[vtkusers] How to draw rectangles using CDC in vtkMFCWindow

Bryn Lloyd lloyd at itis.ethz.ch
Tue Oct 18 09:21:09 EDT 2011


Hi

I think one way to achieve this, would be to pack the code

CPaintDC dc(this);
dc.rectangle(....);

into a subclass of vtkProp. Override the function RenderOpaqueGeometry or
maybe RenderOverlay and place your code inside.

Then add this prop (== actor) to the vtkRenderer.


Have a look at this post:
http://www.vtk.org/pipermail/vtkusers/2008-August/096566.html

Good luck
Bryn









> -----Original Message-----
> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On
> Behalf Of zouchao1112
> Sent: Tuesday, October 18, 2011 12:01 PM
> To: vtkusers at vtk.org
> Subject: [vtkusers] How to draw rectangles using CDC in vtkMFCWindow
> 
> Hi, all
> 
> I  use an inherented class vtkMyMFCWindow from vtkMFCWindow as a child
> window of a view. I setup a pipeline to execute in vtkMyMFCWindow, and
> I
> want to draw something more in this window. So I override the
> vtkMFCWindow::OnPaint() as:
> 
> vtkMyMFCWindow::OnPaint()
> {
> vtkMFCWindow::OnPaint();
> CPaintDC dc(this);
> dc.rectangle(....);
> }
> 
> The image can be shown but the rectangle is overlapped by the
> rendering. I
> can see the rectangle in occasion by updating the rendering window
> continuously. But it is eventually overlapped by the rendering.
> 
> How to solve this problem?
> Thanks for the help!
> 
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/How-to-
> draw-rectangles-using-CDC-in-vtkMFCWindow-tp4913124p4913124.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list