BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
BesPolygon2D Class Reference

#include <BesPolygon2D.h>

Inheritance diagram for BesPolygon2D:

Public Member Functions

 BesPolygon2D ()
 info box
 BesPolygon2D (const char *name, const char *title, Int_t N, Double_t *P)
virtual ~BesPolygon2D ()
virtual void Draw (Option_t *option="")
virtual void Paint (Option_t *option="")
virtual char * GetObjectInfo (Int_t px, Int_t py) const
virtual void SetZRSign (Int_t sign)
virtual void Resize (Double_t ScaleFactor)
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
virtual void SetInfoBox ()
virtual void GetCenter (Double_t *Center) const
virtual void RotatePhi (Double_t phi)
virtual void Restore ()
virtual void SetSize (Double_t size)
virtual void Stretch (Double_t sx, Double_t sy, Double_t sz, Double_t factor)
Bool_t IsRotatable ()
void SetRotatable (Bool_t input)
void SetName (const char *name)
void SetTitle (const char *name)
void Delete (Option_t *option)
void DrawClass ()
void DrawClone (Option_t *option)
void SetDrawOption (Option_t *option)
void SetPoints (Double_t *P)
 BesPolygon2D ()
 info box
 BesPolygon2D (const char *name, const char *title, Int_t N, Double_t *P)
virtual ~BesPolygon2D ()
virtual void Draw (Option_t *option="")
virtual void Paint (Option_t *option="")
virtual char * GetObjectInfo (Int_t px, Int_t py) const
virtual void SetZRSign (Int_t sign)
virtual void Resize (Double_t ScaleFactor)
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
virtual void SetInfoBox ()
virtual void GetCenter (Double_t *Center) const
virtual void RotatePhi (Double_t phi)
virtual void Restore ()
virtual void SetSize (Double_t size)
virtual void Stretch (Double_t sx, Double_t sy, Double_t sz, Double_t factor)
Bool_t IsRotatable ()
void SetRotatable (Bool_t input)
void SetName (const char *name)
void SetTitle (const char *name)
void Delete (Option_t *option)
void DrawClass ()
void DrawClone (Option_t *option)
void SetDrawOption (Option_t *option)
void SetPoints (Double_t *P)
 BesPolygon2D ()
 info box
 BesPolygon2D (const char *name, const char *title, Int_t N, Double_t *P)
virtual ~BesPolygon2D ()
virtual void Draw (Option_t *option="")
virtual void Paint (Option_t *option="")
virtual char * GetObjectInfo (Int_t px, Int_t py) const
virtual void SetZRSign (Int_t sign)
virtual void Resize (Double_t ScaleFactor)
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
virtual void SetInfoBox ()
virtual void GetCenter (Double_t *Center) const
virtual void RotatePhi (Double_t phi)
virtual void Restore ()
virtual void SetSize (Double_t size)
virtual void Stretch (Double_t sx, Double_t sy, Double_t sz, Double_t factor)
Bool_t IsRotatable ()
void SetRotatable (Bool_t input)
void SetName (const char *name)
void SetTitle (const char *name)
void Delete (Option_t *option)
void DrawClass ()
void DrawClone (Option_t *option)
void SetDrawOption (Option_t *option)
void SetPoints (Double_t *P)

Protected Attributes

Double_t * f_xx
Double_t * f_yy
Int_t fN
Double_t * fP
Double_t * fPBackUp
Double_t fCenter [3]
Bool_t fRotatable
TPaveText * fInfoBox

Detailed Description

Constructor & Destructor Documentation

◆ BesPolygon2D() [1/6]

BesPolygon2D::BesPolygon2D ( )

info box

◆ BesPolygon2D() [2/6]

BesPolygon2D::BesPolygon2D ( const char * name,
const char * title,
Int_t N,
Double_t * P )

Definition at line 66 of file BesPolygon2D.cxx.

67 : TNamed( name, title ), TAttLine(), TAttFill() {
68 //
69 // BesPolygon2D normal constructor
70 // cout << "####################" << endl;
71 // cout << "BesPolygon2D ctor called " << ++num << endl;
72 // cout << "####################" << endl;
73
74 fN = N;
75 fP = new Double_t[fN * 3];
76 fPBackUp = new Double_t[fN * 3];
77 f_xx = NULL;
78 f_yy = NULL;
79
80 fInfoBox = 0;
81 if ( P != NULL ) { SetPoints( P ); }
82
83 for ( Int_t i = 0; i < fN * 3; i++ ) { fPBackUp[i] = fP[i]; }
84
85 for ( Int_t j = 0; j < 3; j++ )
86 {
87 fCenter[j] = 0.0;
88 for ( Int_t i = 0; i < fN; i++ ) { fCenter[j] += fP[3 * i + j]; }
89 fCenter[j] /= fN;
90 }
91
92 for ( Int_t i = 0; i < fN; i++ ) {}
93
94 fRotatable = false;
95}
double P(RecMdcKalTrack *trk)
titledef title[20]

◆ ~BesPolygon2D() [1/3]

BesPolygon2D::~BesPolygon2D ( )
virtual

Definition at line 99 of file BesPolygon2D.cxx.

99 {
100 //
101 // BesPolygon2D default destructor
102 // cout << "####################" << endl;
103 // cout << "BesPolygon2D dtor called " << --num << endl;
104 // cout << "####################" << endl;
105
106 // Long Peixun's update: remove "if"
107 delete[] fP;
108 delete[] fPBackUp;
109}

◆ BesPolygon2D() [3/6]

BesPolygon2D::BesPolygon2D ( )

info box

◆ BesPolygon2D() [4/6]

BesPolygon2D::BesPolygon2D ( const char * name,
const char * title,
Int_t N,
Double_t * P )

◆ ~BesPolygon2D() [2/3]

virtual BesPolygon2D::~BesPolygon2D ( )
virtual

◆ BesPolygon2D() [5/6]

BesPolygon2D::BesPolygon2D ( )

info box

◆ BesPolygon2D() [6/6]

BesPolygon2D::BesPolygon2D ( const char * name,
const char * title,
Int_t N,
Double_t * P )

◆ ~BesPolygon2D() [3/3]

virtual BesPolygon2D::~BesPolygon2D ( )
virtual

Member Function Documentation

◆ Delete() [1/3]

void BesPolygon2D::Delete ( Option_t * option)
inline

Definition at line 67 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

67{ TObject::Delete( option ); }

◆ Delete() [2/3]

void BesPolygon2D::Delete ( Option_t * option)
inline

Definition at line 67 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/BesPolygon2D.h.

67{ TObject::Delete( option ); }

◆ Delete() [3/3]

void BesPolygon2D::Delete ( Option_t * option)
inline

Definition at line 67 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/BesPolygon2D.h.

67{ TObject::Delete( option ); }

◆ DistancetoPrimitive() [1/3]

Int_t BesPolygon2D::DistancetoPrimitive ( Int_t px,
Int_t py )
virtual

Definition at line 172 of file BesPolygon2D.cxx.

172 {
173 //
174 // Compute the closest distance of approach from point px,py to the
175 // center of this polygon
176 // The distance is computed in pixels units.
177
178 const Int_t inaxis = 7;
179 Int_t dist = 9999;
180
181 if ( this->IsRotatable() ) return dist;
182
183 Int_t puxmin = gPad->XtoAbsPixel( gPad->GetUxmin() );
184 Int_t puymin = gPad->YtoAbsPixel( gPad->GetUymin() );
185 Int_t puxmax = gPad->XtoAbsPixel( gPad->GetUxmax() );
186 Int_t puymax = gPad->YtoAbsPixel( gPad->GetUymax() );
187
188 // return if point is not in the user area
189 if ( px < puxmin - inaxis ) return dist;
190 if ( py > puymin + inaxis ) return dist;
191 if ( px > puxmax + inaxis ) return dist;
192 if ( py < puymax - inaxis ) return dist;
193
194 // judge the mouse point and center are always on the same side of any line of ploygon
195 // Transform to normalised desktop coordinates
196
197 BesView* view = dynamic_cast<BesView*>( gPad->GetView() );
198 if ( !view ) return dist;
199
200 Bool_t inPolygon = true;
201 Int_t x1, y1, x2, y2, cx, cy;
202 Double_t Pndc[3], k, b, pb, cb;
203
204 view->WCtoNDC( &fCenter[0], Pndc );
205 cx = gPad->XtoAbsPixel( Pndc[0] );
206 cy = gPad->YtoAbsPixel( Pndc[1] );
207
208 // cout << "px " << px << " py " << py << endl;
209 // cout << "center " << cx << " " << cy << endl;
210
211 for ( Int_t i = 0; i < fN; i++ )
212 {
213 view->WCtoNDC( &fP[3 * i], Pndc );
214 x1 = gPad->XtoAbsPixel( Pndc[0] );
215 y1 = gPad->YtoAbsPixel( Pndc[1] );
216
217 if ( i != fN - 1 ) { view->WCtoNDC( &fP[3 * ( i + 1 )], Pndc ); }
218 else view->WCtoNDC( &fP[0], Pndc );
219
220 x2 = gPad->XtoAbsPixel( Pndc[0] );
221 y2 = gPad->YtoAbsPixel( Pndc[1] );
222
223 // cout << "x1 " << x1 << " y1 " << y1 << endl;
224 // cout << "x2 " << x2 << " y2 " << y2 << endl;
225 if ( x1 == x2 )
226 {
227 if ( ( px - x1 ) * ( cx - x1 ) <= 0 )
228 {
229 inPolygon = false;
230 break;
231 }
232 }
233 else
234 {
235 k = Double_t( y2 - y1 ) / ( x2 - x1 );
236 b = y1 - k * x1;
237 pb = py - k * px;
238 cb = cy - k * cx;
239 if ( ( pb - b ) * ( cb - b ) <= 0 )
240 {
241 inPolygon = false;
242 break;
243 }
244 }
245 }
246
247 if ( inPolygon == true )
248 {
249 // gPad->SetSelected(this);
250 // gPad->SetCursor(kHand);
251 return 0;
252 }
253 else return 9999;
254
255 // cout << GetName() << dist << endl;
256 // if (dist < 100) dist = 0;
257}
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)
Definition BesView.cxx:716

◆ DistancetoPrimitive() [2/3]

virtual Int_t BesPolygon2D::DistancetoPrimitive ( Int_t px,
Int_t py )
virtual

◆ DistancetoPrimitive() [3/3]

virtual Int_t BesPolygon2D::DistancetoPrimitive ( Int_t px,
Int_t py )
virtual

◆ Draw() [1/3]

void BesPolygon2D::Draw ( Option_t * option = "")
virtual

Definition at line 113 of file BesPolygon2D.cxx.

113 {
114 //
115 // BesPolygon2D draw function
116 TString opt = option;
117 opt.ToUpper();
118
119 AppendPad( option );
120}

◆ Draw() [2/3]

virtual void BesPolygon2D::Draw ( Option_t * option = "")
virtual

◆ Draw() [3/3]

virtual void BesPolygon2D::Draw ( Option_t * option = "")
virtual

◆ DrawClass() [1/3]

void BesPolygon2D::DrawClass ( )
inline

Definition at line 68 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

68{ TObject::DrawClass(); }

◆ DrawClass() [2/3]

void BesPolygon2D::DrawClass ( )
inline

Definition at line 68 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/BesPolygon2D.h.

68{ TObject::DrawClass(); }

◆ DrawClass() [3/3]

void BesPolygon2D::DrawClass ( )
inline

Definition at line 68 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/BesPolygon2D.h.

68{ TObject::DrawClass(); }

◆ DrawClone() [1/3]

void BesPolygon2D::DrawClone ( Option_t * option)
inline

Definition at line 69 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

69{ TObject::DrawClone( option ); }

◆ DrawClone() [2/3]

void BesPolygon2D::DrawClone ( Option_t * option)
inline

Definition at line 69 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/BesPolygon2D.h.

69{ TObject::DrawClone( option ); }

◆ DrawClone() [3/3]

void BesPolygon2D::DrawClone ( Option_t * option)
inline

Definition at line 69 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/BesPolygon2D.h.

69{ TObject::DrawClone( option ); }

◆ ExecuteEvent() [1/3]

void BesPolygon2D::ExecuteEvent ( Int_t event,
Int_t px,
Int_t py )
virtual

Definition at line 261 of file BesPolygon2D.cxx.

261 {
262 // cout << "I am in " << GetName() << endl;
263
264 BesView* view = dynamic_cast<BesView*>( gPad->GetView() );
265 if ( view ) view->ExecuteEvent( event, px, py );
266}
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Definition BesView.cxx:371

◆ ExecuteEvent() [2/3]

virtual void BesPolygon2D::ExecuteEvent ( Int_t event,
Int_t px,
Int_t py )
virtual

◆ ExecuteEvent() [3/3]

virtual void BesPolygon2D::ExecuteEvent ( Int_t event,
Int_t px,
Int_t py )
virtual

◆ GetCenter() [1/3]

void BesPolygon2D::GetCenter ( Double_t * Center) const
virtual

Definition at line 335 of file BesPolygon2D.cxx.

335 {
336 //
337 // Compute geometric center of this polygon
338 for ( Int_t i = 0; i < 3; i++ )
339 {
340 Center[i] = 0;
341 for ( Int_t j = 0; j < fN; j++ ) Center[i] += fP[3 * j + i];
342 Center[i] /= fN;
343 }
344}

Referenced by Resize(), and Stretch().

◆ GetCenter() [2/3]

virtual void BesPolygon2D::GetCenter ( Double_t * Center) const
virtual

◆ GetCenter() [3/3]

virtual void BesPolygon2D::GetCenter ( Double_t * Center) const
virtual

◆ GetObjectInfo() [1/3]

char * BesPolygon2D::GetObjectInfo ( Int_t px,
Int_t py ) const
virtual

Definition at line 292 of file BesPolygon2D.cxx.

292 {
293
294 BesView* view = dynamic_cast<BesView*>( gPad->GetView() );
295 if ( view ) return view->GetObjectInfo( px, py );
296 else return TObject::GetObjectInfo( px, py );
297}
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Definition BesView.cxx:871

Referenced by SetInfoBox().

◆ GetObjectInfo() [2/3]

virtual char * BesPolygon2D::GetObjectInfo ( Int_t px,
Int_t py ) const
virtual

◆ GetObjectInfo() [3/3]

virtual char * BesPolygon2D::GetObjectInfo ( Int_t px,
Int_t py ) const
virtual

◆ IsRotatable() [1/3]

Bool_t BesPolygon2D::IsRotatable ( )
inline

Definition at line 63 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

63{ return fRotatable; }

Referenced by DistancetoPrimitive(), and Paint().

◆ IsRotatable() [2/3]

Bool_t BesPolygon2D::IsRotatable ( )
inline

◆ IsRotatable() [3/3]

Bool_t BesPolygon2D::IsRotatable ( )
inline

◆ Paint() [1/3]

void BesPolygon2D::Paint ( Option_t * option = "")
virtual

Definition at line 124 of file BesPolygon2D.cxx.

124 {
125 //
126 // BesPolygon2D paint function
127 TString opt = option;
128 opt.ToUpper();
129
130 // Transform to normalised desktop coordinates
131 BesView* view = dynamic_cast<BesView*>( gPad->GetView() );
132 if ( view == 0 ) cout << "no view found" << endl;
133 Double_t viewPhi = view->GetLongitude();
134 if ( IsRotatable() ) RotatePhi( viewPhi - 180.0 );
135
136 if ( f_xx )
137 {
138 delete[] f_xx;
139 f_xx = NULL;
140 }
141 if ( f_yy )
142 {
143 delete[] f_yy;
144 f_yy = NULL;
145 }
146
147 f_xx = new Double_t[fN + 1];
148 f_yy = new Double_t[fN + 1];
149 Double_t Pndc[3];
150
151 for ( Int_t i = 0; i < fN; i++ )
152 {
153 view->WCtoNDC( &fP[i * 3], Pndc );
154 f_xx[i] = Pndc[0];
155 f_yy[i] = Pndc[1];
156 }
157
158 // Close surface
159 f_xx[fN] = f_xx[0];
160 f_yy[fN] = f_yy[0];
161
162 TAttLine::Modify(); // Change line attributes only if necessary
163 TAttFill::Modify(); // Change fill attributes only if necessary
164
165 gPad->PaintFillArea( fN, f_xx, f_yy );
166 gPad->PaintPolyLine( fN + 1, f_xx, f_yy );
167 if ( IsRotatable() ) Restore();
168}
virtual void Restore()
virtual void RotatePhi(Double_t phi)

◆ Paint() [2/3]

virtual void BesPolygon2D::Paint ( Option_t * option = "")
virtual

◆ Paint() [3/3]

virtual void BesPolygon2D::Paint ( Option_t * option = "")
virtual

◆ Resize() [1/3]

void BesPolygon2D::Resize ( Double_t ScaleFactor)
virtual

Definition at line 317 of file BesPolygon2D.cxx.

317 {
318 //
319 // Resize the polygon by ScaleFactor
320
321 // Compute geometric center of the polygon
322 Double_t C[3];
323 GetCenter( C );
324
325 // Rescale distances from the center
326 for ( Int_t i = 0; i < 3; i++ )
327 {
328 for ( Int_t j = 0; j < fN; j++ )
329 { fP[3 * j + i] = C[i] + ScaleFactor * ( fP[3 * j + i] - C[i] ); }
330 }
331}
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
Definition RRes.h:29
virtual void GetCenter(Double_t *Center) const

◆ Resize() [2/3]

virtual void BesPolygon2D::Resize ( Double_t ScaleFactor)
virtual

◆ Resize() [3/3]

virtual void BesPolygon2D::Resize ( Double_t ScaleFactor)
virtual

◆ Restore() [1/3]

void BesPolygon2D::Restore ( )
virtual

Definition at line 363 of file BesPolygon2D.cxx.

363 {
364
365 for ( Int_t i = 0; i < fN * 3; i++ ) { fP[i] = fPBackUp[i]; }
366}

Referenced by Paint().

◆ Restore() [2/3]

virtual void BesPolygon2D::Restore ( )
virtual

◆ Restore() [3/3]

virtual void BesPolygon2D::Restore ( )
virtual

◆ RotatePhi() [1/3]

void BesPolygon2D::RotatePhi ( Double_t phi)
virtual

Definition at line 348 of file BesPolygon2D.cxx.

348 {
349
350 // cout << "phi " << phi << endl;
351 for ( Int_t i = 0; i < fN; i++ )
352 {
353 TVector3 vec( fP[i * 3], fP[i * 3 + 1], fP[i * 3 + 2] );
354 Double_t r = vec.Pt();
355 Double_t newPhi = vec.Phi() + phi * TMath::DegToRad();
356 fP[i * 3] = r * cos( newPhi );
357 fP[i * 3 + 1] = r * sin( newPhi );
358 }
359}
dble_vec_t vec[12]

Referenced by Paint().

◆ RotatePhi() [2/3]

virtual void BesPolygon2D::RotatePhi ( Double_t phi)
virtual

◆ RotatePhi() [3/3]

virtual void BesPolygon2D::RotatePhi ( Double_t phi)
virtual

◆ SetDrawOption() [1/3]

void BesPolygon2D::SetDrawOption ( Option_t * option)
inline

Definition at line 70 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

70{ TObject::SetDrawOption( option ); }

◆ SetDrawOption() [2/3]

void BesPolygon2D::SetDrawOption ( Option_t * option)
inline

Definition at line 70 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/BesPolygon2D.h.

70{ TObject::SetDrawOption( option ); }

◆ SetDrawOption() [3/3]

void BesPolygon2D::SetDrawOption ( Option_t * option)
inline

Definition at line 70 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/BesPolygon2D.h.

70{ TObject::SetDrawOption( option ); }

◆ SetInfoBox() [1/3]

void BesPolygon2D::SetInfoBox ( )
virtual

Definition at line 270 of file BesPolygon2D.cxx.

270 {
271 //
272 // Set tooltip textbox with some information
273 TView* view = dynamic_cast<TView*>( gPad->GetView() );
274 Double_t Pndc[3];
275 if ( view ) view->WCtoNDC( &fP[0], Pndc );
276
277 if ( fInfoBox )
278 {
279 delete fInfoBox;
280 fInfoBox = 0;
281 }
282 fInfoBox = new TPaveText( Pndc[0], Pndc[1], Pndc[0] + 0.4, Pndc[1] + 0.1 );
283 fInfoBox->SetBorderSize( 1 );
284 fInfoBox->SetFillColor( 191 );
285 fInfoBox->AddText( GetTitle() );
286 fInfoBox->AddText( GetObjectInfo( 0, 0 ) );
287 fInfoBox->Draw();
288}
virtual char * GetObjectInfo(Int_t px, Int_t py) const

◆ SetInfoBox() [2/3]

virtual void BesPolygon2D::SetInfoBox ( )
virtual

◆ SetInfoBox() [3/3]

virtual void BesPolygon2D::SetInfoBox ( )
virtual

◆ SetName() [1/3]

void BesPolygon2D::SetName ( const char * name)
inline

Definition at line 65 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

65{ TNamed::SetName( name ); }

◆ SetName() [2/3]

void BesPolygon2D::SetName ( const char * name)
inline

Definition at line 65 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/BesPolygon2D.h.

65{ TNamed::SetName( name ); }

◆ SetName() [3/3]

void BesPolygon2D::SetName ( const char * name)
inline

Definition at line 65 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/BesPolygon2D.h.

65{ TNamed::SetName( name ); }

◆ SetPoints() [1/3]

void BesPolygon2D::SetPoints ( Double_t * P)
inline

Definition at line 71 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

71 {
72 for ( Int_t i = 0; i < fN * 3; i++ ) fP[i] = P[i];
73 }

Referenced by BesPolygon2D().

◆ SetPoints() [2/3]

void BesPolygon2D::SetPoints ( Double_t * P)
inline

Definition at line 71 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/BesPolygon2D.h.

71 {
72 for ( Int_t i = 0; i < fN * 3; i++ ) fP[i] = P[i];
73 }

◆ SetPoints() [3/3]

void BesPolygon2D::SetPoints ( Double_t * P)
inline

Definition at line 71 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/BesPolygon2D.h.

71 {
72 for ( Int_t i = 0; i < fN * 3; i++ ) fP[i] = P[i];
73 }

◆ SetRotatable() [1/3]

void BesPolygon2D::SetRotatable ( Bool_t input)
inline

Definition at line 64 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

64{ fRotatable = input; }

◆ SetRotatable() [2/3]

void BesPolygon2D::SetRotatable ( Bool_t input)
inline

◆ SetRotatable() [3/3]

void BesPolygon2D::SetRotatable ( Bool_t input)
inline

◆ SetSize() [1/3]

void BesPolygon2D::SetSize ( Double_t size)
virtual

Definition at line 370 of file BesPolygon2D.cxx.

370 {
371
372 if ( size > 0.95 ) size = 0.98; // too big could not see border
373 if ( size < 0.15 ) size = 0.2; // too small could not be seen
374
375 for ( Int_t i = 0; i < 3; i++ )
376 {
377 for ( Int_t j = 0; j < fN; j++ )
378 { fP[3 * j + i] = size * fP[3 * j + i] + ( 1.0 - size ) * fCenter[i]; }
379 }
380}

◆ SetSize() [2/3]

virtual void BesPolygon2D::SetSize ( Double_t size)
virtual

◆ SetSize() [3/3]

virtual void BesPolygon2D::SetSize ( Double_t size)
virtual

◆ SetTitle() [1/3]

void BesPolygon2D::SetTitle ( const char * name)
inline

Definition at line 66 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

66{ TNamed::SetTitle( name ); }

◆ SetTitle() [2/3]

void BesPolygon2D::SetTitle ( const char * name)
inline

Definition at line 66 of file InstallArea/x86_64-el9-gcc13-dbg/include/BesVisLib/BesPolygon2D.h.

66{ TNamed::SetTitle( name ); }

◆ SetTitle() [3/3]

void BesPolygon2D::SetTitle ( const char * name)
inline

Definition at line 66 of file InstallArea/x86_64-el9-gcc13-opt/include/BesVisLib/BesPolygon2D.h.

66{ TNamed::SetTitle( name ); }

◆ SetZRSign() [1/3]

void BesPolygon2D::SetZRSign ( Int_t sign)
virtual

Definition at line 301 of file BesPolygon2D.cxx.

301 {
302 //
303 // set sign of points for ZR view
304
305 for ( Int_t i = 0; i < fN; i++ )
306 {
307 // clear sign
308 fP[( i * 3 ) + 1] = TMath::Sign( 1., Double_t( fP[( i * 3 ) + 1] ) ) * fP[( i * 3 ) + 1];
309
310 // set sign
311 fP[( i * 3 ) + 1] = TMath::Sign( 1, sign ) * fP[( i * 3 ) + 1];
312 }
313}

◆ SetZRSign() [2/3]

virtual void BesPolygon2D::SetZRSign ( Int_t sign)
virtual

◆ SetZRSign() [3/3]

virtual void BesPolygon2D::SetZRSign ( Int_t sign)
virtual

◆ Stretch() [1/3]

void BesPolygon2D::Stretch ( Double_t sx,
Double_t sy,
Double_t sz,
Double_t factor )
virtual

Definition at line 384 of file BesPolygon2D.cxx.

384 {
385 // Compute geometric center of the polygon
386 Double_t C[3], V[3];
387 GetCenter( C );
388 Double_t s = TMath::Sqrt( sx * sx + sy * sy + sz * sz );
389 V[0] = sx / s;
390 V[1] = sy / s;
391 V[2] = sz / s;
392
393 // Rescale distances from the center
394 for ( Int_t i = 0; i < fN; ++i )
395 {
396 Double_t dot = ( fP[3 * i] - C[0] ) * V[0] + ( fP[3 * i + 1] - C[1] ) * V[1] +
397 ( fP[3 * i + 2] - C[2] ) * V[2];
398 for ( Int_t j = 0; j < 3; ++j ) { fP[3 * i + j] += dot * ( factor - 1 ) * V[j]; }
399 }
400}
XmlRpcServer s

◆ Stretch() [2/3]

virtual void BesPolygon2D::Stretch ( Double_t sx,
Double_t sy,
Double_t sz,
Double_t factor )
virtual

◆ Stretch() [3/3]

virtual void BesPolygon2D::Stretch ( Double_t sx,
Double_t sy,
Double_t sz,
Double_t factor )
virtual

Member Data Documentation

◆ f_xx

Double_t * BesPolygon2D::f_xx
protected

Definition at line 32 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

Referenced by BesPolygon2D(), and Paint().

◆ f_yy

Double_t * BesPolygon2D::f_yy
protected

Definition at line 33 of file EventDisplay/BesVisLib/include/BesVisLib/BesPolygon2D.h.

Referenced by BesPolygon2D(), and Paint().

◆ fCenter

Double_t BesPolygon2D::fCenter
protected

◆ fInfoBox

TPaveText * BesPolygon2D::fInfoBox
protected

◆ fN

◆ fP

◆ fPBackUp

Double_t * BesPolygon2D::fPBackUp
protected

◆ fRotatable

Bool_t BesPolygon2D::fRotatable
protected

The documentation for this class was generated from the following files: