VMTK
Loading...
Searching...
No Matches
vtkvmtkMath.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=========================================================================*/
24
25#ifndef __vtkvmtkMath_h
26#define __vtkvmtkMath_h
27
28#include "vtkObject.h"
29#include "vtkMath.h"
30#include "vtkvmtkConstants.h"
31#include "vtkvmtkWin32Header.h"
32
33#define VTK_VMTK_NON_OBTUSE 0
34#define VTK_VMTK_OBTUSE_IN_POINT 1
35#define VTK_VMTK_OBTUSE_NOT_IN_POINT 2
36
37class VTK_VMTK_COMMON_EXPORT vtkvmtkMath : public vtkObject
38{
39public:
40
41 vtkTypeMacro(vtkvmtkMath,vtkObject);
42// vtkTypeMacro(vtkvmtkMath,vtkObject);
43 static vtkvmtkMath* New();
44
51 static double Cotangent(double point0[3], double point1[3], double point2[3]);
52
57 static double TriangleArea(double point0[3], double point1[3], double point2[3]);
58
63 static int IsAngleObtuse(double point0[3], double point1[3], double point2[3]);
64
73 static int IsTriangleObtuse(double point0[3], double point1[3], double point2[3]);
74
82 static double VoronoiSectorArea(double point0[3], double point1[3], double point2[3]);
83
91 static double TriangleGradient(double point0[3], double point1[3], double point2[3], double scalar0, double scalar1, double scalar2, double gradient[3]);
92
98 static void TwoSphereIntersection(double center0[3], double radius0, double center1[3], double radius1, double origin[3], double normal[3]);
99
105 static double AngleBetweenNormals(double normal0[3], double normal1[3]);
106
111 static double EvaluateSphereFunction(double center[3], double radius, double point[3]);
112
113protected:
116
117 static double GetTolerance(float cookie)
118 {
119 return VTK_VMTK_FLOAT_TOL;
120 }
121
122 static double GetTolerance(double cookie)
123 {
124 return VTK_VMTK_DOUBLE_TOL;
125 }
126
127 static double GetLarge(float cookie)
128 {
129 return VTK_VMTK_LARGE_FLOAT;
130 }
131
132 static double GetLarge(double cookie)
133 {
134 return VTK_VMTK_LARGE_DOUBLE;
135 }
136
137private:
138 vtkvmtkMath(const vtkvmtkMath&); // Not implemented.
139 void operator=(const vtkvmtkMath&); // Not implemented.
140};
141
142#endif
Provides static utility mathematical functions to avoid repeating code across classes.
Definition vtkvmtkMath.h:38
static double GetLarge(double cookie)
static double AngleBetweenNormals(double normal0[3], double normal1[3])
static vtkvmtkMath * New()
static double Cotangent(double point0[3], double point1[3], double point2[3])
static double VoronoiSectorArea(double point0[3], double point1[3], double point2[3])
static void TwoSphereIntersection(double center0[3], double radius0, double center1[3], double radius1, double origin[3], double normal[3])
static double GetLarge(float cookie)
static double EvaluateSphereFunction(double center[3], double radius, double point[3])
static int IsAngleObtuse(double point0[3], double point1[3], double point2[3])
static double TriangleGradient(double point0[3], double point1[3], double point2[3], double scalar0, double scalar1, double scalar2, double gradient[3])
static double GetTolerance(float cookie)
static int IsTriangleObtuse(double point0[3], double point1[3], double point2[3])
static double TriangleArea(double point0[3], double point1[3], double point2[3])
static double GetTolerance(double cookie)
#define VTK_VMTK_FLOAT_TOL
#define VTK_VMTK_DOUBLE_TOL
#define VTK_VMTK_LARGE_DOUBLE
#define VTK_VMTK_LARGE_FLOAT