attributes of polydata

Patric.Weis at mycrona.de Patric.Weis at mycrona.de
Thu May 11 03:50:01 EDT 2000


Hi Lauren,

try something like this:

    vtkScalars *pScalars = pPolyData->GetPointData()->GetScalars();
    if (pScalars != 0)    // Are there scalars?
    {
        int iNumOfPoints = pPolyData->GetNumberOfPoints();
        int iNumOfScalars = pScalars->GetNumberOfScalars();
        if (iNumOfPoints == iNumOfScalars)    // Does each point have a
scalar?
        {
            ...
        }
    }


Hope this helps!

Patric


Patric Weis
MYCRONA GmbH


- - - Original Message - - -



                                                                                                                                          
                    "Lauren O'Donnell"                                                                                                    
                    <odonnell at ai.mit.edu>          An:     vtkusers at public.kitware.com                                                    
                    Gesendet von:                  Kopie:                                                                                 
                    owner-vtkusers at public.k        Thema:  attributes of polydata                                                         
                    itware.com                                                                                                            
                                                                                                                                          
                                                                                                                                          
                    10.05.00 17:05                                                                                                        
                                                                                                                                          
                                                                                                                                          



Hi,

After I read a .vtk file containing vtkPolyData, is there a way to detect
if there is a scalar value associated with each vertex in the polyData?
(If there are scalars, I want to automatically set ScalarVisibility to On
in the mapper.)

Thanks for your help!

Lauren O'Donnell



--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------




--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list