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 =========================================================================*/
00052 #ifndef __vtkLinearTransform_h
00053 #define __vtkLinearTransform_h
00054 
00055 #include "vtkHomogeneousTransform.h"
00056 
00057 class VTK_EXPORT vtkLinearTransform : public vtkHomogeneousTransform
00058 {
00059 public:
00060 
00061   vtkTypeMacro(vtkLinearTransform,vtkHomogeneousTransform);
00062   void PrintSelf(ostream& os, vtkIndent indent);
00063 
00066   void TransformNormal(const float in[3], float out[3]) {
00067     this->Update(); this->InternalTransformNormal(in,out); };
00068 
00071   void TransformNormal(const double in[3], double out[3]) {
00072     this->Update(); this->InternalTransformNormal(in,out); };
00073 
00076   double *TransformNormal(double x, double y, double z) {
00077     return this->TransformDoubleNormal(x,y,z); }
00078   double *TransformNormal(const double normal[3]) {
00079     return this->TransformDoubleNormal(normal[0],normal[1],normal[2]); };
00080 
00083   float *TransformFloatNormal(float x, float y, float z) {
00084     this->InternalFloatPoint[0] = x;
00085     this->InternalFloatPoint[1] = y;
00086     this->InternalFloatPoint[2] = z;
00087     this->TransformNormal(this->InternalFloatPoint,this->InternalFloatPoint);
00088     return this->InternalFloatPoint; };
00089   float *TransformFloatNormal(const float normal[3]) {
00090     return this->TransformFloatNormal(normal[0],normal[1],normal[2]); };
00091 
00094   double *TransformDoubleNormal(double x, double y, double z) {
00095     this->InternalDoublePoint[0] = x;
00096     this->InternalDoublePoint[1] = y;
00097     this->InternalDoublePoint[2] = z;
00098     this->TransformNormal(this->InternalDoublePoint,this->InternalDoublePoint);
00099     return this->InternalDoublePoint; };
00100   double *TransformDoubleNormal(const double normal[3]) {
00101     return this->TransformDoubleNormal(normal[0],normal[1],normal[2]); };
00102 
00105   double *TransformVector(double x, double y, double z) {
00106     return this->TransformDoubleVector(x,y,z); }
00107   double *TransformVector(const double normal[3]) {
00108     return this->TransformDoubleVector(normal[0],normal[1],normal[2]); };
00109 
00112   void TransformVector(const float in[3], float out[3]) {
00113     this->Update(); this->InternalTransformVector(in,out); };
00114 
00117   void TransformVector(const double in[3], double out[3]) {
00118     this->Update(); this->InternalTransformVector(in,out); };
00119 
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]); };
00130 
00133   double *TransformDoubleVector(double x, double y, double z) {
00134     this->InternalDoublePoint[0] = x;
00135     this->InternalDoublePoint[1] = y;
00136     this->InternalDoublePoint[2] = z;
00137     this->TransformVector(this->InternalDoublePoint,this->InternalDoublePoint);
00138     return this->InternalDoublePoint; };
00139   double *TransformDoubleVector(const double vec[3]) {
00140     return this->TransformDoubleVector(vec[0],vec[1],vec[2]); };
00141 
00144   void TransformPoints(vtkPoints *inPts, vtkPoints *outPts);
00145 
00148   virtual void TransformNormals(vtkNormals *inNms, vtkNormals *outNms);
00149 
00152   virtual void TransformVectors(vtkVectors *inVrs, vtkVectors *outVrs);
00153 
00156   void TransformPointsNormalsVectors(vtkPoints *inPts, 
00157                  vtkPoints *outPts, 
00158                  vtkNormals *inNms, 
00159                  vtkNormals *outNms,
00160                  vtkVectors *inVrs, 
00161                  vtkVectors *outVrs);
00162 
00165   vtkLinearTransform *GetLinearInverse() { 
00166     return (vtkLinearTransform *)this->GetInverse(); }; 
00167 
00170   void InternalTransformPoint(const float in[3], float out[3]);
00171   void InternalTransformPoint(const double in[3], double out[3]);
00172 
00175   virtual void InternalTransformNormal(const float in[3], float out[3]);
00176   virtual void InternalTransformNormal(const double in[3], double out[3]);
00177 
00180   virtual void InternalTransformVector(const float in[3], float out[3]);
00181   virtual void InternalTransformVector(const double in[3], double out[3]);
00182 
00185   void InternalTransformDerivative(const float in[3], float out[3],
00186                float derivative[3][3]);
00187   void InternalTransformDerivative(const double in[3], double out[3],
00188                double derivative[3][3]);
00189 
00190 protected:
00191   vtkLinearTransform() {};
00192   ~vtkLinearTransform() {};
00193   vtkLinearTransform(const vtkLinearTransform&) {};
00194   void operator=(const vtkLinearTransform&) {};
00195 };
00196 
00197 #endif
00198 
00199 
00200 
00201 
00202 

Generated on Wed Nov 21 12:26:52 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001