MURE
Loading...
Searching...
No Matches
MathCylinder.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef _MathCYLINDER_HXX_
20#define _MathCYLINDER_HXX_
21
22#include <algorithm>
23#include <vector>
24
25#include "Shape.hxx"
26#include "MCSource.hxx"
27
34
46class MathCylinder : public Shape
47{
48 public :
65 MathCylinder(double R = 0.01, double X = 0, double Y = 0, double Z = 0,
66 double dX = 0, double dY = 0, double dZ = 1, int Sign = - 1);
68
72 unsigned IsCylinder() override
73 {
74 return 1;
75 }
76
77 double GetR()
78 {
79 return fR ;
80 }
81 double GetX()
82 {
83 return fOrigin[0];
84 }
85 double GetY()
86 {
87 return fOrigin[1];
88 }
89 double GetZ()
90 {
91 return fOrigin[2];
92 }
93 vector < double > GetOrigin()
94 {
95 return fOrigin;
96 }
97 double GetdX()
98 {
99 return fAxisVector[0];
100 }
101 double GetdY()
102 {
103 return fAxisVector[1];
104 }
105 double GetdZ()
106 {
107 return fAxisVector[2];
108 }
109 vector < double > GetAxisVector()
110 {
111 return fAxisVector;
112 }
114
118
126 void Translate(double dx, double dy, double dz, int count = 0) override;
135 void Rotate(double phi, double theta = 0, double psi = 0, double *center = nullptr, int count = 0) override;
137
141 unsigned IsIncluded(Shape_ptr OtherShape) override;
142 unsigned IsDisjoint(Shape_ptr OtherShape) override;
144
154 bool PointInShape(double *P, int border) override;
155
156 Shape_ptr Clone(int count = 0) override;
157 void Copy(Shape_ptr C) override;
158 void CalculNot() override;
159
160 double *GetVirtualSphereCenter() override;
162
163 protected :
164 void Norme();
165
166 MathCylinder *CreateNewInstance(int sign = 1) override;
167
168
169 double fR;
170 vector < double > fOrigin;
171 vector < double > fAxisVector;
172
173};
174
175#endif
#define sign(a)
Definition GenericReactorAssembly.cxx:43
Header file for Monte-Carlo Source abstract class.
Header file for Shape class and Shape_ptr type.
Infinite cylinder Shape.
Definition MathCylinder.hxx:47
vector< double > GetOrigin()
Definition MathCylinder.hxx:93
MathCylinder * CreateNewInstance(int sign=1) override
a new MathCylinder instance.
Definition MathCylinder.cxx:523
void Norme()
Normalisation of axis vector.
Definition MathCylinder.cxx:61
unsigned IsIncluded(Shape_ptr OtherShape) override
return 1 if the Cylinder is included in OtherShape otherwise 0
Definition MathCylinder.cxx:73
double GetdY()
Definition MathCylinder.hxx:101
double GetY()
Definition MathCylinder.hxx:85
vector< double > fAxisVector
cylinder axis vector
Definition MathCylinder.hxx:171
void Translate(double dx, double dy, double dz, int count=0) override
Definition MathCylinder.cxx:436
double fR
Radius of the Cylinder.
Definition MathCylinder.hxx:169
double GetdZ()
Definition MathCylinder.hxx:105
bool PointInShape(double *P, int border) override
Definition MathCylinder.cxx:415
double GetR()
Definition MathCylinder.hxx:77
double GetZ()
Definition MathCylinder.hxx:89
Shape_ptr Clone(int count=0) override
Clone a Shape.
Definition MathCylinder.cxx:471
void Rotate(double phi, double theta=0, double psi=0, double *center=nullptr, int count=0) override
Definition MathCylinder.cxx:454
double GetX()
Definition MathCylinder.hxx:81
unsigned IsCylinder() override
Definition MathCylinder.hxx:72
vector< double > GetAxisVector()
Definition MathCylinder.hxx:109
void CalculNot() override
Allocates and calculs the complement of a Cylinder.
Definition MathCylinder.cxx:397
double * GetVirtualSphereCenter() override
returns the center of a Sphere containing the Shape
Definition MathCylinder.cxx:513
unsigned IsDisjoint(Shape_ptr OtherShape) override
return 1 if the Cylinder is disjoint of OtherShape otherwise 0
Definition MathCylinder.cxx:284
double GetdX()
Definition MathCylinder.hxx:97
vector< double > fOrigin
origin of the cylinder
Definition MathCylinder.hxx:170
void Copy(Shape_ptr C) override
Copy all attributs of a Shape (but not attributs of the father classes).
Definition MathCylinder.cxx:499
Abstract class to define geometrical shapes.
Definition Shape.hxx:85

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024