00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGLScenePad
00013 #define ROOT_TGLScenePad
00014
00015 #ifndef ROOT_TGLScene
00016 #include "TGLScene.h"
00017 #endif
00018 #ifndef ROOT_TVirtualViewer3D
00019 #include "TVirtualViewer3D.h"
00020 #endif
00021 #ifndef ROOT_CsgOps
00022 #include "CsgOps.h"
00023 #endif
00024
00025
00026 class TGLViewer;
00027 class TGLFaceSet;
00028
00029
00030 class TGLScenePad : public TVirtualViewer3D, public TGLScene {
00031
00032 private:
00033 TGLScenePad(const TGLScenePad&);
00034 TGLScenePad& operator=(const TGLScenePad&);
00035
00036 protected:
00037 TVirtualPad* fPad;
00038
00039
00040 Bool_t fInternalPIDs;
00041 UInt_t fNextInternalPID;
00042 UInt_t fLastPID;
00043 Int_t fAcceptedPhysicals;
00044
00045 Int_t ValidateObjectBuffer(const TBuffer3D& buffer, Bool_t includeRaw) const;
00046 TGLLogicalShape* CreateNewLogical(const TBuffer3D & buffer) const;
00047 TGLPhysicalShape* CreateNewPhysical(UInt_t physicalID, const TBuffer3D& buffer,
00048 const TGLLogicalShape& logical) const;
00049
00050
00051 typedef std::pair<UInt_t, RootCsg::TBaseMesh*> CSPart_t;
00052 mutable TGLFaceSet *fComposite;
00053 UInt_t fCSLevel;
00054 std::vector<CSPart_t> fCSTokens;
00055 RootCsg::TBaseMesh* BuildComposite();
00056
00057 TGLLogicalShape* AttemptDirectRenderer(TObject* id);
00058
00059 Bool_t fSmartRefresh;
00060
00061 public:
00062 TGLScenePad(TVirtualPad* pad);
00063 virtual ~TGLScenePad() {}
00064
00065 TVirtualPad* GetPad() const { return fPad; }
00066
00067
00068
00069 void AddHistoPhysical(TGLLogicalShape* log);
00070 void SubPadPaint(TVirtualPad* pad);
00071
00072
00073 virtual void PadPaintFromViewer(TGLViewer* viewer);
00074
00075 Bool_t GetSmartRefresh() const { return fSmartRefresh; }
00076 void SetSmartRefresh(Bool_t smart_ref) { fSmartRefresh = smart_ref; }
00077
00078
00079
00080
00081 virtual Bool_t CanLoopOnPrimitives() const { return kTRUE; }
00082 virtual void PadPaint(TVirtualPad* pad);
00083 virtual void ObjectPaint(TObject* obj, Option_t* opt="");
00084
00085
00086 virtual Int_t DistancetoPrimitive(Int_t , Int_t ) { return 9999; }
00087 virtual void ExecuteEvent(Int_t , Int_t , Int_t ) {}
00088
00089 virtual Bool_t PreferLocalFrame() const { return kTRUE; }
00090
00091 virtual void BeginScene();
00092 virtual Bool_t BuildingScene() const { return CurrentLock() == kModifyLock; }
00093 virtual void EndScene();
00094
00095 virtual Int_t AddObject(const TBuffer3D& buffer, Bool_t* addChildren = 0);
00096 virtual Int_t AddObject(UInt_t physicalID, const TBuffer3D& buffer, Bool_t* addChildren = 0);
00097 virtual Bool_t OpenComposite(const TBuffer3D& buffer, Bool_t* addChildren = 0);
00098 virtual void CloseComposite();
00099 virtual void AddCompositeOp(UInt_t operation);
00100
00101 ClassDef(TGLScenePad, 0);
00102 };
00103
00104 #endif