EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicCadFileConfig.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EicCadFileConfig.h
1 
2 #include <TObject.h>
3 
4 #ifndef _EIC_CAD_FILE_CONFIG_
5 #define _EIC_CAD_FILE_CONFIG_
6 
7 #include <EicUnits.h>
8 #include <EicDetector.h>
9 #include <EicMediaHub.h>
10 
11 class EicCadFileConfig: public TObject {
12  public:
13  enum XYZ {_X_, _Y_, _Z_, _UNDEFINED_};
14 
15  // 2018/04/08: change default units to [cm], since this simplifies STL re-export;
17  mRotationAngle(0.0), mMediaHub(NULL),
18  mStlQualityCoefficient(0.001) {};
20 
21  // No sanity checks?;
22  void SetUnits(double units) { mUnits = units; };
23  // This call is deprecated, unless one really wants to re-scale the model by some
24  // arbitrary factor, with no relationship to the actual units;
25  void SetScale(double scale) { mScale = scale; };
26  // FIXME: make this tolerance parameter passing more smart, please;
28  void CreateMediaHub(char *media_name = 0) { mMediaHub = new EicMediaHub(media_name); };
29  void SetStlQualityCoefficient(double cff) { mStlQualityCoefficient = cff; };
30 
31  double GetScale() const { return mScale; };
32  double GetUnits() const { return mUnits; };
33  EicMediaHub *GetMediaHub( void ) const { return mMediaHub; };
34  // Sorry, I like short C-style names too;
35  double scale() const { return mScale; };
36  double units() const { return mUnits; };
37  EicMediaHub *mhub( void ) const { return mMediaHub; };
38 
39  double GetStlVertexMergingTolerance( void ) const { return mStlVertexMergingTolerance; };
40  double GetStlQualityCoefficient( void ) const { return mStlQualityCoefficient; };
41 
42  //void SetRotation(unsigned axis, double angle) { mRotationAxis = axis; mRotationAngle = angle; };
43  void SetRotationY(double angle) { mRotationAxis = _Y_; mRotationAngle = angle; };
44  unsigned GetRotationAxis( void ) const { return mRotationAxis; };
45  double GetRotationAngle( void ) const { return mRotationAngle; };
46 
47  private:
48  // Length units should be handled with care; per default assume [mm]; STL vertex merge
49  // tolerance is given in absolute units as well;
51 
54 
55  // If unset, the default OCC value of 0.001 (see StlAPI_Writer::StlAPI_Writer()) will
56  // be used both in EicCadFile::DumpAsStlSolid() and EicCompositeShape::LocalFillBuffer3D();
57  // NB: prefer to assign this value of 0.001 right in the constructor in order not to
58  // depend on possible changes in OCC codes in future releases;
60 
62 
63  ClassDef(EicCadFileConfig,3)
64 };
65 
66 #endif