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

Apply umbrella (laplacian) weighting to the neighborhood connections of a surface. More...

#include <vtkvmtkPolyDataAreaWeightedUmbrellaStencil.h>

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

Public Types

typedef vtkvmtkPolyDataManifoldStencil Superclass
Public Types inherited from vtkvmtkPolyDataManifoldStencil
typedef vtkvmtkStencil Superclass
Public Types inherited from vtkvmtkStencil
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)
vtkvmtkPolyDataAreaWeightedUmbrellaStencil * NewInstance () const
virtual vtkIdType GetItemType () override
void Build () override
Public Member Functions inherited from vtkvmtkPolyDataManifoldStencil
vtkvmtkPolyDataManifoldStencil * NewInstance () const
virtual double GetArea ()
virtual void ComputeArea ()
void DeepCopy (vtkvmtkPolyDataManifoldStencil *src)
virtual int GetUseExtendedNeighborhood ()
virtual void SetUseExtendedNeighborhood (int)
virtual void UseExtendedNeighborhoodOn ()
virtual void UseExtendedNeighborhoodOff ()
Public Member Functions inherited from vtkvmtkStencil
vtkvmtkStencil * NewInstance () const
vtkIdType GetNumberOfWeights ()
void ScaleWeights (double factor)
const double * GetCenterWeightTuple ()
virtual void DeepCopy (vtkvmtkItem *src) override
virtual void SetNumberOfComponents (vtkIdType)
virtual vtkIdType GetNumberOfComponents ()
double GetWeight (vtkIdType i)
void SetWeight (vtkIdType i, double weight)
double GetWeight (vtkIdType i, vtkIdType component)
void SetWeight (vtkIdType i, vtkIdType component, double weight)
double GetCenterWeight ()
void SetCenterWeight (double weight)
double GetCenterWeight (vtkIdType component)
void SetCenterWeight (vtkIdType component, double weightComponent)
virtual void SetWeightScaling (int)
virtual int GetWeightScaling ()
virtual void WeightScalingOn ()
virtual void WeightScalingOff ()
virtual void SetNegateWeights (int)
virtual int GetNegateWeights ()
virtual void NegateWeightsOn ()
virtual void NegateWeightsOff ()
Public Member Functions inherited from vtkvmtkNeighborhood
vtkvmtkNeighborhood * NewInstance () const
virtual bool GetIsBoundary ()
vtkIdType GetNumberOfPoints ()
vtkIdType GetPointId (vtkIdType i)
vtkIdType * GetPointer (vtkIdType i)
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 vtkvmtkPolyDataAreaWeightedUmbrellaStencil * New ()
static int IsTypeOf (const char *type)
static vtkvmtkPolyDataAreaWeightedUmbrellaStencil * SafeDownCast (vtkObjectBase *o)
Static Public Member Functions inherited from vtkvmtkPolyDataManifoldStencil
static int IsTypeOf (const char *type)
static vtkvmtkPolyDataManifoldStencil * SafeDownCast (vtkObjectBase *o)
Static Public Member Functions inherited from vtkvmtkStencil
static int IsTypeOf (const char *type)
static vtkvmtkStencil * 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
 vtkvmtkPolyDataAreaWeightedUmbrellaStencil ()
 ~vtkvmtkPolyDataAreaWeightedUmbrellaStencil ()
void ScaleWithArea () override
Protected Member Functions inherited from vtkvmtkPolyDataManifoldStencil
 vtkvmtkPolyDataManifoldStencil ()
 ~vtkvmtkPolyDataManifoldStencil ()
void ScaleWithAreaFactor (double factor)
Protected Member Functions inherited from vtkvmtkStencil
 vtkvmtkStencil ()
 ~vtkvmtkStencil ()
void ResizePointList (vtkIdType ptId, int size)
void ChangeWeightSign ()
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 vtkvmtkPolyDataManifoldStencil
double Area
int UseExtendedNeighborhood
Protected Attributes inherited from vtkvmtkStencil
vtkIdType NumberOfComponents
double * Weights
double * CenterWeight
int WeightScaling
int NegateWeights
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 umbrella (laplacian) weighting to the neighborhood connections of a surface.

vtkvmtkPolyDataAreaWeightedUmbrellaStencil builds, for each mesh point, a discrete Laplacian (umbrella-operator) stencil over its one-ring neighborhood, in which every neighbor initially receives an equal weight (1/N) and is then re-weighted by the area of the two triangles incident to the edge connecting it to the center point (see vtkvmtkMath::TriangleArea), summed into CenterWeight/Area, and finally scaled by ScaleWithArea and sign-flipped so it approximates the surface Laplace operator. It is one of the stencil types selectable through vtkvmtkStencils and vtkvmtkPolyDataMeanCurvature (VTK_VMTK_AREA_WEIGHTED_UMBRELLA_STENCIL) for mesh smoothing and curvature estimation.

See also
vtkvmtkPolyDataManifoldStencil, vtkvmtkStencils, vtkvmtkPolyDataMeanCurvature

Definition at line 43 of file vtkvmtkPolyDataAreaWeightedUmbrellaStencil.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkPolyDataAreaWeightedUmbrellaStencil()

vtkvmtkPolyDataAreaWeightedUmbrellaStencil::vtkvmtkPolyDataAreaWeightedUmbrellaStencil ( )
protected

◆ ~vtkvmtkPolyDataAreaWeightedUmbrellaStencil()

vtkvmtkPolyDataAreaWeightedUmbrellaStencil::~vtkvmtkPolyDataAreaWeightedUmbrellaStencil ( )
inlineprotected

Definition at line 56 of file vtkvmtkPolyDataAreaWeightedUmbrellaStencil.h.

56{};

Member Function Documentation

◆ New()

vtkvmtkPolyDataAreaWeightedUmbrellaStencil * vtkvmtkPolyDataAreaWeightedUmbrellaStencil::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

Reimplemented from vtkvmtkPolyDataManifoldStencil.

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkPolyDataAreaWeightedUmbrellaStencil::NewInstanceInternal ( ) const
protectedvirtual

Reimplemented from vtkvmtkPolyDataManifoldStencil.

◆ NewInstance()

vtkvmtkPolyDataAreaWeightedUmbrellaStencil * vtkvmtkPolyDataAreaWeightedUmbrellaStencil::NewInstance ( ) const

◆ GetItemType()

virtual vtkIdType vtkvmtkPolyDataAreaWeightedUmbrellaStencil::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 50 of file vtkvmtkPolyDataAreaWeightedUmbrellaStencil.h.

@ VTK_VMTK_AREA_WEIGHTED_UMBRELLA_STENCIL

◆ Build()

void vtkvmtkPolyDataAreaWeightedUmbrellaStencil::Build ( )
overridevirtual

Build the stencil.

Reimplemented from vtkvmtkPolyDataManifoldStencil.

Definition at line 35 of file vtkvmtkPolyDataAreaWeightedUmbrellaStencil.cxx.

36{
37 this->Superclass::Build();
38
39 for (vtkIdType i=0; i<this->NPoints; i++)
40 {
41 this->Weights[i] = 1.0/double(this->NPoints);
42 }
43
44 vtkPolyData* pdata = vtkPolyData::SafeDownCast(this->DataSet);
45
46 int j;
47 for (j=0; j<this->NPoints; j++)
48 {
49 this->Weights[j] = 0.0;
50 }
51
52 double point[3], point1[3], point2[3];
53// double vector[3], vector1[3], vector2[3];
54// double dot = 0.0;
55
56 pdata->GetPoint(this->DataSetPointId,point);
57
58// for (j=0; j<this->NPoints; j++)
59// {
60// pdata->GetPoint(this->PointIds[j],point1);
61// pdata->GetPoint(this->PointIds[(j+1)%this->NPoints],point2);
62// vector[0] = point2[0] - point1[0];
63// vector[1] = point2[1] - point1[1];
64// vector[2] = point2[2] - point1[2];
65// vector1[0] = point1[0] - point[0];
66// vector1[1] = point1[1] - point[1];
67// vector1[2] = point1[2] - point[2];
68// vector2[0] = point2[0] - point[0];
69// vector2[1] = point2[1] - point[1];
70// vector2[2] = point2[2] - point[2];
71// vtkMath::Normalize(vector);
72// vtkMath::Normalize(vector1);
73// vtkMath::Normalize(vector2);
74// dot = vtkMath::Dot(vector,vector1);
75// this->Weights[j] += vtkMath::Distance2BetweenPoints(point,point1) * dot * sqrt(1.0 - dot*dot) / 2.0;
76// if (!(this->IsBoundary || j==this->NPoints-1))
77// {
78// dot = vtkMath::Dot(vector,vector2);
79// this->Weights[(j+1)%this->NPoints] += vtkMath::Distance2BetweenPoints(point,point2) * dot * sqrt(1.0 - dot*dot) / 2.0;
80// }
81 for (j=0; j<this->NPoints; j++)
82 {
83 pdata->GetPoint(this->PointIds[j],point1);
84 pdata->GetPoint(this->PointIds[(j+1)%this->NPoints],point2);
85 double area = vtkvmtkMath::TriangleArea(point,point1,point2);
86 if (!(this->IsBoundary || j==this->NPoints-1))
87 {
88 this->Weights[j] += area;
89 this->Weights[(j+1)%this->NPoints] += area;
90 }
91 }
92
93 this->CenterWeight[0] = 0.0;
94 for (j=0; j<this->NPoints; j++)
95 {
96 this->CenterWeight[0] += this->Weights[j];
97 }
98
99 this->Area = this->CenterWeight[0];
100
101 this->ScaleWithArea();
102
103 this->ChangeWeightSign();
104}
static double TriangleArea(double point0[3], double point1[3], double point2[3])
double * CenterWeight

◆ ScaleWithArea()

void vtkvmtkPolyDataAreaWeightedUmbrellaStencil::ScaleWithArea ( )
overrideprotectedvirtual

Normalize the stencil's Weights/CenterWeight by the area computed by ComputeArea(), typically via the protected ScaleWithAreaFactor helper. Must be implemented by every concrete stencil subclass; called internally at the end of Build().

Implements vtkvmtkPolyDataManifoldStencil.

Definition at line 106 of file vtkvmtkPolyDataAreaWeightedUmbrellaStencil.cxx.

107{
108 this->ScaleWithAreaFactor(1.0);
109}

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