MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Hexagon.hxx
Go to the documentation of this file.
1 #ifndef _HEXAGON_HXX_
2 #define _HEXAGON_HXX_
3 
9 #include <vector>
10 #include <math.h>
11 #include "MureHeaders.hxx"
12 using namespace std;
13 
15 
21 class Hexagon : public Node
22 {
23 public :
25 
35  Hexagon(double HalfHeight=0.005,double Side=0.01,double Signe=-1);
37 
47  Hexagon(const char* Infinite,double Side=0.01,double Signe=-1);
48  Hexagon(const Hexagon &h);
49 
50  Shape_ptr Clone(int count=0);
51  virtual void Copy(Shape_ptr S);
52  unsigned IsHexagon() {return fHexagon;}
53 
58  double GetWidth(){return fSide*sqrt(3.);}
59  double GetSide(){return fSide;}
60  double GetHalfHeight(){return fHalfHeight;}
61  double GetOrigin(int i){return fOrigin[i];}
62  double* GetOrigin(){return fOrigin;}
63 
65 
73  void SetPeriodicBoundary(bool state=true,string TopBottPlaneBC="mirror");
74  virtual void SetTopBottomPlanesOpen();
75  virtual void SetSidePlanesOpen();
76 
77  Shape_ptr GetBoundingShape();
78  Shape_ptr GetIncludedShape();
79 
80 
85  unsigned Inclus(Shape_ptr OtherShape);
86  unsigned Disjoint(Shape_ptr OtherShape);
87 
88 
93 
100  virtual void Translate(double dx,double dy,double dz,int count=0);
102 
109  virtual void Rotate(double phi,double theta=0,double psi=0,double *center=0,int count=0);
111 
112 
117  double GetVirtualSphereRadius();
118  double* GetVirtualSphereCenter(){return fOrigin;}
119 
120  virtual string Print();
121 
122  void CalculNot();
123 
125 
126 protected :
127  Hexagon(double HalfHeight,double Side,double Signe,bool Infinite);
128  bool IsSameAxis(Hexagon* hexagon);
129 
130  double fHalfHeight;
131  double fSide;
132  double fOrigin[3];
133 };
142 bool IsHexagonInTube(double Xh[2],Shape_ptr hexa,double Rmax,double Rmin=0,double *Xt=0);
143 
150 bool IsHexagonInHexagon(double Xh1[2],Shape_ptr hexa1,Shape_ptr hexa2);
151 
158 bool IsCylinderInHexagon(Shape_ptr cylinder,Shape_ptr hexagon);
159 
160 #endif
Regular hexagon Shape of a given height.
Definition: Hexagon.hxx:21
Node allows to construct Union or Intersection of Shape.
Definition: Node.hxx:24
double fSide
length of Hexagon side.
Definition: Hexagon.hxx:131
double GetSide()
return the length of a hexagon side
Definition: Hexagon.hxx:59
double GetOrigin(int i)
returns the origin of the hexagon
Definition: Hexagon.hxx:61
double fHalfHeight
Half height of the Hexagon.
Definition: Hexagon.hxx:130
double * GetOrigin()
returns the origin of the hexagon
Definition: Hexagon.hxx:62
double * GetVirtualSphereCenter()
returns the center of a Sphere containing the Shape
Definition: Hexagon.hxx:118
bool IsCylinderInHexagon(Shape_ptr cylinder, Shape_ptr hexagon)
Definition: Hexagon.cxx:889
double GetHalfHeight()
return the 1/2 height of an hexagon
Definition: Hexagon.hxx:60
File including all headers.
unsigned IsHexagon()
1 if Shape is a Hexagon
Definition: Hexagon.hxx:52
bool IsHexagonInTube(double Xh[2], Shape_ptr hexa, double Rmax, double Rmin=0, double *Xt=0)
Definition: Hexagon.cxx:755
bool IsHexagonInHexagon(double Xh1[2], Shape_ptr hexa1, Shape_ptr hexa2)
Definition: Hexagon.cxx:799
double GetWidth()
return the distance of 2 opposite hexagon sides
Definition: Hexagon.hxx:58

MURE Project, documentation generated by Doxygen 1.8.5 - Mon Nov 17 2014