OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / ALPHALINUX5 / util / ALPHALINUX5 / include / vtk / vtkMatrix4x4.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkMatrix4x4.h,v $
5   Language:  C++
6   Date:      $Date: 2002/02/01 06:35:44 $
7   Version:   $Revision: 1.1.1.1 $
8
9
10 Copyright (c) 1993-1998 Ken Martin, Will Schroeder, Bill Lorensen.
11
12 This software is copyrighted by Ken Martin, Will Schroeder and Bill Lorensen.
13 The following terms apply to all files associated with the software unless
14 explicitly disclaimed in individual files. This copyright specifically does
15 not apply to the related textbook "The Visualization Toolkit" ISBN
16 013199837-4 published by Prentice Hall which is covered by its own copyright.
17
18 The authors hereby grant permission to use, copy, and distribute this
19 software and its documentation for any purpose, provided that existing
20 copyright notices are retained in all copies and that this notice is included
21 verbatim in any distributions. Additionally, the authors grant permission to
22 modify this software and its documentation for any purpose, provided that
23 such modifications are not distributed without the explicit consent of the
24 authors and that existing copyright notices are retained in all copies. Some
25 of the algorithms implemented by this software are patented, observe all
26 applicable patent law.
27
28 IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
29 DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
30 OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
31 EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33 THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
34 BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
35 PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE IS PROVIDED ON AN
36 "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
37 MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
38
39
40 =========================================================================*/
41 // .NAME vtkMatrix4x4 - represent and manipulate 4x4 transformation matrices
42 // .SECTION Description
43 // vtkMatrix4x4 is a class to represent and manipulate 4x4 matrices. 
44 // Specifically, it is designed to work on 4x4 transformation matrices
45 // found in 3D rendering using homogeneous coordinates [x y z w].
46
47 // .SECTION See Also
48 // vtkTransform
49
50 #ifndef __vtkMatrix4x4_h
51 #define __vtkMatrix4x4_h
52
53 #include "vtkObject.h"
54
55 class VTK_EXPORT vtkMatrix4x4 : public vtkObject
56 {
57  public:
58   float Element[4][4];
59   //  A 4 x 4 matrix.
60   vtkMatrix4x4 ();
61   vtkMatrix4x4 (const vtkMatrix4x4& m);
62   static vtkMatrix4x4 *New() {return new vtkMatrix4x4;};
63   const char *GetClassName () {return "vtkMatrix4x4";};
64   void PrintSelf (ostream& os, vtkIndent indent);
65
66   void operator= (float element);
67   vtkMatrix4x4& operator= (const vtkMatrix4x4& source);
68   float *operator[](const unsigned int i) {return &(Element[i][0]);};
69
70   void Invert (vtkMatrix4x4 in,vtkMatrix4x4 & out);
71   void Invert (void) { Invert(*this,*this);};
72
73   void Transpose (vtkMatrix4x4 in,vtkMatrix4x4 & out);
74   void Transpose (void) { Transpose(*this,*this);};
75
76   void MultiplyPoint(float in[4], float out[4]);
77   void PointMultiply(float in[4], float out[4]);
78   void Adjoint (vtkMatrix4x4 & in,vtkMatrix4x4 & out);
79   float Determinant (vtkMatrix4x4 & in);
80   void SetElement(int i, int j, float value);
81   float GetElement(int i, int j);
82 };
83
84 // Description:
85 // Sets the element i,j in the matrix.
86 inline void vtkMatrix4x4::SetElement (int i, int j, float value)
87 {
88   if (this->Element[i][j] != value)
89     {
90     this->Element[i][j] = value;
91     this->Modified ();
92     }
93 }
94
95 // Description:
96 // Returns the element i,j from the matrix.
97 inline float vtkMatrix4x4::GetElement (int i, int j)
98 {
99   return this->Element[i][j];
100 }
101 #endif