ROOT
master
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
12
#include "
ROOT/REveScalableStraightLineSet.hxx
"
13
#include "
ROOT/REveChunkManager.hxx
"
14
15
/** \class REveScalableStraightLineSet
16
\ingroup REve
17
Straight-line-set with extra scaling, useful for projectables that need
18
to be scaled in accordance with an external object.
19
*/
20
21
using namespace
ROOT::Experimental
;
22
23
////////////////////////////////////////////////////////////////////////////////
24
/// Constructor.
25
26
REveScalableStraightLineSet::REveScalableStraightLineSet(
const
std::string &
n
,
const
std::string &t):
27
REveStraightLineSet
(
n
, 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
38
void
REveScalableStraightLineSet::SetScaleCenter
(
Float_t
x
,
Float_t
y
,
Float_t
z)
39
{
40
fScaleCenter
[0] =
x
;
41
fScaleCenter
[1] =
y
;
42
fScaleCenter
[2] = z;
43
}
44
45
////////////////////////////////////////////////////////////////////////////////
46
/// Return current scale.
47
48
Double_t
REveScalableStraightLineSet::GetScale
()
const
49
{
50
return
fCurrentScale
;
51
}
52
53
////////////////////////////////////////////////////////////////////////////////
54
/// Loop over line parameters and scale coordinates.
55
56
void
REveScalableStraightLineSet::SetScale
(
Double_t
scale)
57
{
58
REveChunkManager::iterator
li(
GetLinePlex
());
59
while
(li.
next
())
60
{
61
REveStraightLineSet::Line_t
&
l
= * (
REveStraightLineSet::Line_t
*) li();
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
}
REveChunkManager.hxx
REveScalableStraightLineSet.hxx
Float_t
ROOT::Experimental::REveScalableStraightLineSet::fCurrentScale
Double_t fCurrentScale
Definition
REveScalableStraightLineSet.hxx:27
ROOT::Experimental::REveScalableStraightLineSet::SetScaleCenter
void SetScaleCenter(Float_t x, Float_t y, Float_t z)
Set scale center.
Definition
REveScalableStraightLineSet.cxx:38
ROOT::Experimental::REveScalableStraightLineSet::GetScale
Double_t GetScale() const
Return current scale.
Definition
REveScalableStraightLineSet.cxx:48
ROOT::Experimental::REveScalableStraightLineSet::SetScale
void SetScale(Double_t scale)
Loop over line parameters and scale coordinates.
Definition
REveScalableStraightLineSet.cxx:56
ROOT::Experimental::REveScalableStraightLineSet::fScaleCenter
Float_t fScaleCenter[3]
Definition
REveScalableStraightLineSet.hxx:28
ROOT::Experimental::REveStraightLineSet
REveStraightLineSet Set of straight lines with optional markers along the lines.
Definition
REveStraightLineSet.hxx:42
ROOT::Experimental::REveStraightLineSet::GetLinePlex
REveChunkManager & GetLinePlex()
Definition
REveStraightLineSet.hxx:102
double
y
Double_t y[n]
Definition
legend1.C:17
x
Double_t x[n]
Definition
legend1.C:17
n
const Int_t n
Definition
legend1.C:16
ROOT::Experimental
Definition
RDirectory.hxx:30
ROOT::Experimental::REveChunkManager::iterator
Definition
REveChunkManager.hxx:73
ROOT::Experimental::REveChunkManager::iterator::next
Bool_t next()
Go to next atom.
Definition
REveChunkManager.cxx:112
ROOT::Experimental::REveStraightLineSet::Line_t
Definition
REveStraightLineSet.hxx:49
l
TLine l
Definition
textangle.C:4
graf3d
eve7
src
REveScalableStraightLineSet.cxx
ROOT master - Reference Guide Generated on Thu Dec 12 2024 09:43:44 (GVA Time) using Doxygen 1.9.8