MURE
Loading...
Searching...
No Matches
MathSphere.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 _MathSPHERE_
20#define _MathSPHERE_
21
27#include <algorithm>
28#include <vector>
29
30#include "Shape.hxx"
31#include "MCSource.hxx"
32
34
47class MathSphere : public Shape
48{
49 public :
55
63 MathSphere(double R = 0.01, double X = 0, double Y = 0, double Z = 0, int Sign = - 1);
64 void Copy(Shape_ptr S) override;
65 Shape_ptr Clone(int count = 0) override;
67
72 unsigned IsSphere() 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 }
98
104
110 void Translate(double dx, double dy, double dz, int count = 0) override;
112
119 void Rotate(double phi, double theta = 0, double psi = 0, double *center = nullptr, int count = 0) override;
121
126 unsigned IsIncluded(Shape_ptr OtherShape) override;
127 unsigned IsDisjoint(Shape_ptr OtherShape) override;
129
134 double GetVirtualSphereRadius() override;
135 double *GetVirtualSphereCenter() override;
136
138
142 bool PointInShape(double *P, int border) override;
143
144 void CalculNot() override;
145
147
148 protected :
149
150 MathSphere *CreateNewInstance(int sign = 1) override;
151
152 double fR;
153 vector < double > fOrigin;
154};
155
156#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.
Define a MathSphere Shape.
Definition MathSphere.hxx:48
double fR
Radius of the Sphere.
Definition MathSphere.hxx:152
Shape_ptr Clone(int count=0) override
Clone a Shape.
Definition MathSphere.cxx:61
double GetY()
Definition MathSphere.hxx:85
vector< double > fOrigin
Definition MathSphere.hxx:153
double GetVirtualSphereRadius() override
returns the radius of a Sphere containing the Shape
Definition MathSphere.cxx:538
double GetR()
Definition MathSphere.hxx:77
unsigned IsSphere() override
Definition MathSphere.hxx:72
void CalculNot() override
Allocates and calculs the complement of a Sphere.
Definition MathSphere.cxx:476
MathSphere * CreateNewInstance(int sign=1) override
a new MathSphere instance.
Definition MathSphere.cxx:554
unsigned IsDisjoint(Shape_ptr OtherShape) override
return 1 if the Sphere is disjoint of OtherShape otherwise 0
Definition MathSphere.cxx:352
double GetX()
Definition MathSphere.hxx:81
double * GetVirtualSphereCenter() override
returns the center of a Sphere containing the Shape
Definition MathSphere.cxx:544
vector< double > GetOrigin()
Definition MathSphere.hxx:93
void Copy(Shape_ptr S) override
Copy all attributs of a Shape (but not attributs of the father classes).
Definition MathSphere.cxx:92
void Rotate(double phi, double theta=0, double psi=0, double *center=nullptr, int count=0) override
Rotate the Shape clockwise.
Definition MathSphere.cxx:506
void Translate(double dx, double dy, double dz, int count=0) override
Translate the Node of (dx, dy, dz).
Definition MathSphere.cxx:491
unsigned IsIncluded(Shape_ptr OtherShape) override
return 1 if the Sphere is included in OtherShape otherwise 0
Definition MathSphere.cxx:106
bool PointInShape(double *P, int border) override
true if the point P is in the Shape.
Definition MathSphere.cxx:519
double GetZ()
Definition MathSphere.hxx:89
Abstract class to define geometrical shapes.
Definition Shape.hxx:85

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