ROOT » GRAF3D » EVE » TEveTrans

class TEveTrans: public TObject


 TEveTrans is a 4x4 transformation matrix for homogeneous coordinates
 stored internaly in a column-major order to allow direct usage by
 GL. The element type is Double32_t as statically the floats would
 be precise enough but continuous operations on the matrix must
 retain precision of column vectors.

 Cartan angles are stored in fA[1-3] (+z, -y, +x). They are
 recalculated on demand.

 Direct  element access (first two should be used with care):
 operator[i]    direct access to elements,   i:0->15
 CM(i,j)        element 4*j + i;           i,j:0->3    { CM ~ c-matrix }
 operator(i,j)  element 4*(j-1) + i - 1    i,j:1->4

 Column-vector access:
 USet Get/SetBaseVec(), Get/SetPos() and Arr[XYZT]() methods.

 For all methods taking the matrix indices:
 1->X, 2->Y, 3->Z; 4->Position (if applicable). 0 reserved for time.

 Shorthands in method-names:
 LF ~ LocalFrame; PF ~ ParentFrame; IP ~ InPlace

Function Members (Methods)

public:
virtual~TEveTrans()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
Double_t*Array()
const Double_t*Array() const
Double_t*ArrT()
const Double_t*ArrT() const
Double_t*ArrX()
const Double_t*ArrX() const
Double_t*ArrY()
const Double_t*ArrY() const
Double_t*ArrZ()
const Double_t*ArrZ() const
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
Double_tCM(Int_t i, Int_t j) const
Double_t&CM(Int_t i, Int_t j)
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
TVector3GetBaseVec(Int_t b) const
voidGetBaseVec(Int_t b, TVector3& v) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Bool_tGetEditRotation()
Bool_tGetEditScale()
Bool_tGetEditTrans() const
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TVector3GetPos() const
voidGetPos(Double_t* x) const
voidGetPos(Float_t* x) const
voidGetPos(TVector3& v) const
voidGetPos(Double_t& x, Double_t& y, Double_t& z) const
voidGetRotAngles(Float_t* x) const
voidGetScale(Double_t& sx, Double_t& sy, Double_t& sz) const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Bool_tGetUseTrans() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
Double_tInvert()
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
Bool_tIsScale(Double_t low = 0.90000000000000002, Double_t high = 1.1000000000000001) const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
voidMove(const TEveTrans& a, Int_t ai, Double_t amount)
voidMove3(const TEveTrans& a, Double_t x, Double_t y, Double_t z)
voidMove3LF(Double_t x, Double_t y, Double_t z)
voidMove3PF(Double_t x, Double_t y, Double_t z)
voidMoveLF(Int_t ai, Double_t amount)
voidMovePF(Int_t ai, Double_t amount)
TVector3Multiply(const TVector3& v, Double_t w = 1) const
voidMultiply(const Double_t* vin, Double_t* vout, Double_t w = 1) const
voidMultiplyIP(TVector3& v, Double_t w = 1) const
voidMultiplyIP(Double_t* v, Double_t w = 1) const
voidMultiplyIP(Float_t* v, Double_t w = 1) const
voidMultLeft(const TEveTrans& t)
voidMultRight(const TEveTrans& t)
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
Double_toperator()(Int_t i, Int_t j) const
Double_t&operator()(Int_t i, Int_t j)
TEveTransoperator*(const TEveTrans& t)
voidoperator*=(const TEveTrans& t)
TEveTrans&operator=(const TEveTrans& t)
Double_toperator[](Int_t i) const
Double_t&operator[](Int_t i)
voidOrtoNorm3()
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
TVector3Rotate(const TVector3& v) const
voidRotate(const TEveTrans& a, Int_t i1, Int_t i2, Double_t amount)
voidRotateIP(TVector3& v) const
voidRotateIP(Double_t* v) const
voidRotateIP(Float_t* v) const
voidRotateLF(Int_t i1, Int_t i2, Double_t amount)
voidRotatePF(Int_t i1, Int_t i2, Double_t amount)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidScale(Double_t sx, Double_t sy, Double_t sz)
voidSetBaseVec(Int_t b, const TVector3& v)
voidSetBaseVec(Int_t b, Double_t x, Double_t y, Double_t z)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetBuffer3D(TBuffer3D& buff)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetEditRotation(Bool_t x)
voidSetEditScale(Bool_t x)
voidSetEditTrans(Bool_t v)
voidSetFrom(Double_t* carr)
voidSetFrom(const TGeoMatrix& mat)
voidSetFromArray(const Double_t[16] arr)
voidSetFromArray(const Float_t[16] arr)
voidSetGeoHMatrix(TGeoHMatrix& mat)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetPos(Double_t* x)
voidSetPos(Float_t* x)
voidSetPos(const TEveTrans& t)
voidSetPos(Double_t x, Double_t y, Double_t z)
voidSetRotByAngles(Float_t a1, Float_t a2, Float_t a3)
voidSetRotByAnyAngles(Float_t a1, Float_t a2, Float_t a3, const char* pat)
voidSetScale(Double_t sx, Double_t sy, Double_t sz)
voidSetScaleX(Double_t sx)
voidSetScaleY(Double_t sy)
voidSetScaleZ(Double_t sz)
voidSetTrans(const TEveTrans& t, Bool_t copyAngles = kTRUE)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetupFromToVec(const TEveVector& from, const TEveVector& to)
voidSetupRotation(Int_t i, Int_t j, Double_t f)
voidSetUseTrans(Bool_t v)
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TEveTrans()
TEveTrans(const TEveTrans& t)
TEveTrans(const Double_t[16] arr)
TEveTrans(const Float_t[16] arr)
voidTransposeRotationPart()
voidUnitRot()
voidUnitTrans()
Double_tUnscale()
voidUnscale(Double_t& sx, Double_t& sy, Double_t& sz)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
voidZeroTrans(Double_t w = 1.)
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
Double_tNorm3Column(Int_t col)
Double_tOrto3Column(Int_t col, Int_t ref)

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
Float_tfA1!
Float_tfA2!
Float_tfA3!
Bool_tfAsOK!
Bool_tfEditRotationedit rotation
Bool_tfEditScaleedit scale
Bool_tfEditTransedit transformation in TGedFrame
Double32_tfM[16]
Bool_tfUseTransuse transformation matrix

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TEveTrans()
 Default constructor.
TEveTrans(const TEveTrans& t)
 Constructor.
TEveTrans(const Double_t arr[16])
 Constructor.
TEveTrans(const Float_t arr[16])
 Constructor.
void UnitTrans()
 Reset matrix to unity.
void ZeroTrans(Double_t w = 1.)
 Reset matrix to zero, only the perspective scaling is set to w
 (1 by default).
void UnitRot()
 Reset rotation part of the matrix to unity.
void SetTrans(const TEveTrans& t, Bool_t copyAngles = kTRUE)
 Set matrix from another,
void SetFromArray(const Double_t arr[16])
 Set matrix from Double_t array.
void SetFromArray(const Float_t arr[16])
 Set matrix from Float_t array.
void SetupRotation(Int_t i, Int_t j, Double_t f)
 Setup the matrix as an elementary rotation.
 Optimized versions of left/right multiplication with an elementary
 rotation matrix are implemented in RotatePF/RotateLF.
 Expects identity matrix.
void SetupFromToVec(const TEveVector& from, const TEveVector& to)
 A function for creating a rotation matrix that rotates a vector called
 "from" into another vector called "to".
 Input : from[3], to[3] which both must be *normalized* non-zero vectors
 Output: mtx[3][3] -- a 3x3 matrix in colum-major form
 Authors: Tomas Möller, John Hughes
          "Efficiently Building a Matrix to Rotate One Vector to Another"
          Journal of Graphics Tools, 4(4):1-4, 1999
void MultLeft(const TEveTrans& t)
 Multiply from left: this = t * this.
void MultRight(const TEveTrans& t)
 Multiply from right: this = this * t.
TEveTrans operator*(const TEveTrans& t)
 Copy, multiply from right and return product.
 Avoid unless necessary.
void TransposeRotationPart()
 Transpose 3x3 rotation sub-matrix.
void MoveLF(Int_t ai, Double_t amount)
 Move in local-frame along axis with index ai.
void Move3LF(Double_t x, Double_t y, Double_t z)
 General move in local-frame.
void RotateLF(Int_t i1, Int_t i2, Double_t amount)
 Rotate in local frame. Does optimised version of MultRight.
void MovePF(Int_t ai, Double_t amount)
 Move in parent-frame along axis index ai.
void Move3PF(Double_t x, Double_t y, Double_t z)
 General move in parent-frame.
void RotatePF(Int_t i1, Int_t i2, Double_t amount)
 Rotate in parent frame. Does optimised version of MultLeft.
void Move(const TEveTrans& a, Int_t ai, Double_t amount)
 Move in a's coord-system along axis-index ai.
void Move3(const TEveTrans& a, Double_t x, Double_t y, Double_t z)
 General move in a's coord-system.
void Rotate(const TEveTrans& a, Int_t i1, Int_t i2, Double_t amount)
 Rotate in a's coord-system, rotating base vector with index i1
 into i2.
void SetBaseVec(Int_t b, Double_t x, Double_t y, Double_t z)
 Set base-vector with index b.
void SetBaseVec(Int_t b, const TVector3& v)
 Set base-vector with index b.
TVector3 GetBaseVec(Int_t b) const
 Get base-vector with index b.
void GetBaseVec(Int_t b, TVector3& v) const
 Get base-vector with index b.
void SetPos(Double_t x, Double_t y, Double_t z)
 Set position (base-vec 4).
void SetPos(Double_t* x)
 Set position (base-vec 4).
void SetPos(Float_t* x)
 Set position (base-vec 4).
void SetPos(const TEveTrans& t)
 Set position (base-vec 4).
void GetPos(Double_t& x, Double_t& y, Double_t& z) const
 Get position (base-vec 4).
void GetPos(Double_t* x) const
 Get position (base-vec 4).
void GetPos(Float_t* x) const
 Get position (base-vec 4).
void GetPos(TVector3& v) const
 Get position (base-vec 4).
TVector3 GetPos() const
 Get position (base-vec 4).
void SetRotByAngles(Float_t a1, Float_t a2, Float_t a3)
 Sets Rotation part as given by angles:
 a1 around z, -a2 around y, a3 around x.
void SetRotByAnyAngles(Float_t a1, Float_t a2, Float_t a3, const char* pat)
 Sets Rotation part as given by angles a1, a1, a3 and pattern pat.
 Pattern consists of "XxYyZz" characters.
 eg: x means rotate about x axis, X means rotate in negative direction
 xYz -> R_x(a3) * R_y(-a2) * R_z(a1); (standard Gled representation)
 Note that angles and pattern elements have inversed order!

 Implements Eulerian/Cardanian angles in a uniform way.
void GetRotAngles(Float_t* x) const
 Get Cardan rotation angles (pattern xYz above).
void Scale(Double_t sx, Double_t sy, Double_t sz)
 Scale matrix. Translation part untouched.
Double_t Unscale()
 Remove scaling, make all base vectors of unit length.
void Unscale(Double_t& sx, Double_t& sy, Double_t& sz)
 Remove scaling, make all base vectors of unit length.
void GetScale(Double_t& sx, Double_t& sy, Double_t& sz) const
 Deduce scales from sizes of base vectors.
void SetScale(Double_t sx, Double_t sy, Double_t sz)
 Set scaling.
void SetScaleX(Double_t sx)
 Change x scaling.
void SetScaleY(Double_t sy)
 Change y scaling.
void SetScaleZ(Double_t sz)
 Change z scaling.
void MultiplyIP(TVector3& v, Double_t w = 1) const
 Multiply vector in-place.
void MultiplyIP(Double_t* v, Double_t w = 1) const
 Multiply vector in-place.
void MultiplyIP(Float_t* v, Double_t w = 1) const
 Multiply vector in-place.
TVector3 Multiply(const TVector3& v, Double_t w = 1) const
 Multiply vector and return it.
void Multiply(const Double_t* vin, Double_t* vout, Double_t w = 1) const
 Multiply vector and fill output array vout.
void RotateIP(TVector3& v) const
 Rotate vector in-place. Translation is NOT applied.
void RotateIP(Double_t* v) const
 Rotate vector in-place. Translation is NOT applied.
void RotateIP(Float_t* v) const
 Rotate vector in-place. Translation is NOT applied.
TVector3 Rotate(const TVector3& v) const
 Rotate vector and return the rotated vector. Translation is NOT applied.
Double_t Norm3Column(Int_t col)
 Norm 3-vector in column col.
Double_t Orto3Column(Int_t col, Int_t ref)
 Orto-norm 3-vector in column col with respect to column ref.
void OrtoNorm3()
 Orto-norm columns 1 to 3.
Double_t Invert()
 Invert matrix.
 Copied from ROOT's TMatrixFCramerInv.
void Streamer(TBuffer& )
 Stream an object of class TEveTrans.
void Print(Option_t* option = "") const
 Print in reasonable format.
void SetFrom(Double_t* carr)
 Initialize from array.
void SetFrom(const TGeoMatrix& mat)
 Initialize from TGeoMatrix.
void SetGeoHMatrix(TGeoHMatrix& mat)
 Set TGeoHMatrix mat.
void SetBuffer3D(TBuffer3D& buff)
 Fill transformation part TBuffer3D core section.
Bool_t IsScale(Double_t low = 0.90000000000000002, Double_t high = 1.1000000000000001) const
 Test if the transformation is a scale.
 To be used by ROOT TGLObject descendants that potentially need to
 use GL_NORMALIZE.
 The low/high limits are expected to be squares of acutal limits.

 Ideally this should be done by the TGLViewer [but is not].
virtual ~TEveTrans()
{}
TEveTrans& operator=(const TEveTrans& t)
{ SetTrans(t); return *this; }
void operator*=(const TEveTrans& t)
{ MultRight(t); }
Double_t* Array()
 Element access
Double_t* ArrX()
Double_t* ArrY()
Double_t* ArrZ()
Double_t* ArrT()
Double_t operator[](Int_t i) const
{ return fM[i]; }
Double_t& operator[](Int_t i)
{ return fM[i]; }
Double_t CM(Int_t i, Int_t j) const
{ return fM[4*j + i]; }
Double_t& CM(Int_t i, Int_t j)
{ return fM[4*j + i]; }
Double_t operator()(Int_t i, Int_t j) const
{ return fM[4*j + i - 5]; }
Double_t& operator()(Int_t i, Int_t j)
{ return fM[4*j + i - 5]; }
Bool_t GetUseTrans() const
{ return fUseTrans; }
void SetUseTrans(Bool_t v)
{ fUseTrans = v; }
void SetEditRotation(Bool_t x)
{ fEditRotation = x; }
void SetEditScale(Bool_t x)
{ fEditScale = x; }
Bool_t GetEditRotation()
{ return fEditRotation; }
Bool_t GetEditScale()
{ return fEditScale; }
Bool_t GetEditTrans() const
{ return fEditTrans; }
void SetEditTrans(Bool_t v)
{ fEditTrans = v; }