127      ((
TGeoXtru *)
this)->CreateThreadData(1);
 
 
  136   std::lock_guard<std::mutex> guard(
fMutex);
 
  137   std::vector<ThreadData_t *>::iterator i = 
fThreadData.begin();
 
 
  151   std::lock_guard<std::mutex> guard(
fMutex);
 
  163         td.fPoly->SetXY(
td.fXc, 
td.fYc); 
 
  164         td.fPoly->FinishPolygon();
 
  165         if (
tid == 0 && 
td.fPoly->IsIllegalCheck()) {
 
  166            Error(
"DefinePolygon", 
"Shape %s of type XTRU has an illegal polygon.", 
GetName());
 
 
  226      Error(
"ctor", 
"Cannot create TGeoXtru %s with less than 2 Z planes", 
GetName());
 
 
  306   xtru->SetCurrentVertices(0., 0., 1.);
 
  308   for (iz = 0; iz < 
fNz - 1; iz++) {
 
 
  326      Error(
"ComputeBBox", 
"In shape %s polygon not defined", 
GetName());
 
  351   fOrigin[2] = 0.5 * (zmin + zmax);
 
  354   fDZ = 0.5 * (zmax - zmin);
 
 
  365      norm[2] = (dir[2] > 0) ? 1 : -1;
 
 
  387   if (point[2] < 
fZ[0])
 
  389   if (point[2] > 
fZ[
fNz - 1])
 
  392   if (iz < 0 || iz == 
fNz - 1)
 
  397      if (
td.fPoly->Contains(point))
 
  401         return td.fPoly->Contains(point);
 
  404         return td.fPoly->Contains(point);
 
  407   xtru->SetCurrentZ(point[2], iz);
 
  412   return td.fPoly->Contains(point);
 
 
  449      snext = (
fZ[iz] - point[2]) / dir[2];
 
  452      pt[0] = point[0] + 
snext * dir[0];
 
  453      pt[1] = point[1] + 
snext * dir[1];
 
  454      pt[2] = point[2] + 
snext * dir[2];
 
  459      if (!
td.fPoly->Contains(
pt))
 
  483   if (
fZ[iz] < 
fZ[iz + 1]) {
 
  490   pt[0] = point[0] + 
snext * dir[0];
 
  491   pt[1] = point[1] + 
snext * dir[1];
 
  492   pt[2] = point[2] + 
snext * dir[2];
 
 
  566   while (iz >= 0 && iz < 
fNz - 1) {
 
  570      sz = (
fZ[
ipl] - point[2]) / dir[2];
 
  574         pt[0] = point[0] + 
sz * dir[0];
 
  575         pt[1] = point[1] + 
sz * dir[1];
 
  577         if (
td.fPoly->Contains(
pt)) {
 
  590               if (!
td.fPoly->Contains(
pt)) {
 
 
  656      snext = (
fZ[0] - point[2]) / dir[2];
 
  659      for (i = 0; i < 3; i++)
 
  660         pt[i] = point[i] + 
snext * dir[i];
 
  662      if (
td.fPoly->Contains(
pt)) {
 
  676         for (i = 0; i < 3; i++)
 
  677            pt[i] = point[i] + 
snext * dir[i];
 
  679         if (
td.fPoly->Contains(
pt)) {
 
  696      for (i = 0; i < 3; i++)
 
  697         pt[i] += dist * dir[i]; 
 
  701      else if (iz == 
fNz - 1)
 
  719               return (
snext + dist);
 
  730   while (iz >= 0 && iz < 
fNz - 1) {
 
  741               return (
snext + dist);
 
 
  764      Error(
"DefinePolygon", 
"In shape %s cannot create polygon with less than 3 vertices", 
GetName());
 
  771            Error(
"DefinePolygon", 
"In shape %s 2 vertices cannot be identical", 
GetName());
 
 
  806                 "In shape: %s, Z position of section " 
  807                 "%i, z=%e, not in increasing order, %i, z=%e",
 
 
  853   for (
Int_t i = 0; i < 3; i++)
 
 
  869   if (
td.fPoly->IsClockwise()) {
 
 
  921   for (
Int_t i = 0; i < 4; i++) { 
 
  923      k = 3 * ((i + 1) % 4);
 
  925      v1[1] = point[1] - 
vert[
j + 1];
 
  926      v1[2] = point[2] - 
vert[
j + 2];
 
 
  945   printf(
"    List of (x,y) of polygon vertices:\n");
 
  951   printf(
" Bounding box:\n");
 
 
  988   for (i = 0; i < 
nz; i++) {
 
  999   for (i = 0; i < 
nz - 1; i++) {
 
 1014   for (i = 0; i < 
nz - 1; i++) {
 
 
 1058      in1 = 
td.fPoly->Contains(point);
 
 1062      in2 = 
td.fPoly->Contains(point);
 
 1074   safz = 
fZ[iz] - point[2];
 
 1078      saf1 = point[2] - 
fZ[iz + 1];
 
 
 1129      for (iz = 0; iz < 
fNz - 1; iz++) {
 
 1144      if (iz == 
fNz - 1) {
 
 1151   for (i = iz; i < 
fNz - 1; i++) {
 
 1157   for (i = iz - 1; i >= 0; i--) {
 
 
 1173   out << 
"   // Shape: " << 
GetName() << 
" type: " << 
ClassName() << std::endl;
 
 1174   out << 
"   auto " << 
GetPointerName() << 
" = new TGeoXtru(" << 
fNz << 
");" << std::endl;
 
 1177      out << 
"   xvert[" << i << 
"] = " << 
fX[i] << 
";   yvert[" << i << 
"] = " << 
fY[i] << 
";" << std::endl;
 
 1179   out << 
"   " << 
GetPointerName() << 
"->DefinePolygon(" << 
fNvert << 
", xvert, yvert);" << std::endl;
 
 1181      out << 
"   " << 
GetPointerName() << 
"->DefineSection(" << i << 
", " << 
fZ[i] << 
", " << 
fX0[i] << 
", " << 
fY0[i]
 
 1182          << 
", " << 
fScale[i] << 
");" << std::endl;
 
 
 1237      Error(
"SetDimensions", 
"Cannot create TGeoXtru %s with less than 2 Z planes", 
GetName());
 
 1255      DefineSection(i, param[1 + 4 * i], param[2 + 4 * i], param[3 + 4 * i], param[4 + 4 * i]);
 
 
 1268      for (i = 0; i < 
fNz; i++) {
 
 1270         if (
td.fPoly->IsClockwise()) {
 
 
 1297      for (i = 0; i < 
fNz; i++) {
 
 1299         if (
td.fPoly->IsClockwise()) {
 
 
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
 
Generic 3D primitive description class.
 
Bool_t SectionsValid(UInt_t mask) const
 
void SetSectionsValid(UInt_t mask)
 
Bool_t SetRawSizes(UInt_t reqPnts, UInt_t reqPntsCapacity, UInt_t reqSegs, UInt_t reqSegsCapacity, UInt_t reqPols, UInt_t reqPolsCapacity)
Set kRaw tessellation section of buffer with supplied sizes.
 
void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const override
Fills the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections...
 
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
Compute distance from outside point to surface of the box.
 
void InspectShape() const override
Prints shape parameters.
 
Bool_t Contains(const Double_t *point) const override
Test if point is inside this shape.
 
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
Computes the closest distance from given point to this shape.
 
static Int_t ThreadId()
Translates the current thread id to an ordinal number.
 
An arbitrary polygon defined by vertices.
 
Int_t GetBasicColor() const
Get the basic color (0-7).
 
void TransformPoints(Double_t *points, UInt_t NbPoints) const
Tranform a set of points (LocalToMaster)
 
void SetShapeBit(UInt_t f, Bool_t set)
Equivalent of TObject::SetBit.
 
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
 
const char * GetPointerName() const
Provide a pointer name containing uid.
 
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
 
const char * GetName() const override
Get the shape name.
 
static Double_t Tolerance()
 
Bool_t TestShapeBit(UInt_t f) const
 
A TGeoXtru shape is represented by the extrusion of an arbitrary polygon with fixed outline between s...
 
Int_t GetNmeshVertices() const override
Return number of vertices of the mesh representation.
 
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
 
ThreadData_t & GetThreadData() const
 
void ClearThreadData() const override
 
Double_t Capacity() const override
Compute capacity [length^3] of this shape.
 
void ComputeBBox() override
compute bounding box of the pcon
 
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Check the inside status for each of the points in the array.
 
Bool_t Contains(const Double_t *point) const override
test if point is inside this shape
 
Int_t fThreadSize
Navigation data per thread.
 
void SetCurrentVertices(Double_t x0, Double_t y0, Double_t scale)
Set current vertex coordinates according X0, Y0 and SCALE.
 
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
 
void GetPlaneVertices(Int_t iz, Int_t ivert, Double_t *vert) const
Returns (x,y,z) of 3 vertices of the surface defined by Z sections (iz, iz+1) and polygon vertices (i...
 
void InspectShape() const override
Print actual Xtru parameters.
 
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute closest distance from point px,py to each corner
 
Bool_t IsPointInsidePlane(const Double_t *point, Double_t *vert, Double_t *norm) const
Check if the quadrilateral defined by VERT contains a coplanar POINT.
 
void Sizeof3D() const override
fill size of this 3-D object
 
~TGeoXtru() override
destructor
 
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Fills a static 3D buffer and returns a reference.
 
Bool_t DefinePolygon(Int_t nvert, const Double_t *xv, const Double_t *yv)
Creates the polygon representing the blueprint of any Xtru section.
 
void SetCurrentZ(Double_t z, Int_t iz)
Recompute current section vertices for a given Z position within range of section iz.
 
virtual void DefineSection(Int_t snum, Double_t z, Double_t x0=0., Double_t y0=0., Double_t scale=1.)
defines z position of a section plane, rmin and rmax at this z.
 
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
computes the closest distance from given point to this shape, according to option.
 
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
 
void SetDimensions(Double_t *param) override
 
void DrawPolygon(Option_t *option="")
Draw the section polygon.
 
void SetPoints(Double_t *points) const override
create polycone mesh points
 
Double_t SafetyToSector(const Double_t *point, Int_t iz, Double_t safmin, Bool_t in)
Compute safety to sector iz, returning also the closest segment index.
 
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
compute distance from inside point to surface of the polycone locate Z segment
 
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
 
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Compute normal to closest surface from POINT.
 
TBuffer3D * MakeBuffer3D() const override
Creates a TBuffer3D describing this shape.
 
std::vector< ThreadData_t * > fThreadData
 
Double_t DistToPlane(const Double_t *point, const Double_t *dir, Int_t iz, Int_t ivert, Double_t stepmax, Bool_t in) const
Compute distance to a Xtru lateral surface.
 
void SetSegsAndPols(TBuffer3D &buff) const override
Fill TBuffer3D structure for segments and polygons.
 
void SetSeg(Int_t iseg)
Set current segment.
 
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
compute distance from outside point to surface of the tube Warning("DistFromOutside",...
 
std::mutex fMutex
size of thread-specific array
 
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
 
void GetPlaneNormal(const Double_t *vert, Double_t *norm) const
Returns normal vector to the planar quadrilateral defined by vector VERT.
 
void SetIz(Int_t iz)
Set current z-plane.
 
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
Compute safe distance from each of the points in the input array.
 
void CreateThreadData(Int_t nthreads) override
Create thread data for n threads max.
 
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
 
virtual const char * ClassName() const
Returns name of class to which the object belongs.
 
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
 
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
 
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
 
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
 
Double_t Sqrt(Double_t x)
Returns the square root of x.
 
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
 
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
 
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
 
~ThreadData_t()
Destructor.
 
ThreadData_t()
Constructor.