VMTK
Loading...
Searching...
No Matches
vtkvmtkDataSetItems Class Reference

Create a collection of data set items, one for every point within the data set. More...

#include <vtkvmtkDataSetItems.h>

Inheritance diagram for vtkvmtkDataSetItems:
[legend]
Collaboration diagram for vtkvmtkDataSetItems:
[legend]

Public Types

typedef vtkvmtkItems Superclass
Public Types inherited from vtkvmtkItems
typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkDataSetItems * NewInstance () const
void Build ()
void SetDataSet (vtkDataSet *dataSet)
vtkDataSet * GetDataSet ()
virtual void SetReallocateOnBuild (int)
virtual int GetReallocateOnBuild ()
virtual void ReallocateOnBuildOn ()
virtual void ReallocateOnBuildOff ()
Public Member Functions inherited from vtkvmtkItems
vtkvmtkItems * NewInstance () const
void Allocate (vtkIdType numItems, vtkIdType ext=1000)
vtkvmtkItem * GetItem (vtkIdType id)
void Squeeze ()
void Reset ()
void Initialize ()
void ReleaseArray ()
void AllocateItem (vtkIdType i, vtkIdType itemType)
void DeepCopy (vtkvmtkItems *src)
void ShallowCopy (vtkvmtkItems *src)
virtual void SetItemType (int)
virtual int GetItemType ()
void SetNumberOfItems (vtkIdType numberOfItems)
vtkIdType GetNumberOfItems ()

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkvmtkDataSetItems * SafeDownCast (vtkObjectBase *o)
Static Public Member Functions inherited from vtkvmtkItems
static int IsTypeOf (const char *type)
static vtkvmtkItems * SafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkDataSetItems ()
 ~vtkvmtkDataSetItems ()
Protected Member Functions inherited from vtkvmtkItems
 vtkvmtkItems ()
 ~vtkvmtkItems ()
virtual vtkvmtkItem * InstantiateNewItem (int itemType)=0
vtkvmtkItem ** Resize (vtkIdType sz)

Protected Attributes

vtkDataSet * DataSet
int ReallocateOnBuild
Protected Attributes inherited from vtkvmtkItems
vtkvmtkItem ** Array
vtkIdType Size
vtkIdType MaxId
vtkIdType Extend
int ItemType

Detailed Description

Create a collection of data set items, one for every point within the data set.

vtkvmtkDataSetItems specializes vtkvmtkItems for the common case where the collection holds exactly one vtkvmtkDataSetItem per point of a vtkDataSet. Build() allocates (if needed) one item per point of DataSet, then, for every point, assigns DataSet and the point id to the corresponding vtkvmtkDataSetItem and calls its Build() method. This is the base class of vtkvmtkNeighborhoods, which uses it to build, for every point of an input data set, the neighborhood item appropriate to the data set type (poly data, unstructured grid, manifold surface, ...).

See also
vtkvmtkItems, vtkvmtkDataSetItem, vtkvmtkNeighborhoods

Definition at line 43 of file vtkvmtkDataSetItems.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkDataSetItems()

vtkvmtkDataSetItems::vtkvmtkDataSetItems ( )
inlineprotected

Definition at line 79 of file vtkvmtkDataSetItems.h.

79{}

◆ ~vtkvmtkDataSetItems()

vtkvmtkDataSetItems::~vtkvmtkDataSetItems ( )
inlineprotected

Definition at line 80 of file vtkvmtkDataSetItems.h.

80{}

Member Function Documentation

◆ IsTypeOf()

int vtkvmtkDataSetItems::IsTypeOf ( const char * type)
static

◆ IsA()

virtual int vtkvmtkDataSetItems::IsA ( const char * type)
virtual

Reimplemented from vtkvmtkItems.

Reimplemented in vtkvmtkNeighborhoods, and vtkvmtkStencils.

◆ SafeDownCast()

vtkvmtkDataSetItems * vtkvmtkDataSetItems::SafeDownCast ( vtkObjectBase * o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkDataSetItems::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkvmtkItems.

Reimplemented in vtkvmtkNeighborhoods, and vtkvmtkStencils.

◆ NewInstance()

vtkvmtkDataSetItems * vtkvmtkDataSetItems::NewInstance ( ) const

◆ SetDataSet()

void vtkvmtkDataSetItems::SetDataSet ( vtkDataSet * dataSet)
inline

Set/get the data set whose points the item collection is built from. The reference is stored but not registered (no reference counting), so the data set must be kept alive by the caller.

Definition at line 56 of file vtkvmtkDataSetItems.h.

56{this->DataSet = dataSet;};

◆ GetDataSet()

vtkDataSet * vtkvmtkDataSetItems::GetDataSet ( )
inline

Set/get the data set whose points the item collection is built from. The reference is stored but not registered (no reference counting), so the data set must be kept alive by the caller.

Definition at line 57 of file vtkvmtkDataSetItems.h.

57{return this->DataSet;};

◆ Build()

void vtkvmtkDataSetItems::Build ( )

Allocate (if not already allocated, or if ReallocateOnBuild is on) one item per point of DataSet, then build each item in turn by assigning it DataSet and its point id and calling its Build() method.

Definition at line 29 of file vtkvmtkDataSetItems.cxx.

30 {
31 vtkIdType numPts;
32 vtkIdType pointId;
33 vtkvmtkDataSetItem *dataSetItem;
34
35 if (this->DataSet==NULL)
36 {
37 vtkErrorMacro(<<"No DataSet specified.");
38 return;
39 }
40
41 numPts = this->DataSet->GetNumberOfPoints();
42
43 if (!this->Array || (this->Array && this->ReallocateOnBuild))
44 {
45 this->Allocate(numPts);
46 this->MaxId = numPts - 1;
47 }
48
49 for (pointId=0; pointId<numPts; pointId++)
50 {
51 dataSetItem = vtkvmtkDataSetItem::SafeDownCast(this->Array[pointId]);
52 if (dataSetItem==NULL)
53 {
54 vtkErrorMacro(<<"Cannot build non-vtkvmtkDataSetItem item.");
55 return;
56 }
57
58 dataSetItem->SetDataSet(this->DataSet);
59 dataSetItem->SetDataSetPointId(pointId);
60 dataSetItem->Build();
61 }
62 }
virtual void Build()=0
virtual void SetDataSetPointId(vtkIdType)
static vtkvmtkDataSetItem * SafeDownCast(vtkObjectBase *o)
void SetDataSet(vtkDataSet *dataSet)
void Allocate(vtkIdType numItems, vtkIdType ext=1000)
vtkIdType MaxId
vtkvmtkItem ** Array

◆ SetReallocateOnBuild()

virtual void vtkvmtkDataSetItems::SetReallocateOnBuild ( int )
virtual

Toggle whether Build() is forced to reallocate the item array even if it has already been built for the current number of points. Propagated to each item's own ReallocateOnBuild flag. Default: off.

◆ GetReallocateOnBuild()

virtual int vtkvmtkDataSetItems::GetReallocateOnBuild ( )
virtual

Toggle whether Build() is forced to reallocate the item array even if it has already been built for the current number of points. Propagated to each item's own ReallocateOnBuild flag. Default: off.

◆ ReallocateOnBuildOn()

virtual void vtkvmtkDataSetItems::ReallocateOnBuildOn ( )
virtual

Toggle whether Build() is forced to reallocate the item array even if it has already been built for the current number of points. Propagated to each item's own ReallocateOnBuild flag. Default: off.

◆ ReallocateOnBuildOff()

virtual void vtkvmtkDataSetItems::ReallocateOnBuildOff ( )
virtual

Toggle whether Build() is forced to reallocate the item array even if it has already been built for the current number of points. Propagated to each item's own ReallocateOnBuild flag. Default: off.

Member Data Documentation

◆ DataSet

vtkDataSet* vtkvmtkDataSetItems::DataSet
protected

Definition at line 82 of file vtkvmtkDataSetItems.h.

◆ ReallocateOnBuild

int vtkvmtkDataSetItems::ReallocateOnBuild
protected

Definition at line 84 of file vtkvmtkDataSetItems.h.


The documentation for this class was generated from the following files: