Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkLinearTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkLinearTransform.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00035 #ifndef __vtkLinearTransform_h
00036 #define __vtkLinearTransform_h
00037 
00038 #include "vtkHomogeneousTransform.h"
00039 
00040 class VTK_COMMON_EXPORT vtkLinearTransform : public vtkHomogeneousTransform
00041 {
00042 public:
00043 
00044   vtkTypeRevisionMacro(vtkLinearTransform,vtkHomogeneousTransform);
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00048 
00050   void TransformNormal(const float in[3], float out[3]) {
00051     this->Update(); this->InternalTransformNormal(in,out); };
00053 
00055 
00057   void TransformNormal(const double in[3], double out[3]) {
00058     this->Update(); this->InternalTransformNormal(in,out); };
00060 
00062 
00064   double *TransformNormal(double x, double y, double z) {
00065     return this->TransformDoubleNormal(x,y,z); }
00066   double *TransformNormal(const double normal[3]) {
00067     return this->TransformDoubleNormal(normal[0],normal[1],normal[2]); };
00069 
00071 
00073   float *TransformFloatNormal(float x, float y, float z) {
00074     this->InternalFloatPoint[0] = x;
00075     this->InternalFloatPoint[1] = y;
00076     this->InternalFloatPoint[2] = z;
00077     this->TransformNormal(this->InternalFloatPoint,this->InternalFloatPoint);
00078     return this->InternalFloatPoint; };
00079   float *TransformFloatNormal(const float normal[3]) {
00080     return this->TransformFloatNormal(normal[0],normal[1],normal[2]); };
00082 
00084 
00086   double *TransformDoubleNormal(double x, double y, double z) {
00087     this->InternalDoublePoint[0] = x;
00088     this->InternalDoublePoint[1] = y;
00089     this->InternalDoublePoint[2] = z;
00090     this->TransformNormal(this->InternalDoublePoint,this->InternalDoublePoint);
00091     return this->InternalDoublePoint; };
00092   double *TransformDoubleNormal(const double normal[3]) {
00093     return this->TransformDoubleNormal(normal[0],normal[1],normal[2]); };
00095 
00097 
00099   double *TransformVector(double x, double y, double z) {
00100     return this->TransformDoubleVector(x,y,z); }
00101   double *TransformVector(const double normal[3]) {
00102     return this->TransformDoubleVector(normal[0],normal[1],normal[2]); };
00104 
00106 
00108   void TransformVector(const float in[3], float out[3]) {
00109     this->Update(); this->InternalTransformVector(in,out); };
00111 
00113 
00115   void TransformVector(const double in[3], double out[3]) {
00116     this->Update(); this->InternalTransformVector(in,out); };
00118 
00120 
00122   float *TransformFloatVector(float x, float y, float z) {
00123       this->InternalFloatPoint[0] = x;
00124       this->InternalFloatPoint[1] = y;
00125       this->InternalFloatPoint[2] = z;
00126       this->TransformVector(this->InternalFloatPoint,this->InternalFloatPoint);
00127       return this->InternalFloatPoint; };
00128   float *TransformFloatVector(const float vec[3]) {
00129     return this->TransformFloatVector(vec[0],vec[1],vec[2]); };
00131 
00133 
00135   double *TransformDoubleVector(double x, double y, double z) {
00136     this->InternalDoublePoint[0] = x;
00137     this->InternalDoublePoint[1] = y;
00138     this->InternalDoublePoint[2] = z;
00139     this->TransformVector(this->InternalDoublePoint,this->InternalDoublePoint);
00140     return this->InternalDoublePoint; };
00141   double *TransformDoubleVector(const double vec[3]) {
00142     return this->TransformDoubleVector(vec[0],vec[1],vec[2]); };
00144 
00147   void TransformPoints(vtkPoints *inPts, vtkPoints *outPts);
00148 
00151   virtual void TransformNormals(vtkDataArray *inNms, vtkDataArray *outNms);
00152 
00155   virtual void TransformVectors(vtkDataArray *inVrs, vtkDataArray *outVrs);
00156 
00158 
00160   void TransformPointsNormalsVectors(vtkPoints *inPts, 
00161                                      vtkPoints *outPts, 
00162                                      vtkDataArray *inNms, 
00163                                      vtkDataArray *outNms,
00164                                      vtkDataArray *inVrs, 
00165                                      vtkDataArray *outVrs);
00167 
00169 
00171   vtkLinearTransform *GetLinearInverse() { 
00172     return (vtkLinearTransform *)this->GetInverse(); }; 
00174 
00176 
00178   void InternalTransformPoint(const float in[3], float out[3]);
00179   void InternalTransformPoint(const double in[3], double out[3]);
00181 
00183 
00185   virtual void InternalTransformNormal(const float in[3], float out[3]);
00186   virtual void InternalTransformNormal(const double in[3], double out[3]);
00188 
00190 
00192   virtual void InternalTransformVector(const float in[3], float out[3]);
00193   virtual void InternalTransformVector(const double in[3], double out[3]);
00195 
00197 
00199   void InternalTransformDerivative(const float in[3], float out[3],
00200                                    float derivative[3][3]);
00201   void InternalTransformDerivative(const double in[3], double out[3],
00202                                    double derivative[3][3]);
00204 
00205 protected:
00206   vtkLinearTransform() {};
00207   ~vtkLinearTransform() {};
00208 private:
00209   vtkLinearTransform(const vtkLinearTransform&);  // Not implemented.
00210   void operator=(const vtkLinearTransform&);  // Not implemented.
00211 };
00212 
00213 #endif
00214 
00215 
00216 
00217 
00218