ROOT logo
ROOT » GRAF3D » G3D » TXTRU

class TXTRU: public TShape

 


 XTRU is an poly-extrusion with fixed outline shape in x-y,
 a sequence of z extents (segments) and two end faces perpendicular
 to the z axis.  The x-y outline is defined by an ordered list of
 points; the overall scale of the outline scales linearly between
 z points and the center can have an x-y offset specified
 at each segment end.

 A TXTRU has the following parameters:

     - name       name of the shape
     - title      shape's title
     - material  (see TMaterial)
     - nxy        number of x-y vertex points constituting the outline --
                  this number should be at least 3
     - nz         number of planes perpendicular to the z axis where
                  the scaling dimension of the section is given --
                  this number should be at least 2
     - Xvtx       array [nxy] of X coordinates of vertices
     - Yvtx       array [nxy] of Y coordinates of vertices
     - z          array [nz] of z plane positions
     - scale      array [nz] of scale factors
     - x0         array [nz] of x offsets
     - y0         array [nz] of y offsets

 Author:  R. Hatcher 2000.04.21

 All XTRU shapes are correctly rendered in wire mode but can encounter
 difficulty when rendered as a solid with hidden surfaces.  These
 exceptions occur if the outline shape is not a convex polygon.
 Both the X3D and OpenGL renderers expect polygons to be convex.
 The OpenGL spec specifies that points defining a polygon using the
 GL_POLYGON primitive may be rendered as the convex hull of that set.

 Solid rendering under X3D can also give unexpected artifacts if
 the combination of x-y-z offsets and scales for the segments are
 chosen in such a manner that they represent a concave shape when
 sliced along a plane parallel to the z axis.

 Choosing sets of point that represent a malformed polygon is
 not supported, but testing for such a condition is not implemented
 and thus it is left to the user to avoid this mistake.

 

Function Members (Methods)

public:
TXTRU()
TXTRU(const TXTRU& xtru)
TXTRU(const char* name, const char* title, const char* material, Int_t nyx, Int_t nz)
virtual~TXTRU()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
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 voidCopy(TObject& xtru) const
virtual voidDefineSection(Int_t secNum, Float_t z, Float_t scale = 1., Float_t x0 = 0., Float_t y0 = 0.)
virtual voidDefineVertex(Int_t pointNum, Float_t x, Float_t y)
virtual voidTObject::Delete(Option_t* option = "")MENU
Int_tTAttLine::DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
virtual Int_tDistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
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 voidTObject::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 TBuffer3D&GetBuffer3D(Int_t) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Color_tTAttFill::GetFillColor() const
virtual Style_tTAttFill::GetFillStyle() const
virtual const char*TObject::GetIconName() const
virtual Color_tTAttLine::GetLineColor() const
virtual Style_tTAttLine::GetLineStyle() const
virtual Width_tTAttLine::GetLineWidth() const
TMaterial*TShape::GetMaterial() const
virtual const char*TNamed::GetName() const
virtual Int_tTShape::GetNumber() const
virtual Int_tGetNxy() const
virtual 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 Float_tGetOutlinePointX(Int_t pointNum) const
virtual Float_tGetOutlinePointY(Int_t pointNum) const
virtual Float_t*GetScale() const
virtual Float_tGetSectionScale(Int_t secNum) const
virtual Float_tGetSectionX0(Int_t secNum) const
virtual Float_tGetSectionY0(Int_t secNum) const
virtual Float_tGetSectionZ(Int_t secNum) const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Int_tTShape::GetVisibility() const
virtual Float_t*GetX0() const
virtual Float_t*GetXvtx() const
virtual Float_t*GetY0() const
virtual Float_t*GetYvtx() const
virtual Float_t*GetZ() 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
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
virtual Bool_tTAttFill::IsTransparent() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidTAttLine::Modify()
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)
TXTRU&operator=(const TXTRU& rhs)
virtual voidTShape::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidTAttFill::ResetAttFill(Option_t* option = "")
virtual voidTAttLine::ResetAttLine(Option_t* option = "")
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTAttFill::SaveFillAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1001)
virtual voidTAttLine::SaveLineAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1, Int_t widdef = 1)
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTAttFill::SetFillAttributes()MENU
virtual voidTAttFill::SetFillColor(Color_t fcolor)
virtual voidTAttFill::SetFillStyle(Style_t fstyle)
virtual voidTAttLine::SetLineAttributes()MENU
virtual voidTAttLine::SetLineColor(Color_t lcolor)
virtual voidTAttLine::SetLineStyle(Style_t lstyle)
virtual voidTAttLine::SetLineWidth(Width_t lwidth)
virtual voidTShape::SetName(const char* name)
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidTShape::SetVisibility(Int_t vis)MENU
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidSizeof3D() const
voidSplitConcavePolygon(Bool_t split = kTRUE)
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
voidTShape::TransformPoints(Double_t* points, UInt_t NbPnts) const
virtual voidTruncateNxy(Int_t npts)
virtual voidTruncateNz(Int_t npts)
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
protected:
voidCheckOrdering()
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual voidTShape::FillBuffer3D(TBuffer3D& buffer, Int_t reqSections) const
Int_tTShape::GetBasicColor() const
voidTObject::MakeZombie()
virtual voidSetPoints(Double_t* points) const
Int_tTShape::ShapeDistancetoPrimitive(Int_t numPoints, Int_t px, Int_t py)
private:
voidDumpPoints(int npoints, float* pointbuff) const
voidDumpPolygons(int npolygons, int* polybuff, int buffsize) const
voidDumpSegments(int nsegments, int* segbuff) const

Data Members

public:
enum EXYChecked { kUncheckedXY
kMalformedXY
kConvexCCW
kConvexCW
kConcaveCCW
kConcaveCW
};
enum EZChecked { kUncheckedZ
kMalformedZ
kConvexIncZ
kConvexDecZ
kConcaveIncZ
kConcaveDecZ
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
Color_tTAttFill::fFillColorfill area color
Style_tTAttFill::fFillStylefill area style
Color_tTAttLine::fLineColorline color
Style_tTAttLine::fLineStyleline style
Width_tTAttLine::fLineWidthline width
TMaterial*TShape::fMaterialPointer to material
TStringTNamed::fNameobject identifier
Int_tTShape::fNumberShape number
Int_tfNxynumber of x-y points in the cross section
Int_tfNxyAllocnumber of x-y points allocated
Int_tfNznumber of z planes
Int_tfNzAllocnumber of z planes allocated
TXTRU::EXYCheckedfPolygonShapeCCW vs. CW, convex vs. concave
Float_t*fScale[fNzAlloc] array of scale factors (for each z)
Bool_tfSplitConcave
TStringTNamed::fTitleobject title
Int_tTShape::fVisibilityVisibility flag
Float_t*fX0[fNzAlloc] array of x offsets (for each z)
Float_t*fXvtx[fNxyAlloc] array of x positions
Float_t*fY0[fNzAlloc] array of y offsets (for each z)
Float_t*fYvtx[fNxyAlloc] array of y positions
Float_t*fZ[fNzAlloc] array of z planes
TXTRU::EZCheckedfZOrderingincreasing or decreasing

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TXTRU()
 TXTRU shape - default constructor
TXTRU(const char* name, const char* title, const char* material, Int_t nyx, Int_t nz)
 TXTRU shape - normal constructor

 Parameters of Nxy positions must be entered via TXTRU::DefineVertex
 Parameters of Nz  positions must be entered via TXTRU::DefineSection
TXTRU(const TXTRU& xtru)
 TXTRU copy constructor
~TXTRU()
 TXTRU destructor deallocates arrays
TXTRU& operator=(const TXTRU& rhs)
 Deep assignment operator
void Copy(TObject& xtru) const
 TXTRU Copy method
void DefineSection(Int_t secNum, Float_t z, Float_t scale = 1., Float_t x0 = 0., Float_t y0 = 0.)
 Set z section iz information
 expand size of array if necessary
void DefineVertex(Int_t pointNum, Float_t x, Float_t y)
Int_t DistancetoPrimitive(Int_t px, Int_t py)
 Compute the distance from point px,py to a TXTRU
 by calculating the closest approach to each corner
Float_t GetOutlinePointX(Int_t pointNum) const
Float_t GetOutlinePointY(Int_t pointNum) const
Float_t GetSectionX0(Int_t secNum) const
Float_t GetSectionY0(Int_t secNum) const
Float_t GetSectionScale(Int_t secNum) const
Float_t GetSectionZ(Int_t secNum) const
void Print(Option_t* option = "") const
 Dump the info of this TXTRU shape
 Option: "xy" to get x-y information
         "z"  to get z information
         "alloc" to show full allocated arrays (not just used values)
void SetPoints(Double_t* points) const
 Create TXTRU points in buffer
 order as expected by other methods (counterclockwise xy, increasing z)
void Sizeof3D() const
 Return total X3D needed by TNode::ls (when called with option "x")
void SplitConcavePolygon(Bool_t split = kTRUE)
 (Dis)Enable the splitting of concave polygon outlines into
 multiple convex polygons.  This would make for better rendering
 in solid mode, but introduces extra, potentially confusing, lines
 in wireframe mode.
 *** Not yet implemented ***
void TruncateNxy(Int_t npts)
void TruncateNz(Int_t npts)
void CheckOrdering()
 Determine ordering over which to process points, segments, surfaces
 so that they render correctly.  Generally this has to do
 with getting outward normals in the hidden/solid surface case.
void DumpPoints(int npoints, float* pointbuff) const
 Dump the vertex points for visual inspection
void DumpSegments(int nsegments, int* segbuff) const
 Dump the segment info for visual inspection
void DumpPolygons(int npolygons, int* polybuff, int buffsize) const
 Dump the derived polygon info for visual inspection
const TBuffer3D & GetBuffer3D(Int_t ) const
 Get buffer 3d.
Int_t GetNxy() const
{ return fNxy; }
Int_t GetNz() const
{ return fNz; }
Float_t * GetXvtx() const
{return fXvtx; }
Float_t * GetYvtx() const
{return fYvtx; }
Float_t * GetZ() const
{return fZ; }
Float_t * GetScale() const
{return fScale; }
Float_t * GetX0() const
{return fX0; }
Float_t * GetY0() const
{return fY0; }