211 Error(
"CheckShape",
"No geometry manager");
250 return ((
TObject *)
this)->ClassName();
261 if (!painter)
return 9999;
272 if (point[0]*c1+point[1]*s1 >= 0) saf1 =
TMath::Abs(-point[0]*s1 + point[1]*c1);
273 if (point[0]*c2+point[1]*s2 >= 0) saf2 =
TMath::Abs(point[0]*s2 - point[1]*c2);
275 if (saf<epsil)
return kTRUE;
285 while (phi<phi1) phi+=360.;
287 if (ddp>phi2-phi1)
return kFALSE;
301 Double_t rxy0 = point[0]*cphi+point[1]*sphi;
315 if (ddotn<=0)
return kFALSE;
317 rxy = rxy0+snext*(dir[0]*cphi+dir[1]*sphi);
351 a1 = (x2*y1-x1*y2)/dx1;
355 a2 = (x4*y3-x3*y4)/dx2;
358 if (stand1 && stand2) {
362 if ((y3-y1)*(y3-y2)<-eps || (y4-y1)*(y4-y2)<-eps ||
363 (y1-y3)*(y1-y4)<-eps || (y2-y3)*(y2-y4)<-eps)
return kTRUE;
385 if ((x3-x1)*(x3-
x2)<-eps || (x4-x1)*(x4-
x2)<-eps ||
386 (x1-x3)*(x1-
x4)<-eps || (x2-x3)*(x2-
x4)<-eps)
return kTRUE;
389 xm = (a1-a2)/(b2-b1);
390 ym = (a1*b2-a2*b1)/(b2-b1);
394 Double_t check = (xm-
x1)*(xm-x2)+(ym-y1)*(ym-y2);
395 if (check > -eps)
return kFALSE;
396 check = (xm-
x3)*(xm-x4)+(ym-y3)*(ym-y4);
397 if (check > -eps)
return kFALSE;
413 s=-point[0]*s1+point[1]*
c1;
417 if (((point[0]+s*dir[0])*sm-(point[1]+s*dir[1])*cm)>=0) sfi1=s;
420 un = -dir[0]*s2+dir[1]*
c2;
423 s=point[0]*s2-point[1]*
c2;
427 if ((-(point[0]+s*dir[0])*sm+(point[1]+s*dir[1])*cm)>=0) sfi2=s;
440 if (point[0]*c1+point[1]*s1 >= 0) saf1 =
TMath::Abs(-point[0]*s1 + point[1]*c1);
441 if (point[0]*c2+point[1]*s2 >= 0) saf2 =
TMath::Abs(point[0]*s2 - point[1]*c2);
453 if (dir[0]*norm[0]+dir[1]*norm[1] < 0) {
473 Double_t rsq = point[0]*point[0]+point[1]*point[1];
474 Double_t rproj = point[0]*c1+point[1]*s1;
476 if (safsq<0)
return 0.;
478 rproj = point[0]*c2+point[1]*s2;
479 safsq = rsq-rproj*rproj;
480 if (safsq<0)
return 0.;
495 Double_t crossp = (z2-z1)*(r-r1)-(z-z1)*(r2-r1);
496 crossp *= (outer) ? 1. : -1.;
499 if (((z-z1)*(z2-z)) > -1.E-10)
return 0;
505 if (c1<1.
E-10)
return TMath::Sqrt((r-r1)*(r-r1)+(z-z1)*(z-z1));
509 if (c2>-1.
E-10)
return TMath::Sqrt((r-r2)*(r-r2)+(z-z2)*(z-z2));
511 c2 = (z2-z1)*(z2-z1)+(r2-
r1)*(r2-r1);
555 for (j = 0; j < NbPnts; j++) {
558 points[i] = dmaster[0];
559 points[i+1] = dmaster[1];
560 points[i+2] = dmaster[2];
567 for (j = 0; j < NbPnts; j++) {
577 points[i] = dmaster[0];
578 points[i+1] = dmaster[1];
579 points[i+2] = dmaster[2];
621 if (visdensity>0 && paintVolume->
GetMedium()) {
631 if (paintVolume && paintVolume->
GetShape()) {
655 if (!localMasterMat) {
673 Int_t basicColor = 0;
678 if (basicColor < 0) basicColor = 0;
690 Warning(
"GetBuffer3D",
"this must be implemented for shapes in a TGeoPainter hierarchy. This will be come a pure virtual fn eventually.");
722 if (option && option[0]) {
735 if (option && option[0]) {
virtual void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const
Fill the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections...
void CheckShape(Int_t testNo, Int_t nsamples=10000, Option_t *option="")
Test for shape navigation methods.
virtual ~TGeoShape()
Destructor.
void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option)
Test for shape navigation methods.
#define snext(osub1, osub2)
static Double_t ComputeEpsMch()
Compute machine round-off double precision error as the smallest number that if added to 1...
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute mouse actions on this shape.
static Double_t EpsMch()
static function returning the machine round-off error
Int_t GetBasicColor() const
Get the basic color (0-7).
Double_t fLocalMaster[16]
void SetLocalMasterIdentity()
Set kRaw tessellation section of buffer with supplied sizes.
virtual TObject * Remove(TObject *obj)
Remove object from array.
TGeoHMatrix * GetCurrentMatrix() const
void ClearSectionsValid()
Clear any sections marked valid.
TObjArray * GetListOfShapes() const
Short_t Min(Short_t a, Short_t b)
static Double_t SafetyPhi(const Double_t *point, Bool_t in, Double_t phi1, Double_t phi2)
Static method to compute safety w.r.t a phi corner defined by cosines/sines of the angles phi1...
void GetHomogenousMatrix(Double_t *hmat) const
The homogenous matrix associated with the transformation is used for piling up's and visualization...
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
static Double_t Tolerance()
const char * Data() const
static const double x2[5]
Bool_t IsMatrixTransform() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
The TNamed class is the base class for all named ROOT classes.
void LocalToMaster(const Double_t *local, Double_t *master) const
TVirtualGeoPainter * GetPainter() const
static Bool_t IsCrossingSemiplane(const Double_t *point, const Double_t *dir, Double_t cphi, Double_t sphi, Double_t &snext, Double_t &rxy)
Compute distance from POINT to semiplane defined by PHI angle along DIR.
static const double x4[22]
void LocalToMasterBomb(const Double_t *local, Double_t *master) const
Double_t ATan2(Double_t, Double_t)
TGeoVolume * GetPaintVolume() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TGeoMaterial * GetMaterial() const
TGeoVolume * GetTopVolume() const
static void SetTransform(TGeoMatrix *matrix)
Set current transformation matrix that applies to shape.
virtual Int_t ShapeDistancetoPrimitive(const TGeoShape *shape, Int_t numpoints, Int_t px, Int_t py) const =0
void SetSectionsValid(UInt_t mask)
static Double_t SafetySeg(Double_t r, Double_t z, Double_t r1, Double_t z1, Double_t r2, Double_t z2, Bool_t outer)
Compute distance from point of coordinates (r,z) to segment (r1,z1):(r2,z2)
static Bool_t IsSegCrossing(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t x3, Double_t y3, Double_t x4, Double_t y4)
Check if segments (A,B) and (C,D) are crossing, where: A(x1,y1), B(x2,y2), C(x3,y3), D(x4,y4)
TGeoShape()
Default constructor.
void TransformPoints(Double_t *points, UInt_t NbPoints) const
Tranform a set of points (LocalToMaster)
Int_t GetBombMode() const
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
unsigned int r1[N_CITIES]
void ResetShapeBit(UInt_t f)
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
static Double_t DistToPhiMin(const Double_t *point, const Double_t *dir, Double_t s1, Double_t c1, Double_t s2, Double_t c2, Double_t sm, Double_t cm, Bool_t in=kTRUE)
compute distance from point (inside phi) to both phi planes. Return minimum.
Bool_t IsCleaning() const
static Bool_t IsInPhiRange(const Double_t *point, Double_t phi1, Double_t phi2)
Static method to check if a point is in the phi range (phi1, phi2) [degrees].
Generic 3D primitive description class.
virtual const char * GetName() const
Returns name of object.
virtual Color_t GetLineColor() const
virtual const char * GetName() const
Get the shape name.
static TGeoMatrix * fgTransform
virtual Bool_t IsReflected() const
static Bool_t IsCloseToPhi(Double_t epsil, const Double_t *point, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
True if point is closer than epsil to one of the phi planes defined by c1,s1 or c2,s2.
virtual Int_t GetSize() const
TGeoShape * GetShape() const
static const double x1[5]
TGeoHMatrix * GetGLMatrix() const
R__EXTERN TGeoManager * gGeoManager
virtual Bool_t IsComposite() const
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
const char * GetPointerName() const
Provide a pointer name containing uid.
Int_t AddShape(const TGeoShape *shape)
Add a shape to the list. Returns index of the shape in list.
virtual UInt_t GetUniqueID() const
Return the unique object id.
static TGeoMatrix * GetTransform()
Returns current transformation matrix that applies to shape.
void SetShapeBit(UInt_t f, Bool_t set)
Equivalent of TObject::SetBit.
Mother of all ROOT objects.
virtual void DrawShape(TGeoShape *shape, Option_t *option="")=0
virtual void ExecuteShapeEvent(TGeoShape *shape, Int_t event, Int_t px, Int_t py)=0
Bool_t IsMatrixReflection() const
virtual Double_t GetDensity() const
TGeoMedium * GetMedium() const
virtual void LocalToMasterBomb(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
static void NormalPhi(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
Static method to compute normal to phi planes.
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Stub implementation to avoid forcing implementation at this stage.
Char_t GetTransparency() const
virtual void Paint(Option_t *option="")
Paint this shape.
Double_t Sqrt(Double_t x)
virtual void Draw(Option_t *option="")
Draw this shape.
virtual void PaintShape(TGeoShape *shape, Option_t *option="")=0
double norm(double *x, double *p)
TVirtualGeoPainter * GetGeomPainter()
Make a default painter if none present. Returns pointer to it.
unsigned int r2[N_CITIES]
Double_t GetVisDensity() const
Bool_t SectionsValid(UInt_t mask) const
static const double x3[11]
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.