MURE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Node Class Reference

Node allows to construct Union or Intersection of Shape. More...

#include <Node.hxx>

Inheritance diagram for Node:
Shape TReference Hexagon Tube

Public Member Functions

 Node (double Signe=+1)
 
 Node (const Node &n)
 Copy constructor. More...
 
 ~Node ()
 Normal destrutor. More...
 
virtual Shape_ptr Clone (int count=0)
 Clone a Shape. More...
 
Node parameters
unsigned IsNode ()
 +1 for a Node More...
 
unsigned IsFullVoid ()
 1 if the Node is void or full. More...
 
unsigned IsVoid ()
 1 if the node is void. More...
 
unsigned IsFull ()
 1 if the node is Full. More...
 
double GetVolume ()
 return the Volume of a Node More...
 
Shape_ptr GetLeaf (int i)
 returns the i-th leaf (Shape) of a Node More...
 
int GetNumberOfLeaves ()
 returns the number of leaves (Shape) of a Node More...
 
unsigned Add (Shape_ptr OtherShape)
 Add a new Shape (in fact a Shape_ptr) to a Node. More...
 
void SetBoundingShape (Shape_ptr theShape)
 Declare a bounding shape. More...
 
Shape_ptr GetBoundingShape ()
 return the BoundingShape if exist More...
 
void SetIncludedShape (Shape_ptr theShape)
 Declare an included shape. More...
 
Shape_ptr GetIncludedShape ()
 return the IncludedShape if exist More...
 
virtual void SetMirrorBoundary (bool state=true)
 mirror a particle on the surface More...
 
virtual void SetTopBottomPlanesOpen ()
 Set Top and bottom planes open. More...
 
virtual bool GetTopBottomPlanesOpen ()
 Get Top and bottom planes open. More...
 
virtual void SetSidePlanesOpen ()
 The side planes are NOT mirrors. More...
 
virtual bool GetSidePlanesOpen ()
 Get The side planes open. More...
 
virtual void SetWhiteBoundary (bool state=true)
 mirror a particle on the surface with a cosine distribution More...
 
Shape transformations
virtual void Translate (double dx, double dy, double dz, int count=0)
 Translate the Node of (dx,dy,dz). More...
 
virtual void Rotate (double phi, double theta=0, double psi=0, double *center=0, int count=0)
 Rotate the Node clockwise. More...
 
Relations with other shapes
virtual unsigned Inclus (Shape_ptr OtherShape)
 +1 this is included in OtherShape, 0 not included or don't know. More...
 
virtual unsigned Disjoint (Shape_ptr OtherShape)
 +1 this is disjointed in OtherShape, 0 not included or don't know. More...
 
virtual unsigned Contain (Shape_ptr OtherShape)
 +1 this is contains in OtherShape, 0 not included or don't know. More...
 
Node simplification methods
void Simplify (bool violent=false)
 Simplify a tree of Node. More...
 
void ElagueRoot ()
 Trims a tree with a Chain Saw. More...
 
virtual void UnSetMouvement ()
 Set the fMouvement flag to false;. More...
 
void ClearVectorShape (int UMVT=0)
 Clear VectorShape. More...
 
Miscellaneous methods
virtual string Print ()
 Print the Node surface in MCNP cell. More...
 
void SetUniverse (int u=0)
 Set the Universe number for a shape used in a lattice. More...
 
virtual double GetVirtualSphereRadius ()
 returns the radius of a Sphere containing the Shape More...
 
virtual double * GetVirtualSphereCenter ()
 returns the center of a Sphere containing the Shape More...
 
void AlreadyDefine (bool state=true)
 Set a flag to know wheter a surface is already defined. More...
 
bool PointInShape (double *P, int border)
 true if the point P is in the Shape. More...
 
void PrintX (int count=0)
 Debug method: Print the shape surface when fMouvement=true. More...
 
void PrintY (int count=0)
 Debug method: Print the shape surfaces, InsideShape,... More...
 
virtual void ReplaceNode (Shape_ptr C)
 Replace a Node by an other (C must be a Node) More...
 
int NumberOfShapes ()
 return the number of Shapes contains in a Node More...
 
virtual void CalculNot ()
 Allocates and calculs the complement of Shape. More...
 
- Public Member Functions inherited from Shape
 Shape ()
 Default constructor. The interior of a Shape is built. More...
 
 Shape (const Shape &s)
 Copy constructor. More...
 
virtual ~Shape ()
 Normal destructor. More...
 
double GetSigne ()
 Return -1 if the Shape exterior is considered, +1 otherwise. More...
 
void SetSigne (double s)
 
void SetOutermostShape (bool flag=true)
 Say that this Shape is the most outer one. More...
 
bool IsInfinite ()
 Return 1 if the Shape is an axially infinite one (??? why not resolve thru inheritance as same as shape type?) More...
 
virtual unsigned IsBrick ()
 1 if Shape is a Brick More...
 
virtual unsigned IsCylinder ()
 1 if Shape is a Cylinder More...
 
virtual unsigned IsHexagon ()
 1 if Shape is a Hexagon More...
 
virtual unsigned IsPlane ()
 1 if Shape is a Plane More...
 
virtual unsigned IsSphere ()
 1 if Shape is a Sphere More...
 
virtual unsigned IsTube ()
 1 if Shape is a Tube More...
 
virtual double GetSurface ()
 Get the Surface of a Shape. More...
 
void SetVolume (double V)
 Set the volume of a Shape to V. More...
 
void SetSurface (double S)
 Set the surface of a Shape to S. More...
 
virtual void SetPeriodicBoundary (bool state=true, string TopBottPlaneBC="mirror")
 Periodic boundary (WARNING: only for Brick and Hexagon). More...
 
virtual bool IsMirrorBoundary ()
 mirror a particle on the surface More...
 
virtual bool IsWhiteBoundary ()
 mirror a particle on the surface with a cosine distribution More...
 
virtual bool IsPeriodicBoundary ()
 Periodic boundary (only for Brick or Hexagon) More...
 
Shape_ptr Not ()
 Return the complementary Shape (i.e. the other side) More...
 
void RotateVector (double *V, double phi, double theta=0, double psi=0)
 Rotate a Vector clockwise. ??? why a shape member? More...
 
void RotatePoint (double *P, double phi, double theta=0, double psi=0, double *center=0)
 Rotate a Point clockwise.??? why a shape member? More...
 
virtual void SetMouvement (bool state=true)
 Set the fMouvement flag to state;. More...
 
bool GetMouvement ()
 returns fMouvement flag; More...
 
unsigned AddInsideShape (Shape_ptr OtherShape)
 Add a Shape in fInsideShape each time a "put in" is done. More...
 
unsigned AddOriginalInsideShape (Shape_ptr OtherShape)
 This method is called by Shape::AddInsideShape. More...
 
void ClearOriginalInsideShape ()
 Clear all Inside Shapes. More...
 
void ClearInsideShape ()
 Clear all Inside Shapes. More...
 
unsigned GetInsideShapeSize ()
 return the number of Shape put in this More...
 
unsigned GetOriginalInsideShapeSize ()
 return the number of Original Shape put in this More...
 
void SetInsideShape (int i, Shape_ptr S)
 set the ith InsideShape put in to S More...
 
void SetOriginalInsideShape (int i, Shape_ptr S)
 set the ith Original InsideShape put in to S More...
 
Shape_ptr GetInsideShape (int i)
 return the ith InsideShape put in this More...
 
Shape_ptr GetOriginalInsideShape (int i)
 return the ith Original InsideShape put in this More...
 
virtual string PrintSurface ()
 Print the Shape surfaces in MCNP surface block. More...
 
void SetClone (Shape_ptr clone)
 Set the CloneShape to clone. More...
 
void SetClone2Not ()
 Set the CloneShape to a Not. More...
 
virtual void Copy (Shape_ptr S)
 Copy all attributs of a Shape S (but not attributs of the father classes). More...
 
void AddSurfaceNumber (int i)
 Give the vector of Surface of the Shape. More...
 
vector< int > GetSurfaceNumber ()
 Give the vector of Surface of the Shape. More...
 
virtual void DefineSurface ()
 Define MCNP surfaces for this Shape. More...
 
virtual void SetFill (int f)
 Set the Universe number filling a Shape. More...
 
int GetUniverse ()
 return the Univers number if exists. More...
 
int GetFill ()
 return the Univers number that fills the Shape. More...
 
void IncrementSurface (double S)
 Increment the surface of a Shape of S. More...
 
void NewNot ()
 Update the Not. More...
 
virtual void SetLinkedPlane (Shape_ptr P)
 linked plane for periodic boundary More...
 
double PS (double *U, double *V)
 Scalar product of 3D vectors U and V. More...
 
string GetName ()
 returns the Shape name More...
 
void SetZone (int z)
 set test flag for complex geometries More...
 
int GetZone ()
 get test flag for complex geometries More...
 
- Public Member Functions inherited from TReference
 TReference ()
 Default constructor. Number of references is set to 0. More...
 
virtual ~TReference ()
 Destructor. More...
 
void AddReference (unsigned n=1)
 Add n references to an object. More...
 
unsigned DelReference (unsigned n=1)
 Remove n references to an object. More...
 
unsigned Reference ()
 returns the Number of references to an object More...
 

Protected Member Functions

void RemoveSurface ()
 Removed unused surface from gMURE. More...
 
void Remove (vector< Shape_ptr >::iterator Iterator)
 remove a vector element More...
 
- Protected Member Functions inherited from Shape
void SetNot (Shape *Not)
 Allocates and calculs the complement of Shape. More...
 
void SetNotofNot ()
 Give a Not to the Not. More...
 
void UpdateSurface (Surface *&S)
 Add (if not exists) the surface S to MURE::fSurfaceVector. More...
 

Protected Attributes

vector< Shape_ptrfShapeVector
 a vector of Shape_ptr of a Node More...
 
vector< Shape_ptrfDestroyShape
 a vector of destroyed Shape_ptr of a Node (for UnSetMouvement()) More...
 
Shape_ptr fBoundingShape
 Shape containing the Node, 0 for none. More...
 
Shape_ptr fIncludedShape
 Shape included in the Node, 0 for none. More...
 
bool fTube
 true if the Node is a Tube More...
 
bool fHexagon
 true if the Node is an Hexagon More...
 
int fCount
 count flag to unset mvt More...
 
- Protected Attributes inherited from Shape
vector< int > fSurfaceNumber
 number(s) of Surface(s) defining the Shape More...
 
vector< Shape_ptrfInsideShape
 a vector to remember which Shapes are inside the current one.Clear at each ">>" More...
 
vector< Shape_ptrfOriginalInsideShape
 a vector to remember which Shapes are inside the current one. More...
 
double fSigne
 Define whether the interior (-1) or the exterior (+1) of the Shape is considered. More...
 
bool fInfinite
 Determines whether the shape is infinite or not. More...
 
ShapefNot
 pointer on complementary Shape if exists, else 0. More...
 
bool fAlreadyDefine
 Flag to know whether a surface is already defined. More...
 
bool fMouvement
 Flag that indicate a Shape is in mouvement (translation,..) in a tree. More...
 
int fUniverse
 Universe number (for lattice filling) More...
 
int fFill
 Universe number that fill the Shape. More...
 
double fVolume
 the Volume of a Shape; More...
 
double fSurface
 the Surface of a Shape; More...
 
string fName
 Name of a Shape. More...
 
double fVirtualSphereR
 the radius of a Sphere containing the Shape More...
 
double * fVirtualSphereO
 the center of a Sphere containing the Shape More...
 
Shape_ptr fCloneShape
 the clone of a Shape More...
 
bool fMirrorBoundary
 wether or not mirror a particle on the surface More...
 
bool fOpenZPlanes
 whether the top/bottom planes are not mirrors (default=false) More...
 
bool fOpenXYPlanes
 whether the side planes are not mirrors (default=false) More...
 
bool fWhiteBoundary
 wether or not mirror a particle on the surface with a cosine distribution More...
 
bool fPeriodicBoundary
 wether or not Periodic boundary are applied (only for plane) More...
 
string fTopBottPlaneBoundaryCondition
 wether the top(bottom) plane of a periodic boundary Shape is white or mirror More...
 
Shape_ptr fLinkedPlane
 the Plane linked to an this for periodic boundary More...
 
bool fOutermostShape
 wether or not this Shape is the limit to the exterior world (for calculating particle losses). More...
 
int fZone
 flag for identifying complex geometries (test fms) More...
 

Private Member Functions

void DevElague (int count=0, bool violent=false)
 Developps and trims Node's tree. More...
 

Detailed Description

Node allows to construct Union or Intersection of Shape.

Thus Node is a tree of union (OR) or intersection (AND) of Shape. In a Node, fSigne=+1 for OR and fSigne=-1 for AND. A Node is said full (the whole space) when it is the intersection of nothing, whereas it is said void when it is the union of nothing (empty set).

Author
WEC
PTO
Version
1.0

Constructor & Destructor Documentation

Node::Node ( double  Signe = +1)

Normal constructor for a Node (default : OR).

Parameters
Signe: +1 for an Union (OR) and -1 for ans Intersection (AND)
Node::Node ( const Node n)

Copy constructor.

Node::~Node ( )

Normal destrutor.

Member Function Documentation

unsigned Node::Add ( Shape_ptr  OtherShape)
virtual

Add a new Shape (in fact a Shape_ptr) to a Node.

Reimplemented from Shape.

void Node::AlreadyDefine ( bool  state = true)
virtual

Set a flag to know wheter a surface is already defined.

Reimplemented from Shape.

void Node::CalculNot ( )
virtual

Allocates and calculs the complement of Shape.

Reimplemented from Shape.

Reimplemented in Hexagon, and Tube.

void Node::ClearVectorShape ( int  UMVT = 0)

Clear VectorShape.

Shape_ptr Node::Clone ( int  count = 0)
virtual

Clone a Shape.

Reimplemented from Shape.

Reimplemented in Tube, and Hexagon.

unsigned Node::Contain ( Shape_ptr  OtherShape)
virtual

+1 this is contains in OtherShape, 0 not included or don't know.

void Node::DevElague ( int  count = 0,
bool  violent = false 
)
privatevirtual

Developps and trims Node's tree.

Calls ElagueRoot()

Parameters
count: normal used is default (=0) ; usefull to know the recursion depth
violent: may be true only just before the Print(). With this flag, bounding Shape,... will loose all there sense.

Reimplemented from Shape.

unsigned Node::Disjoint ( Shape_ptr  OtherShape)
virtual

+1 this is disjointed in OtherShape, 0 not included or don't know.

Reimplemented from Shape.

Reimplemented in Hexagon, and Tube.

void Node::ElagueRoot ( )

Trims a tree with a Chain Saw.

Not recursive.

Shape_ptr Node::GetBoundingShape ( )
inline

return the BoundingShape if exist

Shape_ptr Node::GetIncludedShape ( )
inline

return the IncludedShape if exist

Shape_ptr Node::GetLeaf ( int  i)
inlinevirtual

returns the i-th leaf (Shape) of a Node

Reimplemented from Shape.

int Node::GetNumberOfLeaves ( )
inlinevirtual

returns the number of leaves (Shape) of a Node

Reimplemented from Shape.

virtual bool Node::GetSidePlanesOpen ( )
inlinevirtual

Get The side planes open.

Reimplemented from Shape.

virtual bool Node::GetTopBottomPlanesOpen ( )
inlinevirtual

Get Top and bottom planes open.

Reimplemented from Shape.

virtual double* Node::GetVirtualSphereCenter ( )
inlinevirtual

returns the center of a Sphere containing the Shape

Reimplemented from Shape.

Reimplemented in Hexagon, and Tube.

double Node::GetVirtualSphereRadius ( )
virtual

returns the radius of a Sphere containing the Shape

Reimplemented from Shape.

Reimplemented in Hexagon, and Tube.

double Node::GetVolume ( )
virtual

return the Volume of a Node

Reimplemented from Shape.

unsigned Node::Inclus ( Shape_ptr  OtherShape)
virtual

+1 this is included in OtherShape, 0 not included or don't know.

Reimplemented from Shape.

Reimplemented in Hexagon, and Tube.

unsigned Node::IsFull ( )
inlinevirtual

1 if the node is Full.

Reimplemented from Shape.

unsigned Node::IsFullVoid ( )
inlinevirtual

1 if the Node is void or full.

Reimplemented from Shape.

unsigned Node::IsNode ( )
inlinevirtual

+1 for a Node

Reimplemented from Shape.

unsigned Node::IsVoid ( )
inlinevirtual

1 if the node is void.

Reimplemented from Shape.

int Node::NumberOfShapes ( )
virtual

return the number of Shapes contains in a Node

Reimplemented from Shape.

bool Node::PointInShape ( double *  P,
int  border 
)
virtual

true if the point P is in the Shape.

Parameters
P: a (x,y,z) point of space
border: =-1 : if P is at the Shape surface then P is inside
border: =+1 : if P is at the Shape surface then P is outside

Reimplemented from Shape.

string Node::Print ( )
virtual

Print the Node surface in MCNP cell.

Reimplemented from Shape.

Reimplemented in Hexagon.

void Node::PrintX ( int  count = 0)
virtual

Debug method: Print the shape surface when fMouvement=true.

Reimplemented from Shape.

void Node::PrintY ( int  count = 0)
virtual

Debug method: Print the shape surfaces, InsideShape,...

Reimplemented from Shape.

void Node::Remove ( vector< Shape_ptr >::iterator  Iterator)
protected

remove a vector element

void Node::RemoveSurface ( )
protectedvirtual

Removed unused surface from gMURE.

Reimplemented from Shape.

void Node::ReplaceNode ( Shape_ptr  C)
virtual

Replace a Node by an other (C must be a Node)

Reimplemented from Shape.

void Node::Rotate ( double  phi,
double  theta = 0,
double  psi = 0,
double *  center = 0,
int  count = 0 
)
virtual

Rotate the Node clockwise.

Parameters
phi: arround z axis
theta: arround y axis
psi: arround x axis
center: the center of rotation (Default=origin)
count: normal used is default (=0) ; usefull to know the recursion depth

Reimplemented from Shape.

Reimplemented in Hexagon.

void Node::SetBoundingShape ( Shape_ptr  theShape)

Declare a bounding shape.

This may be very usefull when a "closed" Node is built to know if the Node is inlcuded or Disjointed of an other Shape.

Parameters
theShape: the Shape (Shape_ptr) bounding the Node
void Node::SetIncludedShape ( Shape_ptr  theShape)

Declare an included shape.

This may be very usefull when a "closed" Node is built to know if the Node is inlcuded or Disjointed of an other Shape.

Parameters
theShape: the Shape (Shape_ptr) that is included by the Node
void Node::SetMirrorBoundary ( bool  state = true)
virtual

mirror a particle on the surface

Reimplemented from Shape.

virtual void Node::SetSidePlanesOpen ( )
inlinevirtual

The side planes are NOT mirrors.

Reimplemented from Shape.

Reimplemented in Tube, and Hexagon.

virtual void Node::SetTopBottomPlanesOpen ( )
inlinevirtual

Set Top and bottom planes open.

Reimplemented from Shape.

Reimplemented in Tube, and Hexagon.

void Node::SetUniverse ( int  u = 0)
virtual

Set the Universe number for a shape used in a lattice.

Parameters
u: universe number. if u<=0 (default) a universe number is automatically given.

Reimplemented from Shape.

void Node::SetWhiteBoundary ( bool  state = true)
virtual

mirror a particle on the surface with a cosine distribution

Reimplemented from Shape.

void Node::Simplify ( bool  violent = false)
virtual

Simplify a tree of Node.

Super simplification of the death which kills. Calls DevElague().

Reimplemented from Shape.

void Node::Translate ( double  dx,
double  dy,
double  dz,
int  count = 0 
)
virtual

Translate the Node of (dx,dy,dz).

Parameters
dx: translation along x-axis
dy: translation along y-axis
dz: translation along z-axis
count: normal used is default (=0) ; usefull to know the recursion depth

Reimplemented from Shape.

Reimplemented in Hexagon.

void Node::UnSetMouvement ( )
virtual

Set the fMouvement flag to false;.

Reimplemented from Shape.

Member Data Documentation

Shape_ptr Node::fBoundingShape
protected

Shape containing the Node, 0 for none.

int Node::fCount
protected

count flag to unset mvt

vector<Shape_ptr> Node::fDestroyShape
protected

a vector of destroyed Shape_ptr of a Node (for UnSetMouvement())

bool Node::fHexagon
protected

true if the Node is an Hexagon

Shape_ptr Node::fIncludedShape
protected

Shape included in the Node, 0 for none.

vector<Shape_ptr> Node::fShapeVector
protected

a vector of Shape_ptr of a Node

bool Node::fTube
protected

true if the Node is a Tube


The documentation for this class was generated from the following files:

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