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

Surface leaf node. More...

#include <Rules.h>

Inheritance diagram for Mantid::Geometry::SurfPoint:
Mantid::Geometry::Rule

Public Member Functions

std::string className () const override
 Returns class name as string. More...
 
std::unique_ptr< SurfPointclone () const
 Clone constructor. More...
 
std::string display () const override
 Returns the signed surface number as a string. More...
 
std::string displayAddress () const override
 Returns the memory address as a string. More...
 
RulefindKey (const int KeyNum) override
 Finds the leaf with the surface number KeyN. More...
 
int findLeaf (const Rule *) const override
 Determines if this rule is a particular leaf value uses memory address to compare. More...
 
void getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override
 gets the bounding box for the surface object held by SurfPoint More...
 
SurfacegetKey () const
 Get Surface Ptr. More...
 
int getKeyN () const
 Get Key. More...
 
int getSign () const
 Get Sign. More...
 
bool isValid (const Kernel::V3D &) const override
 Determines if a point is valid. More...
 
bool isValid (const std::map< int, int > &) const override
 Use MX to determine if the surface truth etc is valid. More...
 
Ruleleaf (const int=0) const override
 No Leaves. More...
 
void setKey (const std::shared_ptr< Surface > &Spoint)
 Sets the key pointer. More...
 
void setKeyN (const int Ky)
 set keyNumber 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...
 
int simplify () override
 Impossible to simplify a simple rule leaf. More...
 
 SurfPoint ()
 Constructor with null key/number. More...
 
int type () const override
 Effective name. 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
 

Private Member Functions

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

Private Attributes

int keyN
 Key Number (identifer) More...
 
std::shared_ptr< Surfacem_key
 Actual Surface Base Object. More...
 
int sign
 +/- in Object unit 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...
 
- 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...
 

Detailed Description

Surface leaf node.

Author
S.Ansell
Version
1.0
Date
August 2005

This class acts as an interface between a general surface and a rule. Allowing an Rule chain to be calculated

Definition at line 213 of file Rules.h.

Constructor & Destructor Documentation

◆ SurfPoint()

Mantid::Geometry::SurfPoint::SurfPoint ( )

Constructor with null key/number.

Definition at line 667 of file RuleItems.cpp.

Referenced by doClone().

Member Function Documentation

◆ className()

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

Returns class name as string.

Reimplemented from Mantid::Geometry::Rule.

Definition at line 221 of file Rules.h.

◆ clone()

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

Clone constructor.

Returns
new(*this)

Definition at line 683 of file RuleItems.cpp.

References doClone().

◆ display()

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

Returns the signed surface number as a string.

Returns
string of the value

Implements Mantid::Geometry::Rule.

Definition at line 801 of file RuleItems.cpp.

References keyN, and sign.

◆ displayAddress()

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

Returns the memory address as a string.

Returns
memory address as string

Implements Mantid::Geometry::Rule.

Definition at line 813 of file RuleItems.cpp.

◆ doClone()

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

Clone constructor.

Returns
new(*this)

Implements Mantid::Geometry::Rule.

Definition at line 674 of file RuleItems.cpp.

References SurfPoint().

Referenced by clone().

◆ findKey()

Rule * Mantid::Geometry::SurfPoint::findKey ( const int  KeyNum)
overridevirtual

Finds the leaf with the surface number KeyN.

Parameters
KeyNum:: Number to search for
Return values
0:: no leaf with that key number availiable
Rule*if an appropiate leaf is found

Implements Mantid::Geometry::Rule.

Definition at line 731 of file RuleItems.cpp.

References keyN.

◆ findLeaf()

int Mantid::Geometry::SurfPoint::findLeaf ( const Rule A) const
overridevirtual

Determines if this rule is a particular leaf value uses memory address to compare.

Parameters
A:: Rule to check
Returns
0 if true and -1 if false.

Implements Mantid::Geometry::Rule.

Definition at line 720 of file RuleItems.cpp.

◆ getBoundingBox()

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

gets the bounding box for the surface object held by SurfPoint

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 834 of file RuleItems.cpp.

References m_key, and sign.

◆ getKey()

Surface * Mantid::Geometry::SurfPoint::getKey ( ) const
inline

Get Surface Ptr.

Definition at line 240 of file Rules.h.

References m_key.

◆ getKeyN()

int Mantid::Geometry::SurfPoint::getKeyN ( ) const
inline

Get Key.

Definition at line 237 of file Rules.h.

◆ getSign()

int Mantid::Geometry::SurfPoint::getSign ( ) const
inline

Get Sign.

Definition at line 236 of file Rules.h.

◆ isValid() [1/2]

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

Determines if a point is valid.

Parameters
Pt:: Point to test
Return values
1:: Pt is the +ve side of the surface or on the surface
0:: Pt is on the -ve side of the surface

Implements Mantid::Geometry::Rule.

Definition at line 771 of file RuleItems.cpp.

References m_key.

◆ isValid() [2/2]

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

Use MX to determine if the surface truth etc is valid.

Parameters
MX:: map of key + logical value XOR sign
Returns
MX.second if key found or 0

Implements Mantid::Geometry::Rule.

Definition at line 786 of file RuleItems.cpp.

◆ leaf()

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

No Leaves.

Reimplemented from Mantid::Geometry::Rule.

Definition at line 224 of file Rules.h.

◆ setKey()

void Mantid::Geometry::SurfPoint::setKey ( const std::shared_ptr< Surface > &  Spoint)

Sets the key pointer.

The class takes ownership.

Parameters
Spoint:: new key values

Definition at line 752 of file RuleItems.cpp.

References m_key.

Referenced by Mantid::Geometry::CSGObject::populate().

◆ setKeyN()

void Mantid::Geometry::SurfPoint::setKeyN ( const int  Ky)

set keyNumber

Sets the key and the sign.

Parameters
Ky:: key value (+/- is used for sign)

Definition at line 742 of file RuleItems.cpp.

References keyN, and sign.

Referenced by Mantid::Geometry::Rule::substituteSurf().

◆ setLeaf()

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

Replaces a leaf with a rule.

This REQUIRES that nR is of type SurfPoint

Parameters
nR:: new rule
:ignored

Implements Mantid::Geometry::Rule.

Definition at line 692 of file RuleItems.cpp.

◆ setLeaves()

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

Replaces a leaf with a rule.

This REQUIRES that nR is of type SurfPoint

Parameters
aR:: new rule

Implements Mantid::Geometry::Rule.

Definition at line 707 of file RuleItems.cpp.

◆ simplify()

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

Impossible to simplify a simple rule leaf.

Therefore returns 0

Returns
0

Implements Mantid::Geometry::Rule.

Definition at line 761 of file RuleItems.cpp.

◆ type()

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

Effective name.

Reimplemented from Mantid::Geometry::Rule.

Definition at line 230 of file Rules.h.

Member Data Documentation

◆ keyN

int Mantid::Geometry::SurfPoint::keyN
private

Key Number (identifer)

Definition at line 217 of file Rules.h.

Referenced by display(), findKey(), and setKeyN().

◆ m_key

std::shared_ptr<Surface> Mantid::Geometry::SurfPoint::m_key
private

Actual Surface Base Object.

Definition at line 215 of file Rules.h.

Referenced by getBoundingBox(), and setKey().

◆ sign

int Mantid::Geometry::SurfPoint::sign
private

+/- in Object unit

Definition at line 218 of file Rules.h.

Referenced by display(), getBoundingBox(), and setKeyN().


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