#ifndef ROOT_TGLClip
#define ROOT_TGLClip
#include "TGLPhysicalShape.h"
#include "TGLOverlay.h"
class TGLRnrCtx;
class TGLManipSet;
class TGLClip : public TGLPhysicalShape
{
public:
enum EMode { kOutside,
kInside
};
private:
EMode fMode;
UInt_t fTimeStamp;
public:
TGLClip(const TGLLogicalShape & logical, const TGLMatrix & transform, const float color[4]);
virtual ~TGLClip();
virtual void Modified() { TGLPhysicalShape::Modified(); IncTimeStamp(); }
virtual void Setup(const TGLBoundingBox & bbox) = 0;
EMode GetMode() const { return fMode; }
void SetMode(EMode mode) { if (mode != fMode) { fMode = mode; ++fTimeStamp; } }
UInt_t TimeStamp() const { return fTimeStamp; }
void IncTimeStamp() { ++fTimeStamp; }
virtual void Draw(TGLRnrCtx & rnrCtx) const;
virtual void PlaneSet(TGLPlaneSet_t & set) const = 0;
ClassDef(TGLClip,0);
};
class TGLClipPlane : public TGLClip
{
private:
static const float fgColor[4];
public:
TGLClipPlane();
virtual ~TGLClipPlane();
virtual void Setup(const TGLBoundingBox & bbox);
void Set(const TGLPlane & plane);
virtual void PlaneSet(TGLPlaneSet_t & set) const;
ClassDef(TGLClipPlane, 0);
};
class TGLClipBox : public TGLClip
{
private:
static const float fgColor[4];
public:
TGLClipBox();
virtual ~TGLClipBox();
virtual void Setup(const TGLBoundingBox & bbox);
virtual void PlaneSet(TGLPlaneSet_t & set) const;
ClassDef(TGLClipBox, 0);
};
class TGLClipSet : public TGLOverlayElement
{
protected:
TGLClipPlane *fClipPlane;
TGLClipBox *fClipBox;
TGLClip *fCurrentClip;
Bool_t fShowClip;
Bool_t fShowManip;
TGLManipSet *fManip;
public:
TGLClipSet();
virtual ~TGLClipSet();
virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
virtual Bool_t MouseStillInside(TGLOvlSelectRecord& selRec);
virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec,
Event_t* event);
virtual void MouseLeave();
virtual void Render(TGLRnrCtx& rnrCtx);
Bool_t IsClipping() const { return fCurrentClip != 0; }
TGLClip* GetCurrentClip() const { return fCurrentClip; }
void FillPlaneSet(TGLPlaneSet_t& set) const;
void SetupClips(const TGLBoundingBox& sceneBBox);
void GetClipState(EClipType type, Double_t data[6]) const;
void SetClipState(EClipType type, const Double_t data[6]);
EClipType GetClipType() const;
void SetClipType(EClipType type);
Bool_t GetShowManip() const { return fShowManip; }
void SetShowManip(Bool_t show) { fShowManip = show; }
Bool_t GetShowClip() const { return fShowClip; }
void SetShowClip(Bool_t show) { fShowClip = show; }
ClassDef(TGLClipSet, 0);
};
#endif
Last change: Mon Nov 24 08:19:09 2008
Last generated: 2008-11-24 08:19
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.