class TGeoXtru: public TGeoBBox

 TGeoXtru

   An extrusion with fixed outline shape in x-y and a sequence
 of z extents (segments).  The overall scale of the outline scales
 linearly between z points and the center can have an x-y offset.

 Creation of TGeoXtru shape

   A TGeoXtru represents a polygonal extrusion. It is defined by the:
 a. 'Blueprint' of the arbitrary polygon representing any Z section. This
    is an arbytrary polygon (convex or not) defined by the X/Y positions of
    its vertices.
 b. A sequence of Z sections ordered on the Z axis. Each section defines the
   'actual' parameters of the polygon at a given Z. The sections may be
    translated with respect to the blueprint and/or scaled. The TGeoXtru
   segment in between 2 Z sections is a solid represented by the linear
   extrusion between the 2 polygons. Two consecutive sections may be defined
   at same Z position.

 1. TGeoXtru *xtru = TGeoXtru(Int_t nz);
   where nz=number of Z planes
 2. Double_t x[nvertices]; // array of X positions of blueprint polygon vertices
    Double_t y[nvertices]; // array of Y positions of blueprint polygon vertices
 3. xtru->DefinePolygon(nvertices,x,y);
 4. DefineSection(0, z0, x0, y0, scale0); // Z position, offset and scale for first section
    DefineSection(1, z1, x1, y1, scale1); // -''- secons section

    DefineSection(nz-1, zn, xn, yn, scalen); // parameters for last section

 *NOTES*
 Currently navigation functionality not fully implemented (only Contains()).
 Decomposition in concave polygons not implemented - drawing in solid mode
 within x3d produces incorrect end-faces

Function Members (Methods)

public:
TGeoXtru()
TGeoXtru(Int_t nz)
TGeoXtru(Double_t* param)
virtual~TGeoXtru()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
static Bool_tTGeoBBox::AreOverlapping(const TGeoBBox* box1, const TGeoMatrix* mat1, const TGeoBBox* box2, const TGeoMatrix* mat2)
static Double_tTGeoShape::Big()
virtual voidTObject::Browse(TBrowser* b)
virtual Double_tCapacity() const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidComputeBBox()
virtual voidComputeNormal(Double_t* point, Double_t* dir, Double_t* norm)
virtual Bool_tContains(Double_t* point) const
virtual voidTNamed::Copy(TObject& named) const
virtual Bool_tTGeoBBox::CouldBeCrossed(Double_t* point, Double_t* dir) const
Bool_tDefinePolygon(Int_t nvert, const Double_t* xv, const Double_t* yv)
virtual voidDefineSection(Int_t snum, Double_t z, Double_t x0 = 0., Double_t y0 = 0., Double_t scale = 1.)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tDistancetoPrimitive(Int_t px, Int_t py)
virtual Double_tDistFromInside(Double_t* point, Double_t* dir, Int_t iact = 1, Double_t step = TGeoShape::Big(), Double_t* safe = 0) const
virtual Double_tDistFromOutside(Double_t* point, Double_t* dir, Int_t iact = 1, Double_t step = TGeoShape::Big(), Double_t* safe = 0) const
static Double_tTGeoShape::DistToPhiMin(Double_t* point, 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)
virtual TGeoVolume*TGeoBBox::Divide(TGeoVolume* voldiv, const char* divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
virtual voidTGeoShape::Draw(Option_t* option = "")MENU
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTGeoShape::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual const char*TGeoBBox::GetAxisName(Int_t iaxis) const
virtual Double_tTGeoBBox::GetAxisRange(Int_t iaxis, Double_t& xlo, Double_t& xhi) const
virtual voidTGeoBBox::GetBoundingCylinder(Double_t* param) const
virtual const TBuffer3D&GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
virtual Int_tTGeoBBox::GetByteCount() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Double_tTGeoBBox::GetDX() const
virtual Double_tTGeoBBox::GetDY() const
virtual Double_tTGeoBBox::GetDZ() const
virtual Double_tTGeoBBox::GetFacetArea(Int_t index = 0) const
virtual Int_tTGeoBBox::GetFittingBox(const TGeoBBox* parambox, TGeoMatrix* mat, Double_t& dx, Double_t& dy, Double_t& dz) const
virtual const char*TObject::GetIconName() const
Int_tTGeoShape::GetId() const
virtual TGeoShape*GetMakeRuntimeShape(TGeoShape*, TGeoMatrix*) const
virtual voidGetMeshNumbers(Int_t& nvert, Int_t& nsegs, Int_t& npols) const
virtual const char*TGeoShape::GetName() const
virtual Int_tGetNmeshVertices() const
Int_tGetNvert() const
Int_tGetNz() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual const Double_t*TGeoBBox::GetOrigin() const
char*TGeoShape::GetPointerName() const
virtual Bool_tTGeoBBox::GetPointsOnFacet(Int_t index, Int_t npoints, Double_t* array) const
virtual Bool_tTGeoBBox::GetPointsOnSegments(Int_t npoints, Double_t* array) const
Double_tGetScale(Int_t i) const
virtual const char*TNamed::GetTitle() const
static TGeoMatrix*TGeoShape::GetTransform()
virtual UInt_tTObject::GetUniqueID() const
Double_tGetX(Int_t i) const
Double_tGetXOffset(Int_t i) const
Double_tGetY(Int_t i) const
Double_tGetYOffset(Int_t i) const
Double_t*GetZ() const
Double_tGetZ(Int_t ipl) const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
virtual voidInspectShape() const
voidTObject::InvertBit(UInt_t f)
voidTGeoShape::InvertShapeBit(UInt_t f)
virtual TClass*IsA() const
static Bool_tTGeoShape::IsCloseToPhi(Double_t epsil, Double_t* point, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
virtual Bool_tTGeoShape::IsComposite() const
static Bool_tTGeoShape::IsCrossingSemiplane(Double_t* point, Double_t* dir, Double_t cphi, Double_t sphi, Double_t& snext, Double_t& rxy)
virtual Bool_tTGeoBBox::IsCylType() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
static Bool_tTGeoShape::IsInPhiRange(Double_t* point, Double_t phi1, Double_t phi2)
virtual Bool_tTGeoBBox::IsNullBox() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTGeoShape::IsReflected() const
Bool_tTGeoShape::IsRunTimeShape() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTGeoShape::IsValid() const
virtual Bool_tTGeoBBox::IsValidBox() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
virtual TBuffer3D*MakeBuffer3D() const
voidTObject::MayNotUse(const char* method) const
static voidTGeoShape::NormalPhi(Double_t* point, Double_t* dir, Double_t* norm, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTGeoShape::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
voidTGeoShape::ResetShapeBit(UInt_t f)
virtual Double_tSafety(Double_t* point, Bool_t in = kTRUE) const
static Double_tTGeoShape::SafetyPhi(Double_t* point, Bool_t in, Double_t phi1, Double_t phi2)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidSavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidTGeoBBox::SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t* origin = 0)
voidTGeoBBox::SetBoxPoints(Double_t* points) const
voidSetCurrentVertices(Double_t x0, Double_t y0, Double_t scale)
voidSetCurrentZ(Double_t z, Int_t iz)
virtual voidSetDimensions(Double_t* param)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidTGeoShape::SetId(Int_t id)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidSetPoints(Double_t* points) const
virtual voidSetPoints(Float_t* points) const
voidTGeoShape::SetRuntime(Bool_t flag = kTRUE)
virtual voidSetSegsAndPols(TBuffer3D& buff) const
voidTGeoShape::SetShapeBit(UInt_t f)
voidTGeoShape::SetShapeBit(UInt_t f, Bool_t set)
virtual voidTNamed::SetTitle(const char* title = "")MENU
static voidTGeoShape::SetTransform(TGeoMatrix* matrix)
virtual voidTObject::SetUniqueID(UInt_t uid)
Int_tTGeoShape::ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidSizeof3D() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
Bool_tTGeoShape::TestShapeBit(UInt_t f) const
Int_tTGeoShape::TestShapeBits(UInt_t f) const
static Double_tTGeoShape::Tolerance()
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
Double_t&Z(Int_t ipl)
protected:
TGeoXtru(const TGeoXtru&)
Double_tDistToPlane(Double_t* point, Double_t* dir, Int_t iz, Int_t ivert, Double_t stepmax, Bool_t in) const
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual voidTGeoBBox::FillBuffer3D(TBuffer3D& buffer, Int_t reqSections, Bool_t localFrame) const
Int_tTGeoShape::GetBasicColor() const
voidGetPlaneNormal(const Double_t* vert, Double_t* norm) const
voidGetPlaneVertices(Int_t iz, Int_t ivert, Double_t* vert) const
Bool_tIsPointInsidePlane(Double_t* point, Double_t* vert, Double_t* norm) const
voidTObject::MakeZombie()
TGeoXtru&operator=(const TGeoXtru&)
Double_tSafetyToSector(Double_t* point, Int_t iz, Double_t safmin)
voidSetIz(Int_t iz)
voidTGeoShape::SetOnBoundary(Bool_t)
voidSetSeg(Int_t iseg)
voidTGeoShape::TransformPoints(Double_t* points, UInt_t NbPoints) const

Data Members

public:
enum TGeoShape::EShapeType { kBitMask32
kGeoNoShape
kGeoBad
kGeoRSeg
kGeoPhiSeg
kGeoThetaSeg
kGeoVisX
kGeoVisY
kGeoVisZ
kGeoRunTimeShape
kGeoInvalidShape
kGeoTorus
kGeoBox
kGeoPara
kGeoSph
kGeoTube
kGeoTubeSeg
kGeoCone
kGeoConeSeg
kGeoPcon
kGeoPgon
kGeoArb8
kGeoEltu
kGeoTrap
kGeoCtub
kGeoTrd1
kGeoTrd2
kGeoComb
kGeoClosedShape
kGeoXtru
kGeoParaboloid
kGeoHalfSpace
kGeoHype
kGeoSavePrimitive
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
Double_tTGeoBBox::fDXX half-length
Double_tTGeoBBox::fDYY half-length
Double_tTGeoBBox::fDZZ half-length
Int_tfIz!current z plane [0,fNz-1]
TStringTNamed::fNameobject identifier
Int_tfNvertnumber of vertices of the 2D polygon (at least 3)
Int_tfNznumber of z planes (at least two)
Double_tTGeoBBox::fOrigin[3]box origin
TGeoPolygon*fPolypolygon defining section shape
Double_t*fScale[fNz] array of scale factors (for each Z)
Int_tfSeg!current segment [0,fNvert-1]
UInt_tTGeoShape::fShapeBitsshape bits
Int_tTGeoShape::fShapeIdshape id
TStringTNamed::fTitleobject title
Double_t*fX[fNvert] X positions for polygon vertices
Double_t*fX0[fNz] array of X offsets (for each Z)
Double_t*fXc[fNvert] current X positions for polygon vertices
Double_t*fY[fNvert] Y positions for polygon vertices
Double_t*fY0[fNz] array of Y offsets (for each Z)
Double_t*fYc[fNvert] current Y positions for polygon vertices
Double_t*fZ[fNz] array of Z planes positions
Double_tfZcurrentcurrent Z position

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TGeoXtru()
 dummy ctor
TGeoXtru(Int_t nz)
 Default constructor
TGeoXtru(Double_t *param)
 Default constructor in GEANT3 style
 param[0] = nz  // number of z planes

 param[1] = z1  // Z position of first plane
 param[2] = x1  // X position of first plane
 param[3] = y1  // Y position of first plane
 param[4] = scale1  // scale factor for first plane

 param[4*(nz-1]+1] = zn
 param[4*(nz-1)+2] = xn
 param[4*(nz-1)+3] = yn
 param[4*(nz-1)+4] = scalen
TGeoXtru(const TGeoXtru& xt)
copy constructor
TGeoXtru& operator=(const TGeoXtru& )
assignment operator
~TGeoXtru()
 destructor
Double_t Capacity() const
 Compute capacity [length^3] of this shape.
void ComputeBBox()
 compute bounding box of the pcon
void ComputeNormal(Double_t* point, Double_t* dir, Double_t* norm)
 Compute normal to closest surface from POINT.
Bool_t Contains(Double_t* point) const
 test if point is inside this shape
 Check Z range
Int_t DistancetoPrimitive(Int_t px, Int_t py)
 compute closest distance from point px,py to each corner
Double_t DistToPlane(Double_t* point, Double_t* dir, Int_t iz, Int_t ivert, Double_t stepmax, Bool_t in) const
 Compute distance to a Xtru lateral surface.
Double_t DistFromInside(Double_t* point, Double_t* dir, Int_t iact = 1, Double_t step = TGeoShape::Big(), Double_t* safe = 0) const
 compute distance from inside point to surface of the polycone
 locate Z segment
Double_t DistFromOutside(Double_t* point, Double_t* dir, Int_t iact = 1, Double_t step = TGeoShape::Big(), Double_t* safe = 0) const
 compute distance from outside point to surface of the tube
   Warning("DistFromOutside", "not implemented");
Bool_t DefinePolygon(Int_t nvert, const Double_t* xv, const Double_t* yv)
 Creates the polygon representing the blueprint of any Xtru section.
   nvert     = number of vertices >2
   xv[nvert] = array of X vertex positions
   yv[nvert] = array of Y vertex positions
 *NOTE* should be called before DefineSection or ctor with 'param'
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 GetZ(Int_t ipl) const
 Return the Z coordinate for segment ipl.
void GetPlaneNormal(const Double_t* vert, Double_t* norm) const
 Returns normal vector to the planar quadrilateral defined by vector VERT.
 The normal points outwards the xtru.
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 (ivert, ivert+1). No range check.
Bool_t IsPointInsidePlane(Double_t* point, Double_t* vert, Double_t* norm) const
 Check if the quadrilateral defined by VERT contains a coplanar POINT.
void InspectShape() const
 Print actual Xtru parameters.
TBuffer3D * MakeBuffer3D() const
 Creates a TBuffer3D describing *this* shape.
 Coordinates are in local reference frame.
void SetSegsAndPols(TBuffer3D& buff) const
 Fill TBuffer3D structure for segments and polygons.
Double_t SafetyToSector(Double_t* point, Int_t iz, Double_t safmin)
 Compute safety to sector iz, returning also the closest segment index.
Double_t Safety(Double_t* point, Bool_t in = kTRUE) const
 computes the closest distance from given point to this shape, according
 to option. The matching point on the shape is stored in spoint.
---> localize the Z segment
void SavePrimitive(ostream& out, Option_t* option = "")
 Save a primitive as a C++ statement(s) on output stream "out".
void SetCurrentZ(Double_t z, Int_t iz)
 Recompute current section vertices for a given Z position within range of section iz.
void SetCurrentVertices(Double_t x0, Double_t y0, Double_t scale)
 Set current vertex coordinates according X0, Y0 and SCALE.
void SetDimensions(Double_t* param)
 param[0] = nz  // number of z planes

 param[1] = z1  // Z position of first plane
 param[2] = x1  // X position of first plane
 param[3] = y1  // Y position of first plane
 param[4] = scale1  // scale factor for first plane

 param[4*(nz-1]+1] = zn
 param[4*(nz-1)+2] = xn
 param[4*(nz-1)+3] = yn
 param[4*(nz-1)+4] = scalen
void SetPoints(Double_t *points)
 create polycone mesh points
void SetPoints(Float_t *points)
 create polycone mesh points
void GetMeshNumbers(Int_t& nvert, Int_t& nsegs, Int_t& npols) const
 Returns numbers of vertices, segments and polygons composing the shape mesh.
Int_t GetNmeshVertices() const
 Return number of vertices of the mesh representation
void Sizeof3D() const
 fill size of this 3-D object
   TVirtualGeoPainter *painter = gGeoManager->GetGeomPainter();
   if (!painter) return;

   Int_t numPoints = fNz*fNvert;
   Int_t numSegs   = fNvert*(2*fNz-1);
   Int_t numPolys  = fNvert*(fNz-1)+2;
   painter->AddSize3D(numPoints, numSegs, numPolys);
void Streamer(TBuffer& b)
 Stream an object of class TGeoVolume.
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
 Fills a static 3D buffer and returns a reference.
void SetIz(Int_t iz)
{fIz = iz;}
void SetSeg(Int_t iseg)
{fSeg = iseg;}
Int_t GetNz() const
   virtual Int_t         GetByteCount() const {return 60+12*fNz;}
{return fNz;}
Int_t GetNvert() const
{return fNvert;}
Double_t GetX(Int_t i) const
{return (i<fNvert&&i>-1 &&fX!=0) ? fX[i] : -1.0E10;}
Double_t GetY(Int_t i) const
{return (i<fNvert&&i>-1 &&fY!=0) ? fY[i] : -1.0E10;}
Double_t GetXOffset(Int_t i) const
{return (i<fNz&&i>-1 && fX0!=0) ? fX0[i] : 0.0;}
Double_t GetYOffset(Int_t i) const
{return (i<fNz&&i>-1 && fY0!=0) ? fY0[i] : 0.0;}
Double_t GetScale(Int_t i) const
{return (i<fNz&&i>-1 && fScale!=0) ? fScale[i] : 1.0;}
Double_t * GetZ() const
{return fZ;}
TGeoShape * GetMakeRuntimeShape(TGeoShape* , TGeoMatrix* ) const
{return 0;}
Double_t & Z(Int_t ipl)
{return fZ[ipl];}

Author: Mihaela Gheata 24/01/04
Last change: root/geom:$Id: TGeoXtru.h 21425 2007-12-17 15:59:27Z brun $
Last generated: 2008-12-05 09:53
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.