#ifndef ROOT_TXTRU
#define ROOT_TXTRU
#ifndef ROOT_TShape
#include "TShape.h"
#endif
class TXTRU : public TShape {
public:
TXTRU();
TXTRU(const char *name, const char *title, const char *material,
Int_t nyx, Int_t nz);
TXTRU(const TXTRU &xtru);
virtual ~TXTRU();
TXTRU& operator=(const TXTRU& rhs);
virtual void Copy(TObject &xtru) const;
virtual void DefineSection(Int_t secNum, Float_t z, Float_t scale=1.,
Float_t x0=0., Float_t y0=0.);
virtual void DefineVertex(Int_t pointNum, Float_t x, Float_t y);
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
virtual const TBuffer3D &GetBuffer3D(Int_t) const;
virtual Int_t GetNxy() const { return fNxy; }
virtual Int_t GetNz() const { return fNz; }
virtual Float_t GetOutlinePointX(Int_t pointNum) const;
virtual Float_t GetOutlinePointY(Int_t pointNum) const;
virtual Float_t GetSectionX0(Int_t secNum) const;
virtual Float_t GetSectionY0(Int_t secNum) const;
virtual Float_t GetSectionScale(Int_t secNum) const;
virtual Float_t GetSectionZ(Int_t secNum) const;
virtual Float_t *GetXvtx() const {return fXvtx; }
virtual Float_t *GetYvtx() const {return fYvtx; }
virtual Float_t *GetZ() const {return fZ; }
virtual Float_t *GetScale() const {return fScale; }
virtual Float_t *GetX0() const {return fX0; }
virtual Float_t *GetY0() const {return fY0; }
virtual void Print(Option_t *option="") const;
virtual void Sizeof3D() const;
void SplitConcavePolygon(Bool_t split = kTRUE);
virtual void TruncateNxy(Int_t npts);
virtual void TruncateNz(Int_t npts);
protected:
void CheckOrdering();
virtual void SetPoints(Double_t *points) const;
Int_t fNxy;
Int_t fNxyAlloc;
Int_t fNz;
Int_t fNzAlloc;
Float_t *fXvtx;
Float_t *fYvtx;
Float_t *fZ;
Float_t *fScale;
Float_t *fX0;
Float_t *fY0;
enum EXYChecked {kUncheckedXY, kMalformedXY,
kConvexCCW, kConvexCW,
kConcaveCCW, kConcaveCW};
enum EZChecked {kUncheckedZ, kMalformedZ,
kConvexIncZ, kConvexDecZ,
kConcaveIncZ, kConcaveDecZ};
EXYChecked fPolygonShape;
EZChecked fZOrdering;
Bool_t fSplitConcave;
private:
void DumpPoints(int npoints, float *pointbuff) const;
void DumpSegments(int nsegments, int *segbuff) const;
void DumpPolygons(int npolygons, int *polybuff, int buffsize) const;
ClassDef(TXTRU,1)
};
#endif