00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00024 #ifndef __vtkLinearTransform_h
00025 #define __vtkLinearTransform_h
00026
00027 #include "vtkHomogeneousTransform.h"
00028
00029 class VTK_COMMON_EXPORT vtkLinearTransform : public vtkHomogeneousTransform
00030 {
00031 public:
00032
00033 vtkTypeRevisionMacro(vtkLinearTransform,vtkHomogeneousTransform);
00034 void PrintSelf(ostream& os, vtkIndent indent);
00035
00037
00039 void TransformNormal(const float in[3], float out[3]) {
00040 this->Update(); this->InternalTransformNormal(in,out); };
00042
00044
00046 void TransformNormal(const double in[3], double out[3]) {
00047 this->Update(); this->InternalTransformNormal(in,out); };
00049
00051
00053 double *TransformNormal(double x, double y, double z) {
00054 return this->TransformDoubleNormal(x,y,z); }
00055 double *TransformNormal(const double normal[3]) {
00056 return this->TransformDoubleNormal(normal[0],normal[1],normal[2]); };
00058
00060
00062 float *TransformFloatNormal(float x, float y, float z) {
00063 this->InternalFloatPoint[0] = x;
00064 this->InternalFloatPoint[1] = y;
00065 this->InternalFloatPoint[2] = z;
00066 this->TransformNormal(this->InternalFloatPoint,this->InternalFloatPoint);
00067 return this->InternalFloatPoint; };
00068 float *TransformFloatNormal(const float normal[3]) {
00069 return this->TransformFloatNormal(normal[0],normal[1],normal[2]); };
00071
00073
00075 double *TransformDoubleNormal(double x, double y, double z) {
00076 this->InternalDoublePoint[0] = x;
00077 this->InternalDoublePoint[1] = y;
00078 this->InternalDoublePoint[2] = z;
00079 this->TransformNormal(this->InternalDoublePoint,this->InternalDoublePoint);
00080 return this->InternalDoublePoint; };
00081 double *TransformDoubleNormal(const double normal[3]) {
00082 return this->TransformDoubleNormal(normal[0],normal[1],normal[2]); };
00084
00086
00088 double *TransformVector(double x, double y, double z) {
00089 return this->TransformDoubleVector(x,y,z); }
00090 double *TransformVector(const double normal[3]) {
00091 return this->TransformDoubleVector(normal[0],normal[1],normal[2]); };
00093
00095
00097 void TransformVector(const float in[3], float out[3]) {
00098 this->Update(); this->InternalTransformVector(in,out); };
00100
00102
00104 void TransformVector(const double in[3], double out[3]) {
00105 this->Update(); this->InternalTransformVector(in,out); };
00107
00109
00111 float *TransformFloatVector(float x, float y, float z) {
00112 this->InternalFloatPoint[0] = x;
00113 this->InternalFloatPoint[1] = y;
00114 this->InternalFloatPoint[2] = z;
00115 this->TransformVector(this->InternalFloatPoint,this->InternalFloatPoint);
00116 return this->InternalFloatPoint; };
00117 float *TransformFloatVector(const float vec[3]) {
00118 return this->TransformFloatVector(vec[0],vec[1],vec[2]); };
00120
00122
00124 double *TransformDoubleVector(double x, double y, double z) {
00125 this->InternalDoublePoint[0] = x;
00126 this->InternalDoublePoint[1] = y;
00127 this->InternalDoublePoint[2] = z;
00128 this->TransformVector(this->InternalDoublePoint,this->InternalDoublePoint);
00129 return this->InternalDoublePoint; };
00130 double *TransformDoubleVector(const double vec[3]) {
00131 return this->TransformDoubleVector(vec[0],vec[1],vec[2]); };
00133
00136 void TransformPoints(vtkPoints *inPts, vtkPoints *outPts);
00137
00140 virtual void TransformNormals(vtkDataArray *inNms, vtkDataArray *outNms);
00141
00144 virtual void TransformVectors(vtkDataArray *inVrs, vtkDataArray *outVrs);
00145
00147
00149 void TransformPointsNormalsVectors(vtkPoints *inPts,
00150 vtkPoints *outPts,
00151 vtkDataArray *inNms,
00152 vtkDataArray *outNms,
00153 vtkDataArray *inVrs,
00154 vtkDataArray *outVrs);
00156
00158
00160 vtkLinearTransform *GetLinearInverse() {
00161 return (vtkLinearTransform *)this->GetInverse(); };
00163
00165
00167 void InternalTransformPoint(const float in[3], float out[3]);
00168 void InternalTransformPoint(const double in[3], double out[3]);
00170
00172
00174 virtual void InternalTransformNormal(const float in[3], float out[3]);
00175 virtual void InternalTransformNormal(const double in[3], double out[3]);
00177
00179
00181 virtual void InternalTransformVector(const float in[3], float out[3]);
00182 virtual void InternalTransformVector(const double in[3], double out[3]);
00184
00186
00188 void InternalTransformDerivative(const float in[3], float out[3],
00189 float derivative[3][3]);
00190 void InternalTransformDerivative(const double in[3], double out[3],
00191 double derivative[3][3]);
00193
00194 protected:
00195 vtkLinearTransform() {};
00196 ~vtkLinearTransform() {};
00197 private:
00198 vtkLinearTransform(const vtkLinearTransform&);
00199 void operator=(const vtkLinearTransform&);
00200 };
00201
00202 #endif
00203
00204
00205
00206
00207