[vtkusers] Edges and Solids

Sean McInerney seanm at nmr.mgh.harvard.edu
Tue Jul 27 13:22:58 EDT 2004


vtkProperty does have Get/SetEdgeVisibility methods, though they are not 
implemented beyond possessing the ivar EdgeVisibility. The code that you 
provided could probably be integrated into vtkProperty (for the edge 
material properties) and vtkMapper (vtkOpenGLPolyDataMapper).

Currently, you will need to use two actors to do what you ask. One actor 
contains your original surface while a second contains the edges (via 
vtkExtractEdges). Use the mapper's SetResolveCoincidentTopology to do 
the polygon offsetting.

A third possibility which I have not tested and may not work *could* use 
only one display list with the current VTK implementation. Try 
terminating your pipeline with a single Mapper (handles the display 
list), but pass the Mapper to two separate Actors possessing 
vtkProperties for Surface and Wireframe, respectively. It just might work!

-Sean

vtk at scil.sinp.msu.ru wrote:
> Hi!
> Problem with solid/combined images still remains, or I miss something?
> If miss, how can I do wireframe and solid picture at the same time?
> Idea of double actors is not very comfortable....
> 
> If we are using OpenGL (I think, most of VTK users are using it), OpenGL
> can render glCallList for the same list for solid and offset poly.
> Code looks like (why not to do in such a manner?) this:
> -----------------------------------------
> glDepthMask (GL_FALSE);
> glEnable (GL_BLEND);
> glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
> glEnable(GL_POLYGON_OFFSET_FILL);
> glPolygonOffset(factor, units);
> glCallList(poly);
> glDisable(GL_POLYGON_OFFSET_FILL);
> glBlendFunc (GL_SRC_ALPHA, GL_ONE);
> glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
> glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, Gray);
> glMaterialfv(GL_FRONT, GL_SPECULAR, Black);
> glMaterialf(GL_FRONT, GL_SHININESS, 0.0);
> glMaterialfv(GL_BACK, GL_AMBIENT_AND_DIFFUSE, BGray);
> glMaterialfv(GL_BACK, GL_SPECULAR, BBlack);
> glMaterialf(GL_BACK, GL_SHININESS, 0.0);
> glLineWidth (1.0);
> glCallList(poly);
> glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
> glDepthMask (GL_TRUE);
> glDisable (GL_BLEND);
> ------------------------------------------
> 
> Calling a list in OGL have very little overhead. But it is not good to 
> have double amount of lists.
> 
> Thanx!
> 
> _______________________________________________
> This is the private VTK discussion list. Please keep messages on-topic. 
> Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 



More information about the vtkusers mailing list