ROOT  6.06/09
Reference Guide
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 
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 
22 
23 ////////////////////////////////////////////////////////////////////////////////
24 /// Constructor.
25 
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 
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 }
float Float_t
Definition: RtypesCore.h:53
Double_t GetScale() const
Return current scale.
TEveChunkManager & GetLinePlex()
Double_t x[n]
Definition: legend1.C:17
Straight-line-set with extra scaling, useful for projectables that need to be scaled in accordance wi...
TLine * l
Definition: textangle.C:4
double Double_t
Definition: RtypesCore.h:55
TEveScalableStraightLineSet(const TEveScalableStraightLineSet &)
Double_t y[n]
Definition: legend1.C:17
void SetScale(Double_t scale)
Loop over line parameters and scale coordinates.
Bool_t next()
Go to next atom.
ClassImp(TEveScalableStraightLineSet)
const Int_t n
Definition: legend1.C:16
Set of straight lines with optional markers along the lines.
void SetScaleCenter(Float_t x, Float_t y, Float_t z)
Set scale center.