Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "TEveElement.h"
25#include "TEveProjectionBases.h"
26#include "TEveChunkManager.h"
27#include "TEveTrans.h"
28
29class TRandom;
30
32 public TEveProjectable,
33 public TNamed,
34 public TQObject,
35 public TAtt3D,
36 public TAttLine,
37 public TAttMarker,
38 public TAttBBox
39{
40private:
41 TEveStraightLineSet(const TEveStraightLineSet&); // Not implemented
43
44public:
45 struct Line_t
46 {
51
53 Float_t x2, Float_t y2, Float_t z2) : fId(-1), fRef()
54 {
55 fV1[0] = x1, fV1[1] = y1, fV1[2] = z1;
56 fV2[0] = x2, fV2[1] = y2, fV2[2] = z2;
57 }
58 };
59
60 struct Marker_t
61 {
65
66 Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id) : fLineId(line_id), fRef()
67 {
68 fV[0] = x, fV[1] = y, fV[2] = z;
69 }
70 };
71
72protected:
75
76 Bool_t fOwnLinesIds; // Flag specifying if id-objects are owned by the line-set
77 Bool_t fOwnMarkersIds; // Flag specifying if id-objects are owned by the line-set
78
81
83
85
86public:
87 TEveStraightLineSet(const char* n="StraightLineSet", const char* t="");
89
90 void SetLineColor(Color_t col) override { SetMainColor(col); }
91
93 Line_t* AddLine(const TEveVector& p1, const TEveVector& p2);
94 Marker_t* AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1);
95 Marker_t* AddMarker(const TEveVector& p, Int_t line_id=-1);
96 Marker_t* AddMarker(Int_t line_id, Float_t pos);
97
98 void SetLine(int idx, Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, Float_t z2);
99 void SetLine(int idx, const TEveVector& p1, const TEveVector& p2);
100
103
104 virtual Bool_t GetRnrMarkers() { return fRnrMarkers; }
105 virtual Bool_t GetRnrLines() { return fRnrLines; }
106 virtual Bool_t GetDepthTest() { return fDepthTest; }
107
108 virtual void SetRnrMarkers(Bool_t x) { fRnrMarkers = x; }
109 virtual void SetRnrLines(Bool_t x) { fRnrLines = x; }
110 virtual void SetDepthTest(Bool_t x) { fDepthTest = x; }
111
112 void CopyVizParams(const TEveElement* el) override;
113 void WriteVizParams(std::ostream& out, const TString& var) override;
114
115 TClass* ProjectedClass(const TEveProjection* p) const override;
116
117 void ComputeBBox() override;
118 void Paint(Option_t* option="") override;
119
120 ClassDefOverride(TEveStraightLineSet, 0); // Set of straight lines with optional markers along the lines.
121};
122
123
124/******************************************************************************/
125
127 public TEveProjected
128{
129private:
132
133protected:
134 void SetDepthLocal(Float_t d) override;
135
136public:
139
140 void SetProjection(TEveProjectionManager* mng, TEveProjectable* model) override;
141 void UpdateProjection() override;
142 TEveElement* GetProjectedAsElement() override { return this; }
143
144 ClassDefOverride(TEveStraightLineSetProjected, 0); // Projected copy of a TEveStraightLineSet.
145};
146
147#endif
#define d(i)
Definition RSha256.hxx:102
int Int_t
Definition RtypesCore.h:45
short Color_t
Definition RtypesCore.h:92
short Marker_t
Definition RtypesCore.h:90
float Float_t
Definition RtypesCore.h:57
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
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:81
Vector-like container with chunked memory allocation.
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
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.
void UpdateProjection() override
Callback that actually performs the projection.
void SetDepthLocal(Float_t d) override
Set depth (z-coordinate) of the projected points.
TEveElement * GetProjectedAsElement() override
Returns this projected dynamic-casted to TEveElement.
void SetProjection(TEveProjectionManager *mng, TEveProjectable *model) override
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)
TClass * ProjectedClass(const TEveProjection *p) const override
Return class of projected object.
void WriteVizParams(std::ostream &out, const TString &var) override
Write visualization parameters.
void CopyVizParams(const TEveElement *el) override
Copy visualization parameters from element el.
void ComputeBBox() override
Compute bounding-box.
virtual Bool_t GetDepthTest()
TEveChunkManager & GetMarkerPlex()
virtual void SetRnrLines(Bool_t x)
void SetLineColor(Color_t col) override
Set the line color.
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()
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
TEveChunkManager & GetLinePlex()
TEveStraightLineSet & operator=(const TEveStraightLineSet &)
void Paint(Option_t *option="") override
Paint the line-set.
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:139
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)