VMTK
Loading...
Searching...
No Matches
vtkvmtkNeighborhood Class Referenceabstract

Query the neighborhood surrounding the set point id in an data set item. More...

#include <vtkvmtkNeighborhood.h>

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

Public Types

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)
vtkvmtkNeighborhood * NewInstance () const
virtual bool GetIsBoundary ()
vtkIdType GetNumberOfPoints ()
vtkIdType GetPointId (vtkIdType i)
vtkIdType * GetPointer (vtkIdType i)
virtual void Build () override=0
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
virtual vtkIdType GetItemType ()=0

Static Public Member Functions

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
 vtkvmtkNeighborhood ()
 ~vtkvmtkNeighborhood ()
void ResizePointList (vtkIdType ptId, int size)
Protected Member Functions inherited from vtkvmtkDataSetItem
 vtkvmtkDataSetItem ()
 ~vtkvmtkDataSetItem ()
Protected Member Functions inherited from vtkvmtkItem
 vtkvmtkItem ()
 ~vtkvmtkItem ()

Protected Attributes

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

Detailed Description

Query the neighborhood surrounding the set point id in an data set item.

vtkvmtkNeighborhood is the abstract base class for a data-set item representing the set of point ids topologically adjacent to DataSetPointId (a "1-ring" or similar local neighborhood, depending on the concrete subclass – e.g. poly data cell-adjacency, or manifold-surface vertex rings). Build() (implemented by subclasses) fills PointIds with the NPoints neighboring point ids and sets IsBoundary if DataSetPointId lies on a mesh boundary. Instances are normally created and owned in bulk by a vtkvmtkNeighborhoods collection, one per point of a data set, and consumed by finite-difference/finite-element stencil classes (see vtkvmtkStencil) to compute derivative weights.

See also
vtkvmtkNeighborhoods, vtkvmtkDataSetItem, vtkvmtkStencil

Definition at line 43 of file vtkvmtkNeighborhood.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkNeighborhood()

vtkvmtkNeighborhood::vtkvmtkNeighborhood ( )
protected

Definition at line 27 of file vtkvmtkNeighborhood.cxx.

28 {
29 this->NPoints = 0;
30 this->PointIds = NULL;
31 this->IsBoundary = false;
32 }

◆ ~vtkvmtkNeighborhood()

vtkvmtkNeighborhood::~vtkvmtkNeighborhood ( )
protected

Definition at line 34 of file vtkvmtkNeighborhood.cxx.

35 {
36 if (this->PointIds != NULL)
37 {
38 delete [] this->PointIds;
39 this->PointIds = NULL;
40 }
41 }

Member Function Documentation

◆ IsTypeOf()

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

◆ IsA()

◆ SafeDownCast()

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

◆ NewInstanceInternal()

◆ NewInstance()

vtkvmtkNeighborhood * vtkvmtkNeighborhood::NewInstance ( ) const

◆ GetIsBoundary()

virtual bool vtkvmtkNeighborhood::GetIsBoundary ( )
virtual

Get whether DataSetPointId lies on a boundary of the data set (meaning, for concrete subclasses, that it does not have a full/closed neighborhood). Valid only after Build() has been called.

◆ GetNumberOfPoints()

vtkIdType vtkvmtkNeighborhood::GetNumberOfPoints ( )
inline

Get the number of neighboring point ids stored in this neighborhood. Valid only after Build() has been called.

Definition at line 60 of file vtkvmtkNeighborhood.h.

60{return this->NPoints;};

◆ GetPointId()

vtkIdType vtkvmtkNeighborhood::GetPointId ( vtkIdType i)
inline

Get the i-th neighboring point id (0 <= i < GetNumberOfPoints()).

Definition at line 65 of file vtkvmtkNeighborhood.h.

65{return this->PointIds[i];};

◆ GetPointer()

vtkIdType * vtkvmtkNeighborhood::GetPointer ( vtkIdType i)
inline

Get a pointer into the internal point id array starting at index i, e.g. for passing a contiguous run of ids to a VTK API expecting a raw vtkIdType array.

Definition at line 71 of file vtkvmtkNeighborhood.h.

71{return this->PointIds+i;};

◆ Build()

◆ DeepCopy()

void vtkvmtkNeighborhood::DeepCopy ( vtkvmtkItem * src)
overridevirtual

Standard DeepCopy method.

Reimplemented from vtkvmtkDataSetItem.

Reimplemented in vtkvmtkStencil.

Definition at line 59 of file vtkvmtkNeighborhood.cxx.

60 {
61 this->Superclass::DeepCopy(src);
62
64
65 if (neighborhoodSrc==NULL)
66 {
67 vtkErrorMacro(<<"Trying to deep copy a non-stencil item");
68 }
69
70 this->NPoints = neighborhoodSrc->NPoints;
71
72 if (this->PointIds != NULL)
73 {
74 delete [] this->PointIds;
75 this->PointIds = NULL;
76 }
77
78 if (neighborhoodSrc->NPoints>0)
79 {
80 this->PointIds = new vtkIdType[neighborhoodSrc->NPoints];
81 memcpy(this->PointIds, neighborhoodSrc->PointIds, this->NPoints * sizeof(vtkIdType));
82 }
83
84 this->IsBoundary = neighborhoodSrc->IsBoundary;
85 }
virtual void DeepCopy(vtkvmtkItem *src) override
static vtkvmtkNeighborhood * SafeDownCast(vtkObjectBase *o)

◆ ResizePointList()

void vtkvmtkNeighborhood::ResizePointList ( vtkIdType ptId,
int size )
protected

Definition at line 43 of file vtkvmtkNeighborhood.cxx.

44 {
45 int newSize;
46 vtkIdType *pointIds;
47
48 newSize = this->NPoints + size;
49 pointIds = new vtkIdType[newSize];
50 memcpy(pointIds, this->PointIds,this->NPoints*sizeof(vtkIdType));
51 delete [] this->PointIds;
52 this->PointIds = NULL;
53
54 this->PointIds = pointIds;
55
56 this->NPoints = newSize;
57 }

Member Data Documentation

◆ NPoints

vtkIdType vtkvmtkNeighborhood::NPoints
protected

Definition at line 89 of file vtkvmtkNeighborhood.h.

◆ PointIds

vtkIdType* vtkvmtkNeighborhood::PointIds
protected

Definition at line 90 of file vtkvmtkNeighborhood.h.

◆ IsBoundary

bool vtkvmtkNeighborhood::IsBoundary
protected

Definition at line 91 of file vtkvmtkNeighborhood.h.


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