Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Common/vtkLinearTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkLinearTransform.h,v $
00005   Language:  C++
00006 
00007 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00008 All rights reserved.
00009 
00010 Redistribution and use in source and binary forms, with or without
00011 modification, are permitted provided that the following conditions are met:
00012 
00013  * Redistributions of source code must retain the above copyright notice,
00014    this list of conditions and the following disclaimer.
00015 
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019 
00020  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00021    of any contributors may be used to endorse or promote products derived
00022    from this software without specific prior written permission.
00023 
00024  * Modified source versions must be plainly marked as such, and must not be
00025    misrepresented as being the original software.
00026 
00027 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00028 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00029 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00031 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00032 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00033 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00034 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00035 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00036 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 
00038 =========================================================================*/
00053 #ifndef __vtkLinearTransform_h
00054 #define __vtkLinearTransform_h
00055 
00056 #include "vtkHomogeneousTransform.h"
00057 
00058 class VTK_COMMON_EXPORT vtkLinearTransform : public vtkHomogeneousTransform
00059 {
00060 public:
00061 
00062   vtkTypeMacro(vtkLinearTransform,vtkHomogeneousTransform);
00063   void PrintSelf(ostream& os, vtkIndent indent);
00064 
00066 
00068   void TransformNormal(const float in[3], float out[3]) {
00069     this->Update(); this->InternalTransformNormal(in,out); };
00071 
00073 
00075   void TransformNormal(const double in[3], double out[3]) {
00076     this->Update(); this->InternalTransformNormal(in,out); };
00078 
00080 
00082   double *TransformNormal(double x, double y, double z) {
00083     return this->TransformDoubleNormal(x,y,z); }
00084   double *TransformNormal(const double normal[3]) {
00085     return this->TransformDoubleNormal(normal[0],normal[1],normal[2]); };
00087 
00089 
00091   float *TransformFloatNormal(float x, float y, float z) {
00092     this->InternalFloatPoint[0] = x;
00093     this->InternalFloatPoint[1] = y;
00094     this->InternalFloatPoint[2] = z;
00095     this->TransformNormal(this->InternalFloatPoint,this->InternalFloatPoint);
00096     return this->InternalFloatPoint; };
00097   float *TransformFloatNormal(const float normal[3]) {
00098     return this->TransformFloatNormal(normal[0],normal[1],normal[2]); };
00100 
00102 
00104   double *TransformDoubleNormal(double x, double y, double z) {
00105     this->InternalDoublePoint[0] = x;
00106     this->InternalDoublePoint[1] = y;
00107     this->InternalDoublePoint[2] = z;
00108     this->TransformNormal(this->InternalDoublePoint,this->InternalDoublePoint);
00109     return this->InternalDoublePoint; };
00110   double *TransformDoubleNormal(const double normal[3]) {
00111     return this->TransformDoubleNormal(normal[0],normal[1],normal[2]); };
00113 
00115 
00117   double *TransformVector(double x, double y, double z) {
00118     return this->TransformDoubleVector(x,y,z); }
00119   double *TransformVector(const double normal[3]) {
00120     return this->TransformDoubleVector(normal[0],normal[1],normal[2]); };
00122 
00124 
00126   void TransformVector(const float in[3], float out[3]) {
00127     this->Update(); this->InternalTransformVector(in,out); };
00129 
00131 
00133   void TransformVector(const double in[3], double out[3]) {
00134     this->Update(); this->InternalTransformVector(in,out); };
00136 
00138 
00140   float *TransformFloatVector(float x, float y, float z) {
00141       this->InternalFloatPoint[0] = x;
00142       this->InternalFloatPoint[1] = y;
00143       this->InternalFloatPoint[2] = z;
00144       this->TransformVector(this->InternalFloatPoint,this->InternalFloatPoint);
00145       return this->InternalFloatPoint; };
00146   float *TransformFloatVector(const float vec[3]) {
00147     return this->TransformFloatVector(vec[0],vec[1],vec[2]); };
00149 
00151 
00153   double *TransformDoubleVector(double x, double y, double z) {
00154     this->InternalDoublePoint[0] = x;
00155     this->InternalDoublePoint[1] = y;
00156     this->InternalDoublePoint[2] = z;
00157     this->TransformVector(this->InternalDoublePoint,this->InternalDoublePoint);
00158     return this->InternalDoublePoint; };
00159   double *TransformDoubleVector(const double vec[3]) {
00160     return this->TransformDoubleVector(vec[0],vec[1],vec[2]); };
00162 
00165   void TransformPoints(vtkPoints *inPts, vtkPoints *outPts);
00166 
00169   virtual void TransformNormals(vtkDataArray *inNms, vtkDataArray *outNms);
00170 
00173   virtual void TransformVectors(vtkDataArray *inVrs, vtkDataArray *outVrs);
00174 
00176 
00178   void TransformPointsNormalsVectors(vtkPoints *inPts, 
00179                                      vtkPoints *outPts, 
00180                                      vtkDataArray *inNms, 
00181                                      vtkDataArray *outNms,
00182                                      vtkDataArray *inVrs, 
00183                                      vtkDataArray *outVrs);
00185 
00187 
00189   vtkLinearTransform *GetLinearInverse() { 
00190     return (vtkLinearTransform *)this->GetInverse(); }; 
00192 
00194 
00196   void InternalTransformPoint(const float in[3], float out[3]);
00197   void InternalTransformPoint(const double in[3], double out[3]);
00199 
00201 
00203   virtual void InternalTransformNormal(const float in[3], float out[3]);
00204   virtual void InternalTransformNormal(const double in[3], double out[3]);
00206 
00208 
00210   virtual void InternalTransformVector(const float in[3], float out[3]);
00211   virtual void InternalTransformVector(const double in[3], double out[3]);
00213 
00215 
00217   void InternalTransformDerivative(const float in[3], float out[3],
00218                                    float derivative[3][3]);
00219   void InternalTransformDerivative(const double in[3], double out[3],
00220                                    double derivative[3][3]);
00222 
00223 protected:
00224   vtkLinearTransform() {};
00225   ~vtkLinearTransform() {};
00226 private:
00227   vtkLinearTransform(const vtkLinearTransform&);  // Not implemented.
00228   void operator=(const vtkLinearTransform&);  // Not implemented.
00229 };
00230 
00231 #endif
00232 
00233 
00234 
00235 
00236 

Generated on Thu Mar 28 14:19:15 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001