[vtkusers] Surface and Wireframe Together?

Andrea Gavana andrea.gavana at polymtl.ca
Tue Jul 6 16:57:54 EDT 2004


Thank you Patrick for your interest on my problem. I am not exactly a guru of 
C/C++, but I will try to translate your code in Python language (if I am able 
to do it, of course...).

Does anyone know if there will be some incompatibilities/problems/bugs in using 
the wxVTKRenderWindow in a wxFrame (using wxPython, of course) to show the 3D 
grid and the wireframe together?

Again, when I call my VTK-wxPython application to show the surface, my last 
command is:

renWin.Render()

At this point, I can rotate/pan/zoom the wxFrame/VTK surface, but I can not 
dismiss it (nothing happen if I click on the close (X) icon on the top right). 
I can not close the frame, and the only way to do it is to kill IDLE (or 
pythonwin, is the same). Is there an intelligent way to close the VTK figure 
without quitting Python? 

I am on a win2000 machine with Python 2.3, wxPython 2.4.2.4 and VTK 4.2.

Thanks to you all.

Andrea.
Selon "Gendron, Patrick" <Patrick.Gendron at imi.cnrc-nrc.gc.ca>:

> It should be working by using only two different actor, one for the Surface
> and an other one for the wireframe
> Calling: (in C++)
> ActorSurf->GetProperty()->SetRepresentationToSurface();
> ActorEdge->GetProperty()->SetRepresentationToWireframe();
> 
> Personally, I prefer using it with 2 different Mapper, because it allows me
> to stop the flickering between Surfaces and Wireframe.
> 
> MapperSurf->SetResolveCoincidentTopologyPolygonOffsetParameters(0,1);
> MapperSurf->SetResolveCoincidentTopologyToPolygonOffset();
> MapperEdge->SetResolveCoincidentTopologyPolygonOffsetParameters(1,1);
> MapperEdge->SetResolveCoincidentTopologyToPolygonOffset();
> //
> // Same color for inside and outside edges
> // ---------------------------------------
> MapperEdge->ScalarVisibilityOff();
> ActorEdge->GetProperty()->SetAmbient(1.0);
> ActorEdge->GetProperty()->SetDiffuse(0.0);
> ActorEdge->GetProperty()->SetSpecular(0.0);
> 
> Patrick.
> 
>  -----Original Message-----
> From: 	vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org]  On 
Behalf
> Of Andrea Gavana
> Sent:	Tuesday, July 06, 2004 4:09 PM
> To:	vtkusers at vtk.org
> Subject:	[vtkusers] Surface and Wireframe Together?
> 
> Hello NG,
> 
>       I have a 3D structured grid, which I can easily visualize using VTK in
> 
> Python. My problem is that I would like to visualize also the Wireframe of
> this 
> grid, in order to see the grid cells. I've tried to use 2 actors in order to
> 
> display them on the same frame, but I'm not able to obtain it.
> 
> I do not have Python here at home, so I can not check the code. But
> basically, 
> what I do is:
> 
> act1 = vtkpython.vtkActor()
> act2 = vtkpython.vtkActor()
> 
> # Other stuff here (Sorry I do not have the source code nor Python at
> home...)
> 
> act2.GetOutput().SetRepresentationToWireframe()  
> 
> # Then on the rendering window
> 
> renWin.AddActor(act1)
> renWin.AddActor(act2)
> 
> 
> I also would like to display the wireframe with a unique color (say black),
> to 
> have a representatio of the 3D grid with cell corners, faces and so on.
> 
> Could please someone post a simple example on how to accomplish these tasks
> in 
> Python?
> 
> Thank you all for your help.
> 
> Andrea.
> _______________________________________________
> 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