Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkAddonMathUtilities.h
Go to the documentation of this file.
1 /*=auto==============================================================================
2 
3  Program: 3D Slicer
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Unless required by applicable law or agreed to in writing, software
9  distributed under the License is distributed on an "AS IS" BASIS,
10  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  See the License for the specific language governing permissions and
12  limitations under the License.
13 
14 ===============================================================================auto=*/
15 
19 
20 #ifndef __vtkAddonMathUtilities_h
21 #define __vtkAddonMathUtilities_h
22 
23 #include <vtkAddon.h>
24 #include <vtkObject.h>
25 
26 class vtkMatrix4x4;
27 class vtkMatrix3x3;
28 
29 class VTK_ADDON_EXPORT vtkAddonMathUtilities : public vtkObject
30 {
31 public:
32  static vtkAddonMathUtilities *New();
33  vtkTypeMacro(vtkAddonMathUtilities,vtkObject);
34  virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
35 
36  static bool MatrixAreEqual(const vtkMatrix4x4* m1,
37  const vtkMatrix4x4* m2,
38  double tolerance = 1e-3);
39 
40  static bool MatrixAreEqual(const vtkMatrix4x4 *m1,
41  const vtkMatrix3x3 *m2,
42  double tolerance = 1e-3);
43 
44  static bool MatrixAreEqual(const vtkMatrix3x3 *m1,
45  const vtkMatrix4x4 *m2,
46  double tolerance = 1e-3);
47 
48  static bool MatrixAreEqual(const vtkMatrix3x3 *m1,
49  const vtkMatrix3x3 *m2,
50  double tolerance = 1e-3);
51 
53  static void GetOrientationMatrixColumn(vtkMatrix4x4* m, int columnIndex, double columnVector[4]);
54 
56  static void SetOrientationMatrixColumn(vtkMatrix4x4* m, int columnIndex, double columnVector[4]);
57 
60  static void GetOrientationMatrix(vtkMatrix4x4* source, vtkMatrix3x3* dest);
61 
64  static void SetOrientationMatrix(vtkMatrix3x3* source, vtkMatrix4x4* dest);
65 
67  static void NormalizeColumns(vtkMatrix3x3 *m, double scale[3]);
68 
70  static void NormalizeOrientationMatrixColumns(vtkMatrix4x4 *m, double scale[3]);
71 
73  static std::string ToString(const vtkMatrix4x4* mat, const std::string delimiter = " ", const std::string rowDelimiter = "");
74 
76  static bool FromString(vtkMatrix4x4* mat, const std::string& str, const std::string delimiterExp = "(\\ |\\,|\\:|\\;|\t|\n|\\[|\\])");
77 
78 protected:
81 
82 private:
83  vtkAddonMathUtilities(const vtkAddonMathUtilities&); // Not implemented.
84  void operator=(const vtkAddonMathUtilities&); // Not implemented.
85 };
86 
87 #endif
std::string ToString(Type value)