+
+void GeomAPI_Shape::translate(const std::shared_ptr<GeomAPI_Dir> theDir, const double theOffset)
+{
+ gp_Dir aDir = theDir->impl<gp_Dir>();
+ gp_Vec aTrsfVec(aDir.XYZ() * theOffset);
+ gp_Trsf aTranslation;
+ aTranslation.SetTranslation(aTrsfVec);
+ TopoDS_Shape aResult = MY_SHAPE->Moved(aTranslation);
+ setImpl(new TopoDS_Shape(aResult));
+}
+
+void GeomAPI_Shape::move(const std::shared_ptr<GeomAPI_Trsf> theTransformation)
+{
+ TopoDS_Shape aResult = MY_SHAPE->Moved(theTransformation->impl<gp_Trsf>());
+ setImpl(new TopoDS_Shape(aResult));
+}
+
+bool GeomAPI_Shape::isSelfIntersected(const int theLevelOfCheck) const
+{
+ BOPAlgo_CheckerSI aCSI; // checker of self-interferences
+ aCSI.SetLevelOfCheck(theLevelOfCheck);
+ TopTools_ListOfShape aList;
+ const TopoDS_Shape& aThisShape = const_cast<GeomAPI_Shape*>(this)->impl<TopoDS_Shape>();
+ aList.Append(aThisShape);
+ aCSI.SetArguments(aList);
+ aCSI.Perform();
+ if (aCSI.HasErrors() || aCSI.DS().Interferences().Extent() > 0) {
+ return true;
+ }
+
+ return false;
+}
+
+bool GeomAPI_Shape::Comparator::operator()(const std::shared_ptr<GeomAPI_Shape>& theShape1,
+ const std::shared_ptr<GeomAPI_Shape>& theShape2) const
+{
+ const TopoDS_Shape& aShape1 = theShape1->impl<TopoDS_Shape>();
+ const TopoDS_Shape& aShape2 = theShape2->impl<TopoDS_Shape>();
+ bool isLess = aShape1.TShape() < aShape2.TShape();
+ if (aShape1.TShape() == aShape2.TShape()) {
+ Standard_Integer aHash1 = aShape1.Location().HashCode(IntegerLast());
+ Standard_Integer aHash2 = aShape2.Location().HashCode(IntegerLast());
+ isLess = aHash1 < aHash2;
+ }
+ return isLess;
+}
+
+bool GeomAPI_Shape::ComparatorWithOri::operator()(
+ const std::shared_ptr<GeomAPI_Shape>& theShape1,
+ const std::shared_ptr<GeomAPI_Shape>& theShape2) const
+{
+ const TopoDS_Shape& aShape1 = theShape1->impl<TopoDS_Shape>();
+ const TopoDS_Shape& aShape2 = theShape2->impl<TopoDS_Shape>();
+ bool isLess = aShape1.TShape() < aShape2.TShape();
+ if (aShape1.TShape() == aShape2.TShape()) {
+ Standard_Integer aHash1 = aShape1.Location().HashCode(IntegerLast());
+ Standard_Integer aHash2 = aShape2.Location().HashCode(IntegerLast());
+ isLess = (aHash1 < aHash2) ||
+ (aHash1 == aHash2 && aShape1.Orientation() < aShape2.Orientation());
+ }
+ return isLess;
+}
+
+int GeomAPI_Shape::Hash::operator()(const std::shared_ptr<GeomAPI_Shape>& theShape) const
+{
+ const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
+ return aShape.HashCode(IntegerLast());
+}
+
+bool GeomAPI_Shape::Equal::operator()(const std::shared_ptr<GeomAPI_Shape>& theShape1,
+ const std::shared_ptr<GeomAPI_Shape>& theShape2) const
+{
+ const TopoDS_Shape& aShape1 = theShape1->impl<TopoDS_Shape>();
+ const TopoDS_Shape& aShape2 = theShape2->impl<TopoDS_Shape>();
+
+ Standard_Integer aHash1 = aShape1.Location().HashCode(IntegerLast());
+ Standard_Integer aHash2 = aShape2.Location().HashCode(IntegerLast());
+
+ return aShape1.TShape() == aShape2.TShape() && aHash1 == aHash2;
+}