[vtkusers] 2D Surface Plot - how to get "outlines"?
David Gobbi
david.gobbi at gmail.com
Mon Feb 15 13:44:10 EST 2010
You can try using vtkMarchingSquares on your structured points. It
can generate a series of contours. Then you can use vtkStripper to
ensure that each contour is a continuous polyline. It would be up to
your GDI code to render these polylines as filled areas and to make
sure that larger areas don't hide smaller, internal areas. Or, you
could just render the polylines directly, if your surface plot doesn't
require filled areas.
David
On Mon, Feb 15, 2010 at 10:48 AM, Johnson, Mike (IS)
<michael.l.johnson at ngc.com> wrote:
> Hi all! VTK newbie here. I work on an application that plots various data
> to a normal Wndows bitmap (lines, circles, etc) I am now using VTK to
> generate a surface plot for a set of data that needs to be plotted to the
> bitmap. This means I am not using any kind of VTK rendering engine or
> OpenGL or anything like that. Also note that this is all in 2D space, so
> probably much simpler than what most of the folks deal with here on a
> day-to-day basis J Here’s how my pipeline looks:
>
> Structured points -> Threshold -> Geometry Filter -> Poly Data Mapper
>
> (The structured points is basically the “grid of data points” which the
> geometry filter and poly data mapper generate poly data from.)
>
> I then take the output polys from the poly data mapper and “draw” those on
> my bitmap using plain GDI calls in Windows. This all works well. However,
> my problem now is that my data ends up generating around 250,000 small
> “squares” (seems to be one square per data point; my grid is around
> 500x500). Since I am not using any kind of hardware-accelerated rendering
> pipeline, it takes quite a while to render these squares. In my object,
> lots of the squares sitting next to each other have the same data value (and
> hence the same rendering color), so I was hoping that there would be some
> way to “combine” the adjacent squares of the same color into larger polygons
> so that I can decrease the # of polygons I must render from ~250,000 to a
> much smaller #. Or is there some way to tell VTK to give me the traces of
> the outlines of the areas with the same color? In general, I am trying to
> vastly reduce the # of polygons to draw in order to speed up the rendering
> of my bitmap, yet still keeping the same representation (ie, I don’t want it
> to lose any detail). Any suggestions?
>
> Thanks in advance,
> Mike Johnson
>
> _______________________________________________
> 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