Go to the documentation of this file.00001 #include "Fireworks/Core/src/FWGeoTopNodeScene.h"
00002 #include "Fireworks/Core/interface/FWGeoTopNode.h"
00003 #include "Fireworks/Core/interface/fwLog.h"
00004
00005 #include "TGLSelectRecord.h"
00006 #include "TGLPhysicalShape.h"
00007 #include "TGLLogicalShape.h"
00008 #include "TGeoVolume.h"
00009 #include "TBuffer3D.h"
00010
00011
00012
00013 FWGeoTopNodeGLScene::FWGeoTopNodeGLScene(TVirtualPad* pad) :
00014 TGLScenePad(pad),
00015
00016 fTopNodeJebo(0)
00017 {
00018
00019
00020 fTitle="JeboScene";
00021 }
00022
00023
00024 Bool_t FWGeoTopNodeGLScene::OpenCompositeWithPhyID(UInt_t phyID, const TBuffer3D& buffer)
00025 {
00026
00027
00028
00029
00030 if (fComposite) {
00031 Error("FWGeoTopNodeGLScene::OpenComposite", "composite already open");
00032 return kFALSE;
00033 }
00034
00035 UInt_t extraSections = TGLScenePad::AddObject(phyID, buffer, 0);
00036 if (extraSections != TBuffer3D::kNone) {
00037 Error("FWGeoTopNodeGLScene::OpenComposite", "expected top level composite to not require extra buffer sections");
00038 }
00039
00040
00041
00042 if (fComposite) {
00043 return kTRUE;
00044 } else {
00045 return kFALSE;
00046 }
00047 }
00048
00049
00050 Int_t FWGeoTopNodeGLScene::AddObject(const TBuffer3D& buffer, Bool_t* addChildren)
00051 {
00052 if (fComposite)
00053 {
00054
00055 int ns = TGLScenePad::AddObject(1, buffer, addChildren);
00056 return ns;
00057 }
00058 else
00059 {
00060 fwLog(fwlog::kError)<< "FWGeoTopNodeGLScene::AddObject() should not be called if fNextCompositeID \n";
00061 return TGLScenePad::AddObject(buffer, addChildren);
00062 }
00063 }
00064
00065
00066 Bool_t FWGeoTopNodeGLScene::ResolveSelectRecord(TGLSelectRecord& rec, Int_t curIdx)
00067 {
00068
00069
00070
00071
00072
00073
00074 if (curIdx >= rec.GetN())
00075 return kFALSE;
00076
00077 TGLPhysicalShape* pshp = FindPhysical(rec.GetItem(curIdx));
00078
00079
00080
00081
00082
00083
00084 if (pshp)
00085 {
00086 rec.SetTransparent(pshp->IsTransparent());
00087 rec.SetPhysShape(pshp);
00088 rec.SetLogShape(FindLogical(fTopNodeJebo));
00089 rec.SetObject(fTopNodeJebo);
00090 rec.SetSpecific(0);
00091 return kTRUE;
00092 }
00093 return kFALSE;
00094 }
00095
00096
00097 void FWGeoTopNodeGLScene::GeoPopupMenu(Int_t gx, Int_t gy)
00098 {fTopNodeJebo->popupMenu(gx, gy);
00099 }