VTK
vtkLinearTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLinearTransform.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
27 #ifndef vtkLinearTransform_h
28 #define vtkLinearTransform_h
29 
30 #include "vtkCommonTransformsModule.h" // For export macro
32 
34 {
35 public:
36 
38  void PrintSelf(ostream& os, vtkIndent indent);
39 
41 
43  void TransformNormal(const float in[3], float out[3]) {
44  this->Update(); this->InternalTransformNormal(in,out); };
46 
48 
50  void TransformNormal(const double in[3], double out[3]) {
51  this->Update(); this->InternalTransformNormal(in,out); };
53 
55 
57  double *TransformNormal(double x, double y, double z) {
58  return this->TransformDoubleNormal(x,y,z); }
59  double *TransformNormal(const double normal[3]) {
60  return this->TransformDoubleNormal(normal[0],normal[1],normal[2]); };
62 
64 
66  float *TransformFloatNormal(float x, float y, float z) {
67  this->InternalFloatPoint[0] = x;
68  this->InternalFloatPoint[1] = y;
69  this->InternalFloatPoint[2] = z;
70  this->TransformNormal(this->InternalFloatPoint,this->InternalFloatPoint);
71  return this->InternalFloatPoint; };
72  float *TransformFloatNormal(const float normal[3]) {
73  return this->TransformFloatNormal(normal[0],normal[1],normal[2]); };
75 
77 
79  double *TransformDoubleNormal(double x, double y, double z) {
80  this->InternalDoublePoint[0] = x;
81  this->InternalDoublePoint[1] = y;
82  this->InternalDoublePoint[2] = z;
83  this->TransformNormal(this->InternalDoublePoint,this->InternalDoublePoint);
84  return this->InternalDoublePoint; };
85  double *TransformDoubleNormal(const double normal[3]) {
86  return this->TransformDoubleNormal(normal[0],normal[1],normal[2]); };
88 
90 
92  double *TransformVector(double x, double y, double z) {
93  return this->TransformDoubleVector(x,y,z); }
94  double *TransformVector(const double normal[3]) {
95  return this->TransformDoubleVector(normal[0],normal[1],normal[2]); };
97 
99 
101  void TransformVector(const float in[3], float out[3]) {
102  this->Update(); this->InternalTransformVector(in,out); };
104 
106 
108  void TransformVector(const double in[3], double out[3]) {
109  this->Update(); this->InternalTransformVector(in,out); };
111 
113 
115  float *TransformFloatVector(float x, float y, float z) {
116  this->InternalFloatPoint[0] = x;
117  this->InternalFloatPoint[1] = y;
118  this->InternalFloatPoint[2] = z;
119  this->TransformVector(this->InternalFloatPoint,this->InternalFloatPoint);
120  return this->InternalFloatPoint; };
121  float *TransformFloatVector(const float vec[3]) {
122  return this->TransformFloatVector(vec[0],vec[1],vec[2]); };
124 
126 
128  double *TransformDoubleVector(double x, double y, double z) {
129  this->InternalDoublePoint[0] = x;
130  this->InternalDoublePoint[1] = y;
131  this->InternalDoublePoint[2] = z;
132  this->TransformVector(this->InternalDoublePoint,this->InternalDoublePoint);
133  return this->InternalDoublePoint; };
134  double *TransformDoubleVector(const double vec[3]) {
135  return this->TransformDoubleVector(vec[0],vec[1],vec[2]); };
137 
140  void TransformPoints(vtkPoints *inPts, vtkPoints *outPts);
141 
144  virtual void TransformNormals(vtkDataArray *inNms, vtkDataArray *outNms);
145 
148  virtual void TransformVectors(vtkDataArray *inVrs, vtkDataArray *outVrs);
149 
151 
154  vtkPoints *outPts,
155  vtkDataArray *inNms,
156  vtkDataArray *outNms,
157  vtkDataArray *inVrs,
158  vtkDataArray *outVrs);
160 
162 
165  {
166  return static_cast<vtkLinearTransform *>(this->GetInverse());
167  }
169 
171 
173  void InternalTransformPoint(const float in[3], float out[3]);
174  void InternalTransformPoint(const double in[3], double out[3]);
176 
178 
180  virtual void InternalTransformNormal(const float in[3], float out[3]);
181  virtual void InternalTransformNormal(const double in[3], double out[3]);
183 
185 
187  virtual void InternalTransformVector(const float in[3], float out[3]);
188  virtual void InternalTransformVector(const double in[3], double out[3]);
190 
192 
194  void InternalTransformDerivative(const float in[3], float out[3],
195  float derivative[3][3]);
196  void InternalTransformDerivative(const double in[3], double out[3],
197  double derivative[3][3]);
199 
200 protected:
203 private:
204  vtkLinearTransform(const vtkLinearTransform&); // Not implemented.
205  void operator=(const vtkLinearTransform&); // Not implemented.
206 };
207 
208 #endif
209 
210 
211 
212 
213 
void TransformNormal(const double in[3], double out[3])
double * TransformDoubleNormal(double x, double y, double z)
void TransformVector(const float in[3], float out[3])
float * TransformFloatNormal(float x, float y, float z)
superclass for homogeneous transformations
double * TransformDoubleNormal(const double normal[3])
float * TransformFloatNormal(const float normal[3])
vtkAbstractTransform * GetInverse()
double * TransformVector(double x, double y, double z)
void TransformVector(const double in[3], double out[3])
void InternalTransformPoint(const float in[3], float out[3])
double * TransformVector(const double normal[3])
vtkLinearTransform * GetLinearInverse()
float * TransformFloatVector(const float vec[3])
#define VTKCOMMONTRANSFORMS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
double * TransformNormal(const double normal[3])
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
void InternalTransformDerivative(const float in[3], float out[3], float derivative[3][3])
double * TransformNormal(double x, double y, double z)
void TransformPoints(vtkPoints *inPts, vtkPoints *outPts)
void TransformNormal(const float in[3], float out[3])
float * TransformFloatVector(float x, float y, float z)
double * TransformDoubleVector(const double vec[3])
void PrintSelf(ostream &os, vtkIndent indent)
double * TransformDoubleVector(double x, double y, double z)
virtual void TransformPointsNormalsVectors(vtkPoints *inPts, vtkPoints *outPts, vtkDataArray *inNms, vtkDataArray *outNms, vtkDataArray *inVrs, vtkDataArray *outVrs)
represent and manipulate 3D points
Definition: vtkPoints.h:38
abstract superclass for linear transformations