MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Brick.hxx
Go to the documentation of this file.
1 #ifndef _BRICK_HXX_
2 #define _BRICK_HXX_
3 
9 #include "MureHeaders.hxx"
10 #include "Cylinder.hxx"
11 #include <string>
12 using namespace std;
13 
15 
28 class Brick : public Shape
29 {
30  public :
35 
43  Brick(double HalfX=0.01,double HalfY=0.01,double HalfZ=0.01, double Signe=-1);
44 
46 
57  Brick(double *Origin, double *Ux, double *Uy, double *Uz, double HalfX=0.01,double HalfY=0.01,double HalfZ=0.01, double Signe=-1);
58 
60 
67  Brick(const char* Infinite, double HalfX=0.01,double HalfY=0.01, double Signe=-1);
68  unsigned IsBrick() {return 1;}
69 
70 
75  double GetHalfX() {return fHalfSize[0];}
76  double GetHalfY() {return fHalfSize[1];}
77  double GetHalfZ() {return fHalfSize[2];}
78  const double* GetOrigin() {return fOrigin;}
79  double* GetUx() {return fUx;}
80  double* GetUy() {return fUy;}
81  double* GetUz() {return fUz;}
82 
84 
92  void SetPeriodicBoundary(bool state=true,string TopBottPlaneBC="mirror");
94 
99 
106  virtual void Translate(double dx,double dy,double dz,int count=0);
108 
115  virtual void Rotate(double phi,double theta=0,double psi=0,double *center=0,int count=0);
117 
122  unsigned Inclus(Shape_ptr OtherShape);
123  unsigned Disjoint(Shape_ptr OtherShape);
124 
126 
130  bool PointInShape(double *P,int border);
132 
137  string Print();
138  void DefineSurface();
139 
146  double MinDistanceFrom2OppositeFace(double *N,int whichplane,double *S);
147 
148  Shape_ptr Clone(int count=0);
149  void Copy(Shape_ptr B);
150 
152  virtual int NumberOfShapes(){return 6;}
154  private:
155  Brick(double HalfX,double HalfY,double HalfZ, double Signe,bool Infinite);
156  void Init(double HalfX,double HalfY,double HalfZ);
157 
163  unsigned CornerInBrick(Brick *brick,int all,int border);
165 
170  unsigned CornerInCylinder(Cylinder *cyl,int all,int border);
171 
172  double Dist2Segment(Cylinder *cyl,double Segment[6][2],double C0[6][2],int &segmentNum);
181  void FindBrickProjection(Cylinder *cyl,double Segment[6][2],double C0[6][2],double Origin[2]);
182 
183  unsigned GeneralIntersectionOf2Brick(Brick *brick);
184 
193  unsigned LineCrossPlane(double *X,double *N,double *P, double *U,double *D);
199  unsigned CylinderCrossBrick(Cylinder *Cyl);
207  unsigned PointInSegment(double *X,double *A,double *B,int border);
208 
218  unsigned TwoFaces3Segments(Brick *brick,double *N,int whichSize,double *C0,double C1[3][3]);
219 
229  unsigned TwoFaces2Segments(Brick *brick,double *N,int whichSize,double *C0,double C1[2][3]);
230 
231  double GetVirtualSphereRadius();
232  double* GetVirtualSphereCenter(){return fOrigin;}
233 
234  void CalculNot();
235 
245  double MinDist1Point2Face(double *U0,double *U1,double *U2,double *P0,double *S,int whichplane);
254  double MinDist1Point2FaceInfinite(double *U0,double *U1,double *P0,double *S,int whichplane);
255 
256  private:
257  Surface* DefinePlane(double *N,double D);
258 
259  double fHalfSize[3];
260  double fOrigin[3];
261  double fUx[3];
262  double fUy[3];
263  double fUz[3];
264 
265 };
266 
267 #endif
virtual int NumberOfShapes()
Number of shapes/surfaces this shape consists of.
Definition: Brick.hxx:152
double * GetUz()
return the 3 components of normal vector to the 2 Z planes (or the axis vector if infinite) ...
Definition: Brick.hxx:81
A rectangular parallepipede Shape.
Definition: Brick.hxx:28
Surface class is design to define MCNP surface format.
Definition: Surface.hxx:26
Header file for Cylinder class.
const double * GetOrigin()
return the origin
Definition: Brick.hxx:78
Infinite cylinder Shape.
Definition: Cylinder.hxx:20
unsigned IsBrick()
return 1 for a Brick
Definition: Brick.hxx:68
double * GetUy()
return the 3 components of normal vector to the 2 Y planes
Definition: Brick.hxx:80
File including all headers.
double * GetVirtualSphereCenter()
returns the center of a Sphere containing the Shape
Definition: Brick.hxx:232
double GetHalfY()
return the half length
Definition: Brick.hxx:76
double GetHalfZ()
return the half height (if it exists)
Definition: Brick.hxx:77
double GetHalfX()
return the half width
Definition: Brick.hxx:75
Base class to define shapes.
Definition: Shape.hxx:54
double * GetUx()
return the 3 components of normal vector to the 2 X planes
Definition: Brick.hxx:79

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