[Paraview] new Source plugin: no show!

B.W.H. van Beest bwvb at xs4all.nl
Sat Oct 4 11:30:37 EDT 2014


Hello,

I need to write a new Source, representing a 'TriPrism",
i.e. a prism where the top and bottom planes are triangles. So far, I
failed.

Being unable to find appropriate documentation, I used the source code
of vtkCubeSource as an example, thinking it would be an easy change.
Wrong! The prism doesn't show on the screen. The
properties panel behaves as expected (and ok, as far I can see).

The member function 'RequestData' seems to be the important method.
But the code of the example (as well as other source examples) is on
closer inspection not clear to me at all.

The following is happening in the vtkCubeSource:

a)   The point of the cube are generated.  This is straightforward and
easily
        translates to the triprism.
       The new points are updated via a call "output->setPoints(
newPoints );"

b)   The normals (to the side planes of the cube) are being calculated.
       The new normals are updated via a call
       "output->GetPointData()->SetNormals(newNormals);"
        This is also straightforward for the triprism, but:

       Q: although calculating the normals is straightforward,
            in which order are they supposed to be given?

c)     Also, texture coordinates (TCoords) are calculated.
         Q: What are these?  Are these mandatory?

d)     Also, a new vtkCellArray is being created. ('newPolys')
          Q: Same question. No clue what I should do here.

As usual, any clue of how to attack this is greatly appreciated.

Bertwim





More information about the ParaView mailing list