#ifndef GTS_GTSurf_H
#define GTS_GTSurf_H
#include <Glasses/ZNode.h>
#include <Stones/ZColor.h>
#include <Stones/SRange.h>
#include <Glasses/LegendreCoefs.h>
class TTree;
namespace GTS
{
struct _GtsSurface;
typedef struct _GtsSurface GtsSurface;
}
class GTSurf : public ZNode
{
MAC_RNR_FRIENDS(GTSurf);
public:
enum PostBoolOp_e { PBM_Noop, PBM_AsValues, PBM_AsFractions };
private:
void _init();
protected:
GTS::GtsSurface* pSurf;
TString mFile;
ZColor mColor;
ZColor mPointColor;
bool bRnrPoints;
UInt_t mVerts;
UInt_t mEdges;
UInt_t mFaces;
SRange mFaceQuality;
SRange mFaceArea;
SRange mEdgeLength;
SRange mEdgeAngle;
PostBoolOp_e mPostBoolOp;
Double_t mPostBoolArea;
Double_t mPostBoolPerimeter;
Double_t mPostBoolLength;
void legendrofy_multi_common(LegendreCoefs* lc, LegendreCoefs::MultiEval& me, const Exc_t eh);
public:
GTSurf(const Text_t* n="GTSurf", const Text_t* t=0) : ZNode(n,t) { _init(); }
void ReplaceSurface(GTS::GtsSurface* new_surf);
GTS::GtsSurface* CopySurface();
GTS::GtsSurface* DisownSurface();
Double_t GetArea() const;
Double_t GetXYArea() const;
Double_t GetVolume() const;
void Load(const TString& file="");
void Save(const TString& file="");
void CalcStats();
void PrintStats();
void Destroy();
void Invert();
void Rescale(Double_t s=2);
void RescaleXYZ(Double_t sx=2, Double_t sy=2, Double_t sz=2);
void TransformAndResetTrans();
void RotateAndResetRot();
void Tessellate(UInt_t order=1, Bool_t mid_edge=true);
void Merge (GTSurf* a, GTSurf* b);
void Union (GTSurf* a, GTSurf* b);
void Intersection(GTSurf* a, GTSurf* b);
void Difference (GTSurf* a, GTSurf* b);
void GenerateSphere(UInt_t order=1);
void GenerateTriangle(Double_t s=1);
void GenerateSphereThetaConst(UInt_t order=1);
void LegendrofyAdd (LegendreCoefs* lc, Double_t scale=1, Int_t l_max=-1);
void LegendrofyScale(LegendreCoefs* lc, Double_t scale=1, Int_t l_max=-1);
void LegendrofyScaleRandom(Int_t l_max, Double_t abs_scale=0.1, Double_t pow_scale=1.5);
void LegendrofyAddMulti (LegendreCoefs* lc, Double_t scale=1, Int_t l_max=-1);
void LegendrofyScaleMulti(LegendreCoefs* lc, Double_t scale=1, Int_t l_max=-1);
void LegendrofyScaleRandomMulti(Int_t l_max, Double_t abs_scale=0.1, Double_t pow_scale=1.5);
void ExportTring(const Text_t* fname=0);
void MakeZSplitSurfaces(Double_t z_split=0, const TString& stem="split",
Bool_t save_p=false);
TTree* MakeHPointDTree(const TString& name="T", const TString& title="");
TTree* MakeMultiEvalTree(const TString& name="T", const TString& title="");
#include "GTSurf.h7"
ClassDef(GTSurf, 1);
};
#endif