Logo ROOT   6.10/09
Reference Guide
TEveStraightLineSet.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TEveStraightLineSet
13 #define ROOT_TEveStraightLineSet
14 
15 #include "TEveUtil.h"
16 
17 #include <Gtypes.h>
18 #include "TNamed.h"
19 #include "TQObject.h"
20 #include "TAtt3D.h"
21 #include "TAttMarker.h"
22 #include "TAttLine.h"
23 #include "TAttBBox.h"
24 
25 #include "TEveUtil.h"
26 #include "TEveElement.h"
27 #include "TEveProjectionBases.h"
28 #include "TEveChunkManager.h"
29 #include "TEveTrans.h"
30 
31 class TRandom;
32 
34  public TEveProjectable,
35  public TNamed,
36  public TQObject,
37  public TAtt3D,
38  public TAttLine,
39  public TAttMarker,
40  public TAttBBox
41 {
42 private:
43  TEveStraightLineSet(const TEveStraightLineSet&); // Not implemented
44  TEveStraightLineSet& operator=(const TEveStraightLineSet&); // Not implemented
45 
46 public:
47  struct Line_t
48  {
53 
55  Float_t x2, Float_t y2, Float_t z2) : fId(-1), fRef()
56  {
57  fV1[0] = x1, fV1[1] = y1, fV1[2] = z1;
58  fV2[0] = x2, fV2[1] = y2, fV2[2] = z2;
59  }
60  };
61 
62  struct Marker_t
63  {
64  Float_t fV[3];
67 
68  Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id) : fLineId(line_id), fRef()
69  {
70  fV[0] = x, fV[1] = y, fV[2] = z;
71  }
72  };
73 
74 protected:
77 
78  Bool_t fOwnLinesIds; // Flag specifying if id-objects are owned by the line-set
79  Bool_t fOwnMarkersIds; // Flag specifying if id-objects are owned by the line-set
80 
83 
85 
87 
88 public:
89  TEveStraightLineSet(const char* n="StraightLineSet", const char* t="");
90  virtual ~TEveStraightLineSet() {}
91 
92  virtual void SetLineColor(Color_t col) { SetMainColor(col); }
93 
95  Line_t* AddLine(const TEveVector& p1, const TEveVector& p2);
96  Marker_t* AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1);
97  Marker_t* AddMarker(const TEveVector& p, Int_t line_id=-1);
98  Marker_t* AddMarker(Int_t line_id, Float_t pos);
99 
100  void SetLine(int idx, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2);
101  void SetLine(int idx, const TEveVector& p1, const TEveVector& p2);
102 
105 
106  virtual Bool_t GetRnrMarkers() { return fRnrMarkers; }
107  virtual Bool_t GetRnrLines() { return fRnrLines; }
108  virtual Bool_t GetDepthTest() { return fDepthTest; }
109 
110  virtual void SetRnrMarkers(Bool_t x) { fRnrMarkers = x; }
111  virtual void SetRnrLines(Bool_t x) { fRnrLines = x; }
112  virtual void SetDepthTest(Bool_t x) { fDepthTest = x; }
113 
114  virtual void CopyVizParams(const TEveElement* el);
115  virtual void WriteVizParams(std::ostream& out, const TString& var);
116 
117  virtual TClass* ProjectedClass(const TEveProjection* p) const;
118 
119  virtual void ComputeBBox();
120  virtual void Paint(Option_t* option="");
121 
122  ClassDef(TEveStraightLineSet, 0); // Set of straight lines with optional markers along the lines.
123 };
124 
125 
126 /******************************************************************************/
127 
129  public TEveProjected
130 {
131 private:
134 
135 protected:
136  virtual void SetDepthLocal(Float_t d);
137 
138 public:
141 
142  virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
143  virtual void UpdateProjection();
144  virtual TEveElement* GetProjectedAsElement() { return this; }
145 
146  ClassDef(TEveStraightLineSetProjected, 0); // Projected copy of a TEveStraightLineSet.
147 };
148 
149 #endif
Abstract base class for classes that hold results of a non-linear projection transformation.
virtual Bool_t GetDepthTest()
virtual TClass * ProjectedClass(const TEveProjection *p) const
Return class of projected object.
virtual TEveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to TEveElement.
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
Line_t(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
TEveChunkManager fLinePlex
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
virtual void SetDepthTest(Bool_t x)
This is the ROOT implementation of the Qt object communication mechanism (see also http://www...
Definition: TQObject.h:49
virtual void Paint(Option_t *option="")
Paint the line-set.
Basic string class.
Definition: TString.h:129
virtual void SetRnrLines(Bool_t x)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void SetRnrMarkers(Bool_t x)
TEveChunkManager & GetLinePlex()
Marker Attributes class.
Definition: TAttMarker.h:19
Persistent Reference link to a TObject A TRef is a lightweight object pointing to any TObject...
Definition: TRef.h:32
static const double x2[5]
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:297
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual void SetLineColor(Color_t col)
Set the line color.
static double p2(double t, double a, double b, double c)
Base-class for non-linear projections.
Projected replica of a TEveStraightLineSet.
Manager class for steering of projections and managing projected objects.
short Color_t
Definition: RtypesCore.h:79
TEveChunkManager & GetMarkerPlex()
TEveStraightLineSet & operator=(const TEveStraightLineSet &)
Abstract base-class for non-linear projectable objects.
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write visualization parameters.
TEveStraightLineSet(const TEveStraightLineSet &)
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:71
Vector-like container with chunked memory allocation.
static double p1(double t, double a, double b)
virtual void SetMainColor(Color_t color)
Set main color of the element.
static const double x1[5]
TEveChunkManager fMarkerPlex
Double_t y[n]
Definition: legend1.C:17
Marker_t * AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1)
Add a marker with given position.
Line_t * AddLine(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Add a line.
you should not use this method at all Int_t Int_t z
Definition: TRolke.cxx:630
virtual Bool_t GetRnrLines()
Helper for management of bounding-box information.
Definition: TAttBBox.h:17
virtual Bool_t GetRnrMarkers()
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
const Int_t n
Definition: legend1.C:16
Line Attributes class.
Definition: TAttLine.h:18
void SetLine(int idx, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Set line vertices with given index.
Set of straight lines with optional markers along the lines.
Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id)
virtual void ComputeBBox()
Compute bounding-box.