library: libRGL #include "TGLUtil.h" |
TGLMatrix
class description - header file - source file
viewCVS header - viewCVS source
class TGLMatrix
Function Members (Methods)
Display options:
public:
| TGLMatrix() |
| TGLMatrix(const TGLVertex3& translation) |
| TGLMatrix(const Double_t* vals) |
| TGLMatrix(const TGLMatrix& other) |
| TGLMatrix(Double_t x, Double_t y, Double_t z) |
| TGLMatrix(const TGLVertex3& origin, const TGLVector3& zAxis, const TGLVector3* xAxis = 0) |
virtual | ~TGLMatrix() |
Double_t* | Arr() |
const Double_t* | CArr() const |
static TClass* | Class() |
void | Dump() const |
TGLVector3 | GetScale() const |
TGLVertex3 | GetTranslation() const |
virtual TClass* | IsA() const |
TGLMatrix& | operator=(const TGLMatrix& rhs) |
Double_t& | operator[](Int_t index) |
Double_t | operator[](Int_t index) const |
void | Rotate(const TGLVertex3& pivot, const TGLVector3& axis, Double_t angle) |
void | Scale(const TGLVector3& scale) |
void | Set(const Double_t* vals) |
void | Set(const TGLVertex3& origin, const TGLVector3& zAxis, const TGLVector3* xAxis = 0) |
void | SetIdentity() |
void | SetTranslation(const TGLVertex3& translation) |
void | SetTranslation(Double_t x, Double_t y, Double_t z) |
virtual void | ShowMembers(TMemberInspector& insp, char* parent) |
virtual void | Streamer(TBuffer& b) |
void | StreamerNVirtual(TBuffer& b) |
void | TransformVertex(TGLVertex3& vertex) const |
void | Translate(const TGLVector3& vect) |
void | Transpose3x3() |
Data Members
private:
Double_t | fVals[16] | Column MAJOR as per OGL |
TGLVertex3
3 component (x/y/z) vertex class
This is part of collection of simple utility classes for GL only in
TGLUtil.h/cxx. These provide const and non-const accessors Arr() &
CArr() to a GL compatible internal field - so can be used directly
with OpenGL C API calls - which TVector3 etc cannot (easily).
They are not intended to be fully featured just provide minimum
required.
TGLMatrix()
Construct default identity matrix:
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
TGLMatrix(const TGLVertex3 & translation)
Construct matrix with translation components x,y,z:
1 0 0 translation.X()
0 1 0 translation.Y()
0 0 1 translation.Z()
0 0 0 1
TGLMatrix(const TGLVertex3 & origin, const TGLVector3 & zAxis, const TGLVector3 * xAxis)
Construct matrix which when applied puts local origin at
'origin' and the local Z axis in direction 'z'. Both
'origin' and 'zAxisVec' are expressed in the parent frame
TGLMatrix(const Double_t vals[16])
Construct matrix using the 16 Double_t 'vals' passed,
ordering is maintained - i.e. should be column major
as we are
void Set(const TGLVertex3 & origin, const TGLVector3 & zAxis, const TGLVector3 * xAxis)
Set matrix which when applied puts local origin at
'origin' and the local Z axis in direction 'z'. Both
'origin' and 'z' are expressed in the parent frame
void Set(const Double_t vals[16])
Set matrix using the 16 Double_t 'vals' passed,
ordering is maintained - i.e. should be column major
as we are
void SetIdentity()
Set matrix to identity:
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
void SetTranslation(const TGLVertex3 & translation)
Set matrix translation components x,y,z:
. . . translation.X()
. . . translation.Y()
. . . translation.Z()
. . . .
. = Exisiting component value - NOT modified
void Translate(const TGLVector3 & vect)
Offset (shift) matrix translation components by 'vect'
. . . . + vect.X()
. . . . + vect.Y()
. . . . + vect.Z()
. . . .
. = Exisiting component value - NOT modified
void Scale(const TGLVector3 & scale)
Set matrix axis scales to 'scale'. Note - this really sets
the overall (total) scaling for each axis - it does NOT
apply compounded scale on top of existing one
void Rotate(const TGLVertex3 & pivot, const TGLVector3 & axis, Double_t angle)
Update martix so resulting transform has been rotated about 'pivot'
(in parent frame), round vector 'axis', through 'angle' (radians)
Equivalent to glRotate function, but with addition of translation
and compounded on top of existing.
void Transpose3x3()
Transpose the top left 3x3 matrix component along major diagonal
Supported as currently incompatability between TGeo and GL matrix
layouts for this 3x3 only. To be resolved.
void Dump()
Output 16 matrix components to std::cout
0 4 8 12
1 5 9 13
2 6 10 14
3 7 11 15
Author: Richard Maunder 25/05/2005
Last update: root/gl:$Name: $:$Id: TGLUtil.cxx,v 1.33 2006/12/13 09:33:29 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.