MURE
Loading...
Searching...
No Matches
MathTube.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 _MathTUBE_HXX_
20#define _MathTUBE_HXX_
21
27#include <vector>
28
29#include "Shape.hxx"
30#include "MathCylinder.hxx"
31#include "MathNode.hxx"
32#include "MCSource.hxx"
33
34class MathCylinder;
35
37
49class MathTube : virtual public MathNode
50{
51 public :
57
64 MathTube(double HalfHeight = 0.005, double Rout = 0.01, double Rin = 0., int Sign = - 1);
65
67
80 MathTube(double X, double Y, double Z, double dX, double dY, double dZ, double HalfHeight, double Rout, double Rin = 0., int Sign = - 1);
81 MathTube(const MathTube &t);
82 Shape_ptr Clone(int count = 0) override;
83 void Copy(Shape_ptr S) override;
85
86
91 unsigned IsTube() override
92 {
93 return fTube;
94 }
95
97 {
98 return GetLeaf(0);
99 }
101 {
102 return GetLeaf(1);
103 }
105 {
106 return GetLeaf(2);
107 }
109 {
110 if (fRin > 0) return GetLeaf(3);
111 else return Shape_ptr(nullptr);
112 }
114 {
115 return fHalfHeight;
116 }
118 {
119 return fRin;
120 }
122 {
123 return fRout;
124 }
125 double SetHalfHeight(double halfH);
127
132 unsigned IsIncluded(Shape_ptr OtherShape) override;
133 unsigned IsDisjoint(Shape_ptr OtherShape) override;
135
140 double GetVirtualSphereRadius() override;
141 double *GetVirtualSphereCenter() override;
142 void SetTopBottomPlanesOpen() override;
143 void SetSidePlanesOpen() override;
144
145 void CalculNot() override;
147
148 protected:
149
150 MathTube *CreateNewInstance(int sign = 1) override;
151
152 bool IsSameAxis(MathTube *tube);
153 bool IsSameAxis(MathCylinder *cyl);
154
155 double fRout;
156 double fRin;
157 double fHalfHeight;
158
159};
160
161#endif
#define sign(a)
Definition GenericReactorAssembly.cxx:43
Reference_ptr< Shape > Shape_ptr
Definition MCNPSource.hxx:42
Header file for Monte-Carlo Source abstract class.
Header file for MathCylinder class.
Header file for MathNode class.
Header file for Shape class and Shape_ptr type.
Infinite cylinder Shape.
Definition MathCylinder.hxx:47
MathNode allows to construct Union or Intersection of Shape.
Definition MathNode.hxx:50
Shape_ptr GetLeaf(int i) override
Definition MathNode.hxx:83
bool fTube
true if the Node is a Tube
Definition MathNode.hxx:229
A MathTube is a finite cylinder with an optional hole inside (like a pipe).
Definition MathTube.hxx:50
double fRin
inner radius of the Tube
Definition MathTube.hxx:156
void SetSidePlanesOpen() override
The side planes are NOT mirrors.
Definition MathTube.cxx:663
void Copy(Shape_ptr S) override
Copy all attributs of a Shape S (but not attributs of the father classes).
Definition MathTube.cxx:606
unsigned IsDisjoint(Shape_ptr OtherShape) override
+1 this is disjoint in OtherShape, 0 not included or don't know.
Definition MathTube.cxx:469
Shape_ptr Clone(int count=0) override
Clone a Shape.
Definition MathTube.cxx:559
double fRout
outer radius of the Tube
Definition MathTube.hxx:155
Shape_ptr GetOutCylinder()
Definition MathTube.hxx:96
void CalculNot() override
Allocates and calculs the complement of Shape.
Definition MathTube.cxx:202
unsigned IsTube() override
Definition MathTube.hxx:91
double fHalfHeight
Half height of the Tube.
Definition MathTube.hxx:157
Shape_ptr GetTopPlane()
Definition MathTube.hxx:104
double * GetVirtualSphereCenter() override
returns the center of a Sphere containing the Shape
Definition MathTube.cxx:650
double SetHalfHeight(double halfH)
void SetTopBottomPlanesOpen() override
The top/bottom planes are NOT mirrors.
Definition MathTube.cxx:655
double GetHalfHeight()
Definition MathTube.hxx:113
double GetVirtualSphereRadius() override
returns the radius of a Sphere containing the Shape
Definition MathTube.cxx:640
MathTube * CreateNewInstance(int sign=1) override
a new MathTube instance.
Definition MathTube.cxx:671
double GetInnerRadius()
Definition MathTube.hxx:117
Shape_ptr GetBottomPlane()
Definition MathTube.hxx:100
unsigned IsIncluded(Shape_ptr OtherShape) override
+1 this is included in OtherShape, 0 not included or don't know.
Definition MathTube.cxx:253
double GetOuterRadius()
Definition MathTube.hxx:121
Shape_ptr GetInCylinder()
Definition MathTube.hxx:108
bool IsSameAxis(MathTube *tube)
whether or not 2 tubes have same z-axis
Definition MathTube.cxx:500

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