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
ClassImp
(
TEveScalableStraightLineSet
);
22
23
////////////////////////////////////////////////////////////////////////////////
24
/// Constructor.
25
26
TEveScalableStraightLineSet::TEveScalableStraightLineSet
(
const
char
*
n
,
const
char
* t):
27
TEveStraightLineSet
(
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
TEveScalableStraightLineSet::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
TEveScalableStraightLineSet::GetScale
()
const
49
{
50
return
fCurrentScale
;
51
}
52
53
////////////////////////////////////////////////////////////////////////////////
54
/// Loop over line parameters and scale coordinates.
55
56
void
TEveScalableStraightLineSet::SetScale
(
Double_t
scale
)
57
{
58
TEveChunkManager::iterator
li
(
GetLinePlex
());
59
while
(
li
.next())
60
{
61
TEveStraightLineSet::Line_t
&
l
= * (
TEveStraightLineSet::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
}
Float_t
float Float_t
Definition
RtypesCore.h:57
ClassImp
#define ClassImp(name)
Definition
Rtypes.h:374
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
Straight-line-set with extra scaling, useful for projectables that need to be scaled in accordance wi...
Definition
TEveScalableStraightLineSet.h:18
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:48
TEveScalableStraightLineSet::SetScale
void SetScale(Double_t scale)
Loop over line parameters and scale coordinates.
Definition
TEveScalableStraightLineSet.cxx:56
TEveScalableStraightLineSet::SetScaleCenter
void SetScaleCenter(Float_t x, Float_t y, Float_t z)
Set scale center.
Definition
TEveScalableStraightLineSet.cxx:38
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 Fri Feb 7 2025 04:24:55 (GVA Time) using Doxygen 1.10.0