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

Rule Status class. More...

#include <Rules.h>

Inheritance diagram for Mantid::Geometry::BoolValue:
Mantid::Geometry::Rule

Public Member Functions

 BoolValue ()
 Constructor. More...
 
std::string className () const override
 Returns class name as string. More...
 
std::unique_ptr< BoolValueclone () const
 Clone constructor. More...
 
std::string display () const override
 
std::string displayAddress () const override
 Returns the memory address as a string. More...
 
RulefindKey (const int) override
 Abstract key find. More...
 
int findLeaf (const Rule *) const override
 Abstract find. More...
 
void getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override
 gets the bounding box for the BoolValue Rule More...
 
bool isValid (const Kernel::V3D &) const override
 Determines if a point is valid. More...
 
bool isValid (const std::map< int, int > &) const override
 isValue :: Based on a surface status map More...
 
Ruleleaf (const int=0) const override
 No leaves. More...
 
void setLeaf (std::unique_ptr< Rule >, const int=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...
 
void setStatus (int val)
 < write val into status, if in valid range More...
 
int simplify () override
 Bool value is always in simplest form. More...
 
int type () const override
 Null rule. 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

 BoolValue (const BoolValue &)=default
 
BoolValueoperator= (const BoolValue &)
 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

BoolValuedoClone () const override
 Clone constructor. More...
 

Private Attributes

int status
 Three values 0 False : 1 True : -1 doesn't matter. 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

Rule Status class.

Author
S.Ansell
Version
1.0
Date
April 2005

Class to handle a rule with a truth value but can be true/false/unknown.

Definition at line 363 of file Rules.h.

Constructor & Destructor Documentation

◆ BoolValue() [1/2]

Mantid::Geometry::BoolValue::BoolValue ( const BoolValue )
protecteddefault

◆ BoolValue() [2/2]

Mantid::Geometry::BoolValue::BoolValue ( )

Constructor.

Definition at line 1181 of file RuleItems.cpp.

Referenced by doClone().

Member Function Documentation

◆ className()

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

Returns class name as string.

Reimplemented from Mantid::Geometry::Rule.

Definition at line 375 of file Rules.h.

◆ clone()

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

Clone constructor.

Returns
new(*this)

Definition at line 1211 of file RuleItems.cpp.

References doClone().

◆ display()

std::string Mantid::Geometry::BoolValue::display ( ) const
overridevirtual
Returns
string of
  • "true" "false" or "unknown"

Implements Mantid::Geometry::Rule.

Definition at line 1283 of file RuleItems.cpp.

References status.

◆ displayAddress()

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

Returns the memory address as a string.

Returns
string of Address

Implements Mantid::Geometry::Rule.

Definition at line 1299 of file RuleItems.cpp.

◆ doClone()

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

Clone constructor.

Returns
new(*this)

Implements Mantid::Geometry::Rule.

Definition at line 1202 of file RuleItems.cpp.

References BoolValue().

Referenced by clone().

◆ findKey()

Rule * Mantid::Geometry::BoolValue::findKey ( const int  )
inlineoverridevirtual

Abstract key find.

Implements Mantid::Geometry::Rule.

Definition at line 381 of file Rules.h.

◆ findLeaf()

int Mantid::Geometry::BoolValue::findLeaf ( const Rule ) const
overridevirtual

Abstract find.

Implements Mantid::Geometry::Rule.

Definition at line 1250 of file RuleItems.cpp.

◆ getBoundingBox()

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

gets the bounding box for the BoolValue Rule

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

Implements Mantid::Geometry::Rule.

Definition at line 1320 of file RuleItems.cpp.

◆ isValid() [1/2]

bool Mantid::Geometry::BoolValue::isValid ( const Kernel::V3D pt) const
overridevirtual

Determines if a point is valid.

Parameters
pt:: Point to test
Returns
status

Implements Mantid::Geometry::Rule.

Definition at line 1252 of file RuleItems.cpp.

◆ isValid() [2/2]

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

isValue :: Based on a surface status map

Determines if a point is valid.

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

Implements Mantid::Geometry::Rule.

Definition at line 1263 of file RuleItems.cpp.

◆ leaf()

Rule * Mantid::Geometry::BoolValue::leaf ( const int  = 0) const
inlineoverridevirtual

No leaves.

Reimplemented from Mantid::Geometry::Rule.

Definition at line 377 of file Rules.h.

◆ operator=()

BoolValue & Mantid::Geometry::BoolValue::operator= ( const BoolValue A)
protected

Assignment operator.

Parameters
A:: BoolValue to copy
Returns
*this

Definition at line 1188 of file RuleItems.cpp.

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

◆ setLeaf()

void Mantid::Geometry::BoolValue::setLeaf ( std::unique_ptr< Rule aR,
const int  = 0 
)
overridevirtual

Replaces a leaf with a rule.

This REQUIRES that aR is of type SurfPoint

Parameters
aR:: new rule

secont argument ignored ( Null side point)

Implements Mantid::Geometry::Rule.

Definition at line 1220 of file RuleItems.cpp.

◆ setLeaves()

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

Replaces a leaf with a rule.

This REQUIRES that aR is of type SurfPoint

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

Implements Mantid::Geometry::Rule.

Definition at line 1235 of file RuleItems.cpp.

◆ setStatus()

void Mantid::Geometry::BoolValue::setStatus ( int  val)
inline

< write val into status, if in valid range

Definition at line 386 of file Rules.h.

◆ simplify()

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

Bool value is always in simplest form.

Returns
0

Implements Mantid::Geometry::Rule.

Definition at line 1274 of file RuleItems.cpp.

◆ type()

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

Null rule.

Reimplemented from Mantid::Geometry::Rule.

Definition at line 383 of file Rules.h.

Member Data Documentation

◆ status

int Mantid::Geometry::BoolValue::status
private

Three values 0 False : 1 True : -1 doesn't matter.

Definition at line 365 of file Rules.h.

Referenced by display(), and operator=().


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