31#ifdef ENABLE_OPENCASCADE
36#undef _USE_MATH_DEFINES
45#include <BRepAlgoAPI_Common.hxx>
46#include <BRepAlgoAPI_Fuse.hxx>
47#include <BRepPrimAPI_MakeBox.hxx>
48#include <TopoDS_Shape.hxx>
73 :
Rule(Parent), A(
std::move(Ix)), B(
std::move(Iy))
97 A = Iother.
A->clone();
101 B = Iother.
B->clone();
114 if (
this != &Iother) {
118 A = Iother.
A->clone();
122 B = Iother.
B->clone();
144 return std::unique_ptr<Intersection>(
doClone());
156 if (
A &&
A->isComplementary())
158 if (
B &&
B->isComplementary())
225 Rule *PtrOut = (
A) ?
A->findKey(KeyN) :
nullptr;
228 return (
B) ?
B->findKey(KeyN) :
nullptr;
239 throw std::runtime_error(
"Intersection::display incomplete type");
241 out =
"(" +
A->display() +
")";
248 out +=
"(" +
B->display() +
")";
262 std::stringstream cx;
265 cx <<
" ] (" +
A->displayAddress() +
" " +
B->displayAddress() +
") ";
267 cx <<
" ] (" +
A->displayAddress() +
" 0x0 ) ";
269 cx <<
" ] ( 0x0 " +
B->displayAddress() +
") ";
271 cx <<
" ] ( 0x0 0x0 ) ";
284 return (A->isValid(Vec) && B->isValid(Vec));
300 return A->isValid(MX) && B->isValid(MX);
328 double Axmax, Aymax, Azmax, Axmin, Aymin, Azmin;
329 double Bxmax, Bymax, Bzmax, Bxmin, Bymin, Bzmin;
330 Axmax = Bxmax = xmax;
331 Aymax = Bymax = ymax;
332 Azmax = Bzmax = zmax;
333 Axmin = Bxmin = xmin;
334 Aymin = Bymin = ymin;
335 Azmin = Bzmin = zmin;
336 A->getBoundingBox(Axmax, Aymax, Azmax, Axmin, Aymin, Azmin);
337 B->getBoundingBox(Bxmax, Bymax, Bzmax, Bxmin, Bymin, Bzmin);
338 xmax = (Axmax < Bxmax) ? Axmax : Bxmax;
339 xmin = (Axmin > Bxmin) ? Axmin : Bxmin;
340 ymax = (Aymax < Bymax) ? Aymax : Bymax;
341 ymin = (Aymin > Bymin) ? Aymin : Bymin;
342 zmax = (Azmax < Bzmax) ? Azmax : Bzmax;
343 zmin = (Azmin > Bzmin) ? Azmin : Bzmin;
346#ifdef ENABLE_OPENCASCADE
351TopoDS_Shape Intersection::analyze() {
352 TopoDS_Shape
left =
A->analyze();
353 TopoDS_Shape
right =
B->analyze();
364 :
Rule(Parent), A(
std::move(Ix)), B(
std::move(Iy))
397 :
Rule(Iother), A(), B()
405 A = Iother.
A->clone();
409 B = Iother.
B->clone();
422 if (
this != &Iother) {
426 A = Iother.
A->clone();
430 B = Iother.
B->clone();
443 return new Union(*
this);
452 return std::unique_ptr<Union>(
doClone());
518 Rule *PtrOut = (
A) ?
A->findKey(KeyN) :
nullptr;
521 return (
B) ?
B->findKey(KeyN) :
nullptr;
533 if (
A &&
A->isComplementary())
535 if (
B &&
B->isComplementary())
564 return (A && A->isValid(Vec)) || (B && B->isValid(Vec));
576 return (A && A->isValid(MX)) || (B && B->isValid(MX));
589 throw std::runtime_error(
"Union::display incomplete type");
591 out =
"(" +
A->display() +
")";
598 out +=
"(" +
B->display() +
")";
612 std::stringstream cx;
616 cx <<
" ] (" +
A->displayAddress() +
" : " +
B->displayAddress() +
") ";
618 cx <<
" ] (" +
A->displayAddress() +
" : 0x0 ) ";
620 cx <<
" ] ( 0x0 : " +
B->displayAddress() +
") ";
622 cx <<
" ] ( 0x0 : 0x0 ) ";
636 double Axmax, Aymax, Azmax, Axmin, Aymin, Azmin;
637 double Bxmax, Bymax, Bzmax, Bxmin, Bymin, Bzmin;
638 Axmax = Bxmax = xmax;
639 Aymax = Bymax = ymax;
640 Azmax = Bzmax = zmax;
641 Axmin = Bxmin = xmin;
642 Aymin = Bymin = ymin;
643 Azmin = Bzmin = zmin;
644 A->getBoundingBox(Axmax, Aymax, Azmax, Axmin, Aymin, Azmin);
645 B->getBoundingBox(Bxmax, Bymax, Bzmax, Bxmin, Bymin, Bzmin);
646 xmax = (Axmax > Bxmax) ? Axmax : Bxmax;
647 xmin = (Axmin < Bxmin) ? Axmin : Bxmin;
648 ymax = (Aymax > Bymax) ? Aymax : Bymax;
649 ymin = (Aymin < Bymin) ? Aymin : Bymin;
650 zmax = (Azmax > Bzmax) ? Azmax : Bzmax;
651 zmin = (Azmin < Bzmin) ? Azmin : Bzmin;
654#ifdef ENABLE_OPENCASCADE
655TopoDS_Shape Union::analyze() {
656 TopoDS_Shape
left =
A->analyze();
657 TopoDS_Shape
right =
B->analyze();
689 return std::unique_ptr<SurfPoint>(
doClone());
702 auto *newX =
dynamic_cast<SurfPoint *
>(nR.get());
715 auto *newX =
dynamic_cast<SurfPoint *
>(aR.get());
728 return (
this == A) ? 0 : -1;
739 return (KeyNum ==
keyN) ? this :
nullptr;
748 sign = (Ky < 0) ? -1 : 1;
781 return (
m_key->side(Pt) * sign) >= 0;
794 auto lx = MX.find(keyN);
797 const int rtype = (lx->second) ? 1 : -1;
798 return (rtype * sign) >= 0;
808 std::stringstream cx;
820 std::stringstream cx;
836 m_key->getBoundingBox(xmax, ymax, zmax, xmin, ymin, zmin);
838 std::vector<V3D> listOfPoints;
839 double gXmax, gYmax, gZmax, gXmin, gYmin, gZmin;
846 m_key->getBoundingBox(gXmax, gYmax, gZmax, gXmin, gYmin, gZmin);
847 if (!((xmax <= gXmax && xmax >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
848 listOfPoints.emplace_back(xmax, ymax, zmax);
849 if (!((xmin <= gXmax && xmin >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
850 listOfPoints.emplace_back(xmin, ymax, zmax);
851 if (!((xmin <= gXmax && xmin >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
852 listOfPoints.emplace_back(xmin, ymax, zmin);
853 if (!((xmax <= gXmax && xmax >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
854 listOfPoints.emplace_back(xmax, ymax, zmin);
855 if (!((xmin <= gXmax && xmin >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
856 listOfPoints.emplace_back(xmin, ymin, zmin);
857 if (!((xmax <= gXmax && xmax >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
858 listOfPoints.emplace_back(xmax, ymin, zmin);
859 if (!((xmax <= gXmax && xmax >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
860 listOfPoints.emplace_back(xmax, ymin, zmax);
861 if (!((xmin <= gXmax && xmin >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
862 listOfPoints.emplace_back(xmin, ymin, zmax);
865 if (((gXmax <= xmax && gXmax >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
866 (gXmax != xmax || gYmax != ymax || gZmax != zmax))
867 listOfPoints.emplace_back(gXmax, gYmax, gZmax);
868 if (((gXmin <= xmax && gXmin >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
869 (gXmin != xmin || gYmax != ymax || gZmax != zmax))
870 listOfPoints.emplace_back(gXmin, gYmax, gZmax);
871 if (((gXmin <= xmax && gXmin >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
872 (gXmin != xmin || gYmax != ymax || gZmin != zmin))
873 listOfPoints.emplace_back(gXmin, gYmax, gZmin);
874 if (((gXmax <= xmax && gXmax >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
875 (gXmax != xmax || gYmax != ymax || gZmin != zmin))
876 listOfPoints.emplace_back(gXmax, gYmax, gZmin);
877 if (((gXmin <= xmax && gXmin >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
878 (gXmin != xmin || gYmin != ymin || gZmin != zmin))
879 listOfPoints.emplace_back(gXmin, gYmin, gZmin);
880 if (((gXmax <= xmax && gXmax >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
881 (gXmax != xmax || gYmin != ymin || gZmin != zmin))
882 listOfPoints.emplace_back(gXmax, gYmin, gZmin);
883 if (((gXmax <= xmax && gXmax >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
884 (gXmax != xmax || gYmin != ymin || gZmax != zmax))
885 listOfPoints.emplace_back(gXmax, gYmin, gZmax);
886 if (((gXmin <= xmax && gXmin >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
887 (gXmin != xmin || gYmin != ymin || gZmax != zmax))
888 listOfPoints.emplace_back(gXmin, gYmin, gZmax);
890 if (!listOfPoints.empty()) {
891 xmin = ymin = zmin = DBL_MAX;
892 xmax = ymax = zmax = -DBL_MAX;
893 for (std::vector<V3D>::const_iterator it = listOfPoints.begin(); it != listOfPoints.end(); ++it) {
912#ifdef ENABLE_OPENCASCADE
913TopoDS_Shape SurfPoint::analyze() {
915 TopoDS_Shape Result =
m_key->createShape();
918 if (
m_key->className() ==
"Plane") {
920 gp_Pnt p(-1000.0, -1000.0, -1000.0);
921 TopoDS_Shape world = BRepPrimAPI_MakeBox(p, 2000.0, 2000.0, 2000.0).Shape();
922 return BRepAlgoAPI_Common(world, Result);
932 :
Rule(), objN(0), key(nullptr)
953 return std::unique_ptr<CompObj>(
doClone());
982 auto *newX =
dynamic_cast<CompObj *
>(aR.get());
998 auto *newX =
dynamic_cast<CompObj *
>(aR.get());
1023 return (
this == A) ? 0 : -1;
1037 return !(key->isValid(Pt));
1048 return (key) ? !(key->isValid(SMap)) :
true;
1067 std::stringstream cx;
1079 std::stringstream cx;
1097 std::vector<V3D> listOfPoints;
1098 double gXmax, gYmax, gZmax, gXmin, gYmin, gZmin;
1106 if (!((xmax <= gXmax && xmax >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
1107 listOfPoints.emplace_back(xmax, ymax, zmax);
1108 if (!((xmin <= gXmax && xmin >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
1109 listOfPoints.emplace_back(xmin, ymax, zmax);
1110 if (!((xmin <= gXmax && xmin >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
1111 listOfPoints.emplace_back(xmin, ymax, zmin);
1112 if (!((xmax <= gXmax && xmax >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
1113 listOfPoints.emplace_back(xmax, ymax, zmin);
1114 if (!((xmin <= gXmax && xmin >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
1115 listOfPoints.emplace_back(xmin, ymin, zmin);
1116 if (!((xmax <= gXmax && xmax >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
1117 listOfPoints.emplace_back(xmax, ymin, zmin);
1118 if (!((xmax <= gXmax && xmax >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
1119 listOfPoints.emplace_back(xmax, ymin, zmax);
1120 if (!((xmin <= gXmax && xmin >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
1121 listOfPoints.emplace_back(xmin, ymin, zmax);
1124 if (((gXmax <= xmax && gXmax >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
1125 (gXmax != xmax || gYmax != ymax || gZmax != zmax))
1126 listOfPoints.emplace_back(gXmax, gYmax, gZmax);
1127 if (((gXmin <= xmax && gXmin >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
1128 (gXmin != xmin || gYmax != ymax || gZmax != zmax))
1129 listOfPoints.emplace_back(gXmin, gYmax, gZmax);
1130 if (((gXmin <= xmax && gXmin >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
1131 (gXmin != xmin || gYmax != ymax || gZmin != zmin))
1132 listOfPoints.emplace_back(gXmin, gYmax, gZmin);
1133 if (((gXmax <= xmax && gXmax >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
1134 (gXmax != xmax || gYmax != ymax || gZmin != zmin))
1135 listOfPoints.emplace_back(gXmax, gYmax, gZmin);
1136 if (((gXmin <= xmax && gXmin >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
1137 (gXmin != xmin || gYmin != ymin || gZmin != zmin))
1138 listOfPoints.emplace_back(gXmin, gYmin, gZmin);
1139 if (((gXmax <= xmax && gXmax >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
1140 (gXmax != xmax || gYmin != ymin || gZmin != zmin))
1141 listOfPoints.emplace_back(gXmax, gYmin, gZmin);
1142 if (((gXmax <= xmax && gXmax >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
1143 (gXmax != xmax || gYmin != ymin || gZmax != zmax))
1144 listOfPoints.emplace_back(gXmax, gYmin, gZmax);
1145 if (((gXmin <= xmax && gXmin >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
1146 (gXmin != xmin || gYmin != ymin || gZmax != zmax))
1147 listOfPoints.emplace_back(gXmin, gYmin, gZmax);
1149 if (!listOfPoints.empty()) {
1150 xmin = ymin = zmin = DBL_MAX;
1151 xmax = ymax = zmax = -DBL_MAX;
1152 for (std::vector<V3D>::const_iterator it = listOfPoints.begin(); it != listOfPoints.end(); ++it) {
1154 if ((*it)[0] < xmin)
1156 if ((*it)[1] < ymin)
1158 if ((*it)[2] < zmin)
1160 if ((*it)[0] > xmax)
1162 if ((*it)[1] > ymax)
1164 if ((*it)[2] > zmax)
1170#ifdef ENABLE_OPENCASCADE
1171TopoDS_Shape CompObj::analyze() {
1172 TopoDS_Shape Result =
const_cast<Rule *
>(
key->
topRule())->analyze();
1173 Result.Complement();
1182 :
Rule(), status(-1)
1217 return std::unique_ptr<BoolValue>(
doClone());
1230 auto *newX =
dynamic_cast<BoolValue *
>(aR.get());
1245 auto *newX =
dynamic_cast<BoolValue *
>(aR.get());
1306 std::stringstream cx;
1335 :
Rule(Parent), A(
std::move(Cx))
1354 A = std::unique_ptr<Rule>(Cother.
A->clone());
1366 if (
this != &Cother) {
1369 A = std::unique_ptr<Rule>(Cother.
A->clone());
1391 return std::unique_ptr<CompGrp>(
doClone());
1442 return (A.get() == R) ? 0 : -1;
1458 return !(A->isValid(Pt));
1471 return !A->isValid(SMap);
1491 std::stringstream cx;
1493 cx <<
"#( " <<
A->display() <<
" )";
1504 std::stringstream cx;
1505 cx <<
"#( [" <<
this <<
"] ";
1507 cx <<
A->displayAddress();
1527 std::vector<V3D> listOfPoints;
1528 double gXmax, gYmax, gZmax, gXmin, gYmin, gZmin;
1535 A->getBoundingBox(gXmax, gYmax, gZmax, gXmin, gYmin, gZmin);
1536 if (!((xmax <= gXmax && xmax >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
1537 listOfPoints.emplace_back(xmax, ymax, zmax);
1538 if (!((xmin <= gXmax && xmin >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
1539 listOfPoints.emplace_back(xmin, ymax, zmax);
1540 if (!((xmin <= gXmax && xmin >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
1541 listOfPoints.emplace_back(xmin, ymax, zmin);
1542 if (!((xmax <= gXmax && xmax >= gXmin) && (ymax <= gYmax && ymax >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
1543 listOfPoints.emplace_back(xmax, ymax, zmin);
1544 if (!((xmin <= gXmax && xmin >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
1545 listOfPoints.emplace_back(xmin, ymin, zmin);
1546 if (!((xmax <= gXmax && xmax >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmin <= gZmax && zmin >= gZmin)))
1547 listOfPoints.emplace_back(xmax, ymin, zmin);
1548 if (!((xmax <= gXmax && xmax >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
1549 listOfPoints.emplace_back(xmax, ymin, zmax);
1550 if (!((xmin <= gXmax && xmin >= gXmin) && (ymin <= gYmax && ymin >= gYmin) && (zmax <= gZmax && zmax >= gZmin)))
1551 listOfPoints.emplace_back(xmin, ymin, zmax);
1554 if (((gXmax <= xmax && gXmax >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
1555 (gXmax != xmax || gYmax != ymax || gZmax != zmax))
1556 listOfPoints.emplace_back(gXmax, gYmax, gZmax);
1557 if (((gXmin <= xmax && gXmin >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
1558 (gXmin != xmin || gYmax != ymax || gZmax != zmax))
1559 listOfPoints.emplace_back(gXmin, gYmax, gZmax);
1560 if (((gXmin <= xmax && gXmin >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
1561 (gXmin != xmin || gYmax != ymax || gZmin != zmin))
1562 listOfPoints.emplace_back(gXmin, gYmax, gZmin);
1563 if (((gXmax <= xmax && gXmax >= xmin) && (gYmax <= ymax && gYmax >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
1564 (gXmax != xmax || gYmax != ymax || gZmin != zmin))
1565 listOfPoints.emplace_back(gXmax, gYmax, gZmin);
1566 if (((gXmin <= xmax && gXmin >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
1567 (gXmin != xmin || gYmin != ymin || gZmin != zmin))
1568 listOfPoints.emplace_back(gXmin, gYmin, gZmin);
1569 if (((gXmax <= xmax && gXmax >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmin <= zmax && gZmin >= zmin)) &&
1570 (gXmax != xmax || gYmin != ymin || gZmin != zmin))
1571 listOfPoints.emplace_back(gXmax, gYmin, gZmin);
1572 if (((gXmax <= xmax && gXmax >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
1573 (gXmax != xmax || gYmin != ymin || gZmax != zmax))
1574 listOfPoints.emplace_back(gXmax, gYmin, gZmax);
1575 if (((gXmin <= xmax && gXmin >= xmin) && (gYmin <= ymax && gYmin >= ymin) && (gZmax <= zmax && gZmax >= zmin)) &&
1576 (gXmin != xmin || gYmin != ymin || gZmax != zmax))
1577 listOfPoints.emplace_back(gXmin, gYmin, gZmax);
1579 if (!listOfPoints.empty()) {
1580 xmin = ymin = zmin = DBL_MAX;
1581 xmax = ymax = zmax = -DBL_MAX;
1582 for (std::vector<V3D>::const_iterator it = listOfPoints.begin(); it != listOfPoints.end(); ++it) {
1584 if ((*it)[0] < xmin)
1586 if ((*it)[1] < ymin)
1588 if ((*it)[2] < zmin)
1590 if ((*it)[0] > xmax)
1592 if ((*it)[1] > ymax)
1594 if ((*it)[2] > zmax)
1600#ifdef ENABLE_OPENCASCADE
1601TopoDS_Shape CompGrp::analyze() {
1602 TopoDS_Shape Result =
A->analyze();
1603 Result.Complement();
1607TopoDS_Shape BoolValue::analyze() {
return TopoDS_Shape(); }
#define GNU_DIAG_OFF(x)
This is a collection of macros for turning compiler warnings off in a controlled manner.
void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override
gets the bounding box for the BoolValue Rule
std::string display() const override
void setLeaves(std::unique_ptr< Rule >, std::unique_ptr< Rule >) override
Replaces a leaf with a rule.
std::unique_ptr< BoolValue > clone() const
Clone constructor.
bool isValid(const Kernel::V3D &) const override
Determines if a point is valid.
BoolValue * doClone() const override
Clone constructor.
int status
Three values 0 False : 1 True : -1 doesn't matter.
BoolValue & operator=(const BoolValue &)
Assignment operator.
int findLeaf(const Rule *) const override
Abstract find.
std::string displayAddress() const override
Returns the memory address as a string.
int simplify() override
Bool value is always in simplest form.
void setLeaf(std::unique_ptr< Rule >, const int=0) override
Replaces a leaf with a rule.
Constructive Solid Geometry object.
const Rule * topRule() const
Return the top rule.
void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) const override
Calculate (or return cached value of) Axis Aligned Bounding box (DEPRECATED)
bool isValid(const Kernel::V3D &) const override
Determines if a point is valid.
Rule * findKey(const int i) override
This is a complementary object and we dont search into CompGrps.
std::string display() const override
Displays the object as #number.
std::string displayAddress() const override
Returns the memory address as a string.
std::unique_ptr< CompGrp > clone() const
Clone of this.
CompGrp * doClone() const override
Clone of this.
int findLeaf(const Rule *) const override
Check to see if this is a copy of a given Rule.
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
void setLeaves(std::unique_ptr< Rule >, std::unique_ptr< Rule >) override
Replaces a leaf with a rule.
CompGrp & operator=(const CompGrp &)
Standard assignment operator.
void setLeaf(std::unique_ptr< Rule > nR, const int side=0) override
Replaces a leaf with a rule.
std::unique_ptr< Rule > A
The rule.
int simplify() override
Impossible to simplify a simple rule leaf.
void setObj(CSGObject *)
Set a Object state.
bool isValid(const Kernel::V3D &) const override
Determines if a point is valid.
void setLeaves(std::unique_ptr< Rule >, std::unique_ptr< Rule >) override
Replaces a leaf with a rule.
CSGObject * key
Object Pointer.
std::string displayAddress() const override
Returns the memory address as a string.
CompObj * doClone() const override
Clone of this.
Rule * findKey(const int i) override
This is a complementary object and we dont search into CompObjs.
int simplify() override
Impossible to simplify a simple rule leaf.
std::unique_ptr< CompObj > clone() const
Clone of this.
std::string display() const override
Displays the object as #number.
void setLeaf(std::unique_ptr< Rule >, const int=0) override
Replaces a leaf with a rule.
void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override
gets the bounding box for the Complementary of the object
int findLeaf(const Rule *) const override
Check to see if this is a copy of a given Rule.
void setObjN(const int Ky)
set object Number
Combines two Rule objects in an intersection.
std::unique_ptr< Intersection > clone() const
Makes a copy of the whole downward tree.
int simplify() override
apply general intersection simplification
Intersection & operator=(const Intersection &)
Assignment operator :: Does a deep copy of the leaves of Iother.
Intersection * doClone() const override
Makes a copy of the whole downward tree.
void setLeaves(std::unique_ptr< Rule >, std::unique_ptr< Rule >) override
set leaves
int findLeaf(const Rule *) const override
Finds out if the Rule is the same as the leaves.
void setLeaf(std::unique_ptr< Rule > nR, const int side=0) override
set one leaf.
std::string displayAddress() const override
Debug function that converts the the intersection ion space delimited unit to denote intersection.
bool isValid(const Kernel::V3D &) const override
Calculates if Vec is within the object.
std::unique_ptr< Rule > A
Rule 1.
std::string display() const override
Displaces a bracket wrapped object.
Rule * findKey(const int KeyN) override
Finds the leaf with the surface number KeyN.
int isComplementary() const override
Determine is the rule has complementary sub components.
void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override
find the common bounding box with the two childs of intersection
std::unique_ptr< Rule > B
Rule 2.
Object generation rule tree.
Rule & operator=(const Rule &)
Assignment operator= does not set parent as Rules are cloned.
std::shared_ptr< Surface > m_key
Actual Surface Base Object.
int sign
+/- in Object unit
std::string displayAddress() const override
Returns the memory address as a string.
void setLeaf(std::unique_ptr< Rule >, const int=0) override
Replaces a leaf with a rule.
Rule * findKey(const int KeyNum) override
Finds the leaf with the surface number KeyN.
void setKeyN(const int Ky)
set keyNumber
int keyN
Key Number (identifer)
void setLeaves(std::unique_ptr< Rule >, std::unique_ptr< Rule >) override
Replaces a leaf with a rule.
SurfPoint()
Constructor with null key/number.
std::string display() const override
Returns the signed surface number as a string.
std::unique_ptr< SurfPoint > clone() const
Clone constructor.
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
int simplify() override
Impossible to simplify a simple rule leaf.
int findLeaf(const Rule *) const override
Determines if this rule is a particular leaf value uses memory address to compare.
void setKey(const std::shared_ptr< Surface > &Spoint)
Sets the key pointer.
SurfPoint * doClone() const override
Clone constructor.
bool isValid(const Kernel::V3D &) const override
Determines if a point is valid.
Combines two Rule objects in an union.
void setLeaves(std::unique_ptr< Rule >, std::unique_ptr< Rule >) override
set leaves
int simplify() override
apply general intersection simplification
std::unique_ptr< Rule > A
Leaf rule A.
Rule * findKey(const int KeyN) override
Finds the leaf with the surface number KeyN.
bool isValid(const Kernel::V3D &) const override
Calculates if Vec is within the object.
std::string displayAddress() const override
Returns the memory address as a string.
std::unique_ptr< Union > clone() const
Clone allows deep virtual coping.
Union * doClone() const override
Clone allows deep virtual coping.
int isComplementary() const override
Determine is the rule has complementary sub components.
std::string display() const override
Display the union in the form (N:M) where N,M are the downward rules.
Union & operator=(const Union &)
Assignment operator :: Does a deep copy of the leaves of Iother.
void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override
gets the bounding box for the Union Rule
std::unique_ptr< Rule > B
Leaf rule B.
void setLeaf(std::unique_ptr< Rule >, const int side=0) override
Replaces a leaf with a rule.
int findLeaf(const Rule *) const override
Finds out if the Rule is the same as the leaves.