Logo ROOT   6.12/07
Reference Guide
TPolyLineShape.cxx
Go to the documentation of this file.
1 // @(#)root/table:$Id$
2 // Author: Valeri Fine 1999
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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 "TPolyLineShape.h"
13 
14 #include "TPoints3D.h"
15 #include "TVolume.h"
16 #include "TVolumePosition.h"
17 #include "TTUBE.h"
18 #include "TBRIK.h"
19 #include "TSPHE.h"
20 #include "TView.h"
21 #include "TVirtualPad.h"
22 #include "TTablePadView3D.h"
23 #include "TPoint.h"
24 #include "TVirtualPS.h"
25 #include "TMath.h"
26 
27 //////////////////////////////////////////////////////////////////////////////////////
28 // //
29 // STAR 3D geometry Object Model //
30 // ============================= //
31 // //
32 // TDataSet Legend: //
33 // | "classA" //
34 // | | "classB" is derived from//
35 // v v the "classA" //
36 // TVolume "classB" //
37 // ^ //
38 // | "classQ" //
39 // | ^ "classQ" has a pointer //
40 // TShape | to "classT" //
41 // | "classT" //
42 // v //
43 // ----------------------------------------------------- //
44 // | | | | | //
45 // | | | . . . | | //
46 // | | | | | //
47 // V v v v v //
48 // TPolyLineShape TBRIK TTUBE TPCON TTRD1 //
49 // | ^ //
50 // | | <a href="http://root.cern.ch/root/html/TShape.html#TShape:description">R O O T S H A P E S</a> //
51 // V | (see <a href="https://cern-tex.web.cern.ch/cern-tex/geant_html3/node109.html#SECTION041000000000000000000000">GEANT 3.21 shapes</a> as well) //
52 // St_PolyLine3D | //
53 // | //
54 // TPoints3DABC //
55 // | //
56 // | //
57 // v //
58 // -------------------------------------------------------- //
59 // | | | | //
60 // | | | | //
61 // | | | | //
62 // V v v v //
63 //StHits3DPoints StHelix3DPoints TTable3Points TPoints3D //
64 // ^ ^ ^ ^ //
65 // | | | | //
66 // | | | | //
67 // StObjArray StTrack / StHelixD TTableSorter flat floating //
68 // ^ point array //
69 // | (see St_PolyLine3D as well) //
70 // | //
71 // TTable //
72 // //
73 // //
74 // S T A R S H A P E S //
75 // ------------------------------- //
76 // //
77 //////////////////////////////////////////////////////////////////////////////////////
78 
80 
81 ////////////////////////////////////////////////////////////////////////////////
82 ///to be documented
83 
85 {
86  fShape = 0;
87  fSmooth = kFALSE;
88  fConnection= 0;
89  fPoints=0;
91  fHasDrawn = kFALSE;
92  fShapeType = kNULL;
93  fSizeX3D = 0;
95  fLineFlag = kFALSE;
96 }
97 
98 ////////////////////////////////////////////////////////////////////////////////
99 /// fShape = new TTUBE("tube","tube","void",0.5,0.5);
100 
102 {
103  fShape = 0;
104  fShapeType = kNULL;
105  fSmooth = kFALSE;
106  fConnection = 0;
107  fPoints = points;
108  fHasDrawn = kFALSE;
109  fSizeX3D = 0;
110  // Take in account the current node if any
111  if (!fPoints) {
112  Error("TPolyLineShape","No polyline is defined");
113  return;
114  }
115  fPointFlag = strchr(option,'P')?kTRUE:kFALSE;
116  fLineFlag = strchr(option,'L')?kTRUE:kFALSE;
117 
118  SetWidthFactor();
119  Create();
120 }
121 
122 ////////////////////////////////////////////////////////////////////////////////
123 ///to be documented
124 
126 {
129 }
130 
131 ////////////////////////////////////////////////////////////////////////////////
132 ///to be documented
133 
135 {
137 }
138 
139 ////////////////////////////////////////////////////////////////////////////////
140 ///to be documented
141 
143 {
144  if (!fSizeX3D) fSizeX3D = new Size3D;
145  fSizeX3D->numPoints = 0;
146  fSizeX3D->numSegs = 0;
147  fSizeX3D->numPolys = 0; //NOTE: Because of different structure, our
148  if (fPoints) {
149  Int_t size = fPoints->Size();
150  if (marker) {
151  Int_t mode;
152  if (size > 10000) mode = 1; // One line marker '-'
153  else if (size > 3000) mode = 2; // Two lines marker '+'
154  else mode = 3; // Three lines marker '*'
155 
156  fSizeX3D->numSegs = size*mode;
157  fSizeX3D->numPoints = size*mode*2;
158  fSizeX3D->numPolys = 0;
159  } else {
160  fSizeX3D->numSegs = size-1;
161  fSizeX3D->numPoints = size;
162  }
163  fSizeX3D->numPolys = 0; //NOTE: Because of different structure, our
164  }
165  return fSizeX3D;
166 }
167 
168 ////////////////////////////////////////////////////////////////////////////////
169 ///to be documented
170 
172 {
173  Float_t size = 0.5*GetWidthFactor()*GetLineWidth();
174 
175  if (fShapeType != connection) {
177  fShapeType = connection;
178  switch (fShapeType) {
179  case kSphere:
180  SetConnection(new TSPHE("connection","sphere","void",0,size,0,90,0,360));
181  break;
182  default:
183  SetConnection(new TBRIK("connection","brik","void",size,size,size));
184  break;
185  };
186  }
187  return 0;
188 }
189 
190 ////////////////////////////////////////////////////////////////////////////////
191 /// Compute distance from point px,py to a 3-D polyline.
192 ///
193 /// Compute the closest distance of approach from point px,py to each segment
194 /// of the polyline.
195 /// Returns when the distance found is below DistanceMaximum.
196 /// The distance is computed in pixels units.
197 
199 {
200  if (fPoints) {
201  Int_t ret = fPoints->DistancetoPrimitive( px, py);
202  if (ret == -1) ret = PointDistancetoPrimitive(px, py);
203  return ret;
204  }
205  return 999999;
206 }
207 
208 ////////////////////////////////////////////////////////////////////////////////
209 /// Compute distance from point px,py to a 3-D points.
210 ///
211 /// Compute the closest distance of approach from point px,py to each segment
212 /// of the polyline.
213 /// Returns when the distance found is below DistanceMaximum.
214 /// The distance is computed in pixels units.
215 
217 {
218  const Int_t inaxis = 7;
219  Float_t dist = 999999;
220 
221  Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
222  Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
223  Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
224  Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());
225 
226  TView *view = 0;
227 //*-*- return if point is not in the user area
228  if (px < puxmin - inaxis) goto END;
229  if (py > puymin + inaxis) goto END;
230  if (px > puxmax + inaxis) goto END;
231  if (py < puymax - inaxis) goto END;
232 
233  view = gPad->GetView();
234  if (view) {
235  Int_t i;
236  Float_t dpoint;
237  Float_t xndc[3];
238  Int_t x1,y1;
239  Int_t pointSize = fPoints->Size();
240  for (i=0;i<pointSize;i++) {
241  Float_t thisPoints[3];
242  view->WCtoNDC(fPoints->GetXYZ(thisPoints,i), xndc);
243  x1 = gPad->XtoAbsPixel(xndc[0]);
244  y1 = gPad->YtoAbsPixel(xndc[1]);
245  dpoint = (px-x1)*(px-x1) + (py-y1)*(py-y1);
246  if (dpoint < dist) dist = dpoint;
247  }
248  dist = (TMath::Sqrt(dist));
249  }
250 END:
251  return Int_t(dist);
252 }
253 
254 ////////////////////////////////////////////////////////////////////////////////
255 ///to be documented
256 
258 {
259  Create();
260  AppendPad();
261 }
262 
263 ////////////////////////////////////////////////////////////////////////////////
264 /// forward the ExecuteEvent call to the decorated object
265 
267 {
268  if (fPoints) fPoints->ExecuteEvent(event,px, py);
269 }
270 
271 ////////////////////////////////////////////////////////////////////////////////
272 ///to be documented
273 
275 {
276  return ((TPolyLineShape *)this)->GetLineColor();
277 }
278 ////////////////////////////////////////////////////////////////////////////////
279 /// forward the GetName call to the decorated object
280 
281 const char *TPolyLineShape::GetName() const
282 {
283  return fPoints ? fPoints->GetName() : TShape::GetName();
284 }
285 ////////////////////////////////////////////////////////////////////////////////
286 /// forward the GetObjectInfo call to the decorated object
287 
289 {
290  return fPoints ? fPoints->GetObjectInfo(px, py) : TShape::GetObjectInfo(px,py);
291 }
292 
293 ////////////////////////////////////////////////////////////////////////////////
294 ///to be documented
295 
297 {
298  return ((TPolyLineShape *)this)->GetMarkerSize();
299 }
300 
301 ////////////////////////////////////////////////////////////////////////////////
302 ///to be documented
303 
305 {
306  return ((TPolyLineShape *)this)->GetLineStyle();
307 }
308 
309 ////////////////////////////////////////////////////////////////////////////////
310 /// forward the GetObjectInfo call to the decorated object
311 
312 const char *TPolyLineShape::GetTitle() const
313 {
314  return fPoints ? fPoints->GetTitle() : TShape::GetTitle();
315 }
316 ////////////////////////////////////////////////////////////////////////////////
317 /// Double_t *start - coordinate of the start point of the current segment
318 /// Double_t *end - coordinate of the end point of the current segment
319 
321 {
322  // Calculate the vector
323  const Int_t kDimension = 3;
324  Double_t vector[kDimension];
325  Double_t nodeposition[kDimension];
326  Int_t i=0;
327  for (i=0;i<kDimension;i++) {
328  vector[i]=end[i]-start[i];
329  nodeposition[i]=0.5*(start[i]+end[i]);
330  }
331  Double_t length = TMath::Normalize(vector);
332 
333  // Calculate the rotation axis for Axis Oz
334 
335  Double_t oz[3]={0,0,1};
336  Double_t rotate[3];
337 
338  Double_t sina = TMath::Normalize(TMath::Cross(vector,oz,rotate));
339  Double_t cosa = Product(vector,oz);
340  Double_t mrot[3][3];
341 
342  TShape *shape = fShape;
343  if (!shape) shape = fConnection;
344 
345  Gyrot(rotate,cosa,sina,mrot);
346 
347  Float_t width = GetWidthFactor()*GetLineWidth();
348 
349  mrot[0][0] *= width;
350  mrot[0][1] *= width;
351  mrot[0][2] *= width;
352 
353  mrot[1][0] *= width;
354  mrot[1][1] *= width;
355  mrot[1][2] *= width;
356 
357  mrot[2][0] *= length;
358  mrot[2][1] *= length;
359  mrot[2][2] *= length;
360 
361  Color_t color = GetLineColor();
362 
363  TVolume node("SegmentNode","SegmentNode", shape);
364  node.SetLineColor(color);
365  if (!fShape) node.SetVisibility();
366  node.SetLineColor(color);
367 
368  TRotMatrix matrix ("rotate","rotate",&mrot[0][0]);
369  TVolumePosition position(&node,nodeposition[0],nodeposition[1]
370  ,nodeposition[2],&matrix);
371 
372  if (!(fSmooth || fConnection)) {
373  node.PaintNodePosition(option, &position);
374  return;
375  }
376 
377  // Add the connection
378 
379  memset(mrot,0,9*sizeof(Double_t));
380 
381  length = width/length;
382  mrot[2][2] = length;
383  mrot[0][0] = 1;
384  mrot[1][1] = 1;
385 
386  TRotMatrix kneeMatrix("knee","knee",&mrot[0][0]);
387  TVolume knee("ConnectionNode","ConnectionNode", fConnection);
388  TVolumePosition kneePosition(&knee, 0, 0, 0.5, &kneeMatrix);
389  knee.SetLineColor(color);
390  node.Add(&knee,&kneePosition);
391 
392  node.PaintNodePosition(option, &position);
393 }
394 
395 ////////////////////////////////////////////////////////////////////////////////
396 ///to be documented
397 
399 {
400  if (!GetPoints()) return;
401 
402  Bool_t rangeView = opt && opt[0] && strcmp(opt,"range")==0 ? kTRUE : kFALSE;
403  TTablePadView3D *view3D = 0;
404  if (!rangeView && (view3D = (TTablePadView3D*)gPad->GetView3D()) ) {
405  TString mode;
406 
407  mode="";
408  if (fLineFlag) mode = "L";
409  if (fPointFlag) mode += "P";
410 
412  view3D->PaintPoints3D(GetPoints(), mode.Data());
413  }
414  if (opt && !strstr(opt, "x3d")) {
415  if (fPointFlag) {
419  }
420  if (fLineFlag) {
424  }
425 
426  } else {
427  if (fLineFlag) {
429  } else {
431  }
432 // Paint3d(opt);
433  }
434 }
435 
436 ////////////////////////////////////////////////////////////////////////////////
437 /// Draw this 3-D polyline with new coordinates.
438 
440 {
441  if (n < 2) return;
442 
443  TAttLine::Modify(); //Change line attributes only if necessary
444 
445 //*-*- Loop on each individual line
446  for (Int_t i=1;i<n;i++) {
447  Float_t xyz[6];
448  fPoints->GetXYZ(&xyz[0],i-1,2);
449  gPad->PaintLine3D(xyz, &xyz[3]);
450  }
451 }
452 
453 ////////////////////////////////////////////////////////////////////////////////
454 /// Paint polymarker in CurrentPad World coordinates.
455 
457 {
458  if (n <= 0) return;
459 
460  TView *view = gPad->GetView(); //Get current 3-D view
461  if(!view) return; //Check if `view` is valid
462 
463  //Create temporary storage
464  TPoint *pxy = new TPoint[n];
465  Float_t *x = new Float_t[n];
466  Float_t *y = new Float_t[n];
467  Float_t xndc[3], ptr[3];
468 
469 //*-*- convert points from world to pixel coordinates
470  Int_t nin = 0;
471  for (Int_t i = 0; i < n; i++) {
472  fPoints->GetXYZ(ptr,i);
473  view->WCtoNDC(ptr, xndc);
474  if (xndc[0] < gPad->GetX1() || xndc[0] > gPad->GetX2()) continue;
475  if (xndc[1] < gPad->GetY1() || xndc[1] > gPad->GetY2()) continue;
476  x[nin] = xndc[0];
477  y[nin] = xndc[1];
478  pxy[nin].fX = gPad->XtoPixel(x[nin]);
479  pxy[nin].fY = gPad->YtoPixel(y[nin]);
480  nin++;
481  }
482 
483  TAttMarker::Modify(); //Change marker attributes only if necessary
484 
485 //*-*- invoke the graphics subsystem
486  if (!gPad->IsBatch()) gVirtualX->DrawPolyMarker(nin, pxy);
487 
488 
489  if (gVirtualPS) {
490  gVirtualPS->DrawPolyMarker(nin, x, y);
491  }
492  delete [] x;
493  delete [] y;
494 
495  delete [] pxy;
496 }
497 
498 ////////////////////////////////////////////////////////////////////////////////
499 ///to be documented
500 
502 {
503  if (!fPoints) return;
504 
505  Create();
506 
507  struct XYZ { Float_t fValues[3]; } *points;
508  points = (XYZ *)(fPoints->GetP());
509  Int_t size = fPoints->GetN()-1;
510 
511  for (Int_t i=0;i<size;i++)
512  PaintNode((Float_t *)(points+i+1),(Float_t *)(points+i),opt);
513  fHasDrawn = kTRUE;
514 }
515 
516 ////////////////////////////////////////////////////////////////////////////////
517 ///to be documented
518 
520 {
521 #ifndef WIN32
522  Int_t size = 0;
523  if (fPoints) size = fPoints->Size();
524  if (!size) return;
525 
526  X3DBuffer *buff = new X3DBuffer;
527  if (!buff) return;
528 
529  fSizeX3D->numPoints = buff->numPoints = size;
530  fSizeX3D->numSegs = buff->numSegs = size-1;
531  fSizeX3D->numPolys = buff->numPolys = 0; //NOTE: Because of different structure, our
532 
533  buff->polys = 0; // TPolyLine3D can't use polygons
534  TPoints3D x3dPoints(size);
535  buff->points = fPoints->GetXYZ(x3dPoints.GetP(),0,size);
536 
537 // Int_t c = (((fAttributes?fAttributes->GetColorAttribute():0) % 8) - 1) * 4; // Basic colors: 0, 1, ... 8
538  Int_t c = ((GetColorAttribute() % 8) - 1) * 4; // Basic colors: 0, 1, ... 8
539  if (c < 0) c = 0;
540 
541  //*-* Allocate memory for segments *-*
542  buff->segs = new Int_t[buff->numSegs*3];
543  if (buff->segs) {
544  for (Int_t i = 0; i < buff->numSegs; i++) {
545  buff->segs[3*i ] = c;
546  buff->segs[3*i+1] = i;
547  buff->segs[3*i+2] = i+1;
548  }
549  }
550 
551 
552  if (buff && buff->points && buff->segs) //If everything seems to be OK ...
553  FillX3DBuffer(buff);
554  else { // ... something very bad was happened
555  gSize3D.numPoints -= buff->numPoints;
556  gSize3D.numSegs -= buff->numSegs;
557  gSize3D.numPolys -= buff->numPolys;
558  }
559 
560  if (buff->segs) delete [] buff->segs;
561  if (buff->polys) delete [] buff->polys;
562  if (buff) delete buff;
563 #endif
564 }
565 
566 ////////////////////////////////////////////////////////////////////////////////
567 ///to be documented
568 
570 {
571 #ifndef WIN32
572  Int_t size = 0;
573  if (fPoints) size = fPoints->Size();
574  if (!size) return;
575  Int_t mode;
576  Int_t i, j, k, n;
577 
578  X3DBuffer *buff = new X3DBuffer;
579  if(!buff) return;
580 
581  if (size > 10000) mode = 1; // One line marker '-'
582  else if (size > 3000) mode = 2; // Two lines marker '+'
583  else mode = 3; // Three lines marker '*'
584 
585  fSizeX3D->numSegs = buff->numSegs = size*mode;
586  fSizeX3D->numPoints = buff->numPoints = buff->numSegs*2;
587  fSizeX3D->numPolys = buff->numPolys = 0; //NOTE: Because of different structure, our
588 
589  buff->polys = 0; // TPolyMarker3D can't use polygons
590 
591 
592  //*-* Allocate memory for points *-*
593  Float_t delta = 0.002;
594 
595  buff->points = new Float_t[buff->numPoints*3];
596  if (buff->points) {
597  for (i = 0; i < size; i++) {
598  for (j = 0; j < mode; j++) {
599  for (k = 0; k < 2; k++) {
600  delta *= -1;
601  for (n = 0; n < 3; n++) {
602  Float_t xyz[3];
603  fPoints->GetXYZ(xyz,i);
604  buff->points[mode*6*i+6*j+3*k+n] =
605  xyz[n] * (1 + (j == n ? delta : 0));
606  }
607  }
608  }
609  }
610  }
611 
612  Int_t c = ((GetColorAttribute() % 8) - 1) * 4; // Basic colors: 0, 1, ... 8
613  if (c < 0) c = 0;
614 
615  //*-* Allocate memory for segments *-*
616  buff->segs = new Int_t[buff->numSegs*3];
617  if (buff->segs) {
618  for (i = 0; i < buff->numSegs; i++) {
619  buff->segs[3*i ] = c;
620  buff->segs[3*i+1] = 2*i;
621  buff->segs[3*i+2] = 2*i+1;
622  }
623  }
624 
625  if (buff->points && buff->segs) //If everything seems to be OK ...
626  FillX3DBuffer(buff);
627  else { // ... something very bad was happened
628  gSize3D.numPoints -= buff->numPoints;
629  gSize3D.numSegs -= buff->numSegs;
630  gSize3D.numPolys -= buff->numPolys;
631  }
632 
633  if (buff->points) delete [] buff->points;
634  if (buff->segs) delete [] buff->segs;
635  if (buff->polys) delete [] buff->polys;
636  if (buff) delete buff;
637 #endif
638 }
639 
640 ////////////////////////////////////////////////////////////////////////////////
641 ///to be documented
642 
644 {
645  Float_t p = 0;
646  if (v1 && v2 && ndim > 0)
647  for (Int_t i=0; i<ndim; i++) p+= v1[i]*v2[i];
648  return p;
649 }
650 
651 ////////////////////////////////////////////////////////////////////////////////
652 ///to be documented
653 
655 {
656  Double_t p = 0;
657  if (v1 && v2 && ndim > 0)
658  for (Int_t i=0;i<ndim;i++) p+= v1[i]*v2[i];
659  return p;
660 }
661 
662 ////////////////////////////////////////////////////////////////////////////////
663 ///************************************************************************
664 ///* *
665 ///* call gyrot(dirc,angp,trans,ntrans) vp 880722 *
666 ///* revised vp 921009 *
667 ///* revised (f->c++) vf 981006 *
668 ///* routine for filling rotation transformation matrix *
669 ///* from axis and rotation angle around *
670 ///* *
671 ///* arguments: *
672 ///* dirc direct cosinuses (may be not normalised) *
673 ///* cosang, sinang - cos and sin of the rotation angle *
674 ///* tranz rotation & shift matrix 3*3 (input/output) *
675 ///* --------------------------------------------------------------- *
676 ///* This code is provided by Victor Perevoztchikov *
677 ///************************************************************************
678 
679 Double_t *TPolyLineShape::Gyrot(Double_t *dirc, Double_t cosang, Double_t sinang, Double_t trans[3][3])
680 {
681  Double_t ax[3];
682 
683  memcpy(ax,dirc,3*sizeof(Double_t));
684  TMath::Normalize(ax);
685 
686  Double_t ca = cosang;
687  Double_t sa = sinang;
688  Double_t ca1;
689 
690  if (ca < 0.5)
691  ca1 = 1. - ca ;
692  else
693  ca1 = (sa*sa)/(1.+ca) ;
694 
695  Int_t j1 = 0;
696  Int_t j2 = 0;
697  for(j1 = 0; j1 < 3; j1++) {
698  for(j2 = 0; j2 < 3; j2++)
699  trans[j1][j2] = ca1*ax[j1]*ax[j2];
700  trans[j1][j1] += ca;
701  }
702 
703  trans[0][1] = trans[0][1] - sa*ax[2];
704  trans[1][0] = trans[1][0] + sa*ax[2];
705  trans[0][2] = trans[0][2] + sa*ax[1];
706  trans[2][0] = trans[2][0] - sa*ax[1];
707  trans[1][2] = trans[1][2] - sa*ax[0];
708  trans[2][1] = trans[2][1] + sa*ax[0];
709 
710  return (Double_t *)trans;
711 
712 }
713 
714 ////////////////////////////////////////////////////////////////////////////////
715 ///to be documented
716 
718 {
719  Color_t currentColor = GetColorAttribute();
720  if (color != currentColor) {
721  SetLineColor(color);
722  SetMarkerColor(color);
723  }
724  return currentColor;
725 }
726 
727 ////////////////////////////////////////////////////////////////////////////////
728 ///to be documented
729 
731 {
732  Size_t currentSize = GetSizeAttribute();
733  if (size != currentSize) {
734  SetLineWidth(Width_t(size));
735  SetMarkerSize(size);
736  }
737  return currentSize;
738 }
739 
740 ////////////////////////////////////////////////////////////////////////////////
741 /// Set new style for this line.
742 /// Returns:
743 /// previous value of the line style
744 
746 {
747  Style_t s = 0;
748  s = GetStyleAttribute();
749  SetLineStyle(style);
750  SetMarkerStyle(style);
751  return s;
752 }
753 
754 ////////////////////////////////////////////////////////////////////////////////
755 ///to be documented
756 
758 {
760  fShape = shape;
761 }
762 
763 ////////////////////////////////////////////////////////////////////////////////
764 ///to be documented
765 
767 {
768  return fPoints ? fPoints->Size():0;
769 }
770 
771 ////////////////////////////////////////////////////////////////////////////////
772 /// Return total X3D size of this shape with its attributes.
773 
775 {
777  if (fLineFlag )
778  line->CreateX3DSize(kFALSE);
779  else
780  line->CreateX3DSize(kTRUE);
781  if (fSizeX3D) {
782  gSize3D.numPoints += fSizeX3D->numPoints;
783  gSize3D.numSegs += fSizeX3D->numSegs;
784  gSize3D.numPolys += fSizeX3D->numPolys;
785  }
786  else Error("Sizeof3D()","buffer size has not been defined yet");
787 }
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
virtual Float_t * GetXYZ(Float_t *xyz, Int_t idx, Int_t num=1) const
GetXYZ(Float_t *xyz,Int_t idx,Int_t num=1) fills the buffer supplied by the calling code with the poi...
EShapeTypes
double dist(Rotation3D const &r1, Rotation3D const &r2)
Definition: 3DDistances.cxx:48
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)=0
Computes distance from point (px,py) to the object.
virtual Int_t Size() const
to be documented
Float_t Normalize(Float_t v[3])
Normalize a vector v in place.
Definition: TMath.cxx:498
short Style_t
Definition: RtypesCore.h:76
virtual void SetShape(TShape *shape)
to be documented
virtual void PaintPoints3D(const TPoints3DABC *points, Option_t *opt="")
TLine * line
virtual void WCtoNDC(const Float_t *pw, Float_t *pn)=0
float Float_t
Definition: RtypesCore.h:53
float Size_t
Definition: RtypesCore.h:83
const char Option_t
Definition: RtypesCore.h:62
Abstract class to define Arrays of 3D points.
Definition: TPoints3DABC.h:25
virtual void DrawPolyMarker(Int_t n, Float_t *x, Float_t *y)=0
virtual Size_t SetSizeAttribute(Size_t size)
to be documented
See TView3D.
Definition: TView.h:25
struct _x3d_data_ X3DBuffer
SCoord_t fX
Definition: TPoint.h:35
virtual void PaintNode(Float_t *start, Float_t *end, Option_t *option)
Double_t *start - coordinate of the start point of the current segment Double_t *end - coordinate of ...
int numPolys
Definition: X3DBuffer.h:18
virtual Size_t GetSizeAttribute() const
to be documented
virtual void SetConnection(TShape *connection)
SCoord_t fY
Definition: TPoint.h:36
virtual Size3D * CreateX3DSize(Bool_t marker=kFALSE)
to be documented
Basic string class.
Definition: TString.h:125
virtual Int_t PointDistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a 3-D points.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
forward the ExecuteEvent call to the decorated object
virtual void Paint(Option_t *opt)
to be documented
virtual void Create()
the X3D buffer sizes
virtual void Sizeof3D() const
Return total X3D size of this shape with its attributes.
virtual Float_t GetWidthFactor() const
virtual void Modify()
Change current line attributes if necessary.
Definition: TAttLine.cxx:232
TPolyLineShape()
to be documented
virtual void SetWidthFactor(Float_t fact=1.0)
virtual Color_t GetColorAttribute() const
to be documented
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
Definition: TObject.cxx:386
int numSegs
Definition: X3DBuffer.h:17
virtual Width_t GetLineWidth() const
Return the line width.
Definition: TAttLine.h:35
virtual const char * GetTitle() const
forward the GetObjectInfo call to the decorated object
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition: TObject.cxx:105
virtual void PaintX3DLine(Option_t *opt="")
to be documented
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a 3-D polyline.
virtual Style_t SetStyleAttribute(Style_t style)
Set new style for this line.
#define SafeDelete(p)
Definition: RConfig.h:509
Double_t x[n]
Definition: legend1.C:17
int * polys
Definition: X3DBuffer.h:21
virtual void Add(TDataSet *dataset)
Definition: TVolume.h:97
A Sphere.
Definition: TSPHE.h:28
virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible)
Set visibility for this volume and its sons.
Definition: TVolume.cxx:747
virtual void Paint3d(Option_t *opt)
to be documented
virtual ~TPolyLineShape()
to be documented
virtual Style_t GetStyleAttribute() const
to be documented
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition: TAttMarker.h:38
virtual void PaintX3DMarker(Option_t *opt="")
to be documented
float * points
Definition: X3DBuffer.h:19
void FillX3DBuffer(X3DBuffer *buff)
Definition: X3DBuffer.c:140
virtual char * GetObjectInfo(Int_t px, Int_t py) const
forward the GetObjectInfo call to the decorated object
short Marker_t
Definition: RtypesCore.h:77
int numPoints
Definition: X3DBuffer.h:25
virtual Int_t GetN() const
GetN() returns the number of allocated cells if any.
TShape * fConnection
short Color_t
Definition: RtypesCore.h:79
int * segs
Definition: X3DBuffer.h:20
struct _x3d_sizeof_ Size3D
Definition: TPoint.h:31
point * points
Definition: X3DBuffer.c:20
virtual Float_t * GetP() const
GetP() returns the pointer to the float point array of points if available The number of the availabl...
Definition: TPoints3D.h:76
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
virtual void Modify()
Change current marker attributes if necessary.
Definition: TAttMarker.cxx:219
This is the base class for all geometry shapes.
Definition: TShape.h:35
Manages a detector rotation matrix.
Definition: TRotMatrix.h:28
#define gSize3D
Definition: X3DBuffer.h:40
virtual void PaintNodePosition(Option_t *option="", TVolumePosition *postion=0)
Definition: TVolume.cxx:585
static Double_t * Gyrot(Double_t *dirc, Double_t cosang, Double_t sinang, Double_t trans[3][3])
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
Definition: TAttMarker.h:40
T * Cross(const T v1[3], const T v2[3], T out[3])
Definition: TMath.h:1168
virtual TPoints3DABC * GetPoints() const
virtual Color_t SetColorAttribute(Color_t color)
to be documented
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Definition: TAttMarker.h:41
#define gVirtualX
Definition: TVirtualX.h:350
short Width_t
Definition: RtypesCore.h:78
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual Color_t GetLineColor() const
Return the line color.
Definition: TAttLine.h:33
A box with faces perpendicular to the axes.
Definition: TBRIK.h:26
const Int_t kDimension
static const double x1[5]
#define ClassImp(name)
Definition: Rtypes.h:359
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to an event at (px,py).
Definition: TObject.cxx:311
TPoints3DABC * fPoints
double Double_t
Definition: RtypesCore.h:55
EShapeTypes fShapeType
Size3D * fSizeX3D
TCanvas * style()
Definition: style.C:1
Double_t y[n]
Definition: legend1.C:17
static constexpr double s
virtual void SetLineAttr(Color_t color, Int_t width, Option_t *opt="")
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition: TAttLine.h:42
virtual void PaintPolyMarker(Int_t n, Float_t *p=0, Marker_t m=0, Option_t *opt="")
Paint polymarker in CurrentPad World coordinates.
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:401
virtual Float_t * GetP() const
GetP() returns the pointer to the float point array of points if available The number of the availabl...
static Float_t Product(Float_t *v1, Float_t *v2, Int_t ndim=3)
to be documented
R__EXTERN TVirtualPS * gVirtualPS
Definition: TVirtualPS.h:81
#define gPad
Definition: TVirtualPad.h:285
Double_t Sqrt(Double_t x)
Definition: TMath.h:590
virtual Int_t Size() const =0
int numPolys
Definition: X3DBuffer.h:27
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:357
int numPoints
Definition: X3DBuffer.h:16
const Bool_t kTRUE
Definition: RtypesCore.h:87
const Int_t n
Definition: legend1.C:16
virtual void Draw(Option_t *opt="")
to be documented
virtual void PaintPoints(Int_t n, Float_t *p=0, Option_t *opt="")
Draw this 3-D polyline with new coordinates.
virtual const char * GetName() const
forward the GetName call to the decorated object
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
const char * Data() const
Definition: TString.h:345