fDisableLigting = kFALSE;
}
-/**************************************************************************/
+/******************************************************************************/
//______________________________________________________________________________
Int_t BoxSet::SizeofAtom(BoxSet::BoxType_e bt)
//______________________________________________________________________
// GridStepper
//
+// Provide position coordinates for regular-grid placement of objects.
+//
ClassImp(GridStepper)
}
/**************************************************************************/
-bool GridStepper::Step()
+Bool_t GridStepper::Step()
{
(*ns[0])++;
- if(*ns[0] >= *ls[0]) {
+ if (*ns[0] >= *ls[0]) {
*ns[0] = 0; (*ns[1])++;
- if(*ns[1] >= *ls[1]) {
+ if (*ns[1] >= *ls[1]) {
*ns[1] = 0; (*ns[2])++;
- if(*ns[2] >= *ls[2]) {
- return false;
+ if (*ns[2] >= *ls[2]) {
+ return kFALSE;
}
}
}
- return true;
+ return kTRUE;
}
/**************************************************************************/
class GridStepper : public TObject
{
- Int_t *ls[3], *ns[3];
private:
+ Int_t *ls[3], *ns[3]; //! Internal traversal variables.
+
GridStepper(const GridStepper&); // Not implemented
GridStepper& operator=(const GridStepper&); // Not implemented
public:
enum StepMode_e { SM_XYZ, SM_YXZ, SM_XZY };
- StepMode_e Mode;
+ StepMode_e Mode; // Stepping mode, order of filling.
- Int_t nx, ny, nz;
- Int_t Nx, Ny, Nz;
- Float_t Dx, Dy, Dz;
- Float_t Ox, Oy, Oz;
+ Int_t nx, ny, nz; // Current positions during filling / traversal.
+ Int_t Nx, Ny, Nz; // Number of slots in eaxh direction.
+ Float_t Dx, Dy, Dz; // Step size in each direction.
+ Float_t Ox, Oy, Oz; // Initial offset for each direction.
GridStepper(Int_t sm=SM_XYZ);
virtual ~GridStepper() {}
void SetOs(Float_t ox, Float_t oy, Float_t oz=0)
{ Ox = ox; Oy = oy; Oz = oz; }
- bool Step();
+ Bool_t Step();
void GetPosition(Float_t* p);
GridStepperSubEditor& operator=(const GridStepperSubEditor&); // Not implemented
protected:
- GridStepper *fM;
+ GridStepper *fM; // Model object.
- RGValuator *fNx;
- RGValuator *fNy;
- RGValuator *fNz;
- RGValuator *fDx;
- RGValuator *fDy;
- RGValuator *fDz;
+ RGValuator *fNx; // Number of slots along x.
+ RGValuator *fNy; // Number of slots along y.
+ RGValuator *fNz; // Number of slots along z.
+ RGValuator *fDx; // Step in the x direction.
+ RGValuator *fDy; // Step in the y direction.
+ RGValuator *fDz; // Step in the z direction.
public:
GridStepperSubEditor(const TGWindow* p);
void DoNs();
void DoDs();
- ClassDef(GridStepperSubEditor, 0) // Sub-editor for GridStepper
+ ClassDef(GridStepperSubEditor, 0) // Sub-editor for GridStepper class.
};
GridStepperEditor& operator=(const GridStepperEditor&); // Not implemented
protected:
- GridStepper *fM; // fModel dynamic-casted to GridStepper
- GridStepperSubEditor *fSE;
+ GridStepper *fM; // Model object.
+ GridStepperSubEditor *fSE; // Sub-editor containg GUI controls.
public:
GridStepperEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground());
virtual void SetModel(TObject* obj);
- ClassDef(GridStepperEditor, 0) // Editor for GridStepper
+ ClassDef(GridStepperEditor, 0) // Editor for GridStepper class.
};
}
LineEditor& operator=(const LineEditor&); // Not implemented
protected:
- Line* fM; // fModel dynamic-casted to LineEditor
+ Line *fM; // Model object.
- TGCheckButton *fRnrLine;
- TGCheckButton *fRnrPoints;
+ TGCheckButton *fRnrLine; // Checkbox for line-rendering.
+ TGCheckButton *fRnrPoints; // Checkbox for point-rendering.
public:
LineEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
void DoRnrLine();
void DoRnrPoints();
- ClassDef(LineEditor, 1); // Editor for Line
+ ClassDef(LineEditor, 1); // Editor for Line class.
}; // endclass LineEditor
}
#pragma link C++ class Reve::Vector+;
#pragma link C++ class Reve::PathMark+;
#pragma link C++ class Reve::MCTrack+;
-#pragma link C++ class Reve::MCTrackRef+;
#pragma link C++ class Reve::Hit+;
#pragma link C++ class Reve::Cluster+;
#pragma link C++ class Reve::RecTrack+;
Float_t NLTProjection::fgEps = 0.005f;
+
//______________________________________________________________________________
// NLTProjection
//
// Enables to define an external center of distortion and a scale to
// fixate a bounding box of a projected point.
-
ClassImp(Reve::NLTProjection)
//______________________________________________________________________________
return dv[i];
}
+
//______________________________________________________________________________
-//
// NLTRhoZ
//
// Transformation from 3D to 2D. X axis represent Z coordinate. Y axis have value of
// radius with a sign of Y coordinate.
-
ClassImp(Reve::NLTRhoZ)
//______________________________________________________________________________
return val;
}
+
//______________________________________________________________________________
-//
// NLTCircularFishEye
//
// XY projection with distortion around given center.
-ClassImp(Reve:: NLTCircularFishEye)
+ClassImp(Reve::NLTCircularFishEye)
//______________________________________________________________________________
-void NLTCircularFishEye::ProjectPoint(Float_t& x, Float_t& y, Float_t& z, PProc_e proc)
+void NLTCircularFishEye::ProjectPoint(Float_t& x, Float_t& y, Float_t& z,
+ PProc_e proc)
{
// Project point.
using namespace TMath;
- if(proc != PP_Plane)
+ if (proc != PP_Plane)
{
x -= fCenter.x;
y -= fCenter.y;
z = 0.0f;
}
+
+ClassImp(NLTProjector)
+
//______________________________________________________________________________
-//
// NLTProjector
//
// Recursively projects RenderElement and draws axis in the projected scene.
// It enables to interactivly set NLTProjection parameters and updates
// projected scene accordingly.
-ClassImp(NLTProjector)
NLTProjector::NLTProjector():
RenderElementList("NLTProjector",""),
BBoxInit();
}
-
ClassDef(NLTCircularFishEye, 0); // XY non-linear projection.
};
+
/**************************************************************************/
// NLTProjector
/**************************************************************************/
+
class NLTProjector : public RenderElementList,
public TAttBBox,
public TAtt3D
virtual void ComputeBBox();
virtual void Paint(Option_t* option = "");
- ClassDef(NLTProjector, 0); // Project NLTProjectable object.
+ ClassDef(NLTProjector, 0); // Manages and steers NLT projections.
};
}
Vector& Mult(const Vector&a, Float_t af) { x = a.x*af; y = a.y*af; z = a.z*af; return *this; }
- ClassDef(Vector, 1);
+ ClassDef(Vector, 1); // VSD float three-vector.
};
inline Float_t Vector::Phi() const
const char* type_name();
- ClassDef(PathMark, 1);
+ ClassDef(PathMark, 1); // VSD special-point on track.
};
/**************************************************************************/
void ResetPdgCode() { fPdgCode = 0; }
- ClassDef(MCTrack, 1);
-};
-
-
-/**************************************************************************/
-// MCTrackRef
-/**************************************************************************/
-
-// Not used.
-
-class MCTrackRef : public TObject
-{
-public:
- Int_t label;
- Int_t status;
- Vector V;
- Vector P;
- Float_t length;
- Float_t time;
-
- MCTrackRef() : label(-1), status(-1), V(), P(), length(0), time(0) {}
- virtual ~MCTrackRef() {}
-
- ClassDef(MCTrackRef, 1)
+ ClassDef(MCTrack, 1); // VSD Monte Carlo track.
};
UShort_t det_id; // Custom detector id
UShort_t subdet_id; // Custom sub-detector id
Int_t label; // Label of particle that produced the hit
- Int_t eva_label;
- Vector V; // Vertex
+ Int_t eva_label; // Label of primary particle, ancestor of label
+ Vector V; // Hit position
- // ?? Float_t charge. Probably specific.
+ // Float_t charge; Probably specific.
Hit() : det_id(0), subdet_id(0), label(0), eva_label(0), V() {}
virtual ~Hit() {}
- ClassDef(Hit, 1);
+ ClassDef(Hit, 1); // VSD Monte Carlo hit.
};
Cluster() : det_id(0), subdet_id(0), V() { label[0] = label[1] = label [2] = 0; }
virtual ~Cluster() {}
- ClassDef(Cluster, 1);
+ ClassDef(Cluster, 1); // VSD reconstructed cluster.
};
Int_t label; // Label of the track
Int_t index; // Index of the track (in some source array)
Int_t status; // Status as exported from reconstruction
- Int_t sign;
+ Int_t sign; // Charge of the track
Vector V; // Start vertex from reconstruction
Vector P; // Reconstructed momentum at start vertex
Float_t beta;
Float_t Pt() { return P.Perp(); }
- ClassDef(RecTrack, 1);
+ ClassDef(RecTrack, 1); // VSD reconstructed track.
};
// Another class with specified points/clusters
RecKink() : RecTrack(), label_sec(0), V_end(), V_kink(), P_sec() {}
virtual ~RecKink() {}
- ClassDef(RecKink, 1);
+ ClassDef(RecKink, 1); // VSD reconstructed track.
};
{ d_label[0] = d_label[1] = 0; }
virtual ~RecV0() {}
- ClassDef(RecV0, 1);
+ ClassDef(RecV0, 1); // VSD reconstructed V0.
};
/**************************************************************************/
label(0), n_hits(0), n_clus(0) {}
virtual ~GenInfo() {}
- ClassDef(GenInfo, 1);
+ ClassDef(GenInfo, 1); // VSD cross-reference of sim/rec data per particle.
};
/**************************************************************************/
/**************************************************************************/
-// This whole construction is highly embarrassing. It requires
+// This whole construction is somewhat doubtable. It requires
// shameless copying of experiment data. What is good about this
// scheme:
//
// This was intended as a TPad wrapper to allow smart updates of
// groups of pads. Uses THashList instead of TList for faster removal
// of objects from the pad.
-// Currently not used ...
using namespace Reve;
virtual TVirtualViewer3D *GetViewer3D(Option_t * /*type*/ = "")
{ return fViewer3D; }
- ClassDef(Pad, 1); // Wrapper for TPad
+ ClassDef(Pad, 1); // Internal Reve pad (sub-class of TPad).
};
}
VoidCPlex& operator=(const VoidCPlex&); // Not implemented
protected:
- Int_t fS; // Size of atom
- Int_t fN; // Number of atoms in a chunk
+ Int_t fS; // Size of atom
+ Int_t fN; // Number of atoms in a chunk
Int_t fSize; // Size of container, number of atoms
Int_t fVecSize; // Number of allocated chunks
Int_t index() { return fAtomIndex; }
};
-
- ClassDef(VoidCPlex, 1)
+ ClassDef(VoidCPlex, 1); // Vector-like container with chunked memory allocation.
};
+
+/******************************************************************************/
+
inline Char_t* VoidCPlex::NewAtom()
{
Char_t *a = (fSize >= fCapacity) ? NewChunk() : Atom(fSize);
/**************************************************************************/
-// Some-class CPlex
+// Templated some-class CPlex
/**************************************************************************/
template<class T>
T* At(Int_t idx) { return reinterpret_cast<T*>(Atom(idx)); }
T& Ref(Int_t idx) { return *At(idx); }
- ClassDef(CPlex, 1)
+ ClassDef(CPlex, 1); // Templated class for specific atom classes (given as template argument).
}; // endclass CPlex
}
//
// PointSet is a render-element holding a collection of 3D points with
// optional per-point TRef and an arbitrary number of integer ids (to
-// be used for signal, volume id, track-id, etc).
+// be used for signal, volume-id, track-id, etc).
//
// 3D point representation is implemented in base-class TPolyMarker3D.
// Per-point TRef is implemented in base-class TPointSet3D.
ClassImp(PointSet)
+//______________________________________________________________________________
PointSet::PointSet(Int_t n_points, TreeVarType_e tv_type) :
RenderElement(fMarkerColor),
TPointSet3D(n_points),
fMarkerStyle = 20;
}
+//______________________________________________________________________________
PointSet::PointSet(const Text_t* name, Int_t n_points, TreeVarType_e tv_type) :
RenderElement(fMarkerColor),
TPointSet3D(n_points),
SetName(name);
}
+//______________________________________________________________________________
PointSet::~PointSet()
{
// Destructor.
/**************************************************************************/
+//______________________________________________________________________________
void PointSet::ComputeBBox()
{
// Override of virtual method from TAttBBox.
AssertBBoxExtents(0.1);
}
+//______________________________________________________________________________
void PointSet::Reset(Int_t n_points, Int_t n_int_ids)
{
// Drop all data and set-up the data structures to recive new data.
ResetBBox();
}
+//______________________________________________________________________________
Int_t PointSet::GrowFor(Int_t n_points)
{
// Resizes internal array to allow additional n_points to be stored.
/**************************************************************************/
+//______________________________________________________________________________
inline void PointSet::AssertIntIdsSize()
{
// Assert that size of IntId array is compatible with the size of
fIntIds->Set(exp_size);
}
+//______________________________________________________________________________
Int_t* PointSet::GetPointIntIds(Int_t p) const
{
// Return a pointer to integer ids of point with index p.
return 0;
}
+//______________________________________________________________________________
Int_t PointSet::GetPointIntId(Int_t p, Int_t i) const
{
// Return i-th integer id of point with index p.
return kMinInt;
}
+//______________________________________________________________________________
void PointSet::SetPointIntIds(Int_t* ids)
{
// Set integer ids for the last point that was registerd (most
SetPointIntIds(fLastPoint, ids);
}
+//______________________________________________________________________________
void PointSet::SetPointIntIds(Int_t n, Int_t* ids)
{
+ // Set integer ids for point with index n.
+
if (!fIntIds) return;
AssertIntIdsSize();
Int_t* x = fIntIds->GetArray() + n*fIntIdsPerPoint;
/**************************************************************************/
+//______________________________________________________________________________
void PointSet::SetRnrElNameTitle(const Text_t* name, const Text_t* title)
{
+ // Set name and title of point-set.
+ // Virtual in RenderElement.
+
SetName(name);
SetTitle(title);
}
-/**************************************************************************/
+/******************************************************************************/
+//______________________________________________________________________________
void PointSet::Paint(Option_t* option)
{
+ // Paint point-set.
+
if(fRnrSelf == kFALSE) return;
TPointSet3D::Paint(option);
/**************************************************************************/
+//______________________________________________________________________________
void PointSet::InitFill(Int_t subIdNum)
{
+ // Initialize point-set for new filling.
+ // subIdNum gives the number of integer ids that can be assigned to
+ // each point.
+
if (subIdNum > 0) {
fIntIdsPerPoint = subIdNum;
if (!fIntIds)
}
}
+//______________________________________________________________________________
void PointSet::TakeAction(TPointSelector* sel)
{
+ // Called from TPointSelector when internal arrays of the tree-selector
+ // are filled up and need to be processed.
+ // Virtual from TPointSelectorConsumer.
+
static const Exc_t eH("PointSet::TakeAction ");
if(sel == 0)
/**************************************************************************/
+//______________________________________________________________________________
TClass* PointSet::ProjectedClass() const
{
+ // Virtual from NLTProjectable, returns NLTPointSet class.
+
return NLTPointSet::Class();
}
/**************************************************************************/
/**************************************************************************/
-//______________________________________________________________________
+//______________________________________________________________________________
// PointSetArray
//
+// An array of point-sets with each point-set playing a role of a bin
+// in a histogram. When a new point is added to a PointSetArray, an
+// additional separating quantity needs to be specified: it determines
+// into which PointSet (bin) the point will actually be stored.
+//
+// By using the TPointSelector the points and the separating
+// quantities can be filled directly from a TTree holding the source
+// data.
+// Setting of per-point TRef's is not supported.
+//
+// After the filling, the range of separating variable can be
+// controlled with a slider to choose a sub-set of PointSets that are
+// actually shown.
+//
ClassImp(PointSetArray)
+//______________________________________________________________________________
PointSetArray::PointSetArray(const Text_t* name,
const Text_t* title) :
RenderElement(fMarkerColor),
fMin(0), fCurMin(0), fMax(0), fCurMax(0),
fBinWidth(0),
fQuantName()
-{}
+{
+ // Constructor.
+}
+//______________________________________________________________________________
PointSetArray::~PointSetArray()
{
// Destructor: deletes the fBins array. Actual removal of
delete [] fBins; fBins = 0;
}
+//______________________________________________________________________________
void PointSetArray::Paint(Option_t* option)
{
- if(fRnrSelf) {
- for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
- if((*i)->GetRnrSelf())
+ // Paint the subjugated PointSet's.
+
+ if (fRnrSelf) {
+ for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+ if ((*i)->GetRnrSelf())
(*i)->GetObject()->Paint(option);
}
}
}
+//______________________________________________________________________________
void PointSetArray::RemoveElementLocal(RenderElement* el)
{
- for(Int_t i=0; i<fNBins; ++i) {
- if(fBins[i] == el) {
+ // Virtual from RenderElement, provide bin management.
+
+ for (Int_t i=0; i<fNBins; ++i) {
+ if (fBins[i] == el) {
fBins[i] = 0;
break;
}
}
}
+//______________________________________________________________________________
void PointSetArray::RemoveElementsLocal()
{
+ // Virtual from RenderElement, provide bin management.
+
delete [] fBins; fBins = 0; fLastBin = -1;
}
/**************************************************************************/
+//______________________________________________________________________________
void PointSetArray::SetMarkerColor(Color_t tcolor)
{
- for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+ for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject());
- if(m && m->GetMarkerColor() == fMarkerColor)
+ if (m && m->GetMarkerColor() == fMarkerColor)
m->SetMarkerColor(tcolor);
}
TAttMarker::SetMarkerColor(tcolor);
}
+//______________________________________________________________________________
void PointSetArray::SetMarkerStyle(Style_t mstyle)
{
- for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+ for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject());
- if(m && m->GetMarkerStyle() == fMarkerStyle)
+ if (m && m->GetMarkerStyle() == fMarkerStyle)
m->SetMarkerStyle(mstyle);
}
TAttMarker::SetMarkerStyle(mstyle);
}
+//______________________________________________________________________________
void PointSetArray::SetMarkerSize(Size_t msize)
{
- for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+ for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
TAttMarker* m = dynamic_cast<TAttMarker*>((*i)->GetObject());
- if(m && m->GetMarkerSize() == fMarkerSize)
+ if (m && m->GetMarkerSize() == fMarkerSize)
m->SetMarkerSize(msize);
}
TAttMarker::SetMarkerSize(msize);
/**************************************************************************/
+//______________________________________________________________________________
void PointSetArray::TakeAction(TPointSelector* sel)
{
+ // Called from TPointSelector when internal arrays of the tree-selector
+ // are filled up and need to be processed.
+ // Virtual from TPointSelectorConsumer.
+
static const Exc_t eH("PointSetArray::TakeAction ");
- if(sel == 0)
+ if (sel == 0)
throw(eH + "selector is <null>.");
Int_t n = sel->GetNfill();
/**************************************************************************/
+//______________________________________________________________________________
void PointSetArray::InitBins(const Text_t* quant_name,
Int_t nbins, Double_t min, Double_t max,
Bool_t addRe)
{
static const Exc_t eH("PointSetArray::InitBins ");
- if(nbins < 1) throw(eH + "nbins < 1.");
- if(min > max) throw(eH + "min > max.");
+ if (nbins < 1) throw(eH + "nbins < 1.");
+ if (min > max) throw(eH + "min > max.");
RemoveElements();
fBinWidth = (fMax - fMin)/fNBins;
fBins = new Reve::PointSet*[fNBins];
- for(Int_t i=0; i<fNBins; ++i) {
+ for (Int_t i=0; i<fNBins; ++i) {
fBins[i] = new Reve::PointSet
(Form("Slice %d [%4.3lf, %4.3lf]", i, fMin + i*fBinWidth, fMin + (i+1)*fBinWidth),
fDefPointSetCapacity);
fBins[i]->SetMarkerColor(fMarkerColor);
fBins[i]->SetMarkerStyle(fMarkerStyle);
fBins[i]->SetMarkerSize(fMarkerSize);
- if(addRe)
+ if (addRe)
gReve->AddRenderElement(fBins[i], this);
else
AddElement(fBins[i]);
}
}
+//______________________________________________________________________________
void PointSetArray::Fill(Double_t x, Double_t y, Double_t z, Double_t quant)
{
fLastBin = Int_t( (quant - fMin)/fBinWidth );
- if(fLastBin >= 0 && fLastBin < fNBins && fBins[fLastBin] != 0)
+ if (fLastBin >= 0 && fLastBin < fNBins && fBins[fLastBin] != 0)
fBins[fLastBin]->SetNextPoint(x, y, z);
else
fLastBin = -1;
}
+//______________________________________________________________________________
void PointSetArray::SetPointId(TObject* id)
{
if (fLastBin >= 0)
fBins[fLastBin]->SetPointId(id);
}
+//______________________________________________________________________________
void PointSetArray::CloseBins()
{
- for(Int_t i=0; i<fNBins; ++i) {
- if(fBins[i] != 0) {
+ for (Int_t i=0; i<fNBins; ++i) {
+ if (fBins[i] != 0) {
// HACK! PolyMarker3D does half-management of array size.
// In fact, the error is mine, in pointset3d(gl) i use fN instead of Size().
// Fixed in my root, but not elsewhere.
/**************************************************************************/
+//______________________________________________________________________________
void PointSetArray::SetOwnIds(Bool_t o)
{
- for(Int_t i=0; i<fNBins; ++i)
+ for (Int_t i=0; i<fNBins; ++i)
{
- if(fBins[i] != 0)
+ if (fBins[i] != 0)
fBins[i]->SetOwnIds(o);
}
}
/**************************************************************************/
+//______________________________________________________________________________
void PointSetArray::SetRange(Double_t min, Double_t max)
{
using namespace TMath;
fCurMin = min; fCurMax = max;
Int_t low_b = (Int_t) Max(Double_t(0), Floor((min-fMin)/fBinWidth));
Int_t high_b = (Int_t) Min(Double_t(fNBins-1), Ceil((max-fMin)/fBinWidth));
- for(Int_t i=0; i<fNBins; ++i) {
- if(fBins[i] != 0)
+ for (Int_t i=0; i<fNBins; ++i) {
+ if (fBins[i] != 0)
fBins[i]->SetRnrSelf(i>=low_b && i<=high_b);
}
}
-/**************************************************************************/
-/**************************************************************************/
-
+/******************************************************************************/
+/******************************************************************************/
-//______________________________________________________________________
+//______________________________________________________________________________
// NLTPointSet
//
ClassImp(NLTPointSet)
+//______________________________________________________________________________
NLTPointSet::NLTPointSet() :
PointSet (),
NLTProjected ()
-{}
+{
+ // Default contructor.
+}
+//______________________________________________________________________________
void NLTPointSet::SetProjection(NLTProjector* proj, NLTProjectable* model)
{
NLTProjected::SetProjection(proj, model);
* (TAttMarker*)this = * dynamic_cast<TAttMarker*>(fProjectable);
}
+//______________________________________________________________________________
void NLTPointSet::UpdateProjection()
{
NLTProjection& proj = * fProjector->GetProjection();
Int_t n = ps.GetN();
Reset(n);
Float_t *o = ps.GetP(), *p = GetP();
- for(Int_t i = 0; i < n; ++i, o+=3, p+=3)
+ for (Int_t i = 0; i < n; ++i, o+=3, p+=3)
{
p[0] = o[0]; p[1] = o[1]; p[2] = o[2];
proj.ProjectPoint(p[0], p[1], p[2]);
Int_t fDefPointSetCapacity; // Default capacity of subjugated PointSet's.
Int_t fNBins; // Number of subjugated PointSet's.
Int_t fLastBin; //! Index of the last filled PointSet.
- Double_t fMin, fCurMin;
- Double_t fMax, fCurMax;
- Double_t fBinWidth;
- TString fQuantName;
+ Double_t fMin, fCurMin; // Overall and current minimum value of the separating quantity.
+ Double_t fMax, fCurMax; // Overall and current maximum value of the separating quantity.
+ Double_t fBinWidth; // Separating quantity bin-width.
+ TString fQuantName; // Name of the separating quantity.
public:
PointSetArray(const Text_t* name="PointSetArray", const Text_t* title="");
void SetRange(Double_t min, Double_t max);
- ClassDef(PointSetArray, 1);
+ ClassDef(PointSetArray, 1); // Array of centrally managed PointSet's.
};
/**************************************************************************/
virtual void UpdateProjection();
- ClassDef(NLTPointSet, 1);
+ ClassDef(NLTPointSet, 1); // NLT projected PointSet.
}; // endclass NLTPointSet
}
ClassImp(PointSetArrayEditor)
+//______________________________________________________________________________
PointSetArrayEditor::PointSetArrayEditor(const TGWindow *p,
Int_t width, Int_t height,
UInt_t options, Pixel_t back) :
fM(0),
fRange(0)
{
+ // Constructor.
+
fM = 0;
MakeTitle("PointSetArray");
AddFrame(fRange, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
}
+//______________________________________________________________________________
PointSetArrayEditor::~PointSetArrayEditor()
-{}
+{
+ // Destructor.
+}
/**************************************************************************/
+//______________________________________________________________________________
void PointSetArrayEditor::SetModel(TObject* obj)
{
+ // Set model object.
+
fM = dynamic_cast<PointSetArray*>(obj);
// printf("FullRange(%f, %f) Selected(%f,%f)\n",
/**************************************************************************/
+//______________________________________________________________________________
void PointSetArrayEditor::DoRange()
{
+ // Slot for setting the range of the separating quantity.
+
fM->SetRange(fRange->GetMin(), fRange->GetMax());
Update();
}
PointSetArrayEditor& operator=(const PointSetArrayEditor&); // Not implemented
protected:
- PointSetArray* fM; // fModel dynamic-casted to PointSetArrayEditor
+ PointSetArray *fM; // Model object.
- Reve::RGDoubleValuator* fRange;
+ Reve::RGDoubleValuator *fRange; // Control for displayed range of the separating quantity.
public:
PointSetArrayEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
void DoRange();
- ClassDef(PointSetArrayEditor, 1); // Editor for PointSetArray
+ ClassDef(PointSetArrayEditor, 1); // Editor for PointSetArray class.
}; // endclass PointSetArrayEditor
}
// ?? Should we emit some *SIGNALS* ??
// ?? Should we have a RendererTimeStamp ??
- ClassDef(RGBAPalette, 1);
+ ClassDef(RGBAPalette, 1); // A generic mapping from value to RGBA color.
}; // endclass RGBAPalette
void DoUnderflowAction(Int_t mode);
void DoOverflowAction(Int_t mode);
- ClassDef(RGBAPaletteSubEditor, 1); // SubEditor for RGBAPalette
+ ClassDef(RGBAPaletteSubEditor, 1); // Sub-editor for RGBAPalette class.
}; // endclass RGBAPaletteSubEditor
virtual void SetModel(TObject* obj);
- ClassDef(RGBAPaletteEditor, 1); // Editor for RGBAPalette
+ ClassDef(RGBAPaletteEditor, 1); // Editor for RGBAPalette class.
}; // endclass RGBAPaletteEditor
}
using namespace Reve;
-//______________________________________________________________________
+//______________________________________________________________________________
// RenderElement
//
//
const TGPicture* RenderElement::fgRnrIcons[4] = { 0 };
const TGPicture* RenderElement::fgListTreeIcons[8] = { 0 };
+//______________________________________________________________________________
RenderElement::RenderElement() :
fRnrSelf (kTRUE),
fRnrChildren (kTRUE),
fDestroyOnZeroRefCnt (kTRUE),
fDenyDestroy (0),
fChildren ()
-{}
+{
+ // Default contructor.
+}
+//______________________________________________________________________________
RenderElement::RenderElement(Color_t& main_color) :
fRnrSelf (kTRUE),
fRnrChildren (kTRUE),
fDestroyOnZeroRefCnt (kTRUE),
fDenyDestroy (0),
fChildren ()
-{}
+{
+ // Constructor.
+}
+//______________________________________________________________________________
RenderElement::~RenderElement()
{
+ // Destructor.
+
static const Exc_t _eh("RenderElement::RenderElement ");
RemoveElements();
- for(List_i p=fParents.begin(); p!=fParents.end(); ++p)
+ for (List_i p=fParents.begin(); p!=fParents.end(); ++p)
{
(*p)->RemoveElementLocal(this);
(*p)->fChildren.remove(this);
}
fParents.clear();
- for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) {
+ for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i)
i->fTree->DeleteItem(i->fItem);
- }
}
/**************************************************************************/
+//______________________________________________________________________________
void RenderElement::SetRnrElNameTitle(const Text_t* name, const Text_t* title)
{
+ // Virtual function for setting of name and title of render element.
+ // Here we attempt to cast the assigned object into TNamed and call
+ // SetNameTitle() there.
+
TNamed* named = dynamic_cast<TNamed*>(GetObject());
if (named)
named->SetNameTitle(name, title);
}
-/**************************************************************************/
+//______________________________________________________________________________
const Text_t* RenderElement::GetRnrElName() const
{
+ // Virtual function for retrieveing name of the render-element.
+ // Here we attempt to cast the assigned object into TNamed and call
+ // GetName() there.
+
TObject* named = dynamic_cast<TObject*>(GetObject());
- return named ? named->GetName() : "<noo-nom>";
+ return named ? named->GetName() : "<no-name>";
}
-/**************************************************************************/
+//______________________________________________________________________________
const Text_t* RenderElement::GetRnrElTitle() const
{
+ // Virtual function for retrieveing title of the render-element.
+ // Here we attempt to cast the assigned object into TNamed and call
+ // GetTitle() there.
+
TObject* named = dynamic_cast<TObject*>(GetObject());
- return named ? named->GetTitle() : "<noo-tit>";
+ return named ? named->GetTitle() : "<no-title>";
}
-/**************************************************************************/
+/******************************************************************************/
+
+//______________________________________________________________________________
void RenderElement::AddParent(RenderElement* re)
{
+ // Add re into the list parents.
// Adding parent is subordinate to adding an element.
- // Consider this an internal function.
+ // This is an internal function.
fParents.push_back(re);
}
void RenderElement::RemoveParent(RenderElement* re)
{
+ // Remove re from the list of parents.
// Removing parent is subordinate to removing an element.
- // Consider this an internal function.
+ // This is an internal function.
static const Exc_t eH("RenderElement::RemoveParent ");
CheckReferenceCount(eH);
}
+/******************************************************************************/
+
+//______________________________________________________________________________
void RenderElement::CheckReferenceCount(const Reve::Exc_t& eh)
{
+ // Check external references to this and eventually auto-destruct
+ // the render-element.
+
if(fParents.empty() && fItems.empty() &&
fDenyDestroy <= 0 && fDestroyOnZeroRefCnt)
{
}
}
+//______________________________________________________________________________
void RenderElement::CollectSceneParents(List_t& scenes)
{
// Collect all parents of class Reve::Scene. This is needed to
(*p)->CollectSceneParents(scenes);
}
+//______________________________________________________________________________
void RenderElement::CollectSceneParentsFromChildren(List_t& scenes, RenderElement* parent)
{
// Collect scene-parents from all children. This is needed to
// Argument parent specifies parent in traversed hierarchy for which we can
// skip the upwards search.
- for(List_i p=fParents.begin(); p!=fParents.end(); ++p)
+ for (List_i p=fParents.begin(); p!=fParents.end(); ++p)
{
if (*p != parent) (*p)->CollectSceneParents(scenes);
}
- for(List_i c=fChildren.begin(); c!=fChildren.end(); ++c)
+ for (List_i c=fChildren.begin(); c!=fChildren.end(); ++c)
{
(*c)->CollectSceneParentsFromChildren(scenes, this);
}
}
-/**************************************************************************/
+/******************************************************************************/
// List-tree stuff
-/**************************************************************************/
+/******************************************************************************/
+//______________________________________________________________________________
Int_t RenderElement::ExpandIntoListTree(TGListTree* ltree,
TGListTreeItem* parent)
{
// search through fItems to get parent here.
// Anyhow, it is probably known as it must have been selected by the user.
- if(parent->GetFirstChild() != 0)
+ if (parent->GetFirstChild() != 0)
return 0;
Int_t n = 0;
- for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+ for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
(*i)->AddIntoListTree(ltree, parent);
++n;
}
return n;
}
+//______________________________________________________________________________
Int_t RenderElement::DestroyListSubTree(TGListTree* ltree,
TGListTreeItem* parent)
{
return n;
}
-/**************************************************************************/
-
+//______________________________________________________________________________
TGListTreeItem* RenderElement::AddIntoListTree(TGListTree* ltree,
TGListTreeItem* parent_lti)
{
item->SetPictures(GetListTreeIcon(),GetListTreeIcon());
item->CheckItem(fRnrSelf);
- if(fMainColorPtr != 0) item->SetColor(GetMainColor());
+ if (fMainColorPtr != 0) item->SetColor(GetMainColor());
item->SetTipText(tobj->GetTitle());
fItems.insert(ListTreeInfo(ltree, item));
return item;
}
+//______________________________________________________________________________
TGListTreeItem* RenderElement::AddIntoListTree(TGListTree* ltree,
RenderElement* parent)
{
if (parent == 0) {
lti = AddIntoListTree(ltree, (TGListTreeItem*) 0);
} else {
- for(sLTI_ri i = parent->fItems.rbegin(); i != parent->fItems.rend(); ++i)
+ for (sLTI_ri i = parent->fItems.rbegin(); i != parent->fItems.rend(); ++i)
{
- if(i->fTree == ltree)
+ if (i->fTree == ltree)
lti = AddIntoListTree(ltree, i->fItem);
}
}
return lti;
}
+//______________________________________________________________________________
TGListTreeItem* RenderElement::AddIntoListTrees(RenderElement* parent)
{
// Add this render element into all list-trees and all items
// register entry (but we use a set for that so it can be anything).
TGListTreeItem* lti = 0;
- for(sLTI_ri i = parent->fItems.rbegin(); i != parent->fItems.rend(); ++i)
+ for (sLTI_ri i = parent->fItems.rbegin(); i != parent->fItems.rend(); ++i)
{
lti = AddIntoListTree(i->fTree, i->fItem);
}
return lti;
}
+//______________________________________________________________________________
Bool_t RenderElement::RemoveFromListTree(TGListTree* ltree,
TGListTreeItem* parent_lti)
{
static const Exc_t eH("RenderElement::RemoveFromListTree ");
sLTI_i i = FindItem(ltree, parent_lti);
- if(i != fItems.end()) {
+ if (i != fItems.end()) {
DestroyListSubTree(ltree, i->fItem);
ltree->DeleteItem(i->fItem);
ltree->ClearViewPort();
}
}
+//______________________________________________________________________________
Int_t RenderElement::RemoveFromListTrees(RenderElement* parent)
{
Int_t count = 0;
return count;
}
-/**************************************************************************/
-
+//______________________________________________________________________________
RenderElement::sLTI_i RenderElement::FindItem(TGListTree* ltree)
{
- for(sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
- if(i->fTree == ltree)
+ for (sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
+ if (i->fTree == ltree)
return i;
return fItems.end();
}
+//______________________________________________________________________________
RenderElement::sLTI_i RenderElement::FindItem(TGListTree* ltree,
TGListTreeItem* parent_lti)
{
- for(sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
- if(i->fTree == ltree && i->fItem->GetParent() == parent_lti)
+ for (sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
+ if (i->fTree == ltree && i->fItem->GetParent() == parent_lti)
return i;
return fItems.end();
}
+//______________________________________________________________________________
TGListTreeItem* RenderElement::FindListTreeItem(TGListTree* ltree)
{
- for(sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
- if(i->fTree == ltree)
+ for (sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
+ if (i->fTree == ltree)
return i->fItem;
return 0;
}
+//______________________________________________________________________________
TGListTreeItem* RenderElement::FindListTreeItem(TGListTree* ltree,
TGListTreeItem* parent_lti)
{
- for(sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
- if(i->fTree == ltree && i->fItem->GetParent() == parent_lti)
+ for (sLTI_i i = fItems.begin(); i != fItems.end(); ++i)
+ if (i->fTree == ltree && i->fItem->GetParent() == parent_lti)
return i->fItem;
return 0;
}
-/**************************************************************************/
-
+//______________________________________________________________________________
void RenderElement::UpdateItems()
{
+ // Update list-tree-items representing this render-element.
+
static const Exc_t eH("RenderElement::UpdateItems ");
TObject* tobj = GetObject(eH);
- for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) {
+ for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) {
i->fItem->Rename(tobj->GetName());
i->fItem->SetTipText(tobj->GetTitle());
i->fItem->CheckItem(fRnrSelf);
- if(fMainColorPtr != 0) i->fItem->SetColor(GetMainColor());
+ if (fMainColorPtr != 0) i->fItem->SetColor(GetMainColor());
i->fTree->ClearViewPort();
}
}
-/**************************************************************************/
+/******************************************************************************/
+//______________________________________________________________________________
TObject* RenderElement::GetObject(Exc_t eh) const
{
+ // Get a TObject associated with this render-element.
+ // Most cases uses double-inheritance from RenderElement and TObject
+ // so we just do a dynamic cast here.
+ // If some RenderElement descendant implements a different scheme,
+ // this virtual method should be overriden accordingly.
+
const TObject* obj = dynamic_cast<const TObject*>(this);
- if(obj == 0)
+ if (obj == 0)
throw(eh + "not a TObject.");
return const_cast<TObject*>(obj);
}
+//______________________________________________________________________________
void RenderElement::SpawnEditor()
{
+ // Show GUI editor for this object.
+
gReve->EditRenderElement(this);
}
+//______________________________________________________________________________
void RenderElement::ExportToCINT(Text_t* var_name)
{
- static const Exc_t eH("RenderElement::ExportToCINT ");
+ // Export render-element to CINT with variable name var_name.
const char* cname = IsA()->GetName();
gROOT->ProcessLine(Form("%s* %s = (%s*)0x%lx;", cname, var_name, cname, this));
/**************************************************************************/
+//______________________________________________________________________________
void RenderElement::PadPaint(Option_t* option)
{
+ // Paint self and/or children into currently active pad.
+
if (GetRnrSelf() && GetObject())
GetObject()->Paint(option);
if (GetRnrChildren()) {
- for(List_i i=BeginChildren(); i!=EndChildren(); ++i) {
+ for (List_i i=BeginChildren(); i!=EndChildren(); ++i) {
(*i)->PadPaint(option);
}
}
/**************************************************************************/
+//______________________________________________________________________________
void RenderElement::SetRnrSelf(Bool_t rnr)
{
- if(rnr != fRnrSelf)
+ if (rnr != fRnrSelf)
{
fRnrSelf = rnr;
- for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i)
+ for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i)
{
- if(i->fItem->IsChecked() != rnr) {
+ if (i->fItem->IsChecked() != rnr) {
i->fItem->SetCheckBoxPictures(GetCheckBoxPicture(1, fRnrChildren),
GetCheckBoxPicture(0, fRnrChildren));
i->fItem->CheckItem(fRnrSelf);
}
}
+//______________________________________________________________________________
void RenderElement::SetRnrChildren(Bool_t rnr)
{
- if(rnr != fRnrChildren)
+ if (rnr != fRnrChildren)
{
fRnrChildren = rnr;
- for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i)
+ for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i)
{
i->fItem->SetCheckBoxPictures(GetCheckBoxPicture(fRnrSelf, fRnrChildren),
GetCheckBoxPicture(fRnrSelf, fRnrChildren));
}
}
+//______________________________________________________________________________
void RenderElement::SetRnrState(Bool_t rnr)
{
if (fRnrSelf != rnr || fRnrChildren != rnr)
/**************************************************************************/
+//______________________________________________________________________________
void RenderElement::SetMainColor(Color_t color)
{
+ // Set main color of the render-element.
+ // List-tree-items are updated.
+
Color_t oldcol = GetMainColor();
- for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
- if((*i)->GetMainColor() == oldcol) (*i)->SetMainColor(color);
+ for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
+ if ((*i)->GetMainColor() == oldcol) (*i)->SetMainColor(color);
}
if (fMainColorPtr) {
*fMainColorPtr = color;
- for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) {
- if(i->fItem->GetColor() != color) {
+ for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i) {
+ if (i->fItem->GetColor() != color) {
i->fItem->SetColor(GetMainColor());
i->fTree->ClearViewPort();
}
}
}
+//______________________________________________________________________________
void RenderElement::SetMainColor(Pixel_t pixel)
{
+ // Convert pixel to Color_t and call the above function.
+
SetMainColor(Color_t(TColor::GetColor(pixel)));
}
/**************************************************************************/
+//______________________________________________________________________________
TGListTreeItem* RenderElement::AddElement(RenderElement* el)
{
+ // Add el to the list of children.
+
+ static const Exc_t eH("RenderElement::AddElement ");
+
+ if ( ! AcceptRenderElement(el))
+ throw(eH + Form("parent '%s' rejects '%s'.",
+ GetRnrElName(), el->GetRnrElName()));
+
el->AddParent(this);
fChildren.push_back(el);
TGListTreeItem* ret = el->AddIntoListTrees(this);
return ret;
}
+//______________________________________________________________________________
void RenderElement::RemoveElement(RenderElement* el)
{
// Remove el from the list of children.
ElementChanged();
}
+//______________________________________________________________________________
void RenderElement::RemoveElementLocal(RenderElement* /*el*/)
{
// Perform additional local removal of el.
// Put into special function as framework-related handling of
// element removal should really be common to all classes and
// clearing of local structures happens in between removal
- // of list-tree-items and final untangling.
+ // of list-tree-items and final removal.
// If you override this, you should also override
// RemoveElementsLocal().
}
+//______________________________________________________________________________
void RenderElement::RemoveElements()
{
// Remove all elements. This assumes removing of all elements can be
// done more efficiently then looping over them and removing one by
// one.
- for(sLTI_i i=fItems.begin(); i!=fItems.end(); ++i)
+ for (sLTI_i i=fItems.begin(); i!=fItems.end(); ++i)
{
DestroyListSubTree(i->fTree, i->fItem);
}
RemoveElementsLocal();
- for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
+ for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
{
(*i)->RemoveParent(this);
}
ElementChanged();
}
+//______________________________________________________________________________
void RenderElement::RemoveElementsLocal()
{
// Perform additional local removal of all elements.
/**************************************************************************/
+//______________________________________________________________________________
void RenderElement::EnableListElements(Bool_t rnr_self, Bool_t rnr_children)
{
- for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
+ // Enable rendering of children and their list contents.
+ // Arguments control how to set self/child rendering.
+
+ for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
{
(*i)->SetRnrSelf(rnr_self);
(*i)->SetRnrChildren(rnr_children);
ElementChanged(kTRUE, kTRUE);
}
+//______________________________________________________________________________
void RenderElement::DisableListElements(Bool_t rnr_self, Bool_t rnr_children)
{
- for(List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
+ // Disable rendering of children and their list contents.
+ // Arguments control how to set self/child rendering.
+ //
+ // Same as above function, but default arguments are different. This
+ // is convenient for calls via context menu.
+
+ for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i)
{
(*i)->SetRnrSelf(rnr_self);
(*i)->SetRnrChildren(rnr_children);
/**************************************************************************/
+//______________________________________________________________________________
void RenderElement::Destroy()
{
static const Exc_t eH("RenderElement::Destroy ");
gReve->Redraw3D();
}
+//______________________________________________________________________________
void RenderElement::DestroyElements()
{
static const Exc_t eH("RenderElement::DestroyElements ");
- while( ! fChildren.empty()) {
+ while ( ! fChildren.empty()) {
RenderElement* c = fChildren.front();
if (c->fDenyDestroy <= 0)
{
try {
c->Destroy();
}
- catch(Exc_t exc) {
+ catch (Exc_t exc) {
Warning(eH, Form("element destruction failed: '%s'.", exc.Data()));
RemoveElement(c);
}
/**************************************************************************/
+//______________________________________________________________________________
Bool_t RenderElement::HandleElementPaste(RenderElement* el)
{
// React to element being pasted or dnd-ed.
return kTRUE;
}
+//______________________________________________________________________________
void RenderElement::ElementChanged(Bool_t update_scenes, Bool_t redraw)
{
if (update_scenes)
// Statics
/**************************************************************************/
+//______________________________________________________________________________
const TGPicture*
RenderElement::GetCheckBoxPicture(Bool_t rnrSelf, Bool_t rnrDaughters)
{
Int_t idx = 0;
- if(rnrSelf) idx = 2;
- if(rnrDaughters ) idx++;
+ if (rnrSelf) idx = 2;
+ if (rnrDaughters ) idx++;
return fgRnrIcons[idx];
}
/**************************************************************************/
/**************************************************************************/
-//______________________________________________________________________
+//______________________________________________________________________________
// Reve::RenderElementObjPtr
//
ClassImp(RenderElementObjPtr)
+//______________________________________________________________________________
RenderElementObjPtr::RenderElementObjPtr(TObject* obj, Bool_t own) :
RenderElement(),
fObject(obj),
fOwnObject(own)
-{}
+{
+ // Constructor.
+}
+//______________________________________________________________________________
RenderElementObjPtr::RenderElementObjPtr(TObject* obj, Color_t& mainColor, Bool_t own) :
RenderElement(mainColor),
fObject(obj),
fOwnObject(own)
-{}
+{
+ // Constructor.
+}
+//______________________________________________________________________________
TObject* RenderElementObjPtr::GetObject(Reve::Exc_t eh) const
{
+ // Return external object.
+ // Virtual from RenderElement.
+
if(fObject == 0)
throw(eh + "fObject not set.");
return fObject;
}
+//______________________________________________________________________________
void RenderElementObjPtr::ExportToCINT(Text_t* var_name)
{
+ // Export external object to CINT with variable name var_name.
+ // Virtual from RenderElement.
+
static const Exc_t eH("RenderElementObjPtr::ExportToCINT ");
TObject* obj = GetObject(eH);
gROOT->ProcessLine(Form("%s* %s = (%s*)0x%lx;", cname, var_name, cname, obj));
}
+//______________________________________________________________________________
RenderElementObjPtr::~RenderElementObjPtr()
{
+ // Destructor.
+
if(fOwnObject)
delete fObject;
}
-/**************************************************************************/
-/**************************************************************************/
+/******************************************************************************/
+/******************************************************************************/
-//______________________________________________________________________
+//______________________________________________________________________________
// Reve::RenderElementList
//
+// A list of render elements.
+// Class of acceptable children can be limited by setting the
+// fChildClass member.
+//
// !!! should have two ctors (like in RenderElement), one with Color_t&
// and set fDoColor automatically, based on which ctor is called.
ClassImp(RenderElementList)
+//______________________________________________________________________________
RenderElementList::RenderElementList(const Text_t* n, const Text_t* t, Bool_t doColor) :
RenderElement(),
TNamed(n, t),
fDoColor(doColor),
fChildClass(0)
{
+ // Constructor.
+
if(fDoColor) {
SetMainColorPtr(&fColor);
}
}
+//______________________________________________________________________________
Bool_t RenderElementList::AcceptRenderElement(RenderElement* el)
{
+ // Check if RenderElement el is inherited from fChildClass.
+ // Virtual from RenderElement.
+
if (fChildClass && ! el->IsA()->InheritsFrom(fChildClass))
return kFALSE;
return kTRUE;
class ZTrans;
+
+/******************************************************************************/
+// RenderElement
+/******************************************************************************/
+
class RenderElement
{
friend class ReveManager;
bool operator<(const ListTreeInfo& x) const
{ return fTree == x.fTree ? fItem < x.fItem : fTree < x.fTree; }
- ClassDef(ListTreeInfo, 0);
+ ClassDef(ListTreeInfo, 0); // Structure agregating data for a render element image in a list tree.
};
static const TGPicture* fgRnrIcons[4];
protected:
// TRef fSource;
- Bool_t fRnrSelf;
- Bool_t fRnrChildren;
- Color_t* fMainColorPtr;
+ Bool_t fRnrSelf; // Render this element.
+ Bool_t fRnrChildren; // Render children of this element.
+ Color_t* fMainColorPtr; // Pointer to main-color variable.
- sLTI_t fItems;
- List_t fParents;
+ sLTI_t fItems; // Set of list-tree-items.
+ List_t fParents; // List of parents.
- Bool_t fDestroyOnZeroRefCnt;
- Int_t fDenyDestroy;
+ Bool_t fDestroyOnZeroRefCnt; // Auto-destruct when ref-count reaches zero.
+ Int_t fDenyDestroy; // Deny-destroy count.
- List_t fChildren;
+ List_t fChildren; // List of children.
public:
RenderElement();
virtual Bool_t HandleElementPaste(RenderElement* el);
virtual void ElementChanged(Bool_t update_scenes=kTRUE, Bool_t redraw=kFALSE);
- virtual Bool_t CanEditRnrElement() { return kTRUE; }
- virtual Bool_t GetRnrSelf() const { return fRnrSelf; }
+ virtual Bool_t CanEditRnrElement() { return kTRUE; }
+ virtual Bool_t GetRnrSelf() const { return fRnrSelf; }
virtual Bool_t GetRnrChildren() const { return fRnrChildren; }
virtual void SetRnrSelf(Bool_t rnr);
virtual void SetRnrChildren(Bool_t rnr);
static const TGPicture* GetCheckBoxPicture(Bool_t rnrElement, Bool_t rnrDaughter);
virtual const TGPicture* GetListTreeIcon() { return fgListTreeIcons[0]; }
- ClassDef(RenderElement, 1);
+ ClassDef(RenderElement, 1); // Base class for visualization elements.
}; // endclass RenderElement
-/**************************************************************************/
+
+/******************************************************************************/
+// RenderElementObjPtr
+/******************************************************************************/
class RenderElementObjPtr : public RenderElement,
public TObject
RenderElementObjPtr& operator=(const RenderElementObjPtr&); // Not implemented
protected:
- TObject* fObject;
- Bool_t fOwnObject;
+ TObject* fObject; // External object holding the visual data.
+ Bool_t fOwnObject; // Is object owned / should be deleted on destruction.
public:
RenderElementObjPtr(TObject* obj, Bool_t own=kTRUE);
Bool_t GetOwnObject() const { return fOwnObject; }
void SetOwnObject(Bool_t o) { fOwnObject = o; }
- ClassDef(RenderElementObjPtr, 1);
+ ClassDef(RenderElementObjPtr, 1); // Render element with external TObject as visualization data holder.
}; // endclass RenderElementObjPtr
-/**************************************************************************/
+
+/******************************************************************************/
+// RenderElementList
+/******************************************************************************/
class RenderElementList : public RenderElement,
public TNamed
{
protected:
- Color_t fColor;
- Bool_t fDoColor;
- TClass *fChildClass;
+ Color_t fColor; // Color of the object.
+ Bool_t fDoColor; // Should serve fColor as the main color of the object.
+ TClass *fChildClass; // Class of acceptable children, others are rejected.
public:
RenderElementList(const Text_t* n="RenderElementList", const Text_t* t="",
virtual Bool_t AcceptRenderElement(RenderElement* el);
- ClassDef(RenderElementList, 1);
+ ClassDef(RenderElementList, 1); // List of render elements.
};
}
fGeometries ()
{
+ // Constructor.
+
static const Exc_t eH("ReveManager::ReveManager ");
if (gReve != 0)
}
ReveManager::~ReveManager()
-{}
+{
+ // Destructor.
+}
/**************************************************************************/
TCanvas* ReveManager::AddCanvasTab(const char* name)
{
+ // Add a new canvas tab.
+
fBrowser->StartEmbedding(1, -1);
TCanvas* c = new TCanvas;
fBrowser->StopEmbedding();
TGWindow* ReveManager::GetMainWindow() const
{
+ // Get the main window, i.e. the first created reve-browser.
+
return fBrowser;
}
TGLViewer* ReveManager::GetGLViewer() const
{
+ // Get default TGLViewer.
+
return fViewer->GetGLViewer();
}
-Viewer* ReveManager::SpawnNewViewer(const Text_t* name, const Text_t* title, Bool_t embed)
+Viewer* ReveManager::SpawnNewViewer(const Text_t* name, const Text_t* title,
+ Bool_t embed)
{
+ // Create a new GL viewer.
+
Viewer* v = new Viewer(name, title);
if (embed) fBrowser->StartEmbedding(1);
Scene* ReveManager::SpawnNewScene(const Text_t* name, const Text_t* title)
{
+ // Create a new scene.
+
Scene* s = new Scene(name, title);
AddRenderElement(s, fScenes);
return s;
void ReveManager::RegisterRedraw3D()
{
+ // Register a request for 3D redraw.
+
fRedrawTimer.Start(0, kTRUE);
fTimerActive = true;
}
void ReveManager::DoRedraw3D()
{
+ // Perform 3D redraw of scenes and viewers whose contents has
+ // changed.
+
// printf("ReveManager::DoRedraw3D redraw triggered\n");
fScenes ->RepaintChangedScenes();
void ReveManager::FullRedraw3D(Bool_t resetCameras, Bool_t dropLogicals)
{
+ // Perform 3D redraw of all scenes and viewers.
+
fScenes ->RepaintAllScenes();
fViewers->RepaintAllViewers(resetCameras, dropLogicals);
}
TGListTreeItem* ReveManager::AddRenderElement(RenderElement* rnr_element,
RenderElement* parent)
{
- static const Exc_t eH("ReveManager::AddRenderElement ");
-
- if (parent && ! parent->AcceptRenderElement(rnr_element)) {
- throw(eH + Form("parent '%s' rejects '%s'.",
- parent->GetRnrElName(), rnr_element->GetRnrElName()));
- }
-
if (parent == 0) {
if (fCurrentEvent == 0)
AddEvent(new EventBase("Event", "Auto-created event directory"));
parent = fCurrentEvent;
}
- TGListTreeItem* newitem = parent->AddElement(rnr_element);
-
- return newitem;
+ return parent->AddElement(rnr_element);
}
TGListTreeItem* ReveManager::AddGlobalRenderElement(RenderElement* rnr_element,
- RenderElement* parent)
+ RenderElement* parent)
{
- static const Exc_t eH("ReveManager::AddGlobalRenderElement ");
-
- if (parent && ! parent->AcceptRenderElement(rnr_element)) {
- throw(eH + "parent '%s' rejects '%s'.",
- parent->GetObject()->GetName(), rnr_element->GetObject()->GetName());
- }
-
if (parent == 0)
parent = fGlobalScene;
- parent->AddElement(rnr_element);
-
- TGListTreeItem* newitem =
- rnr_element->AddIntoListTrees(parent);
-
- return newitem;
+ return parent->AddElement(rnr_element);
}
/**************************************************************************/
{
rnrEl->SetRnrState(state);
- if(fEditor->GetModel() == rnrEl->GetEditorObject()) {
+ if (fEditor->GetModel() == rnrEl->GetEditorObject())
fEditor->DisplayRenderElement(rnrEl);
- }
rnrEl->ElementChanged();
}
void ReveManager::NotifyBrowser(TGListTreeItem* parent_lti)
{
TGListTree* lt = GetListTree();
- if(parent_lti)
+ if (parent_lti)
lt->OpenItem(parent_lti);
lt->ClearViewPort();
}
filename.Data(), exp_filename.Data());
std::map<TString, TGeoManager*>::iterator g = fGeometries.find(filename);
- if(g != fGeometries.end()) {
+ if (g != fGeometries.end()) {
return g->second;
} else {
- if(gSystem->AccessPathName(exp_filename, kReadPermission))
+ if (gSystem->AccessPathName(exp_filename, kReadPermission))
throw(eH + "file '" + exp_filename + "' not readable.");
gGeoManager = 0;
TGeoManager::Import(filename);
- if(gGeoManager == 0)
+ if (gGeoManager == 0)
throw(eH + "GeoManager import failed.");
gGeoManager->GetTopVolume()->VisibleDaughters(1);
TFile f(exp_filename, "READ");
TObjArray* collist = (TObjArray*) f.Get("ColorList");
f.Close();
- if(collist != 0) {
+ if (collist != 0) {
TIter next(gGeoManager->GetListOfVolumes());
TGeoVolume* vol;
while ((vol = (TGeoVolume*) next()) != 0)
void SetStatusLine(const char* text);
void ThrowException(const char* text="foo");
- ClassDef(ReveManager, 0);
+ ClassDef(ReveManager, 0); // Reve application manager.
};
} // namespace Reve
virtual void Paint(Option_t* option = "");
virtual const TGPicture* GetListTreeIcon() { return RenderElement::fgListTreeIcons[2]; }
- ClassDef(Scene, 0);
+
+ ClassDef(Scene, 0); // Reve representation of TGLScene.
}; // endclass Scene
void RepaintChangedScenes();
void RepaintAllScenes();
- ClassDef(SceneList, 0);
+ ClassDef(SceneList, 0); // List of Scenes.
}; // endclass SceneList
}
virtual Bool_t AcceptRenderElement(RenderElement* el);
virtual Bool_t HandleElementPaste(RenderElement* el);
- ClassDef(SceneInfo, 0);
+ ClassDef(SceneInfo, 0); // Reve representation of TGLSceneInfo.
}; // endclass SceneInfo
}
virtual TClass* ProjectedClass() const;
- ClassDef(StraightLineSet, 1);
+ ClassDef(StraightLineSet, 1); // Set of lines and optional markers.
}; // endclass StraightLineSet
virtual void UpdateProjection();
- ClassDef(NLTSLineSet, 1);
+ ClassDef(NLTSLineSet, 1); // NLT projected StraightLineSet.
}; // endclass NLTSLineSet
} // Reve
fPathMarks(),
fRnrStyle(0)
-{}
+{
+ // Default constructor.
+}
//______________________________________________________________________________
Track::Track(TParticle* t, Int_t label, TrackRnrStyle* rs):
fRnrStyle(0)
{
+ // Constructor from TParticle.
+
SetRnrStyle(rs);
fMainColorPtr = &fLineColor;
fRnrStyle(0)
{
+ // Constructor from Reve Monte Carlo track.
+
SetRnrStyle(rs);
fMainColorPtr = &fLineColor;
fRnrStyle(0)
{
+ // Constructor from Reve reconstructed track.
+
SetRnrStyle(rs);
fMainColorPtr = &fLineColor;
//______________________________________________________________________________
Track::~Track()
{
+ // Destructor.
+
SetRnrStyle(0);
for (vpPathMark_i i=fPathMarks.begin(); i!=fPathMarks.end(); ++i)
delete *i;
//______________________________________________________________________________
void Track::SetRnrStyle(TrackRnrStyle* rs)
{
- if (fRnrStyle == rs) return;
+ // Set track's render style.
+ // Reference counts of old and new render-style are updated.
+
+ if (fRnrStyle == rs) return;
if (fRnrStyle) fRnrStyle->DecRefCount(this);
fRnrStyle = rs;
if (fRnrStyle) rs->IncRefCount(this);
//______________________________________________________________________________
void Track::SetAttLineAttMarker(TrackList* tl)
{
+ // Set line and marker attributes from TrackList.
+
SetLineColor(tl->GetLineColor());
SetLineStyle(tl->GetLineStyle());
SetLineWidth(tl->GetLineWidth());
//______________________________________________________________________________
void Track::MakeTrack(Bool_t recurse)
{
+ // Calculate track representation based on track data and current
+ // settings of the render-style.
+ // If recurse is true, descend into children.
+
TrackRnrStyle& RS((fRnrStyle != 0) ? *fRnrStyle : TrackRnrStyle::fgDefStyle);
Float_t px = fP.x, py = fP.y, pz = fP.z;
//______________________________________________________________________________
TClass* Track::ProjectedClass() const
{
+ // Virtual from NLTProjectable, return NLTTrack class.
+
return NLTTrack::Class();
}
//______________________________________________________________________________
void Track::SortPathMarksByTime()
{
+ // Sort registerd pat-marks by time.
+
std::sort(fPathMarks.begin(), fPathMarks.end(), cmp_pathmark());
}
//______________________________________________________________________________
void Track::ImportHits()
{
+ // Import hits with same label as the track.
+ // Uses macro "hits_from_label.C".
+
Reve::LoadMacro("hits_from_label.C");
gROOT->ProcessLine(Form("hits_from_label(%d, (Reve::RenderElement*)%p);",
fLabel, this));
//______________________________________________________________________________
void Track::ImportClusters()
{
+ // Import clusters with same label as the track.
+ // Uses macro "clusters_from_label.C".
+
Reve::LoadMacro("clusters_from_label.C");
gROOT->ProcessLine(Form("clusters_from_label(%d, (Reve::RenderElement*)%p);",
fLabel, this));
//______________________________________________________________________________
void Track::ImportClustersFromIndex()
{
+ // Import clusters marked with same reconstructed track index as the track.
+ // Uses macro "clusters_from_index.C".
+
static const Exc_t eH("Track::ImportClustersFromIndex ");
if (fIndex == kMinInt)
//______________________________________________________________________________
void Track::ImportKine()
{
+ // Import kinematics of the track's label recursively.
+ // Uses macro "kine_tracks.C".
+
static const Exc_t eH("Track::ImportKine ");
if (fLabel == kMinInt)
void Track::ImportKineWithArgs(Bool_t importMother, Bool_t importDaugters,
Bool_t colorPdg, Bool_t recurse)
{
+ // Import kinematics of the track's label. Arguments steer the
+ // import process:
+ // importMother import particle with track's label
+ // importDaugters import direct daughters of label
+ // colorPdg color kinematics by PDG code
+ // recurse recursive import of daughters' daughters
+ // Uses macro "kine_tracks.C".
+
static const Exc_t eH("Track::ImportKineWithArgs ");
if (fLabel == kMinInt)
//______________________________________________________________________________
void Track::PrintKineStack()
{
+ // Print kinematics pertaining to track's label.
+ // Uses macro "print_kine_from_label.C".
+
static const Exc_t eH("Track::PrintKineStack ");
if (fLabel == kMinInt)
//______________________________________________________________________________
void Track::PrintPathMarks()
{
+ // Print registered path-marks.
+
static const Exc_t eH("Track::PrintPathMarks ");
printf("Track '%s', number of path marks %d, label %d\n",
//______________________________________________________________________________
void Track::CtrlClicked(Reve::Track* track)
{
+ // Emits "CtrlClicked(Reve::Track*)" signal.
+ // Called from TrackGL on secondary-selection.
+
Emit("CtrlClicked(Reve::Track*)", (Long_t)track);
}
//______________________________________________________________________________
void Track::SetLineStyle(Style_t lstyle)
{
+ // Set line-style of the track.
+ // The style is propagated to projected tracks.
+
TAttLine::SetLineStyle(lstyle);
std::list<NLTProjected*>::iterator pi = fProjectedList.begin();
while (pi != fProjectedList.end())
//______________________________________________________________________________
void TrackList::SelectByPt(Float_t min_pt, Float_t max_pt)
{
+ // Select visibility of tracks by transverse momentum.
+ // If data-member fRecurse is set, the selection is applied
+ // recursively to all children.
+
fMinPt = min_pt;
fMaxPt = max_pt;
//______________________________________________________________________________
void TrackList::SelectByPt(Float_t min_pt, Float_t max_pt, RenderElement* el)
{
+ // Select visibility of el's children tracks by transverse momentum.
+
const Float_t minptsq = min_pt*min_pt;
const Float_t maxptsq = max_pt*max_pt;
//______________________________________________________________________________
void TrackList::SelectByP(Float_t min_p, Float_t max_p)
{
+ // Select visibility of tracks by momentum.
+ // If data-member fRecurse is set, the selection is applied
+ // recursively to all children.
+
fMinP = min_p;
fMaxP = max_p;
//______________________________________________________________________________
void TrackList::SelectByP(Float_t min_p, Float_t max_p, RenderElement* el)
{
+ // Select visibility of el's children tracks by momentum.
+
const Float_t minpsq = min_p*min_p;
const Float_t maxpsq = max_p*max_p;
//______________________________________________________________________________
void TrackList::ImportHits()
{
+ // Import hits for all track.
+
for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
((Track*)(*i))->ImportHits();
}
//______________________________________________________________________________
void TrackList::ImportClusters()
{
+ // Import clusters for all track.
+
for (List_i i=fChildren.begin(); i!=fChildren.end(); ++i) {
((Track*)(*i))->ImportClusters();
}
//______________________________________________________________________________
TClass* TrackList::ProjectedClass() const
{
+ // Virtual from NLTProjectable, returns NLTTrackList class.
+
return NLTTrackList::Class();
}
//______________________________________________________________________________
// TrackCounter
//
+// Provides event-based method for tagging of good / bad (or primary /
+// secondary) tracks. A report can be written into a text file.
+//
+// Track status is toggled by using secondary-selection / ctrl-click
+// functionality of the GL viewer.
+//
+// Some of the functionality is implemented in TrackCounterEditor
+// class.
ClassImp(TrackCounter)
TrackCounter* TrackCounter::fgInstance = 0;
+//______________________________________________________________________________
TrackCounter::TrackCounter(const Text_t* name, const Text_t* title) :
RenderElement(),
TNamed(name, title),
fGoodTracks (0),
fTrackLists ()
{
+ // Constructor.
+ // Connects to global signal "Reve::Track", "CtrlClicked(Reve::Track*)".
+
if (fgInstance == 0) fgInstance = this;
TQObject::Connect("Reve::Track", "CtrlClicked(Reve::Track*)",
"Reve::TrackCounter", this, "DoTrackAction(Reve::Track*)");
}
+//______________________________________________________________________________
TrackCounter::~TrackCounter()
{
+ // Destructor.
+ // Disconnect from the global track signals.
+
TQObject::Disconnect("Reve::Track", "DoTrackAction(Reve::Track*)");
if (fgInstance == this) fgInstance = 0;
}
/**************************************************************************/
+//______________________________________________________________________________
void TrackCounter::Reset()
{
+ // Reset internal track-counters and track-list.
+
printf("TrackCounter::Reset()\n");
fAllTracks = 0;
fGoodTracks = 0;
fTrackLists.Clear("nodelete");
}
+//______________________________________________________________________________
void TrackCounter::RegisterTracks(TrackList* tlist, Bool_t goodTracks)
{
- // printf("TrackCounter::RegisterTracks '%s', %s\n",
- // tlist->GetObject()->GetName(), goodTracks ? "good" : "bad");
+ // Register tracks from tlist and tlist itself.
+ // If goodTracks is true, they are considered as primary/good
+ // tracks.
tlist->IncDenyDestroy();
fTrackLists.Add(tlist);
}
}
+//______________________________________________________________________________
void TrackCounter::DoTrackAction(Track* track)
{
- // !!!! No check done if ok.
- // !!!! Should also override RemoveElementLocal
- // !!!! But then ... should also store local information if track is ok.
+ // Slot called when track is ctrl-clicked.
+ //
+ // No check is done if track actually belongs to one of the
+ // registered track-lists.
+ //
+ // Probably it would be safer to copy good/bad tracks into special
+ // sub-containers.
+ // In this case one should also override RemoveElementLocal.
switch (fClickAction)
{
/**************************************************************************/
+//______________________________________________________________________________
void TrackCounter::OutputEventTracks(FILE* out)
{
+ // Print good-track summary into a plain-text file by iteration
+ // through all registered track-lists.
+ // State of each track is determined by its line-style, it is
+ // considered a good track if it's line style is solid.
+
if (out == 0)
{
out = stdout;
TrackCounter& operator=(const TrackCounter&); // Not implemented
protected:
- Int_t fBadLineStyle;
- Int_t fClickAction;
+ Int_t fBadLineStyle; // Line-style used for secondary/bad tracks.
+ Int_t fClickAction; // Action to take when a track is ctrl-clicked.
- Int_t fEventId;
+ Int_t fEventId; // Current event-id.
- Int_t fAllTracks;
- Int_t fGoodTracks;
+ Int_t fAllTracks; // Counter of all tracks.
+ Int_t fGoodTracks; // Counter of good tracks.
- TList fTrackLists;
+ TList fTrackLists; // List of TrackLists registered for management.
public:
TrackCounter(const Text_t* name="TrackCounter", const Text_t* title="");
// If input is composed from triangles with direct vertex coordinates
// one should consider finding all occurences of the same vertex
// and specifying it only once.
+//
ClassImp(TriangleSet)
fColor (2), fTransp(0),
fHMTrans ()
{
+ // Constructor.
+
fVerts = new Float_t[3*fNVerts];
fTrings = new Int_t [3*fNTrings];
fTringNorms = (norms) ? new Float_t[3*fNTrings] : 0;
TriangleSet::~TriangleSet()
{
+ // Destructor.
+
delete [] fVerts;
delete [] fTrings;
delete [] fTringNorms;
void TriangleSet::GenerateTriangleNormals()
{
+ // Generate triangle normals via cross product of triangle edges.
+
if (fTringNorms == 0) fTringNorms = new Float_t[3*fNTrings];
TVector3 e1, e2, n;
void TriangleSet::GenerateRandomColors()
{
+ // Assign random colors to all triangles.
+
if (fTringCols == 0) fTringCols = new UChar_t[3*fNTrings];
TRandom r;
void TriangleSet::GenerateZNormalColors(Float_t fac, Int_t min, Int_t max,
Bool_t interp, Bool_t wrap)
{
+ // Generate triangle colors by the z-component of the normal.
+ // Current palette is taken from gStyle.
+
if (fTringCols == 0) fTringCols = new UChar_t[3*fNTrings];
if (fTringNorms == 0) GenerateTriangleNormals();
static TriangleSet* ReadTrivialFile(const char* file);
- ClassDef(TriangleSet, 0)
+ ClassDef(TriangleSet, 0); // Generic triangle mesh or soup.
}; // endclass TriangleSet
}
TriangleSetEditor& operator=(const TriangleSetEditor&); // Not implemented
protected:
- TriangleSet* fM; // fModel dynamic-casted to TriangleSetEditor
+ TriangleSet *fM; // Model object.
- ZTransSubEditor *fHMTrans;
+ ZTransSubEditor *fHMTrans; // Sub-editor of transforamtion matrix.
public:
TriangleSetEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
virtual void SetModel(TObject* obj);
- ClassDef(TriangleSetEditor, 1); // Editor for TriangleSet
+ ClassDef(TriangleSetEditor, 1); // Editor for TriangleSet class.
}; // endclass TriangleSetEditor
}
//______________________________________________________________________
// TriangleSetGL
//
+// GL-renderer for TriangleSet class.
+//
+// See also: TGLObject, TGLLogicalShape.
using namespace Reve;
TriangleSetGL::TriangleSetGL() : TGLObject(), fM(0)
{
+ // Constructor.
+
// fDLCache = false; // Disable display list.
}
TriangleSetGL::~TriangleSetGL()
-{}
+{
+ // Destructor.
+}
/**************************************************************************/
Bool_t TriangleSetGL::SetModel(TObject* obj, const Option_t* /*opt*/)
{
+ // Set model object.
+
if(SetModelCheckClass(obj, TriangleSet::Class())) {
fM = dynamic_cast<TriangleSet*>(obj);
return kTRUE;
void TriangleSetGL::SetBBox()
{
+ // Set bounding-box from the model.
+
// !! This ok if master sub-classed from TAttBBox
SetAxisAlignedBBox(((TriangleSet*)fExternalObj)->AssertBBox());
}
void TriangleSetGL::DirectDraw(TGLRnrCtx & /*rnrCtx*/) const
{
+ // Low-level GL rendering.
+
TriangleSet& TS = *fM;
Bool_t isScaled = TS.fHMTrans.IsScale();
TriangleSetGL& operator=(const TriangleSetGL&); // Not implemented
protected:
- TriangleSet* fM; // fModel dynamic-casted to TriangleSetGL
+ TriangleSet* fM; // Model object.
virtual void DirectDraw(TGLRnrCtx & rnrCtx) const;
// virtual Bool_t SupportsSecondarySelect() const { return kTRUE; }
// virtual void ProcessSelection(UInt_t* ptr, TGLViewer*, TGLScene*);
- ClassDef(TriangleSetGL, 0);
+ ClassDef(TriangleSetGL, 0); // GL-renderer for TriangleSet class.
}; // endclass TriangleSetGL
}
virtual const TGPicture* GetListTreeIcon() { return RenderElement::fgListTreeIcons[1]; }
- ClassDef(Viewer, 0);
+ ClassDef(Viewer, 0); // Reve representation of TGLViewer.
}; // endclass Viewer
void SceneDestructing(Scene* scene);
- ClassDef(ViewerList, 0);
+ ClassDef(ViewerList, 0); // List of Viewers.
}; // endclass ViewerList
}
void DoEditTrans();
void DoTransChanged();
- ClassDef(ZTransSubEditor, 0)
+ ClassDef(ZTransSubEditor, 0); // Sub-editor for ZTrans class.
};
class ZTransEditor : public TGedFrame
ZTransEditor& operator=(const ZTransEditor&); // Not implemented
protected:
- ZTrans* fM; // fModel dynamic-casted to ZTransEditor
-
- // Declare widgets
- // TGSomeWidget* fXYZZ;
+ ZTrans* fM; // Model object.
public:
ZTransEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
virtual void SetModel(TObject* obj);
- // Declare callback/slot methods
- // void DoXYZZ();
-
- ClassDef(ZTransEditor, 1); // Editor for ZTrans
+ ClassDef(ZTransEditor, 1); // Editor for ZTrans class.
}; // endclass ZTransEditor
}