VMTK
vtkvmtkMath.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: VMTK
4  Module: $RCSfile: vtkvmtkTMath.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 __vtkvmtkMath_h
29 #define __vtkvmtkMath_h
30 
31 #include "vtkObject.h"
32 #include "vtkMath.h"
33 #include "vtkvmtkConstants.h"
34 #include "vtkvmtkWin32Header.h"
35 
36 #define VTK_VMTK_NON_OBTUSE 0
37 #define VTK_VMTK_OBTUSE_IN_POINT 1
38 #define VTK_VMTK_OBTUSE_NOT_IN_POINT 2
39 
40 class VTK_VMTK_COMMON_EXPORT vtkvmtkMath : public vtkObject
41 {
42 public:
43 
44  vtkTypeMacro(vtkvmtkMath,vtkObject);
45 // vtkTypeMacro(vtkvmtkMath,vtkObject);
46  static vtkvmtkMath* New();
47 
48  static double Cotangent(double point0[3], double point1[3], double point2[3]);
49  static double TriangleArea(double point0[3], double point1[3], double point2[3]);
50  static int IsAngleObtuse(double point0[3], double point1[3], double point2[3]);
51  static int IsTriangleObtuse(double point0[3], double point1[3], double point2[3]);
52  static double VoronoiSectorArea(double point0[3], double point1[3], double point2[3]);
53  static double TriangleGradient(double point0[3], double point1[3], double point2[3], double scalar0, double scalar1, double scalar2, double gradient[3]);
54  static void TwoSphereIntersection(double center0[3], double radius0, double center1[3], double radius1, double origin[3], double normal[3]);
55  static double AngleBetweenNormals(double normal0[3], double normal1[3]);
56  static double EvaluateSphereFunction(double center[3], double radius, double point[3]);
57 
58 protected:
61 
62  static double GetTolerance(float cookie)
63  {
64  return VTK_VMTK_FLOAT_TOL;
65  }
66 
67  static double GetTolerance(double cookie)
68  {
69  return VTK_VMTK_DOUBLE_TOL;
70  }
71 
72  static double GetLarge(float cookie)
73  {
74  return VTK_VMTK_LARGE_FLOAT;
75  }
76 
77  static double GetLarge(double cookie)
78  {
79  return VTK_VMTK_LARGE_DOUBLE;
80  }
81 
82 private:
83  vtkvmtkMath(const vtkvmtkMath&); // Not implemented.
84  void operator=(const vtkvmtkMath&); // Not implemented.
85 };
86 
87 #endif
static double GetTolerance(float cookie)
Definition: vtkvmtkMath.h:62
#define VTK_VMTK_LARGE_DOUBLE
#define VTK_VMTK_LARGE_FLOAT
#define VTK_VMTK_DOUBLE_TOL
Static utility mathematical functions included to avoid repeating ourselves.
Definition: vtkvmtkMath.h:40
static double GetLarge(double cookie)
Definition: vtkvmtkMath.h:77
#define VTK_VMTK_FLOAT_TOL
static double GetTolerance(double cookie)
Definition: vtkvmtkMath.h:67
static double GetLarge(float cookie)
Definition: vtkvmtkMath.h:72