Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::Geometry::CompGrp Class Reference

Compemented Grup. More...

#include <Rules.h>

Inheritance diagram for Mantid::Geometry::CompGrp:
Mantid::Geometry::Rule

Public Member Functions

std::string className () const override
 Returns class name as string. More...
 
std::unique_ptr< CompGrpclone () const
 Clone of this. More...
 
 CompGrp ()=default
 
 CompGrp (Rule *, std::unique_ptr< Rule >)
 Constructor to build parent and complent tree. More...
 
std::string display () const override
 Displays the object as #number. More...
 
std::string displayAddress () const override
 Returns the memory address as a string. More...
 
RulefindKey (const int i) override
 This is a complementary object and we dont search into CompGrps. More...
 
int findLeaf (const Rule *) const override
 Check to see if this is a copy of a given Rule. More...
 
void getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override
 gets the bounding box for the complement of the group More...
 
int isComplementary () const override
 Always returns true (1) More...
 
bool isValid (const Kernel::V3D &) const override
 Determines if a point is valid. More...
 
bool isValid (const std::map< int, int > &) const override
 Determines if a point is valid. More...
 
Ruleleaf (const int) const override
 selects leaf component More...
 
void setLeaf (std::unique_ptr< Rule > nR, const int side=0) override
 Replaces a leaf with a rule. More...
 
void setLeaves (std::unique_ptr< Rule >, std::unique_ptr< Rule >) override
 Replaces a leaf with a rule. More...
 
int simplify () override
 Impossible to simplify a simple rule leaf. More...
 
int type () const override
 Is it a branched object. More...
 
- Public Member Functions inherited from Mantid::Geometry::Rule
int checkParents () const
 Debug test for parents. More...
 
virtual std::string className () const
 Returns class name as string. More...
 
std::unique_ptr< Ruleclone () const
 
int commonType () const
 Gets a common type. More...
 
virtual std::string display () const =0
 Abstract Display. More...
 
virtual std::string displayAddress () const =0
 Abstract Display Address. More...
 
int Eliminate ()
 elimination not written More...
 
virtual RulefindKey (const int)=0
 Abstract key find. More...
 
virtual int findLeaf (const Rule *) const =0
 Abstract find. More...
 
virtual void getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin)=0
 Abstract getBoundingBox. More...
 
int getKeyList (std::vector< int > &) const
 Generate the key list given an insertion type object. More...
 
RulegetParent () const
 Returns the parent object. More...
 
virtual int isComplementary () const
 Always returns false (0) More...
 
virtual bool isValid (const Kernel::V3D &) const =0
 Abstract: The point is within the object. More...
 
virtual bool isValid (const std::map< int, int > &) const =0
 Abstract Validity based on surface true/false map. More...
 
virtual Ruleleaf (const int=0) const
 No leaf for a base rule. More...
 
void makeParents ()
 This is initialisation code that populates all the parents in the rule tree. More...
 
 Rule ()
 Standard Constructor. More...
 
 Rule (Rule *)
 Constructor copies. More...
 
virtual void setLeaf (std::unique_ptr< Rule >, const int=0)=0
 Abstract set. More...
 
virtual void setLeaves (std::unique_ptr< Rule >, std::unique_ptr< Rule >)=0
 abstract set leaves More...
 
void setParent (Rule *)
 Sets the parent object (not check for A==this) More...
 
virtual int simplify ()=0
 Abstract: Can the rule be simplified. More...
 
int substituteSurf (const int SurfN, const int newSurfN, const std::shared_ptr< Surface > &SPtr)
 Substitues a surface item if within a rule. More...
 
virtual int type () const
 Null rule. More...
 
virtual ~Rule ()=default
 

Protected Member Functions

 CompGrp (const CompGrp &)
 Standard copy constructor. More...
 
CompGrpoperator= (const CompGrp &)
 Standard assignment operator. More...
 
- Protected Member Functions inherited from Mantid::Geometry::Rule
Ruleoperator= (const Rule &)
 Assignment operator= does not set parent as Rules are cloned. More...
 
 Rule (const Rule &)
 Constructor copies. More...
 

Private Member Functions

CompGrpdoClone () const override
 Clone of this. More...
 

Private Attributes

std::unique_ptr< RuleA
 The rule. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Mantid::Geometry::Rule
static int makeCNF (std::unique_ptr< Rule > &)
 Make Rule into a CNF format. More...
 
static int makeCNFcopy (std::unique_ptr< Rule > &)
 Make Rule into a CNF format (slow) More...
 
static int makeFullDNF (std::unique_ptr< Rule > &)
 Make Rule into a full DNF format. More...
 
static int removeComplementary (std::unique_ptr< Rule > &)
 NOT WORKING. More...
 
static int removeItem (std::unique_ptr< Rule > &TRule, const int SurfN)
 Given an item as a surface name, remove the surface from the Rule tree. More...
 

Detailed Description

Compemented Grup.

Author
S.Ansell
Version
1.0
Date
January 2006

This class holds a complement object of a single object group. Care must be taken to avoid a cyclic loop

Definition at line 315 of file Rules.h.

Constructor & Destructor Documentation

◆ CompGrp() [1/3]

Mantid::Geometry::CompGrp::CompGrp ( const CompGrp Cother)
protected

Standard copy constructor.

Parameters
Cother:: CompGrp to copy

Definition at line 1346 of file RuleItems.cpp.

References A.

◆ CompGrp() [2/3]

Mantid::Geometry::CompGrp::CompGrp ( )
default

Referenced by doClone().

◆ CompGrp() [3/3]

Mantid::Geometry::CompGrp::CompGrp ( Rule Parent,
std::unique_ptr< Rule Cx 
)
explicit

Constructor to build parent and complent tree.

Parameters
Parent:: Rule that is the parent to this
Cx:: Complementary object below

Definition at line 1334 of file RuleItems.cpp.

References A.

Member Function Documentation

◆ className()

std::string Mantid::Geometry::CompGrp::className ( ) const
inlineoverridevirtual

Returns class name as string.

Reimplemented from Mantid::Geometry::Rule.

Definition at line 328 of file Rules.h.

◆ clone()

std::unique_ptr< CompGrp > Mantid::Geometry::CompGrp::clone ( ) const

Clone of this.

Returns
new copy of this

Definition at line 1385 of file RuleItems.cpp.

References doClone().

◆ display()

std::string Mantid::Geometry::CompGrp::display ( ) const
overridevirtual

Displays the object as #number.

Returns
string component

Implements Mantid::Geometry::Rule.

Definition at line 1485 of file RuleItems.cpp.

References A.

◆ displayAddress()

std::string Mantid::Geometry::CompGrp::displayAddress ( ) const
overridevirtual

Returns the memory address as a string.

Returns
memory address as string

Implements Mantid::Geometry::Rule.

Definition at line 1497 of file RuleItems.cpp.

References A.

◆ doClone()

CompGrp * Mantid::Geometry::CompGrp::doClone ( ) const
overrideprivatevirtual

Clone of this.

Returns
new copy of this

Implements Mantid::Geometry::Rule.

Definition at line 1376 of file RuleItems.cpp.

References CompGrp().

Referenced by clone().

◆ findKey()

Rule * Mantid::Geometry::CompGrp::findKey ( const int  i)
overridevirtual

This is a complementary object and we dont search into CompGrps.

If that is needed then the CompGrp should be removed first

Parameters
i:: Null index key
Returns
0

Implements Mantid::Geometry::Rule.

Definition at line 1422 of file RuleItems.cpp.

◆ findLeaf()

int Mantid::Geometry::CompGrp::findLeaf ( const Rule R) const
overridevirtual

Check to see if this is a copy of a given Rule.

Parameters
R:: Rule Ptr to find
Return values
0on success -ve on failuire

Implements Mantid::Geometry::Rule.

Definition at line 1435 of file RuleItems.cpp.

◆ getBoundingBox()

void Mantid::Geometry::CompGrp::getBoundingBox ( double &  xmax,
double &  ymax,
double &  zmax,
double &  xmin,
double &  ymin,
double &  zmin 
)
overridevirtual

gets the bounding box for the complement of the group

Parameters
xmax:: Maximum value for the bounding box in x direction
ymax:: Maximum value for the bounding box in y direction
zmax:: Maximum value for the bounding box in z direction
xmin:: Minimum value for the bounding box in x direction
ymin:: Minimum value for the bounding box in y direction
zmin:: Minimum value for the bounding box in z direction

To calculate the bounding box is formed by the all the points in input box that are not in group bounding box and all the points in group bounding box that are in the input box

Implements Mantid::Geometry::Rule.

Definition at line 1523 of file RuleItems.cpp.

References A.

◆ isComplementary()

int Mantid::Geometry::CompGrp::isComplementary ( ) const
inlineoverridevirtual

Always returns true (1)

Reimplemented from Mantid::Geometry::Rule.

Definition at line 337 of file Rules.h.

◆ isValid() [1/2]

bool Mantid::Geometry::CompGrp::isValid ( const Kernel::V3D Pt) const
overridevirtual

Determines if a point is valid.

Checks to see if the point is valid in the object and returns ture if it is not valid. Note the complementary reverse in the test.

Parameters
Pt:: Point to test
Return values
notvalid in the object
trueis no object is set

Implements Mantid::Geometry::Rule.

Definition at line 1445 of file RuleItems.cpp.

◆ isValid() [2/2]

bool Mantid::Geometry::CompGrp::isValid ( const std::map< int, int > &  SMap) const
overridevirtual

Determines if a point is valid.

Parameters
SMap:: map of surface number and true values
Returns
:: status

Implements Mantid::Geometry::Rule.

Definition at line 1462 of file RuleItems.cpp.

◆ leaf()

Rule * Mantid::Geometry::CompGrp::leaf ( const int  ) const
inlineoverridevirtual

selects leaf component

Reimplemented from Mantid::Geometry::Rule.

Definition at line 330 of file Rules.h.

◆ operator=()

CompGrp & Mantid::Geometry::CompGrp::operator= ( const CompGrp Cother)
protected

Standard assignment operator.

Parameters
Cother:: CompGrp to copy
Returns
*this

Definition at line 1359 of file RuleItems.cpp.

References A, and Mantid::Geometry::Rule::operator=().

◆ setLeaf()

void Mantid::Geometry::CompGrp::setLeaf ( std::unique_ptr< Rule nR,
const int  side = 0 
)
overridevirtual

Replaces a leaf with a rule.

No deletion is carried out

Parameters
nR:: new rule
side:: side to use

Implements Mantid::Geometry::Rule.

Definition at line 1394 of file RuleItems.cpp.

References A.

◆ setLeaves()

void Mantid::Geometry::CompGrp::setLeaves ( std::unique_ptr< Rule aR,
std::unique_ptr< Rule oR 
)
overridevirtual

Replaces a leaf with a rule.

No deletion is carried out but sets the parents.

Parameters
aR:: new rule
oR:: Null other rule

Implements Mantid::Geometry::Rule.

Definition at line 1408 of file RuleItems.cpp.

References A.

◆ simplify()

int Mantid::Geometry::CompGrp::simplify ( )
overridevirtual

Impossible to simplify a simple rule leaf.

Therefore returns 0

Returns
0

Implements Mantid::Geometry::Rule.

Definition at line 1475 of file RuleItems.cpp.

◆ type()

int Mantid::Geometry::CompGrp::type ( ) const
inlineoverridevirtual

Is it a branched object.

Reimplemented from Mantid::Geometry::Rule.

Definition at line 336 of file Rules.h.

Member Data Documentation

◆ A

std::unique_ptr<Rule> Mantid::Geometry::CompGrp::A
private

The rule.

Definition at line 317 of file Rules.h.

Referenced by CompGrp(), display(), displayAddress(), getBoundingBox(), operator=(), setLeaf(), and setLeaves().


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