#include "TGLObject.h"
#include "TGLRnrCtx.h"
#include "TObject.h"
#include "TClass.h"
#include "TBaseClass.h"
#include "TList.h"
#include "TString.h"
#include "TAtt3D.h"
#include "TAttBBox.h"
ClassImp(TGLObject);
TMap TGLObject::fgGLClassMap;
Bool_t TGLObject::ShouldDLCache(const TGLRnrCtx & rnrCtx) const
{
if (!fDLCache ||
!fScene ||
(rnrCtx.SecSelection() && SupportsSecondarySelect()) ||
(fMultiColor && (rnrCtx.HighlightOutline() || rnrCtx.IsDrawPassOutlineLine())))
{
return kFALSE;
}
return kTRUE;
}
void TGLObject::UpdateBoundingBox()
{
SetBBox();
UpdateBoundingBoxesOfPhysicals();
}
Bool_t TGLObject::SetModelCheckClass(TObject* obj, TClass* cls)
{
if(obj->InheritsFrom(cls) == kFALSE) {
Warning("TGLObject::SetModelCheckClass", "object of wrong class passed.");
return kFALSE;
}
fExternalObj = obj;
return kTRUE;
}
void TGLObject::SetAxisAlignedBBox(Float_t xmin, Float_t xmax,
Float_t ymin, Float_t ymax,
Float_t zmin, Float_t zmax)
{
fBoundingBox.SetAligned(TGLVertex3(xmin, ymin, zmin),
TGLVertex3(xmax, ymax, zmax));
}
void TGLObject::SetAxisAlignedBBox(const Float_t* p)
{
SetAxisAlignedBBox(p[0], p[1], p[2], p[3], p[4], p[5]);
}
TClass* TGLObject::SearchGLRenderer(TClass* cls)
{
TString rnr( cls->GetName() );
rnr += "GL";
TClass* c = TClass::GetClass(rnr);
if (c != 0)
return c;
TList* bases = cls->GetListOfBases();
if (bases == 0 || bases->IsEmpty())
return 0;
TIter next_base(bases);
TBaseClass* bc;
while ((bc = (TBaseClass*) next_base()) != 0) {
cls = bc->GetClassPointer();
if ((c = SearchGLRenderer(cls)) != 0) {
return c;
}
}
return 0;
}
TClass* TGLObject::GetGLRenderer(TClass* isa)
{
TPair* p = (TPair*) fgGLClassMap.FindObject(isa);
TClass* cls;
if (p != 0) {
cls = (TClass*) p->Value();
} else {
cls = SearchGLRenderer(isa);
fgGLClassMap.Add(isa, cls);
}
return cls;
}
Last change: Wed Jun 25 08:41:05 2008
Last generated: 2008-06-25 08:41
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.