23 #ifndef vtkMatrix4x4_h
24 #define vtkMatrix4x4_h
26 #include "vtkCommonMathModule.h"
29 VTK_ABI_NAMESPACE_BEGIN
67 static void DeepCopy(
double destination[16],
const double source[16]);
87 static void Zero(
double elements[16]);
97 static void Identity(
double elements[16]);
114 static void Invert(
const double inElements[16],
double outElements[16]);
125 static void Transpose(
const double inElements[16],
double outElements[16]);
131 static void MatrixFromRotation(
double angle,
double x,
double y,
double z,
vtkMatrix4x4* result);
132 static void MatrixFromRotation(
double angle,
double x,
double y,
double z,
double matrix[16]);
141 static void PoseToMatrix(
double pos[3],
double ori[4],
vtkMatrix4x4* mat);
156 static void MultiplyPoint(
const double elements[16],
const float in[4],
float out[4]);
157 static void MultiplyPoint(
const double elements[16],
const double in[4],
double out[4]);
165 return this->MultiplyDoublePoint(in);
169 this->MultiplyPoint(in, this->FloatPoint);
170 return this->FloatPoint;
174 this->MultiplyPoint(in, this->DoublePoint);
175 return this->DoublePoint;
183 static void Multiply4x4(
const double a[16],
const double b[16],
double c[16]);
184 static void Multiply4x4(
const double a[16],
const double b[16],
float c[16]);
185 static void MultiplyAndTranspose4x4(
const double a[16],
const double b[16],
float c[16]);
195 static void Adjoint(
const double inElements[16],
double outElements[16]);
201 static double Determinant(
const double elements[16]);
206 void SetElement(
int i,
int j,
double value);
211 double GetElement(
int i,
int j)
const {
return this->Element[i][j]; }
221 const double*
GetData()
const {
return *this->Element; }
228 double DoublePoint[4];
241 for (
int i = 0; i < 16; i += 4)
243 for (
int j = 0; j < 4; j++)
246 a[i + 0] * b[j + 0] + a[i + 1] * b[j + 4] + a[i + 2] * b[j + 8] + a[i + 3] * b[j + 12];
250 for (
int k = 0; k < 16; k++)
260 for (
int i = 0; i < 16; i += 4)
262 for (
int j = 0; j < 4; j++)
265 a[i + 0] * b[j + 0] + a[i + 1] * b[j + 4] + a[i + 2] * b[j + 8] + a[i + 3] * b[j + 12];
273 const double a[16],
const double b[16],
float c[16])
275 for (
int i = 0; i < 4; i++)
277 for (
int j = 0; j < 4; j++)
280 c[i + j * 4] = a[it4 + 0] * b[j + 0] + a[it4 + 1] * b[j + 4] + a[it4 + 2] * b[j + 8] +
281 a[it4 + 3] * b[j + 12];
295 if (this->
Element[i][j] != value)
306 return M[0] == 1.0 && M[1] == 0.0 && M[2] == 0.0 && M[3] == 0.0 && M[4] == 0.0 && M[5] == 1.0 &&
307 M[6] == 0.0 && M[7] == 0.0 && M[8] == 0.0 && M[9] == 0.0 && M[10] == 1.0 && M[11] == 0.0 &&
308 M[12] == 0.0 && M[13] == 0.0 && M[14] == 0.0 && M[15] == 1.0;
311 VTK_ABI_NAMESPACE_END
static void DeepCopy(double destination[16], const vtkMatrix4x4 *source)
Set the elements of the given destination buffer to the same values as the elements of the given sour...
double * MultiplyPoint(const double in[4])
abstract base class for most VTK objects
represent and manipulate 4x4 transformation matrices
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static void MultiplyAndTranspose4x4(const double a[16], const double b[16], float c[16])
Multiplies matrices a and b and stores the result in c.
void Adjoint(const vtkMatrix4x4 *in, vtkMatrix4x4 *out)
Compute adjoint of the matrix and put it into out.
float * MultiplyFloatPoint(const float in[4])
double GetElement(int i, int j) const
Returns the element i,j from the matrix.
void SetElement(int i, int j, double value)
Sets the element i,j in the matrix.
void MultiplyPoint(const double in[4], double out[4])
void MultiplyPoint(const float in[4], float out[4])
Multiply a homogeneous coordinate by this matrix, i.e.
void DeepCopy(const vtkMatrix4x4 *source)
Set the elements of the matrix to the same values as the elements of the given source matrix...
static void Multiply4x4(const vtkMatrix4x4 *a, const vtkMatrix4x4 *b, vtkMatrix4x4 *c)
Multiplies matrices a and b and stores the result in c.
double * GetData()
Returns the raw double array holding the matrix.
a simple class to control print indentation
static void Invert(const vtkMatrix4x4 *in, vtkMatrix4x4 *out)
Matrix Inversion (adapted from Richard Carling in "Graphics Gems," Academic Press, 1990).
void Identity()
Set equal to Identity matrix.
double * MultiplyDoublePoint(const double in[4])
virtual void Modified()
Update the modification time for this object.
static void Transpose(const vtkMatrix4x4 *in, vtkMatrix4x4 *out)
Transpose the matrix and put it into out.
#define VTK_SIZEHINT(...)
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
bool IsIdentity()
Returns true if this matrix is equal to the identity matrix.
double Determinant()
Compute the determinant of the matrix and return it.
double Element[4][4]
The internal data is public for historical reasons. Do not use!
float * MultiplyPoint(const float in[4])
For use in Java or Python.
void DeepCopy(const double elements[16])
Non-static member function.
void Zero()
Set all of the elements to zero.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
const double * GetData() const
Returns the raw double array holding the matrix.