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

common/vtkGeneralTransform.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGeneralTransform.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 =========================================================================*/
00059 #include "vtkAbstractTransform.h"
00060 
00061 #ifndef __vtkGeneralTransform_h
00062 #define __vtkGeneralTransform_h
00063 
00064 class VTK_EXPORT vtkGeneralTransform : public vtkAbstractTransform
00065 {
00066 public:
00067   static vtkGeneralTransform *New();
00068 
00069   vtkTypeMacro(vtkGeneralTransform,vtkAbstractTransform);
00070   void PrintSelf(ostream& os, vtkIndent indent);
00071   
00075   void Identity() { this->Concatenation->Identity(); this->Modified(); };
00076 
00080   void Inverse() { this->Concatenation->Inverse(); this->Modified(); };
00081 
00084   void Translate(double x, double y, double z) {
00085     this->Concatenation->Translate(x,y,z); };
00086   void Translate(const double x[3]) { this->Translate(x[0], x[1], x[2]); };
00087   void Translate(const float x[3]) { this->Translate(x[0], x[1], x[2]); };
00088 
00093   void RotateWXYZ(double angle, double x, double y, double z) {
00094     this->Concatenation->Rotate(angle,x,y,z); };
00095   void RotateWXYZ(double angle, const double axis[3]) {
00096     this->RotateWXYZ(angle, axis[0], axis[1], axis[2]); };
00097   void RotateWXYZ(double angle, const float axis[3]) {
00098     this->RotateWXYZ(angle, axis[0], axis[1], axis[2]); };
00099 
00103   void RotateX(double angle) { this->RotateWXYZ(angle, 1, 0, 0); };
00104   void RotateY(double angle) { this->RotateWXYZ(angle, 0, 1, 0); };
00105   void RotateZ(double angle) { this->RotateWXYZ(angle, 0, 0, 1); };
00106 
00110   void Scale(double x, double y, double z) {
00111     this->Concatenation->Scale(x,y,z); };
00112   void Scale(const double s[3]) { this->Scale(s[0], s[1], s[2]); };
00113   void Scale(const float s[3]) { this->Scale(s[0], s[1], s[2]); };
00114 
00117   void Concatenate(vtkMatrix4x4 *matrix) { 
00118     this->Concatenate(*matrix->Element); };
00119   void Concatenate(const double elements[16]) {
00120     this->Concatenation->Concatenate(elements); };
00121 
00127   void Concatenate(vtkAbstractTransform *transform);
00128 
00134   void PreMultiply() { 
00135     if (this->Concatenation->GetPreMultiplyFlag()) { return; }
00136     this->Concatenation->SetPreMultiplyFlag(1); this->Modified(); };
00137 
00143   void PostMultiply()  { 
00144     if (!this->Concatenation->GetPreMultiplyFlag()) { return; }
00145     this->Concatenation->SetPreMultiplyFlag(0); this->Modified(); };
00146 
00148   void Push() { if (this->Stack == NULL) { 
00149                     this->Stack = vtkTransformConcatenationStack::New(); }
00150                 this->Stack->Push(&this->Concatenation); 
00151                 this->Modified(); };
00152 
00155   void Pop() { if (this->Stack == NULL) { return; }
00156                this->Stack->Pop(&this->Concatenation);
00157                this->Modified(); };
00158 
00163   void SetInput(vtkAbstractTransform *input);
00164   vtkAbstractTransform *GetInput() { return this->Input; };
00165 
00168   void InternalTransformPoint(const float in[3], float out[3]);
00169   void InternalTransformPoint(const double in[3], double out[3]);
00170 
00173   void InternalTransformDerivative(const float in[3], float out[3],
00174                float derivative[3][3]);
00175   void InternalTransformDerivative(const double in[3], double out[3],
00176                double derivative[3][3]);
00177 
00184   int CircuitCheck(vtkAbstractTransform *transform);
00185 
00187   vtkAbstractTransform *MakeTransform();
00188 
00190   unsigned long GetMTime();
00191 
00192 protected:
00193   vtkGeneralTransform();
00194   ~vtkGeneralTransform();
00195   vtkGeneralTransform(const vtkGeneralTransform&) {};
00196   void operator=(const vtkGeneralTransform&) {};
00197 
00198   void InternalDeepCopy(vtkAbstractTransform *t);
00199   void InternalUpdate();
00200 
00201   vtkAbstractTransform *Input;
00202   vtkTransformConcatenation *Concatenation;
00203   vtkTransformConcatenationStack *Stack;
00204 };
00205 
00206 
00207 #endif
00208 
00209 
00210 
00211 
00212 

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