Logo ROOT  
Reference Guide
REveScalableStraightLineSet.cxx
Go to the documentation of this file.
3
4/** \class REveScalableStraightLineSet
5\ingroup REve
6Straight-line-set with extra scaling, useful for projectables that need
7to be scaled in accordance with an external object.
8*/
9
10using namespace ROOT::Experimental;
11namespace REX = ROOT::Experimental;
12
13////////////////////////////////////////////////////////////////////////////////
14/// Constructor.
15
16REveScalableStraightLineSet::REveScalableStraightLineSet(const std::string &n, const std::string &t):
18 fCurrentScale(1.0)
19{
20 fScaleCenter[0] = 0;
21 fScaleCenter[1] = 0;
22 fScaleCenter[2] = 0;
23}
24
25////////////////////////////////////////////////////////////////////////////////
26/// Set scale center.
27
29{
30 fScaleCenter[0] = x;
31 fScaleCenter[1] = y;
32 fScaleCenter[2] = z;
33}
34
35////////////////////////////////////////////////////////////////////////////////
36/// Return current scale.
37
39{
40 return fCurrentScale;
41}
42
43////////////////////////////////////////////////////////////////////////////////
44/// Loop over line parameters and scale coordinates.
45
47{
49 while (li.next())
50 {
52 l.fV1[0] = fScaleCenter[0]+(l.fV1[0]-fScaleCenter[0])/fCurrentScale*scale;
53 l.fV1[1] = fScaleCenter[1]+(l.fV1[1]-fScaleCenter[1])/fCurrentScale*scale;
54 l.fV1[2] = fScaleCenter[2]+(l.fV1[2]-fScaleCenter[2])/fCurrentScale*scale;
55 l.fV2[0] = fScaleCenter[0]+(l.fV2[0]-fScaleCenter[0])/fCurrentScale*scale;
56 l.fV2[1] = fScaleCenter[1]+(l.fV2[1]-fScaleCenter[1])/fCurrentScale*scale;
57 l.fV2[2] = fScaleCenter[2]+(l.fV2[2]-fScaleCenter[2])/fCurrentScale*scale;
58 }
59 fCurrentScale = scale;
60}
double Double_t
Definition: RtypesCore.h:55
float Float_t
Definition: RtypesCore.h:53
void SetScaleCenter(Float_t x, Float_t y, Float_t z)
Set scale center.
void SetScale(Double_t scale)
Loop over line parameters and scale coordinates.
REveScalableStraightLineSet(const REveScalableStraightLineSet &)
REveStraightLineSet Set of straight lines with optional markers along the lines.
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
auto * l
Definition: textangle.C:4