|
Mantid
|
Combines two Rule objects in an union. More...
#include <Rules.h>
Public Member Functions | |
| std::string | className () const override |
| Returns class name as string. More... | |
| std::unique_ptr< Union > | clone () const |
| Clone allows deep virtual coping. More... | |
| std::string | display () const override |
| Display the union in the form (N:M) where N,M are the downward rules. More... | |
| std::string | displayAddress () const override |
| Returns the memory address as a string. More... | |
| Rule * | findKey (const int KeyN) override |
| Finds the leaf with the surface number KeyN. More... | |
| int | findLeaf (const Rule *) const override |
| Finds out if the Rule is the same as the leaves. More... | |
| void | getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override |
| gets the bounding box for the Union Rule More... | |
| int | isComplementary () const override |
| Determine is the rule has complementary sub components. More... | |
| bool | isValid (const Kernel::V3D &) const override |
| Calculates if Vec is within the object. More... | |
| bool | isValid (const std::map< int, int > &) const override |
| Use MX to determine if the surface truth etc is valie. More... | |
| Rule * | leaf (const int ipt=0) const override |
| Select a leaf component. More... | |
| void | setLeaf (std::unique_ptr< Rule >, const int side=0) override |
| Replaces a leaf with a rule. More... | |
| void | setLeaves (std::unique_ptr< Rule >, std::unique_ptr< Rule >) override |
| set leaves More... | |
| int | simplify () override |
| apply general intersection simplification More... | |
| int | type () const override |
| effective name More... | |
| Union ()=default | |
| Union (Rule *, std::unique_ptr< Rule >, std::unique_ptr< Rule >) | |
| Union constructor from two Rule ptrs. More... | |
| Union (std::unique_ptr< Rule >, std::unique_ptr< Rule >) | |
| Union constructor from two Rule ptrs. 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< Rule > | clone () 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 Rule * | findKey (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... | |
| Rule * | getParent () 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 Rule * | leaf (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 | |
| Union & | operator= (const Union &) |
| Assignment operator :: Does a deep copy of the leaves of Iother. More... | |
| Union (const Union &) | |
| Copy constructor: Does a clone on the sub-tree below. More... | |
Protected Member Functions inherited from Mantid::Geometry::Rule | |
| Rule & | operator= (const Rule &) |
| Assignment operator= does not set parent as Rules are cloned. More... | |
| Rule (const Rule &) | |
| Constructor copies. More... | |
Private Member Functions | |
| Union * | doClone () const override |
| Clone allows deep virtual coping. More... | |
Private Attributes | |
| std::unique_ptr< Rule > | A |
| Leaf rule A. More... | |
| std::unique_ptr< Rule > | B |
| Leaf rule B. 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... | |
Combines two Rule objects in an union.
|
protected |
Copy constructor: Does a clone on the sub-tree below.
| Iother | :: Union to copy |
Definition at line 396 of file RuleItems.cpp.
|
default |
Referenced by doClone().
|
inlineoverridevirtual |
Returns class name as string.
Reimplemented from Mantid::Geometry::Rule.
| std::unique_ptr< Union > Mantid::Geometry::Union::clone | ( | ) | const |
Clone allows deep virtual coping.
Definition at line 446 of file RuleItems.cpp.
References doClone().
|
overridevirtual |
Display the union in the form (N:M) where N,M are the downward rules.
Implements Mantid::Geometry::Rule.
Definition at line 579 of file RuleItems.cpp.
|
overridevirtual |
Returns the memory address as a string.
Displays addresses of leaves
Implements Mantid::Geometry::Rule.
Definition at line 605 of file RuleItems.cpp.
|
overrideprivatevirtual |
Clone allows deep virtual coping.
Implements Mantid::Geometry::Rule.
Definition at line 437 of file RuleItems.cpp.
References Union().
Referenced by clone().
|
overridevirtual |
Finds the leaf with the surface number KeyN.
| KeyN | :: Number to search for |
| 0 | :: no leaf with that key number availiable |
| Rule* | if an appropiate leaf is found |
Implements Mantid::Geometry::Rule.
Definition at line 509 of file RuleItems.cpp.
|
overridevirtual |
Finds out if the Rule is the same as the leaves.
| R | :: Rule pointer to compare |
| 0 | / 1 for LHS / RHS leaf |
| -1 | :: neither leaf |
Implements Mantid::Geometry::Rule.
Definition at line 493 of file RuleItems.cpp.
|
overridevirtual |
gets the bounding box for the Union Rule
| 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 635 of file RuleItems.cpp.
|
overridevirtual |
Determine is the rule has complementary sub components.
| 1 | :: A side |
| -1 | :: B side |
| 0 | :: no complement |
Reimplemented from Mantid::Geometry::Rule.
Definition at line 524 of file RuleItems.cpp.
|
overridevirtual |
Calculates if Vec is within the object.
| Vec | :: Point to test |
| 1 | :: Vec is within object |
| 0 | :: Vec is outside object. |
Implements Mantid::Geometry::Rule.
Definition at line 556 of file RuleItems.cpp.
|
overridevirtual |
Use MX to determine if the surface truth etc is valie.
| MX | :: map of key + logical value XOR sign |
| 1 | :: if either side is valid |
| 0 | :: Neither side is valid |
Implements Mantid::Geometry::Rule.
Definition at line 567 of file RuleItems.cpp.
|
inlineoverridevirtual |
Select a leaf component.
Reimplemented from Mantid::Geometry::Rule.
Assignment operator :: Does a deep copy of the leaves of Iother.
| Iother | :: Union to assign to it. |
Definition at line 414 of file RuleItems.cpp.
References A, B, and Mantid::Geometry::Rule::operator=().
|
overridevirtual |
Replaces a leaf with a rule.
Calls delete on previous leaf.
| nR | :: new rule |
| side | :: side to use
|
Implements Mantid::Geometry::Rule.
Definition at line 455 of file RuleItems.cpp.
|
overridevirtual |
set leaves
Replaces a both with a rule.
No deletion is carried out but sets the parents.
Implements Mantid::Geometry::Rule.
Definition at line 477 of file RuleItems.cpp.
|
overridevirtual |
apply general intersection simplification
Union simplification::
| 1 | if clauses removed (not top) |
| -1 | replacement of this intersection is required by leaf 0 |
| 0 | if no work to do. |
Implements Mantid::Geometry::Rule.
Definition at line 541 of file RuleItems.cpp.
|
inlineoverridevirtual |
|
private |
Leaf rule A.
Definition at line 163 of file Rules.h.
Referenced by display(), displayAddress(), findKey(), getBoundingBox(), isComplementary(), operator=(), setLeaf(), setLeaves(), and Union().
|
private |
Leaf rule B.
Definition at line 164 of file Rules.h.
Referenced by display(), displayAddress(), findKey(), getBoundingBox(), isComplementary(), operator=(), setLeaf(), setLeaves(), and Union().