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

Apply a an extended neighborhood to the points of a manifold surface. More...

#include <vtkvmtkPolyDataManifoldExtendedNeighborhood.h>

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

Public Types

typedef vtkvmtkPolyDataManifoldNeighborhood Superclass
Public Types inherited from vtkvmtkPolyDataManifoldNeighborhood
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)
vtkvmtkPolyDataManifoldExtendedNeighborhood * NewInstance () const
virtual vtkIdType GetItemType () override
virtual void Build () override
Public Member Functions inherited from vtkvmtkPolyDataManifoldNeighborhood
vtkvmtkPolyDataManifoldNeighborhood * NewInstance () const
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 vtkvmtkPolyDataManifoldExtendedNeighborhood * New ()
static int IsTypeOf (const char *type)
static vtkvmtkPolyDataManifoldExtendedNeighborhood * SafeDownCast (vtkObjectBase *o)
Static Public Member Functions inherited from vtkvmtkPolyDataManifoldNeighborhood
static vtkvmtkPolyDataManifoldNeighborhood * New ()
static int IsTypeOf (const char *type)
static vtkvmtkPolyDataManifoldNeighborhood * 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
 vtkvmtkPolyDataManifoldExtendedNeighborhood ()
 ~vtkvmtkPolyDataManifoldExtendedNeighborhood ()
Protected Member Functions inherited from vtkvmtkPolyDataManifoldNeighborhood
 vtkvmtkPolyDataManifoldNeighborhood ()
 ~vtkvmtkPolyDataManifoldNeighborhood ()
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 an extended neighborhood to the points of a manifold surface.

vtkvmtkPolyDataManifoldExtendedNeighborhood extends vtkvmtkPolyDataManifoldNeighborhood by enlarging the interior (non-boundary) one-ring neighborhood of a point when the ring only has 3 or 4 points: for each edge of the ring whose two incident triangles both lie on the "outward" side of the edge relative to the center point (tested via a dot-product sign check on the edge and the two candidate outer points), the extra point across that edge is appended to the neighborhood. This produces a wider (extended) stencil support, which is used, e.g., by vtkvmtkPolyDataFELaplaceBeltramiStencil / vtkvmtkPolyDataFVFELaplaceBeltramiStencil (via vtkvmtkPolyDataManifoldStencil::UseExtendedNeighborhood) to improve the accuracy of Laplace-Beltrami weight computation on coarse or nearly-degenerate meshes.

See also
vtkvmtkPolyDataManifoldNeighborhood, vtkvmtkPolyDataManifoldStencil

Definition at line 45 of file vtkvmtkPolyDataManifoldExtendedNeighborhood.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkPolyDataManifoldExtendedNeighborhood()

vtkvmtkPolyDataManifoldExtendedNeighborhood::vtkvmtkPolyDataManifoldExtendedNeighborhood ( )
inlineprotected

Definition at line 60 of file vtkvmtkPolyDataManifoldExtendedNeighborhood.h.

60{};

◆ ~vtkvmtkPolyDataManifoldExtendedNeighborhood()

vtkvmtkPolyDataManifoldExtendedNeighborhood::~vtkvmtkPolyDataManifoldExtendedNeighborhood ( )
inlineprotected

Definition at line 61 of file vtkvmtkPolyDataManifoldExtendedNeighborhood.h.

61{};

Member Function Documentation

◆ New()

vtkvmtkPolyDataManifoldExtendedNeighborhood * vtkvmtkPolyDataManifoldExtendedNeighborhood::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkPolyDataManifoldExtendedNeighborhood::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkPolyDataManifoldExtendedNeighborhood * vtkvmtkPolyDataManifoldExtendedNeighborhood::NewInstance ( ) const

◆ GetItemType()

virtual vtkIdType vtkvmtkPolyDataManifoldExtendedNeighborhood::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.

Reimplemented from vtkvmtkPolyDataManifoldNeighborhood.

Definition at line 52 of file vtkvmtkPolyDataManifoldExtendedNeighborhood.h.

◆ Build()

void vtkvmtkPolyDataManifoldExtendedNeighborhood::Build ( )
overridevirtual

Build the neighborhood.

Reimplemented from vtkvmtkPolyDataManifoldNeighborhood.

Definition at line 32 of file vtkvmtkPolyDataManifoldExtendedNeighborhood.cxx.

33 {
34 vtkIdType i, j, k;
35 vtkIdType p, p1, p2, outerP;
36 vtkIdType pointId;
37 double outerPoint[3], point1[3], point2[3];
38 double edgeVector[3], outerVector1[3], outerVector2[3];
39 vtkIdList *cellIds, *ptIds, *extendedStencilIds;
40 vtkCell* cell;
41 vtkPolyData* pdata = vtkPolyData::SafeDownCast(this->DataSet);
42
43 if (pdata==NULL)
44 {
45 vtkErrorMacro(<< "Input data NULL or not poly data");
46 }
47
48 pointId = this->DataSetPointId;
49
50 this->Superclass::Build();
51
52 cellIds = vtkIdList::New();
53 ptIds = vtkIdList::New();
54 extendedStencilIds = vtkIdList::New();
55
56 if (!this->IsBoundary)
57 {
58 if ((this->NPoints==3)||(this->NPoints==4))
59 {
60 for (i=0; i<this->NPoints; i++)
61 {
62 extendedStencilIds->InsertNextId(this->PointIds[i]);
63
64 p1 = this->PointIds[i];
65 p2 = this->PointIds[(i+1)%this->NPoints];
66 pdata->GetCellEdgeNeighbors (-1, p1, p2, cellIds);
67 if (cellIds->GetNumberOfIds()>1)
68 {
69 outerP = -1;
70 for (j=0; j<2; j++)
71 {
72 cell = pdata->GetCell(cellIds->GetId(j));
73 for (k=0; k<3; k++)
74 {
75 p = cell->GetPointId(k);
76 if (p!=pointId && p!=p1 && p!=p2)
77 {
78 outerP = p;
79 break;
80 }
81 }
82 if (outerP != -1)
83 {
84 break;
85 }
86 }
87
88 pdata->GetPoint(p1,point1);
89 pdata->GetPoint(p2,point2);
90 pdata->GetPoint(outerP,outerPoint);
91 edgeVector[0] = point1[0] - point2[0];
92 edgeVector[1] = point1[1] - point2[1];
93 edgeVector[2] = point1[2] - point2[2];
94 outerVector1[0] = outerPoint[0] - point1[0];
95 outerVector1[1] = outerPoint[1] - point1[1];
96 outerVector1[2] = outerPoint[2] - point1[2];
97 outerVector2[0] = outerPoint[0] - point2[0];
98 outerVector2[1] = outerPoint[1] - point2[1];
99 outerVector2[2] = outerPoint[2] - point2[2];
100
101 if (vtkMath::Dot(edgeVector,outerVector1)*vtkMath::Dot(edgeVector,outerVector2) < 0.0)
102 extendedStencilIds->InsertNextId(outerP);
103 }
104 }
105
106 this->NPoints = extendedStencilIds->GetNumberOfIds();
107 if (this->PointIds!=NULL)
108 {
109 delete[] this->PointIds;
110 this->PointIds = NULL;
111 }
112 this->PointIds = new vtkIdType[this->NPoints];
113 memcpy(this->PointIds,extendedStencilIds->GetPointer(0),this->NPoints*sizeof(vtkIdType));
114 }
115 }
116
117 cellIds->Delete();
118 ptIds->Delete();
119 extendedStencilIds->Delete();
120}

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