Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
REveScalableStraightLineSet.cxx
Go to the documentation of this file.
1// @(#)root/eve7:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2020
3
4/*************************************************************************
5 * Copyright (C) 1995-2020, 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
14
15/** \class REveScalableStraightLineSet
16\ingroup REve
17Straight-line-set with extra scaling, useful for projectables that need
18to be scaled in accordance with an external object.
19*/
20
21using namespace ROOT::Experimental;
22
23////////////////////////////////////////////////////////////////////////////////
24/// Constructor.
25
26REveScalableStraightLineSet::REveScalableStraightLineSet(const std::string &n, const std::string &t):
28 fCurrentScale(1.0)
29{
30 fScaleCenter[0] = 0;
31 fScaleCenter[1] = 0;
32 fScaleCenter[2] = 0;
33}
34
35////////////////////////////////////////////////////////////////////////////////
36/// Set scale center.
37
39{
40 fScaleCenter[0] = x;
41 fScaleCenter[1] = y;
42 fScaleCenter[2] = z;
43}
44
45////////////////////////////////////////////////////////////////////////////////
46/// Return current scale.
47
49{
50 return fCurrentScale;
51}
52
53////////////////////////////////////////////////////////////////////////////////
54/// Loop over line parameters and scale coordinates.
55
57{
59 while (li.next())
60 {
62 l.fV1[0] = fScaleCenter[0]+(l.fV1[0]-fScaleCenter[0])/fCurrentScale*scale;
63 l.fV1[1] = fScaleCenter[1]+(l.fV1[1]-fScaleCenter[1])/fCurrentScale*scale;
64 l.fV1[2] = fScaleCenter[2]+(l.fV1[2]-fScaleCenter[2])/fCurrentScale*scale;
65 l.fV2[0] = fScaleCenter[0]+(l.fV2[0]-fScaleCenter[0])/fCurrentScale*scale;
66 l.fV2[1] = fScaleCenter[1]+(l.fV2[1]-fScaleCenter[1])/fCurrentScale*scale;
67 l.fV2[2] = fScaleCenter[2]+(l.fV2[2]-fScaleCenter[2])/fCurrentScale*scale;
68 }
69 fCurrentScale = scale;
70}
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.
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
TLine l
Definition textangle.C:4