Logo ROOT   6.18/05
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 "TNamed.h"
18#include "TQObject.h"
19#include "TAtt3D.h"
20#include "TAttMarker.h"
21#include "TAttLine.h"
22#include "TAttBBox.h"
23
24#include "TEveUtil.h"
25#include "TEveElement.h"
26#include "TEveProjectionBases.h"
27#include "TEveChunkManager.h"
28#include "TEveTrans.h"
29
30class TRandom;
31
33 public TEveProjectable,
34 public TNamed,
35 public TQObject,
36 public TAtt3D,
37 public TAttLine,
38 public TAttMarker,
39 public TAttBBox
40{
41private:
42 TEveStraightLineSet(const TEveStraightLineSet&); // Not implemented
44
45public:
46 struct Line_t
47 {
52
54 Float_t x2, Float_t y2, Float_t z2) : fId(-1), fRef()
55 {
56 fV1[0] = x1, fV1[1] = y1, fV1[2] = z1;
57 fV2[0] = x2, fV2[1] = y2, fV2[2] = z2;
58 }
59 };
60
61 struct Marker_t
62 {
66
67 Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id) : fLineId(line_id), fRef()
68 {
69 fV[0] = x, fV[1] = y, fV[2] = z;
70 }
71 };
72
73protected:
76
77 Bool_t fOwnLinesIds; // Flag specifying if id-objects are owned by the line-set
78 Bool_t fOwnMarkersIds; // Flag specifying if id-objects are owned by the line-set
79
82
84
86
87public:
88 TEveStraightLineSet(const char* n="StraightLineSet", const char* t="");
90
91 virtual void SetLineColor(Color_t col) { SetMainColor(col); }
92
93 Line_t* AddLine(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2);
94 Line_t* AddLine(const TEveVector& p1, const TEveVector& p2);
95 Marker_t* AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1);
96 Marker_t* AddMarker(const TEveVector& p, Int_t line_id=-1);
97 Marker_t* AddMarker(Int_t line_id, Float_t pos);
98
99 void SetLine(int idx, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2);
100 void SetLine(int idx, const TEveVector& p1, const TEveVector& p2);
101
104
105 virtual Bool_t GetRnrMarkers() { return fRnrMarkers; }
106 virtual Bool_t GetRnrLines() { return fRnrLines; }
107 virtual Bool_t GetDepthTest() { return fDepthTest; }
108
109 virtual void SetRnrMarkers(Bool_t x) { fRnrMarkers = x; }
110 virtual void SetRnrLines(Bool_t x) { fRnrLines = x; }
111 virtual void SetDepthTest(Bool_t x) { fDepthTest = x; }
112
113 virtual void CopyVizParams(const TEveElement* el);
114 virtual void WriteVizParams(std::ostream& out, const TString& var);
115
116 virtual TClass* ProjectedClass(const TEveProjection* p) const;
117
118 virtual void ComputeBBox();
119 virtual void Paint(Option_t* option="");
120
121 ClassDef(TEveStraightLineSet, 0); // Set of straight lines with optional markers along the lines.
122};
123
124
125/******************************************************************************/
126
128 public TEveProjected
129{
130private:
133
134protected:
135 virtual void SetDepthLocal(Float_t d);
136
137public:
140
141 virtual void SetProjection(TEveProjectionManager* mng, TEveProjectable* model);
142 virtual void UpdateProjection();
143 virtual TEveElement* GetProjectedAsElement() { return this; }
144
145 ClassDef(TEveStraightLineSetProjected, 0); // Projected copy of a TEveStraightLineSet.
146};
147
148#endif
#define d(i)
Definition: RSha256.hxx:102
static const double x2[5]
static const double x1[5]
int Int_t
Definition: RtypesCore.h:41
short Marker_t
Definition: RtypesCore.h:77
bool Bool_t
Definition: RtypesCore.h:59
short Color_t
Definition: RtypesCore.h:79
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
Use this attribute class when an object should have 3D capabilities.
Definition: TAtt3D.h:19
Helper for management of bounding-box information.
Definition: TAttBBox.h:18
Line Attributes class.
Definition: TAttLine.h:18
Marker Attributes class.
Definition: TAttMarker.h:19
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
Vector-like container with chunked memory allocation.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:34
virtual void SetMainColor(Color_t color)
Set main color of the element.
Abstract base-class for non-linear projectable objects.
Abstract base class for classes that hold results of a non-linear projection transformation.
Manager class for steering of projections and managing projected objects.
Base-class for non-linear projections.
Projected replica of a TEveStraightLineSet.
virtual void SetDepthLocal(Float_t d)
Set depth (z-coordinate) of the projected points.
virtual TEveElement * GetProjectedAsElement()
Returns this projected dynamic-casted to TEveElement.
virtual void UpdateProjection()
Callback that actually performs the projection.
virtual void SetProjection(TEveProjectionManager *mng, TEveProjectable *model)
Set projection manager and model object.
TEveStraightLineSetProjected(const TEveStraightLineSetProjected &)
TEveStraightLineSetProjected & operator=(const TEveStraightLineSetProjected &)
Set of straight lines with optional markers along the lines.
TEveStraightLineSet(const TEveStraightLineSet &)
virtual void SetRnrMarkers(Bool_t x)
virtual void CopyVizParams(const TEveElement *el)
Copy visualization parameters from element el.
virtual void Paint(Option_t *option="")
Paint the line-set.
virtual Bool_t GetDepthTest()
TEveChunkManager & GetMarkerPlex()
virtual void SetRnrLines(Bool_t x)
virtual TClass * ProjectedClass(const TEveProjection *p) const
Return class of projected object.
Marker_t * AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1)
Add a marker with given position.
virtual Bool_t GetRnrLines()
virtual void SetLineColor(Color_t col)
Set the line color.
Line_t * AddLine(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Add a line.
TEveChunkManager fLinePlex
virtual void ComputeBBox()
Compute bounding-box.
TEveChunkManager & GetLinePlex()
virtual void WriteVizParams(std::ostream &out, const TString &var)
Write visualization parameters.
TEveStraightLineSet & operator=(const TEveStraightLineSet &)
virtual void SetDepthTest(Bool_t x)
virtual Bool_t GetRnrMarkers()
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.
TEveChunkManager fMarkerPlex
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition: TQObject.h:48
This is the base class for the ROOT Random number generators.
Definition: TRandom.h:27
Persistent Reference link to a TObject A TRef is a lightweight object pointing to any TObject.
Definition: TRef.h:32
Basic string class.
Definition: TString.h:131
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
Line_t(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2)
Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id)