[vtkusers] Stupid Mistake? Color a pointcloud...

Fabian fabian-richter at gmx.de
Thu Sep 22 03:34:39 EDT 2011


Dear vtk-users,

I have a large file with geometry data and color data (lets say a colored
pointcloud)

Now I want to visualize it. To get the geometry -> No Problem! (looks pretty
nice!)
But when I want to assign the color values to the points I just fail! :(

I tried to work with some examples:
1) the colored point example "enlarges" my points (sets vertices?!) so they
all are tiny squares. Thus I cannot use the visualization because it is
getting blurred. (Example:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColoredPoints)

2) I found quite the same problem discussed here some time ago. There is
given this example:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/VTKConcepts/Scalars
But when I try to use this method, my compiler (visual studio 2010) say
"pointer to incomplete class is not allowed!" when I try to set a
vtkDoubleArray as scalar values.

Looks like this:

vtkSmartPointer<vtkDoubleArray>				PointCloudColors	=
vtkSmartPointer<vtkDoubleArray>::New();

[Set all the points in polydata, set all the colors (it is in the same loop
so I am pretty sure, that the numbers of values are equal)]

PointCloudPolyData	->SetPoints(PointCloudPoints);
PointCloudPolyData	->SetVerts(PointCloudCellArray);
PointCloudPolyData	->GetPointData()->SetScalars(Colors); //here comes
"pointer to incomplete" error

Now this could mean two things:
Either I didnt understand the concept or I just did a stupid mistake! In
both cases I need Your help!

Thanks a lot,
Fabian
 

--
View this message in context: http://vtk.1045678.n5.nabble.com/Stupid-Mistake-Color-a-pointcloud-tp4829262p4829262.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list