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

Apply a neighborhood to the vertices on of a unstructured grid data set. More...

#include <vtkvmtkUnstructuredGridNeighborhood.h>

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

Public Types

typedef vtkvmtkNeighborhood Superclass
Public Types inherited from vtkvmtkNeighborhood
typedef vtkvmtkDataSetItem Superclass
Public Types inherited from vtkvmtkDataSetItem
typedef vtkvmtkItem Superclass
Public Types inherited from vtkvmtkItem
typedef vtkObject Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkUnstructuredGridNeighborhood * NewInstance () const
virtual vtkIdType GetItemType () override
virtual void Build () override
Public Member Functions inherited from vtkvmtkNeighborhood
vtkvmtkNeighborhood * NewInstance () const
virtual bool GetIsBoundary ()
vtkIdType GetNumberOfPoints ()
vtkIdType GetPointId (vtkIdType i)
vtkIdType * GetPointer (vtkIdType i)
virtual void DeepCopy (vtkvmtkItem *src) override
Public Member Functions inherited from vtkvmtkDataSetItem
vtkvmtkDataSetItem * NewInstance () const
void SetDataSet (vtkDataSet *dataSet)
vtkDataSet * GetDataSet ()
virtual void SetDataSetPointId (vtkIdType)
virtual vtkIdType GetDataSetPointId ()
virtual void SetReallocateOnBuild (int)
virtual int GetReallocateOnBuild ()
virtual void ReallocateOnBuildOn ()
virtual void ReallocateOnBuildOff ()
Public Member Functions inherited from vtkvmtkItem
vtkvmtkItem * NewInstance () const

Static Public Member Functions

static vtkvmtkUnstructuredGridNeighborhood * New ()
static int IsTypeOf (const char *type)
static vtkvmtkUnstructuredGridNeighborhood * SafeDownCast (vtkObjectBase *o)
Static Public Member Functions inherited from vtkvmtkNeighborhood
static int IsTypeOf (const char *type)
static vtkvmtkNeighborhood * SafeDownCast (vtkObjectBase *o)
Static Public Member Functions inherited from vtkvmtkDataSetItem
static int IsTypeOf (const char *type)
static vtkvmtkDataSetItem * SafeDownCast (vtkObjectBase *o)
Static Public Member Functions inherited from vtkvmtkItem
static int IsTypeOf (const char *type)
static vtkvmtkItem * SafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkUnstructuredGridNeighborhood ()
 ~vtkvmtkUnstructuredGridNeighborhood ()
Protected Member Functions inherited from vtkvmtkNeighborhood
 vtkvmtkNeighborhood ()
 ~vtkvmtkNeighborhood ()
void ResizePointList (vtkIdType ptId, int size)
Protected Member Functions inherited from vtkvmtkDataSetItem
 vtkvmtkDataSetItem ()
 ~vtkvmtkDataSetItem ()
Protected Member Functions inherited from vtkvmtkItem
 vtkvmtkItem ()
 ~vtkvmtkItem ()

Additional Inherited Members

Protected Attributes inherited from vtkvmtkNeighborhood
vtkIdType NPoints
vtkIdType * PointIds
bool IsBoundary
Protected Attributes inherited from vtkvmtkDataSetItem
vtkDataSet * DataSet
vtkIdType DataSetPointId
int ReallocateOnBuild

Detailed Description

Apply a neighborhood to the vertices on of a unstructured grid data set.

Concrete vtkvmtkNeighborhood implementation for a vtkUnstructuredGrid: Build() collects, for the point set via SetDataSetPointId, the ids of every other point sharing a cell with it (its one-ring neighbors in the volumetric mesh).

See also
vtkvmtkNeighborhood, vtkvmtkNeighborhoods

Definition at line 38 of file vtkvmtkUnstructuredGridNeighborhood.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkUnstructuredGridNeighborhood()

vtkvmtkUnstructuredGridNeighborhood::vtkvmtkUnstructuredGridNeighborhood ( )
inlineprotected

Definition at line 53 of file vtkvmtkUnstructuredGridNeighborhood.h.

53{};

◆ ~vtkvmtkUnstructuredGridNeighborhood()

vtkvmtkUnstructuredGridNeighborhood::~vtkvmtkUnstructuredGridNeighborhood ( )
inlineprotected

Definition at line 54 of file vtkvmtkUnstructuredGridNeighborhood.h.

54{};

Member Function Documentation

◆ New()

vtkvmtkUnstructuredGridNeighborhood * vtkvmtkUnstructuredGridNeighborhood::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

Reimplemented from vtkvmtkNeighborhood.

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkUnstructuredGridNeighborhood::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkvmtkNeighborhood.

◆ NewInstance()

vtkvmtkUnstructuredGridNeighborhood * vtkvmtkUnstructuredGridNeighborhood::NewInstance ( ) const

◆ GetItemType()

virtual vtkIdType vtkvmtkUnstructuredGridNeighborhood::GetItemType ( )
inlineoverridevirtual

Get an identifier for the concrete item type (one of the VTK_VMTK_*_NEIGHBORHOOD / VTK_VMTK_*_STENCIL constants), used by owning vtkvmtkItems collections to instantiate the correct subclass.

Implements vtkvmtkItem.

Definition at line 45 of file vtkvmtkUnstructuredGridNeighborhood.h.

@ VTK_VMTK_UNSTRUCTUREDGRID_NEIGHBORHOOD

◆ Build()

void vtkvmtkUnstructuredGridNeighborhood::Build ( )
overridevirtual

Build the neighborhood.

Implements vtkvmtkNeighborhood.

Definition at line 31 of file vtkvmtkUnstructuredGridNeighborhood.cxx.

32{
33 vtkIdType i, j;
34 vtkIdType numCellsInStencil;
35 vtkIdList *cellIds, *ptIds, *stencilIds;
36 vtkUnstructuredGrid* ugdata = vtkUnstructuredGrid::SafeDownCast(this->DataSet);
37
38 if (ugdata==NULL)
39 {
40 vtkErrorMacro(<< "Input data NULL or not poly data");
41 }
42
43 vtkIdType pointId = this->DataSetPointId;
44
45 this->NPoints = 0;
46
47 cellIds = vtkIdList::New();
48 ptIds = vtkIdList::New();
49 stencilIds = vtkIdList::New();
50
51 ugdata->GetPointCells (pointId, cellIds);
52 numCellsInStencil = cellIds->GetNumberOfIds();
53 if (numCellsInStencil < 1)
54 {
55 // vtkWarningMacro("numCellsInStencil < 1: " << numCellsInStencil);
56 cellIds->Delete();
57 ptIds->Delete();
58 stencilIds->Delete();
59 return;
60 }
61
62 vtkIdType cellPointId;
63 for (i=0; i<numCellsInStencil; i++)
64 {
65 if (ugdata->GetCell(cellIds->GetId(i))->GetCellDimension() != 3)
66 {
67 continue;
68 }
69 ugdata->GetCellPoints(cellIds->GetId(i),ptIds);
70 for (j=0; j<ptIds->GetNumberOfIds(); j++)
71 {
72 cellPointId = ptIds->GetId(j);
73 if (cellPointId != pointId)
74 {
75 stencilIds->InsertUniqueId(cellPointId);
76 }
77 }
78 }
79
80 this->NPoints = stencilIds->GetNumberOfIds();
81 if (this->PointIds!=NULL)
82 {
83 delete[] this->PointIds;
84 this->PointIds = NULL;
85 }
86 this->PointIds = new vtkIdType[this->NPoints];
87 memcpy(this->PointIds,stencilIds->GetPointer(0),this->NPoints*sizeof(vtkIdType));
88
89 cellIds->Delete();
90 ptIds->Delete();
91 stencilIds->Delete();
92}

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