ROOT logo
// $Id: GTSurf.h 2530 2011-09-27 19:32:01Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#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;

//#ifndef __CINT__
//#include <GTS/GTS.h>
//#endif

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;        //! X{g}

  TString		mFile;        // X{GS}   7 Filor()

  ZColor		mColor;	      // X{PGST} 7 ColorButt(-join=>1)
  ZColor		mPointColor;  // X{PGST} 7 ColorButt(-join=>1)
  bool			bRnrPoints;   // X{GST}  7 Bool()

  UInt_t		mVerts;       //! X{G}   7 ValOut(-width=>10, -join=>1)
  UInt_t		mEdges;       //! X{G}   7 ValOut(-width=>10, -join=>1)
  UInt_t		mFaces;       //! X{G}   7 ValOut(-width=>10)

  SRange		mFaceQuality; //! X{RGS} 7 StoneOutput(-width=>32, Fmt=>"%4.2le | %4.2le : %4.2le | %4.2le", Args=>[Min, Average, Sigma, Max])
  SRange		mFaceArea;    //! X{RGS} 7 StoneOutput(-width=>32, Fmt=>"%4.2le | %4.2le : %4.2le | %4.2le", Args=>[Min, Average, Sigma, Max])
  SRange		mEdgeLength;  //! X{RGS} 7 StoneOutput(-width=>32, Fmt=>"%4.2le | %4.2le : %4.2le | %4.2le", Args=>[Min, Average, Sigma, Max])
  SRange		mEdgeAngle;   //! X{RGS} 7 StoneOutput(-width=>32, Fmt=>"%4.2le | %4.2le : %4.2le | %4.2le", Args=>[Min, Average, Sigma, Max])

  PostBoolOp_e          mPostBoolOp;         // X{GS} 7 PhonyEnum(-join=>1)
  Double_t              mPostBoolArea;       // X{GS} 7 Value()
  Double_t              mPostBoolPerimeter;  // X{GS} 7 Value(-join=>1)
  Double_t              mPostBoolLength;     // X{GS} 7 Value()

  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=""); //  X{E} 7 MCWButt(-join=>1)
  void Save(const TString& file=""); //  X{E} 7 MCWButt()

  void CalcStats();           //! X{E} 7 MButt(-join=>1)
  void PrintStats();          //! X{E} 7 MButt()

  void Destroy();             //  X{E} 7 MButt(-join=>1)
  void Invert();              //  X{E} 7 MButt()

  void Rescale(Double_t s=2); // X{E} 7 MCWButt(-join=>1)
  void RescaleXYZ(Double_t sx=2, Double_t sy=2, Double_t sz=2); // X{E} 7 MCWButt()

  void TransformAndResetTrans(); // X{E} 7 MButt(-join=>1)
  void RotateAndResetRot();      // X{E} 7 MButt()

  void Tessellate(UInt_t order=1, Bool_t mid_edge=true); // X{E} 7 MCWButt()

  void Merge       (GTSurf* a, GTSurf* b); // X{E} C{2} 7 MCWButt(-join=>1)
  void Union       (GTSurf* a, GTSurf* b); // X{E} C{2} 7 MCWButt()
  void Intersection(GTSurf* a, GTSurf* b); // X{E} C{2} 7 MCWButt(-join=>1)
  void Difference  (GTSurf* a, GTSurf* b); // X{E} C{2} 7 MCWButt()

  void GenerateSphere(UInt_t order=1); // X{E} 7 MCWButt(-join=>1)
  void GenerateTriangle(Double_t s=1); // X{E} 7 MCWButt()
  void GenerateSphereThetaConst(UInt_t order=1); // X{E} 7 MCWButt()

  void LegendrofyAdd  (LegendreCoefs* lc, Double_t scale=1, Int_t l_max=-1); // X{E} C{1} 7 MCWButt()
  void LegendrofyScale(LegendreCoefs* lc, Double_t scale=1, Int_t l_max=-1); // X{E} C{1} 7 MCWButt()
  void LegendrofyScaleRandom(Int_t l_max, Double_t abs_scale=0.1, Double_t pow_scale=1.5); // X{E} 7 MCWButt()

  void LegendrofyAddMulti  (LegendreCoefs* lc, Double_t scale=1, Int_t l_max=-1); // X{E} C{1} 7 MCWButt()
  void LegendrofyScaleMulti(LegendreCoefs* lc, Double_t scale=1, Int_t l_max=-1); // X{E} C{1} 7 MCWButt()
  void LegendrofyScaleRandomMulti(Int_t l_max, Double_t abs_scale=0.1, Double_t pow_scale=1.5); // X{E} 7 MCWButt()

  void ExportTring(const Text_t* fname=0);

  void MakeZSplitSurfaces(Double_t z_split=0, const TString& stem="split",
			  Bool_t save_p=false); //! X{ED} 7 MCWButt()

  TTree* MakeHPointDTree(const TString& name="T", const TString& title="");

  TTree* MakeMultiEvalTree(const TString& name="T", const TString& title="");

#include "GTSurf.h7"
  ClassDef(GTSurf, 1);
}; // endclass GTSurf

#endif
 GTSurf.h:1
 GTSurf.h:2
 GTSurf.h:3
 GTSurf.h:4
 GTSurf.h:5
 GTSurf.h:6
 GTSurf.h:7
 GTSurf.h:8
 GTSurf.h:9
 GTSurf.h:10
 GTSurf.h:11
 GTSurf.h:12
 GTSurf.h:13
 GTSurf.h:14
 GTSurf.h:15
 GTSurf.h:16
 GTSurf.h:17
 GTSurf.h:18
 GTSurf.h:19
 GTSurf.h:20
 GTSurf.h:21
 GTSurf.h:22
 GTSurf.h:23
 GTSurf.h:24
 GTSurf.h:25
 GTSurf.h:26
 GTSurf.h:27
 GTSurf.h:28
 GTSurf.h:29
 GTSurf.h:30
 GTSurf.h:31
 GTSurf.h:32
 GTSurf.h:33
 GTSurf.h:34
 GTSurf.h:35
 GTSurf.h:36
 GTSurf.h:37
 GTSurf.h:38
 GTSurf.h:39
 GTSurf.h:40
 GTSurf.h:41
 GTSurf.h:42
 GTSurf.h:43
 GTSurf.h:44
 GTSurf.h:45
 GTSurf.h:46
 GTSurf.h:47
 GTSurf.h:48
 GTSurf.h:49
 GTSurf.h:50
 GTSurf.h:51
 GTSurf.h:52
 GTSurf.h:53
 GTSurf.h:54
 GTSurf.h:55
 GTSurf.h:56
 GTSurf.h:57
 GTSurf.h:58
 GTSurf.h:59
 GTSurf.h:60
 GTSurf.h:61
 GTSurf.h:62
 GTSurf.h:63
 GTSurf.h:64
 GTSurf.h:65
 GTSurf.h:66
 GTSurf.h:67
 GTSurf.h:68
 GTSurf.h:69
 GTSurf.h:70
 GTSurf.h:71
 GTSurf.h:72
 GTSurf.h:73
 GTSurf.h:74
 GTSurf.h:75
 GTSurf.h:76
 GTSurf.h:77
 GTSurf.h:78
 GTSurf.h:79
 GTSurf.h:80
 GTSurf.h:81
 GTSurf.h:82
 GTSurf.h:83
 GTSurf.h:84
 GTSurf.h:85
 GTSurf.h:86
 GTSurf.h:87
 GTSurf.h:88
 GTSurf.h:89
 GTSurf.h:90
 GTSurf.h:91
 GTSurf.h:92
 GTSurf.h:93
 GTSurf.h:94
 GTSurf.h:95
 GTSurf.h:96
 GTSurf.h:97
 GTSurf.h:98
 GTSurf.h:99
 GTSurf.h:100
 GTSurf.h:101
 GTSurf.h:102
 GTSurf.h:103
 GTSurf.h:104
 GTSurf.h:105
 GTSurf.h:106
 GTSurf.h:107
 GTSurf.h:108
 GTSurf.h:109
 GTSurf.h:110
 GTSurf.h:111
 GTSurf.h:112
 GTSurf.h:113
 GTSurf.h:114
 GTSurf.h:115
 GTSurf.h:116
 GTSurf.h:117
 GTSurf.h:118
 GTSurf.h:119
 GTSurf.h:120