ROOT
master
Reference Guide
Loading...
Searching...
No Matches
TEveScalableStraightLineSet.cxx
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
#include "
TEveScalableStraightLineSet.h
"
13
#include "
TEveChunkManager.h
"
14
15
/** \class TEveScalableStraightLineSet
16
\ingroup TEve
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
22
////////////////////////////////////////////////////////////////////////////////
23
/// Constructor.
24
25
TEveScalableStraightLineSet::TEveScalableStraightLineSet
(
const
char
*
n
,
const
char
* t):
26
TEveStraightLineSet
(
n
, t),
27
fCurrentScale(1.0)
28
{
29
fScaleCenter
[0] = 0;
30
fScaleCenter
[1] = 0;
31
fScaleCenter
[2] = 0;
32
}
33
34
////////////////////////////////////////////////////////////////////////////////
35
/// Set scale center.
36
37
void
TEveScalableStraightLineSet::SetScaleCenter
(
Float_t
x
,
Float_t
y
,
Float_t
z)
38
{
39
fScaleCenter
[0] =
x
;
40
fScaleCenter
[1] =
y
;
41
fScaleCenter
[2] = z;
42
}
43
44
////////////////////////////////////////////////////////////////////////////////
45
/// Return current scale.
46
47
Double_t
TEveScalableStraightLineSet::GetScale
()
const
48
{
49
return
fCurrentScale
;
50
}
51
52
////////////////////////////////////////////////////////////////////////////////
53
/// Loop over line parameters and scale coordinates.
54
55
void
TEveScalableStraightLineSet::SetScale
(
Double_t
scale
)
56
{
57
TEveChunkManager::iterator
li
(
GetLinePlex
());
58
while
(
li
.next())
59
{
60
TEveStraightLineSet::Line_t
&
l
= * (
TEveStraightLineSet::Line_t
*)
li
();
61
l
.fV1[0] =
fScaleCenter
[0]+(
l
.fV1[0]-
fScaleCenter
[0])/
fCurrentScale
*
scale
;
62
l
.fV1[1] =
fScaleCenter
[1]+(
l
.fV1[1]-
fScaleCenter
[1])/
fCurrentScale
*
scale
;
63
l
.fV1[2] =
fScaleCenter
[2]+(
l
.fV1[2]-
fScaleCenter
[2])/
fCurrentScale
*
scale
;
64
l
.fV2[0] =
fScaleCenter
[0]+(
l
.fV2[0]-
fScaleCenter
[0])/
fCurrentScale
*
scale
;
65
l
.fV2[1] =
fScaleCenter
[1]+(
l
.fV2[1]-
fScaleCenter
[1])/
fCurrentScale
*
scale
;
66
l
.fV2[2] =
fScaleCenter
[2]+(
l
.fV2[2]-
fScaleCenter
[2])/
fCurrentScale
*
scale
;
67
}
68
fCurrentScale
=
scale
;
69
}
Float_t
float Float_t
Float 4 bytes (float)
Definition
RtypesCore.h:71
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
TEveChunkManager.h
TEveScalableStraightLineSet.h
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TEveScalableStraightLineSet::fCurrentScale
Double_t fCurrentScale
Definition
TEveScalableStraightLineSet.h:24
TEveScalableStraightLineSet::TEveScalableStraightLineSet
TEveScalableStraightLineSet(const TEveScalableStraightLineSet &)
TEveScalableStraightLineSet::fScaleCenter
Float_t fScaleCenter[3]
Definition
TEveScalableStraightLineSet.h:25
TEveScalableStraightLineSet::GetScale
Double_t GetScale() const
Return current scale.
Definition
TEveScalableStraightLineSet.cxx:47
TEveScalableStraightLineSet::SetScale
void SetScale(Double_t scale)
Loop over line parameters and scale coordinates.
Definition
TEveScalableStraightLineSet.cxx:55
TEveScalableStraightLineSet::SetScaleCenter
void SetScaleCenter(Float_t x, Float_t y, Float_t z)
Set scale center.
Definition
TEveScalableStraightLineSet.cxx:37
TEveStraightLineSet
Set of straight lines with optional markers along the lines.
Definition
TEveStraightLineSet.h:39
TEveStraightLineSet::GetLinePlex
TEveChunkManager & GetLinePlex()
Definition
TEveStraightLineSet.h:101
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
TEveChunkManager::iterator
Definition
TEveChunkManager.h:70
TEveStraightLineSet::Line_t
Definition
TEveStraightLineSet.h:46
l
TLine l
Definition
textangle.C:4
graf3d
eve
src
TEveScalableStraightLineSet.cxx
ROOT master - Reference Guide Generated on Tue Oct 7 2025 04:42:04 (GVA Time) using Doxygen 1.10.0