--- /dev/null
+// $Header$
+
+#include "CLASS.h"
+#include <STEM.h>
+
+#include <TVirtualPad.h>
+#include <TColor.h>
+
+#include <TGLabel.h>
+#include <TGButton.h>
+#include <TGNumberEntry.h>
+#include <TGColorSelect.h>
+#include <TGDoubleSlider.h>
+
+using namespace Reve;
+using namespace Alieve;
+
+//______________________________________________________________________
+// XXCLASS
+//
+//
+
+ClassImp(XXCLASS)
+
+//______________________________________________________________________
+XXCLASS::XXCLASS(const TGWindow *p) :
+ TGVerticalFrame(p),
+ fM (0)
+{
+ // Constructor.
+}
+
+//______________________________________________________________________
+void XXCLASS::SetModel(STEM* m)
+{
+ // Set model object.
+
+ fM = m;
+}
+
+//______________________________________________________________________
+void XXCLASS::Changed()
+{
+ // Emit Changed signal.
+
+ Emit("Changed()");
+}
+
+//______________________________________________________________________
+//void XXCLASS::DoABCD()
+//{
+// // Set some value from some widget
+// Changed();
+//}
+
+
+//______________________________________________________________________
+// CLASS
+//
+//
+
+ClassImp(CLASS)
+
+//______________________________________________________________________
+CLASS::CLASS(const TGWindow *p, Int_t width, Int_t height,
+ UInt_t options, Pixel_t back) :
+ TGedFrame(p, width, height, options | kVerticalFrame, back),
+ fM (0),
+ fSE (0)
+{
+ // Constructor.
+
+ MakeTitle("STEM");
+
+ fSE = new XXCLASS(this);
+ AddFrame(fSE, new TGLayoutHints(kLHintsTop, 2, 0, 2, 2));
+ fSE->Connect("Changed()", "CLASS", this, "Update()");
+}
+
+/**************************************************************************/
+
+//______________________________________________________________________
+void CLASS::SetModel(TObject* obj)
+{
+ // Set model object.
+ fM = dynamic_cast<STEM*>(obj);
+ fSE->SetModel(fM);
+}
+
+/**************************************************************************/
+
+// Implements callback/slot methods
+
+//______________________________________________________________________
+// void CLASS::DoXYZZ()
+// {
+// fM->SetXYZZ(fXYZZ->GetValue());
+// Update();
+// }
--- /dev/null
+// $Header$
+
+#ifndef REVE_CLASS_H
+#define REVE_CLASS_H
+
+#include <TGedFrame.h>
+
+class TGButton;
+class TGCheckButton;
+class TGNumberEntry;
+class TGColorSelect;
+
+namespace Alieve {
+
+class STEM;
+
+class XXCLASS : public TGVerticalFrame
+{
+private:
+ XXCLASS(const XXCLASS&); // Not implemented
+ XXCLASS& operator=(const XXCLASS&); // Not implemented
+
+protected:
+ STEM *fM;
+
+public:
+ XXCLASS(const TGWindow* p);
+ virtual ~XXCLASS() {}
+
+ void SetModel(STEM* m);
+
+ void Changed(); //*SIGNAL*
+
+ // void DoABCD();
+
+ ClassDef(XXCLASS, 0) // Sub-editor for STEM
+};
+
+
+class CLASS : public TGedFrame
+{
+private:
+ CLASS(const CLASS&); // Not implemented
+ CLASS& operator=(const CLASS&); // Not implemented
+
+protected:
+ STEM *fM; // fModel dynamic-casted to STEM
+ XXCLASS *fSE;
+
+public:
+ CLASS(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground());
+ virtual ~CLASS() {}
+
+ virtual void SetModel(TObject* obj);
+
+ void DoXYZZ();
+
+ ClassDef(CLASS, 0) // Editor for STEM
+};
+
+}
+
+#endif
CLASS::CLASS() : TGLObject(), fM(0)
{
- // fCached = false; // Disable display list.
+ // fDLCache = kFALSE; // Disable display list.
}
CLASS::~CLASS()
From Massimo: constructor of AliITSsegmentationSDD has been
simplified.
+2007-10-16 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * MUONData.cxx:
+ * MUONData.h:
+ * TOFDigitsInfo.cxx:
+ * TOFSector.cxx:
+ * TOFSector.h:
+ * TOFStrip.cxx:
+ * TOFStrip.h:
+ * TPCData.cxx:
+ * TRDData.cxx:
+ * TRDModuleImp.cxx:
+ Merge from EVE-head-after-merge to HEAD.
+
+2007-10-05 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * EventAlieve.cxx:
+ * ITSModuleStepper.cxx:
+ * ITSModuleStepperEditor.cxx:
+ * PMDModuleEditor.cxx:
+ * T0Module.cxx:
+ * TOFSector.cxx:
+ * TOFStrip.cxx:
+ * TPCLoader.cxx:
+ * TPCLoaderEditor.cxx:
+ * TPCSector2D.cxx:
+ * TRDLoader.cxx:
+ * TRDLoaderImp.cxx:
+ * TRDLoaderManager.cxx:
+ * TRDModule.cxx:
+ * TRDModuleImp.cxx:
+ * alieve_main/alieve_main.cxx:
+ Renamed class RGTopFrame to ReveManager.
+
+2007-10-04 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * TPCSector3D.cxx:
+ Remove lines that were commented-out during last revision.
+
2007-10-04 Matevz Tadel <matevz.tadel@cern.ch>
* TOFDigitsInfo.cxx:
* TOFStrip.h:
From Annalisa: changes for the new TOF geometry classes.
+2007-10-03 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * TPCSector3DGL.cxx:
+ * TPCSector3DGL.h:
+ Implement virtuals from TGLLogicalShape for level-of-detail
+ calculation / management.
+
+2007-10-03 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * TPCLoader.cxx:
+ Add calls to ElementChanged() for all displayed sectors after
+ loading a new event.
+
+ * TPCSectorViz.cxx:
+ * TPCSectorViz.h:
+ White-space.
+
+2007-10-02 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * ITSModule.cxx:
+ * ITSModule.h:
+ * ITSScaledModule.cxx:
+ * ITSScaledModule.h:
+ * PMDModule.cxx:
+ * T0Module.cxx:
+ * T0Module.h:
+ * TOFSector.cxx:
+ * TOFSector.h:
+ Changes required by re-basing of QuadSet to DigitSet.
+
+ * TPCSector3D.cxx:
+ * TPCSector3DGL.cxx:
+ * TPCSector3DGL.h:
+ Use axis-aligned box-set for speed/memory optimization.
+ Support secondary-selection for boxes.
+
+ * TRDData.cxx:
+ Comment-out unused code requiring obsolete features of BoxSet.
+
2007-09-24 Matevz Tadel <matevz.tadel@cern.ch>
* MUONData.cxx:
From Bogdan: modifications for the new structure of the data in
the MUON code.
+2007-09-19 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * EventAlieve.cxx:
+ * EventAlieve.h:
+ Event-navigation commands are now virtual in the base-class.
+ Moved new-event-commands list and method to Reve::EventBase.
+
+2007-08-30 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * EventAlieve.cxx:
+ Added comment about brutality of event-data destruction.
+
+ * ITSModuleStepper.cxx:
+ * ITSModuleStepper.h:
+ Subclass from RenderElementList and use fChildClass instead of
+ overriding AddElement to enforce child-class.
+
+ * TPCLoader.cxx:
+ * TPCLoader.h:
+ Update to new convention of RemoveElement.
+
+2007-08-28 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * ITSModule.cxx:
+ In InitStatics add missing reference on global palettes.
+
+ * ITSModuleStepper.cxx:
+ * ITSModuleStepper.h:
+ * ITSModuleStepperEditor.cxx:
+ * ITSModuleStepperEditor.h:
+ Enable dynamic setting of Reve::GridStepper cell size and number
+ of rows.
+
+ * LinkDef.h:
+ Register new class ITSModuleStepperEditor.
+
+ * ITSScaledModule.cxx:
+ * ITSScaledModule.h:
+ Replace roots gui Signal/Slot mechanism by using structure of
+ Reve::ReferenceBackPtr.
+
+2007-08-28 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * .SKEL-gedsubed.cxx:
+ * ITSScaledModuleEditor.cxx:
+ * PMDModuleEditor.cxx:
+
+2007-08-28 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * PMDModule.cxx:
+ Request a filled frame.
+
+2007-08-27 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * ITSDigitsInfo.cxx:
+ * ITSDigitsInfo.h:
+ Fix theta range ITSModuleSelection. Add default values values for
+ low and high values in sub-detectors.
+
+ * ITSModule.cxx:
+ Initialize low and high values reading ITSDigitsInfo.
+
+ * ITSModuleStepper.cxx:
+ * ITSScaledModule.cxx:
+ * ITSScaledModule.h:
+ Synchronize palette according to scale and statistic type.
+
+ * ITSScaledModuleEditor.cxx:
+ * ITSScaledModuleEditor.h:
+ Do not use sub-editor mechanism. Add widgets directly in TGedFrame.
+
+ * LinkDef.h:
+ Unregister obsolete class ITSSDSubEditor.
+
+ * PMDModuleEditor.cxx:
+ * PMDModuleEditor.h:
+ Use QuadSetEditor Info tab.
+
+2007-08-27 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * TPCSector2D.cxx:
+ * TPCSector2D.h:
+ Added menu-function MakeSector3D().
+ Removed obsolete ifdefed code.
+
+2007-08-27 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * ITSModule.cxx:
+ Request filled frame for all standard frame-boxes.
+
+ * ITSModuleStepper.cxx:
+ Shift origin of grid-stepper instead of shifting each individual
+ module.
+
+2007-08-26 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * ITSModuleStepper.cxx:
+ * ITSModuleStepper.h:
+ Use RenderElement::ElementChanged() to signal redraw requests.
+ Reorder function declarations and function code to make source
+ easier to read.
+
+2007-08-24 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * TPCLoaderEditor.cxx:
+ * TRDLoader.cxx:
+ Use gReve->GetMainWindow() to obtain main window for file-dialog.
+
+2007-08-13 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * TPCLoader.cxx:
+ * TRDLoader.cxx:
+ * TRDLoaderManager.cxx:
+ Consistent ordering of arguments to AddRenderElement(),
+ AddGlobalRenderElement() and RemoveRenderElement().
+
+2007-08-09 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * ITSDigitsInfo.cxx:
+ Fix offset by one bug in GetModuleIDs().
+
+ * ITSModuleStepper.cxx:
+ * ITSModuleStepper.h:
+ ITSModuleStepper is an TGLOverlayElement. ITSModuleStepperGL
+ functionality moved here.
+
+ * LinkDef.h:
+ * ITSModuleStepperGL.cxx:
+ * ITSModuleStepperGL.h:
+ Remove files.
+
2007-08-06 Matevz Tadel <matevz.tadel@cern.ch>
* JetPlane.cxx:
#include "EventAlieve.h"
#include <Reve/Reve.h>
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <AliRunLoader.h>
#include <AliRun.h>
#include <TFile.h>
#include <TTree.h>
-#include <TObjString.h>
#include <TError.h>
#include <TROOT.h>
#include <TSystem.h>
-#include <TCint.h>
using namespace Reve;
using namespace Alieve;
fPath (), fEventId (0),
fRunLoader (0),
fESDFile (0), fESDTree (0), fESD (0),
- fESDfriend (0), fESDfriendExists(kFALSE),
- fNewEventCommands()
+ fESDfriend (0), fESDfriendExists(kFALSE)
{}
Event::Event(TString path, Int_t ev) :
fPath (path), fEventId(-1),
fRunLoader (0),
fESDFile (0), fESDTree (0), fESD (0),
- fESDfriend (0), fESDfriendExists(kFALSE),
- fNewEventCommands()
+ fESDfriend (0), fESDfriendExists(kFALSE)
{
Open();
if (ev >= 0) GotoEvent(ev);
throw(eH + Form("event %d not present, available range [%d, %d].",
event, 0, maxEvent));
- RGTopFrame::RedrawDisabler rd(gReve);
+ ReveManager::RedrawDisabler rd(gReve);
gReve->Redraw3D(kFALSE, kTRUE); // Enforce drop of all logicals.
+ // !!! MT this is somewhat brutal; at least optionally, one could be
+ // a bit gentler, checking for objs owning their external refs and having
+ // additinal parents.
DestroyElements();
fEventId = event;
SetName(Form("Event %d", fEventId));
}
}
-/**************************************************************************/
-
-void Event::AfterNewEventLoaded()
-{
- TIter next(&fNewEventCommands);
- TObject* o;
- while ((o = next())) {
- TObjString* s = dynamic_cast<TObjString*>(o);
- if (s)
- gInterpreter->ProcessLine(s->String());
- }
-}
-
-void Event::AddNewEventCommand(const Text_t* cmd)
-{
- fNewEventCommands.Add(new TObjString(cmd));
-}
/**************************************************************************/
/**************************************************************************/
#ifndef ALIEVE_Event_H
#define ALIEVE_Event_H
-#include <TList.h>
-
#include <Reve/EventBase.h>
class AliRunLoader;
TFile* fESDFile;
TTree* fESDTree;
- AliESDEvent* fESD;
+ AliESDEvent* fESD;
AliESDfriend* fESDfriend;
Bool_t fESDfriendExists;
- TList fNewEventCommands;
-
static TString fgCdbUri;
static Bool_t fgAssertRunLoader;
static Bool_t fgAssertESDTree;
Event();
Event(TString path, Int_t ev=0);
- void Open();
- void GotoEvent(Int_t event);
- void NextEvent() { GotoEvent(fEventId + 1); }
- void PrevEvent() { GotoEvent(fEventId - 1); }
- void Close();
-
- virtual void AfterNewEventLoaded();
-
- TList& GetNewEventCommands() { return fNewEventCommands; }
- void AddNewEventCommand(const Text_t* cmd);
+ virtual void Open();
+ virtual void GotoEvent(Int_t event);
+ virtual void NextEvent() { GotoEvent(fEventId + 1); }
+ virtual void PrevEvent() { GotoEvent(fEventId - 1); }
+ virtual void Close();
Int_t GetEventId() const { return fEventId; }
AliRunLoader* GetRunLoader() const { return fRunLoader; }
TTree* GetESDTree() const { return fESDTree; }
- AliESDEvent* GetESD() const { return fESD; }
+ AliESDEvent* GetESD() const { return fESD; }
AliESDfriend* GetESDfriend() const { return fESDfriend; }
Bool_t GetESDfriendExists() const { return fESDfriendExists; }
virtual const Text_t* GetTitle() const { return fPath.Data(); }
static AliRunLoader* AssertRunLoader();
- static AliESDEvent* AssertESD();
+ static AliESDEvent* AssertESD();
static AliESDfriend* AssertESDfriend();
static AliMagF* AssertMagField();
ITSModuleSelection::ITSModuleSelection():
fType(-1),
fLayer(-1),
- fMinPhi(0),
- fMaxPhi(2*TMath::Pi()),
- fMinTheta(0),
- fMaxTheta(2*TMath::Pi())
+ fMinPhi(-TMath::Pi()),
+ fMaxPhi(TMath::Pi()),
+ fMinTheta(-TMath::Pi()),
+ fMaxTheta(TMath::Pi())
{}
fSDDMaxVal = 80;
fSSDMaxVal = 100;
- fSPDMaxOcc = 0.15;
- fSDDMaxOcc = 0.15;
- fSSDMaxOcc = 0.3;
+ fSPDHighLim = 1;
+ fSDDHighLim = 512;
+ fSSDHighLim = 1024;
// lowest scale factor refers to unscaled ITS module
fSPDScaleX[0] = 1;
TClonesArray* digitsSPD = 0;
map<Int_t, TClonesArray*>::iterator i = fSPDmap.find(mod);
if(i == fSPDmap.end()) {
- if (fTree == 0) return 0;
TBranch* br = fTree->GetBranch("ITSDigitsSPD");
br->SetAddress(&digitsSPD);
br->GetEntry(mod);
TClonesArray* digitsSDD = 0;
map<Int_t, TClonesArray*>::iterator i = fSDDmap.find(mod);
if(i == fSDDmap.end()) {
- if (fTree == 0) return 0;
TBranch* br = fTree->GetBranch("ITSDigitsSDD");
br->SetAddress(&digitsSDD);
br->GetEntry(mod);
TClonesArray* digitsSSD = 0;
map<Int_t, TClonesArray*>::iterator i = fSSDmap.find(mod);
if(i == fSSDmap.end()) {
- if (fTree == 0) return 0;
TBranch* br = fTree->GetBranch("ITSDigitsSSD");
br->SetAddress(&digitsSSD);
br->GetEntry(mod);
idx1 = fGeom->GetLastSPD();
break;
case 1:
- idx0 = fGeom->GetLastSPD();
+ idx0 = fGeom->GetLastSPD()+1;
idx1 = fGeom->GetLastSDD();
break;
case 2:
- idx0 = fGeom->GetLastSDD();
+ idx0 = fGeom->GetLastSDD()+1;
idx1 = fGeom->GetLastSSD();
break;
default:
fGeom->GetTrans(id, x);
mx.SetBaseVec(4, x);
mx.GetPos(v);
- if(v.Phi()<sel->fMaxPhi && v.Phi()>sel->fMinPhi &&
- v.Theta()<sel->fMaxTheta && v.Theta()>sel->fMinTheta )
+ if(v.Phi()<=sel->fMaxPhi && v.Phi()>=sel->fMinPhi &&
+ v.Theta()<=sel->fMaxTheta && v.Theta()>=sel->fMinTheta )
ids.push_back(id);
}
}
Float_t fMaxTheta;
ITSModuleSelection();
+ virtual ~ITSModuleSelection() {}
ClassDef(ITSModuleSelection, 1);
};
Int_t fSSDMaxVal;
Int_t fSDDMaxVal;
- Float_t fSPDMaxOcc;
- Float_t fSDDMaxOcc;
- Float_t fSSDMaxOcc;
+ Int_t fSPDHighLim;
+ Int_t fSDDHighLim;
+ Int_t fSSDHighLim;
Int_t fSPDScaleX[5];
Int_t fSPDScaleZ[5];
fgSPDFrameBox = new FrameBox();
fgSPDFrameBox->SetAAQuadXZ(-dx, 0, -dz, 2*dx, 2*dz);
fgSPDFrameBox->SetFrameColor((Color_t) 31);
+ fgSPDFrameBox->SetFrameFill(kTRUE);
+ fgSPDFrameBox->IncRefCount();
fgSPDPalette = new RGBAPalette(info->fSPDMinVal,info->fSPDMaxVal);
+ fgSPDPalette->IncRefCount();
}
{
fgSDDFrameBox = new FrameBox();
fgSDDFrameBox->SetAAQuadXZ(-dx, 0, -dz, 2*dx, 2*dz);
fgSDDFrameBox->SetFrameColor((Color_t) 32);
+ fgSDDFrameBox->SetFrameFill(kTRUE);
+ fgSDDFrameBox->IncRefCount();
fgSDDPalette = new RGBAPalette(info->fSDDMinVal,info->fSDDMaxVal);
- fgSDDPalette->SetLimits(0, 512); // Set proper ADC range.
+ fgSDDPalette->SetLimits(0, info->fSDDHighLim); // Set proper ADC range.
+ fgSDDPalette->IncRefCount();
}
{
fgSSDFrameBox = new FrameBox();
fgSSDFrameBox->SetAAQuadXZ(-dx, 0, -dz, 2*dx, 2*dz);
fgSSDFrameBox->SetFrameColor((Color_t) 33);
+ fgSSDFrameBox->SetFrameFill(kTRUE);
+ fgSSDFrameBox->IncRefCount();
fgSSDPalette = new RGBAPalette(info->fSSDMinVal,info->fSSDMaxVal);
- fgSSDPalette->SetLimits(0, 1024); // Set proper ADC range.
+ fgSSDPalette->SetLimits(0, info->fSSDHighLim); // Set proper ADC range.
+ fgSSDPalette->IncRefCount();
}
}
/**************************************************************************/
-void ITSModule::QuadSelected(Int_t idx)
+void ITSModule::DigitSelected(Int_t idx)
{
// Override control-click from QuadSet
- QuadBase* qb = GetQuad(idx);
+ DigitBase* qb = GetDigit(idx);
TObject* obj = qb->fId.GetObject();
AliITSdigit* d = dynamic_cast<AliITSdigit*>(obj);
printf("ITSModule::QuadSelected "); Print();
virtual void LoadQuads();
void SetTrans();
- virtual void QuadSelected(Int_t idx);
+ virtual void DigitSelected(Int_t idx);
virtual void Print(Option_t* opt="") const;
#include "ITSDigitsInfo.h"
#include "ITSScaledModule.h"
-#include "Reve/RGTopFrame.h"
+#include "Reve/ReveManager.h"
#include "Reve/RGEditor.h"
#include "Reve/GridStepper.h"
#include "Reve/GLTextNS.h"
+#include "Reve/ZTrans.h"
#include <TObject.h>
-#include <TSystem.h>
#include <TBuffer3D.h>
#include <TBuffer3DTypes.h>
#include <TVirtualPad.h>
#include <TVirtualViewer3D.h>
+#include <TGLRnrCtx.h>
+#include <TGLSelectRecord.h>
+#include <TGLText.h>
+// #include <FTFont.h>
+#include <TGLAxis.h>
+#include <TGLViewer.h>
+
using namespace Reve;
using namespace Alieve;
ClassImp(ITSModuleStepper)
-ITSModuleStepper::ITSModuleStepper(ITSDigitsInfo* di):
- RenderElement(fWColor),
- TNamed("ITS 2DStore", "ITSModuleStepper"),
+ITSModuleStepper::ITSModuleStepper(ITSDigitsInfo* di) :
+ RenderElementList("ITS 2DStore", "ITSModuleStepper", kTRUE),
+
+ fPosition(0),
+
+ fDigitsInfo(di),
+ fScaleInfo(0),
+
+ fSubDet(-1),
- fDigitsInfo(di),
- fScaleInfo(0),
- fStepper(0),
- fExpand(0.85),
+ fStepper(0),
+ fAxis(0),
+ fText(0),
+ fTextSize(0.05),
+ fPagerGap(0.1),
+ fRnrFrame(kFALSE),
- fRnrFrame(kTRUE),
+ fExpandCell(0.85),
+ fModuleFrameCol(2),
- fWCorner(PT_BottomLeft),
- fWWidth(0.05),
- fWHeight(0.2)
+ fPaletteOffset(0.2),
+ fPaletteLength(0.6),
+
+ fWActive(-1),
+ fWWidth(0.025),
+ fWHeight(0.032),
+ fWOff(0.05),
+ fWCol(30),
+ fWActiveCol(45),
+ fFontCol(8)
{
+ // override member from base RenderElementList
+ fChildClass = ITSScaledModule::Class();
+
+ SetMainColorPtr(&fWCol);
+
+ fDigitsInfo->IncRefCount();
+
fStepper = new GridStepper();
-
+ fStepper->SetNs(5, 4);
+
fScaleInfo = new DigitScaleInfo();
+ fScaleInfo->IncRefCount();
- fWColor = 5;
+ fAxis = new TGLAxis();
+ fAxis->SetLineColor(4);
+ fAxis->SetTextColor(fFontCol);
- // GLTextNS::LoadDefaultFont(Form("%s/icons/fontdefault.txf",gSystem->Getenv("REVESYS")));
- GLTextNS::LoadDefaultFont(Form("%s/icons/fonthelvetica34.txf",gSystem->Getenv("REVESYS")));
+ fText = new TGLText();
+ fText->SetTextColor(fFontCol);
+ fText->SetGLTextFont(40);
+ fText->SetGLTextAngles(0, 0, 0);
+ fText->SetTextSize(fTextSize);
+
+ gReve->GetGLViewer()->AddOverlayElement(this);
}
-/**************************************************************************/
ITSModuleStepper::~ITSModuleStepper()
{
+ gReve->GetGLViewer()->RemoveOverlayElement(this);
+
+ fScaleInfo->DecRefCount();
+ fDigitsInfo->DecRefCount();
+
delete fStepper;
- delete fScaleInfo;
+
+ delete fAxis;
+ delete fText;
}
/**************************************************************************/
-void ITSModuleStepper::SetStepper(Int_t nx, Int_t ny, Float_t dx, Float_t dy)
+void ITSModuleStepper::Capacity()
{
- fStepper->SetNs(nx, ny, 1);
- RenderElement::DestroyElements();
-
- Int_t nmod = nx*ny;
- for(Int_t m = 0; m<nmod; m++)
+ Int_t N = fStepper->Nx*fStepper->Ny;
+ if(N != GetNChildren())
{
- AddElement( new ITSScaledModule(m, fDigitsInfo, fScaleInfo));
+ DestroyElements();
+ for(Int_t m=0; m<N; m++)
+ {
+ AddElement(new ITSScaledModule(m, fDigitsInfo, fScaleInfo));
+ }
}
-
- if(dx > 0 && dy > 0)
- fStepper->SetDs(dx, dy);
}
/**************************************************************************/
-void ITSModuleStepper::SetFirst(Int_t first)
+void ITSModuleStepper::SetFirst(Int_t first)
{
Int_t lastpage = fIDs.size()/Nxy();
if(fIDs.size() % Nxy() ) lastpage++;
if(first > first_lastpage) first = first_lastpage;
if(first < 0) first = 0;
fPosition = first;
- fStepper->Reset();
Apply();
}
-void ITSModuleStepper::Start()
+void ITSModuleStepper::Start()
{
fPosition = 0;
- fStepper->Reset();
Apply();
}
-void ITSModuleStepper::Next()
+void ITSModuleStepper::Next()
{
- SetFirst( fPosition + Nxy());
+ SetFirst(fPosition + Nxy());
}
-void ITSModuleStepper::Previous()
+void ITSModuleStepper::Previous()
{
// move to the top left corner first
- SetFirst( fPosition - Nxy());
+ SetFirst(fPosition - Nxy());
}
-void ITSModuleStepper::End()
+void ITSModuleStepper::End()
{
Int_t lastpage = fIDs.size()/Nxy();
if(fIDs.size() % Nxy() ) lastpage++;
/**************************************************************************/
+void ITSModuleStepper::DisplayDet(Int_t det, Int_t layer)
+{
+ fSubDet = det;
+ fIDs.clear();
+ ITSModuleSelection sel = ITSModuleSelection();
+ sel.fType = det; sel.fLayer=layer;
+ fDigitsInfo->GetModuleIDs(&sel, fIDs);
+ //in reder menu define a space between left and right pager
+ fPagerGap = 1.2*TextLength(Form("%d/%d",GetPages(), GetPages()));
+ Start();
+}
+
+/**************************************************************************/
+
+void ITSModuleStepper::DisplayTheta(Float_t min, Float_t max)
+{
+ fIDs.clear();
+ ITSModuleSelection sel = ITSModuleSelection();
+ sel.fMaxTheta = max; sel.fMinTheta=min;
+ fDigitsInfo->GetModuleIDs(&sel, fIDs);
+ Start();
+}
+
+/**************************************************************************/
+
+Int_t ITSModuleStepper::GetCurrentPage()
+{
+ Int_t idx = fPosition +1;
+ Int_t n = idx/Nxy();
+ if(idx % Nxy()) n++;
+ return n;
+}
+
+/**************************************************************************/
+
+Int_t ITSModuleStepper::GetPages()
+{
+ Int_t n = fIDs.size()/Nxy();
+ if(fIDs.size() % Nxy()) n++;
+ return n;
+}
+
+/**************************************************************************/
+
void ITSModuleStepper::Apply()
{
// printf("ITSModuleStepper::Apply fPosition %d \n", fPosition);
gReve->DisableRedraw();
+ Capacity();
UInt_t idx = fPosition;
- Float_t p[3];
-
- for(List_i childit=fChildren.begin(); childit!=fChildren.end(); ++childit)
+ for(List_i childit=fChildren.begin(); childit!=fChildren.end(); ++childit)
{
if(idx < fIDs.size())
{
ITSScaledModule* mod = dynamic_cast<ITSScaledModule*>(*childit);
mod->SetID(fIDs[idx], kFALSE);
- ZTrans& mx = mod->RefHMTrans();
+ ZTrans& tr = mod->RefHMTrans();
+ tr.UnitTrans();
+ tr.RotateLF(3,2,TMath::PiOver2());
+ tr.RotateLF(1,3,TMath::PiOver2());
- Float_t dx, dz;
+ // scaling
+ Float_t mz, mx;
Float_t* fp = mod->GetFrame()->GetFramePoints();
// switch x,z it will be rotated afterwards
- dz = -2*fp[0];
- dx = -2*fp[2];
+ mx = -2*fp[0];
+ mz = -2*fp[2];
- Double_t sh = fStepper->Dy;
- Double_t sw = (dx*fStepper->Dy)/dz;
- if(sw > fStepper->Dx)
+ // fit width first
+ Double_t sx = fStepper->Dx;
+ Double_t sy = (mx*fStepper->Dx)/mz;
+ if(sy > fStepper->Dy)
{
- // printf("fit width \n");
- sw = fStepper->Dx;
- sh = (dz*fStepper->Dx)/dx;
+ // printf("fit width \n");
+ sy = fStepper->Dy;
+ sx = (mz*fStepper->Dx)/mx;
}
- mx.UnitTrans();
- mx.RotateLF(3,2,TMath::PiOver2());
- mx.Scale(sw/dx, sh/dz,1);
-
- fStepper->GetPosition(p);
- mx.SetPos(p[0]+0.5*fStepper->Dx, p[1]+0.5*fStepper->Dy, p[2]+0.5*fStepper->Dz);
-
- mx.Scale(fExpand, fExpand,1);
- mx.RotateLF(2,1,TMath::PiOver2());
-
- mx.MultLeft(fHMTrans);
+ Float_t scale = (fExpandCell*sx)/mz;
+ tr.Scale(scale, scale, scale);
- mod->SetRnrSelf(kTRUE);
+ Float_t p[3];
+ fStepper->GetPosition(p);
+ tr.SetPos(p[0]+0.5*fStepper->Dx, p[1]+0.5*fStepper->Dy, p[2]+0.5*fStepper->Dz);
if(mod->GetSubDetID() == 2)
mod->SetName(Form("SSD %d", idx));
mod->SetName(Form("SDD %d", idx));
else
mod->SetName(Form("SPD %d", idx));
+ mod->SetRnrSelf(kTRUE);
mod->UpdateItems();
fStepper->Step();
}
}
- // update in case scaled module is a model in the editor
+ fStepper->Reset();
+ ElementChanged();
gReve->EnableRedraw();
- gReve->GetEditor()->DisplayObject(gReve->GetEditor()->GetModel());
}
/**************************************************************************/
-void ITSModuleStepper::DisplayDet(Int_t det, Int_t layer)
+void ITSModuleStepper::Render(TGLRnrCtx& rnrCtx)
{
- ITSModuleSelection sel = ITSModuleSelection();
- sel.fType = det; sel.fLayer=layer;
- fDigitsInfo->GetModuleIDs(&sel, fIDs);
- Start();
+ // render everyting in relative coordinates
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glLoadIdentity();
+ if (rnrCtx.Selection())
+ {
+ // Should be
+ // glLoadMatrix(rnrCtx.GetCamera()->GetProjMBase());
+ TGLRect rect(*rnrCtx.GetPickRectangle());
+ rnrCtx.GetCamera()->WindowToViewport(rect);
+ gluPickMatrix(rect.X(), rect.Y(), rect.Width(), rect.Height(),
+ (Int_t*) rnrCtx.GetCamera()->RefViewport().CArr());
+ }
+
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+ glLoadIdentity();
+
+ GLboolean lightp;
+ glGetBooleanv(GL_LIGHTING, &lightp);
+ if (lightp) glDisable(GL_LIGHTING);
+
+ glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ glDisable(GL_CULL_FACE);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ RenderMenu();
+ RenderPalette(fPaletteLength, 1.6*fWWidth, fWHeight*0.6);
+ glPopMatrix();
+ glPopAttrib();
+
+ if (lightp) glEnable(GL_LIGHTING);
+
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+
+ glMatrixMode(GL_MODELVIEW);
+ RenderCellIDs();
}
+
+/**************************************************************************/
+// Protected sub-renderers
/**************************************************************************/
-void ITSModuleStepper::DisplayTheta(Float_t min, Float_t max)
+//______________________________________________________________________
+Float_t ITSModuleStepper::TextLength(const char* txt)
{
- fIDs.clear();
- ITSModuleSelection sel = ITSModuleSelection();
- sel.fMaxTheta = max; sel.fMinTheta=min;
- fDigitsInfo->GetModuleIDs(&sel, fIDs);
- Start();
+ Float_t llx, lly, llz, urx, ury, urz;
+ fText->BBox(txt, llx, lly, llz, urx, ury, urz);
+ return (urx-llx)*fTextSize;
}
-/**************************************************************************/
-
-void ITSModuleStepper::Paint(Option_t* /*option*/)
+//______________________________________________________________________
+void ITSModuleStepper::RenderString(TString string, Int_t id)
{
- static const Exc_t eH("ITSModuleStepper::Paint ");
+ Float_t txtY = fWHeight*0.5;
+ Float_t txtl = TextLength(string.Data());
- TBuffer3D buff(TBuffer3DTypes::kGeneric);
+ if(id > 0) glLoadName(id);
+ if(id>0 && fWActive == id)
+ fText->SetTextColor(fWActiveCol);
+ else
+ fText->SetTextColor(fFontCol);
- // Section kCore
- buff.fID = this;
- buff.fColor = fWColor;
- buff.fTransparency = 0;
- fHMTrans.SetBuffer3D(buff);
- buff.SetSectionsValid(TBuffer3D::kCore);
+
+ if(id>0)
+ {
+ if(fWActive == id)
+ fText->SetTextColor(fWActiveCol);
+ else
+ fText->SetTextColor(fFontCol);
+
+ glLoadName(id);
+ Float_t ss = fWWidth*0.4;
+ fText->PaintGLText(ss, txtY, -0.8, string.Data());
+ // box
+ Float_t bw =2*ss+txtl;
+ RenderFrame(bw,fWHeight*2,id);
+ glTranslatef( bw, 0, 0);
+ }
+ else
+ {
+ fText->SetTextColor(fFontCol);
+ fText->PaintGLText(0, txtY, -0.8, string.Data());
+ glTranslatef(txtl, 0, 0);
+ }
+}
- Int_t reqSections = gPad->GetViewer3D()->AddObject(buff);
- if (reqSections != TBuffer3D::kNone)
- Error(eH, "only direct GL rendering supported.");
+//______________________________________________________________________
+void ITSModuleStepper::RenderFrame(Float_t dx, Float_t dy, Int_t id)
+{
+ if(fRnrFrame == kFALSE)return;
+
+ glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ UChar_t color[4];
+ if(fWActive == id)
+ ColorFromIdx(fWActiveCol, color);
+ else
+ ColorFromIdx(fWCol, color);
+ glColor4ubv(color);
+
+ glBegin(GL_QUADS);
+ glVertex2f(0, 0); glVertex2f(dx, 0);
+ glVertex2f(dx, dy); glVertex2f(0, dy);
+ glEnd();
+ glPopAttrib();
}
-/**************************************************************************/
+//______________________________________________________________________
+void ITSModuleStepper::RenderSymbol(Float_t dx, Float_t dy, Int_t id)
+{
+ glLoadName(id);
+
+ UChar_t color[4];
+ if(fWActive == id)
+ ColorFromIdx(fWActiveCol, color);
+ else
+ ColorFromIdx(fWCol, color);
+ glColor4ubv(color);
+
+ Float_t xs = dx/4, ys = dy/4;
+ if(id == 0) {
+ glBegin(GL_QUADS);
+ glVertex2f(0,ys); glVertex2f(0, ys*3);
+ glVertex2f(dx, ys*3); glVertex2f(dx, ys);
+ glEnd();
+ return;
+ }
+
+ glBegin(GL_TRIANGLES);
+ switch (id) {
+ case 1:
+ {
+ // left
+ // glVertex2f(xs*2.5, ys*3); glVertex2f(xs*1.5, ys*2); glVertex2f(xs*2.5, ys);
+ glVertex2f(xs*3, ys*3); glVertex2f(xs*1, ys*2); glVertex2f(xs*3, ys);
+ break;
+ }
+ case 2:
+ {
+ //double left
+ glVertex2f(xs*2, ys*3); glVertex2f(xs, ys*2); glVertex2f(xs*2, ys);
+ glVertex2f(xs*3, ys*3); glVertex2f(xs*2, ys*2); glVertex2f(xs*3, ys);
+ break;
+ }
+ case 3:
+ {
+ // right
+ //glVertex2f(xs*1.5, ys); glVertex2f(xs*2.5, ys*2); glVertex2f(xs*1.5, ys*3);
+ glVertex2f(xs*1, ys); glVertex2f(xs*3, ys*2); glVertex2f(xs*1, ys*3);
+ break;
+ }
+ case 4:
+ {
+ // double right
+ glVertex2f(xs, ys); glVertex2f(xs*2, ys*2); glVertex2f(xs, ys*3);
+ glVertex2f(xs*2, ys); glVertex2f(xs*3, ys*2); glVertex2f(xs*2, ys*3);
+ break;
+ }
+ case 5:
+ {
+ // up
+ glVertex2f(xs, ys*2.5); glVertex2f(xs*2, ys*3.5); glVertex2f(xs*3, ys*2.5);
+ break;
+ }
+ case 6:
+ {
+ // down
+ glVertex2f(xs, ys*1.5); glVertex2f(xs*2, ys*0.5); glVertex2f(xs*3, ys*1.5);
+ break;
+ }
+
+ default:
+ break;
+ }
+ glEnd();
+ glLoadName(0);
+}
-void ITSModuleStepper::ComputeBBox()
+//______________________________________________________________________
+void ITSModuleStepper::RenderPalette(Float_t dx, Float_t x, Float_t y)
{
- // printf("ITSModuleStepper::ComputeBBox \n");
- BBoxInit();
-
- Float_t W = fStepper->Dx*fStepper->Nx;
- Float_t H = fStepper->Dy*fStepper->Ny;
-
- BBoxCheckPoint(0, 0, -0.1);
- BBoxCheckPoint(W, H, 0.1);
-
- // Float_t dx = W*fWWidth);
- Float_t dy = H*fWHeight;
+ glPushMatrix();
+ glLoadIdentity();
+ glTranslatef(1 -x- dx, -1+y*4, 0);
+ ITSModule* qs = dynamic_cast<ITSModule*>(*BeginChildren());
+ RGBAPalette* p = qs->GetPalette();
+ glBegin(GL_QUAD_STRIP);
+ glColor4ubv(p->ColorFromValue(p->GetMinVal()));
+ glVertex2f(0, 0);
+ glVertex2f(0, y);
+ if (p->GetMaxVal() > p->GetMinVal() + 1)
+ {
+ Float_t xs = dx/(p->GetMaxVal() - p->GetMinVal());
+ Float_t x0 = xs;
+ for(Int_t i=p->GetMinVal() + 1; i<p->GetMaxVal(); i++)
+ {
+ glColor4ubv(p->ColorFromValue(i));
+ glVertex2f(x0, 0);
+ glVertex2f(x0, y);
+ x0+=xs;
+ }
+ }
+ glColor4ubv(p->ColorFromValue(p->GetMaxVal()));
+ glVertex2f(dx, 0);
+ glVertex2f(dx, y);
+ glEnd();
- if(fWCorner == PT_BottomLeft || fWCorner == PT_BottomRight) {
- BBoxCheckPoint(0, -dy, 0);
+ if (p->GetMaxVal() > p->GetMinVal())
+ {
+ glRotatef(-90,1, 0, 0 );
+ Double_t v1[3] = {0., 0., 0.};
+ Double_t v2[3] = {dx, 0, 0.};
+ fAxis->SetLabelsSize(fTextSize/dx);
+ fAxis->PaintGLAxis(v1, v2, p->GetMinVal(), p->GetMaxVal(), 206);
}
- else
- BBoxCheckPoint(0, H+dy, 0);
+ glPopMatrix();
}
+//______________________________________________________________________
+void ITSModuleStepper::RenderMenu()
+{
+ Float_t ww = 2*fWWidth;
+ Float_t wh = 2*fWHeight;
+
+ // transparent bar
+ Float_t a=0.3;
+ glColor4f(a, a, a, a);
+ Float_t H = 1.9*wh*(1+ 2*fWOff);
+ if(1) {
+ glBegin(GL_QUADS);
+ glVertex3f(-1, -1, 0.1); glVertex3f(-1, -1+H, 0.1);
+ glVertex3f(1 , -1+H, 0.1); glVertex3f( 1, -1 , 0.1);
+ glEnd();
+ }
-/**************************************************************************/
+ Float_t y_base = -1 + wh*0.35;
+ glTranslatef(-1, y_base, 0.);
+ glPushName(0);
+ // pager
+ glPushMatrix();
+ glTranslatef(ww, 0, 0.);
+ fText->SetTextSize(fTextSize);
+ Float_t soff = ww*1.3;
+ glTranslatef(0, fWOff*wh, 0);
+ RenderSymbol(ww, wh, 2);
+ RenderFrame(ww,wh,2);
+ glTranslatef(soff, 0, 0);
+ RenderSymbol(ww, wh, 1);
+ RenderFrame(ww,wh,1);
+ glTranslatef(soff, 0, 0);
+ // text info
+ {
+ const char* txt = Form("%d/%d ", GetCurrentPage(), GetPages());
+ Float_t dx = (fPagerGap - TextLength(txt))*0.5;
+ fText->SetTextColor(fFontCol);
+ fText->PaintGLText(dx, wh*0.25, -0.8, txt);
+ }
+ glTranslatef(fPagerGap, 0, 0);
+
+ RenderSymbol(ww, wh, 3);
+ RenderFrame(ww,wh,3);
+ glTranslatef(soff, 0, 0);
+ RenderSymbol(ww, wh, 4);
+ RenderFrame(ww,wh,4);
+ glTranslatef(2*ww, 0, 0);
+ glPopMatrix();
+
+ // scale info
+ glPushMatrix();
+ ITSDigitsInfo* di = fDigitsInfo;
+ Int_t scale = fScaleInfo->GetScale() - 1;
+ ITSScaledModule* sm = dynamic_cast<ITSScaledModule*>(*BeginChildren());
+ Int_t cnx = 0, cnz = 0;
+ switch(sm->GetSubDetID())
+ {
+ case 0:
+ cnx = di->fSPDScaleX[scale], cnz = di->fSPDScaleZ[scale];
+ break;
+ case 1:
+ cnx = di->fSDDScaleX[scale], cnz = di->fSDDScaleZ[scale];
+ break;
+ case 2:
+ cnx = di->fSSDScale[scale], cnz = 1;
+ break;
+ }
+ glTranslatef(10*ww,0, 0);
+ RenderString(Form("Zoom: "));
+ glPushMatrix();
+ glTranslatef(0, 0.2*wh, 0);
+ RenderSymbol(ww, wh*0.9, 5);
+ glTranslatef(0, 0.4*wh, 0);
+ RenderFrame(ww, wh*0.5, 5);
+ glPopMatrix();
+ RenderSymbol(ww, wh*0.9, 6);
+ RenderFrame(ww, wh*0.5, 6);
+ glTranslatef(ww, 0, 0);
+ RenderString(Form("%dx%d ", cnx, cnz));
+ glPopMatrix();
+
+ //choose detector
+ glPushMatrix();
+ glTranslatef(18*ww, 0, 0);
+ Float_t bs = ww*0.2;
+ RenderString("SPD", 8);
+ glTranslatef(bs, 0, 0);
+ RenderString("SDD", 9);
+ glTranslatef(bs, 0, 0);
+ RenderString("SSD", 10);
+ glPopMatrix();
+
+ glPopName();
+}
-Int_t ITSModuleStepper::GetCurrentPage()
+//______________________________________________________________________
+void ITSModuleStepper::RenderCellIDs()
{
- Int_t idx = fPosition +1;
- Int_t n = idx/Nxy();
- if(idx % Nxy()) n++;
- return n;
+ fText->SetTextSize(fStepper->Dy*0.1);
+ fText->SetTextColor(fFontCol);
+ Double_t x, y, z;
+ Double_t sx, sy, sz;
+ UInt_t idx = fPosition;
+ for (List_i childit=fChildren.begin(); childit!=fChildren.end(); ++childit)
+ {
+ if(idx < fIDs.size())
+ {
+ ITSScaledModule* mod = dynamic_cast<ITSScaledModule*>(*childit);
+ ZTrans& tr = mod->RefHMTrans();
+ TString name = Form("%d",mod->GetID());
+ tr.GetPos(x,y,z);
+ x += fStepper->Dx*0.5;
+ y -= fStepper->Dy*0.5;
+ z += 0.4; // !!! MT hack - cross check with overlay rendering.
+ Float_t llx, lly, llz, urx, ury, urz;
+ fText->BBox(name, llx, lly, llz, urx, ury, urz);
+ tr.GetScale(sx, sy, sz);
+ fText->PaintGLText(x-(urx-llx)*sx, y, z, name);
+ idx++;
+ }
+ }
}
+
+
+/**************************************************************************/
+// Virtual event handlers from TGLOverlayElement
/**************************************************************************/
-Int_t ITSModuleStepper::GetPages()
+//______________________________________________________________________
+Bool_t ITSModuleStepper::Handle(TGLRnrCtx & /*rnrCtx*/,
+ TGLOvlSelectRecord & rec,
+ Event_t * event)
{
- Int_t n = fIDs.size()/Nxy();
- if(fIDs.size() % Nxy()) n++;
- return n;
+ // Handle overlay event.
+ // Return TRUE if event was handled.
+
+ switch (event->fType)
+ {
+ case kMotionNotify:
+ {
+ Int_t item = rec.GetN() < 2 ? -1 : (Int_t)rec.GetItem(1);
+ if (fWActive != item) {
+ fWActive = item;
+ return kTRUE;
+ } else {
+ return kFALSE;
+ }
+ break;
+ }
+ case kButtonPress:
+ {
+ if (event->fCode != kButton1) {
+ return kFALSE;
+ }
+ switch (rec.GetItem(1))
+ {
+ case 1:
+ Previous();
+ break;
+ case 2:
+ Start();
+ break;
+ case 3:
+ Next();
+ break;
+ case 4:
+ End();
+ break;
+ case 5:
+ {
+ DigitScaleInfo* si = fScaleInfo;
+ if(si->GetScale() < 5)
+ {
+ si->ScaleChanged(si->GetScale() + 1);
+ ElementChanged(kTRUE, kTRUE);
+ }
+ break;
+ }
+ case 6:
+ {
+ DigitScaleInfo* si = fScaleInfo;
+ if(si->GetScale() > 1)
+ {
+ si->ScaleChanged(si->GetScale() - 1);
+ ElementChanged(kTRUE, kTRUE);
+ }
+ break;
+ }
+ case 7:
+ gReve->GetEditor()->DisplayRenderElement(*BeginChildren());
+ break;
+
+ case 8:
+ DisplayDet(0, -1);
+ break;
+ case 9:
+ DisplayDet(1, -1);
+ break;
+ case 10:
+ DisplayDet(2, -1);
+ break;
+ default:
+ break;
+ }
+ return kTRUE;
+ break;
+ }
+ default:
+ break;
+ } // end switch
+ return kFALSE;
}
-
+
+//______________________________________________________________________
+Bool_t ITSModuleStepper::MouseEnter(TGLOvlSelectRecord& /*rec*/)
+{
+ return kTRUE;
+}
+
+//______________________________________________________________________
+void ITSModuleStepper::MouseLeave()
+{
+ // Mouse has left the element.
+
+ fWActive = -1;
+}
#define ALIEVE_ITSModuleStepper_H
#include <TNamed.h>
-#include <TAtt3D.h>
-#include <TAttBBox.h>
+#include <TGLOverlay.h>
#include <Reve/RenderElement.h>
#include <Reve/GridStepper.h>
-#include <Reve/ZTrans.h>
#include <vector>
+class TGLText;
+class TGLAxis;
+
namespace Alieve {
class ITSDigitsInfo;
class DigitScaleInfo;
-class ITSModuleStepper : public Reve::RenderElement,
- public TNamed,
- public TAtt3D,
- public TAttBBox
+class ITSModuleStepper : public Reve::RenderElementList,
+ public TGLOverlayElement
{
friend class ITSModuleStepperGL;
typedef std::vector<UInt_t> vpInt_t;
typedef std::vector<UInt_t>::iterator vpInt_i;
- enum PositionType_e { PT_BottomLeft, PT_BottomRight, PT_TopLeft, PT_TopRight };
-
private:
+ vpInt_t fIDs;
+ UInt_t fPosition; // position of top corner ITS module in vector fIDs
+
ITSModuleStepper(const ITSModuleStepper&); // Not implemented
ITSModuleStepper& operator=(const ITSModuleStepper&); // Not implemented
protected:
ITSDigitsInfo* fDigitsInfo;
DigitScaleInfo* fScaleInfo;
+ Int_t fSubDet;
- Reve::GridStepper* fStepper;
-
- Float_t fExpand;
+ Reve::GridStepper* fStepper;
+ TGLAxis* fAxis;
+ TGLText* fText;
+ Float_t fTextSize;
+ Float_t fPagerGap;
+ Bool_t fRnrFrame;
- vpInt_t fIDs;
- UInt_t fPosition;
+ // module configuration
+ Float_t fExpandCell;
+ Color_t fModuleFrameCol;
- Reve::ZTrans fHMTrans;
+ // palette configuratiom
+ Float_t fPaletteOffset;
+ Float_t fPaletteLength;
- Bool_t fRnrFrame;
- PositionType_e fWCorner;
- Color_t fWColor;
+ // symbol configuration
+ Int_t fWActive;
Float_t fWWidth;
Float_t fWHeight;
-
- void Apply();
- Int_t Nxy(){ return fStepper->Nx*fStepper->Ny; }
-
- void SetFirst(Int_t first);
+ Float_t fWOff; ///offset relative to widget size
+ Color_t fWCol;
+ Int_t fWActiveCol;
+ Color_t fFontCol;
+
+ // wrappers
+ Float_t TextLength(const char* txt);
+ void RenderString(TString tex ,Int_t id = -1);
+ void RenderFrame(Float_t dx, Float_t dy, Int_t id);
+ void RenderSymbol(Float_t dx, Float_t dy, Int_t id);
+ void RenderPalette(Float_t dx, Float_t x, Float_t y);
+ void RenderMenu();
+ void RenderCellIDs();
+
+ // module ID navigation
+ Int_t Nxy(){ return fStepper->Nx*fStepper->Ny; }
+ void AddToList( Int_t modID ){ fIDs.push_back(modID);}
+ void ResetList(){ fIDs.clear();}
+ void SetFirst(Int_t first);
public:
ITSModuleStepper(ITSDigitsInfo* di);
virtual ~ITSModuleStepper();
- void Start();
- void Next();
- void Previous();
- void End();
-
- void SetStepper(Int_t nx, Int_t ny, Float_t dx = -1, Float_t dy = -1);
- Reve::GridStepper* GetStepper(){ return fStepper; }
-
- void AddToList( Int_t modID ){ fIDs.push_back(modID);}
- void ResetList(){ fIDs.clear();}
-
- void DisplayDet(Int_t det, Int_t layer = -1);
- void DisplayTheta(Float_t min, Float_t max);
-
- Int_t GetCurrentPage();
- Int_t GetPages();
-
- virtual Bool_t CanEditMainColor() { return kTRUE; }
-
- Bool_t GetRnrFrame(){ return fRnrFrame; }
- void SetRnrFrame(Bool_t rnr){ fRnrFrame = rnr; }
- Color_t GetWColor(){ return fWColor; };
- void SetWColor(Color_t c){ fWColor=c; }
-
- virtual Reve::ZTrans* PtrMainHMTrans() { return &fHMTrans; }
-
- virtual void ComputeBBox();
-
- virtual void Paint(Option_t* option = "");
+ // external functions
+ void DisplayDet(Int_t det, Int_t layer = -1);
+ void DisplayTheta(Float_t min, Float_t max);
+
+ // overlay functions
+ virtual Bool_t MouseEnter(TGLOvlSelectRecord& selRec);
+ virtual Bool_t Handle(TGLRnrCtx& rnrCtx, TGLOvlSelectRecord& selRec,
+ Event_t* event);
+ virtual void MouseLeave();
+ virtual void Render(TGLRnrCtx& rnrCtx);
+
+ // stepper
+ Reve::GridStepper* GetStepper(){return fStepper;}
+ void SetStepper(Reve::GridStepper* s){ fStepper = s; Apply();}
+
+ Int_t GetCurrentPage();
+ Int_t GetPages();
+ void Start();
+ void Next();
+ void Previous();
+ void End();
+ void Apply();
+ void Capacity();
+
+
+ // getters/setters
+ Color_t GetWColor(){ return fWCol; };
+ void SetWColor(Color_t c){ fWCol = c; }
+ TGLText* GetFont(){ return fText; }
+ void SetGLText(TGLText* t) {fText = t;}
ClassDef(ITSModuleStepper, 0);
};
--- /dev/null
+// $Header$
+
+#include "ITSModuleStepperEditor.h"
+#include <Alieve/ITSModuleStepper.h>
+#include <Reve/GridStepperEditor.h>
+#include <Reve/ReveManager.h>
+
+#include <TVirtualPad.h>
+#include <TColor.h>
+
+#include <TGLabel.h>
+#include <TGButton.h>
+#include <TGNumberEntry.h>
+#include <TGColorSelect.h>
+#include <TGDoubleSlider.h>
+
+using namespace Reve;
+using namespace Alieve;
+
+//______________________________________________________________________
+// ITSModuleStepperEditor
+//
+
+ClassImp(ITSModuleStepperEditor)
+
+ITSModuleStepperEditor::ITSModuleStepperEditor(const TGWindow *p, Int_t width, Int_t height,
+ UInt_t options, Pixel_t back) :
+ TGedFrame(p, width, height, options | kVerticalFrame, back),
+
+ fM(0),
+ fStepper(0)
+{
+ MakeTitle("ITSModuleStepper");
+
+ fStepper = new GridStepperSubEditor(this);
+ fStepper->Connect("Changed()", "Alieve::ITSModuleStepperEditor", this, "UpdateStore()");
+ AddFrame(fStepper, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0));
+}
+
+ITSModuleStepperEditor::~ITSModuleStepperEditor()
+{}
+
+/**************************************************************************/
+
+void ITSModuleStepperEditor::SetModel(TObject* obj)
+{
+ fM = dynamic_cast<ITSModuleStepper*>(obj);
+ fStepper->SetModel(fM->GetStepper());
+}
+
+/**************************************************************************/
+
+void ITSModuleStepperEditor::UpdateStore()
+{
+ fM->Apply();
+ Update();
+ gReve->Redraw3D(kTRUE);
+}
--- /dev/null
+// $Header$
+
+#ifndef ALIEVE_ITSModuleStepperEditor_H
+#define ALIEVE_ITSModuleStepperEditor_H
+
+#include <TGedFrame.h>
+
+class TGCheckButton;
+class TGNumberEntry;
+class TGColorSelect;
+
+namespace Reve
+{
+class GridStepperSubEditor;
+}
+
+namespace Alieve {
+
+class ITSModuleStepper;
+
+class ITSModuleStepperEditor : public TGedFrame
+{
+private:
+ ITSModuleStepperEditor(const ITSModuleStepperEditor&); // Not implemented
+ ITSModuleStepperEditor& operator=(const ITSModuleStepperEditor&); // Not implemented
+
+protected:
+ ITSModuleStepper* fM; // fModel dynamic-casted to ITSModuleStepperEditor
+
+ Reve::GridStepperSubEditor* fStepper;
+
+public:
+ ITSModuleStepperEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
+ virtual ~ITSModuleStepperEditor();
+
+ virtual void SetModel(TObject* obj);
+
+ void UpdateStore();
+ ClassDef(ITSModuleStepperEditor, 0); // Editor for ITSModuleStepper
+}; // endclass ITSModuleStepperEditor
+
+}
+
+#endif
+++ /dev/null
-// $Header$
-
-#include "ITSModuleStepperGL.h"
-
-#include <Reve/GLTextNS.h>
-#include <Reve/GLUtilNS.h>
-#include <Reve/RGTopFrame.h>
-#include <Reve/RGEditor.h>
-#include <Reve/RGBAPalette.h>
-
-#include <Alieve/ITSModuleStepper.h>
-#include <Alieve/ITSScaledModule.h>
-
-#include <TGLRnrCtx.h>
-#include <TGLSelectRecord.h>
-
-using namespace Reve;
-using namespace Alieve;
-
-//______________________________________________________________________
-// ITSModuleStepperGL
-//
-
-ClassImp(ITSModuleStepperGL)
-
-ITSModuleStepperGL::ITSModuleStepperGL() : TGLObject(), fM(0)
-{
- fDLCache = false; // Disable display list.
-}
-
-ITSModuleStepperGL::~ITSModuleStepperGL()
-{}
-
-/**************************************************************************/
-
-Bool_t ITSModuleStepperGL::SetModel(TObject* obj, const Option_t* /*opt*/)
-{
- if(SetModelCheckClass(obj, ITSModuleStepper::Class())) {
- fM = dynamic_cast<ITSModuleStepper*>(obj);
- return kTRUE;
- }
- return kFALSE;
-}
-
-void ITSModuleStepperGL::SetBBox()
-{
- // !! This ok if master sub-classed from TAttBBox
- SetAxisAlignedBBox(fM->AssertBBox());
-}
-
-/**************************************************************************/
-
-void ITSModuleStepperGL::DirectDraw(TGLRnrCtx & rnrCtx) const
-{
- // printf("ITSModuleStepperGL::DirectDraw Style %d, LOD %d\n", rnrCtx.Style(), rnrCtx.LOD());
-
- ITSModuleStepper& MS = *fM;
- Int_t W = Int_t(MS.fStepper->Dx*MS.fStepper->Nx);
- Int_t H = Int_t(MS.fStepper->Dy*MS.fStepper->Ny);
- Float_t dx = W*MS.fWWidth;
- Float_t dy = 6; // H*MS.fWHeight;
-
- GLboolean lightp;
- glGetBooleanv(GL_LIGHTING, &lightp);
- if (lightp) glDisable(GL_LIGHTING);
-
- UChar_t color[4];
- ColorFromIdx(MS.fWColor, color);
- glColor4ubv(color);
-
- // render frame of grid stepper
- if (MS.fRnrFrame)
- {
- glBegin(GL_LINE_LOOP);
- glVertex2f(-1, -1);
- glVertex2f(W+1, -1);
- glVertex2f(W+1, H+1);
- glVertex2f(-1 , H+1);
- glEnd();
- }
-
- // triangles
- glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- glDisable(GL_CULL_FACE);
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-
- Float_t sx =0 ,sy = 0;
- switch(MS.fWCorner) {
- case ITSModuleStepper::PT_BottomLeft:
- sy = -dy;
- break;
- case ITSModuleStepper::PT_BottomRight:
- sy = -dy;
- break;
- case ITSModuleStepper::PT_TopLeft:
- sy = H;
- break;
- case ITSModuleStepper::PT_TopRight:
- sy = H;
- break;
- default:
- sy = dy;
- break;
- }
-
- if (rnrCtx.SecSelection()) glPushName(0);
- glPushMatrix();
- glTranslatef(sx, sy, 0.);
-
- // pager
- if (rnrCtx.SecSelection()) glLoadName(2);
- RenderSymbol(dx, dy, 2);
- glTranslatef(dx, 0, 0);
- if (rnrCtx.SecSelection()) glLoadName(1);
- RenderSymbol(dx*1.2, dy, 1);
- glTranslatef(dx, 0, 0);
- RenderString(Form(" %d/%d ", MS.GetCurrentPage(), MS.GetPages()), dy);
- if (rnrCtx.SecSelection()) glLoadName(3);
- RenderSymbol(dx*1.2, dy, 3);
- glTranslatef(dx, 0, 0);
- if (rnrCtx.SecSelection()) glLoadName(4);
- RenderSymbol(dx, dy, 4);
- glTranslatef(2*dx, 0, 0);
-
- // scale info
- Int_t cnx = 0, cnz = 0;
- ITSDigitsInfo* di = MS.fDigitsInfo;
- Int_t scale = fM->fScaleInfo->GetScale() - 1;
- ITSScaledModule* sm = dynamic_cast<ITSScaledModule*>(*fM->BeginChildren());
- switch(sm->GetSubDetID())
- {
- case 0:
- cnx = di->fSPDScaleX[scale], cnz = di->fSPDScaleZ[scale];
- break;
- case 1:
- cnx = di->fSDDScaleX[scale], cnz = di->fSDDScaleZ[scale];
- break;
- case 2:
- cnx = di->fSSDScale[scale], cnz = 1;
- break;
- }
- if (rnrCtx.SecSelection()) glLoadName(0);
- RenderString(Form("Scale"), dy);
- glTranslatef(0.07*dx, 0, 0);
- // up down arrows
- if (rnrCtx.SecSelection()) glLoadName(6);
- RenderSymbol(dx*1.2, dy*0.9, 5);
-
- if (rnrCtx.SecSelection()) glLoadName(7);
- RenderSymbol(dx*1.2, dy*0.9, 6);
-
- glTranslatef(1*dx, 0, 0);
- if (rnrCtx.SecSelection()) glLoadName(0);
- RenderString(Form(" %dx%d ", cnx, cnz), dy, kFALSE);
-
- glPopMatrix();
- if (rnrCtx.SecSelection()) glLoadName(5);
- glPushMatrix();
- glTranslatef(W+2, 0, 0);
- RenderPalette(H, 4);
- glPopMatrix();
-
- if (rnrCtx.SecSelection()) glPopName();
-
- glPopAttrib();
-
- if (lightp) glEnable(GL_LIGHTING);
-}
-
-/**************************************************************************/
-
-void ITSModuleStepperGL::RenderPalette(Float_t dx, Float_t dy) const
-{
- ITSModule* qs = dynamic_cast<ITSModule*>(*fM->BeginChildren());
- RGBAPalette* p = qs->GetPalette();
- Float_t xs = dx/(p->GetMaxVal()- p->GetMinVal());
- Float_t ys = dy;
-
- Float_t x = 0;
- glBegin(GL_QUAD_STRIP);
- for(Int_t i=p->GetMinVal(); i<=p->GetMaxVal(); i++)
- {
- glColor4ubv(p->ColorFromValue(i + p->GetMinVal()));
- glVertex2f(0, x);
- glVertex2f(ys, x);
- x+=xs;
- }
- glEnd();
-}
-
-/**************************************************************************/
-
-void ITSModuleStepperGL::RenderSymbol(Float_t dx, Float_t dy, Int_t id) const
-{
- Float_t xs = dx/4, ys = dy/4;
-
- if(id == 0) {
- glBegin(GL_QUADS);
- glVertex2f(0,ys); glVertex2f(0, ys*3);
- glVertex2f(dx, ys*3); glVertex2f(dx, ys);
- glEnd();
- return;
- }
-
-
- glBegin(GL_TRIANGLES);
- switch (id) {
- case 1:
- {
- glVertex2f(xs*2.5, ys*3); glVertex2f(xs*1.5, ys*2); glVertex2f(xs*2.5, ys);
- break;
- }
- case 2:
- {
- glVertex2f(xs*2, ys*3); glVertex2f(xs, ys*2); glVertex2f(xs*2, ys);
- glVertex2f(xs*3, ys*3); glVertex2f(xs*2, ys*2); glVertex2f(xs*3, ys);
- break;
- }
- case 3:
- {
- glVertex2f(xs*1.5, ys); glVertex2f(xs*2.5, ys*2); glVertex2f(xs*1.5, ys*3);
- break;
- }
- case 4:
- {
- glVertex2f(xs, ys); glVertex2f(xs*2, ys*2); glVertex2f(xs, ys*3);
- glVertex2f(xs*2, ys); glVertex2f(xs*3, ys*2); glVertex2f(xs*2, ys*3);
- break;
- }
- case 5:
- {
- glVertex2f(xs, ys*2.5); glVertex2f(xs*2, ys*3.5); glVertex2f(xs*3, ys*2.5);
- break;
- }
- case 6:
- {
- glVertex2f(xs, ys*1.5); glVertex2f(xs*2, ys*0.5); glVertex2f(xs*3, ys*1.5);
- break;
- }
-
- default:
- break;
- }
- glEnd();
-}
-
-/**************************************************************************/
-void ITSModuleStepperGL::RenderString(TString info, Float_t dy, Bool_t trans) const
-{
- Float_t movex = 0;
-
- GLUtilNS::GL_Capability_Switch texure_on(GL_TEXTURE_2D, true);
- GLTextNS::txfBindFontTexture(GLTextNS::fgDefaultFont);
-
- glPushMatrix();
- glTranslatef(0, dy*0.25, 0);
- Float_t s = (dy)/ (GLTextNS::fgDefaultFont->max_height());
- Float_t sx = s*0.75; Float_t sy = s*0.8;
- glScalef(sx, sy, 1);
- txfRenderString(GLTextNS::fgDefaultFont, info.Data(), info.Length());
- Int_t w, ma, md;
- txfGetStringMetrics(GLTextNS::fgDefaultFont,info.Data(), info.Length() , w, ma, md);
- movex = w*sx;
- glPopMatrix();
-
- if(trans)
- glTranslatef(movex, 0, 0);
-}
-
-/**************************************************************************/
-
-void ITSModuleStepperGL::ProcessSelection(TGLRnrCtx & /*rnrCtx*/,
- TGLSelectRecord & rec)
-{
- // Processes secondary selection from TGLViewer.
- // Calls TPointSet3D::PointSelected(Int_t) with index of selected
- // point as an argument.
-
- if (rec.GetN() < 2) return;
-
- switch (rec.GetItem(1)) {
- case 1:
- fM->Previous();
- break;
- case 2:
- fM->Start();
- break;
- case 3:
- fM->Next();
- break;
- case 4:
- fM->End();
- break;
- case 5:
- gReve->GetEditor()->DisplayRenderElement(*fM->BeginChildren());
- break;
- case 6:
- {
- DigitScaleInfo* si = fM->fScaleInfo;
- if(si->fScale < 5)
- {
- si->ScaleChanged(si->fScale + 1);
- gReve->GetEditor()->DisplayObject(gReve->GetEditor()->GetModel());
- gReve->Redraw3D();
- }
- break;
- }
- case 7:
- {
- DigitScaleInfo* si = fM->fScaleInfo;
- if(si->fScale > 1)
- {
- si->ScaleChanged(si->GetScale() - 1);
- gReve->GetEditor()->DisplayObject(gReve->GetEditor()->GetModel());
- gReve->Redraw3D();
- }
- break;
- }
- default:
- break;
- }
-}
+++ /dev/null
-// $Header$
-
-#ifndef ALIEVE_ITSModuleStepperGL_H
-#define ALIEVE_ITSModuleStepperGL_H
-
-#include <TGLObject.h>
-
-class TGLViewer;
-class TGLScene;
-class TString;
-
-namespace Alieve {
-
-class ITSModuleStepper;
-
-class ITSModuleStepperGL : public TGLObject
-{
-private:
- ITSModuleStepperGL(const ITSModuleStepperGL&); // Not implemented
- ITSModuleStepperGL& operator=(const ITSModuleStepperGL&); // Not implemented
-
- void RenderSymbol(Float_t dx, Float_t dy, Int_t id) const;
- void RenderString(TString text , Float_t dy, Bool_t trans = kTRUE) const;
- void RenderPalette(Float_t dx, Float_t dy) const;
-protected:
- ITSModuleStepper* fM; // fModel dynamic-casted to ITSModuleStepperGL
-
- virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
-
-public:
- ITSModuleStepperGL();
- virtual ~ITSModuleStepperGL();
-
- virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0);
- virtual void SetBBox();
-
- virtual Bool_t IgnoreSizeForOfInterest() const { return kTRUE; }
- virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
- virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec);
-
- ClassDef(ITSModuleStepperGL, 0);
-}; // endclass ITSModuleStepperGL
-
-}
-
-#endif
DigitScaleInfo::DigitScaleInfo():
fScale(1),
fStatType (ST_Average),
- fAutoUpdatePalette(kTRUE)
+ fSyncPalette(kFALSE)
{
}
void DigitScaleInfo::ScaleChanged(Int_t s)
{
- fScale = s;
- Emit("ScaleChanged(Int_t)",fScale);
+ fScale = s;
+
+ ITSScaledModule* sm;
+ std::list<RenderElement*>::iterator i = fBackRefs.begin();
+ while (i != fBackRefs.end())
+ {
+ sm = dynamic_cast<ITSScaledModule*>(*i);
+ if(sm) sm->LoadQuads();
+ ++i;
+ }
}
void DigitScaleInfo::StatTypeChanged(Int_t t)
{
- fStatType = t;
- Emit("StatTypeChanged(Int_t)",fStatType);
+ fStatType = t;
+ fSyncPalette = kTRUE;
+
+ ITSScaledModule* sm;
+ std::list<RenderElement*>::iterator i = fBackRefs.begin();
+ while (i != fBackRefs.end())
+ {
+ sm = dynamic_cast<ITSScaledModule*>(*i);
+ if(sm) sm->SetQuadValues();
+ ++i;
+ }
}
//______________________________________________________________________
-// DigitScaleInfo
+// ScaledDigit
//
ScaledDigit::ScaledDigit():
TObject(),
ClassImp(ITSScaledModule)
- ITSScaledModule::ITSScaledModule(Int_t gid, ITSDigitsInfo* info, DigitScaleInfo* si):
+ITSScaledModule::ITSScaledModule(Int_t gid, ITSDigitsInfo* info, DigitScaleInfo* si):
ITSModule("ITSScaledModule", "ITSScaledModule"),
fNx(-1),
fNz(-1),
fNCz(-1),
fScaleInfo(si)
{
- si->IncRefCount(this);
- si->Connect("ScaleChanged(Int_t)", "Alieve::ITSScaledModule", this,"LoadQuads()");
- si->Connect("StatTypeChanged(Int_t)", "Alieve::ITSScaledModule", this,"SetQuadValues()");
SetOwnIds(kTRUE);
SetDigitsInfo(info);
- SetID(gid);
+ SetID(gid);
+ fScaleInfo->IncRefCount(this);
}
ITSScaledModule::~ITSScaledModule()
{
- fScaleInfo->DecRefCount();
+ fScaleInfo->DecRefCount(this);
}
/**************************************************************************/
void ITSScaledModule::SetQuadValues()
{
- Int_t N = fPlex.Size();
+ if(fScaleInfo->GetSyncPalette()) SyncPalette();
+
+ Int_t N = fPlex.Size();
for (Int_t i = 0 ; i< N; i++)
{
ScaledDigit* sd = dynamic_cast<ScaledDigit*>(GetId(i));
Int_t v = 0;
- switch(fScaleInfo->GetStatType()) {
- case DigitScaleInfo::ST_Occup: v = sd->N; break;
- case DigitScaleInfo::ST_Average: v = Int_t(sd->sum/(1.* sd->N)); break;
- case DigitScaleInfo::ST_Rms: v = Int_t(TMath::Sqrt(sd->sqr_sum)/(1.*sd->N)); break;
+ switch(fScaleInfo->GetStatType())
+ {
+ using namespace TMath;
+
+ case DigitScaleInfo::ST_Occup:
+ v = Nint((100.0*sd->N) / (fNCx*fNCz));
+ break;
+ case DigitScaleInfo::ST_Average:
+ v = Nint((Double_t) sd->sum / sd->N);
+ break;
+ case DigitScaleInfo::ST_Rms:
+ v = Nint(Sqrt(sd->sqr_sum) / sd->N);
+ break;
}
- QuadBase* qb = GetQuad(i);
+ DigitBase* qb = GetDigit(i);
qb->fValue = v;
}
}
/**************************************************************************/
-void ITSScaledModule::QuadSelected(Int_t idx)
+void ITSScaledModule::SyncPalette()
+{
+ // printf("ITSScaledModule::SyncPalette()\n");
+ if(fScaleInfo->GetStatType() == DigitScaleInfo::ST_Occup)
+ {
+ // SPD
+ ITSModule::fgSPDPalette->SetLimits(0, 100);
+ ITSModule::fgSPDPalette->SetMinMax(0, 100);
+
+ // SDD
+ ITSModule::fgSDDPalette->SetLimits(0, 100);
+ ITSModule::fgSDDPalette->SetMinMax(0, 100);
+
+ // SSD
+ ITSModule::fgSSDPalette->SetLimits(0, 100);
+ ITSModule::fgSDDPalette->SetMinMax(0, 100);
+ }
+ else
+ {
+ Alieve::ITSDigitsInfo& DI = *fInfo;
+ // SPD
+ ITSModule::fgSPDPalette->SetLimits(0, DI.fSPDHighLim);
+ ITSModule::fgSPDPalette->SetMinMax(DI.fSPDMinVal, DI.fSPDMaxVal);
+
+ // SDD
+ ITSModule::fgSDDPalette->SetLimits(0, DI.fSDDHighLim);
+ ITSModule::fgSDDPalette->SetMinMax(DI.fSDDMinVal, DI.fSDDMaxVal);
+
+ // SSD
+ ITSModule::fgSSDPalette->SetLimits(0, DI.fSSDHighLim);
+ ITSModule::fgSSDPalette->SetMinMax(DI.fSSDMinVal, DI.fSSDMaxVal);
+ }
+
+ fScaleInfo->SetSyncPalette(kFALSE);
+}
+
+/**************************************************************************/
+
+void ITSScaledModule::GetScaleData(Int_t& cnx, Int_t& cnz, Int_t& total)
+{
+ cnx =fNx;
+ cnz =fNz;
+ total = cnx*cnz;
+}
+
+/**************************************************************************/
+
+void ITSScaledModule::DigitSelected(Int_t idx)
{
// Override control-click from QuadSet
- printf("ITSScaledModule::QuadSelected "); Print();
+ printf("ITSScaledModule::DigitSelected "); Print();
- QuadBase* qb = GetQuad(idx);
+ DigitBase* qb = GetDigit(idx);
TObject* obj = qb->fId.GetObject();
ScaledDigit* sd = dynamic_cast<ScaledDigit*>(obj);
TClonesArray *digits = fInfo->GetDigits(fID, fDetID);
{
public:
enum StatType_e { ST_Occup, ST_Average, ST_Rms };
-
- Int_t fScale;
- Int_t fStatType;
- Bool_t fAutoUpdatePalette;
+ // Bool_t fAutoUpdatePalette;
private:
DigitScaleInfo(const DigitScaleInfo&); // Not implemented
DigitScaleInfo& operator=(const DigitScaleInfo&); // Not implemented
+protected:
+ Int_t fScale;
+ Int_t fStatType;
+
+ Bool_t fSyncPalette;
+
public:
DigitScaleInfo();
virtual ~DigitScaleInfo(){}
Int_t GetScale() { return fScale; }
- void ScaleChanged(Int_t s); //*SIGNAL*
+ void ScaleChanged(Int_t s);
Int_t GetStatType() { return fStatType; }
- void StatTypeChanged(Int_t t); //*SIGNAL*
+ void StatTypeChanged(Int_t t);
+
+ Bool_t GetSyncPalette(){return fSyncPalette;}
+ void SetSyncPalette(Bool_t x){fSyncPalette = x;}
ClassDef(DigitScaleInfo, 1);
};
ITSScaledModule(Int_t gid, ITSDigitsInfo* info, DigitScaleInfo* si );
virtual ~ITSScaledModule();
- virtual void QuadSelected(Int_t idx);
+ virtual void DigitSelected(Int_t idx);
virtual void LoadQuads();
void SetQuadValues();
+ void SyncPalette();
+
+ void GetScaleData(Int_t& cnx, Int_t& cnz, Int_t& total);
DigitScaleInfo* GetScaleInfo(){ return fScaleInfo; }
ClassDef(ITSScaledModule, 1);
#include <TGedEditor.h>
#include <TGLabel.h>
+#include <TG3DLine.h>
#include <TGButton.h>
#include <TGNumberEntry.h>
#include <TGColorSelect.h>
using namespace Alieve;
//______________________________________________________________________
-// SDPaletteSubEditor
+// ITSScaledModuleEditor
//
-ITSSDSubEditor::ITSSDSubEditor(const TGWindow* p) :
- RGBAPaletteSubEditor(p),
- fModule(0),
- fScale(0),
- fStatistic(0),
- fInfoLabel0(0),
- fInfoLabel1(0),
- fInfoLabel2(0)
+
+ClassImp(ITSScaledModuleEditor)
+
+ ITSScaledModuleEditor::ITSScaledModuleEditor(const TGWindow *p, Int_t width, Int_t height,
+ UInt_t options, Pixel_t back) :
+ TGedFrame(p, width, height, options | kVerticalFrame, back),
+
+ fInfoFrame(0),
+
+ fModule(0),
+
+ fScale(0),
+ fStatistic(0),
+ fInfoLabel0(0),
+ fInfoLabel1(0)
{
+ MakeTitle("ITSScaledModule");
// Create widgets
{
TGHorizontalFrame* f = new TGHorizontalFrame(this);
fScale->GetNumberEntry()->SetToolTipText("Set cell size.");
f->AddFrame(fScale, new TGLayoutHints(kLHintsLeft, 1, 7, 1, 1));
fScale->Associate(f);
- fScale->Connect("ValueSet(Long_t)", "Alieve::ITSSDSubEditor", this, "DoScale()");
+ fScale->Connect("ValueSet(Long_t)", "Alieve::ITSScaledModuleEditor", this, "DoScale()");
TGLabel* lab = new TGLabel(f, "Statistic:");
f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 2, 1, 2));
TGListBox* lb = fStatistic->GetListBox();
lb->Resize(lb->GetWidth(), 3*16);
fStatistic->Resize(74, 20);
- fStatistic->Connect("Selected(Int_t)", "Alieve::ITSSDSubEditor", this, "DoStatType(Int_t)");
+ fStatistic->Connect("Selected(Int_t)", "Alieve::ITSScaledModuleEditor", this, "DoStatType(Int_t)");
f->AddFrame(fStatistic, new TGLayoutHints(kLHintsLeft, 1, 2, 1, 1));
AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
}
+ CreateInfoFrame();
+}
+
+/*************************************************************************/
+ITSScaledModuleEditor::~ITSScaledModuleEditor()
+{}
+
+/*************************************************************************/
+void ITSScaledModuleEditor::CreateInfoFrame()
+{
+ fInfoFrame = CreateEditorTabSubFrame("Info");
+ TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10,
+ kHorizontalFrame |
+ kLHintsExpandX |
+ kFixedWidth |
+ kOwnBackground);
+
+ title1->AddFrame(new TGLabel(title1, "ScaledDigits Info"),
+ new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
+ title1->AddFrame(new TGHorizontal3DLine(title1),
+ new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
+ fInfoFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
+
+
Int_t lp = 2;
- fInfoLabel0 = new TGLabel(this);
+ fInfoLabel0 = new TGLabel(fInfoFrame);
fInfoLabel0->SetTextJustify(kTextLeft);
- AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
- lp, 0, 8, 0));
+ fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
+ lp, 0, 8, 0));
- fInfoLabel1 = new TGLabel(this);
+ fInfoLabel1 = new TGLabel(fInfoFrame);
fInfoLabel1->SetTextJustify(kTextLeft);
- AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
- lp, 0, 2, 0));
+ fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
+ lp, 0, 2, 8));
- fInfoLabel2 = new TGLabel(this);
- fInfoLabel2->SetTextJustify(kTextLeft);
- AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
- lp, 0, 2, 0));
}
/**************************************************************************/
-void ITSSDSubEditor::SetModel(ITSScaledModule* mod)
+void ITSScaledModuleEditor::SetModel(TObject* obj)
{
- fModule = mod;
- RGBAPaletteSubEditor::SetModel(fModule->GetPalette());
-
+ fModule = dynamic_cast<ITSScaledModule*>(obj);
+
+ // widgets
fScale->SetIntNumber(fModule->GetScaleInfo()->GetScale());
fStatistic->Select(fModule->GetScaleInfo()->GetStatType(), kFALSE);
-
+
+ // text info
Int_t cnx, cnz, total;
- Float_t maxoc;
- GetSubDetScaleData(cnx, cnz, total, maxoc);
+ fModule->GetScaleData(cnx, cnz, total);
fInfoLabel0->SetText(Form("Cell size: Nx=%d Nz=%d", cnx, cnz));
fInfoLabel1->SetText(Form("Num cells: %d", total));
- fInfoLabel2->SetText(Form("Max occupancy: %5.3f%%", maxoc));
-
- SetPaletteFromDigitInfo();
-}
-
-/**************************************************************************/
-
-void ITSSDSubEditor::GetSubDetScaleData(Int_t& cnx, Int_t& cnz, Int_t& total, Float_t& maxoc)
-{
- Int_t scale = fScale->GetIntNumber() -1;
- Alieve::ITSDigitsInfo* di = fModule->GetDigitsInfo();
- switch(fModule->fDetID)
- {
- case 0:
- cnx = di->fSPDScaleX[scale], cnz = di->fSPDScaleZ[scale];
- total = di->fSegSPD->Npx()*di->fSegSPD->Npz();
- maxoc = di->fSPDMaxOcc;;
- break;
- case 1:
- cnx = di->fSDDScaleX[scale], cnz = di->fSDDScaleZ[scale];
- total = di->fSegSDD->Npx()*di->fSegSDD->Npz();
- maxoc = di->fSDDMaxOcc;;
- break;
- case 2:
- cnx = di->fSSDScale[scale], cnz = 1;
- total = di->fSegSSD->Npx()*di->fSegSSD->Npz();
- maxoc = di->fSSDMaxOcc;;
- break;
- }
}
-/**************************************************************************/
-
-void ITSSDSubEditor::SetPaletteFromDigitInfo()
-{
- // apply values for color palettefgdif
- if(fModule->GetScaleInfo()->fAutoUpdatePalette)
- {
- Int_t cnx, cnz, total;
- Float_t maxoc;
- GetSubDetScaleData(cnx, cnz, total, maxoc);
- Alieve::ITSDigitsInfo* di = fModule->GetDigitsInfo();
- if(fStatistic->GetSelected() == DigitScaleInfo::ST_Occup)
- {
- Int_t scale = fScale->GetIntNumber() -1;
- fMinMax->SetValues(0, TMath::Max(Int_t(cnx*cnz*maxoc),1), kFALSE);
- ITSModule::fgSPDPalette->SetMinMax(0,TMath::Max(Int_t(di->fSPDScaleZ[scale]*di->fSPDScaleX[scale]*di->fSPDMaxOcc), 1));
- ITSModule::fgSDDPalette->SetMinMax(0,TMath::Max(Int_t(di->fSDDScaleZ[scale]*di->fSDDScaleX[scale]*di->fSPDMaxOcc), 1));
- ITSModule::fgSSDPalette->SetMinMax(0,TMath::Max(Int_t(di->fSSDScale[scale]*di->fSPDMaxOcc), 1));
- }
- else
- {
- ITSModule::fgSPDPalette->SetMinMax(di->fSPDMinVal,di->fSPDMaxVal);
- ITSModule::fgSDDPalette->SetMinMax(di->fSDDMinVal,di->fSDDMaxVal);
- ITSModule::fgSSDPalette->SetMinMax(di->fSSDMinVal,di->fSSDMaxVal);
- }
- }
-}
/**************************************************************************/
-void ITSSDSubEditor::DoScale()
+void ITSScaledModuleEditor::DoScale()
{
- Int_t cnx, cnz, total; Float_t maxoc;
- GetSubDetScaleData(cnx, cnz, total, maxoc);
- fInfoLabel0->SetText(Form("Cell size: Nx=%d Nz=%d", cnx, cnz));
-
- SetPaletteFromDigitInfo();
-
fModule->GetScaleInfo()->ScaleChanged(fScale->GetIntNumber());
- Changed();
-}
-
-/**************************************************************************/
-
-void ITSSDSubEditor::DoStatType(Int_t v)
-{
- // update palette
- SetPaletteFromDigitInfo();
-
- fModule->GetScaleInfo()->StatTypeChanged(v);
-
- Changed();
-}
-//______________________________________________________________________
-// ITSScaledModuleEditor
-//
-
-ClassImp(ITSScaledModuleEditor)
-
-ITSScaledModuleEditor::ITSScaledModuleEditor(const TGWindow *p, Int_t width, Int_t height,
- UInt_t options, Pixel_t back) :
- TGedFrame(p, width, height, options | kVerticalFrame, back),
- fM(0),
- fHMTrans (0),
- fSDPalette (0)
-{
- MakeTitle("ITSScaledModule");
-
- fHMTrans = new ZTransSubEditor(this);
- fHMTrans->Connect("UseTrans()", "Alieve::ITSScaledModuleEditor", this, "Update()");
- fHMTrans->Connect("TransChanged()", "Alieve::ITSScaledModuleEditor", this, "Update()");
- AddFrame(fHMTrans, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0));
-
- MakeTitle("Palette controls");
-
- fSDPalette = new ITSSDSubEditor(this);
- fSDPalette->Connect("Changed", "Alieve::ITSScaledModuleEditor", this, "Update()");
- AddFrame(fSDPalette, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0));
-}
-
-/*************************************************************************/
-ITSScaledModuleEditor::~ITSScaledModuleEditor()
-{}
-
-/**************************************************************************/
-
-void ITSScaledModuleEditor::ActivateBaseClassEditors(TClass* cl)
-{
- // exclude QuadSet editor
- fGedEditor->ExcludeClassEditor(QuadSet::Class());
- TGedFrame::ActivateBaseClassEditors(cl);
+ Int_t cnx, cnz, total;
+ fModule->GetScaleData(cnx, cnz, total);
+ fInfoLabel0->SetText(Form("Cell size: Nx=%d Nz=%d", cnx, cnz));
+ Update();
+ fGedEditor->SetModel(fGedEditor->GetPad(), fGedEditor->GetModel(), kButton1Down);
}
/**************************************************************************/
-void ITSScaledModuleEditor::SetModel(TObject* obj)
+void ITSScaledModuleEditor::DoStatType(Int_t v)
{
- fM = dynamic_cast<ITSScaledModule*>(obj);
-
- fHMTrans->SetDataFromTrans(&fM->RefHMTrans());
-
- if (fM->GetValueIsColor() || fM->GetPalette() == 0) {
- fSDPalette->UnmapWindow();
- } else {
- fSDPalette->SetModel(fM);
- fSDPalette->MapWindow();
- }
+ fModule->GetScaleInfo()->StatTypeChanged(v);
+ Update();
+ fGedEditor->SetModel(fGedEditor->GetPad(), fGedEditor->GetModel(), kButton1Down);
}
class RGValuator;
class RGDoubleValuator;
class RGBAPalette;
-class ZTransSubEditor;
}
namespace Alieve {
class ITSScaledModule;
class AliITSsegmentation;
-class ITSSDSubEditor : public Reve::RGBAPaletteSubEditor
-{
-private:
- ITSSDSubEditor(const ITSSDSubEditor&); // Not implemented
- ITSSDSubEditor& operator=(const ITSSDSubEditor&); // Not implemented
-
- void GetSubDetScaleData(Int_t& cnx, Int_t& cnz, Int_t& total, Float_t& maxoc);
- void SetPaletteFromDigitInfo();
-protected:
- ITSScaledModule* fModule;
-
- TGNumberEntry* fScale;
- TGComboBox* fStatistic;
-
- TGLabel* fInfoLabel0;
- TGLabel* fInfoLabel1;
- TGLabel* fInfoLabel2;
-
-public:
- ITSSDSubEditor(const TGWindow* p);
- virtual ~ITSSDSubEditor() {}
-
- void SetModel(ITSScaledModule* sm);
-
- void DoScale();
- void DoStatType(Int_t t);
-
- ClassDef(ITSSDSubEditor, 1); // SubEditor for RGBAPalelet and scaled digits
-}; // endclass ITSSDPaletteSubEditor
-
/**************************************************************************/
class ITSScaledModuleEditor : public TGedFrame
ITSScaledModuleEditor(const ITSScaledModuleEditor&); // Not implemented
ITSScaledModuleEditor& operator=(const ITSScaledModuleEditor&); // Not implemented
+ void CreateInfoFrame();
+
protected:
- ITSScaledModule* fM; // fModel dynamic-casted to ITSScaledModuleEditor
+ TGVerticalFrame* fInfoFrame;
+
+ ITSScaledModule* fModule; // fModel dynamic-casted to ITSScaledModuleEditor
+
+ TGNumberEntry* fScale;
+ TGComboBox* fStatistic;
+
+ TGLabel* fInfoLabel0;
+ TGLabel* fInfoLabel1;
- Reve::ZTransSubEditor* fHMTrans;
- ITSSDSubEditor* fSDPalette;
-
public:
ITSScaledModuleEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
virtual ~ITSScaledModuleEditor();
- virtual void ActivateBaseClassEditors(TClass* cl);
-
virtual void SetModel(TObject* obj);
+ void DoScale();
+ void DoStatType(Int_t t);
+
ClassDef(ITSScaledModuleEditor, 0); // Editor for ITSScaledModule
}; // endclass ITSScaledModuleEditor
#pragma link C++ class Alieve::ITSModule+;
#pragma link C++ class Alieve::DigitScaleInfo+;
#pragma link C++ class Alieve::ITSScaledModule+;
-#pragma link C++ class Alieve::ITSSDSubEditor+;
#pragma link C++ class Alieve::ITSScaledModuleEditor+;
#pragma link C++ class Alieve::ITSModuleStepper+;
-#pragma link C++ class Alieve::ITSModuleStepperGL+;
+#pragma link C++ class Alieve::ITSModuleStepperEditor;
// MUON
#pragma link C++ class Alieve::MUONData+;
Reve::FrameBox *pmdModBox = new FrameBox();
pmdModBox->SetAAQuadXY(xism, yism, 0, dxism, dyism);
pmdModBox->SetFrameColor((Color_t) 31);
-
- Reve::RGBAPalette *pmdModPalette = new RGBAPalette(20, 1000);
- pmdModPalette->SetLimits(0, 1000);
+ pmdModBox->SetFrameFill(kTRUE);
+ SetFrame(pmdModBox);
SetName(smodule.Data());
SetOwnIds(kTRUE);
Reset(Reve::QuadSet::QT_HexagonXY, kFALSE, 32);
-
- SetFrame(pmdModBox);
- SetPalette(pmdModPalette);
fH1 = new TH1F("fH1", smodule.Data(), 100, 0., 1000.);
fH1->SetDirectory(0);
#include "PMDModuleEditor.h"
#include <Alieve/PMDModule.h>
+#include <Reve/RGEditor.h>
#include <TVirtualPad.h>
#include <TColor.h>
#include <TGLabel.h>
+#include <TG3DLine.h>
#include <TGButton.h>
#include <TGNumberEntry.h>
#include <TGColorSelect.h>
#include <TCanvas.h>
#include <TGLViewer.h>
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <TH1F.h>
UInt_t options, Pixel_t back) :
TGedFrame(p, width, height, options | kVerticalFrame, back),
fM(0),
+ fInfoFrame(0),
fInfoLabel0(0),
fInfoLabel1(0),
fInfoLabel2(0),
{
MakeTitle("PMDModule");
- Int_t labelW = 67;
+ CreateInfoFrame();
+}
+
+void PMDModuleEditor::CreateInfoFrame()
+{
+ fInfoFrame = CreateEditorTabSubFrame("Info");
- // Create widgets
- // fXYZZ = new TGSomeWidget(this, ...);
- // AddFrame(fXYZZ, new TGLayoutHints(...));
- // fXYZZ->Connect("SignalName()", "Alieve::PMDModuleEditor", this, "DoXYZZ()");
+ TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 145, 10,
+ kHorizontalFrame |
+ kLHintsExpandX |
+ kFixedWidth |
+ kOwnBackground);
- fInfoLabel0 = new TGLabel(this);
+ title1->AddFrame(new TGLabel(title1, "PMDModule Info"),
+ new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
+ title1->AddFrame(new TGHorizontal3DLine(title1),
+ new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
+ fInfoFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
+
+ Int_t labelW = 67;
+
+ fInfoLabel0 = new TGLabel(fInfoFrame);
fInfoLabel0->SetTextJustify(kTextLeft);
- AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
+ fInfoFrame->AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
8, 0, 2, 0));
- fInfoLabel1 = new TGLabel(this);
+ fInfoLabel1 = new TGLabel(fInfoFrame);
fInfoLabel1->SetTextJustify(kTextLeft);
- AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
+ fInfoFrame->AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
8, 0, 2, 0));
- fInfoLabel2 = new TGLabel(this);
+ fInfoLabel2 = new TGLabel(fInfoFrame);
fInfoLabel2->SetTextJustify(kTextLeft);
- AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
+ fInfoFrame->AddFrame(fInfoLabel2, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
8, 0, 2, 0));
- fInfoLabel3 = new TGLabel(this);
+ fInfoLabel3 = new TGLabel(fInfoFrame);
fInfoLabel3->SetTextJustify(kTextLeft);
- AddFrame(fInfoLabel3, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
+ fInfoFrame->AddFrame(fInfoLabel3, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
8, 0, 2, 0));
- fInfoLabel4 = new TGLabel(this);
+ fInfoLabel4 = new TGLabel(fInfoFrame);
fInfoLabel4->SetTextJustify(kTextLeft);
- AddFrame(fInfoLabel4, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
+ fInfoFrame->AddFrame(fInfoLabel4, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
8, 0, 2, 0));
- fInfoLabel5 = new TGLabel(this);
+ fInfoLabel5 = new TGLabel(fInfoFrame);
fInfoLabel5->SetTextJustify(kTextLeft);
- AddFrame(fInfoLabel5, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
+ fInfoFrame->AddFrame(fInfoLabel5, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
8, 0, 2, 0));
{
- TGHorizontalFrame* f = new TGHorizontalFrame(this, 210, 20, kFixedWidth);
+ TGHorizontalFrame* f = new TGHorizontalFrame(fInfoFrame, 210, 20, kFixedWidth);
TGHorizontalFrame* g = new TGHorizontalFrame(f, labelW, 0, kFixedWidth);
TGLabel* l = new TGLabel(g, "Histos:");
f->AddFrame(b, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 1, 1, 0, 0));
b->Connect("Clicked()", "Alieve::PMDModuleEditor", this, "DisplayHistos()");
- AddFrame(f, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
+ fInfoFrame->AddFrame(f, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
}
-
-
}
PMDModuleEditor::~PMDModuleEditor()
fM = dynamic_cast<PMDModule*>(obj);
// Set values of widgets
- // fXYZZ->SetValue(fM->GetXYZZ());
fInfoLabel0->SetText(Form("Cells hit per Module : %d", fM->GetNPads()));
fInfoLabel1->SetText(Form("ADC per Module : %d", fM->GetAdc()));
gPad->Modified();
gPad->Update();
}
-
-
-
-
-/**************************************************************************/
-
-// Implements callback/slot methods
-
-// void PMDModuleEditor::DoXYZZ()
-// {
-// fM->SetXYZZ(fXYZZ->GetValue());
-// Update();
-// }
PMDModuleEditor(const PMDModuleEditor&); // Not implemented
PMDModuleEditor& operator=(const PMDModuleEditor&); // Not implemented
+ void CreateInfoFrame();
+
protected:
PMDModule* fM; // fModel dynamic-casted to PMDModuleEditor
+ TGVerticalFrame* fInfoFrame;
+
TGLabel* fInfoLabel0;
TGLabel* fInfoLabel1;
TGLabel* fInfoLabel2;
TGLabel* fInfoLabel4;
TGLabel* fInfoLabel5;
-
- // Declare widgets
- // TGSomeWidget* fXYZZ;
-
public:
PMDModuleEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
virtual ~PMDModuleEditor();
#include <TStyle.h>
#include <TMath.h>
#include <TRandom.h>
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <AliT0digit.h>
#include "TArrayI.h"
#include <AliRawReader.h>
/**************************************************************************/
-void T0Module::QuadSelected(Int_t idx)
+void T0Module::DigitSelected(Int_t idx)
{
// Override control-click from QuadSet
- QuadBase* qb = GetQuad(idx);
+ DigitBase* qb = GetDigit(idx);
if (fSigType == 0) { //ADC
printf("adc====================\n");
Int_t besttimeright = fDigits->BestTimeA();
T0Module(const Text_t* n="T0Module", Int_t sigType=0, AliT0digit *digits=0,AliT0RawReader *start=0);
virtual ~T0Module();
+ virtual void DigitSelected(Int_t idx);
- virtual void QuadSelected(Int_t idx);
- static void MakeModules(AliT0digit *digits);
void LoadRaw(TString fileName, Int_t ievt);
+ static void MakeModules(AliT0digit *digits);
+
protected:
+ Int_t fSigType; // 0 ~ ADC, 1 ~ TDC
+ AliT0digit *fDigits;
+ AliT0RawReader *fStart;
- Int_t fSigType; // 0 ~ ADC, 1 ~ TDC
- AliT0digit * fDigits;
- AliT0RawReader *fStart;
- ClassDef(T0Module,1);
-
+ ClassDef(T0Module,1);
};
/*
#include "TOFSector.h"
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <AliTOFdigit.h>
#include <AliTOFGeometry.h>
/**************************************************************************/
-void TOFSector::QuadSelected(Int_t idx)
+void TOFSector::DigitSelected(Int_t idx)
{
// Override control-click from QuadSet
- QuadBase* qb = GetQuad(idx);
+ DigitBase* qb = GetDigit(idx);
TObject* obj = qb->fId.GetObject();
AliTOFdigit* digs = dynamic_cast<AliTOFdigit*>(obj);
// printf("TOFSector::QuadSelected "); Print();
TOFSector(TGeoManager *localGeoManager,
Int_t nSector, TTree *tofTree);
virtual ~TOFSector();
-
-
+
static Bool_t fgStaticInitDone;
static void InitStatics();
+
void SetSectorID(Int_t id);
void SetAutoTrans(Bool_t r){fAutoTrans=r;};
void SetThreshold(Short_t t);
Int_t GetMaxVal() const {return fMaxVal;};
Bool_t GetAutoTrans() const {return fAutoTrans;};
Int_t GetSectorID() const {return fSectorID;};
- virtual void QuadSelected(Int_t idx);
+ virtual void DigitSelected(Int_t idx);
///////////////////////////////////////////
void SetPlate(Int_t nPlate, Bool_t r);
- static Reve::FrameBox* fgTOFsectorFrameBox;
-
- static Reve::RGBAPalette* fgTOFsectorPalette;
+ static Reve::FrameBox *fgTOFsectorFrameBox;
+ static Reve::RGBAPalette *fgTOFsectorPalette;
ClassDef(TOFSector, 1);
};
#include "TOFStrip.h"
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <AliTOFdigit.h>
#include <AliTOFGeometry.h>
#include "TPCData.h"
#include <Alieve/TPCSector2D.h>
#include <Alieve/TPCSector3D.h>
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <Reve/RGEditor.h>
#include <AliRawReaderRoot.h>
if(fSec2Ds[i] == el) fSec2Ds[i] = 0;
if(fSec3Ds[i] == el) fSec3Ds[i] = 0;
}
-
- RenderElement::RemoveElementLocal(el);
}
-void TPCLoader::RemoveElements()
+void TPCLoader::RemoveElementsLocal()
{
for(Int_t i=0; i<36; ++i) {
fSec2Ds[i] = 0;
fSec3Ds[i] = 0;
}
-
- RenderElement::RemoveElements();
}
/**************************************************************************/
if(fSec2Ds[i] != 0)
{
if (dropNonPresent && sd == 0) {
- gReve->RemoveRenderElement(this, fSec2Ds[i]);
+ gReve->RemoveRenderElement(fSec2Ds[i], this);
fSec2Ds[i] = 0;
} else {
fSec2Ds[i]->IncRTS();
+ fSec2Ds[i]->ElementChanged();
}
}
else
s->SetAutoTrans(kTRUE);
s->SetFrameColor(36);
- gReve->AddRenderElement(this, s);
+ gReve->AddRenderElement(s, this);
}
}
if(fSec3Ds[i] != 0)
{
if (dropNonPresent && sd == 0) {
- gReve->RemoveRenderElement(this, fSec3Ds[i]);
+ gReve->RemoveRenderElement(fSec3Ds[i], this);
fSec3Ds[i] = 0;
} else {
fSec3Ds[i]->IncRTS();
+ fSec3Ds[i]->ElementChanged();
}
}
}
s->SetAutoTrans(kTRUE);
s->SetFrameColor(36);
- gReve->AddRenderElement(this, s);
+ gReve->AddRenderElement(s, this);
}
}
gReve->EnableRedraw();
for(Int_t i=0; i<=35; ++i) {
RenderElement* re = fSec3Ds[i];
if(re != 0) {
- gReve->RemoveRenderElement(this, re);
+ gReve->RemoveRenderElement(re, this);
// delete re; // Done automatically.
fSec3Ds[i] = 0;
}
virtual ~TPCLoader();
virtual void RemoveElementLocal(Reve::RenderElement* el);
- virtual void RemoveElements();
+ virtual void RemoveElementsLocal();
void SetFile(const Text_t* f) { fFile = f; }
void SetDoubleSR(Bool_t d) { fDoubleSR = d; }
#include "TPCLoaderEditor.h"
#include <Alieve/TPCLoader.h>
#include <Alieve/TPCData.h>
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <Reve/RGValuators.h>
#include <TSystem.h>
fi.fFilename = StrDup(gSystem->BaseName(fM->fFile));
fi.fFileTypes = tpcfiletypes;
- new TGFileDialog(fClient->GetRoot(), gReve, kFDOpen, &fi);
+ new TGFileDialog(fClient->GetRoot(), gReve->GetMainWindow(), kFDOpen, &fi);
if (!fi.fFilename)
return;
// $Header$
#include "TPCSector2D.h"
+#include "TPCSector3D.h"
#include <Alieve/TPCData.h>
#include <Alieve/TPCSectorData.h>
+#include <Reve/ReveManager.h>
+
#include <AliTPCParam.h>
#include <TBuffer3D.h>
fUseTexture (kTRUE),
fPickEmpty (kFALSE),
- fPickMode (0)
+ fPickMode (1)
{}
TPCSector2D::~TPCSector2D()
/**************************************************************************/
+void TPCSector2D::MakeSector3D()
+{
+ TPCSector3D* s = new TPCSector3D;
+ s->SetDataSource(fTPCData);
+ s->SetSectorID(fSectorID);
+ s->SetAutoTrans(fAutoTrans);
+ gReve->AddRenderElement(s, this);
+ gReve->Redraw3D();
+}
+
+/**************************************************************************/
+
void TPCSector2D::ComputeBBox()
{
const TPCSectorData::SegmentInfo& iSeg = TPCSectorData::GetInnSeg();
const TPCSectorData::SegmentInfo& o2Seg = TPCSectorData::GetOut2Seg();
-#if ROOT_VERSION_CODE <= ROOT_VERSION(5,11,2)
- bbox_init();
-#else
BBoxInit();
-#endif
Float_t w = o2Seg.GetNMaxPads()*o2Seg.GetPadWidth()/2;
fBBox[0] = -w;
fBBox[1] = w;
Int_t GetPickMode() const { return fPickMode; }
void SetPickMode(Int_t mode) { fPickMode = mode; }
+ void MakeSector3D(); // *MENU*
+
virtual void ComputeBBox();
virtual void PadSelected(Int_t row, Int_t pad);
fPickMode->AddEntry("1D histo", 1);
fPickMode->AddEntry("2D histo", 2);
TGListBox* lb = fPickMode->GetListBox();
- lb->Resize(lb->GetWidth(), 3*16);
+ lb->Resize(lb->GetWidth(), 3*18);
fPickMode->Resize(80, 20);
fPickMode->Connect("Selected(Int_t)", "Alieve::TPCSector2DEditor", this, "DoPickMode(Int_t)");
f->AddFrame(fPickMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
const TPCSectorData::SegmentInfo& iSeg = TPCSectorData::GetInnSeg();
const TPCSectorData::SegmentInfo& o2Seg = TPCSectorData::GetOut2Seg();
-#if ROOT_VERSION_CODE <= ROOT_VERSION(5,11,2)
- bbox_init();
-#else
BBoxInit();
-#endif
+
Float_t w = 0.5*o2Seg.GetNMaxPads()*o2Seg.GetPadWidth();
fBBox[0] = -w;
fBBox[1] = w;
Float_t xs, Float_t ys, Float_t pw, Float_t ph)
{
Short_t pad, time, val;
- Float_t x0, x1, z0, z1;
+ Float_t x0, z0;
Float_t ym = ys + 0.5*ph;
- Float_t ye = ys + ph;
Float_t zs = fZStep/fDriftVel;
- while (iter.NextPad()) {
+ while (iter.NextPad())
+ {
pad = iter.Pad();
- while (iter.Next()) {
+ while (iter.Next())
+ {
time = iter.Time();
val = iter.Signal();
if(val <= fThreshold || time < fMinTime || time > fMaxTime)
continue;
- if(fPointSetOn && val <= fPointSetMaxVal) {
+ if(fPointSetOn && val <= fPointSetMaxVal)
+ {
fPointSetArray.Fill(xs + (pad+0.5)*pw, ym, (time+0.5)*zs, val);
- } else {
- fBoxSet.fBoxes.push_back(Reve::Box());
- ColorFromArray(val, fBoxSet.fBoxes.back().color);
+ }
+ else
+ {
x0 = xs + pad*pw;
- x1 = x0 + pw;
z0 = time*zs;
- z1 = z0 + zs;
- Float_t* p = fBoxSet.fBoxes.back().vertices;
- // front
- p[0] = x0; p[1] = ys; p[2] = z0; p += 3;
- p[0] = x1; p[1] = ys; p[2] = z0; p += 3;
- p[0] = x1; p[1] = ye; p[2] = z0; p += 3;
- p[0] = x0; p[1] = ye; p[2] = z0; p += 3;
- // back
- p[0] = x0; p[1] = ys; p[2] = z1; p += 3;
- p[0] = x1; p[1] = ys; p[2] = z1; p += 3;
- p[0] = x1; p[1] = ye; p[2] = z1; p += 3;
- p[0] = x0; p[1] = ye; p[2] = z1;
+ fBoxSet.AddBox(x0, ys, z0, pw, ph, zs);
+ fBoxSet.DigitColor(ColorFromArray(val));
}
}
}
// printf("TPCSector3D update boxes\n");
- fBoxSet.ClearSet();
+ fBoxSet.Reset(BoxSet::BT_AABox, kTRUE, 16384);
fPointSetArray.RemoveElements();
TPCSectorData* data = GetSectorData();
}
}
+ fBoxSet.RefitPlex();
if(fPointSetOn)
fPointSetArray.CloseBins();
}
#include <Reve/BoxSetGL.h>
-#include <TGLRnrCtx.h>
#include <TGLIncludes.h>
+#include <TGLRnrCtx.h>
+#include <TGLSelectRecord.h>
using namespace Reve;
using namespace Alieve;
/**************************************************************************/
+//______________________________________________________________________________
+Short_t TPCSector3DGL::QuantizeShapeLOD(Short_t shapeLOD, Short_t combiLOD) const
+{
+ // Factor in scene/viewer LOD and quantize.
+
+ Int_t lod = ((Int_t)shapeLOD * (Int_t)combiLOD) / 100;
+
+ if (lod >= 100)
+ return 100;
+ else
+ return (Short_t)(10 * TMath::Nint(0.1*lod));
+}
+
+/**************************************************************************/
+
Bool_t TPCSector3DGL::SetModel(TObject* obj, const Option_t* /*opt*/)
{
if(SetModelCheckClass(obj, Alieve::TPCSector3D::Class())) {
fRTS = fSector->fRTS;
}
+ if (rnrCtx.SecSelection()) glPushName(0);
+
Bool_t hasData = (fSector->GetSectorData() != 0);
if(hasData)
+ {
+ if (rnrCtx.SecSelection()) glLoadName(9999);
fBoxRnr->Render(rnrCtx);
+ }
glPushAttrib(GL_CURRENT_BIT | GL_POINT_BIT | GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
UChar_t col[4];
- if(hasData && fSector->fPointSetOn) {
+ if(hasData && fSector->fPointSetOn)
+ {
glEnable(GL_BLEND);
glEnable(GL_POINT_SMOOTH);
glPointSize(fSector->fPointSize);
glEnableClientState(GL_VERTEX_ARRAY);
const Reve::PointSetArray& psa = fSector->fPointSetArray;
- for(Int_t b=0; b<psa.GetNBins(); ++b) {
+ for(Int_t b=0; b<psa.GetNBins(); ++b)
+ {
Reve::PointSet* ps = psa.GetBin(b);
- if(ps->Size() > 0) {
+ if(ps->Size() > 0)
+ {
ColorFromIdx(ps->GetMarkerColor(), col);
glColor4ubv(col);
+ if (rnrCtx.SecSelection()) glLoadName(b + 1);
glVertexPointer(3, GL_FLOAT, 0, ps->GetP());
glDrawArrays(GL_POINTS, 0, ps->Size());
}
glPopClientAttrib();
}
- if(fSector->fRnrFrame) {
+ if(fSector->fRnrFrame && ! rnrCtx.SecSelection())
+ {
ColorFromIdx(fSector->fFrameColor, col);
glColor4ubv(col);
glVertex3f(-xl, yl, zl); glVertex3f(-xl, yl, zh);
glEnd();
}
+
+/**************************************************************************/
+/**************************************************************************/
+
+//______________________________________________________________________________
+void TPCSector3DGL::ProcessSelection(TGLRnrCtx & /*rnrCtx*/, TGLSelectRecord & rec)
+{
+ // Processes secondary selection from TGLViewer.
+ // Calls TPointSet3D::PointSelected(Int_t) with index of selected
+ // point as an argument.
+
+ if (rec.GetN() < 3) return;
+
+ if (rec.GetItem(1) == 9999)
+ {
+ printf("TPC3D Box selected idx=%u\n", rec.GetItem(2));
+ return;
+ }
+
+ const Reve::PointSetArray& psa = fSector->fPointSetArray;
+
+ if (rec.GetItem(1) > 0 && rec.GetItem(1) <= (UInt_t) psa.GetNBins())
+ {
+ // Reve::PointSet& ps = * psa.GetBin(rec.GetItem(1) - 1);
+ printf("TPC3D Point selected, bin=%u, idx=%u\n", rec.GetItem(1) - 1, rec.GetItem(2));
+ return;
+ }
+}
TPCSector3DGL();
virtual ~TPCSector3DGL();
+ virtual Bool_t ShouldDLCache(const TGLRnrCtx&) const { return kFALSE; }
+ virtual ELODAxes SupportedLODAxes() const { return kLODAxesAll; }
+ virtual Short_t QuantizeShapeLOD(Short_t shapeLOD, Short_t combiLOD) const;
+
virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0);
virtual void SetBBox();
void DrawSegmentFrame(const TPCSectorData::SegmentInfo& s,
Int_t botExtraPads=0, Int_t topExtraPads=0) const;
+ virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
+ virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec);
+
ClassDef(TPCSector3DGL, 0);
}; // endclass TPCSector3DGL
fRnrOut2 (kTRUE),
fFrameColor ((Color_t) 4),
- fRnrFrame (kTRUE),
- fAutoTrans(kFALSE),
- fRTS (1),
+ fRnrFrame (kTRUE),
+ fAutoTrans (kFALSE),
+ fRTS (1),
fColorArray (0)
{}
Bool_t fRnrOut1;
Bool_t fRnrOut2;
- Color_t fFrameColor;
- Bool_t fRnrFrame;
+ Color_t fFrameColor;
+ Bool_t fRnrFrame;
Reve::ZTrans fHMTrans;
Bool_t fAutoTrans;
- UInt_t fRTS; //! Rendering TimeStamp
+ UInt_t fRTS; //! Rendering TimeStamp
void SetupColor(Int_t val, UChar_t* pix) const;
// - digits apparence (quads/boxes)
fQuads.clear();
- fBoxes.fBoxes.clear();
+ // MT fBoxes.fBoxes.clear();
Double_t colSize, rowSize, scale;
Double_t x, y, z;
cloc[3][1] = y - colSize * scale;
cloc[3][0] = x;
- Float_t* p;
+ Float_t* p = 0;
if( fParent->GetDigitsBox()){
- fBoxes.fBoxes.push_back(Reve::Box());
- fBoxes.fBoxes.back().color[0] = (UChar_t)color;
- fBoxes.fBoxes.back().color[1] = (UChar_t)color;
- fBoxes.fBoxes.back().color[2] = (UChar_t)color;
- fBoxes.fBoxes.back().color[3] = (UChar_t)color;
- p = fBoxes.fBoxes.back().vertices;
+ // MT fBoxes.fBoxes.push_back(Reve::Box());
+ // MT fBoxes.fBoxes.back().color[0] = (UChar_t)color;
+ // MT fBoxes.fBoxes.back().color[1] = (UChar_t)color;
+ // MT fBoxes.fBoxes.back().color[2] = (UChar_t)color;
+ // MT fBoxes.fBoxes.back().color[3] = (UChar_t)color;
+ // MT p = fBoxes.fBoxes.back().vertices;
dimension = 2;
} else {
fQuads.push_back(Reve::Quad());
void TRDDigits::Reset()
{
fQuads.clear();
- fBoxes.fBoxes.clear();
+ // MT fBoxes.fBoxes.clear();
fData.Reset();
}
#include "TRDLoader.h"
#include "TRDModuleImp.h"
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <Reve/RGValuators.h>
#include "TSystem.h"
SM = (TRDNode*)(*ichmb);
SM->SetRnrSelf(kTRUE);
}else{
- gReve->AddRenderElement(this, SM = new TRDNode("SM", ism));
+ gReve->AddRenderElement(SM = new TRDNode("SM", ism), this);
SM->FindListTreeItem(gReve->GetListTree())->SetTipText(Form("Supermodule %2d", ism));
}
for(int istk=istk_start; istk<istk_stop; istk++){
STK = (TRDNode*)(*ichmb);
STK->SetRnrSelf(kTRUE);
}else{
- gReve->AddRenderElement(SM, STK = new TRDNode("Stack", istk));
+ gReve->AddRenderElement(STK = new TRDNode("Stack", istk), SM);
STK->FindListTreeItem(gReve->GetListTree())->SetTipText(Form("SM %2d Stack %1d", ism, istk));
}
for(int ily=ily_start; ily<ily_stop; ily++){
ichmb = find_if(STK->begin(), STK->end(), ID<RenderElement*>(det));
if(ichmb != STK->end()) (*ichmb)->SetRnrSelf(kTRUE);
else{
- gReve->AddRenderElement(STK, CHMB = new TRDChamber(det));
+ gReve->AddRenderElement(CHMB = new TRDChamber(det), STK);
CHMB->SetGeometry(fGeo);
CHMB->FindListTreeItem(gReve->GetListTree())->SetTipText(Form("SM %2d Stack %1d Layer %1d", ism, istk, ily));
}
fi.fFilename = StrDup(gSystem->BaseName(fM->fFilename.Data()));
// fi.fFileTypes = tpcfiletypes;
- new TGFileDialog(fClient->GetRoot(), gReve, kFDOpen, &fi);
+ new TGFileDialog(fClient->GetRoot(), gReve->GetMainWindow(), kFDOpen, &fi);
if (!fi.fFilename) return;
fFile->SetToolTipText(gSystem->DirName (fi.fFilename));
//#include "AliTRDv1.h"
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include "TFile.h"
#include "TTree.h"
#include "TRDLoader.h"
#include "TRDLoaderImp.h"
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <TGLabel.h>
#include <TGButton.h>
switch(type){
case 0:
//fChildren.push_back(new TRDLoaderSim(name, title));
- gReve->AddRenderElement(this, trdl = new TRDLoaderSim(name, title));
+ gReve->AddRenderElement(trdl = new TRDLoaderSim(name, title), this);
((TRDLoaderSim*)trdl)->FindListTreeItem(gReve->GetListTree())->SetTipText(title);
break;
case 1:
case 2:
case 3:
//fChildren.push_back(new TRDLoader(name, title));
- gReve->AddRenderElement(this, trdl = new TRDLoader(name, title));
+ gReve->AddRenderElement(trdl = new TRDLoader(name, title), this);
trdl->FindListTreeItem(gReve->GetListTree())->SetTipText(title);
trdl->SetDataType((Alieve::TRDDataTypes)type);
break;
case 4:
case 5:
//fChildren.push_back(new TRDLoaderRaw(name, title));
- gReve->AddRenderElement(this, trdl = new TRDLoaderRaw(name, title));
+ gReve->AddRenderElement(trdl = new TRDLoaderRaw(name, title), this);
((TRDLoaderRaw*)trdl)->FindListTreeItem(gReve->GetListTree())->SetTipText(title);
trdl->SetDataType((Alieve::TRDDataTypes)type);
break;
//printf("TRDLoaderManager::Remove(%d)\n", entry);
List_i it = fChildren.begin();
for(int i=0; i<entry; i++) it++;
- gReve->RemoveRenderElement(this, (*it));
+ gReve->RemoveRenderElement((*it), this);
fChildren.erase(it);
}
//#include "TColor.h"
//#include "TMath.h"
-#include "Reve/RGTopFrame.h"
+#include "Reve/ReveManager.h"
#include "Reve/Track.h"
#include "TMath.h"
#include <TGListTree.h>
-#include "Reve/RGTopFrame.h"
+#include "Reve/ReveManager.h"
#include "Reve/Track.h"
#include "AliLog.h"
#include <Reve/Reve.h>
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <Getline.h>
{
Reve::SetupEnvironment();
- int r = Reve::RGTopFrame::SpawnGuiAndRun(argc, argv);
+ int r = Reve::ReveManager::SpawnGuiAndRun(argc, argv);
Getlinem(kCleanUp, 0);
return r;
}
+2007-10-22 Matevz Tadel <matevz.tadel@cern.ch>
+
+ Merged EVE-dev-after-merge to EVE-dev into HEAD.
+ Moved tag EVE-dev-after-merge to current EVE-dev.
+
+2007-10-16 Matevz Tadel <matevz.tadel@cern.ch>
+
+ Merged EVE-head-after-merge to HEAD into EVE-dev.
+ Moved tag EVE-head-after-merge to current HEAD.
+
+ EVE-dev
+
+ * alice-macros/MUON_display.C:
+ * alice-macros/acorde_hits.C:
+ * alice-macros/geom_acorde.C:
+ * binalieve.pkg:
+ Merge from EVE-head-after-merge to HEAD.
+
+ * alice-macros/its_hits.C:
+ Added example line for usage of per-point integer ids.
+
+ * icons/pointset.xpm:
+ Changed icon.
+
+2007-10-05 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/esd_Cascade.C:
+ * alice-macros/esd_V0.C:
+ * alice-macros/its_clusters.C:
+ * alice-macros/tpc_clusters.C:
+ * macros/reve_sa_init.C:
+ * test-macros/tpc_gui.C:
+ * test-macros/tpc_gui_hack.C:
+ Renamed class RGTopFrame to ReveManager.
+
+2007-10-04 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/tpc_calib_viewer.C:
+ New macro (with Marian): start an embedded TPC calibration viewer.
+
2007-10-04 Matevz Tadel <matevz.tadel@cern.ch>
* alice-macros/acorde_hits.C:
* alice-macros/geom_acorde.C:
New files from Eleazar: geometry and hits for ACORDE.
+2007-10-03 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/tpc_digits.C:
+ Name sectors by sector-id when creating full A/C side plates.
+
+2007-10-03 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * test-macros/tpc_gui.C:
+ Enable setting of default parameters matching the standard real
+ TPC data.
+ Remove some obsolete framework calls.
+
+2007-10-02 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/pmd_digits.C:
+ Optionally add background polygons.
+
2007-09-24 Matevz Tadel <matevz.tadel@cern.ch>
* alice-macros/MUON_display.C:
From Bogdan: modifications for the new structure of the data in
the MUON code.
+2007-08-31 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/kine_tracks.C:
+ Add missing namespace qualifier.
+
+ * icons/pointset.xpm:
+ * icons/scene.xpm:
+ * icons/track.xpm:
+ * icons/viewer.xpm:
+ New files: icons for list tree.
+
+2007-08-30 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/primary_vertex.C:
+ Generalize creation of primary vertex ellipse.
+
+2007-08-30 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/geom_gentle.C:
+ Add missing namespace qualifier.
+
+ * macros/alieve_init.C:
+ Remove std namespace qualifiers disliked by the new cint.
+
+ * alice-macros/NLT_trackcount_init.C:
+ * macros/trackcount_init.C:
+ Reuse its/tpc_cluster.C.so.
+ Do not load event in alieve_init (first event was loaded twice).
+
+2007-08-30 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/its_clusters.C:
+ * alice-macros/tpc_clusters.C:
+ Allow on-the-fly compilation.
+
+ * alice-macros/NLT_trackcount_init.C:
+ Put in sync with the rest of the world.
+
+2007-08-29 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/NLT_test.C:
+ Fix wrong condition before import event to NLTProjector.
+
+ * alice-macros/primary_vertex.C:
+ Present the primary-vertex as a cross and three ellipses by using
+ the StraightLineSet primitive.
+
+2007-08-29 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * macros/trackcount_init.C:
+ Call alieve_init before trackcount_init. Problems in loading macros with std::list.
+
+ * alice-macros/NLT_trackcount_init.C:
+ New macro: trackcount in non-linear projections.
+
+ * alice-macros/esd_tracks.C:
+ Set marker and line attributes as defined in parent TrackList.
+
+ * alice-macros/geom_gentle.C:
+ Return pointer of imported geometry.
+
+2007-08-28 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/its_module_stepper.C:
+ Remove configuration of GridStepper. Default already done in
+ ITSModuleStepper constructor.
+
+2007-08-27 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/tpc_digits.C:
+ Run in full 2D mode by default.
+
+2007-08-24 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/NLT_test.C:
+ Enable rendering of NLTProjector to get scale info.
+
+2007-08-24 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/NLT_test.C:
+ * alice-macros/clusters_from_index.C:
+ * alice-macros/clusters_from_label.C:
+ * alice-macros/hits_from_label.C:
+ * alice-macros/its_clusters.C:
+ * alice-macros/phos_clusters.C:
+ * alice-macros/tpc_clusters.C:
+ * alice-macros/tpc_hits.C:
+ * alice-macros/trd_hits.C:
+ Argument types must be fully quantified with latest cint: added
+ 'Reve::' where needed.
+
+ * macros/alieve_init.C:
+ Changes for browser-topframe reorganization.
+
+2007-08-22 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/NLT_geo_demo.C:
+ Remove obsolete demo.
+
+2007-08-21 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/NLT_demo.C:
+ Remove file: replaced by NLT_test.C.
+
+ * alice-macros/NLT_test.C:
+ Put current camera in orthographic XY projection. Disable drawing of
+ NLTProjector.
+
+2007-08-20 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/NLT_test.C:
+ Create special scene for projected event and add it to the default
+ gl viewer.
+
+2007-08-19 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/NLT_demo.C:
+ * alice-macros/NLT_geo_demo.C:
+ Update for changes in Reve.
+
+ * alice-macros/NLT_test.C:
+ New file, mini test macro for automatic import of projected
+ elements.
+
+2007-08-18 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/esd_V0.C:
+ * alice-macros/esd_tracks.C:
+ * alice-macros/kine_tracks.C:
+ * alice-macros/primary_vertex_tracks.C:
+ Remove Track::MakeMarkers(). Rendering of fist vertices done in
+ TrackGL::DirectDraw(). Set line color of tracks same as container color.
+
+2007-08-13 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/MUON_display.C:
+ * alice-macros/NLT_geo_demo.C:
+ * alice-macros/clusters_from_label.C:
+ * alice-macros/emcal_digits.C:
+ * alice-macros/emcal_hits.C:
+ * alice-macros/esd_Cascade.C:
+ * alice-macros/esd_V0.C:
+ * alice-macros/esd_tracks.C:
+ * alice-macros/geom_fmd.C:
+ * alice-macros/geom_hmpid.C:
+ * alice-macros/geom_phos.C:
+ * alice-macros/geom_t0.C:
+ * alice-macros/geom_vzero.C:
+ * alice-macros/its_digits.C:
+ * alice-macros/its_hits.C:
+ * alice-macros/its_raw.C:
+ * alice-macros/kine_tracks.C:
+ * alice-macros/pmd_digits.C:
+ * alice-macros/pmd_raw.C:
+ * alice-macros/primary_vertex_tracks.C:
+ * alice-macros/tof_digits.C:
+ * alice-macros/tof_digits_sector.C:
+ * alice-macros/tof_digits_strips.C:
+ * alice-macros/tof_hits.C:
+ * alice-macros/tpc_digits.C:
+ * alice-macros/tpc_hits.C:
+ * alice-macros/trd_hits.C:
+ * macros/reve_quad_test.C:
+ Consistent ordering of arguments to AddRenderElement(),
+ AddGlobalRenderElement() and RemoveRenderElement().
+
+2007-08-10 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * Alieve/.SKEL-gedsubed.cxx:
+ * Alieve/.SKEL-gedsubed.h:
+ * Reve/.SKEL-gedsubed.cxx:
+ * Reve/.SKEL-gedsubed.h:
+ * reve-genclass.pl:
+ Generate class skeletons for ged sub-editors.
+
+2007-08-09 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * alice-macros/NLT_demo.C:
+ * alice-macros/NLT_geo_demo.C:
+ Add projection of gentle_geo.root geometry.
+
+ * alice-macros/its_module_stepper.C:
+ Display only one ITSModuleStepper.
+
2007-08-08 Matevz Tadel <matevz.tadel@cern.ch>
Create branch EVE-dev.
#include <TGedFrame.h>
+class TGButton;
class TGCheckButton;
class TGNumberEntry;
class TGColorSelect;
// Declare callback/slot methods
// void DoXYZZ();
- ClassDef(CLASS, 1); // Editor for STEM
+ ClassDef(CLASS, 0); // Editor for STEM
}; // endclass CLASS
}
--- /dev/null
+// $Header$
+
+#include "CLASS.h"
+#include <STEM.h>
+
+#include <TVirtualPad.h>
+#include <TColor.h>
+
+#include <TGLabel.h>
+#include <TGButton.h>
+#include <TGNumberEntry.h>
+#include <TGColorSelect.h>
+#include <TGDoubleSlider.h>
+
+using namespace Reve;
+
+//______________________________________________________________________
+// XXCLASS
+//
+//
+
+ClassImp(XXCLASS)
+
+//______________________________________________________________________
+XXCLASS::XXCLASS(const TGWindow *p) :
+ TGVerticalFrame(p),
+ fM (0)
+{
+ // Constructor.
+}
+
+//______________________________________________________________________
+void XXCLASS::SetModel(STEM* m)
+{
+ // Set model object.
+
+ fM = m;
+}
+
+//______________________________________________________________________
+void XXCLASS::Changed()
+{
+ // Emit Changed signal.
+
+ Emit("Changed()");
+}
+
+//______________________________________________________________________
+//void XXCLASS::DoABCD()
+//{
+// // Set some value from some widget
+// Changed();
+//}
+
+
+//______________________________________________________________________
+// CLASS
+//
+//
+
+ClassImp(CLASS)
+
+//______________________________________________________________________
+CLASS::CLASS(const TGWindow *p, Int_t width, Int_t height,
+ UInt_t options, Pixel_t back) :
+ TGedFrame(p, width, height, options | kVerticalFrame, back),
+ fM (0),
+ fSE (0)
+{
+ // Constructor.
+
+ MakeTitle("STEM");
+
+ fSE = new XXCLASS(this);
+ AddFrame(fSE, new TGLayoutHints(kLHintsTop, 2, 0, 2, 2));
+ fSE->Connect("Changed()", "CLASS", this, "Update()");
+}
+
+/**************************************************************************/
+
+//______________________________________________________________________
+void CLASS::SetModel(TObject* obj)
+{
+ // Set model object.
+ fM = dynamic_cast<STEM*>(obj);
+ fSE->SetModel(fM);
+}
+
+/**************************************************************************/
+
+// Implements callback/slot methods
+
+//______________________________________________________________________
+// void CLASS::DoXYZZ()
+// {
+// fM->SetXYZZ(fXYZZ->GetValue());
+// Update();
+// }
--- /dev/null
+// $Header$
+
+#ifndef REVE_CLASS_H
+#define REVE_CLASS_H
+
+#include <TGedFrame.h>
+
+class TGButton;
+class TGCheckButton;
+class TGNumberEntry;
+class TGColorSelect;
+
+namespace Reve {
+
+class STEM;
+
+class XXCLASS : public TGVerticalFrame
+{
+private:
+ XXCLASS(const XXCLASS&); // Not implemented
+ XXCLASS& operator=(const XXCLASS&); // Not implemented
+
+protected:
+ STEM *fM;
+
+public:
+ XXCLASS(const TGWindow* p);
+ virtual ~XXCLASS() {}
+
+ void SetModel(STEM* m);
+
+ void Changed(); //*SIGNAL*
+
+ // void DoABCD();
+
+ ClassDef(XXCLASS, 0) // Sub-editor for STEM
+};
+
+
+class CLASS : public TGedFrame
+{
+private:
+ CLASS(const CLASS&); // Not implemented
+ CLASS& operator=(const CLASS&); // Not implemented
+
+protected:
+ STEM *fM; // fModel dynamic-casted to STEM
+ XXCLASS *fSE;
+
+public:
+ CLASS(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground());
+ virtual ~CLASS() {}
+
+ virtual void SetModel(TObject* obj);
+
+ void DoXYZZ();
+
+ ClassDef(CLASS, 0) // Editor for STEM
+};
+
+}
+
+#endif
CLASS::CLASS() : TGLObject(), fM(0)
{
- // fCached = false; // Disable display list.
+ // fDLCache = kFALSE; // Disable display list.
}
CLASS::~CLASS()
using namespace Reve;
-/**************************************************************************/
-// Box
+
+//______________________________________________________________________
+// BoxSet
+//
+
+ClassImp(BoxSet)
+
+BoxSet::BoxSet(const Text_t* n, const Text_t* t) :
+ DigitSet (n, t),
+
+ fBoxType (BT_Undef),
+ fDefWidth (1),
+ fDefHeight (1),
+ fDefDepth (1)
+{
+ // Override from DigitSet.
+ fDisableLigting = kFALSE;
+}
+
/**************************************************************************/
-Box::Box(Color_t col)
+Int_t BoxSet::SizeofAtom(BoxSet::BoxType_e bt)
{
- Reve::ColorFromIdx(col, color);
+ static const Exc_t eH("BoxSet::SizeofAtom ");
+
+ switch (bt) {
+ case BT_Undef: return 0;
+ case BT_FreeBox: return sizeof(BFreeBox);
+ case BT_AABox: return sizeof(BAABox);
+ case BT_AABoxFixedDim: return sizeof(BAABoxFixedDim);
+ default: throw(eH + "unexpected atom type.");
+ }
+ return 0;
}
-Box::Box(Color_t col, Float_t* p)
+/**************************************************************************/
+
+void BoxSet::Reset(BoxSet::BoxType_e boxType, Bool_t valIsCol, Int_t chunkSize)
{
- Reve::ColorFromIdx(col, color);
- memcpy(vertices, p, 24*sizeof(Float_t));
+ fBoxType = boxType;
+ fValueIsColor = valIsCol;
+ fDefaultValue = valIsCol ? 0 : kMinInt;
+ if (fOwnIds)
+ ReleaseIds();
+ fPlex.Reset(SizeofAtom(fBoxType), chunkSize);
}
-Box::Box(Color_t col, Float_t x, Float_t y, Float_t z,
- Float_t dx, Float_t dy, Float_t dz)
+void BoxSet::Reset()
{
- Reve::ColorFromIdx(col, color);
- MakeAxisAlignedBox(x, y, z, dx, dy, dz);
+ if (fOwnIds)
+ ReleaseIds();
+ fPlex.Reset(SizeofAtom(fBoxType), TMath::Max(fPlex.N(), 64));
}
-Box::Box(TRandom& rnd, Float_t origin, Float_t size)
+/**************************************************************************/
+
+void BoxSet::AddBox(const Float_t* verts)
{
- Reve::ColorFromIdx(Int_t(30*rnd.Rndm()), color);
- Float_t x = 2*origin*(rnd.Rndm() - 0.5);
- Float_t y = 2*origin*(rnd.Rndm() - 0.5);
- Float_t z = 2*origin*(rnd.Rndm() - 0.5);
- Float_t dx = 2*size*(rnd.Rndm() - 0.5);
- Float_t dy = 2*size*(rnd.Rndm() - 0.5);
- Float_t dz = 2*size*(rnd.Rndm() - 0.5);
- MakeAxisAlignedBox(x, y, z, dx, dy, dz);
+ // Create a new box from a set of 8 vertices.
+ // To be used for box-type BT_FreeBox.
+
+ static const Exc_t eH("BoxSet::AddBox ");
+
+ if (fBoxType != BT_FreeBox)
+ throw(eH + "expect free box-type.");
+
+ BFreeBox* b = (BFreeBox*) NewDigit();
+ memcpy(b->fVertices, verts, sizeof(b->fVertices));
}
-void Box::MakeAxisAlignedBox(Float_t x, Float_t y, Float_t z,
- Float_t dx, Float_t dy, Float_t dz)
+void BoxSet::AddBox(Float_t a, Float_t b, Float_t c, Float_t w, Float_t h, Float_t d)
{
- Float_t* p = vertices;
- //bottom
- p[0] = x - dx; p[1] = y + dy; p[2] = z - dz; p += 3;
- p[0] = x + dx; p[1] = y + dy; p[2] = z - dz; p += 3;
- p[0] = x + dx; p[1] = y - dy; p[2] = z - dz; p += 3;
- p[0] = x - dx; p[1] = y - dy; p[2] = z - dz; p += 3;
- //top
- p[0] = x - dx; p[1] = y + dy; p[2] = z + dz; p += 3;
- p[0] = x + dx; p[1] = y + dy; p[2] = z + dz; p += 3;
- p[0] = x + dx; p[1] = y - dy; p[2] = z + dz; p += 3;
- p[0] = x - dx; p[1] = y - dy; p[2] = z + dz;
-
+ // Create a new axis-aligned box from at a given position and with
+ // specified dimensions.
+ // To be used for box-type BT_AABox.
+
+ static const Exc_t eH("BoxSet::AddBox ");
+
+ if (fBoxType != BT_AABox)
+ throw(eH + "expect axis-aligned box-type.");
+
+ BAABox* box = (BAABox*) NewDigit();
+ box->fA = a; box->fB = b; box->fC = c;
+ box->fW = w; box->fH = h; box->fD = d;
}
-//______________________________________________________________________
-// BoxSet
-//
+void BoxSet::AddBox(Float_t a, Float_t b, Float_t c)
+{
+ // Create a new axis-aligned box from at a given position.
+ // To be used for box-type BT_AABoxFixedDim.
-ClassImp(BoxSet)
+ static const Exc_t eH("BoxSet::AddBox ");
-BoxSet::BoxSet(const Text_t* n, const Text_t* t) :
- RenderElement(fDefaultColor),
- TNamed(n, t),
- fDefaultColor(0),
- fRenderMode(RM_AsIs),
- fHMTrans(),
- fBoxes()
-{}
+ if (fBoxType != BT_AABoxFixedDim)
+ throw(eH + "expect axis-aligned fixed-dimension box-type.");
+
+ BAABoxFixedDim* box = (BAABoxFixedDim*) NewDigit();
+ box->fA = a; box->fB = b; box->fC = c;
+}
/**************************************************************************/
void BoxSet::ComputeBBox()
{
- if(fBoxes.empty()) {
+ // Fill bounding-box information of the base-class TAttBBox (virtual method).
+ // If member 'FrameBox* fFrame' is set, frame's corners are used as bbox.
+
+ static const Exc_t eH("BoxSet::ComputeBBox ");
+
+ if (fFrame != 0)
+ {
+ BBoxInit();
+ Int_t n = fFrame->GetFrameSize() / 3;
+ Float_t *bbps = fFrame->GetFramePoints();
+ for (int i=0; i<n; ++i, bbps+=3)
+ BBoxCheckPoint(bbps);
+ return;
+ }
+
+ if(fPlex.Size() == 0)
+ {
BBoxZero();
return;
}
+
BBoxInit();
- for(std::vector<Box>::iterator q=fBoxes.begin(); q!=fBoxes.end(); ++q) {
- Float_t* p = q->vertices;
- for(int i=0; i<8; ++i, p+=3)
- BBoxCheckPoint(p);
- }
- // printf("%s BBox is x(%f,%f), y(%f,%f), z(%f,%f)\n", GetName(),
- // fBBox[0], fBBox[1], fBBox[2], fBBox[3], fBBox[4], fBBox[5]);
+
+ VoidCPlex::iterator bi(fPlex);
+ switch (fBoxType)
+ {
+
+ case BT_FreeBox:
+ {
+ while (bi.next()) {
+ BFreeBox& b = * (BFreeBox*) bi();
+ Float_t * p = b.fVertices;
+ for(int i=0; i<8; ++i, p+=3)
+ BBoxCheckPoint(p);
+ }
+ break;
+ }
+
+ case BT_AABox:
+ {
+ while (bi.next()) {
+ BAABox& b = * (BAABox*) bi();
+ BBoxCheckPoint(b.fA, b.fB, b.fC);
+ BBoxCheckPoint(b.fA + b.fW, b.fB + b.fH , b.fC + b.fD);
+ }
+ break;
+ }
+
+ case BT_AABoxFixedDim:
+ {
+ while (bi.next()) {
+ BAABoxFixedDim& b = * (BAABoxFixedDim*) bi();
+ BBoxCheckPoint(b.fA, b.fB, b.fC);
+ BBoxCheckPoint(b.fA + fDefWidth, b.fB + fDefHeight , b.fC + fDefDepth);
+ }
+ break;
+ }
+
+ default:
+ {
+ throw(eH + "unsupported box-type.");
+ }
+
+ } // end switch box-type
+
+ printf("%s BBox is x(%f,%f), y(%f,%f), z(%f,%f)\n", GetName(),
+ fBBox[0], fBBox[1], fBBox[2], fBBox[3], fBBox[4], fBBox[5]);
}
-void BoxSet::Paint(Option_t* /*option*/)
+/*
+void BoxSet::Paint(Option_t* option)
{
TBuffer3D buff(TBuffer3DTypes::kGeneric);
}
gPad->GetViewer3D()->AddObject(buff);
}
+*/
/**************************************************************************/
void BoxSet::Test(Int_t nboxes)
{
+ Reset(BT_AABox, kTRUE, nboxes);
TRandom rnd(0);
- fBoxes.resize(nboxes);
- for(Int_t i=0; i<nboxes; ++i) {
- new (&fBoxes[i]) Box(rnd, 10, 2);
+ const Float_t origin = 10, size = 2;
+ Int_t color;
+ for(Int_t i=0; i<nboxes; ++i)
+ {
+ AddBox(origin * rnd.Uniform(-1, 1),
+ origin * rnd.Uniform(-1, 1),
+ origin * rnd.Uniform(-1, 1),
+ size * rnd.Uniform(0.1, 1),
+ size * rnd.Uniform(0.1, 1),
+ size * rnd.Uniform(0.1, 1));
+
+ Reve::ColorFromIdx(rnd.Integer(256), (UChar_t*)&color);
+ DigitValue(color);
}
}
#ifndef REVE_BoxSet_H
#define REVE_BoxSet_H
-#include <Gtypes.h>
-#include <TNamed.h>
-#include <TAtt3D.h>
-#include <TAttBBox.h>
-#include <Reve/RenderElement.h>
-#include <Reve/Reve.h>
-#include "ZTrans.h"
-
-#include <vector>
+#include <Reve/DigitSet.h>
class TGeoMatrix;
class TRandom;
namespace Reve {
-struct Box
+class BoxSet: public DigitSet
{
- Float_t vertices[24];
- UChar_t color[4];
+ friend class BoxSetGL;
- Box(Color_t col = 1);
- Box(Color_t col, Float_t* p);
- Box(Color_t col, Float_t x, Float_t y, Float_t z,
- Float_t dx, Float_t dy, Float_t dz);
+ BoxSet(const BoxSet&); // Not implemented
+ BoxSet& operator=(const BoxSet&); // Not implemented
- Box(TRandom& rnd, Float_t origin, Float_t size);
+public:
+ enum BoxType_e
+ {
+ BT_Undef, // unknown-ignored
+ BT_FreeBox, // arbitrary box: specify 8*(x,y,z) box corners
+ BT_AABox, // axis-aligned box: specify (x,y,z) and (w, h, d)
+ BT_AABoxFixedDim // axis-aligned box w/ fixed dimensions: specify (x,y,z)
+ };
- virtual ~Box() {}
+protected:
- void MakeAxisAlignedBox(Float_t x, Float_t y, Float_t z,
- Float_t dx, Float_t dy, Float_t dz);
+ struct BFreeBox : public DigitBase { Float_t fVertices[24]; };
- ClassDef(Box, 1);
-};
+ struct BOrigin : public DigitBase { Float_t fA, fB, fC; };
-/**************************************************************************/
+ struct BAABox : public BOrigin { Float_t fW, fH, fD; };
-class BoxSet: public RenderElement,
- public TNamed,
- public TAtt3D,
- public TAttBBox
-{
- friend class BoxSetGL;
-
-public:
- enum RenderMode_e { RM_AsIs, RM_Line, RM_Fill };
+ struct BAABoxFixedDim : public BOrigin {};
protected:
- Color_t fDefaultColor;
- RenderMode_e fRenderMode;
- ZTrans fHMTrans;
+ BoxType_e fBoxType;
-public:
- std::vector<Box> fBoxes;
+ Float_t fDefWidth; // Breadth assigned to first coordinate (A)
+ Float_t fDefHeight; // Breadth assigned to second coordinate (B)
+ Float_t fDefDepth; // Breadth assigned to third coordinate (C)
+
+ static Int_t SizeofAtom(BoxType_e bt);
+public:
BoxSet(const Text_t* n="BoxSet", const Text_t* t="");
virtual ~BoxSet() {}
- void AddBox(const Box& b) { fBoxes.push_back(b); }
- void ClearSet() { fBoxes.clear(); }
+ void Reset(BoxType_e boxType, Bool_t valIsCol, Int_t chunkSize);
+ void Reset();
- virtual Bool_t CanEditMainColor() { return kTRUE; }
+ void AddBox(const Float_t* verts);
+ void AddBox(Float_t a, Float_t b, Float_t c, Float_t w, Float_t h, Float_t d);
+ void AddBox(Float_t a, Float_t b, Float_t c);
virtual void ComputeBBox();
- virtual void Paint(Option_t* option = "");
+ // virtual void Paint(Option_t* option = "");
- RenderMode_e GetRenderMode() const { return fRenderMode; }
- void SetRenderMode(RenderMode_e rm) { fRenderMode = rm; }
+ void Test(Int_t nboxes);
- ZTrans& RefHMTrans() { return fHMTrans; }
- void SetTransMatrix(Double_t* carr) { fHMTrans.SetFrom(carr); }
- void SetTransMatrix(const TGeoMatrix& mat) { fHMTrans.SetFrom(mat); }
+ Float_t GetDefWidth() const { return fDefWidth; }
+ Float_t GetDefHeight() const { return fDefHeight; }
+ Float_t GetDefDepth() const { return fDefDepth; }
- void Test(Int_t nboxes);
+ void SetDefWidth(Float_t v) { fDefWidth = v ; }
+ void SetDefHeight(Float_t v) { fDefHeight = v ; }
+ void SetDefDepth(Float_t v) { fDefDepth = v ; }
ClassDef(BoxSet, 1);
}; // endclass BoxSet
#include <Reve/BoxSet.h>
#include <TGLIncludes.h>
+#include <TGLRnrCtx.h>
+#include <TGLScene.h>
+#include <TGLSelectRecord.h>
+#include <TGLContext.h>
using namespace Reve;
ClassImp(BoxSetGL)
-BoxSetGL::BoxSetGL() : fM(0)
+BoxSetGL::BoxSetGL() : fM(0), fBoxDL(0)
{
// fDLCache = false; // Disable display list.
}
BoxSetGL::~BoxSetGL()
{}
+/**************************************************************************/
+// Protected methods
+/**************************************************************************/
+
+Int_t BoxSetGL::PrimitiveType() const
+{
+ return (fM->fRenderMode != DigitSet::RM_Line) ? GL_QUADS : GL_LINE_LOOP;
+}
+
+inline Bool_t BoxSetGL::SetupColor(const DigitSet::DigitBase& q) const
+{
+ if (fM->fValueIsColor)
+ {
+ glColor4ubv((UChar_t*) & q.fValue);
+ return kTRUE;
+ }
+ else
+ {
+ UChar_t c[4];
+ Bool_t visible = fM->fPalette->ColorFromValue(q.fValue, fM->fDefaultValue, c);
+ if (visible)
+ glColor4ubv(c);
+ return visible;
+ }
+}
+
+void BoxSetGL::MakeOriginBox(Float_t* p, Float_t dx, Float_t dy, Float_t dz) const
+{
+ // bottom
+ p[0] = 0; p[1] = dy; p[2] = 0; p += 3;
+ p[0] = dx; p[1] = dy; p[2] = 0; p += 3;
+ p[0] = dx; p[1] = 0; p[2] = 0; p += 3;
+ p[0] = 0; p[1] = 0; p[2] = 0; p += 3;
+ // top
+ p[0] = 0; p[1] = dy; p[2] = dz; p += 3;
+ p[0] = dx; p[1] = dy; p[2] = dz; p += 3;
+ p[0] = dx; p[1] = 0; p[2] = dz; p += 3;
+ p[0] = 0; p[1] = 0; p[2] = dz;
+}
+
+inline void BoxSetGL::RenderBox(const Float_t* p) const
+{
+ // bottom: 0123
+ glNormal3f(0, 0, -1);
+ glVertex3fv(p); glVertex3fv(p + 3);
+ glVertex3fv(p + 6); glVertex3fv(p + 9);
+ // top: 7654
+ glNormal3f(0, 0, 1);
+ glVertex3fv(p + 21); glVertex3fv(p + 18);
+ glVertex3fv(p + 15); glVertex3fv(p + 12);
+ // back: 0451
+ glNormal3f(0, 1, 0);
+ glVertex3fv(p); glVertex3fv(p + 12);
+ glVertex3fv(p + 15); glVertex3fv(p + 3);
+ // front: 3267
+ glNormal3f(0, -1, 0);
+ glVertex3fv(p + 9); glVertex3fv(p + 6);
+ glVertex3fv(p + 18); glVertex3fv(p + 21);
+ // left: 0374
+ glNormal3f(-1, 0, 0);
+ glVertex3fv(p); glVertex3fv(p + 9);
+ glVertex3fv(p + 21); glVertex3fv(p + 12);
+ // right: 1562
+ glNormal3f(1, 0, 0);
+ glVertex3fv(p + 3); glVertex3fv(p + 15);
+ glVertex3fv(p + 18); glVertex3fv(p + 6);
+}
+
+void BoxSetGL::MakeDisplayList() const
+{
+ if (fM->fBoxType == BoxSet::BT_AABox ||
+ fM->fBoxType == BoxSet::BT_AABoxFixedDim)
+ {
+ if (fBoxDL == 0)
+ fBoxDL = glGenLists(1);
+
+ Float_t p[24];
+ if (fM->fBoxType == BoxSet::BT_AABox)
+ MakeOriginBox(p, 1.0f, 1.0f, 1.0f);
+ else
+ MakeOriginBox(p, fM->fDefWidth, fM->fDefHeight, fM->fDefDepth);
+
+ glNewList(fBoxDL, GL_COMPILE);
+ glBegin(PrimitiveType());
+ RenderBox(p);
+ glEnd();
+ glEndList();
+ }
+}
+
+/**************************************************************************/
+// Virtuals from base-classes
+/**************************************************************************/
+
+Bool_t BoxSetGL::ShouldDLCache(const TGLRnrCtx & rnrCtx) const
+{
+ MakeDisplayList();
+
+ if (rnrCtx.DrawPass() == TGLRnrCtx::kPassOutlineLine)
+ return kFALSE;
+ return TGLObject::ShouldDLCache(rnrCtx);
+}
+
+void BoxSetGL::DLCacheDrop()
+{
+ fBoxDL = 0;
+ TGLObject::DLCacheDrop();
+}
+
+void BoxSetGL::DLCachePurge()
+{
+ static const Exc_t eH("BoxSetGL::DLCachePurge ");
+
+ if (fBoxDL == 0) return;
+ if (fScene)
+ {
+ fScene->GetGLCtxIdentity()->RegisterDLNameRangeToWipe(fBoxDL, 1);
+ }
+ else
+ {
+ Warning(eH, "Scene unknown, attempting direct deletion.");
+ glDeleteLists(fBoxDL, 1);
+ }
+ TGLObject::DLCachePurge();
+}
+
/**************************************************************************/
Bool_t BoxSetGL::SetModel(TObject* obj, const Option_t* /*opt*/)
SetAxisAlignedBBox(fM->AssertBBox());
}
-/**************************************************************************/
-
-void BoxSetGL::DirectDraw(TGLRnrCtx & /*rnrCtx*/) const
+void BoxSetGL::DirectDraw(TGLRnrCtx & rnrCtx) const
{
+ static const Exc_t eH("BoxSetGL::DirectDraw ");
+
+ if (rnrCtx.DrawPass() == TGLRnrCtx::kPassOutlineLine)
+ return;
+
BoxSet& mB = * fM;
- // printf("BoxSetGL::DirectDraw N boxes %d\n", mB.fBoxes.size());
- if(mB.fBoxes.size() == 0)
+ // printf("BoxSetGL::DirectDraw N boxes %d\n", mB.fPlex.Size());
+ if(mB.fPlex.Size() == 0)
return;
glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT);
glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
glEnable(GL_COLOR_MATERIAL);
- glDisable(GL_CULL_FACE);
- if (mB.fRenderMode == BoxSet::RM_Fill) {
+
+ if (mB.fRenderMode == DigitSet::RM_Fill)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
- } else if (mB.fRenderMode == BoxSet::RM_Line) {
+ else if (mB.fRenderMode == DigitSet::RM_Line)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- glDisable(GL_LIGHTING);
- }
- UChar_t defCol[4];
- Reve::ColorFromIdx(mB.fDefaultColor, defCol);
-
- if (mB.fRenderMode != BoxSet::RM_Line) {
-
- glBegin(GL_QUADS);
- for(std::vector<Box>::iterator q=mB.fBoxes.begin(); q!=mB.fBoxes.end(); ++q) {
- UChar_t* c = q->color;
- if (c[3] == 0 && c[2] == 0 && c[1] == 0 && c[0] == 0) {
- glColor4ubv(defCol);
- } else {
- glColor4ubv(c);
+
+ if (mB.fDisableLigting) glDisable(GL_LIGHTING);
+
+ if (rnrCtx.SecSelection()) glPushName(0);
+
+ Int_t boxSkip = 0;
+ if (rnrCtx.ShapeLOD() < 50)
+ boxSkip = 6 - (rnrCtx.ShapeLOD()+1)/10;
+
+ VoidCPlex::iterator bi(mB.fPlex);
+
+ switch (mB.fBoxType)
+ {
+
+ case BoxSet::BT_FreeBox:
+ {
+ GLenum primitiveType = PrimitiveType();
+ while (bi.next())
+ {
+ BoxSet::BFreeBox& b = * (BoxSet::BFreeBox*) bi();
+ if (SetupColor(b))
+ {
+ if (rnrCtx.SecSelection()) glLoadName(bi.index());
+ glBegin(primitiveType);
+ RenderBox(b.fVertices);
+ glEnd();
+ }
+ if (boxSkip) { Int_t s = boxSkip; while (s--) bi.next(); }
}
+ break;
+ } // end case free-box
- // bottom: 3210
- glNormal3f(0, 0, -1);
- glVertex3fv(q->vertices + 9); glVertex3fv(q->vertices + 6);
- glVertex3fv(q->vertices + 3); glVertex3fv(q->vertices);
- // top: 4567
- glNormal3f(0, 0, 1);
- glVertex3fv(q->vertices + 12); glVertex3fv(q->vertices + 15);
- glVertex3fv(q->vertices + 18); glVertex3fv(q->vertices + 21);
- // front: 0154
- glNormal3f(0, -1, 0);
- glVertex3fv(q->vertices); glVertex3fv(q->vertices + 3);
- glVertex3fv(q->vertices + 15); glVertex3fv(q->vertices + 12);
- // back: 7623
- glNormal3f(0, 1, 0);
- glVertex3fv(q->vertices + 21); glVertex3fv(q->vertices + 18);
- glVertex3fv(q->vertices + 6); glVertex3fv(q->vertices + 9);
- // left: 4730
- glNormal3f(-1, 0, 0);
- glVertex3fv(q->vertices + 12); glVertex3fv(q->vertices + 21);
- glVertex3fv(q->vertices + 9); glVertex3fv(q->vertices);
- // right: 5126
- glNormal3f(1, 0, 0);
- glVertex3fv(q->vertices + 15); glVertex3fv(q->vertices + 3);
- glVertex3fv(q->vertices + 6); glVertex3fv(q->vertices + 18);
+ case BoxSet::BT_AABox:
+ {
+ glEnable(GL_NORMALIZE);
+ while (bi.next())
+ {
+ BoxSet::BAABox& b = * (BoxSet::BAABox*) bi();
+ if (SetupColor(b))
+ {
+ if (rnrCtx.SecSelection()) glLoadName(bi.index());
+ glPushMatrix();
+ glTranslatef(b.fA, b.fB, b.fC);
+ glScalef (b.fW, b.fH, b.fD);
+ glCallList(fBoxDL);
+ glPopMatrix();
+ }
+ if (boxSkip) { Int_t s = boxSkip; while (s--) bi.next(); }
+ }
+ break;
}
- glEnd();
-
- } else {
- for(std::vector<Box>::iterator q=mB.fBoxes.begin(); q!=mB.fBoxes.end(); ++q) {
- UChar_t* c = q->color;
- if (c[3] == 0 && c[2] == 0 && c[1] == 0 && c[0] == 0) {
- glColor4ubv(defCol);
- } else {
- glColor4ubv(c);
+ case BoxSet::BT_AABoxFixedDim:
+ {
+ while (bi.next())
+ {
+ BoxSet::BAABoxFixedDim& b = * (BoxSet::BAABoxFixedDim*) bi();
+ if (SetupColor(b))
+ {
+ if (rnrCtx.SecSelection()) glLoadName(bi.index());
+ glTranslatef(b.fA, b.fB, b.fC);
+ glCallList(fBoxDL);
+ glTranslatef(-b.fA, -b.fB, -b.fC);
+ }
+ if (boxSkip) { Int_t s = boxSkip; while (s--) bi.next(); }
}
+ break;
+ }
- // bottom: 3210
- glBegin(GL_LINE_LOOP);
- glVertex3fv(q->vertices + 9); glVertex3fv(q->vertices + 6);
- glVertex3fv(q->vertices + 3); glVertex3fv(q->vertices);
- glEnd();
- // top: 4567
- glBegin(GL_LINE_LOOP);
- glVertex3fv(q->vertices + 12); glVertex3fv(q->vertices + 15);
- glVertex3fv(q->vertices + 18); glVertex3fv(q->vertices + 21);
- glEnd();
- // front: 0154
- glBegin(GL_LINE_LOOP);
- glVertex3fv(q->vertices); glVertex3fv(q->vertices + 3);
- glVertex3fv(q->vertices + 15); glVertex3fv(q->vertices + 12);
- glEnd();
- // back: 7623
- glBegin(GL_LINE_LOOP);
- glVertex3fv(q->vertices + 21); glVertex3fv(q->vertices + 18);
- glVertex3fv(q->vertices + 6); glVertex3fv(q->vertices + 9);
- glEnd();
- // left: 4730
- glBegin(GL_LINE_LOOP);
- glVertex3fv(q->vertices + 12); glVertex3fv(q->vertices + 21);
- glVertex3fv(q->vertices + 9); glVertex3fv(q->vertices);
- glEnd();
- // right: 5126
- glBegin(GL_LINE_LOOP);
- glVertex3fv(q->vertices + 15); glVertex3fv(q->vertices + 3);
- glVertex3fv(q->vertices + 6); glVertex3fv(q->vertices + 18);
- glEnd();
+ default:
+ {
+ throw(eH + "unsupported box-type.");
}
- }
+ } // end switch box-type
+
+ if (rnrCtx.SecSelection()) glPopName();
glPopAttrib();
}
+
+/**************************************************************************/
+/**************************************************************************/
+
+//______________________________________________________________________________
+void BoxSetGL::ProcessSelection(TGLRnrCtx & /*rnrCtx*/, TGLSelectRecord & rec)
+{
+ // Processes secondary selection from TGLViewer.
+ // Calls TPointSet3D::PointSelected(Int_t) with index of selected
+ // point as an argument.
+
+ if (rec.GetN() < 2) return;
+ fM->DigitSelected(rec.GetItem(1));
+}
+
+void BoxSetGL::Render(TGLRnrCtx & rnrCtx)
+{
+ // Interface for direct rendering from classes that include BoxSet as a member.
+
+ MakeDisplayList();
+ DirectDraw(rnrCtx);
+ glDeleteLists(fBoxDL, 1);
+ fBoxDL = 0;
+}
#define REVE_BoxSetGL_H
#include <TGLObject.h>
+#include <Reve/BoxSet.h>
namespace Reve {
-class BoxSet;
-
class BoxSetGL : public TGLObject
{
BoxSetGL(const BoxSetGL&); // Not implemented
protected:
BoxSet* fM;
+ mutable UInt_t fBoxDL;
+
virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
+ Int_t PrimitiveType() const;
+ Bool_t SetupColor(const DigitSet::DigitBase& q) const;
+ void MakeOriginBox(Float_t* p, Float_t dx, Float_t dy, Float_t dz) const;
+ void RenderBox(const Float_t* p) const;
+ void MakeDisplayList() const;
+
public:
BoxSetGL();
virtual ~BoxSetGL();
+ virtual Bool_t ShouldDLCache(const TGLRnrCtx & rnrCtx) const;
+ virtual void DLCacheDrop();
+ virtual void DLCachePurge();
+
virtual Bool_t SetModel(TObject* obj, const Option_t* opt=0);
virtual void SetBBox();
- virtual void Render(TGLRnrCtx & rnrCtx) { DirectDraw(rnrCtx); }
+ virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
+ virtual void ProcessSelection(TGLRnrCtx & rnrCtx, TGLSelectRecord & rec);
+
+ virtual void Render(TGLRnrCtx & rnrCtx);
ClassDef(BoxSetGL, 0);
}; // endclass BoxSetGL
#include <TColor.h>
// Updates
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
#include <TCanvas.h>
#include <TH1F.h>
#include <TH2F.h>
fCasCosPointingAngle(999),
fCasDecayLength(999)
{
- fMarkerColor = fRnrStyle->GetColor();
+ fMarkerColor = fRnrStyle->fFVAtt.GetMarkerColor();
fPolyLineV0.SetLineColor(fMarkerColor);
fPolyLinePos.SetLineColor(2); // red
fPolyLineNeg.SetLineColor(7); // light blue
//______________________________________________________________________
CascadeList::CascadeList(TrackRnrStyle* rs) :
- RenderElement(),
+ RenderElementList(),
fTitle(),
fRnrStyle(rs),
fRnrBach(kTRUE),
fPosColor(0),
fBachColor(0)
{
+ fChildClass = Cascade::Class(); // override member from base RenderElementList
+
Init();
}
//______________________________________________________________________
CascadeList::CascadeList(const Text_t* name, TrackRnrStyle* rs) :
- RenderElement(),
+ RenderElementList(),
fTitle(),
fRnrStyle(rs),
fRnrBach(kTRUE),
fPosColor(0),
fBachColor(0)
{
+ fChildClass = Cascade::Class(); // override member from base RenderElementList
+
Init();
SetName(name);
}
//______________________________________________________________________
void CascadeList::Init()
{
-
if (fRnrStyle== 0) fRnrStyle = new TrackRnrStyle;
- SetMainColorPtr(&fRnrStyle->fColor);
-
fMin[0] = 0; fMax[0] = 5; // Xi mass
fMin[1] = 0; fMax[1] = 5; // Omega mass
//______________________________________________________________________
-
-void CascadeList::AddElement(RenderElement* el)
-{
- static const Exc_t eH("CascadeList::AddElement ");
- if (dynamic_cast<Cascade*>(el) == 0)
- throw(eH + "new element not a Cascade.");
- RenderElement::AddElement(el);
-}
-
-
-
void CascadeList::SetRnrV0vtx(Bool_t rnr)
{
fRnrV0vtx = rnr;
*
************************************************************************/
-class CascadeList : public TNamed, public RenderElement
+class CascadeList : public RenderElementList
{
CascadeList(const CascadeList&); // Not implemented
CascadeList& operator=(const CascadeList&); // Not implemented
virtual void Paint(Option_t* option="");
- virtual void AddElement(RenderElement* el);
-
void SetRnrStyle(TrackRnrStyle* rst) { fRnrStyle= rst; }
TrackRnrStyle* GetRnrStyle() { return fRnrStyle; }
+2007-10-16 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * Line.cxx:
+ * Line.h:
+ * PointSet.cxx:
+ * PointSet.h:
+ * TTreeTools.cxx:
+ * TTreeTools.h:
+ Add support for optional integer ids for every point in a
+ PointSet. Can also be filled via TPointSelector.
+ Remove obsolete constructor from PointSet and Line.
+
+ * Track.cxx:
+ Merge from EVE-head-after-merge to HEAD.
+
+2007-10-10 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ * NLTProjector.cxx:
+ * NLTProjector.h:
+ * NLTProjectorGL.cxx:
+ * NLTProjectorEditor.cxx:
+ * NLTProjectorEditor.h:
+ Set NLTProjection name according to projection type and
+ distortion. Use fAxisColor instead of RenderElement::fMainColor.
+
+2007-10-05 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * RGeoNodeEditors.cxx:
+ * RGeoNodeEditors.h:
+ * GeoNodeEditor.cxx:
+ * GeoNodeEditor.h:
+ Rename inconsistently named file RGeoNodeEditors to
+ GeoNodeEditor.
+
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ * ReveManager.cxx:
+ * ReveManager.h:
+ * Cascade.cxx:
+ * DigitSet.cxx:
+ * GeoNode.cxx:
+ * LinkDef.h:
+ * NLTProjector.cxx:
+ * PointSet.cxx:
+ * QuadSet.cxx:
+ * RGBrowser.cxx:
+ * RGBrowser.h:
+ * RGEditor.cxx:
+ * RenderElement.cxx:
+ * RenderElement.h:
+ * Scene.cxx:
+ * SceneInfo.cxx:
+ * Track.cxx:
+ * TrackEditors.cxx:
+ * TrackRnrStyleEditor.cxx:
+ * TriangleSet.cxx:
+ * V0.cxx:
+ * VSDSelector.cxx:
+ * Viewer.cxx:
+ * reve_main/reve_main.cxx:
+ Renamed class RGTopFrame to ReveManager.
+
+2007-10-04 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * BoxSetGL.cxx:
+ Make box face-normals and face-orientations consistent.
+
+2007-10-04 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * GeoNode.cxx:
+ For class GeoShapeRnrEl:
+ Add missing call to ElementChanged() in ImportShapeExtract().
+ Properly handle fHMTrans::UseTrans.
+
+ * TGeoShapeExtract.cxx:
+ * TGeoShapeExtract.h:
+ Add setters and AddElement() method to allow creation of ad hoc
+ shape collections.
+
+2007-10-03 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * BoxSetGL.cxx:
+ Progressively skip more and more boxes at lower levels of detail.
+
+2007-10-03 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * EventBase.h:
+ Fix compilation warning.
+
+ * MCHelixLine.hi:
+ Include cassert, needed by gcc-4.1.
+
+ * RGEditor.cxx:
+ Call RenderElement::ElementChanged() instead of
+ gReve->RenderElementChanged().
+
+ * RGeoNodeEditors.cxx:
+ * RGeoNodeEditors.h:
+ Use RGValuator for top-node visibility option and level.
+ Add missing call to Update() for those two callbacks.
+
+2007-10-02 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * DigitSet.cxx:
+ * DigitSet.h:
+ * DigitSetEditor.cxx:
+ * DigitSetEditor.h:
+ New files: take common digit rendering stuff from QuadSet.
+
+ * QuadSet.cxx:
+ * QuadSet.h:
+ Much code moved to DigitSet: this is the new base.
+
+ * QuadSetEditor.cxx:
+ * QuadSetEditor.h:
+ Removed files: all done in DigitSetEditor now.
+
+ * QuadSetGL.cxx:
+ * QuadSetGL.h:
+ Changes for DigitSet.
+ Skip rendering in line-pass of outline mode.
+
+ * BoxSet.cxx:
+ * BoxSet.h:
+ Inherit from DigitSet.
+ Implement optimised axis-aligned box modes.
+
+ * BoxSetGL.cxx:
+ * BoxSetGL.h:
+ Support new box-modes and secondary-selection.
+
+ * FrameBox.cxx:
+ * FrameBox.h:
+ * FrameBoxGL.cxx:
+ * FrameBoxGL.h:
+ Add support for background polygon.
+
+ * LinkDef.h:
+ Add DigitSet and DigitSetEditor.
+ Remove QuadSetEditor and Box.
+
+ * PointSet.cxx:
+ * PointSet.h:
+ Support assignment of external references in PointSetArray.
+
+ * RGBrowser.cxx:
+ Tried to add HTML browser; apparently the class was not put into
+ root repository yet,
+
+ * StraightLineSet.cxx:
+ Effc++ warnings.
+
+2007-09-19 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * EventBase.cxx:
+ * EventBase.h:
+ Added empty virtual functions for event-navigation.
+ Moved new-event-commands list and method from Alieve::Event.
+
+ * RGValuators.cxx:
+ Do not use GetName() on TGWindow derivatives.
+
+ * Track.cxx:
+ Added initialization of min/max/lim momentums to the other
+ TrackList ctor as well.
+
+2007-09-19 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * MCHelixLine.hi:
+ Properly extrapolate helices to boundaries (needed for
+ high-momentum tracks).
+ Added check for near-zero pT (extrapolate as line).
+ Some code cleanup.
+
+ * RenderElement.cxx:
+ In SetRnrState() check if update is really necessary.
+
+ * Track.cxx:
+ * Track.h:
+ * TrackEditors.cxx:
+ * TrackEditors.h:
+ * TrackRnrStyleEditor.cxx:
+ * TrackRnrStyleEditor.h:
+ Implement automatic determination of p and pT ranges.
+ Moved momentum ranges from TrackRnrStyle to TrackList.
+
+2007-09-10 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * TGClassBrowser.cxx:
+ * TGFileBrowser.cxx:
+ * TGFileBrowser.h:
+ * TGNewBrowser.cxx:
+ * TGNewBrowser.h:
+ From Bertrand.
+
+ - Removed dependencies on libRIO
+ - Solved problems when user double-click on different keys
+ in different opened Root files
+ - Changed icons size for Root files containing pictures
+ - Added drawing option combobox
+ - Added a few main menu entries, allowing to:
+ - add a new tab with canvas
+ - add a new tab with editor
+ - remove a tab element
+ - execute a plugin by TGFileDialog selection
+ - Added key shortcuts for these menus entries
+ - Double-clicking on a .C file opens it in the editor if
+ the active tab is the editor one, otherwise the default
+ action will be taken (execute it)
+ - Properly goes to current (startup) directory at startup
+ time (open the list tree to the current directory)
+ - Properly remove menu when closing a tab element
+ - Temporary remove keys binding on embedded menus
+
+2007-09-06 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * RGBrowser.cxx:
+ Clarify exception text.
+
+ * RGEditor.cxx:
+ From Bertrand: use set-method when changing static
+ TGedFrame::fgFrameCreator (required for windows).
+
+2007-08-31 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * RenderElement.cxx:
+ * RenderElement.h:
+ New virtual GetListTreeIcon(), which sets an icon picture in a list tree.
+
+ * Reve.cxx:
+ Initialize list tree icons.
+
+ * Scene.h:
+ * Track.h:
+ * Viewer.h:
+ * PointSet.h:
+ Set specific icons for this class in a list tree.
+
+2007-08-30 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ * StraightLineSet.cxx:
+ * StraightLineSet.h:
+ Handle translation and scale in projected line-set separately.
+
+2007-08-30 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * NLTProjector.h:
+ Reindent.
+
+ * NLTProjectorEditor.cxx:
+ * NLTProjectorEditor.h:
+ Add RGValuator for current depth.
+
+ * StraightLineSet.cxx:
+ * StraightLineSet.h:
+ Use transformation matrix, to scale or move line set.
+
+ * ZTrans.cxx:
+ * ZTrans.h:
+ Add multiply function with Float_t* as an argument.
+
+2007-08-30 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * RenderElement.cxx:
+ * RenderElement.h:
+ Change DenyDestroy to Int_t, replace Set with Inc/Dec
+ methods. Fixed zero-ref checks accordingly.
+
+ Symmetrized RemoveElement and RemoveElements with their Local
+ parts.
+
+ Moved code for list-tree item mgmnt from RGTopFrame to Add/Remove
+ element methods here.
+
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ Moved list-tree item mgmnt from Add/RemoveRenderElement to
+ appropriate methods in RenderElement.
+
+ Update to new RnrEl::DenyDestroy.
+
+ Added Bool_t fKeepEmptyCont as it is queried by many macros.
+
+ * RGBrowser.cxx:
+ Update to new RnrEl::DenyDestroy.
+
+ * PointSet.cxx:
+ * PointSet.h:
+ * Viewer.cxx:
+ * Viewer.h:
+ * Cascade.cxx:
+ * Cascade.h:
+ * V0.cxx:
+ * V0.h:
+ Update to new RnrEl::RemoveElementLocal, RemoveElementsLocal.
+
+ * NLTBases.cxx:
+ * NLTBases.h:
+ Added list<NTLProjected*> fProjectedList to NLTProjectable.
+ Set of functions to manage it.
+ Proper management in relevant functions of NLTProjectable and
+ NTLProjected.
+
+ * NLTTrack.cxx:
+ * NLTTrack.h:
+ Forward CtrlClicked() call (from gl sec-selection) to
+ fProjectable.
+
+ * NLTProjector.cxx:
+ Set RnrSelf/Children() on imported elements.
+
+ * NLTPolygonSet.cxx:
+ * NLTPolygonSet.h:
+ Fix search for duplicate polygons a little.
+
+ * Track.cxx:
+ * Track.h:
+ Manage list of projected tracks so that it works in TrackCount.
+
+ * Reve.cxx:
+ Revert to gled-style check if function is loaded in cint.
+
+2007-08-30 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * TGFileBrowser.cxx:
+ * TGFileBrowser.h:
+ From Bertrand.
+ Override ReallyDelete() so that browser is properly deregistered
+ from root.
+
+ * TGNewBrowser.cxx:
+ * TGNewBrowser.h:
+ From Bertrand.
+ Move framework specific menus to the left menu-bar.
+
+ * RGBrowser.cxx:
+ Remove the 'Framework' popup on construction.
+ Add 'Reve' popup to inherited member fMenuBar.
+ Added 'New Text Editor' menu entry.
+
+2007-08-29 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * LinkDef.h:
+ Register new class NLTSLineSet.
+
+ * StraightLineSet.cxx:
+ * StraightLineSet.h:
+ Implement StraightLineSet projected class NLTSLineSet.
+
+ * StraightLineSetGL.cxx:
+ StraightLineSet inherits from TAttLine.
+
+ * StraightLineSetEditor.cxx:
+ Editor not friend class of model. Use Getters/Setters.
+
+2007-08-29 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * NLTProjectorEditor.cxx:
+ ChangeTGNumberEntry length.
+
+ * Track.cxx:
+ * Track.h:
+ Add function in Track to set line and marker attributes from TrackList.
+
+2007-08-29 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * TGClassBrowser.cxx:
+ * TGClassBrowser.h:
+ * TGCommandPlugin.cxx:
+ * TGCommandPlugin.h:
+ * TGFileBrowser.cxx:
+ * TGFileBrowser.h:
+ * TGNewBrowser.cxx:
+ * TGNewBrowser.h:
+ New files from Bertrand, somewhat hacked: prototype implementation
+ of a new root browser.
+
+ * LinkDef.h:
+ Register new classes TGClassBrowser, TGCommandPlugin,
+ TGFileBrowser and TGNewBrowser.
+
+ * RGBrowser.cxx:
+ * RGBrowser.h:
+ Fix includes for the new-browser files (before they were in
+ ROOTSYS/include).
+
+2007-08-28 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * GridStepperEditor.cxx:
+ * GridStepperEditor.h:
+ Configure GridStepper widgets.
+
+ * NLTProjector.cxx:
+ Remeve obsolete Signal/Slot call.
+
+2007-08-28 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * .SKEL-gedsubed.cxx:
+ Change callback in sub-editor skeleton file.
+
+ * GridStepperEditor.cxx:
+ * GridStepperEditor.h:
+ New class GridStepperEditor/GridStepperSubEditor.
+
+ * LinkDef.h:
+ Register new classes: GridStepperSubEditor and GridStepperEditor.
+
+ * NLTProjectorEditor.cxx:
+ Add tool-tip in TGComboBox.
+
+2007-08-28 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ *es FrameBoxGL.cxx:
+ Disable back-face culling if enabled.
+
+ * RMacro.cxx:
+ Revert back to gled-style checking if a macro is loaded. The
+ Axel's method spits blood with latest cint.
+
+2007-08-27 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * QuadSetEditor.cxx:
+ * QuadSetEditor.h:
+ Create extra tab to show histograms.
+
+ * RGBAPalette.cxx:
+ * RGBAPalette.h:
+ New function SetLimitsScaleMinMax(Int_t low, Int_t high).
+
+2007-08-27 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * RGTopFrame.cxx:
+ Use gClient->GetRoot() for creation of embedded gl viewer.
+
+ * RGValuators.cxx:
+ During construction of label frame use fName instead of GetName(),
+ which is used for saving gui into a macro.
+
+ * TrackRnrStyleEditor.cxx:
+ Fix labels, now that we can have spaces.
+
+2007-08-27 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * FrameBox.cxx:
+ * FrameBox.h:
+ * FrameBoxGL.cxx:
+ Added option to render a filled-frame so that a client can be
+ selected even by pressing into an empty area.
+
+ * GridStepper.h:
+ Added SetOs() to set origin.
+
+ * RGEditor.cxx:
+ * RGEditor.h:
+ Implemented SetModel() from TGedEditor so that it can cross check
+ if the edited object is a render element. This is needed when the
+ model is set from somewhere else the reve, like TGLViewer.
+
+ * ZTrans.cxx:
+ * ZTrans.h:
+ Added Float_t* versions of Get/SetPos().
+
+2007-08-26 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * NLTProjector.cxx:
+ * NLTProjector.h:
+ * NLTProjectorEditor.cxx:
+ * NLTProjectorEditor.h:
+ Add member fFixedRadius. It defines distance from center, where
+ projected value is not dependent of distortion. Introduce z-depth
+ which defines the z coordinate of projected points.
+
+ * NLTBases.h:
+ * PointSet.cxx:
+ * NLTPolygonSet.cxx:
+ * NLTPolygonSet.h:
+ * NLTPolygonSetEditor.cxx:
+ * NLTPolygonSetEditor.h:
+ NLTProjected new member z-depth.
+
+ * NLTTrack.cxx:
+ Improve algorithm in GetBreakpoint().
+
+ * PODs.h:
+ Add function Vector::Set(const Vector& v).
+
+2007-08-26 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ Added FullRedraw3D() forcing complete redraw of scenes and
+ viewers.
+
+ * Scene.cxx:
+ * Scene.h:
+ Added RepaintAllScenes().
+
+ * Viewer.cxx:
+ * Viewer.h:
+ Added RepaintAllViewers().
+ When camera reset is requested call viewer->PostSceneBuildSetup()
+ instead of ResetCamerasAfterNextUpdate().
+
+2007-08-26 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * RenderElement.cxx:
+ * RenderElement.h:
+ Added new optional argument Bool_t redraw to ElementChanged().
+ USe the above method consistently throughout the code.
+
+2007-08-26 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * NLTProjector.cxx:
+ NLTProjection::GetValForScreenPos(): use projected values during
+ calculation of inital bisection bounds.
+
+ * PODs.cxx:
+ * PODs.h:
+ Added Vector::Mult(). Whitespace.
+
+ * RGBrowser.cxx:
+ * RGBrowser.h:
+ RGLTEFrame: added functions ReconfToHorizontal/Vertical() and menu
+ entry to invoke them.
+
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ Added GetLTEFrame().
+ Setup TGLSAViewer to edit external objects by default.
+ At startup show editor of default viewer.
+
+ * RenderElement.cxx:
+ In RemoveFromListTrees() rewrite list-tree-item loop to avoid
+ backward iteration during item removal.
+
+ * Viewer.cxx:
+ Setup TGLSAViewer to edit external objects by default.
+
+2007-08-24 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * NLTProjector.cxx:
+ * NLTProjector.h:
+ * NLTProjectorGL.cxx:
+ * NLTProjectorGL.h:
+ Improve algorithm for tick-mark positioning and configuration.
+
+ * NLTProjectorEditor.cxx:
+ * NLTProjectorEditor.h:
+ Add widgets to configure scale info.
+
+ * PODs.h:
+ Add index operator to Vector class.
+
+ * RenderElement.cxx:
+ * RenderElement.h:
+ Add GetRnrElName()/GetRnrElTitle() in RenderElement class.
+
+2007-08-24 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * LinkDef.h:
+ Register new class NLTPointSetGL.
+
+ * NLTPointSetGL.cxx:
+ * NLTPointSetGL.h:
+ New files: hack to disable display-lists for NLTPointSet (bug in
+ fglrx driver, takes forever).
+
+ * NLTProjector.cxx:
+ Set fProjection = 0 after destruction.
+
+ * .SKEL-gl.cxx:
+ * NLTTrackGL.cxx:
+ Fix a commented line for display-list disabling.
+
+2007-08-24 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * LinkDef.h:
+ Register class RGLTEFrame.
+
+ * RGBrowser.cxx:
+ * RGBrowser.h:
+ Subclass RGBrowser from TNewBrowser, add new class RGLTEFrame to
+ encapsulate list-tree editor combo.
+ This is a major change, basically no code left unchanged.
+
+ * RGEditor.cxx:
+ * RGEditor.h:
+ Added width, height ctor args.
+ Use RenderElement::GetEditorObject() instead of GetObject().
+
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ Removed inheritance from TGmainFrame, use RGBrowser as top-level
+ GUI element. Whole initalization rewritten to reflect that.
+ RGTopFrame class is now ripe to be renamed to Application, Manager
+ or something similar.
+
+ For consistency renamed ElementChanged() to RenderElementChanged().
+
+ * RenderElement.cxx:
+ * RenderElement.h:
+ Added virtual GetEditorObject() that can return an alternate
+ object to be edited when rnr-el is selected (eg. Viewer passes its
+ TGLViewer).
+
+ Added virtual CheckReferenceCount() (code taken from
+ RemoveParent()) that is now also called from RemoveFromListTree()
+ when a top-level list-tree-entry is removed.
+
+ Replaced all calls gClient->NeedRedraw(listtree) with
+ listtree->ClearViewPort() [changes in root].
+
+ Added optional arguments Bool_t rnr_self/children to
+ En/DisableListElements().
+
+ * Reve.cxx:
+ Moved mime-type init for RMacro from RGTopFrame to SetupGUI().
+
+ * Scene.cxx:
+ Report scene destruction to global viewer-list.
+
+ * SceneInfo.cxx:
+ * SceneInfo.h:
+ Overrode AcceptRenderElement() and HandleElementPaste() to deny
+ addition of elements.
+
+ * Viewer.cxx:
+ * Viewer.h:
+ Viewer: overrode GetEditorObject() to return fGLViewer.
+ ViewerList: added SceneDestructing(Scene* scene) method to
+ unregister a scene from all existing viewers.
+
+ * GeoNode.cxx:
+ Remove obsolete root-version ifdef.
+
+ * VSDSelector.h:
+ Add missing include.
+
+2007-08-22 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * NLTBases.cxx:
+ * NLTBases.h:
+ Implementation of NLTGeoProjectable class, to be a common base of
+ GeoNode and GeoShapeRnrEl for non-linear projections.
+
+ * GeoNode.cxx:
+ * GeoNode.h:
+ GeoShapeRnrEl inherited from NLTGeoProjectable class.
+
+ * LinkDef.h:
+ Register new class NLTGeoProjectable.
+
+ * NLTPolygonSet.cxx:
+ * NLTPolygonSet.h:
+ * NLTProjector.cxx:
+ * NLTProjector.h:
+ Non-linear transformation of TBuffer3D moved in NLTPolygonSet.
+
+ * NLTPolygonSetGL.cxx:
+ NLTPolygons in NLTPolygonSet stored in std::list.
+
+ * NLTProjectorEditor.cxx:
+ Use NLTProjector Getters and Setters.
+
+ * NLTTrack.h:
+ Remove PrintLineSegments() from popup menu.
+
+ * NLTTrack.cxx:
+ In UpdateProjection disable recursive behavior. Recursive calls
+ already done by NLTProjector.
+
+2007-08-21 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * GLUtilNS.cxx:
+ * GLUtilNS.h:
+ * LineGL.cxx:
+ Add function RenderLine() to draw a float array with given
+ TAttLine. In RenderCorsses() and RenderPoints() fix bug => leave
+ second argument to point to the same location.
+
+ * TrackGL.cxx:
+ Use GLUtilNS::RenderLine(). Do check of PathMarks boundaries in
+ DirectDraw().
+
+ * Track.cxx:
+ * Track.h:
+ TrackList and Track become NLTProjectable classes. In Track remove
+ vector fVisPathMarks. It was unnecessary, since fPathMarks have
+ the required data.
+
+ * LinkDef.h:
+ Register new classes NLTTrack, NLTTrackGL, NLTTrackList.
+
+ * NLTTrack.cxx:
+ * NLTTrack.h:
+ * NLTTrackGL.cxx:
+ * NLTTrackGL.h:
+ New files: new classes for management and rendering of projected
+ tracks.
+
+ * NLTProjector.cxx:
+ * NLTProjector.h:
+ Remove obsolete management for PointSet and Track. Fix bug in RhoZ::AcceptSegment().
+
+ * TrackRnrStyleEditor.cxx:
+ Fix interval in fMaxOrbits RGValuator.
+
+2007-08-20 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * NLTProjector.cxx:
+ * NLTProjector.h:
+ * Viewer.cxx:
+ * Viewer.h:
+ Method HandleElementPaste() now returns Bool_t.
+
+ * NLTProjector.cxx:
+ Use new method CollectSceneParentsFromChildren() to optimize
+ update of all related scenes.
+
+ * RGBrowser.cxx:
+ * RGBrowser.h:
+ Conform to convention that change initiator is responsible for
+ calling redraw. Added method ItemChecked() to act as a mediator to
+ gReve.
+
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ * RenderElement.cxx:
+ * RenderElement.h:
+ Added method CollectSceneParentsFromChildren().
+ Changed return value of HandleElementPaste() from void to Bool_t.
+ Renamed Changed() to ElementChanged().
+
+ * TriangleSet.cxx:
+ Fixed gcc-4 warnings.
+
+2007-08-20 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * RGBrowser.cxx:
+ * RGBrowser.h:
+ Added handling of key-presses in list-tree; in particular delete
+ key removes render element from specific parent.
+
+ * RGTopFrame.cxx:
+ RemoveRenderElement now properly untangles the element from all
+ list-trees.
+
+ * RenderElement.cxx:
+ * RenderElement.h:
+ Implemented RemoveFromListTrees(RenderElement* parent) that
+ removes items from all list trees where parent is equal to the one
+ passed as argument.
+
+2007-08-20 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * NLTProjector.cxx:
+ * NLTProjector.h:
+ Bind element-paste to ImportElements.
+ Prefix imported render-element names with "NLT ".
+
+ * PointSet.cxx:
+ * PointSet.h:
+ Implemented virtual ComputeBBox() to enforce minimal bounding-box
+ size.
+
+ * RGBrowser.cxx:
+ * RGBrowser.h:
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ Removed obsolete code for "classic-look".
+
+2007-08-19 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * LinkDef.h:
+ Register new class NLTProjectorEditor.
+
+ * NLTProjector.cxx:
+ * NLTProjector.h:
+ Added methods for (recursive) import and update of projected
+ elements.
+
+ * NLTProjectorEditor.cxx:
+ * NLTProjectorEditor.h:
+ New files, editor class for NLTProjection.
+
+ * PointSet.cxx:
+ * PointSet.h:
+ PointSet: implemented virtual SetRnrElNameTitle();
+ NLTPointSet: implemented virtual SetProjection().
+
+ * RenderElement.cxx:
+ * RenderElement.h:
+ Added virtual functions SetRnrElNameTitle() and Changed().
+
+2007-08-19 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * FrameBoxGL.h:
+ * NLTProjector.cxx:
+ * NLTProjector.h:
+ Fix gcc-4 warnings.
+
+ * LinkDef.h:
+ Register new classes NLTProjectable, NLTProjected and NLTPointSet.
+
+ * NLTBases.cxx:
+ * NLTBases.h:
+ New files: new abstract bases NLTProjectable and NLTProjected.
+
+ * PointSet.cxx:
+ * PointSet.h:
+ New class NLTPointSet; add NLTProjectable as a base of PointSet.
+
+ * RGBrowser.cxx:
+ Resize widgets to obtain resonable starting size.
+
+2007-08-19 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ Default start-up mode now embedded gl viewer;
+ added function SpawnNewScene().
+
+2007-08-18 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * LinkDef.h:
+ Registere new classes TrackEditor, TrackRnrStyleEditor and
+ TrackRnrStyleSubEditor.
+
+ * Track.cxx:
+ * Track.h:
+ * TrackEditors.cxx:
+ * TrackEditors.h:
+ * TrackGL.cxx:
+ * TrackRnrStyleEditor.cxx:
+ * TrackRnrStyleEditor.h:
+ Configuration of track rendering has two sources. First is done by
+ TrackRnrStyle which can be shared. Second type of configuration
+ goes via TrackList container, a RenderElement parent of a track.
+
+ TrackList handles only track line attributes. These attributes are
+ set recursively by default. The remaining configuration is dane
+ with referenced TrackRnrStyle.
+
+ * GLUtilNS.cxx:
+ * GLUtilNS.h:
+ Change argument TAttMatker& in RenderPoints(), RenderCrosses() and
+ RenderPolymarkers() to const TAttMatker&.
+
+ * LineEditor.cxx:
+ Put checkbox fRnrMarkers before checkbox fRnrLine.
+
+ * Cascade.cxx:
+ * V0.cxx:
+ * VSDSelector.cxx:
+ * NLTProjector.cxx:
+ Set line color in tracks to TrackList main color. Remove call
+ MakeMarkers(). Rendering of fist vertex is done in
+ TrackGL::DirectDraw().
+
+2007-08-18 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * RenderElement.cxx:
+ * RenderElement.h:
+ Added virtual HandleElementPaste(RenderElement* el) that is called
+ on mouse-paste into list-tree-item representing the element.
+
+ * Viewer.cxx:
+ * Viewer.h:
+ Override HandleElementPaste() to try and add a scene to the viewer.
+
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ Added methods RenderElementSelect/Paste().
+
+ * RGBrowser.cxx:
+ In ItemClicked also check for middle button.
+
+ * RGEditor.cxx:
+ * RGEditor.h:
+ Added new state data-memebr to cross-check if fRenderElement is
+ still correct;
+ hack to set priority of TAttMArkerEditor to one.
+
+2007-08-17 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * EventBase.cxx:
+ * EventBase.h:
+ Subclass directly from RenderElementList instead of PadPrimitive.
+
+ * Pad.cxx:
+ * Pad.h:
+ Override virtuals IsBatch(), Update() and GetViewer3D() to allow
+ Reve::Pad - GLViewer link to survive without a canvas.
+
+ * RGBrowser.cxx:
+ * RGBrowser.h:
+ Removed all usage of pad during construction of editor and
+ gl-viewer.
+
+ * RGEditor.cxx:
+ * RGEditor.h:
+ In Update() propagate the change to gReve so that it can deduce
+ which scenes need to be repainted. GUI size change.
+
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ Major restructuring of basic state representation: use new
+ Viewer/Scene classes to allow many simoultaneous GL-viewers with
+ shared scenes; update mechanism changed accordingly.
+
+ * RenderElement.cxx:
+ * RenderElement.h:
+ Added virtual CollectSceneParents() for update steering;
+ generalized methods for adding elements into list-trees; removed
+ obsolete class PadPrimitive.
+
+ * Scene.cxx:
+ * Scene.h:
+ * SceneInfo.cxx:
+ * SceneInfo.h:
+ * Viewer.cxx:
+ * Viewer.h:
+ New files implementing classes for representation of
+ GL-viewer/scene classes in Reve.
+
+ * LinkDef.h:
+ Register new classes Scene, SceneList, SceneInfo, Viewer and
+ ViewerList; remove PadPrimitive.
+
+ * VSDSelector.cxx:
+ Removed obsolete protection of gPad.
+
+2007-08-13 Matevz Tadel <matevz.tadel@cern.ch>
+
+ EVE-dev
+
+ * GeoNode.cxx:
+ * NLTProjector.cxx:
+ * PointSet.cxx:
+ * RGTopFrame.cxx:
+ * RGTopFrame.h:
+ * VSDSelector.cxx:
+ Consistent ordering of arguments to AddRenderElement(),
+ AddGlobalRenderElement() and RemoveRenderElement().
+
+2007-08-09 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
+
+ EVE-dev
+
+ * GLUtilNS.cxx:
+ * GLUtilNS.h:
+ * StraightLineSetGL.cxx:
+ In RederPolymarkers()/RederCorssess()/RederPoints() argument
+ sec_sel has default value false. RenderPolyMarkers() now also
+ applies color from TAttMarker.
+
+ * Track.cxx:
+ * Track.h:
+ * TrackGL.cxx:
+ MakeTrack()/MakeTracks() are recursive by default.
+
+ * LinkDef.h:
+ * NLTProjectorGL.h:
+ * NLTProjectorGL.cxx:
+ New files.
+ Draw axis to define bounding box of non-linear projected geometry.
+
+ * NLTProjector.cxx:
+ * NLTProjector.h:
+ Fix inconsistent checking of polygon duplicates. Enable dynamic
+ configuration of TrackRenderStyle.
+
+ * ZTrans.cxx:
+ * ZTrans.h:
+ Add multiply functions with Double_t* as an argument.
+
+ * NLTPolygonSet.cxx:
+ * NLTPolygonSet.h:
+ * NLTPolygonSetGL.cxx:
+ NLTPolygonSetGL inherited from RenderElementList. Add Getters for
+ vertices and polygons.
+
+ * NLTPolygonSetEditor.cxx:
+ * NLTPolygonSetEditor.h:
+ Edit transparency of main color.
+
2007-07-23 Matevz Tadel <matevz.tadel@cern.ch>
* Track.h:
* Track.h:
* TrackEditors.cxx:
* TrackEditors.h:
- Enable line style modification in TrackList/TrackListEditor.
+ Enable line style modification in TrackList/TrackListEditor.
2007-05-24 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
* GeoNode.h:
* RGeoNodeEditors.cxx:
Map SetRnrSelf and SetRnrChildren to node visibility and to node
- daughters visibility.
+ daughters visibility.
2007-04-19 Matevz Tadel <matevz.tadel@cern.ch>
* RenderElement.h:
* LinkDef.h:
Classes RenderElement and RenderElementListBase have been merged,
- RenderElementListBase class is removed.
+ RenderElementListBase class is removed.
- Since RenderElement supports hierarchical structure fRnrElement is
+ Since RenderElement supports hierarchical structure fRnrElement is
replaced to fRnrSelf and fRnrChildren. RnrSelf/RnrDaughters
callbacks from editor set check box picture according to the for
- possible states.
+ possible states.
New class PadPrimitve. Objects of the classes enable recursive
rendering as they are added in TPad fListOfPrimitives.
* RenderElement.cxx:
Call redraw after Enable/DisableListElements.
-
+
* Track.cxx:
* Track.h:
Two new items for context menu: PrintPathMarks and
Fix Ludovic's strange const-method syntax.
2007-02-19 Alja Mrak-Tadel <Alja.Mrak.Tadel@cern.ch>
-
+
* PODs.h:
Add member time to class PathMark. Set values in enum
PathMark::Type_e.
-
+
* Track.cxx:
Add callbacks to set path marks. In Track::MakeTrack() implement
fitting of track references and daughter particles.
* QuadSetGL.cxx:
* QuadSetGL.h:
Added support for secondary selection. Sacrificed some speed for
- simplicity / clarity.
+ simplicity / clarity.
2006-12-08 Matevz Tadel <matevz.tadel@cern.ch>
* RGValuators.cxx:
* RGValuators.h:
- Added int version of SetLimits for RGDoubleValuator; added
+ Added int version of SetLimits for RGDoubleValuator; added
getters for value limits (Ludovic).
* Plex.cxx:
* TrackEditors.cxx:
* TrackEditors.h:
Cleaned-up by using RGValuators instead of raw ROOT GUI (partial).
-
+
* QuadSet.cxx:
* QuadSet.h:
* QuadSetGL.cxx:
Changed inheritance to include Reve::RenderElement;
use ZTrans to store transformation matrix;
added render-mode state (to force line/fill drawing).
-
+
In class Box added ctor and function MakeAxisAlignedBox() to
facilitate creation of regular boxes.
2006-10-12 Matevz Tadel <matevz.tadel@cern.ch>
EVE-dev
-
+
* BoxSet.h:
Fix wrong numerical constant in transformation assignment.
2006-10-04 Matevz Tadel <matevz.tadel@cern.ch>
EVE-dev
-
+
* RenderElement.cxx:
* RenderElement.h:
Made RenderElement::ExportToCINT() virtual and reimplemented it in
2006-10-02 Matevz Tadel <matevz.tadel@cern.ch>
EVE-dev
-
+
* .SKEL-ged.cxx:
* .SKEL-ged.h:
* .SKEL-gl.cxx:
2006-08-29 Matevz Tadel <matevz.tadel@cern.ch>
EVE-dev
-
+
* BoxSetGL.cxx:
* QuadSetGL.cxx:
Added ifdefs for post root-5.11.0 prototype of SetModelCheckClass().
--- /dev/null
+// $Header$
+
+#include "DigitSet.h"
+
+#include "ReveManager.h"
+
+#include <TColor.h>
+
+#include <TBuffer3D.h>
+#include <TBuffer3DTypes.h>
+#include <TVirtualPad.h>
+#include <TVirtualViewer3D.h>
+
+using namespace Reve;
+
+//______________________________________________________________________
+// DigitSet
+//
+
+ClassImp(DigitSet)
+
+DigitSet::DigitSet(const Text_t* n, const Text_t* t) :
+ RenderElement (),
+ TNamed (n, t),
+
+ fDefaultValue (kMinInt),
+ fValueIsColor (kFALSE),
+ fOwnIds (kFALSE),
+ fPlex (),
+ fLastDigit (0),
+
+ fFrame (0),
+ fPalette (0),
+ fRenderMode (RM_Fill),
+ fDisableLigting (kTRUE),
+ fEmitSignals (kFALSE),
+ fHistoButtons (kTRUE),
+ fHMTrans ()
+{
+
+}
+
+DigitSet::~DigitSet()
+{
+ SetFrame(0);
+ SetPalette(0);
+ if (fOwnIds)
+ ReleaseIds();
+}
+
+/**************************************************************************/
+
+DigitSet::DigitBase* DigitSet::NewDigit()
+{
+ fLastDigit = new (fPlex.NewAtom()) DigitBase(fDefaultValue);
+ return fLastDigit;
+}
+
+void DigitSet::ReleaseIds()
+{
+ VoidCPlex::iterator qi(fPlex);
+ while (qi.next()) {
+ DigitBase& q = * (DigitBase*) qi();
+ if (q.fId.GetObject()) {
+ delete q.fId.GetObject();
+ q.fId = 0;
+ }
+ }
+}
+
+/**************************************************************************/
+/**************************************************************************/
+
+void DigitSet::SetMainColor(Color_t color)
+{
+ // Override from RenderElement, forward to Frame.
+
+ if (fFrame) {
+ fFrame->SetFrameColor(color);
+ fFrame->UpdateBackPtrItems();
+ }
+ gReve->Redraw3D();
+}
+
+/**************************************************************************/
+/**************************************************************************/
+
+void DigitSet::RefitPlex()
+{
+ // Instruct underlying memory allocator to regroup itself into a
+ // contiguous memory chunk.
+
+ fPlex.Refit();
+}
+
+/**************************************************************************/
+
+void DigitSet::ScanMinMaxValues(Int_t& min, Int_t& max)
+{
+ if (fValueIsColor || fPlex.Size() == 0) return;
+ min = kMaxInt;
+ max = kMinInt;
+ for (Int_t c=0; c<fPlex.VecSize(); ++c)
+ {
+ Char_t* a = fPlex.Chunk(c);
+ Int_t n = fPlex.NAtoms(c);
+ while (n--)
+ {
+ Int_t v = ((DigitBase*)a)->fValue;
+ if (v < min) min = v;
+ if (v > max) max = v;
+ a += fPlex.S();
+ }
+ }
+ if (min == max)
+ --min;
+}
+
+/**************************************************************************/
+
+
+void DigitSet::DigitValue(Int_t value)
+{
+ fLastDigit->fValue = value;
+}
+
+void DigitSet::DigitColor(Color_t ci)
+{
+ ColorFromIdx(ci, (UChar_t*) & fLastDigit->fValue, kTRUE);
+}
+
+void DigitSet::DigitColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a)
+{
+ UChar_t* x = (UChar_t*) & fLastDigit->fValue;
+ x[0] = r; x[1] = g; x[2] = b; x[3] = a;
+}
+
+void DigitSet::DigitColor(UChar_t* rgba)
+{
+ UChar_t* x = (UChar_t*) & fLastDigit->fValue;
+ x[0] = rgba[0]; x[1] = rgba[1]; x[2] = rgba[2]; x[3] = rgba[3];
+}
+
+/**************************************************************************/
+
+void DigitSet::DigitId(TObject* id)
+{
+ fLastDigit->fId = id;
+}
+
+/**************************************************************************/
+/**************************************************************************/
+
+void DigitSet::Paint(Option_t* /*option*/)
+{
+ static const Exc_t eH("DigitSet::Paint ");
+
+ TBuffer3D buff(TBuffer3DTypes::kGeneric);
+
+ // Section kCore
+ buff.fID = this;
+ buff.fColor = fFrame ? fFrame->GetFrameColor() : 1;
+ buff.fTransparency = 0;
+ fHMTrans.SetBuffer3D(buff);
+ buff.SetSectionsValid(TBuffer3D::kCore);
+
+ Int_t reqSections = gPad->GetViewer3D()->AddObject(buff);
+ if (reqSections != TBuffer3D::kNone)
+ Error(eH, "only direct GL rendering supported.");
+}
+
+void DigitSet::DigitSelected(Int_t idx)
+{
+ if (fEmitSignals) {
+ CtrlClicked(this, idx);
+ } else {
+ DigitBase* qb = GetDigit(idx);
+ TObject* obj = qb->fId.GetObject();
+ printf("DigitSet::DigitSelected idx=%d, value=%d, obj=0x%lx\n",
+ idx, qb->fValue, (ULong_t)obj);
+ if (obj)
+ obj->Print();
+ }
+}
+
+void DigitSet::CtrlClicked(DigitSet* qs, Int_t idx)
+{
+ Long_t args[2];
+ args[0] = (Long_t) qs;
+ args[1] = (Long_t) idx;
+
+ Emit("CtrlClicked(Reve::DigitSet*, Int_t)", args);
+}
+
+/**************************************************************************/
+// Getters / Setters for Frame, RGBAPalette, ZTrans
+/**************************************************************************/
+
+void DigitSet::SetFrame(FrameBox* b)
+{
+ if (fFrame == b) return;
+ if (fFrame) fFrame->DecRefCount(this);
+ fFrame = b;
+ if (fFrame) {
+ fFrame->IncRefCount(this);
+ SetMainColorPtr(fFrame->PtrFrameColor());
+ } else {
+ SetMainColorPtr(0);
+ }
+}
+
+void DigitSet::SetPalette(RGBAPalette* p)
+{
+ if (fPalette == p) return;
+ if (fPalette) fPalette->DecRefCount();
+ fPalette = p;
+ if (fPalette) fPalette->IncRefCount();
+}
+
+RGBAPalette* DigitSet::AssertPalette()
+{
+ if (fPalette == 0) {
+ fPalette = new RGBAPalette;
+ if (!fValueIsColor) {
+ Int_t min, max;
+ ScanMinMaxValues(min, max);
+ fPalette->SetLimits(min, max);
+ fPalette->SetMinMax(min, max);
+ }
+ }
+ return fPalette;
+}
--- /dev/null
+// $Header$
+
+#ifndef REVE_DigitSetBase_H
+#define REVE_DigitSetBase_H
+
+#include <TNamed.h>
+#include <TQObject.h>
+#include <TAtt3D.h>
+#include <TAttBBox.h>
+
+#include <Reve/Reve.h>
+#include <Reve/RenderElement.h>
+#include <Reve/FrameBox.h>
+#include <Reve/RGBAPalette.h>
+#include <Reve/Plex.h>
+#include <Reve/ZTrans.h>
+
+#include <TObject.h>
+
+namespace Reve {
+
+class DigitSet : public RenderElement,
+ public TNamed, public TQObject,
+ public TAtt3D,
+ public TAttBBox
+{
+ friend class DigitSetEditor;
+
+ DigitSet(const DigitSet&); // Not implemented
+ DigitSet& operator=(const DigitSet&); // Not implemented
+
+public:
+ enum RenderMode_e { RM_AsIs, RM_Line, RM_Fill };
+
+protected:
+ struct DigitBase
+ {
+ Int_t fValue;
+ TRef fId;
+
+ // Here could have additional integer (like time, second threshold).
+
+ DigitBase(Int_t v=0) : fValue(v), fId() {}
+ };
+
+ Int_t fDefaultValue;
+ Bool_t fValueIsColor;
+ Bool_t fOwnIds; //Flag specifying if id-objects are owned by the DigitSet
+ VoidCPlex fPlex;
+ DigitBase* fLastDigit; //!
+
+ FrameBox* fFrame;
+ RGBAPalette* fPalette;
+ RenderMode_e fRenderMode;
+ Bool_t fDisableLigting;
+ Bool_t fEmitSignals;
+ Bool_t fHistoButtons;
+ ZTrans fHMTrans;
+
+ DigitBase* NewDigit();
+ void ReleaseIds();
+
+public:
+ DigitSet(const Text_t* n="DigitSet", const Text_t* t="");
+ virtual ~DigitSet();
+
+ virtual Bool_t CanEditMainColor() { return kTRUE; }
+ virtual void SetMainColor(Color_t color);
+
+ // virtual void Reset(QuadType_e quadType, Bool_t valIsCol, Int_t chunkSize);
+
+ void RefitPlex();
+ void ScanMinMaxValues(Int_t& min, Int_t& max);
+
+ // --------------------------------
+
+ void DigitValue(Int_t value);
+ void DigitColor(Color_t ci);
+ void DigitColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255);
+ void DigitColor(UChar_t* rgba);
+
+ void DigitId(TObject* id);
+
+ Bool_t GetOwnIds() const { return fOwnIds; }
+ void SetOwnIds(Bool_t o) { fOwnIds = o; }
+
+ DigitBase* GetDigit(Int_t n) { return (DigitBase*) fPlex.Atom(n); }
+ TObject* GetId(Int_t n) { return GetDigit(n)->fId.GetObject(); }
+
+ // --------------------------------
+
+ // virtual void ComputeBBox(); // implement in subclass
+ virtual void Paint(Option_t* option="");
+
+ virtual void DigitSelected(Int_t idx);
+ virtual void CtrlClicked(DigitSet* qs, Int_t idx); // *SIGNAL*
+
+ // --------------------------------
+
+ VoidCPlex* GetPlex() { return &fPlex; }
+
+ FrameBox* GetFrame() const { return fFrame; }
+ void SetFrame(FrameBox* b);
+
+ Bool_t GetValueIsColor() const { return fValueIsColor; }
+
+ RGBAPalette* GetPalette() const { return fPalette; }
+ void SetPalette(RGBAPalette* p);
+ RGBAPalette* AssertPalette();
+
+ RenderMode_e GetRenderMode() const { return fRenderMode; }
+ void SetRenderMode(RenderMode_e rm) { fRenderMode = rm; }
+
+ Bool_t GetEmitSignals() const { return fEmitSignals; }
+ void SetEmitSignals(Bool_t f) { fEmitSignals = f; }
+
+ Bool_t GetHistoButtons() const { return fHistoButtons; }
+ void SetHistoButtons(Bool_t f) { fHistoButtons = f; }
+
+ ZTrans& RefHMTrans() { return fHMTrans; }
+ void SetTransMatrix(Double_t* carr) { fHMTrans.SetFrom(carr); }
+ void SetTransMatrix(const TGeoMatrix& mat) { fHMTrans.SetFrom(mat); }
+
+ ClassDef(DigitSet, 1);
+}; // endclass DigitSet
+
+}
+
+#endif
--- /dev/null
+// $Header$
+
+#include "DigitSetEditor.h"
+#include <Reve/DigitSet.h>
+
+#include <Reve/RGValuators.h>
+#include <Reve/ZTransEditor.h>
+#include <Reve/RGBAPaletteEditor.h>
+#include <Reve/RGEditor.h>
+
+#include <TVirtualPad.h>
+#include <TColor.h>
+#include <TH1F.h>
+#include <TStyle.h>
+
+#include <TGLabel.h>
+#include <TG3DLine.h>
+#include <TGButton.h>
+#include <TGNumberEntry.h>
+#include <TGColorSelect.h>
+#include <TGDoubleSlider.h>
+
+using namespace Reve;
+
+//______________________________________________________________________
+// DigitSetEditor
+//
+
+ClassImp(DigitSetEditor)
+
+DigitSetEditor::DigitSetEditor(const TGWindow *p, Int_t width, Int_t height,
+ UInt_t options, Pixel_t back) :
+ TGedFrame(p, width, height, options | kVerticalFrame, back),
+ fM(0),
+ fHMTrans (0),
+ fPalette (0),
+
+ fHistoButtFrame(0),
+ fInfoFrame(0)
+{
+ MakeTitle("Transformation matrix");
+
+ fHMTrans = new ZTransSubEditor(this);
+ fHMTrans->Connect("UseTrans()", "Reve::DigitSetEditor", this, "Update()");
+ fHMTrans->Connect("TransChanged()", "Reve::DigitSetEditor", this, "Update()");
+ AddFrame(fHMTrans, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0));
+
+
+ MakeTitle("Palette controls");
+
+ fPalette = new RGBAPaletteSubEditor(this);
+ fPalette->Connect("Changed", "Reve::DigitSetEditor", this, "Update()");
+ AddFrame(fPalette, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0));
+
+ CreateInfoTab();
+}
+
+DigitSetEditor::~DigitSetEditor()
+{}
+
+/*************************************************************************/
+void DigitSetEditor::CreateInfoTab()
+{
+
+ fInfoFrame = CreateEditorTabSubFrame("Info");
+
+ TGCompositeFrame *title1 = new TGCompositeFrame(fInfoFrame, 180, 10,
+ kHorizontalFrame |
+ kLHintsExpandX |
+ kFixedWidth |
+ kOwnBackground);
+
+ title1->AddFrame(new TGLabel(title1, "DigitSet Info"),
+ new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
+ title1->AddFrame(new TGHorizontal3DLine(title1),
+ new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
+ fInfoFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
+
+
+ fHistoButtFrame = new TGHorizontalFrame(fInfoFrame);
+ TGTextButton* b = 0;
+ b = new TGTextButton(fHistoButtFrame, "Histo");
+ b->SetToolTipText("Show histogram over full range.");
+ fHistoButtFrame->AddFrame(b, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 1, 1, 0, 0));
+ b->Connect("Clicked()", "Reve::DigitSetEditor", this, "DoHisto()");
+
+ b = new TGTextButton(fHistoButtFrame, "Range Histo");
+ b->SetToolTipText("Show histogram over selected range.");
+ fHistoButtFrame->AddFrame(b, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 1, 1, 0, 0));
+ b->Connect("Clicked()", "Reve::DigitSetEditor", this, "DoRangeHisto()");
+ fInfoFrame->AddFrame(fHistoButtFrame, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
+}
+
+/**************************************************************************/
+
+void DigitSetEditor::SetModel(TObject* obj)
+{
+ fM = dynamic_cast<DigitSet*>(obj);
+
+ fHMTrans->SetDataFromTrans(&fM->fHMTrans);
+
+ if (fM->fValueIsColor || fM->fPalette == 0) {
+ fPalette->UnmapWindow();
+ } else {
+ fPalette->SetModel(fM->fPalette);
+ fPalette->MapWindow();
+ }
+
+ // Set values of widgets
+ // fXYZZ->SetValue(fM->GetXYZZ());
+
+ if (fM->fHistoButtons)
+ fHistoButtFrame->MapWindow();
+ else
+ fHistoButtFrame->UnmapWindow();
+}
+
+/**************************************************************************/
+
+void DigitSetEditor::DoHisto()
+{
+ Int_t min, max;
+ if (fM->fPalette) {
+ min = fM->fPalette->GetLowLimit();
+ max = fM->fPalette->GetHighLimit();
+ } else {
+ fM->ScanMinMaxValues(min, max);
+ }
+ PlotHisto(min, max);
+}
+
+void DigitSetEditor::DoRangeHisto()
+{
+ Int_t min, max;
+ if (fM->fPalette) {
+ min = fM->fPalette->GetMinVal();
+ max = fM->fPalette->GetMaxVal();
+ } else {
+ fM->ScanMinMaxValues(min, max);
+ }
+ PlotHisto(min, max);
+}
+
+void DigitSetEditor::PlotHisto(Int_t min, Int_t max)
+{
+ Int_t nbins = max-min+1;
+ while (nbins > 200)
+ nbins /= 2;
+
+ TH1F* h = new TH1F(fM->GetName(), fM->GetTitle(), nbins, min-0.5, max+0.5);
+ h->SetDirectory(0);
+ h->SetBit(kCanDelete);
+ VoidCPlex::iterator qi(fM->fPlex);
+ while (qi.next())
+ h->Fill(((DigitSet::DigitBase*)qi())->fValue);
+
+ gStyle->SetOptStat(1111111);
+ h->Draw();
+ gPad->Modified();
+ gPad->Update();
+}
--- /dev/null
+// $Header$
+
+#ifndef REVE_DigitSetEditor_H
+#define REVE_DigitSetEditor_H
+
+#include <TGedFrame.h>
+
+class TGCheckButton;
+class TGNumberEntry;
+class TGColorSelect;
+
+namespace Reve {
+
+class DigitSet;
+
+class RGValuator;
+class RGDoubleValuator;
+class ZTransSubEditor;
+
+// It would be better to have button to change model to the palette
+// object itself.
+class RGBAPaletteSubEditor;
+
+class DigitSetEditor : public TGedFrame
+{
+private:
+ DigitSetEditor(const DigitSetEditor&); // Not implemented
+ DigitSetEditor& operator=(const DigitSetEditor&); // Not implemented
+
+ void CreateInfoTab();
+protected:
+ DigitSet* fM; // fModel dynamic-casted to DigitSetEditor
+
+ ZTransSubEditor* fHMTrans;
+ RGBAPaletteSubEditor* fPalette;
+
+ TGHorizontalFrame* fHistoButtFrame;
+ TGVerticalFrame* fInfoFrame;
+
+public:
+ DigitSetEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
+ virtual ~DigitSetEditor();
+
+ virtual void SetModel(TObject* obj);
+
+ // Declare callback/slot methods
+ void DoHisto();
+ void DoRangeHisto();
+ void PlotHisto(Int_t min, Int_t max);
+
+ ClassDef(DigitSetEditor, 1); // Editor for DigitSet
+}; // endclass DigitSetEditor
+
+}
+
+#endif
#include "EventBase.h"
+#include <TObjString.h>
+#include <TCint.h>
+
using namespace Reve;
//______________________________________________________________________
-// Event
+// Reve::EventBase
//
ClassImp(EventBase)
EventBase::EventBase(const Text_t* n, const Text_t* t) :
- PadPrimitive(n, t)
+ RenderElementList(n, t),
+ fNewEventCommands()
{}
+
+/**************************************************************************/
+
+void EventBase::AfterNewEventLoaded()
+{
+ TIter next(&fNewEventCommands);
+ TObject* o;
+ while ((o = next())) {
+ TObjString* s = dynamic_cast<TObjString*>(o);
+ if (s)
+ gInterpreter->ProcessLine(s->String());
+ }
+}
+
+void EventBase::AddNewEventCommand(const Text_t* cmd)
+{
+ fNewEventCommands.Add(new TObjString(cmd));
+}
#include <Reve/RenderElement.h>
+#include <TList.h>
+
namespace Reve {
-class EventBase : public PadPrimitive
+class EventBase : public RenderElementList
{
protected:
+ TList fNewEventCommands;
public:
EventBase(const Text_t* n="EventBase", const Text_t* t="");
virtual ~EventBase() {}
+ TList& GetNewEventCommands() { return fNewEventCommands; }
+
+ virtual void Open() {}
+ virtual void GotoEvent(Int_t /*event*/) {}
+ virtual void NextEvent() {}
+ virtual void PrevEvent() {}
+ virtual void Close() {}
+
+ virtual void AfterNewEventLoaded();
+ virtual void AddNewEventCommand(const Text_t* cmd);
+
+
ClassDef(EventBase, 1);
}; // endclass Event
fFrameSize (0),
fFramePoints (0),
- fFrameColor (0)
+ fFrameWidth (1),
+ fFrameColor (1),
+ fBackColor (0),
+ fFrameFill (kFALSE),
+ fDrawBack (kFALSE)
{
- fFrameRGBA[0] = fFrameRGBA[1] = fFrameRGBA[2] = fFrameRGBA[3] = 255;
+ fFrameRGBA[0] = fFrameRGBA[1] = fFrameRGBA[2] = 0; fFrameRGBA[3] = 255;
+ fBackRGBA [0] = fBackRGBA [1] = fBackRGBA [2] = 255; fBackRGBA [3] = 255;
}
FrameBox::~FrameBox()
fFrameRGBA[2] = b;
fFrameRGBA[3] = a;
}
+
+/**************************************************************************/
+
+void FrameBox::SetBackColor(Color_t ci)
+{
+ fBackColor = ci;
+ ColorFromIdx(ci, fBackRGBA, kTRUE);
+}
+
+void FrameBox::SetBackColor(Pixel_t pix)
+{
+ SetBackColor(Color_t(TColor::GetColor(pix)));
+}
+
+void FrameBox::SetBackColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a)
+{
+ fBackColor = Color_t(TColor::GetColor(r, g, b));
+ fBackRGBA[0] = r;
+ fBackRGBA[1] = g;
+ fBackRGBA[2] = b;
+ fBackRGBA[3] = a;
+}
Int_t fFrameSize;
Float_t *fFramePoints; //[fFrameSize]
+ Float_t fFrameWidth;
Color_t fFrameColor;
+ Color_t fBackColor;
UChar_t fFrameRGBA[4];
+ UChar_t fBackRGBA[4];
+ Bool_t fFrameFill;
+ Bool_t fDrawBack;
public:
FrameBox();
Int_t GetFrameSize() const { return fFrameSize; }
Float_t* GetFramePoints() const { return fFramePoints; }
+ Float_t GetFrameWidth() const { return fFrameWidth; }
+ void SetFrameWidth(Float_t f) { fFrameWidth = f; }
+
Color_t GetFrameColor() const { return fFrameColor; }
Color_t* PtrFrameColor() { return &fFrameColor; }
UChar_t* GetFrameRGBA() { return fFrameRGBA; }
void SetFrameColor(Pixel_t pix);
void SetFrameColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255);
+ Color_t GetBackColor() const { return fBackColor; }
+ Color_t* PtrBackColor() { return &fBackColor; }
+ UChar_t* GetBackRGBA() { return fBackRGBA; }
+
+ void SetBackColor(Color_t ci);
+ void SetBackColor(Pixel_t pix);
+ void SetBackColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255);
+
+ Bool_t GetFrameFill() const { return fFrameFill; }
+ void SetFrameFill(Bool_t f) { fFrameFill = f; }
+
+ Bool_t GetDrawBack() const { return fDrawBack; }
+ void SetDrawBack(Bool_t f) { fDrawBack = f; }
+
ClassDef(FrameBox, 1);
}; // endclass FrameBox
#include <TGLIncludes.h>
+#include <TMath.h>
+
using namespace Reve;
//______________________________________________________________________
ClassImp(FrameBoxGL)
-void FrameBoxGL::Render(const FrameBox* box)
+void FrameBoxGL::RenderFrame(const FrameBox& b, Bool_t fillp)
{
- GLboolean lightp;
- glGetBooleanv(GL_LIGHTING, &lightp);
- if (lightp) glDisable(GL_LIGHTING);
-
- const FrameBox& b = *box;
const Float_t* p = b.fFramePoints;
- glColor4ubv(b.fFrameRGBA);
+
if (b.fFrameType == FrameBox::FT_Quad)
{
- glBegin(GL_LINE_LOOP);
+ glBegin(fillp ? GL_POLYGON : GL_LINE_LOOP);
glVertex3fv(p); glVertex3fv(p + 3);
glVertex3fv(p + 6); glVertex3fv(p + 9);
glEnd();
}
else if (b.fFrameType == FrameBox::FT_Box)
{
+ // !!! frame-fill not implemented for 3D frame.
glBegin(GL_LINE_STRIP);
glVertex3fv(p); glVertex3fv(p + 3);
glVertex3fv(p + 6); glVertex3fv(p + 9);
glVertex3fv(p + 9); glVertex3fv(p + 21);
glEnd();
}
+}
+
+void FrameBoxGL::Render(const FrameBox* box)
+{
+ const FrameBox& b = *box;
+
+ glPushAttrib(GL_POLYGON_BIT | GL_LINE_BIT | GL_ENABLE_BIT);
+
+ glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
+ glEnable(GL_COLOR_MATERIAL);
+ glDisable(GL_CULL_FACE);
+
+ if (b.fFrameType == FrameBox::FT_Quad && b.fDrawBack)
+ {
+ GLboolean lmts;
+ glGetBooleanv(GL_LIGHT_MODEL_TWO_SIDE, &lmts);
+ if (!lmts) glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
+
+ glEnable(GL_POLYGON_OFFSET_FILL);
+ glPolygonOffset(2, 2);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+
+ const Float_t* p = b.fFramePoints;
+ Float_t normal[3];
+ TMath::Normal2Plane(p, p+3, p+6, normal);
+ glNormal3fv(normal);
+
+ glColor4ubv(b.fBackRGBA);
+ RenderFrame(b, kTRUE);
+
+ if (!lmts) glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
+ }
+
+ glDisable(GL_LIGHTING);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_LINE_SMOOTH);
+
+ glLineWidth(b.fFrameWidth);
+ glColor4ubv(b.fFrameRGBA);
+ RenderFrame(b, b.fFrameFill);
- if (lightp) glEnable(GL_LIGHTING);
+ glPopAttrib();
}
FrameBoxGL(const FrameBoxGL&); // Not implemented
FrameBoxGL& operator=(const FrameBoxGL&); // Not implemented
+ static void RenderFrame(const FrameBox& b, Bool_t fillp);
+
public:
+ virtual ~FrameBoxGL() {}
+
static void Render(const FrameBox* box);
ClassDef(FrameBoxGL, 0);
#include "GLUtilNS.h"
+#include "Reve.h"
#include <TAttMarker.h>
+#include <TAttLine.h>
#include <TGLIncludes.h>
namespace GLUtilNS {
-void RenderPolyMarkers(TAttMarker& marker, Float_t* p, Int_t n,
+void RenderLine(const TAttLine& aline, Float_t* p, Int_t n,
+ Bool_t /*selection*/, Bool_t /*sec_selection*/)
+{
+ if(n == 0) return;
+
+ glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT);
+ glDisable(GL_LIGHTING);
+ glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
+ glEnable(GL_COLOR_MATERIAL);
+ UChar_t color[4];
+ Reve::ColorFromIdx(aline.GetLineColor(), color);
+ glColor4ubv(color);
+ glLineWidth(aline.GetLineWidth());
+ if (aline.GetLineStyle() > 1) {
+ Int_t fac = 1;
+ UShort_t pat = 0xffff;
+ switch (aline.GetLineStyle()) {
+ case 2: pat = 0x3333; break;
+ case 3: pat = 0x5555; break;
+ case 4: pat = 0xf040; break;
+ case 5: pat = 0xf4f4; break;
+ case 6: pat = 0xf111; break;
+ case 7: pat = 0xf0f0; break;
+ case 8: pat = 0xff11; break;
+ case 9: pat = 0x3fff; break;
+ case 10: pat = 0x08ff; fac = 2; break;
+ }
+
+ glLineStipple(1, pat);
+ glEnable(GL_LINE_STIPPLE);
+ }
+
+ Float_t* tp = p;
+ glBegin(GL_LINE_STRIP);
+ for (Int_t i=0; i<n; ++i, tp+=3)
+ glVertex3fv(tp);
+ glEnd();
+
+ glPopAttrib();
+}
+
+void RenderPolyMarkers(const TAttMarker& marker, Float_t* p, Int_t n,
Bool_t selection, Bool_t sec_selection)
{
// Store attributes GL_POINT_BIT and GL_LINE_BIT before call this function !
+ glPushAttrib(GL_ENABLE_BIT |GL_POINT_BIT | GL_LINE_BIT);
+ glDisable(GL_LIGHTING);
+ glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE);
+ glEnable(GL_COLOR_MATERIAL);
+ UChar_t color[4];
+ Reve::ColorFromIdx(marker.GetMarkerColor(), color);
+ glColor4ubv(color);
Int_t s = marker.GetMarkerStyle();
if (s == 2 || s == 3 || s == 5 || s == 28)
RenderCrosses(marker, p, n, sec_selection);
else
RenderPoints(marker, p, n, selection, sec_selection);
+
+ glPopAttrib();
}
//______________________________________________________________________________
-void RenderPoints(TAttMarker& marker, Float_t* p, Int_t n,
+void RenderPoints(const TAttMarker& marker, Float_t* op, Int_t n,
Bool_t selection, Bool_t sec_selection)
{
// Render markers as circular or square points.
+
+ Int_t ms = marker.GetMarkerStyle();
+ Float_t size = 5*marker.GetMarkerSize();
+ if (ms == 4 || ms == 20 || ms == 24)
{
- Int_t ms = marker.GetMarkerStyle();
- Float_t size = 5*marker.GetMarkerSize();
- if (ms == 4 || ms == 20 || ms == 24)
- {
- if (ms == 4 || ms == 24)
- glEnable(GL_BLEND);
- glEnable(GL_POINT_SMOOTH);
- } else
- {
- glDisable(GL_POINT_SMOOTH);
- if (ms == 1) size = 1;
- else if (ms == 6) size = 2;
- else if (ms == 7) size = 3;
- }
- glPointSize(size);
+ if (ms == 4 || ms == 24)
+ glEnable(GL_BLEND);
+ glEnable(GL_POINT_SMOOTH);
+ } else
+ {
+ glDisable(GL_POINT_SMOOTH);
+ if (ms == 1) size = 1;
+ else if (ms == 6) size = 2;
+ else if (ms == 7) size = 3;
+ }
+ glPointSize(size);
- // During selection extend picking region for large point-sizes.
- static const Int_t sPickRadius = 3; // Hardcoded also in TGLViewer::RequestSelect()
- Bool_t changePM = kFALSE;
- if (selection && size > sPickRadius)
- {
- changePM = kTRUE;
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- Float_t pm[16];
- glGetFloatv(GL_PROJECTION_MATRIX, pm);
- Float_t scale = (Float_t) sPickRadius / size;
- for (Int_t i=0; i<=12; i+=4) {
- pm[i] *= scale; pm[i+1] *= scale;
- }
- glLoadMatrixf(pm);
+ // During selection extend picking region for large point-sizes.
+ static const Int_t sPickRadius = 3; // Hardcoded also in TGLViewer::RequestSelect()
+ Bool_t changePM = kFALSE;
+ if (selection && size > sPickRadius)
+ {
+ changePM = kTRUE;
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ Float_t pm[16];
+ glGetFloatv(GL_PROJECTION_MATRIX, pm);
+ Float_t scale = (Float_t) sPickRadius / size;
+ for (Int_t i=0; i<=12; i+=4) {
+ pm[i] *= scale; pm[i+1] *= scale;
}
+ glLoadMatrixf(pm);
+ }
- if (sec_selection)
+ Float_t* p = op;
+ if (sec_selection)
+ {
+ glPushName(0);
+ for (Int_t i=0; i<n; ++i, p+=3)
{
- glPushName(0);
- for (Int_t i=0; i<n; ++i, p+=3)
+ glLoadName(i);
+ glBegin(GL_POINTS);
+ glVertex3fv(p);
+ glEnd();
+ }
+ glPopName();
+ }
+ else
+ {
+ glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
+ glVertexPointer(3, GL_FLOAT, 0, p);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ { // Circumvent bug in ATI's linux drivers.
+ Int_t nleft = n;
+ Int_t ndone = 0;
+ const Int_t maxChunk = 8192;
+ while (nleft > maxChunk)
{
- glLoadName(i);
- glBegin(GL_POINTS);
- glVertex3fv(p);
- glEnd();
- }
- glPopName();
- }
- else
- {
- glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
- glVertexPointer(3, GL_FLOAT, 0, p);
- glEnableClientState(GL_VERTEX_ARRAY);
- { // Circumvent bug in ATI's linux drivers.
- Int_t nleft = n;
- Int_t ndone = 0;
- const Int_t maxChunk = 8192;
- while (nleft > maxChunk)
- {
- glDrawArrays(GL_POINTS, ndone, maxChunk);
- nleft -= maxChunk;
- ndone += maxChunk;
- }
- glDrawArrays(GL_POINTS, ndone, nleft);
+ glDrawArrays(GL_POINTS, ndone, maxChunk);
+ nleft -= maxChunk;
+ ndone += maxChunk;
}
- glPopClientAttrib();
+ glDrawArrays(GL_POINTS, ndone, nleft);
}
+ glPopClientAttrib();
+ }
- if (changePM)
- {
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- }
+ if (changePM)
+ {
+ glPopMatrix();
+ glMatrixMode(GL_MODELVIEW);
}
+
}
//______________________________________________________________________________
-void RenderCrosses(TAttMarker& marker, Float_t* p, Int_t n,
+void RenderCrosses(const TAttMarker& marker, Float_t* op, Int_t n,
Bool_t sec_selection)
{
// Render markers as crosses.
}
// cross dim
- const Float_t d = marker.GetMarkerSize();
+ const Float_t d = 2*marker.GetMarkerSize();
+ Float_t* p = op;
if (sec_selection)
{
glPushName(0);
#include <TObject.h>
class TAttMarker;
+class TAttLine;
namespace GLUtilNS
{
{ if(fFlip) fFoo(fState); }
};
+void RenderLine(const TAttLine& al, Float_t* p, Int_t n,
+ Bool_t selection=kFALSE, Bool_t sec_selection=kFALSE);
-void RenderPolyMarkers(TAttMarker& marker, Float_t* p, Int_t n,
- Bool_t selection, Bool_t sec_selection);
+void RenderPolyMarkers(const TAttMarker& marker, Float_t* p, Int_t n,
+ Bool_t selection=kFALSE, Bool_t sec_selection=kFALSE);
-void RenderPoints(TAttMarker& marker, Float_t* p, Int_t n,
- Bool_t selection, Bool_t sec_selection);
+void RenderPoints(const TAttMarker& marker, Float_t* p, Int_t n,
+ Bool_t selection=kFALSE, Bool_t sec_selection=kFALSE);
-void RenderCrosses(TAttMarker& marker, Float_t* p, Int_t n, Bool_t sec_selection);
+void RenderCrosses(const TAttMarker& marker, Float_t* p, Int_t n, Bool_t sec_selection=kFALSE);
}
// $Header$
#include "GeoNode.h"
-#include <Reve/RGTopFrame.h>
+#include <Reve/ReveManager.h>
+#include <Reve/NLTBases.h>
#include "TGeoShapeExtract.h"
#include <TGeoShape.h>
#include <TGeoVolume.h>
#include <TGeoNode.h>
+#include <TGeoShapeAssembly.h>
#include <TGeoManager.h>
#include <TVirtualGeoPainter.h>
GeoTopNodeRnrEl::GeoTopNodeRnrEl(TGeoManager* manager, TGeoNode* node,
Int_t visopt, Int_t vislvl) :
GeoNodeRnrEl (node),
- fGlobalTrans (),
fManager (manager),
+ fGlobalTrans (),
fVisOption (visopt),
fVisLevel (vislvl)
{
gPad = pad;
TVirtualGeoPainter* vgp = fManager->GetGeomPainter();
if(vgp != 0) {
-#if ROOT_VERSION_CODE > ROOT_VERSION(5,11,6)
TGeoHMatrix geomat;
fGlobalTrans.SetGeoHMatrix(geomat);
vgp->PaintNode(fNode, option, &geomat);
-#else
- vgp->PaintNode(fNode, option);
-#endif
}
fManager->SetTopVolume(top_volume);
}
buff.fColor = fColor;
buff.fTransparency = fTransparency;
fHMTrans.SetBuffer3D(buff);
+ buff.fLocalFrame = kTRUE; // Always enforce local frame (no geo manager).
fShape->GetBuffer3D(TBuffer3D::kBoundingBox | TBuffer3D::kShapeSpecific, true);
/**************************************************************************/
-Int_t GeoShapeRnrEl::ImportShapeExtract(TGeoShapeExtract * gse,
+GeoShapeRnrEl* GeoShapeRnrEl::ImportShapeExtract(TGeoShapeExtract * gse,
RenderElement * parent)
{
gReve->DisableRedraw();
- Int_t n = SubImportShapeExtract(gse, parent);
- printf ("GeoShapeRnrEl::ImportShapeExtract imported %d elements\n", n);
+ GeoShapeRnrEl* gsre = SubImportShapeExtract(gse, parent);
+ gsre->ElementChanged();
gReve->EnableRedraw();
- return n;
+ return gsre;
}
-Int_t GeoShapeRnrEl::SubImportShapeExtract(TGeoShapeExtract * gse,
+
+GeoShapeRnrEl* GeoShapeRnrEl::SubImportShapeExtract(TGeoShapeExtract * gse,
RenderElement * parent)
{
- Int_t ncreated = 1;
-
GeoShapeRnrEl* gsre = new GeoShapeRnrEl(gse->GetName(), gse->GetTitle());
gsre->fHMTrans.SetFromArray(gse->GetTrans());
const Float_t* rgba = gse->GetRGBA();
if (gsre->fShape)
gsre->fShape->SetUniqueID(gsre->fShape->GetUniqueID() + 1);
- if (parent)
- gReve->AddGlobalRenderElement(parent, gsre);
- else
- gReve->AddGlobalRenderElement(gsre);
+ gReve->AddGlobalRenderElement(gsre, parent);
if (gse->HasElements())
{
TIter next(gse->GetElements());
TGeoShapeExtract* chld;
while ((chld = (TGeoShapeExtract*) next()) != 0)
- ncreated += SubImportShapeExtract(chld, gsre);
+ SubImportShapeExtract(chld, gsre);
}
- return ncreated;
+ return gsre;
+}
+
+/**************************************************************************/
+
+TBuffer3D* GeoShapeRnrEl::MakeBuffer3D()
+{
+ if(fShape == 0) return 0;
+
+ if(dynamic_cast<TGeoShapeAssembly*>(fShape)){
+ // !!!! TGeoShapeAssembly makes a bad TBuffer3D
+ return 0;
+ }
+
+ TBuffer3D* buff = fShape->MakeBuffer3D();
+ if (fHMTrans.GetUseTrans())
+ {
+ Reve::ZTrans& mx = RefHMTrans();
+ Int_t N = buff->NbPnts();
+ Double_t* pnts = buff->fPnts;
+ for(Int_t k=0; k<N; k++)
+ {
+ mx.MultiplyIP(&pnts[3*k]);
+ }
+ }
+ return buff;
}
#include <Reve/RenderElement.h>
#include <Reve/ZTrans.h>
+#include <Reve/NLTBases.h>
class TGeoVolume;
class TGeoNode;
//----------------------------------------------------------------
class GeoShapeRnrEl : public RenderElement,
- public TNamed
+ public TNamed,
+ public NLTGeoProjectable
{
GeoShapeRnrEl(const GeoShapeRnrEl&); // Not implemented
GeoShapeRnrEl& operator=(const GeoShapeRnrEl&); // Not implemented
UChar_t fTransparency;
TGeoShape* fShape;
- static Int_t SubImportShapeExtract(TGeoShapeExtract* gse, RenderElement* parent);
+ static GeoShapeRnrEl* SubImportShapeExtract(TGeoShapeExtract* gse, RenderElement* parent);
public:
GeoShapeRnrEl(const Text_t* name="GeoShapeRnrEl", const Text_t* title=0);
virtual void Paint(Option_t* option="");
- static Int_t ImportShapeExtract(TGeoShapeExtract* gse, RenderElement* parent);
+ static GeoShapeRnrEl* ImportShapeExtract(TGeoShapeExtract* gse, RenderElement* parent);
+
+ // NLTGeoProjectable
+ virtual TBuffer3D* MakeBuffer3D();
ClassDef(GeoShapeRnrEl, 1);
};
// $Header$
-#include "RGeoNodeEditors.h"
+#include "GeoNodeEditor.h"
+#include "RGValuators.h"
#include <Reve/GeoNode.h>
#include <TGeoNode.h>
{
MakeTitle("GeoTopNode");
- {
- TGHorizontalFrame* f = new TGHorizontalFrame(this);
- TGLabel *l = new TGLabel(f, "VisOption:");
- f->AddFrame(l, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1, 2, 1, 1));
- fVisOption = new TGNumberEntry(f, 0., 6, -1,
- TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative,
- TGNumberFormat::kNELLimitMinMax, 0, 3);
- fVisOption->GetNumberEntry()->SetToolTipText("0 ~ all final nodes, 1 ~ pure leaves only, 2 ~ path (?)");
- f->AddFrame(fVisOption, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
- fVisOption->Associate(f);
- fVisOption->Connect("ValueSet(Long_t)",
- "Reve::GeoTopNodeRnrElEditor", this, "DoVisOption()");
- AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
- }
-
- {
- TGHorizontalFrame* f = new TGHorizontalFrame(this);
- TGLabel *l = new TGLabel(f, "VisLevel:");
- f->AddFrame(l, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1, 2, 1, 1));
- fVisLevel = new TGNumberEntry(f, 0., 6, -1,
- TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative,
- TGNumberFormat::kNELLimitMinMax, 0, 128);
- fVisLevel->GetNumberEntry()->SetToolTipText("");
- f->AddFrame(fVisLevel, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1));
- fVisLevel->Associate(f);
- fVisLevel->Connect("ValueSet(Long_t)",
- "Reve::GeoTopNodeRnrElEditor", this, "DoVisLevel()");
- AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
- }
+ Int_t labelW = 58;
+
+ fVisOption = new RGValuator(this, "VisOption:", 90, 0);
+ fVisOption->SetLabelWidth(labelW);
+ fVisOption->SetShowSlider(kFALSE);
+ fVisOption->SetNELength(4);
+ fVisOption->Build();
+ fVisOption->SetLimits(0, 2, 10, TGNumberFormat::kNESInteger);
+ fVisOption->SetToolTip("Visualization option passed to TGeoPainter.");
+ fVisOption->Connect("ValueSet(Double_t)", "Reve::GeoTopNodeRnrElEditor", this, "DoVisOption()");
+ AddFrame(fVisOption, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+
+ fVisLevel = new RGValuator(this, "VisLevel:", 90, 0);
+ fVisLevel->SetLabelWidth(labelW);
+ fVisLevel->SetShowSlider(kFALSE);
+ fVisLevel->SetNELength(4);
+ fVisLevel->Build();
+ fVisLevel->SetLimits(0, 10, 10, TGNumberFormat::kNESInteger);
+ fVisLevel->SetToolTip("Level (depth) to which the geometry is traversed.");
+ fVisLevel->Connect("ValueSet(Double_t)", "Reve::GeoTopNodeRnrElEditor", this, "DoVisLevel()");
+ AddFrame(fVisLevel, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
}
/**************************************************************************/
{
fTopNodeRE = dynamic_cast<GeoTopNodeRnrEl*>(obj);
- fVisOption->SetNumber(fTopNodeRE->GetVisOption());
- fVisLevel->SetNumber(fTopNodeRE->GetVisLevel());
+ fVisOption->SetValue(fTopNodeRE->GetVisOption());
+ fVisLevel ->SetValue(fTopNodeRE->GetVisLevel());
}
/**************************************************************************/
void GeoTopNodeRnrElEditor::DoVisOption()
{
- fTopNodeRE->SetVisOption(Int_t(fVisOption->GetNumber()));
+ fTopNodeRE->SetVisOption(Int_t(fVisOption->GetValue()));
+ Update();
}
void GeoTopNodeRnrElEditor::DoVisLevel()
{
- fTopNodeRE->SetVisLevel(Int_t(fVisLevel->GetNumber()));
+ fTopNodeRE->SetVisLevel(Int_t(fVisLevel->GetValue()));
+ Update();
}
// $Header$
-#ifndef REVE_RGeoNodeEditors_H
-#define REVE_RGeoNodeEditors_H
+#ifndef REVE_GeoNodeEditor_H
+#define REVE_GeoNodeEditor_H
#include <TGedFrame.h>
class GeoNodeRnrEl;
class GeoTopNodeRnrEl;
+class RGValuator;
class GeoNodeRnrElEditor : public TGedFrame
{
protected:
GeoTopNodeRnrEl* fTopNodeRE;
- TGNumberEntry* fVisOption;
- TGNumberEntry* fVisLevel;
+ Reve::RGValuator* fVisOption;
+ Reve::RGValuator* fVisLevel;
public:
GeoTopNodeRnrElEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
{ Nx = nx; Ny = ny; Nz = nz; }
void SetDs(Float_t dx, Float_t dy, Float_t dz=0)
{ Dx = dx; Dy = dy; Dz = dz; }
+ void SetOs(Float_t ox, Float_t oy, Float_t oz=0)
+ { Ox = ox; Oy = oy; Oz = oz; }
bool Step();
--- /dev/null
+// $Header$
+
+#include "GridStepperEditor.h"
+#include <Reve/GridStepper.h>
+#include <Reve/RGValuators.h>
+
+#include <TVirtualPad.h>
+#include <TColor.h>
+
+#include <TGLabel.h>
+#include <TGSlider.h>
+#include <TGButton.h>
+#include <TGNumberEntry.h>
+
+using namespace Reve;
+
+//______________________________________________________________________
+// GridStepperSubEditor
+//
+//
+
+ClassImp(GridStepperSubEditor)
+
+//______________________________________________________________________
+GridStepperSubEditor::GridStepperSubEditor(const TGWindow *p) :
+ TGVerticalFrame(p),
+ fM (0),
+
+ fNx (0),
+ fNy (0),
+ fNz (0),
+ fDx (0),
+ fDy (0),
+ fDz (0)
+{
+ Int_t labelW = 15;
+
+ TGHorizontalFrame* VF = new TGHorizontalFrame(this);
+
+ {
+ TGGroupFrame* f = new TGGroupFrame(VF, "NumRows", kVerticalFrame);
+ f->SetWidth(30);
+ VF->AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
+
+ fNx = new RGValuator(f,"X:", 200, 0);
+ fNx->SetNELength(3);
+ fNx->SetLabelWidth(labelW);
+ fNx->SetShowSlider(kFALSE);
+ fNx->Build();
+ fNx->SetLimits(1, 15);
+ fNx->Connect("ValueSet(Double_t)",
+ "Reve::GridStepperSubEditor", this, "DoNs()");
+ f->AddFrame(fNx, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+
+ fNy = new RGValuator(f,"Y:", 200, 0);
+ fNy->SetNELength(3);
+ fNy->SetLabelWidth(labelW);
+ fNy->SetShowSlider(kFALSE);
+ fNy->Build();
+ fNy->SetLimits(1, 15);
+ fNy->Connect("ValueSet(Double_t)",
+ "Reve::GridStepperSubEditor", this, "DoNs()");
+ f->AddFrame(fNy, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+
+ fNz = new RGValuator(f,"Z:", 200, 0);
+ fNz->SetNELength(3);
+ fNz->SetLabelWidth(labelW);
+ fNz->SetShowSlider(kFALSE);
+ fNz->Build();
+ fNz->SetLimits(1, 15);
+ fNz->Connect("ValueSet(Double_t)",
+ "Reve::GridStepperSubEditor", this, "DoNs()");
+ f->AddFrame(fNz, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+
+ //AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
+ }
+ {
+ TGGroupFrame* f = new TGGroupFrame(VF, "Step", kVerticalFrame);
+ f->SetWidth(130);
+ VF->AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
+
+ fDx = new RGValuator(f,"X:", 200, 0);
+ fDx->SetNELength(5);
+ fDx->SetLabelWidth(labelW);
+ fDx->SetShowSlider(kFALSE);
+ fDx->Build();
+ fDx->SetLimits(0.1, 100, 101, TGNumberFormat::kNESRealOne);
+ fDx->Connect("ValueSet(Double_t)",
+ "Reve::GridStepperSubEditor", this, "DoDs()");
+ f->AddFrame(fDx, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+
+ fDy = new RGValuator(f,"Y:", 200, 0);
+ fDy->SetNELength(5);
+ fDy->SetLabelWidth(labelW);
+ fDy->SetShowSlider(kFALSE);
+ fDy->Build();
+ fDy->SetLimits(0.1, 100, 101, TGNumberFormat::kNESRealOne);
+ fDy->Connect("ValueSet(Double_t)",
+ "Reve::GridStepperSubEditor", this, "DoDs()");
+ f->AddFrame(fDy, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+
+ fDz = new RGValuator(f,"Z:", 200, 0);
+ fDz->SetNELength(5);
+ fDz->SetLabelWidth(labelW);
+ fDz->SetShowSlider(kFALSE);
+ fDz->Build();
+ fDz->SetLimits(0.1, 100, 101, TGNumberFormat::kNESRealOne);
+ fDz->Connect("ValueSet(Double_t)",
+ "Reve::GridStepperSubEditor", this, "DoDs()");
+ f->AddFrame(fDz, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
+
+ //AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
+ }
+ AddFrame(VF, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
+}
+
+//______________________________________________________________________
+void GridStepperSubEditor::SetModel(GridStepper* m)
+{
+ // Set model object.
+ fM = m;
+
+ fNx->SetValue(m->Nx);
+ fNy->SetValue(m->Ny);
+ fNz->SetValue(m->Nz);
+
+ fDx->SetValue(m->Dx);
+ fDy->SetValue(m->Dy);
+ fDz->SetValue(m->Dz);
+}
+
+//______________________________________________________________________
+void GridStepperSubEditor::Changed()
+{
+ // Emit Changed signal.
+
+ Emit("Changed()");
+}
+
+//______________________________________________________________________
+void GridStepperSubEditor::DoNs()
+{
+ fM->SetNs((Int_t)fNx->GetValue(), (Int_t)fNy->GetValue(), (Int_t)fNz->GetValue());
+ Changed();
+}
+
+//______________________________________________________________________
+void GridStepperSubEditor::DoDs()
+{
+ // Set some value from some widget
+ fM->SetDs(fDx->GetValue(), fDy->GetValue(), fDz->GetValue());
+ Changed();
+}
+
+//______________________________________________________________________
+// GridStepperEditor
+//
+//
+
+ClassImp(GridStepperEditor)
+
+//______________________________________________________________________
+GridStepperEditor::GridStepperEditor(const TGWindow *p, Int_t width, Int_t height,
+ UInt_t options, Pixel_t back) :
+ TGedFrame(p, width, height, options | kVerticalFrame, back),
+ fM (0),
+ fSE (0)
+{
+ // Constructor.
+
+ MakeTitle("GridStepper");
+
+ fSE = new GridStepperSubEditor(this);
+ AddFrame(fSE, new TGLayoutHints(kLHintsTop, 2, 0, 2, 2));
+ fSE->Connect("Changed()", "GridStepperEditor", this, "Update()");
+}
+
+/**************************************************************************/
+
+//______________________________________________________________________
+void GridStepperEditor::SetModel(TObject* obj)
+{
+ // Set model object.
+ fM = dynamic_cast<GridStepper*>(obj);
+ fSE->SetModel(fM);
+}
--- /dev/null
+// $Header$
+
+#ifndef REVE_GridStepperEditor_H
+#define REVE_GridStepperEditor_H
+
+#include <TGedFrame.h>
+
+class TGButton;
+class TGCheckButton;
+class TGNumberEntry;
+class TGColorSelect;
+
+namespace Reve {
+
+class GridStepper;
+class RGValuator;
+
+class GridStepperSubEditor : public TGVerticalFrame
+{
+private:
+ GridStepperSubEditor(const GridStepperSubEditor&); // Not implemented
+ GridStepperSubEditor& operator=(const GridStepperSubEditor&); // Not implemented
+
+protected:
+ GridStepper *fM;
+
+ RGValuator *fNx;
+ RGValuator *fNy;
+ RGValuator *fNz;
+ RGValuator *fDx;
+ RGValuator *fDy;
+ RGValuator *fDz;
+
+public:
+ GridStepperSubEditor(const TGWindow* p);
+ virtual ~GridStepperSubEditor() {}
+
+ void SetModel(GridStepper* m);
+
+ void Changed(); //*SIGNAL*
+
+ void DoNs();
+ void DoDs();
+
+ ClassDef(GridStepperSubEditor, 0) // Sub-editor for GridStepper
+};
+
+
+class GridStepperEditor : public TGedFrame
+{
+private:
+ GridStepperEditor(const GridStepperEditor&); // Not implemented
+ GridStepperEditor& operator=(const GridStepperEditor&); // Not implemented
+
+protected:
+ GridStepper *fM; // fModel dynamic-casted to GridStepper
+ GridStepperSubEditor *fSE;
+
+public:
+ GridStepperEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground());
+ virtual ~GridStepperEditor() {}
+
+ virtual void SetModel(TObject* obj);
+
+ ClassDef(GridStepperEditor, 0) // Editor for GridStepper
+};
+
+}
+
+#endif
fMainColorPtr = &fLineColor;
}
-Line::Line(const Text_t* name, TTree* tree, TreeVarType_e tv_type) :
- PointSet(name, tree, tv_type),
- fRnrLine (kTRUE),
- fRnrPoints (kFALSE)
-{
- fMainColorPtr = &fLineColor;
-}
-
Line::~Line()
{}
public:
Line(Int_t n_points=0, TreeVarType_e tv_type=TVT_XYZ);
Line(const Text_t* name, Int_t n_points=0, TreeVarType_e tv_type=TVT_XYZ);
- Line(const Text_t* name, TTree* tree, TreeVarType_e tv_type=TVT_XYZ);
virtual ~Line();
virtual void SetMarkerColor(Color_t col)
fRnrLine (0),
fRnrPoints (0)
{
- // MakeTitle("Line");
-
+ fPriority = 20;
{
TGHorizontalFrame* f = new TGHorizontalFrame(this);
- fRnrLine = new TGCheckButton(f, "Draw Line");
- f->AddFrame(fRnrLine, new TGLayoutHints(kLHintsLeft, 1,2,0,0));
- fRnrLine->Connect("Toggled(Bool_t)", "Reve::LineEditor", this, "DoRnrLine()");
fRnrPoints = new TGCheckButton(f, "Draw Marker");
f->AddFrame(fRnrPoints, new TGLayoutHints(kLHintsLeft, 2,1,0,0));
fRnrPoints->Connect("Toggled(Bool_t)"," Reve::LineEditor", this, "DoRnrPoints()");
+
+ fRnrLine = new TGCheckButton(f, "Draw Line");
+ f->AddFrame(fRnrLine, new TGLayoutHints(kLHintsLeft, 1,2,0,0));
+ fRnrLine->Connect("Toggled(Bool_t)", "Reve::LineEditor", this, "DoRnrLine()");
AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1));
}
#include <Reve/Line.h>
#include <TGLRnrCtx.h>
+#include <Reve/GLUtilNS.h>
#include <TGLIncludes.h>
using namespace Reve;
Line& q = *fM;
if (q.Size() <= 0) return;
- glPushAttrib(GL_POINT_BIT | GL_LINE_BIT | GL_ENABLE_BIT);
- glDisable(GL_LIGHTING);
-
- UChar_t color[4];
-
if (q.fRnrLine)
- {
- glPushAttrib(GL_LINE_BIT);
- ColorFromIdx(q.GetLineColor(), color);
- glColor4ubv(color);
- glLineWidth(q.GetLineWidth());
- if (q.GetLineStyle() > 1) {
- Int_t fac = 1;
- UShort_t pat = 0xffff;
- switch (q.GetLineStyle()) {
- case 2: pat = 0x3333; break;
- case 3: pat = 0x5555; break;
- case 4: pat = 0xf040; break;
- case 5: pat = 0xf4f4; break;
- case 6: pat = 0xf111; break;
- case 7: pat = 0xf0f0; break;
- case 8: pat = 0xff11; break;
- case 9: pat = 0x3fff; break;
- case 10: pat = 0x08ff; fac = 2; break;
- }
-
- glLineStipple(1, pat);
- glEnable(GL_LINE_STIPPLE);
- }
-
- const Float_t* p = q.GetP();
- const Int_t n = q.Size();
- glBegin(GL_LINE_STRIP);
- for (Int_t i=0; i<n; ++i, p+=3)
- glVertex3fv(p);
- glEnd();
- glPopAttrib();
- }
+ GLUtilNS::RenderLine(q, q.GetP(), q.Size());
if (q.fRnrPoints)
- {
- ColorFromIdx(q.GetMarkerColor(), color);
- glColor4ubv(color);
- Int_t ms = q.GetMarkerStyle();
- if (ms != 2 && ms != 3 && ms != 5 && ms != 28)
- RenderPoints(rnrCtx);
- else
- RenderCrosses(rnrCtx);
- }
-
- glPopAttrib();
+ GLUtilNS::RenderPolyMarkers(q, q.GetP(), q.Size());
}
#pragma link off all globals;
#pragma link off all classes;
+// Bertrand's new browser and helpers
+#pragma link C++ class TGClassBrowser;
+#pragma link C++ class TGCommandPlugin;
+#pragma link C++ class TGFileBrowser;
+#pragma link C++ class TGNewBrowser;
+
+
#pragma link C++ namespace Reve;
-#pragma link C++ global gReve; // In RGTopFrame ... should move.
+#pragma link C++ global gReve; // In ReveManager ... should move.
//================================
// base/
// Stepper
#pragma link C++ class Reve::GridStepper+;
+#pragma link C++ class Reve::GridStepperSubEditor+;
+#pragma link C++ class Reve::GridStepperEditor+;
// RGBAPalette
#pragma link C++ class Reve::RGBAPalette+;
#pragma link C++ class Reve::RenderElement::ListTreeInfo+;
#pragma link C++ class Reve::RenderElementObjPtr+;
#pragma link C++ class Reve::RenderElementList+;
-#pragma link C++ class Reve::PadPrimitive+;
#pragma link C++ class Reve::RenderElementEditor+;
#pragma link C++ class std::list<Reve::RenderElement*>;
#pragma link C++ typedef Reve::RenderElement::List_t;
#pragma link C++ typedef Reve::RenderElement::List_i;
+// GL-interface
+#pragma link C++ class Reve::Scene+;
+#pragma link C++ class Reve::SceneList+;
+#pragma link C++ class Reve::SceneInfo+;
+#pragma link C++ class Reve::Viewer+;
+#pragma link C++ class Reve::ViewerList+;
+
// Pad
#pragma link C++ class Reve::Pad+;
#pragma link C++ class Reve::VSDSelector+;
// RGBrowser
+#pragma link C++ class Reve::RGLTEFrame+;
#pragma link C++ class Reve::RGBrowser+;
// RGEditor
// RMacro
#pragma link C++ class Reve::RMacro+;
-// RGTopFrame
-#pragma link C++ class Reve::RGTopFrame+;
+// ReveManager
+#pragma link C++ class Reve::ReveManager+;
// RGValuators
#pragma link C++ class Reve::RGValuatorBase+;
#pragma link C++ class Reve::RGTriVecValuator+;
// Non-linear transformations
+#pragma link C++ class Reve::NLTProjectable+;
+#pragma link C++ class Reve::NLTGeoProjectable+;
+#pragma link C++ class Reve::NLTProjected+;
#pragma link C++ class Reve::NLTProjection+;
-#pragma link C++ class Reve::PhiZ+;
+//#pragma link C++ class Reve::PhiZ+;
#pragma link C++ class Reve::RhoZ+;
#pragma link C++ class Reve::CircularFishEye+;
#pragma link C++ class Reve::NLTProjector+;
+#pragma link C++ class Reve::NLTProjectorEditor+;
+#pragma link C++ class Reve::NLTProjectorGL+;
+
+#pragma link C++ class Reve::NLTTrack+;
+#pragma link C++ class Reve::NLTTrackGL+;
+#pragma link C++ class Reve::NLTTrackList+;
#pragma link C++ class Reve::NLTPolygon+;
#pragma link C++ class Reve::NLTPolygonSet+;
#pragma link C++ class Reve::NLTPolygonSetEditor+;
#pragma link C++ class Reve::NLTPolygonSetGL+;
+#pragma link C++ class Reve::NLTPointSet+;
+#pragma link C++ class Reve::NLTPointSetGL+;
+
//=====================================
// Graphical elements (with renderers)
//=====================================
// Track
#pragma link C++ class Reve::Track+;
#pragma link C++ class Reve::TrackGL+;
+#pragma link C++ class Reve::TrackEditor+;
#pragma link C++ class Reve::TrackRnrStyle+;
#pragma link C++ class Reve::TrackList+;
#pragma link C++ class Reve::TrackListEditor+;
+#pragma link C++ class Reve::TrackRnrStyleSubEditor+;
+#pragma link C++ class Reve::TrackRnrStyleEditor+;
#pragma link C++ class Reve::TrackCounter+;
#pragma link C++ class Reve::TrackCounterEditor+;
#pragma link C++ class Reve::FrameBox+;
#pragma link C++ class Reve::FrameBoxGL+;
+// DigitSet
+#pragma link C++ class Reve::DigitSet+;
+#pragma link C++ class Reve::DigitSetEditor+;
+
// QuadSet
#pragma link C++ class Reve::Quad+;
#pragma link C++ class Reve::OldQuadSet+;
#pragma link C++ class Reve::OldQuadSetGL+;
#pragma link C++ class Reve::QuadSet+;
-#pragma link C++ class Reve::QuadSetEditor+;
#pragma link C++ class Reve::QuadSetGL+;
// BoxSet
-#pragma link C++ class Reve::Box+;
#pragma link C++ class Reve::BoxSet+;
#pragma link C++ class Reve::BoxSetGL+;
#pragma link C++ class Reve::StraightLineSet+;
#pragma link C++ class Reve::StraightLineSetGL+;
#pragma link C++ class Reve::StraightLineSetEditor+;
+#pragma link C++ class Reve::NLTSLineSet+;
#define REVE_MCHelixLine_H
#include <Reve/Track.h>
+#include <cassert>
#include <vector>
namespace Reve {
struct MCVertex
{
Float_t x,y,z,t;
+
+ MCVertex() : x(0), y(0), z(0), t(0) {}
+ MCVertex(Float_t _x, Float_t _y, Float_t _z, Float_t _t=0) :
+ x(_x), y(_y), z(_z), t(_t) {}
+
+ Float_t Mag() const { return TMath::Sqrt(x*x+y*y+z*z);}
+ Float_t Mag2() const { return x*x+y*y+z*z;}
+
+ Float_t Perp() const { return TMath::Sqrt(x*x+y*y);}
+ Float_t Perp2() const { return x*x+y*y;}
+ Float_t R() const { return Perp(); }
+
+ MCVertex operator + (const MCVertex & b)
+ { return MCVertex(x + b.x, y + b.y, z + b.z, t + b.t); }
+
+ MCVertex operator - (const MCVertex & b)
+ { return MCVertex(x - b.x, y - b.y, z - b.z, t - b.t); }
+
+ MCVertex operator * (Float_t a)
+ { return MCVertex(a*x, a*y, a*z, a*t); }
+
+ MCVertex& operator +=(const MCVertex & b)
+ { x += b.x; y += b.y; z += b.z; t += b.t; return *this; }
};
void Init(Float_t pT, Float_t pZ)
{
- fN = 0;
+ fN = 0;
crosR = false;
- x_off = 0; y_off = 0;
- fLam = pZ/pT;
- fR = pT/fA;
+ x_off = 0;
+ y_off = 0;
+ fLam = pZ/pT;
+ fR &nbs