vtkbone
vtkboneTensorOfInertia.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Copyright 2010-2016, Numerics88 Solutions Ltd.
4 http://www.numerics88.com/
5
6 Copyright (c) Eric Nodwell and Steven K. Boyd
7 See Copyright.txt for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12=========================================================================*/
13
26#ifndef __vtkboneTensorOfInertia_h
27#define __vtkboneTensorOfInertia_h
28
29#include "vtkAlgorithm.h"
30#include "vtkImageData.h"
31#include "vtkUnstructuredGrid.h"
32#include "vtkboneWin32Header.h"
33#include "vtkboneTensor.h"
34
35// forward declarations
36class vtkMatrix3x3;
37
38class VTKBONE_EXPORT vtkboneTensorOfInertia : public vtkAlgorithm
39{
40public:
43
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
48
52 vtkInformationVector*) override;
54
56
60
62
64 vtkSetMacro(UseSpecificValue, int);
65 vtkGetMacro(UseSpecificValue, int);
66 vtkBooleanMacro(UseSpecificValue,int);
68
70
72 void SetSpecificValue (int v) {this->SpecificValue=v; this->UseSpecificValue=1;}
73 vtkGetMacro(SpecificValue, int);
75
77
80 vtkSetMacro(UseThresholds, int);
81 vtkGetMacro(UseThresholds, int);
82 vtkBooleanMacro(UseThresholds,int);
84
86
88 void SetLowerThreshold (double v) {this->LowerThreshold=v; this->UseThresholds=1;}
89 vtkGetMacro(LowerThreshold, double);
91
93
95 void SetUpperThreshold (double v) {this->UpperThreshold=v; this->UseThresholds=1;}
96 vtkGetMacro(UpperThreshold, double);
98
100
101 vtkGetMacro(Count, vtkIdType);
103
105
106 vtkGetMacro(Volume, double);
108
110
111 vtkGetMacro(Mass, double);
113
115
116 vtkGetVector3Macro(CenterOfMass, double);
117 double GetCenterOfMassX() {return this->CenterOfMass[0];}
118 double GetCenterOfMassY() {return this->CenterOfMass[1];}
119 double GetCenterOfMassZ() {return this->CenterOfMass[2];}
121
124
127
132
134
135 vtkGetVector3Macro(PrincipalAxisClosestToX, double);
136 vtkGetVector3Macro(PrincipalAxisClosestToY, double);
137 vtkGetVector3Macro(PrincipalAxisClosestToZ, double);
139
141
143 vtkGetVector3Macro(PrincipalMoments, double);
145 {return this->PrincipalMoments[0];}
147 {return this->PrincipalMoments[1];}
149 {return this->PrincipalMoments[2];}
151
153
157 vtkboneTensor* T0,
158 double mass,
159 double r[3],
160 vtkboneTensor* T);
162
164
168 vtkboneTensor* T,
169 double mass,
170 double r[3],
171 vtkboneTensor* T0);
173
175
178 vtkboneTensor* T1,
179 double r1[3],
180 double mass,
181 double r2[3],
182 vtkboneTensor* T2);
184
185protected:
188
189 virtual int RequestData(vtkInformation* request,
190 vtkInformationVector** inputVector,
191 vtkInformationVector* outputVector);
192
193 virtual int ProcessImage(vtkImageData* image);
194
196
197 virtual int FillInputPortInformation(int port, vtkInformation* info) override;
198
199 // Settings
205
206 // Results
208 double Volume;
209 double Mass;
210 double CenterOfMass[3];
214 double PrincipalMoments[3];
215 double PrincipalAxisClosestToX[3];
216 double PrincipalAxisClosestToY[3];
217 double PrincipalAxisClosestToZ[3];
218
219private:
220 vtkboneTensorOfInertia(const vtkboneTensorOfInertia&); // Not implemented.
221 void operator=(const vtkboneTensorOfInertia&); // Not implemented.
222};
223
224#endif
void operator=(const vtkObjectBase &)
calculates the tensor of inertia.
virtual int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
static void TranslateTensorOfInertia(vtkboneTensor *T1, double r1[3], double mass, double r2[3], vtkboneTensor *T2)
static void TranslateTensorOfInertiaFromCOM(vtkboneTensor *T0, double mass, double r[3], vtkboneTensor *T)
void GetTensorOfInertia(vtkboneTensor *MOI)
virtual int ProcessImage(vtkImageData *image)
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SetInputData(int, vtkDataObject *)
void GetTensorOfInertiaAboutOrigin(vtkboneTensor *MOI)
static void TranslateTensorOfInertiaToCOM(vtkboneTensor *T, double mass, double r[3], vtkboneTensor *T0)
static vtkboneTensorOfInertia * New()
void PrintSelf(ostream &os, vtkIndent indent) override
vtkboneTensor * TensorOfInertiaAboutOrigin
virtual int FillInputPortInformation(int port, vtkInformation *info) override
void GetEigenvectors(vtkMatrix3x3 *A)
virtual int ProcessUnstructuredGrid(vtkUnstructuredGrid *grid)
void SetInputData(vtkDataObject *)
supporting class to enable assignment and referencing of tensors
int vtkIdType