VMTK
vtkvmtkStencil.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: VMTK
4  Module: $RCSfile: vtkvmtkStencil.h,v $
5  Language: C++
6 
7  Copyright (c) Luca Antiga, David Steinman. All rights reserved.
8  See LICENSE file for details.
9 
10  Portions of this code are covered under the VTK copyright.
11  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
12  for details.
13 
14  This software is distributed WITHOUT ANY WARRANTY; without even
15  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16  PURPOSE. See the above copyright notices for more information.
17 
18 =========================================================================*/
28 #ifndef __vtkvmtkStencil_h
29 #define __vtkvmtkStencil_h
30 
31 #include "vtkObject.h"
32 #include "vtkvmtkNeighborhood.h"
33 //#include "vtkvmtkDifferentialGeometryWin32Header.h"
34 #include "vtkvmtkWin32Header.h"
35 
36 class VTK_VMTK_DIFFERENTIAL_GEOMETRY_EXPORT vtkvmtkStencil : public vtkvmtkNeighborhood
37 {
38 public:
39 
41 
42  vtkSetMacro(NumberOfComponents,vtkIdType);
43  vtkGetMacro(NumberOfComponents,vtkIdType);
44 
45  double GetWeight(vtkIdType i) {return this->Weights[i];};
46  void SetWeight(vtkIdType i, double weight) {this->Weights[i] = weight;};
47 
48  double GetWeight(vtkIdType i, vtkIdType component) {return this->Weights[this->NumberOfComponents * i + component];};
49  void SetWeight(vtkIdType i, vtkIdType component, double weight) {this->Weights[this->NumberOfComponents * i + component] = weight;};
50 
51  vtkIdType GetNumberOfWeights() {return this->NumberOfComponents * this->NPoints;};
52 
53  void ScaleWeights(double factor);
54 
55  double GetCenterWeight() {return this->CenterWeight[0];};
56  void SetCenterWeight(double weight) {this->CenterWeight[0] = weight;};
57 
58  const double* GetCenterWeightTuple() {return this->CenterWeight;};
59 
60  double GetCenterWeight(vtkIdType component) {return this->CenterWeight[component];};
61  void SetCenterWeight(vtkIdType component, double weightComponent) {this->CenterWeight[component] = weightComponent;};
62 
63 // vtkSetMacro(CenterWeight,double);
64 // vtkGetMacro(CenterWeight,double);
65 
67  virtual void Build() VTK_OVERRIDE = 0;
68 
70  virtual void DeepCopy(vtkvmtkItem *src) VTK_OVERRIDE;
71 
72  vtkSetMacro(WeightScaling,int)
73  vtkGetMacro(WeightScaling,int)
74  vtkBooleanMacro(WeightScaling,int)
75 
76  vtkSetMacro(NegateWeights,int)
77  vtkGetMacro(NegateWeights,int)
78  vtkBooleanMacro(NegateWeights,int)
79 
80 protected:
82  ~vtkvmtkStencil();
83 
84  void ResizePointList(vtkIdType ptId, int size);
85 
86  void ChangeWeightSign();
87 
88  vtkIdType NumberOfComponents;
89  double* Weights;
90  double* CenterWeight;
91 
92  int WeightScaling;
93 
94  int NegateWeights;
95 
96 private:
97  vtkvmtkStencil(const vtkvmtkStencil&); // Not implemented.
98  void operator=(const vtkvmtkStencil&); // Not implemented.
99 };
100 
101 #endif
102 
void SetCenterWeight(double weight)
void SetCenterWeight(vtkIdType component, double weightComponent)
void SetWeight(vtkIdType i, double weight)
const double * GetCenterWeightTuple()
Base class for the construction of neighborhoods and stencil from a set of points.
Definition: vtkvmtkItem.h:35
double GetCenterWeight(vtkIdType component)
Apply a weighting matrix to a single neighborhood of a data set.
virtual void Build() VTK_OVERRIDE=0
double GetWeight(vtkIdType i)
void SetWeight(vtkIdType i, vtkIdType component, double weight)
double GetWeight(vtkIdType i, vtkIdType component)
vtkIdType GetNumberOfWeights()
Query the neighborhood surrounding the set point id in an data set item.
double GetCenterWeight()