[vtkusers] help displaying a set of points
wind
wind at climate.gsfc.nasa.gov
Thu Feb 22 09:50:39 EST 2007
I figured it out, whatever it was. This code did it, even though I
swear I tried this before
vtkPolyData* pd1 = vtkPolyData::New();
pd1->SetPoints(flight_track);
pd1->GetPointData()->SetScalars(scalars);
pd1->Update();
vtkMaskPoints* mp = vtkMaskPoints::New();
mp->SetInput(pd1);
mp->GenerateVerticesOn();
vtkPolyDataMapper *popMapper = vtkPolyDataMapper::New();
popMapper->SetInput(mp->GetOutput());
popMapper->ScalarVisibilityOn();
popMapper->SetScalarRange(21.59, 3369.36);
popMapper->Update();
vtkActor *popActor = vtkActor::New();
popActor->SetMapper(popMapper);
popActor->GetProperty()->SetRepresentationToPoints();
popActor->GetProperty()->SetPointSize(1.0);
This is the result of this little madness

> Hi Gala,
>
> Does your vtkUnstructuredGrid dataset have vertex cells in it, or
> only points? In order for VTK to display points, you have to create
> a vertex cell for each point. You can either do that when you
> create the unstructured grid, or you can use vtkGlyph3D filter
> (http://www.vtk.org/doc/nightly/html/classvtkGlyph3D.html) to do it.
>
> - Amy
>
> wind wrote:
>> I did that and still nothing.
>> On Feb 21, 2007, at 8:34 PM, Michael Rice wrote:
>>
>>> You probably need to set the Actor properties to display as points:
>>>
>>> actor->GetPropery()->SetRepresentationToPoints()
>>>
>>> If you've assigned scalars, then you need to turn those on too:
>>>
>>> mapper->ScalarVisibilityOn()
>>>
>>> Michael
>>>
>>> On Feb 21, 2007, at 2:17 PM, wind wrote:
>>>
>>>> Hello,
>>>>
>>>> I have a dataset that consists of XYZ point coordinates and one
>>>> scalar at each point. I want to display the points as individual
>>>> points, not a surface, not a wireframe, nothing. The points are
>>>> not related to each other, so I don't want to do anything to
>>>> connect them explicitly. I've tried just about every combination
>>>> of vtkUnstructuredGrid, vtkDataSetMapper and what not and I
>>>> still end up with a blank screen. I know the data is there and
>>>> read in correctly. I have the vtkPoints object and the
>>>> vtkFloatArray for scalars.
>>>>
>>>> Thanks,
>>>>
>>>> -- Gala
>>>>
>>>> Gala Wind
>>>> (301) 614-6221
>>>> wind at climate.gsfc.nasa.gov <mailto:wind at climate.gsfc.nasa.gov>
>>>> Code 613.2, Climate and Radiation
>>>> SSAI, Inc.
>>>> NASA/GSFC
>>>> Greenbelt, MD 20771
>>>>
>>>> /
>>>> *------------------------------------------------------------------
>>>> --
>>>> -- There's always a way, you just have to find it.
>>>> ( B. Hambly "Children of the Jedi" )
>>>> -------------------------------------------------------------------
>>>> ---*/
>>>>
>>>>
>>>> _______________________________________________
>>>> This is the private VTK discussion list.
>>>> Please keep messages on-topic. Check the FAQ at: http://
>>>> www.vtk.org/Wiki/VTK_FAQ
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>
>> Gala Wind
>>
>> (301) 614-6221
>>
>> wind at climate.gsfc.nasa.gov <mailto:wind at climate.gsfc.nasa.gov>
>>
>> Code 613.2, Climate and Radiation
>>
>> SSAI, Inc.
>>
>> NASA/GSFC
>>
>> Greenbelt, MD 20771
>>
>>
>> /
>> *--------------------------------------------------------------------
>>
>> -- There's always a way, you just have to find it.
>>
>> ( B. Hambly "Children of the Jedi" )
>>
>> ---------------------------------------------------------------------
>> -*/
>>
>>
>>
>> ---------------------------------------------------------------------
>> ---
>>
>> _______________________________________________
>> This is the private VTK discussion list. Please keep messages on-
>> topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
> --
> Amy Squillacote
> Kitware, Inc.
> 28 Corporate Drive
> Clifton Park, NY 12065
> Phone: (518) 371-3971 x106
>
>
Gala Wind
(301) 614-6221
wind at climate.gsfc.nasa.gov
Code 613.2, Climate and Radiation
SSAI, Inc.
NASA/GSFC
Greenbelt, MD 20771
/*--------------------------------------------------------------------
-- There's always a way, you just have to find it.
( B. Hambly "Children of the Jedi" )
----------------------------------------------------------------------*/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070222/b1dc8c6c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flight_track.tiff
Type: image/tiff
Size: 15482 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070222/b1dc8c6c/attachment.tiff>
More information about the vtkusers
mailing list