[Paraview] cast from vtkDataSet to subclasses

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Sep 9 08:20:40 EDT 2008


try this:

#include "vtkStructuredGrid.h"
#include "vtkRectilinearGrid.h"

vtkDataSet* ds = ...

vtkStructuredGrid* sg = vtkStructuredGrid::SafeDownCast(ds);
if (sg)
   {
   ...
   }
vtkRectilinearGrid* rg = vtkRectilinearGrid::SafeDownCast(ds);
if (rg)
   {
   ...
   }

etc.

Utkarsh

Natalie Happenhofer wrote:
> Hi!
> Is there any possibility to cast from vtkDataSet to vtkRectilinearGrid 
> or vtkStructuredGrid,....?
> I´m writing a filter which should input vtkDataSet, it´s to say I have 
> RectilinearGrid, StructuredGrid and StructuredPoint files with which the 
> filter should work.
> I need to extract the dimensions from these DataSets, i.e use 
> "GetDimensions(dims)" to implement my algorithm, so that´s why I´d need 
> the downcast..
> or is there any other possibility to get the dimensions of the input 
> Dataset?
> 
> thx,
> NH
> 
> ------------------------------------------------------------------------
> Express yourself instantly with MSN Messenger! MSN Messenger 
> <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview


More information about the ParaView mailing list