VMTK
Loading...
Searching...
No Matches
vtkvmtkPolyBallLine2.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: VMTK
4
5 Copyright (c) Luca Antiga, David Steinman. All rights reserved.
6 See LICENSE file for details.
7
8 Portions of this code are covered under the VTK copyright.
9 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
10 for details.
11
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
15
16 Note: this class was contributed by
17 Tangui Morvan
18 Kalkulo AS
19 Simula Research Laboratory
20=========================================================================*/
28
29#ifndef __vtkvmtkPolyBallLine2_h
30#define __vtkvmtkPolyBallLine2_h
31
32#include "vtkImplicitFunction.h"
33#include "vtkPolyData.h"
34#include "vtkIdList.h"
35#include "vtkTriangleFilter.h"
36#include "vtkCellLocator.h"
37
38//#include "vtkvmtkComputationalGeometryWin32Header.h"
39#include "vtkvmtkWin32Header.h"
40
41class VTK_VMTK_CONTRIB_EXPORT vtkvmtkPolyBallLine2 : public vtkImplicitFunction
42{
43 public:
44
46 vtkTypeMacro(vtkvmtkPolyBallLine2,vtkImplicitFunction);
47 void PrintSelf(std::ostream& os, vtkIndent indent) override;
48
50
53 double EvaluateFunction(double x[3]) override;
54 double EvaluateFunction(double x, double y, double z) override
55 {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
56
57
61 void EvaluateGradient(double x[3], double n[3]) override;
62
64
67 virtual void SetInput(vtkPolyData *inp);
68 vtkGetObjectMacro(Input,vtkPolyData);
69 void SetInputData(vtkPolyData* input) { SetInput(input); }
70 vtkPolyData* GetInputData() { return GetInput(); }
72
74
77 virtual void SetInputCellIds(vtkIdList *cellIds);
78 vtkGetObjectMacro(InputCellIds,vtkIdList);
80
82
85 virtual void SetInputCellId(vtkIdType cellId);
86 vtkGetMacro(InputCellId,vtkIdType);
88
90
94 vtkSetStringMacro(PolyBallRadiusArrayName);
95 vtkGetStringMacro(PolyBallRadiusArrayName);
97
99
105 vtkSetMacro(UseRadiusInformation,int);
106 vtkGetMacro(UseRadiusInformation,int);
107 vtkBooleanMacro(UseRadiusInformation,int);
109
115 static double ComplexDot(double x[4], double y[4]);
116
117 protected:
120
121 vtkPolyData* Input;
122 vtkIdList* InputCellIds;
123 vtkIdType InputCellId;
124
131
133
134 // Used to triangulate the polylines
135 vtkTriangleFilter *Triangulator;
136
137 //For faster distance computation
138 vtkCellLocator *Locator;
139
140 //Local copy of the cells used in the input
141 vtkPolyData *LocalInput;
142
143 //Triangulated input (for increased performance)
144 vtkPolyData *TriangulatedInput;
145
146 //Should the locator be rebuild
148
149 //MTime of input last time the locator was built
150 unsigned long LocatorMTime;
151
152 //Rebuild the locator
153 void BuildLocator();
154
155 private:
156 vtkvmtkPolyBallLine2(const vtkvmtkPolyBallLine2&); // Not implemented.
157 void operator=(const vtkvmtkPolyBallLine2&); // Not implemented.
158};
159
160#endif
161
162
vtkTriangleFilter * Triangulator
static double ComplexDot(double x[4], double y[4])
void PrintSelf(std::ostream &os, vtkIndent indent) override
virtual void SetInput(vtkPolyData *inp)
virtual void SetInputCellId(vtkIdType cellId)
static vtkvmtkPolyBallLine2 * New()
double EvaluateFunction(double x[3]) override
virtual vtkPolyData * GetInput()
double EvaluateFunction(double x, double y, double z) override
void SetInputData(vtkPolyData *input)