From 9e869ede4d8c56262bb20534543c2bf56cd6a91b Mon Sep 17 00:00:00 2001 From: sbh Date: Mon, 17 Nov 2014 20:24:12 +0300 Subject: [PATCH] Boost has been removed from code --- src/Config/Config_FeatureReader.cpp | 6 +- src/Config/Config_FeatureReader.h | 4 +- src/Config/Config_Prop.cpp | 2 +- src/Config/Config_XMLReader.cpp | 2 +- .../ConstructionPlugin_Point.cpp | 4 +- src/Events/Events_Error.cpp | 4 +- src/Events/Events_Listener.h | 4 +- src/Events/Events_LongOp.cpp | 8 +- src/Events/Events_Loop.cpp | 18 +- src/Events/Events_Loop.h | 4 +- src/Events/Events_MessageGroup.h | 6 +- .../ExchangePlugin_ImportFeature.cpp | 10 +- .../ExchangePlugin_ImportFeature.h | 4 +- src/ExchangePlugin/ExchangePlugin_Plugin.cpp | 2 +- .../ExchangePlugin_Validators.cpp | 2 +- src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp | 22 +-- src/FeaturesPlugin/FeaturesPlugin_Boolean.h | 8 +- .../FeaturesPlugin_Extrusion.cpp | 24 +-- src/FeaturesPlugin/FeaturesPlugin_Extrusion.h | 6 +- src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp | 2 +- src/GeomAPI/GeomAPI.i | 7 +- src/GeomAPI/GeomAPI_AISObject.cpp | 48 +++--- src/GeomAPI/GeomAPI_AISObject.h | 36 ++-- src/GeomAPI/GeomAPI_Circ.cpp | 16 +- src/GeomAPI/GeomAPI_Circ.h | 12 +- src/GeomAPI/GeomAPI_Circ2d.cpp | 22 +-- src/GeomAPI/GeomAPI_Circ2d.h | 16 +- src/GeomAPI/GeomAPI_Curve.cpp | 2 +- src/GeomAPI/GeomAPI_Curve.h | 4 +- src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp | 10 +- src/GeomAPI/GeomAPI_DataMapOfShapeShape.h | 10 +- src/GeomAPI/GeomAPI_Dir.cpp | 14 +- src/GeomAPI/GeomAPI_Dir.h | 10 +- src/GeomAPI/GeomAPI_Dir2d.cpp | 10 +- src/GeomAPI/GeomAPI_Dir2d.h | 10 +- src/GeomAPI/GeomAPI_Edge.cpp | 22 +-- src/GeomAPI/GeomAPI_Edge.h | 10 +- src/GeomAPI/GeomAPI_IPresentable.h | 2 +- src/GeomAPI/GeomAPI_Lin.cpp | 22 +-- src/GeomAPI/GeomAPI_Lin.h | 16 +- src/GeomAPI/GeomAPI_Lin2d.cpp | 26 +-- src/GeomAPI/GeomAPI_Lin2d.h | 20 +-- src/GeomAPI/GeomAPI_PlanarEdges.cpp | 8 +- src/GeomAPI/GeomAPI_PlanarEdges.h | 30 ++-- src/GeomAPI/GeomAPI_Pln.cpp | 12 +- src/GeomAPI/GeomAPI_Pln.h | 10 +- src/GeomAPI/GeomAPI_Pnt.cpp | 14 +- src/GeomAPI/GeomAPI_Pnt.h | 14 +- src/GeomAPI/GeomAPI_Pnt2d.cpp | 20 +-- src/GeomAPI/GeomAPI_Pnt2d.h | 16 +- src/GeomAPI/GeomAPI_Shape.cpp | 2 +- src/GeomAPI/GeomAPI_Shape.h | 8 +- src/GeomAPI/GeomAPI_XY.cpp | 14 +- src/GeomAPI/GeomAPI_XY.h | 12 +- src/GeomAPI/GeomAPI_XYZ.cpp | 26 +-- src/GeomAPI/GeomAPI_XYZ.h | 14 +- src/GeomAlgoAPI/GeomAlgoAPI.i | 6 +- src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp | 44 ++--- src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h | 32 ++-- .../GeomAlgoAPI_CompoundBuilder.cpp | 8 +- src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.h | 6 +- src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp | 26 +-- src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.h | 18 +- src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.cpp | 14 +- src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h | 18 +- src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp | 14 +- src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.h | 8 +- src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp | 12 +- src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h | 12 +- src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp | 6 +- src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h | 4 +- src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp | 50 +++--- src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h | 30 ++-- src/GeomData/GeomData_Dir.cpp | 6 +- src/GeomData/GeomData_Dir.h | 6 +- src/GeomData/GeomData_Point.cpp | 6 +- src/GeomData/GeomData_Point.h | 4 +- src/GeomData/GeomData_Point2D.cpp | 6 +- src/GeomData/GeomData_Point2D.h | 4 +- src/GeomDataAPI/GeomDataAPI.i | 11 +- src/GeomDataAPI/GeomDataAPI_Dir.h | 4 +- src/GeomDataAPI/GeomDataAPI_Point.h | 4 +- src/GeomDataAPI/GeomDataAPI_Point2D.h | 4 +- .../GeomValidators_Positive.cpp | 4 +- src/Model/Model_Application.cpp | 4 +- src/Model/Model_Application.h | 4 +- src/Model/Model_AttributeDocRef.cpp | 4 +- src/Model/Model_AttributeDocRef.h | 6 +- src/Model/Model_AttributeRefAttr.cpp | 14 +- src/Model/Model_AttributeRefAttr.h | 4 +- src/Model/Model_AttributeRefList.cpp | 8 +- src/Model/Model_AttributeReference.cpp | 22 +-- src/Model/Model_AttributeReference.h | 2 +- src/Model/Model_AttributeSelection.cpp | 64 +++---- src/Model/Model_AttributeSelection.h | 10 +- src/Model/Model_AttributeSelectionList.cpp | 12 +- src/Model/Model_AttributeSelectionList.h | 4 +- src/Model/Model_Data.cpp | 128 +++++++------- src/Model/Model_Data.h | 32 ++-- src/Model/Model_Document.cpp | 144 ++++++++-------- src/Model/Model_Document.h | 30 ++-- src/Model/Model_Events.cpp | 28 +-- src/Model/Model_Events.h | 16 +- src/Model/Model_FeatureValidator.cpp | 6 +- src/Model/Model_FeatureValidator.h | 4 +- src/Model/Model_ResultBody.cpp | 72 ++++---- src/Model/Model_ResultBody.h | 38 ++--- src/Model/Model_ResultConstruction.cpp | 4 +- src/Model/Model_ResultConstruction.h | 8 +- src/Model/Model_ResultGroup.cpp | 10 +- src/Model/Model_ResultGroup.h | 6 +- src/Model/Model_ResultPart.cpp | 12 +- src/Model/Model_ResultPart.h | 6 +- src/Model/Model_Session.cpp | 48 +++--- src/Model/Model_Session.h | 16 +- src/Model/Model_Update.cpp | 62 +++---- src/Model/Model_Update.h | 16 +- src/Model/Model_Validator.cpp | 4 +- src/Model/Model_Validator.h | 2 +- src/ModelAPI/ModelAPI.i | 22 +-- src/ModelAPI/ModelAPI_Attribute.h | 10 +- src/ModelAPI/ModelAPI_AttributeBoolean.h | 2 +- src/ModelAPI/ModelAPI_AttributeDocRef.h | 6 +- src/ModelAPI/ModelAPI_AttributeDouble.h | 2 +- src/ModelAPI/ModelAPI_AttributeInteger.h | 2 +- src/ModelAPI/ModelAPI_AttributeRefAttr.h | 6 +- src/ModelAPI/ModelAPI_AttributeRefList.h | 2 +- src/ModelAPI/ModelAPI_AttributeReference.h | 2 +- src/ModelAPI/ModelAPI_AttributeSelection.h | 6 +- .../ModelAPI_AttributeSelectionList.h | 6 +- src/ModelAPI/ModelAPI_AttributeString.h | 2 +- src/ModelAPI/ModelAPI_CompositeFeature.h | 6 +- src/ModelAPI/ModelAPI_Data.h | 34 ++-- src/ModelAPI/ModelAPI_Document.h | 32 ++-- src/ModelAPI/ModelAPI_Events.h | 14 +- src/ModelAPI/ModelAPI_Feature.cpp | 32 ++-- src/ModelAPI/ModelAPI_Feature.h | 46 ++--- src/ModelAPI/ModelAPI_FeatureValidator.h | 2 +- src/ModelAPI/ModelAPI_Object.h | 18 +- src/ModelAPI/ModelAPI_Plugin.h | 4 +- src/ModelAPI/ModelAPI_Result.h | 2 +- src/ModelAPI/ModelAPI_ResultBody.h | 40 ++--- src/ModelAPI/ModelAPI_ResultConstruction.h | 6 +- src/ModelAPI/ModelAPI_ResultGroup.h | 6 +- src/ModelAPI/ModelAPI_ResultParameters.h | 2 +- src/ModelAPI/ModelAPI_ResultPart.h | 4 +- src/ModelAPI/ModelAPI_Session.cpp | 6 +- src/ModelAPI/ModelAPI_Session.h | 20 +-- src/ModelAPI/ModelAPI_Tools.cpp | 10 +- src/ModelAPI/ModelAPI_Tools.h | 2 +- src/ModelAPI/ModelAPI_Validator.h | 6 +- src/ModuleBase/ModuleBase_IModule.cpp | 4 +- src/ModuleBase/ModuleBase_ModelWidget.h | 2 +- src/ModuleBase/ModuleBase_Operation.cpp | 8 +- src/ModuleBase/ModuleBase_Operation.h | 2 +- src/ModuleBase/ModuleBase_ResultPrs.cpp | 10 +- src/ModuleBase/ModuleBase_ResultPrs.h | 2 +- src/ModuleBase/ModuleBase_ViewerFilters.cpp | 6 +- src/ModuleBase/ModuleBase_ViewerPrs.h | 2 +- src/ModuleBase/ModuleBase_WidgetBoolValue.cpp | 4 +- src/ModuleBase/ModuleBase_WidgetChoice.cpp | 4 +- src/ModuleBase/ModuleBase_WidgetFeature.cpp | 10 +- .../ModuleBase_WidgetFeatureOrAttribute.cpp | 26 +-- .../ModuleBase_WidgetFeatureOrAttribute.h | 6 +- .../ModuleBase_WidgetFileSelector.cpp | 2 +- src/ModuleBase/ModuleBase_WidgetLineEdit.cpp | 2 +- .../ModuleBase_WidgetMultiSelector.cpp | 10 +- src/ModuleBase/ModuleBase_WidgetPoint2D.cpp | 16 +- src/ModuleBase/ModuleBase_WidgetPoint2D.h | 2 +- .../ModuleBase_WidgetPoint2dDistance.cpp | 10 +- .../ModuleBase_WidgetPoint2dDistance.h | 2 +- .../ModuleBase_WidgetShapeSelector.cpp | 34 ++-- .../ModuleBase_WidgetShapeSelector.h | 6 +- .../ModuleBase_WidgetValueFeature.cpp | 4 +- .../ModuleBase_WidgetValueFeature.h | 8 +- src/PartSet/PartSet_Listener.cpp | 16 +- src/PartSet/PartSet_Listener.h | 2 +- src/PartSet/PartSet_Module.cpp | 16 +- src/PartSet/PartSet_Module.h | 2 +- src/PartSet/PartSet_OperationFeatureBase.cpp | 2 +- src/PartSet/PartSet_OperationFeatureEdit.cpp | 16 +- src/PartSet/PartSet_OperationSketch.cpp | 56 +++--- src/PartSet/PartSet_OperationSketch.h | 2 +- src/PartSet/PartSet_OperationSketchBase.cpp | 8 +- src/PartSet/PartSet_OperationSketchBase.h | 2 +- src/PartSet/PartSet_TestOCC.cpp | 24 +-- src/PartSet/PartSet_Tools.cpp | 132 +++++++-------- src/PartSet/PartSet_Tools.h | 16 +- src/PartSetPlugin/PartSetPlugin_Duplicate.cpp | 10 +- src/PartSetPlugin/PartSetPlugin_Part.cpp | 4 +- src/PartSetPlugin/PartSetPlugin_Part.h | 2 +- src/PartSetPlugin/PartSetPlugin_Remove.cpp | 10 +- src/SketchPlugin/SketchPlugin_Arc.cpp | 72 ++++---- src/SketchPlugin/SketchPlugin_Arc.h | 2 +- src/SketchPlugin/SketchPlugin_Circle.cpp | 42 ++--- src/SketchPlugin/SketchPlugin_Circle.h | 2 +- .../SketchPlugin_ConstraintBase.cpp | 2 +- .../SketchPlugin_ConstraintBase.h | 2 +- .../SketchPlugin_ConstraintDistance.cpp | 78 ++++----- .../SketchPlugin_ConstraintDistance.h | 10 +- .../SketchPlugin_ConstraintLength.cpp | 36 ++-- .../SketchPlugin_ConstraintParallel.cpp | 30 ++-- .../SketchPlugin_ConstraintPerpendicular.cpp | 22 +-- .../SketchPlugin_ConstraintRadius.cpp | 64 +++---- .../SketchPlugin_ConstraintRigid.cpp | 18 +- src/SketchPlugin/SketchPlugin_Feature.cpp | 10 +- src/SketchPlugin/SketchPlugin_Feature.h | 6 +- src/SketchPlugin/SketchPlugin_Line.cpp | 44 ++--- src/SketchPlugin/SketchPlugin_Line.h | 2 +- src/SketchPlugin/SketchPlugin_Point.cpp | 20 +-- src/SketchPlugin/SketchPlugin_Point.h | 2 +- .../SketchPlugin_ResultValidators.cpp | 8 +- src/SketchPlugin/SketchPlugin_Sketch.cpp | 130 +++++++------- src/SketchPlugin/SketchPlugin_Sketch.h | 14 +- src/SketchPlugin/SketchPlugin_Validators.cpp | 38 ++--- src/SketchSolver/SketchSolver_Constraint.cpp | 28 +-- src/SketchSolver/SketchSolver_Constraint.h | 6 +- .../SketchSolver_ConstraintGroup.cpp | 160 +++++++++--------- .../SketchSolver_ConstraintGroup.h | 42 ++--- .../SketchSolver_ConstraintManager.cpp | 52 +++--- .../SketchSolver_ConstraintManager.h | 18 +- src/XGUI/XGUI_ContextMenuMgr.cpp | 8 +- src/XGUI/XGUI_Displayer.cpp | 8 +- src/XGUI/XGUI_Displayer.h | 2 +- src/XGUI/XGUI_DocumentDataModel.cpp | 18 +- src/XGUI/XGUI_DocumentDataModel.h | 2 +- src/XGUI/XGUI_ObjectsBrowser.cpp | 4 +- src/XGUI/XGUI_ObjectsBrowser.h | 2 +- src/XGUI/XGUI_PartDataModel.cpp | 14 +- src/XGUI/XGUI_QtEvents.cpp | 2 +- src/XGUI/XGUI_QtEvents.h | 6 +- src/XGUI/XGUI_Tools.cpp | 2 +- src/XGUI/XGUI_Tools.h | 2 +- src/XGUI/XGUI_Workshop.cpp | 70 ++++---- src/XGUI/XGUI_Workshop.h | 12 +- 235 files changed, 1935 insertions(+), 1943 deletions(-) diff --git a/src/Config/Config_FeatureReader.cpp b/src/Config/Config_FeatureReader.cpp index 947fdb8ab..9ebc93f78 100644 --- a/src/Config/Config_FeatureReader.cpp +++ b/src/Config/Config_FeatureReader.cpp @@ -49,7 +49,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) Events_ID aMenuItemEvent = Events_Loop::eventByName(myEventGenerated); if (isNode(theNode, NODE_FEATURE, NULL)) { storeAttribute(theNode, _ID); - boost::shared_ptr aMessage(new Config_FeatureMessage(aMenuItemEvent, this)); + std::shared_ptr aMessage(new Config_FeatureMessage(aMenuItemEvent, this)); fillFeature(theNode, aMessage); myFeatures.push_back(getProperty(theNode, _ID)); //If a feature has xml definition for it's widget: @@ -60,7 +60,7 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) storeAttribute(theNode, _ID); storeAttribute(theNode, WORKBENCH_DOC); } else if (myIsProcessWidgets && isWidgetNode(theNode)) { - boost::shared_ptr aMessage(new Config_AttributeMessage(aMenuItemEvent, this)); + std::shared_ptr aMessage(new Config_AttributeMessage(aMenuItemEvent, this)); aMessage->setFeatureId(restoreAttribute(NODE_FEATURE, _ID)); std::string anAttributeID = getProperty(theNode, _ID); if (!anAttributeID.empty()) { @@ -84,7 +84,7 @@ bool Config_FeatureReader::processChildren(xmlNodePtr theNode) } void Config_FeatureReader::fillFeature(xmlNodePtr theNode, - const boost::shared_ptr& outFeatureMessage) + const std::shared_ptr& outFeatureMessage) { outFeatureMessage->setId(getProperty(theNode, _ID)); outFeatureMessage->setPluginLibrary(myLibraryName); diff --git a/src/Config/Config_FeatureReader.h b/src/Config/Config_FeatureReader.h index 3f5d7f705..005c9d7f2 100644 --- a/src/Config/Config_FeatureReader.h +++ b/src/Config/Config_FeatureReader.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -32,7 +32,7 @@ class Config_FeatureReader : public Config_XMLReader bool processChildren(xmlNodePtr aNode); void fillFeature(xmlNodePtr theRoot, - const boost::shared_ptr& outFeatureMessage); + const std::shared_ptr& outFeatureMessage); void storeAttribute(xmlNodePtr theNode, const char* theNodeAttribute); std::string restoreAttribute(xmlNodePtr theNode, const char* theNodeAttribute); diff --git a/src/Config/Config_Prop.cpp b/src/Config/Config_Prop.cpp index 6de7627b0..f2854009b 100644 --- a/src/Config/Config_Prop.cpp +++ b/src/Config/Config_Prop.cpp @@ -12,7 +12,7 @@ void Config_Prop::setValue(const std::string& theValue) if (theValue != myValue) { myValue = theValue; static const Events_ID aChangedEvent = Events_Loop::loop()->eventByName("PreferenceChanged"); - Events_Loop::loop()->send(boost::shared_ptr( + Events_Loop::loop()->send(std::shared_ptr( new Events_Message(aChangedEvent, this))); } } diff --git a/src/Config/Config_XMLReader.cpp b/src/Config/Config_XMLReader.cpp index 66bd850a8..44c806ce9 100644 --- a/src/Config/Config_XMLReader.cpp +++ b/src/Config/Config_XMLReader.cpp @@ -152,7 +152,7 @@ void Config_XMLReader::processValidator(xmlNodePtr theNode) { Events_ID aValidatoEvent = Events_Loop::eventByName(EVENT_VALIDATOR_LOADED); Events_Loop* aEvLoop = Events_Loop::loop(); - boost::shared_ptr + std::shared_ptr aMessage(new Config_ValidatorMessage(aValidatoEvent, this)); std::string aValidatorId; std::list aValidatorParameters; diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp index 61c20a9ee..f98ac1b85 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp @@ -26,11 +26,11 @@ void ConstructionPlugin_Point::initAttributes() void ConstructionPlugin_Point::execute() { - boost::shared_ptr aPnt( + std::shared_ptr aPnt( new GeomAPI_Pnt(data()->real(POINT_ATTR_X)->value(), data()->real(POINT_ATTR_Y)->value(), data()->real(POINT_ATTR_Z)->value())); - boost::shared_ptr aConstr = document()->createConstruction(data()); + std::shared_ptr aConstr = document()->createConstruction(data()); aConstr->setShape(GeomAlgoAPI_PointBuilder::point(aPnt)); setResult(aConstr); } diff --git a/src/Events/Events_Error.cpp b/src/Events/Events_Error.cpp index 3ac990edb..712478c89 100644 --- a/src/Events/Events_Error.cpp +++ b/src/Events/Events_Error.cpp @@ -31,8 +31,8 @@ char* Events_Error::description() const void Events_Error::send(char* theDescription, const void* theSender) { - boost::shared_ptr aNewOne = - boost::shared_ptr(new Events_Error(theDescription, theSender)); + std::shared_ptr aNewOne = + std::shared_ptr(new Events_Error(theDescription, theSender)); Events_Loop::loop()->send(aNewOne); } diff --git a/src/Events/Events_Listener.h b/src/Events/Events_Listener.h index f59bbd2f9..8d2df430b 100644 --- a/src/Events/Events_Listener.h +++ b/src/Events/Events_Listener.h @@ -6,7 +6,7 @@ #define Events_Listener_H_ #include -#include +#include class Events_Message; @@ -22,7 +22,7 @@ class EVENTS_EXPORT Events_Listener public: //! This method is called by loop when the event is started to process. - virtual void processEvent(const boost::shared_ptr& theMessage) = 0; + virtual void processEvent(const std::shared_ptr& theMessage) = 0; }; #endif diff --git a/src/Events/Events_LongOp.cpp b/src/Events/Events_LongOp.cpp index 75b7a0dfd..17c373c65 100644 --- a/src/Events/Events_LongOp.cpp +++ b/src/Events/Events_LongOp.cpp @@ -33,8 +33,8 @@ void Events_LongOp::start(void* theSender) MY_SENDERS[theSender]++; if (toSend) { - boost::shared_ptr aNewOne = - boost::shared_ptr(new Events_LongOp(theSender)); + std::shared_ptr aNewOne = + std::shared_ptr(new Events_LongOp(theSender)); Events_Loop::loop()->send(aNewOne); } } @@ -49,8 +49,8 @@ void Events_LongOp::end(void* theSender) MY_SENDERS[theSender] = aCount - 1; } if (MY_SENDERS.empty()) { - boost::shared_ptr aNewOne = - boost::shared_ptr(new Events_LongOp(theSender)); + std::shared_ptr aNewOne = + std::shared_ptr(new Events_LongOp(theSender)); Events_Loop::loop()->send(aNewOne); } } diff --git a/src/Events/Events_Loop.cpp b/src/Events/Events_Loop.cpp index eadae7283..9447c376b 100644 --- a/src/Events/Events_Loop.cpp +++ b/src/Events/Events_Loop.cpp @@ -37,24 +37,24 @@ Events_ID Events_Loop::eventByName(const char* theName) return Events_ID(aResult); } -void Events_Loop::send(const boost::shared_ptr& theMessage, bool isGroup) +void Events_Loop::send(const std::shared_ptr& theMessage, bool isGroup) { if (myImmediateListeners.find(theMessage->eventID().eventText()) != myImmediateListeners.end()) { myImmediateListeners[theMessage->eventID().eventText()]->processEvent(theMessage); } // if it is grouped message, just accumulate it if (isGroup && myFlushed.find(theMessage->eventID().myID) == myFlushed.end()) { - boost::shared_ptr aGroup = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aGroup = + std::dynamic_pointer_cast(theMessage); if (aGroup) { - std::map >::iterator aMyGroup = myGroups.find( + std::map >::iterator aMyGroup = myGroups.find( aGroup->eventID().eventText()); if (aMyGroup == myGroups.end()) { // create a new group of messages for accumulation myGroups[aGroup->eventID().eventText()] = aGroup->newEmpty(); aMyGroup = myGroups.find(aGroup->eventID().eventText()); } - boost::shared_ptr aStored = - boost::dynamic_pointer_cast(aMyGroup->second); + std::shared_ptr aStored = + std::dynamic_pointer_cast(aMyGroup->second); aStored->Join(aGroup); return; } @@ -115,11 +115,11 @@ void Events_Loop::flush(const Events_ID& theID) { if (!myFlushActive) return; - std::map>::iterator aMyGroup = + std::map>::iterator aMyGroup = myGroups.find(theID.eventText()); if (aMyGroup != myGroups.end()) { // really sends myFlushed.insert(theID.myID); - boost::shared_ptr aGroup = aMyGroup->second; + std::shared_ptr aGroup = aMyGroup->second; myGroups.erase(aMyGroup); send(aGroup, false); myFlushed.erase(myFlushed.find(theID.myID)); @@ -133,7 +133,7 @@ void Events_Loop::activateFlushes(const bool theActivate) void Events_Loop::clear(const Events_ID& theID) { - std::map>::iterator aMyGroup = + std::map>::iterator aMyGroup = myGroups.find(theID.eventText()); if (aMyGroup != myGroups.end()) { // really sends myGroups.erase(aMyGroup); diff --git a/src/Events/Events_Loop.h b/src/Events/Events_Loop.h index b8a628ff7..c8b7798c0 100644 --- a/src/Events/Events_Loop.h +++ b/src/Events/Events_Loop.h @@ -33,7 +33,7 @@ class Events_Loop std::map myImmediateListeners; /// map from event ID to groupped messages (accumulated on flush) - std::map > myGroups; + std::map > myGroups; ///< set of messages that are flushed right now, so they are not grouped std::set myFlushed; @@ -53,7 +53,7 @@ class Events_Loop //! Allows to send an event //! \param isGroup is true for grouping messages if possible - EVENTS_EXPORT void send(const boost::shared_ptr& theMessage, bool isGroup = true); + EVENTS_EXPORT void send(const std::shared_ptr& theMessage, bool isGroup = true); //! Registers (or adds if such listener is already registered) a listener //! that will be called on the event and from the defined sender diff --git a/src/Events/Events_MessageGroup.h b/src/Events/Events_MessageGroup.h index b41d4ffcb..8f6561f0b 100644 --- a/src/Events/Events_MessageGroup.h +++ b/src/Events/Events_MessageGroup.h @@ -6,7 +6,7 @@ #define Events_MessageGroup_H_ #include -#include +#include /**\class Events_Message * \ingroup EventsLoop @@ -26,9 +26,9 @@ class EVENTS_EXPORT Events_MessageGroup : public Events_Message virtual ~Events_MessageGroup(); //! Creates a new empty group (to store it in the loop before flush) - virtual boost::shared_ptr newEmpty() = 0; + virtual std::shared_ptr newEmpty() = 0; //! Allows to join the given message with the current one - virtual void Join(const boost::shared_ptr& theJoined) = 0; + virtual void Join(const std::shared_ptr& theJoined) = 0; }; #endif diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index 13a61e546..6493870df 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -68,7 +68,7 @@ void ExchangePlugin_ImportFeature::initAttributes() */ void ExchangePlugin_ImportFeature::execute() { - AttributeStringPtr aFilePathAttr = boost::dynamic_pointer_cast( + AttributeStringPtr aFilePathAttr = std::dynamic_pointer_cast( data()->attribute(ExchangePlugin_ImportFeature::FILE_PATH_ID())); std::string aFilePath = aFilePathAttr->value(); if(aFilePath.empty()) @@ -112,8 +112,8 @@ bool ExchangePlugin_ImportFeature::importFile(const std::string& theFileName) // Pass the results into the model std::string anObjectName = aPath.Name().ToCString(); data()->setName(anObjectName); - boost::shared_ptr aResultBody = document()->createBody(data()); - boost::shared_ptr aGeomShape(new GeomAPI_Shape); + std::shared_ptr aResultBody = document()->createBody(data()); + std::shared_ptr aGeomShape(new GeomAPI_Shape); aGeomShape->setImpl(new TopoDS_Shape(aShape)); //LoadNamingDS of the imported shape @@ -126,8 +126,8 @@ bool ExchangePlugin_ImportFeature::importFile(const std::string& theFileName) //============================================================================ void ExchangePlugin_ImportFeature::loadNamingDS( - boost::shared_ptr theGeomShape, - boost::shared_ptr theResultBody) + std::shared_ptr theGeomShape, + std::shared_ptr theResultBody) { //load result theResultBody->store(theGeomShape); diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.h b/src/ExchangePlugin/ExchangePlugin_ImportFeature.h index 6a90bf0b9..c4c254e00 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.h @@ -66,8 +66,8 @@ class ExchangePlugin_ImportFeature : public ModelAPI_Feature private: /// Loads Naming data structure to the document - void loadNamingDS(boost::shared_ptr theGeomShape, - boost::shared_ptr theResultBody); + void loadNamingDS(std::shared_ptr theGeomShape, + std::shared_ptr theResultBody); }; #endif /* IMPORT_IMPORTFEATURE_H_ */ diff --git a/src/ExchangePlugin/ExchangePlugin_Plugin.cpp b/src/ExchangePlugin/ExchangePlugin_Plugin.cpp index b37a06906..5168e91f7 100644 --- a/src/ExchangePlugin/ExchangePlugin_Plugin.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Plugin.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include using namespace std; diff --git a/src/ExchangePlugin/ExchangePlugin_Validators.cpp b/src/ExchangePlugin/ExchangePlugin_Validators.cpp index 7954c540b..2582ca76e 100644 --- a/src/ExchangePlugin/ExchangePlugin_Validators.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Validators.cpp @@ -55,7 +55,7 @@ bool ExchangePlugin_ImportFormatValidator::isValid(const AttributePtr& theAttrib ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); if (theAttribute->isInitialized()) { const AttributeStringPtr aStrAttr = - boost::dynamic_pointer_cast(theAttribute); + std::dynamic_pointer_cast(theAttribute); if(!aStrAttr) return false; std::string aFileName = aStrAttr->value(); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp index de5cdbf22..d8b8198ed 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp @@ -31,37 +31,37 @@ void FeaturesPlugin_Boolean::initAttributes() data()->addAttribute(FeaturesPlugin_Boolean::TOOL_ID(), ModelAPI_AttributeReference::type()); } -boost::shared_ptr FeaturesPlugin_Boolean::getShape(const std::string& theAttrName) +std::shared_ptr FeaturesPlugin_Boolean::getShape(const std::string& theAttrName) { - boost::shared_ptr aObjRef = boost::dynamic_pointer_cast< + std::shared_ptr aObjRef = std::dynamic_pointer_cast< ModelAPI_AttributeReference>(data()->attribute(theAttrName)); if (aObjRef) { - boost::shared_ptr aConstr = boost::dynamic_pointer_cast< + std::shared_ptr aConstr = std::dynamic_pointer_cast< ModelAPI_ResultBody>(aObjRef->value()); if (aConstr) return aConstr->shape(); } - return boost::shared_ptr(); + return std::shared_ptr(); } void FeaturesPlugin_Boolean::execute() { - boost::shared_ptr aTypeAttr = boost::dynamic_pointer_cast< + std::shared_ptr aTypeAttr = std::dynamic_pointer_cast< ModelAPI_AttributeInteger>(data()->attribute(FeaturesPlugin_Boolean::TYPE_ID())); if (!aTypeAttr) return; int aType = aTypeAttr->value(); - boost::shared_ptr anObject = this->getShape(FeaturesPlugin_Boolean::OBJECT_ID()); + std::shared_ptr anObject = this->getShape(FeaturesPlugin_Boolean::OBJECT_ID()); if (!anObject) return; - boost::shared_ptr aTool = this->getShape(FeaturesPlugin_Boolean::TOOL_ID()); + std::shared_ptr aTool = this->getShape(FeaturesPlugin_Boolean::TOOL_ID()); if (!aTool) return; - boost::shared_ptr aResultBody = document()->createBody(data()); + std::shared_ptr aResultBody = document()->createBody(data()); GeomAlgoAPI_Boolean* aFeature = new GeomAlgoAPI_Boolean(anObject, aTool, aType); if(aFeature && !aFeature->isDone()) { @@ -98,9 +98,9 @@ void FeaturesPlugin_Boolean::execute() //============================================================================ void FeaturesPlugin_Boolean::LoadNamingDS(GeomAlgoAPI_Boolean* theFeature, - boost::shared_ptr theResultBody, - boost::shared_ptr theObject, - boost::shared_ptr theTool, + std::shared_ptr theResultBody, + std::shared_ptr theObject, + std::shared_ptr theTool, int theType) { diff --git a/src/FeaturesPlugin/FeaturesPlugin_Boolean.h b/src/FeaturesPlugin/FeaturesPlugin_Boolean.h index 2f99dbdf4..021b99da6 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Boolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Boolean.h @@ -62,13 +62,13 @@ class FeaturesPlugin_Boolean : public ModelAPI_Feature FeaturesPlugin_Boolean(); private: - boost::shared_ptr getShape(const std::string& theAttrName); + std::shared_ptr getShape(const std::string& theAttrName); /// Load Naming data structure of the feature to the document void LoadNamingDS(GeomAlgoAPI_Boolean* theFeature, - boost::shared_ptr theResultBody, - boost::shared_ptr theObject, - boost::shared_ptr theTool, + std::shared_ptr theResultBody, + std::shared_ptr theObject, + std::shared_ptr theTool, int theType); }; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index ab5c393e6..55bc605c1 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -37,23 +37,23 @@ void FeaturesPlugin_Extrusion::initAttributes() void FeaturesPlugin_Extrusion::execute() { - boost::shared_ptr aFaceRef = boost::dynamic_pointer_cast< + std::shared_ptr aFaceRef = std::dynamic_pointer_cast< ModelAPI_AttributeSelection>(data()->attribute(FeaturesPlugin_Extrusion::FACE_ID())); if (!aFaceRef) return; - boost::shared_ptr aFace = - boost::dynamic_pointer_cast(aFaceRef->value()); + std::shared_ptr aFace = + std::dynamic_pointer_cast(aFaceRef->value()); if (!aFace) return; - boost::shared_ptr aContext; + std::shared_ptr aContext; ResultPtr aContextRes = aFaceRef->context(); if (aContextRes) { if (aContextRes->groupName() == ModelAPI_ResultBody::group()) - aContext = boost::dynamic_pointer_cast(aContextRes)->shape(); + aContext = std::dynamic_pointer_cast(aContextRes)->shape(); else if (aContextRes->groupName() == ModelAPI_ResultConstruction::group()) - aContext = boost::dynamic_pointer_cast(aContextRes)->shape(); + aContext = std::dynamic_pointer_cast(aContextRes)->shape(); } if (!aContext) { std::string aContextError = "The selection context is bad"; @@ -65,7 +65,7 @@ void FeaturesPlugin_Extrusion::execute() if (data()->boolean(FeaturesPlugin_Extrusion::REVERSE_ID())->value()) aSize = -aSize; - boost::shared_ptr aResultBody = document()->createBody(data()); + std::shared_ptr aResultBody = document()->createBody(data()); GeomAlgoAPI_Extrusion aFeature(aFace, aSize); if(!aFeature.isDone()) { std::string aFeatureError = "Extrusion algorithm failed"; @@ -95,9 +95,9 @@ void FeaturesPlugin_Extrusion::execute() //============================================================================ void FeaturesPlugin_Extrusion::LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature, - boost::shared_ptr theResultBody, - boost::shared_ptr theBasis, - boost::shared_ptr theContext) + std::shared_ptr theResultBody, + std::shared_ptr theBasis, + std::shared_ptr theContext) { @@ -114,7 +114,7 @@ void FeaturesPlugin_Extrusion::LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature, theResultBody->loadAndOrientGeneratedShapes(theFeature.makeShape(), theBasis, EDGE,_LATERAL_TAG, *aSubShapes); //Insert bottom face - boost::shared_ptr aBottomFace = theFeature.firstShape(); + std::shared_ptr aBottomFace = theFeature.firstShape(); if (!aBottomFace->isNull()) { if (aSubShapes->isBound(aBottomFace)) { aBottomFace = aSubShapes->find(aBottomFace); @@ -125,7 +125,7 @@ void FeaturesPlugin_Extrusion::LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature, //Insert top face - boost::shared_ptr aTopFace = theFeature.lastShape(); + std::shared_ptr aTopFace = theFeature.lastShape(); if (!aTopFace->isNull()) { if (aSubShapes->isBound(aTopFace)) { aTopFace = aSubShapes->find(aTopFace); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.h b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.h index 57c84efde..151968299 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.h @@ -55,9 +55,9 @@ class FeaturesPlugin_Extrusion : public ModelAPI_Feature FeaturesPlugin_Extrusion(); private: /// Load Naming data structure of the feature to the document - void LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature, boost::shared_ptr theResultBody, - boost::shared_ptr theBasis, - boost::shared_ptr theContext); + void LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature, std::shared_ptr theResultBody, + std::shared_ptr theBasis, + std::shared_ptr theContext); }; #endif diff --git a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp index 32c95813f..681479032 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp @@ -8,7 +8,7 @@ #include -#include +#include using namespace std; diff --git a/src/GeomAPI/GeomAPI.i b/src/GeomAPI/GeomAPI.i index 67d8297f7..474ea1caa 100644 --- a/src/GeomAPI/GeomAPI.i +++ b/src/GeomAPI/GeomAPI.i @@ -1,7 +1,6 @@ /* GeomAPI.i */ %module GeomAPI %{ - #include "boost/shared_ptr.hpp" #include "GeomAPI.h" #include "GeomAPI_Interface.h" #include "GeomAPI_Pnt.h" @@ -16,11 +15,9 @@ // standard definitions %include "typemaps.i" %include "std_string.i" -//%include -%include +%include "std_shared_ptr.i" -// boost pointers -// %include +// shared pointers %shared_ptr(GeomAPI_Interface) %shared_ptr(GeomAPI_Pnt) %shared_ptr(GeomAPI_Dir) diff --git a/src/GeomAPI/GeomAPI_AISObject.cpp b/src/GeomAPI/GeomAPI_AISObject.cpp index ec84c8c34..b381074b8 100644 --- a/src/GeomAPI/GeomAPI_AISObject.cpp +++ b/src/GeomAPI/GeomAPI_AISObject.cpp @@ -41,7 +41,7 @@ GeomAPI_AISObject::GeomAPI_AISObject() { } -void GeomAPI_AISObject::createShape(boost::shared_ptr theShape) +void GeomAPI_AISObject::createShape(std::shared_ptr theShape) { const TopoDS_Shape& aTDS = (theShape && theShape->implPtr()) ? @@ -64,10 +64,10 @@ void GeomAPI_AISObject::createShape(boost::shared_ptr theShape) setImpl(new Handle(AIS_InteractiveObject)(new AIS_Shape(aTDS))); } -void GeomAPI_AISObject::createDistance(boost::shared_ptr theStartPoint, - boost::shared_ptr theEndPoint, - boost::shared_ptr theFlyoutPoint, - boost::shared_ptr thePlane, double theDistance) +void GeomAPI_AISObject::createDistance(std::shared_ptr theStartPoint, + std::shared_ptr theEndPoint, + std::shared_ptr theFlyoutPoint, + std::shared_ptr thePlane, double theDistance) { double aFlyout = 0; if (theFlyoutPoint) { @@ -75,15 +75,15 @@ void GeomAPI_AISObject::createDistance(boost::shared_ptr theStartPo if (theStartPoint->distance(theEndPoint) < tolerance) aDist = theStartPoint->distance(theFlyoutPoint); else { - boost::shared_ptr aLine = boost::shared_ptr( + std::shared_ptr aLine = std::shared_ptr( new GeomAPI_Lin(theStartPoint, theEndPoint)); aDist = aLine->distance(theFlyoutPoint); } - boost::shared_ptr aLineDir = theEndPoint->xyz()->decreased(theStartPoint->xyz()); - boost::shared_ptr aFOutDir = theFlyoutPoint->xyz()->decreased( + std::shared_ptr aLineDir = theEndPoint->xyz()->decreased(theStartPoint->xyz()); + std::shared_ptr aFOutDir = theFlyoutPoint->xyz()->decreased( theStartPoint->xyz()); - boost::shared_ptr aNorm = thePlane->direction()->xyz(); + std::shared_ptr aNorm = thePlane->direction()->xyz(); if (aLineDir->cross(aFOutDir)->dot(aNorm) < 0) aDist = -aDist; aFlyout = aDist; @@ -122,11 +122,11 @@ void GeomAPI_AISObject::createDistance(boost::shared_ptr theStartPo } } -void GeomAPI_AISObject::createRadius(boost::shared_ptr theCircle, - boost::shared_ptr theFlyoutPoint, +void GeomAPI_AISObject::createRadius(std::shared_ptr theCircle, + std::shared_ptr theFlyoutPoint, double theRadius) { - boost::shared_ptr aCenter = theCircle->center(); + std::shared_ptr aCenter = theCircle->center(); // TODO: a bug in AIS_RadiusDimension: // The anchor point can't be myCirc.Location() - an exception is raised. @@ -134,10 +134,10 @@ void GeomAPI_AISObject::createRadius(boost::shared_ptr theCircle, // We want to show a radius dimension starting from the circle centre and // ending at the user-defined point. // Also, if anchor point coincides with myP2, the radius dimension is not displayed at all. - boost::shared_ptr anAnchor = theCircle->project(theFlyoutPoint); - boost::shared_ptr anAnchorXYZ = anAnchor->xyz(); + std::shared_ptr anAnchor = theCircle->project(theFlyoutPoint); + std::shared_ptr anAnchorXYZ = anAnchor->xyz(); anAnchorXYZ = anAnchorXYZ->decreased(aCenter->xyz()); - boost::shared_ptr aDeltaDir(new GeomAPI_Dir(anAnchorXYZ)); + std::shared_ptr aDeltaDir(new GeomAPI_Dir(anAnchorXYZ)); const double aDelta = 1e-3; anAnchor->setX(anAnchor->x() + aDelta * aDeltaDir->x()); anAnchor->setY(anAnchor->y() + aDelta * aDeltaDir->y()); @@ -171,10 +171,10 @@ void GeomAPI_AISObject::createRadius(boost::shared_ptr theCircle, } } -void GeomAPI_AISObject::createParallel(boost::shared_ptr theLine1, - boost::shared_ptr theLine2, - boost::shared_ptr theFlyoutPoint, - boost::shared_ptr thePlane) +void GeomAPI_AISObject::createParallel(std::shared_ptr theLine1, + std::shared_ptr theLine2, + std::shared_ptr theFlyoutPoint, + std::shared_ptr thePlane) { Handle(Geom_Plane) aPlane = new Geom_Plane(thePlane->impl()); Handle(AIS_InteractiveObject) anAIS = impl(); @@ -198,9 +198,9 @@ void GeomAPI_AISObject::createParallel(boost::shared_ptr theLine1 } } -void GeomAPI_AISObject::createPerpendicular(boost::shared_ptr theLine1, - boost::shared_ptr theLine2, - boost::shared_ptr thePlane) +void GeomAPI_AISObject::createPerpendicular(std::shared_ptr theLine1, + std::shared_ptr theLine2, + std::shared_ptr thePlane) { Handle(Geom_Plane) aPlane = new Geom_Plane(thePlane->impl()); Handle(AIS_InteractiveObject) anAIS = impl(); @@ -222,8 +222,8 @@ void GeomAPI_AISObject::createPerpendicular(boost::shared_ptr the } -void GeomAPI_AISObject::createFixed(boost::shared_ptr theShape, - boost::shared_ptr thePlane) +void GeomAPI_AISObject::createFixed(std::shared_ptr theShape, + std::shared_ptr thePlane) { Handle(Geom_Plane) aPlane = new Geom_Plane(thePlane->impl()); Handle(AIS_InteractiveObject) anAIS = impl(); diff --git a/src/GeomAPI/GeomAPI_AISObject.h b/src/GeomAPI/GeomAPI_AISObject.h index 0c8034d0d..97b4688e0 100644 --- a/src/GeomAPI/GeomAPI_AISObject.h +++ b/src/GeomAPI/GeomAPI_AISObject.h @@ -7,7 +7,7 @@ #include -#include +#include class GeomAPI_Circ; class GeomAPI_Lin; @@ -35,7 +35,7 @@ class GEOMAPI_EXPORT GeomAPI_AISObject : public GeomAPI_Interface GeomAPI_AISObject(); /// \brief Creates AIS_Shape object using specified shape - void createShape(boost::shared_ptr theShape); + void createShape(std::shared_ptr theShape); /** \brief Creates AIS_LengthDimension object * \param[in] theStartPoint first point for dimension @@ -44,18 +44,18 @@ class GEOMAPI_EXPORT GeomAPI_AISObject : public GeomAPI_Interface * \param[in] thePlane the plane which contains all points above * \param[in] theDistance value of the distance to be shown */ - void createDistance(boost::shared_ptr theStartPoint, - boost::shared_ptr theEndPoint, - boost::shared_ptr theFlyoutPoint, - boost::shared_ptr thePlane, double theDistance); + void createDistance(std::shared_ptr theStartPoint, + std::shared_ptr theEndPoint, + std::shared_ptr theFlyoutPoint, + std::shared_ptr thePlane, double theDistance); /** \brief Creates AIS_RadiusDimension object * \param[in] theCircle the radius is created for this circle * \param[in] theFlyoutPoint the flyout of dimension * \param[in] theRadius value of the radius to be shown */ - void createRadius(boost::shared_ptr theCircle, - boost::shared_ptr theFlyoutPoint, double theRadius); + void createRadius(std::shared_ptr theCircle, + std::shared_ptr theFlyoutPoint, double theRadius); /** \brief Creates AIS_ParallelRelation object for two lines * \param[in] theLine1 first parallel line @@ -63,26 +63,26 @@ class GEOMAPI_EXPORT GeomAPI_AISObject : public GeomAPI_Interface * \param[in] theFlyoutPoint the flyout point for relation * \param[in] thePlane the plane which contains the lines */ - void createParallel(boost::shared_ptr theLine1, - boost::shared_ptr theLine2, - boost::shared_ptr theFlyoutPoint, - boost::shared_ptr thePlane); + void createParallel(std::shared_ptr theLine1, + std::shared_ptr theLine2, + std::shared_ptr theFlyoutPoint, + std::shared_ptr thePlane); /** \brief Creates AIS_PerpendicularRelation object for two lines * \param[in] theLine1 first parallel line * \param[in] theLine2 second parallel line * \param[in] thePlane the plane which contains the lines */ - void createPerpendicular(boost::shared_ptr theLine1, - boost::shared_ptr theLine2, - boost::shared_ptr thePlane); + void createPerpendicular(std::shared_ptr theLine1, + std::shared_ptr theLine2, + std::shared_ptr thePlane); /** \brief Creates AIS_FixedRelation object for an object * \param[in] theShape the object * \param[in] thePlane the plane which contains the lines */ - void createFixed(boost::shared_ptr theShape, - boost::shared_ptr thePlane); + void createFixed(std::shared_ptr theShape, + std::shared_ptr thePlane); /** \brief Assigns the color for the shape * \param[in] theColor index of the color @@ -104,7 +104,7 @@ class GEOMAPI_EXPORT GeomAPI_AISObject : public GeomAPI_Interface }; //! Pointer on attribute object -typedef boost::shared_ptr AISObjectPtr; +typedef std::shared_ptr AISObjectPtr; #endif diff --git a/src/GeomAPI/GeomAPI_Circ.cpp b/src/GeomAPI/GeomAPI_Circ.cpp index 566824e06..e2b46853b 100644 --- a/src/GeomAPI/GeomAPI_Circ.cpp +++ b/src/GeomAPI/GeomAPI_Circ.cpp @@ -21,16 +21,16 @@ static gp_Circ* newCirc(const gp_Pnt& theCenter, const gp_Dir& theDir, const dou return new gp_Circ(gp_Ax2(theCenter, theDir), theRadius); } -GeomAPI_Circ::GeomAPI_Circ(const boost::shared_ptr& theCenter, - const boost::shared_ptr& theDir, double theRadius) +GeomAPI_Circ::GeomAPI_Circ(const std::shared_ptr& theCenter, + const std::shared_ptr& theDir, double theRadius) : GeomAPI_Interface(newCirc(theCenter->impl(), theDir->impl(), theRadius)) { } -const boost::shared_ptr GeomAPI_Circ::project( - const boost::shared_ptr& thePoint) const +const std::shared_ptr GeomAPI_Circ::project( + const std::shared_ptr& thePoint) const { - boost::shared_ptr aResult; + std::shared_ptr aResult; if (!MY_CIRC) return aResult; @@ -47,7 +47,7 @@ const boost::shared_ptr GeomAPI_Circ::project( aDistance = aNewPoint.Distance(aPoint); if (!aMinDistance || aDistance < aMinDistance) { aMinDistance = aDistance; - aResult = boost::shared_ptr( + aResult = std::shared_ptr( new GeomAPI_Pnt(aNewPoint.X(), aNewPoint.Y(), aNewPoint.Z())); } } @@ -55,10 +55,10 @@ const boost::shared_ptr GeomAPI_Circ::project( return aResult; } -const boost::shared_ptr GeomAPI_Circ::center() const +const std::shared_ptr GeomAPI_Circ::center() const { const gp_Pnt& aCenter = MY_CIRC->Location(); - return boost::shared_ptr(new GeomAPI_Pnt(aCenter.X(), aCenter.Y(), aCenter.Z())); + return std::shared_ptr(new GeomAPI_Pnt(aCenter.X(), aCenter.Y(), aCenter.Z())); } double GeomAPI_Circ::radius() const diff --git a/src/GeomAPI/GeomAPI_Circ.h b/src/GeomAPI/GeomAPI_Circ.h index 37f8bfaf2..8036faf56 100644 --- a/src/GeomAPI/GeomAPI_Circ.h +++ b/src/GeomAPI/GeomAPI_Circ.h @@ -6,7 +6,7 @@ #define GeomAPI_Circ_H_ #include -#include +#include class GeomAPI_Pnt; class GeomAPI_Dir; @@ -20,18 +20,18 @@ class GEOMAPI_EXPORT GeomAPI_Circ : public GeomAPI_Interface { public: /// Creation of circle defined by center point, direction and circle radius - GeomAPI_Circ(const boost::shared_ptr& theCenter, - const boost::shared_ptr& theDir, double theRadius); + GeomAPI_Circ(const std::shared_ptr& theCenter, + const std::shared_ptr& theDir, double theRadius); /// Return center of the circle - const boost::shared_ptr center() const; + const std::shared_ptr center() const; /// Return radius of the circle double radius() const; /// Project point on circle - const boost::shared_ptr project( - const boost::shared_ptr& thePoint) const; + const std::shared_ptr project( + const std::shared_ptr& thePoint) const; }; #endif diff --git a/src/GeomAPI/GeomAPI_Circ2d.cpp b/src/GeomAPI/GeomAPI_Circ2d.cpp index d5a67b8f8..0a7a9a01b 100644 --- a/src/GeomAPI/GeomAPI_Circ2d.cpp +++ b/src/GeomAPI/GeomAPI_Circ2d.cpp @@ -41,25 +41,25 @@ static gp_Circ2d* newCirc2d(const double theCenterX, const double theCenterY, return newCirc2d(theCenterX, theCenterY, aDir, aRadius); } -GeomAPI_Circ2d::GeomAPI_Circ2d(const boost::shared_ptr& theCenter, - const boost::shared_ptr& theCirclePoint) +GeomAPI_Circ2d::GeomAPI_Circ2d(const std::shared_ptr& theCenter, + const std::shared_ptr& theCirclePoint) : GeomAPI_Interface( newCirc2d(theCenter->x(), theCenter->y(), theCirclePoint->x(), theCirclePoint->y())) { } -GeomAPI_Circ2d::GeomAPI_Circ2d(const boost::shared_ptr& theCenter, - const boost::shared_ptr& theDir, double theRadius) +GeomAPI_Circ2d::GeomAPI_Circ2d(const std::shared_ptr& theCenter, + const std::shared_ptr& theDir, double theRadius) : GeomAPI_Interface( newCirc2d(theCenter->x(), theCenter->y(), theDir->impl(), theRadius)) { } -const boost::shared_ptr GeomAPI_Circ2d::project( - const boost::shared_ptr& thePoint) const +const std::shared_ptr GeomAPI_Circ2d::project( + const std::shared_ptr& thePoint) const { - boost::shared_ptr aResult; + std::shared_ptr aResult; if (!MY_CIRC2D) return aResult; @@ -72,22 +72,22 @@ const boost::shared_ptr GeomAPI_Circ2d::project( if (Abs(aDist - MY_CIRC2D->Radius()) < Precision::Confusion()) { // Point on the circle - aResult = boost::shared_ptr( + aResult = std::shared_ptr( new GeomAPI_Pnt2d(thePoint->x(), thePoint->y())); } else { gp_Dir2d aDir(aPoint.XY() - aCenter.XY()); gp_XY aNewPoint = aCenter.XY() + aDir.XY() * MY_CIRC2D->Radius(); - aResult = boost::shared_ptr( + aResult = std::shared_ptr( new GeomAPI_Pnt2d(aNewPoint.X(), aNewPoint.Y())); } return aResult; } -const boost::shared_ptr GeomAPI_Circ2d::center() const +const std::shared_ptr GeomAPI_Circ2d::center() const { const gp_Pnt2d& aCenter = MY_CIRC2D->Location(); - return boost::shared_ptr(new GeomAPI_Pnt2d(aCenter.X(), aCenter.Y())); + return std::shared_ptr(new GeomAPI_Pnt2d(aCenter.X(), aCenter.Y())); } double GeomAPI_Circ2d::radius() const diff --git a/src/GeomAPI/GeomAPI_Circ2d.h b/src/GeomAPI/GeomAPI_Circ2d.h index 58a292c16..6a2627baf 100644 --- a/src/GeomAPI/GeomAPI_Circ2d.h +++ b/src/GeomAPI/GeomAPI_Circ2d.h @@ -6,7 +6,7 @@ #define GeomAPI_Circ2d_H_ #include -#include +#include class GeomAPI_Pnt2d; class GeomAPI_Dir2d; @@ -20,22 +20,22 @@ class GEOMAPI_EXPORT GeomAPI_Circ2d : public GeomAPI_Interface { public: /// Creation of circle defined by center point and circle radius - GeomAPI_Circ2d(const boost::shared_ptr& theCenter, - const boost::shared_ptr& theCirclePoint); + GeomAPI_Circ2d(const std::shared_ptr& theCenter, + const std::shared_ptr& theCirclePoint); /// Creation of circle defined by center point, direction and circle radius - GeomAPI_Circ2d(const boost::shared_ptr& theCenter, - const boost::shared_ptr& theDir, double theRadius); + GeomAPI_Circ2d(const std::shared_ptr& theCenter, + const std::shared_ptr& theDir, double theRadius); /// Return center of the circle - const boost::shared_ptr center() const; + const std::shared_ptr center() const; /// Return radius of the circle double radius() const; /// Project point on line - const boost::shared_ptr project( - const boost::shared_ptr& thePoint) const; + const std::shared_ptr project( + const std::shared_ptr& thePoint) const; }; #endif diff --git a/src/GeomAPI/GeomAPI_Curve.cpp b/src/GeomAPI/GeomAPI_Curve.cpp index 53a845810..d6a7280c6 100644 --- a/src/GeomAPI/GeomAPI_Curve.cpp +++ b/src/GeomAPI/GeomAPI_Curve.cpp @@ -19,7 +19,7 @@ GeomAPI_Curve::GeomAPI_Curve() { } -GeomAPI_Curve::GeomAPI_Curve(const boost::shared_ptr& theShape) +GeomAPI_Curve::GeomAPI_Curve(const std::shared_ptr& theShape) : GeomAPI_Interface(new Handle_Geom_Curve()) // initially it is null { const TopoDS_Shape& aShape = theShape->impl(); diff --git a/src/GeomAPI/GeomAPI_Curve.h b/src/GeomAPI/GeomAPI_Curve.h index e4f494875..f09f1d375 100644 --- a/src/GeomAPI/GeomAPI_Curve.h +++ b/src/GeomAPI/GeomAPI_Curve.h @@ -6,7 +6,7 @@ #define GeomAPI_Curve_H_ #include -#include +#include /**\class GeomAPI_Curve * \ingroup DataModel @@ -20,7 +20,7 @@ class GEOMAPI_EXPORT GeomAPI_Curve : public GeomAPI_Interface GeomAPI_Curve(); /// Creates a curve from the shape (edge) - GeomAPI_Curve(const boost::shared_ptr& theShape); + GeomAPI_Curve(const std::shared_ptr& theShape); /// Returns true if curve is not initialized bool isNull() const; diff --git a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp index 56002d3a5..c20e9fd89 100644 --- a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp +++ b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.cpp @@ -19,7 +19,7 @@ void GeomAPI_DataMapOfShapeShape::clear() } /// Adds the Key to the Map with the Item. Returns True if the Key was not already in the map -bool GeomAPI_DataMapOfShapeShape::bind (boost::shared_ptr theKey, boost::shared_ptr theItem) +bool GeomAPI_DataMapOfShapeShape::bind (std::shared_ptr theKey, std::shared_ptr theItem) { bool flag(false); if(implPtr()->Bind(theKey->impl(), theItem->impl())) @@ -28,7 +28,7 @@ bool GeomAPI_DataMapOfShapeShape::bind (boost::shared_ptr theKey, } /// Returns true if theKey is stored in the map. -bool GeomAPI_DataMapOfShapeShape::isBound (boost::shared_ptr theKey) +bool GeomAPI_DataMapOfShapeShape::isBound (std::shared_ptr theKey) { bool flag(false); if(impl().IsBound(theKey->impl())) @@ -37,15 +37,15 @@ bool GeomAPI_DataMapOfShapeShape::isBound (boost::shared_ptr theK } /// Returns the Item stored with the Key in the Map. To be checked before with isBound() -const boost::shared_ptr GeomAPI_DataMapOfShapeShape::find(boost::shared_ptr theKey) +const std::shared_ptr GeomAPI_DataMapOfShapeShape::find(std::shared_ptr theKey) { - boost::shared_ptr aShape(new GeomAPI_Shape()); + std::shared_ptr aShape(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(impl().Find(theKey->impl()))); return aShape; } /// Removes the Key from the map. Returns true if the Key was in the Map -bool GeomAPI_DataMapOfShapeShape::unBind(boost::shared_ptr theKey) +bool GeomAPI_DataMapOfShapeShape::unBind(std::shared_ptr theKey) { bool flag(false); if(implPtr()->UnBind(theKey->impl())) diff --git a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h index 20b63903a..94a35b780 100644 --- a/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h +++ b/src/GeomAPI/GeomAPI_DataMapOfShapeShape.h @@ -5,7 +5,7 @@ #ifndef GeomAPI_DataMapOfShapeShape_H_ #define GeomAPI_DataMapOfShapeShape_H_ -#include +#include #include class GeomAPI_Pnt; @@ -26,16 +26,16 @@ class GEOMAPI_EXPORT GeomAPI_DataMapOfShapeShape : public GeomAPI_Interface void clear(); /// Adds the Key to the Map with the Item. Returns True if the Key was not already in the map - bool bind (boost::shared_ptr theKey, boost::shared_ptr theItem); + bool bind (std::shared_ptr theKey, std::shared_ptr theItem); /// Returns true if theKey is stored in the map. - bool isBound (boost::shared_ptr theKey); + bool isBound (std::shared_ptr theKey); /// Returns the Item stored with the Key in the Map. - const boost::shared_ptr find(boost::shared_ptr theKey); + const std::shared_ptr find(std::shared_ptr theKey); /// Removes the Key from the map. Returns true if the Key was in the Map - bool unBind(boost::shared_ptr theKey); + bool unBind(std::shared_ptr theKey); /// Destructor ~GeomAPI_DataMapOfShapeShape(); diff --git a/src/GeomAPI/GeomAPI_Dir.cpp b/src/GeomAPI/GeomAPI_Dir.cpp index c1b88a78d..c81efd26e 100644 --- a/src/GeomAPI/GeomAPI_Dir.cpp +++ b/src/GeomAPI/GeomAPI_Dir.cpp @@ -14,7 +14,7 @@ GeomAPI_Dir::GeomAPI_Dir(const double theX, const double theY, const double theZ { } -GeomAPI_Dir::GeomAPI_Dir(const boost::shared_ptr& theCoords) +GeomAPI_Dir::GeomAPI_Dir(const std::shared_ptr& theCoords) : GeomAPI_Interface(new gp_Dir(theCoords->x(), theCoords->y(), theCoords->z())) { } @@ -34,20 +34,20 @@ double GeomAPI_Dir::z() const return MY_DIR->Z(); } -const boost::shared_ptr GeomAPI_Dir::xyz() +const std::shared_ptr GeomAPI_Dir::xyz() { - return boost::shared_ptr(new GeomAPI_XYZ(MY_DIR->X(), MY_DIR->Y(), MY_DIR->Z())); + return std::shared_ptr(new GeomAPI_XYZ(MY_DIR->X(), MY_DIR->Y(), MY_DIR->Z())); } -double GeomAPI_Dir::dot(const boost::shared_ptr& theArg) const +double GeomAPI_Dir::dot(const std::shared_ptr& theArg) const { return MY_DIR->Dot(theArg->impl()); } -const boost::shared_ptr GeomAPI_Dir::cross( - const boost::shared_ptr& theArg) const +const std::shared_ptr GeomAPI_Dir::cross( + const std::shared_ptr& theArg) const { gp_XYZ aResult = MY_DIR->XYZ().Crossed(theArg->impl().XYZ()); - return boost::shared_ptr(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z())); + return std::shared_ptr(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z())); } diff --git a/src/GeomAPI/GeomAPI_Dir.h b/src/GeomAPI/GeomAPI_Dir.h index 3d666af67..12f3b0b3f 100644 --- a/src/GeomAPI/GeomAPI_Dir.h +++ b/src/GeomAPI/GeomAPI_Dir.h @@ -6,7 +6,7 @@ #define GeomAPI_Dir_H_ #include -#include +#include class GeomAPI_XYZ; @@ -21,7 +21,7 @@ class GEOMAPI_EXPORT GeomAPI_Dir : public GeomAPI_Interface /// Creation of direction by coordinates GeomAPI_Dir(const double theX, const double theY, const double theZ); /// Creation of direction by coordinates - GeomAPI_Dir(const boost::shared_ptr& theCoords); + GeomAPI_Dir(const std::shared_ptr& theCoords); /// returns X coordinate double x() const; @@ -31,12 +31,12 @@ class GEOMAPI_EXPORT GeomAPI_Dir : public GeomAPI_Interface double z() const; /// returns coordinates of the direction - const boost::shared_ptr xyz(); + const std::shared_ptr xyz(); /// result is a scalar product of directions - double dot(const boost::shared_ptr& theArg) const; + double dot(const std::shared_ptr& theArg) const; /// result is a cross product of two directions - const boost::shared_ptr cross(const boost::shared_ptr& theArg) const; + const std::shared_ptr cross(const std::shared_ptr& theArg) const; }; #endif diff --git a/src/GeomAPI/GeomAPI_Dir2d.cpp b/src/GeomAPI/GeomAPI_Dir2d.cpp index e3089d8b9..b7dcfc960 100644 --- a/src/GeomAPI/GeomAPI_Dir2d.cpp +++ b/src/GeomAPI/GeomAPI_Dir2d.cpp @@ -14,7 +14,7 @@ GeomAPI_Dir2d::GeomAPI_Dir2d(const double theX, const double theY) { } -GeomAPI_Dir2d::GeomAPI_Dir2d(const boost::shared_ptr& theCoords) +GeomAPI_Dir2d::GeomAPI_Dir2d(const std::shared_ptr& theCoords) : GeomAPI_Interface(new gp_Dir2d(theCoords->x(), theCoords->y())) { } @@ -29,17 +29,17 @@ double GeomAPI_Dir2d::y() const return MY_DIR->Y(); } -const boost::shared_ptr GeomAPI_Dir2d::xy() +const std::shared_ptr GeomAPI_Dir2d::xy() { - return boost::shared_ptr(new GeomAPI_XY(MY_DIR->X(), MY_DIR->Y())); + return std::shared_ptr(new GeomAPI_XY(MY_DIR->X(), MY_DIR->Y())); } -double GeomAPI_Dir2d::dot(const boost::shared_ptr& theArg) const +double GeomAPI_Dir2d::dot(const std::shared_ptr& theArg) const { return MY_DIR->Dot(theArg->impl()); } -double GeomAPI_Dir2d::cross(const boost::shared_ptr& theArg) const +double GeomAPI_Dir2d::cross(const std::shared_ptr& theArg) const { return MY_DIR->XY().Crossed(theArg->impl().XY()); } diff --git a/src/GeomAPI/GeomAPI_Dir2d.h b/src/GeomAPI/GeomAPI_Dir2d.h index 906e1af0f..3453f1247 100644 --- a/src/GeomAPI/GeomAPI_Dir2d.h +++ b/src/GeomAPI/GeomAPI_Dir2d.h @@ -6,7 +6,7 @@ #define GeomAPI_Dir2d_H_ #include -#include +#include class GeomAPI_XY; @@ -21,7 +21,7 @@ class GEOMAPI_EXPORT GeomAPI_Dir2d : public GeomAPI_Interface /// Creation of direction by coordinates GeomAPI_Dir2d(const double theX, const double theY); /// Creation of direction by coordinates - GeomAPI_Dir2d(const boost::shared_ptr& theCoords); + GeomAPI_Dir2d(const std::shared_ptr& theCoords); /// returns X coordinate double x() const; @@ -29,12 +29,12 @@ class GEOMAPI_EXPORT GeomAPI_Dir2d : public GeomAPI_Interface double y() const; /// returns coordinates of the direction - const boost::shared_ptr xy(); + const std::shared_ptr xy(); /// result is a scalar product of directions - double dot(const boost::shared_ptr& theArg) const; + double dot(const std::shared_ptr& theArg) const; /// result is a cross product of two directions - double cross(const boost::shared_ptr& theArg) const; + double cross(const std::shared_ptr& theArg) const; }; #endif diff --git a/src/GeomAPI/GeomAPI_Edge.cpp b/src/GeomAPI/GeomAPI_Edge.cpp index 5c61a94a1..5e455f9f3 100644 --- a/src/GeomAPI/GeomAPI_Edge.cpp +++ b/src/GeomAPI/GeomAPI_Edge.cpp @@ -22,7 +22,7 @@ GeomAPI_Edge::GeomAPI_Edge() { } -GeomAPI_Edge::GeomAPI_Edge(const boost::shared_ptr& theShape) +GeomAPI_Edge::GeomAPI_Edge(const std::shared_ptr& theShape) { if (!theShape->isNull() && theShape->isEdge()) { setImpl(new TopoDS_Shape(theShape->impl())); @@ -59,27 +59,27 @@ bool GeomAPI_Edge::isArc() const return false; } -boost::shared_ptr GeomAPI_Edge::firstPoint() +std::shared_ptr GeomAPI_Edge::firstPoint() { const TopoDS_Shape& aShape = const_cast(this)->impl(); double aFirst, aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast); gp_Pnt aPoint; aCurve->D0(aFirst, aPoint); - return boost::shared_ptr(new GeomAPI_Pnt(aPoint.X(), aPoint.Y(), aPoint.Z())); + return std::shared_ptr(new GeomAPI_Pnt(aPoint.X(), aPoint.Y(), aPoint.Z())); } -boost::shared_ptr GeomAPI_Edge::lastPoint() +std::shared_ptr GeomAPI_Edge::lastPoint() { const TopoDS_Shape& aShape = const_cast(this)->impl(); double aFirst, aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve((const TopoDS_Edge&)aShape, aFirst, aLast); gp_Pnt aPoint; aCurve->D0(aLast, aPoint); - return boost::shared_ptr(new GeomAPI_Pnt(aPoint.X(), aPoint.Y(), aPoint.Z())); + return std::shared_ptr(new GeomAPI_Pnt(aPoint.X(), aPoint.Y(), aPoint.Z())); } -boost::shared_ptr GeomAPI_Edge::circle() +std::shared_ptr GeomAPI_Edge::circle() { const TopoDS_Shape& aShape = const_cast(this)->impl(); double aFirst, aLast; @@ -88,17 +88,17 @@ boost::shared_ptr GeomAPI_Edge::circle() Handle(Geom_Circle) aCirc = Handle(Geom_Circle)::DownCast(aCurve); if (aCirc) { gp_Pnt aLoc = aCirc->Location(); - boost::shared_ptr aCenter(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z())); + std::shared_ptr aCenter(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z())); gp_Dir anAxis = aCirc->Axis().Direction(); - boost::shared_ptr aDir(new GeomAPI_Dir(anAxis.X(), anAxis.Y(), anAxis.Z())); - return boost::shared_ptr(new GeomAPI_Circ(aCenter, aDir, aCirc->Radius())); + std::shared_ptr aDir(new GeomAPI_Dir(anAxis.X(), anAxis.Y(), anAxis.Z())); + return std::shared_ptr(new GeomAPI_Circ(aCenter, aDir, aCirc->Radius())); } } - return boost::shared_ptr(); // not circle + return std::shared_ptr(); // not circle } -bool GeomAPI_Edge::isEqual(boost::shared_ptr theEdge) +bool GeomAPI_Edge::isEqual(std::shared_ptr theEdge) { const TopoDS_Shape& aMyShape = const_cast(this)->impl(); const TopoDS_Shape& aInShape = theEdge->impl(); diff --git a/src/GeomAPI/GeomAPI_Edge.h b/src/GeomAPI/GeomAPI_Edge.h index ea4be9ef6..1ecf75078 100644 --- a/src/GeomAPI/GeomAPI_Edge.h +++ b/src/GeomAPI/GeomAPI_Edge.h @@ -22,7 +22,7 @@ public: GeomAPI_Edge(); /// Creation of edge by the edge-shape - GeomAPI_Edge(const boost::shared_ptr& theShape); + GeomAPI_Edge(const std::shared_ptr& theShape); /// Verifies that the edge is a line bool isLine() const; @@ -34,16 +34,16 @@ public: bool isArc() const; /// Returns the first vertex coordinates of the edge - boost::shared_ptr firstPoint(); + std::shared_ptr firstPoint(); /// Returns the Last vertex coordinates of the edge - boost::shared_ptr lastPoint(); + std::shared_ptr lastPoint(); /// Returns a circle if edge is based on the cirsle curve - boost::shared_ptr circle(); + std::shared_ptr circle(); /// Returns true if the current edge is geometrically equal to the given edge - bool isEqual(boost::shared_ptr theEdge); + bool isEqual(std::shared_ptr theEdge); }; #endif diff --git a/src/GeomAPI/GeomAPI_IPresentable.h b/src/GeomAPI/GeomAPI_IPresentable.h index 34868048a..8f9a6d8d3 100644 --- a/src/GeomAPI/GeomAPI_IPresentable.h +++ b/src/GeomAPI/GeomAPI_IPresentable.h @@ -19,6 +19,6 @@ class GeomAPI_IPresentable virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious) = 0; }; -typedef boost::shared_ptr GeomPresentablePtr; +typedef std::shared_ptr GeomPresentablePtr; #endif diff --git a/src/GeomAPI/GeomAPI_Lin.cpp b/src/GeomAPI/GeomAPI_Lin.cpp index 58095f0e8..770d7175f 100644 --- a/src/GeomAPI/GeomAPI_Lin.cpp +++ b/src/GeomAPI/GeomAPI_Lin.cpp @@ -33,23 +33,23 @@ GeomAPI_Lin::GeomAPI_Lin(const double theStartX, const double theStartY, const d { } -GeomAPI_Lin::GeomAPI_Lin(const boost::shared_ptr& theStart, - const boost::shared_ptr& theEnd) +GeomAPI_Lin::GeomAPI_Lin(const std::shared_ptr& theStart, + const std::shared_ptr& theEnd) : GeomAPI_Interface( newLine(theStart->x(), theStart->y(), theStart->z(), theEnd->x(), theEnd->y(), theEnd->z())) { } -double GeomAPI_Lin::distance(const boost::shared_ptr& thePoint) const +double GeomAPI_Lin::distance(const std::shared_ptr& thePoint) const { return MY_LIN->Distance(thePoint->impl()); } -const boost::shared_ptr GeomAPI_Lin::intersect( - const boost::shared_ptr& theLine) const +const std::shared_ptr GeomAPI_Lin::intersect( + const std::shared_ptr& theLine) const { if (MY_LIN->SquareDistance(theLine->impl()) > Precision::Confusion()) - return boost::shared_ptr(); + return std::shared_ptr(); const gp_Dir& aDir1 = MY_LIN->Direction(); const gp_Dir& aDir2 = theLine->impl().Direction(); @@ -61,16 +61,16 @@ const boost::shared_ptr GeomAPI_Lin::intersect( IntAna2d_AnaIntersection anInter(aPrjLine1, aPrjLine1); if (!anInter.IsDone() || anInter.IsEmpty()) - return boost::shared_ptr(); + return std::shared_ptr(); const gp_Pnt2d& anIntPnt2d = anInter.Point(0).Value(); gp_Pnt aResult = ElSLib::Value(anIntPnt2d.X(), anIntPnt2d.Y(), aPlane); - return boost::shared_ptr( + return std::shared_ptr( new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z())); } -const boost::shared_ptr GeomAPI_Lin::project( - const boost::shared_ptr& thePoint) const +const std::shared_ptr GeomAPI_Lin::project( + const std::shared_ptr& thePoint) const { const gp_XYZ& aDir = MY_LIN->Direction().XYZ(); const gp_XYZ& aLoc = MY_LIN->Location().XYZ(); @@ -78,6 +78,6 @@ const boost::shared_ptr GeomAPI_Lin::project( double aParam = aDir.Dot(aPnt - aLoc); gp_XYZ aResult = aPnt + aDir * aParam; - return boost::shared_ptr(new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z())); + return std::shared_ptr(new GeomAPI_Pnt(aResult.X(), aResult.Y(), aResult.Z())); } diff --git a/src/GeomAPI/GeomAPI_Lin.h b/src/GeomAPI/GeomAPI_Lin.h index 69d1ba48a..b6b3cca5a 100644 --- a/src/GeomAPI/GeomAPI_Lin.h +++ b/src/GeomAPI/GeomAPI_Lin.h @@ -6,7 +6,7 @@ #define GeomAPI_Lin_H_ #include -#include +#include class GeomAPI_Pnt; @@ -22,17 +22,17 @@ class GEOMAPI_EXPORT GeomAPI_Lin : public GeomAPI_Interface GeomAPI_Lin(const double theStartX, const double theStartY, const double theStartZ, const double theEndX, const double theEndY, const double theEndZ); /// Creation of line defined by start and end points - GeomAPI_Lin(const boost::shared_ptr& theStart, - const boost::shared_ptr& theEnd); + GeomAPI_Lin(const std::shared_ptr& theStart, + const std::shared_ptr& theEnd); /// Distance between two points - double distance(const boost::shared_ptr& thePoint) const; + double distance(const std::shared_ptr& thePoint) const; /// Intersection of two lines - const boost::shared_ptr intersect( - const boost::shared_ptr& theLine) const; + const std::shared_ptr intersect( + const std::shared_ptr& theLine) const; /// Project point on line - const boost::shared_ptr project( - const boost::shared_ptr& thePoint) const; + const std::shared_ptr project( + const std::shared_ptr& thePoint) const; }; #endif diff --git a/src/GeomAPI/GeomAPI_Lin2d.cpp b/src/GeomAPI/GeomAPI_Lin2d.cpp index 929cff9f8..a59c5b4ea 100644 --- a/src/GeomAPI/GeomAPI_Lin2d.cpp +++ b/src/GeomAPI/GeomAPI_Lin2d.cpp @@ -28,29 +28,29 @@ GeomAPI_Lin2d::GeomAPI_Lin2d(const double theStartX, const double theStartY, con { } -GeomAPI_Lin2d::GeomAPI_Lin2d(const boost::shared_ptr& theStart, - const boost::shared_ptr& theEnd) +GeomAPI_Lin2d::GeomAPI_Lin2d(const std::shared_ptr& theStart, + const std::shared_ptr& theEnd) : GeomAPI_Interface(newLine2d(theStart->x(), theStart->y(), theEnd->x(), theEnd->y())) { } -double GeomAPI_Lin2d::distance(const boost::shared_ptr& theOther) const +double GeomAPI_Lin2d::distance(const std::shared_ptr& theOther) const { return MY_LIN2D->Distance(theOther->impl()); } -const boost::shared_ptr GeomAPI_Lin2d::intersect( - const boost::shared_ptr& theLine) const +const std::shared_ptr GeomAPI_Lin2d::intersect( + const std::shared_ptr& theLine) const { IntAna2d_AnaIntersection anInter(*MY_LIN2D, theLine->impl()); if (!anInter.IsDone() || anInter.IsEmpty()) - return boost::shared_ptr(); + return std::shared_ptr(); const gp_Pnt2d& aResult = anInter.Point(1).Value(); - return boost::shared_ptr(new GeomAPI_Pnt2d(aResult.X(), aResult.Y())); + return std::shared_ptr(new GeomAPI_Pnt2d(aResult.X(), aResult.Y())); } -const boost::shared_ptr GeomAPI_Lin2d::project( - const boost::shared_ptr& thePoint) const +const std::shared_ptr GeomAPI_Lin2d::project( + const std::shared_ptr& thePoint) const { const gp_XY& aDir = MY_LIN2D->Direction().XY(); const gp_XY& aLoc = MY_LIN2D->Location().XY(); @@ -58,10 +58,10 @@ const boost::shared_ptr GeomAPI_Lin2d::project( double aParam = aDir.Dot(aPnt - aLoc); gp_XY aResult = aLoc + aDir * aParam; - return boost::shared_ptr(new GeomAPI_Pnt2d(aResult.X(), aResult.Y())); + return std::shared_ptr(new GeomAPI_Pnt2d(aResult.X(), aResult.Y())); } -bool GeomAPI_Lin2d::isRight(const boost::shared_ptr& thePoint) const +bool GeomAPI_Lin2d::isRight(const std::shared_ptr& thePoint) const { const gp_XY& aDir = MY_LIN2D->Direction().XY(); const gp_XY& aLoc = MY_LIN2D->Location().XY(); @@ -71,7 +71,7 @@ bool GeomAPI_Lin2d::isRight(const boost::shared_ptr& thePoint) co } -boost::shared_ptr GeomAPI_Lin2d::shiftedLocation(double theShift) const +std::shared_ptr GeomAPI_Lin2d::shiftedLocation(double theShift) const { gp_Vec2d aVec = MY_LIN2D->Direction(); aVec = aVec.GetNormal(); @@ -79,5 +79,5 @@ boost::shared_ptr GeomAPI_Lin2d::shiftedLocation(double theShift) aVec.Reverse(); aVec.Scale(theShift); gp_Lin2d aLin = MY_LIN2D->Translated(aVec); - return boost::shared_ptr(new GeomAPI_Pnt2d(aLin.Location().X(), aLin.Location().Y())); + return std::shared_ptr(new GeomAPI_Pnt2d(aLin.Location().X(), aLin.Location().Y())); } diff --git a/src/GeomAPI/GeomAPI_Lin2d.h b/src/GeomAPI/GeomAPI_Lin2d.h index 10089d67a..50a8fbfb1 100644 --- a/src/GeomAPI/GeomAPI_Lin2d.h +++ b/src/GeomAPI/GeomAPI_Lin2d.h @@ -6,7 +6,7 @@ #define GeomAPI_Lin2d_H_ #include -#include +#include class GeomAPI_Pnt2d; @@ -22,22 +22,22 @@ class GEOMAPI_EXPORT GeomAPI_Lin2d : public GeomAPI_Interface GeomAPI_Lin2d(const double theStartX, const double theStartY, const double theEndX, const double theEndY); /// Creation of line defined by start and end points - GeomAPI_Lin2d(const boost::shared_ptr& theStart, - const boost::shared_ptr& theEnd); + GeomAPI_Lin2d(const std::shared_ptr& theStart, + const std::shared_ptr& theEnd); /// Distance between two points - double distance(const boost::shared_ptr& theOther) const; + double distance(const std::shared_ptr& theOther) const; /// Intersection of two lines - const boost::shared_ptr intersect( - const boost::shared_ptr& theLine) const; + const std::shared_ptr intersect( + const std::shared_ptr& theLine) const; /// Project point on line - const boost::shared_ptr project( - const boost::shared_ptr& thePoint) const; + const std::shared_ptr project( + const std::shared_ptr& thePoint) const; /// Computes the cross product of the line direction and a vector from the line start point to the point - bool isRight(const boost::shared_ptr& thePoint) const; + bool isRight(const std::shared_ptr& thePoint) const; /// Returns a location point shifted on theShift in perpendicular direction - boost::shared_ptr shiftedLocation(double theShift) const; + std::shared_ptr shiftedLocation(double theShift) const; }; #endif diff --git a/src/GeomAPI/GeomAPI_PlanarEdges.cpp b/src/GeomAPI/GeomAPI_PlanarEdges.cpp index f12d62204..fc09a74b3 100644 --- a/src/GeomAPI/GeomAPI_PlanarEdges.cpp +++ b/src/GeomAPI/GeomAPI_PlanarEdges.cpp @@ -25,7 +25,7 @@ GeomAPI_PlanarEdges::GeomAPI_PlanarEdges() : GeomAPI_Shape() this->setImpl(new TopoDS_Shape(aBigWireImpl)); } -void GeomAPI_PlanarEdges::addEdge(boost::shared_ptr theEdge) +void GeomAPI_PlanarEdges::addEdge(std::shared_ptr theEdge) { const TopoDS_Edge& anEdge = theEdge->impl(); if (anEdge.ShapeType() != TopAbs_EDGE) @@ -35,14 +35,14 @@ void GeomAPI_PlanarEdges::addEdge(boost::shared_ptr theEdge) aBuilder.Add(aWire, anEdge); } -std::list > GeomAPI_PlanarEdges::getEdges() +std::list > GeomAPI_PlanarEdges::getEdges() { TopoDS_Shape& aShape = const_cast(impl()); //BRepTools_WireExplorer aWireExp(TopoDS::Wire(aShape)); TopExp_Explorer aWireExp(aShape, TopAbs_EDGE); - std::list > aResult; + std::list > aResult; for (; aWireExp.More(); aWireExp.Next()) { - boost::shared_ptr anEdge(new GeomAPI_Shape); + std::shared_ptr anEdge(new GeomAPI_Shape); anEdge->setImpl(new TopoDS_Shape(aWireExp.Current())); aResult.push_back(anEdge); } diff --git a/src/GeomAPI/GeomAPI_PlanarEdges.h b/src/GeomAPI/GeomAPI_PlanarEdges.h index af8422619..1521d5add 100644 --- a/src/GeomAPI/GeomAPI_PlanarEdges.h +++ b/src/GeomAPI/GeomAPI_PlanarEdges.h @@ -10,7 +10,7 @@ #include "GeomAPI_Pnt.h" #include "GeomAPI_Dir.h" -#include +#include #include @@ -36,34 +36,34 @@ class GeomAPI_PlanarEdges : public GeomAPI_Shape return false; } - GEOMAPI_EXPORT void addEdge(boost::shared_ptr theEdge); - GEOMAPI_EXPORT std::list > getEdges(); + GEOMAPI_EXPORT void addEdge(std::shared_ptr theEdge); + GEOMAPI_EXPORT std::list > getEdges(); /// Returns True if the wire is defined in a plane GEOMAPI_EXPORT bool hasPlane() const { return myOrigin && myNorm && myDirX && myDirY; } /// Set/Get origin point - GEOMAPI_EXPORT void setOrigin(const boost::shared_ptr& theOrigin) + GEOMAPI_EXPORT void setOrigin(const std::shared_ptr& theOrigin) { myOrigin = theOrigin; } - GEOMAPI_EXPORT boost::shared_ptr origin() const { return myOrigin; } + GEOMAPI_EXPORT std::shared_ptr origin() const { return myOrigin; } /// Set/Get X direction vector - GEOMAPI_EXPORT void setDirX(const boost::shared_ptr& theDirX) { myDirX = theDirX; } - GEOMAPI_EXPORT boost::shared_ptr dirX() const { return myDirX; } + GEOMAPI_EXPORT void setDirX(const std::shared_ptr& theDirX) { myDirX = theDirX; } + GEOMAPI_EXPORT std::shared_ptr dirX() const { return myDirX; } /// Set/Get Y direction vector - GEOMAPI_EXPORT void setDirY(const boost::shared_ptr& theDirY) { myDirY = theDirY; } - GEOMAPI_EXPORT boost::shared_ptr dirY() const { return myDirY; } + GEOMAPI_EXPORT void setDirY(const std::shared_ptr& theDirY) { myDirY = theDirY; } + GEOMAPI_EXPORT std::shared_ptr dirY() const { return myDirY; } /// Set/Get Normal direction vector - GEOMAPI_EXPORT void setNorm(const boost::shared_ptr& theNorm) { myNorm = theNorm; } - GEOMAPI_EXPORT boost::shared_ptr norm() const { return myNorm; } + GEOMAPI_EXPORT void setNorm(const std::shared_ptr& theNorm) { myNorm = theNorm; } + GEOMAPI_EXPORT std::shared_ptr norm() const { return myNorm; } private: - boost::shared_ptr myOrigin; - boost::shared_ptr myDirX; - boost::shared_ptr myDirY; - boost::shared_ptr myNorm; + std::shared_ptr myOrigin; + std::shared_ptr myDirX; + std::shared_ptr myDirY; + std::shared_ptr myNorm; }; #endif diff --git a/src/GeomAPI/GeomAPI_Pln.cpp b/src/GeomAPI/GeomAPI_Pln.cpp index 2f4e0cec4..cee055008 100644 --- a/src/GeomAPI/GeomAPI_Pln.cpp +++ b/src/GeomAPI/GeomAPI_Pln.cpp @@ -10,8 +10,8 @@ using namespace std; -GeomAPI_Pln::GeomAPI_Pln(const boost::shared_ptr& thePoint, - const boost::shared_ptr& theNormal) +GeomAPI_Pln::GeomAPI_Pln(const std::shared_ptr& thePoint, + const std::shared_ptr& theNormal) : GeomAPI_Interface(new gp_Pln(thePoint->impl(), theNormal->impl())) { } @@ -21,16 +21,16 @@ GeomAPI_Pln::GeomAPI_Pln(const double theA, const double theB, const double theC { } -boost::shared_ptr GeomAPI_Pln::location() +std::shared_ptr GeomAPI_Pln::location() { gp_Pnt aLoc = impl().Location(); - return boost::shared_ptr(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z())); + return std::shared_ptr(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z())); } -boost::shared_ptr GeomAPI_Pln::direction() +std::shared_ptr GeomAPI_Pln::direction() { const gp_Dir& aDir = impl().Axis().Direction(); - return boost::shared_ptr(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z())); + return std::shared_ptr(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z())); } void GeomAPI_Pln::coefficients(double& theA, double& theB, double& theC, double& theD) diff --git a/src/GeomAPI/GeomAPI_Pln.h b/src/GeomAPI/GeomAPI_Pln.h index 5471a34ad..c1a99f6ef 100644 --- a/src/GeomAPI/GeomAPI_Pln.h +++ b/src/GeomAPI/GeomAPI_Pln.h @@ -5,7 +5,7 @@ #ifndef GeomAPI_Pln_H_ #define GeomAPI_Pln_H_ -#include +#include #include class GeomAPI_Pnt; @@ -20,17 +20,17 @@ class GEOMAPI_EXPORT GeomAPI_Pln : public GeomAPI_Interface { public: /// Creation of plane by the point and normal - GeomAPI_Pln(const boost::shared_ptr& thePoint, - const boost::shared_ptr& theNormal); + GeomAPI_Pln(const std::shared_ptr& thePoint, + const std::shared_ptr& theNormal); /// Creation of plane by coefficients (Ax+By+Cz+D=0) GeomAPI_Pln(const double theA, const double theB, const double theC, const double theD); /// Returns a point of this plane - boost::shared_ptr location(); + std::shared_ptr location(); /// Returns a plane normal - boost::shared_ptr direction(); + std::shared_ptr direction(); /// Returns the plane coefficients (Ax+By+Cz+D=0) void coefficients(double& theA, double& theB, double& theC, double& theD); diff --git a/src/GeomAPI/GeomAPI_Pnt.cpp b/src/GeomAPI/GeomAPI_Pnt.cpp index aae0d1b8b..ef7b58001 100644 --- a/src/GeomAPI/GeomAPI_Pnt.cpp +++ b/src/GeomAPI/GeomAPI_Pnt.cpp @@ -16,7 +16,7 @@ GeomAPI_Pnt::GeomAPI_Pnt(const double theX, const double theY, const double theZ { } -GeomAPI_Pnt::GeomAPI_Pnt(const boost::shared_ptr& theCoords) +GeomAPI_Pnt::GeomAPI_Pnt(const std::shared_ptr& theCoords) : GeomAPI_Interface(new gp_Pnt(theCoords->x(), theCoords->y(), theCoords->z())) { } @@ -51,23 +51,23 @@ void GeomAPI_Pnt::setZ(const double theZ) return MY_PNT->SetZ(theZ); } -const boost::shared_ptr GeomAPI_Pnt::xyz() +const std::shared_ptr GeomAPI_Pnt::xyz() { - return boost::shared_ptr(new GeomAPI_XYZ(MY_PNT->X(), MY_PNT->Y(), MY_PNT->Z())); + return std::shared_ptr(new GeomAPI_XYZ(MY_PNT->X(), MY_PNT->Y(), MY_PNT->Z())); } -double GeomAPI_Pnt::distance(const boost::shared_ptr& theOther) const +double GeomAPI_Pnt::distance(const std::shared_ptr& theOther) const { return MY_PNT->Distance(theOther->impl()); } -boost::shared_ptr GeomAPI_Pnt::to2D(const boost::shared_ptr& theOrigin, - const boost::shared_ptr& theDirX, const boost::shared_ptr& theDirY) +std::shared_ptr GeomAPI_Pnt::to2D(const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, const std::shared_ptr& theDirY) { gp_Pnt anOriginPnt(theOrigin->x(), theOrigin->y(), theOrigin->z()); gp_Vec aVec(anOriginPnt, impl()); double aX = aVec.X() * theDirX->x() + aVec.Y() * theDirX->y() + aVec.Z() * theDirX->z(); double aY = aVec.X() * theDirY->x() + aVec.Y() * theDirY->y() + aVec.Z() * theDirY->z(); - return boost::shared_ptr(new GeomAPI_Pnt2d(aX, aY)); + return std::shared_ptr(new GeomAPI_Pnt2d(aX, aY)); } diff --git a/src/GeomAPI/GeomAPI_Pnt.h b/src/GeomAPI/GeomAPI_Pnt.h index af4cce849..e01c80647 100644 --- a/src/GeomAPI/GeomAPI_Pnt.h +++ b/src/GeomAPI/GeomAPI_Pnt.h @@ -6,7 +6,7 @@ #define GeomAPI_Pnt_H_ #include -#include +#include class GeomAPI_XYZ; class GeomAPI_Pnt2d; @@ -23,7 +23,7 @@ class GEOMAPI_EXPORT GeomAPI_Pnt : public GeomAPI_Interface /// Creation of point by coordinates GeomAPI_Pnt(const double theX, const double theY, const double theZ); /// Creation of point by coordinates - GeomAPI_Pnt(const boost::shared_ptr& theCoords); + GeomAPI_Pnt(const std::shared_ptr& theCoords); /// returns X coordinate double x() const; @@ -40,15 +40,15 @@ class GEOMAPI_EXPORT GeomAPI_Pnt : public GeomAPI_Interface void setZ(const double theZ); /// returns coordinates of the point - const boost::shared_ptr xyz(); + const std::shared_ptr xyz(); /// Distance between two points - double distance(const boost::shared_ptr& theOther) const; + double distance(const std::shared_ptr& theOther) const; /// Projects a point to the plane defined by the origin and 2 axes vectors in this plane - boost::shared_ptr to2D(const boost::shared_ptr& theOrigin, - const boost::shared_ptr& theDirX, - const boost::shared_ptr& theDirY); + std::shared_ptr to2D(const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theDirY); }; #endif diff --git a/src/GeomAPI/GeomAPI_Pnt2d.cpp b/src/GeomAPI/GeomAPI_Pnt2d.cpp index 062cbfb99..5ef9df175 100644 --- a/src/GeomAPI/GeomAPI_Pnt2d.cpp +++ b/src/GeomAPI/GeomAPI_Pnt2d.cpp @@ -19,7 +19,7 @@ GeomAPI_Pnt2d::GeomAPI_Pnt2d(const double theX, const double theY) { } -GeomAPI_Pnt2d::GeomAPI_Pnt2d(const boost::shared_ptr& theCoords) +GeomAPI_Pnt2d::GeomAPI_Pnt2d(const std::shared_ptr& theCoords) : GeomAPI_Interface(new gp_Pnt2d(theCoords->x(), theCoords->y())) { } @@ -44,27 +44,27 @@ void GeomAPI_Pnt2d::setY(const double theY) return MY_PNT2D->SetY(theY); } -boost::shared_ptr GeomAPI_Pnt2d::to3D(const boost::shared_ptr& theOrigin, - const boost::shared_ptr& theDirX, - const boost::shared_ptr& theDirY) +std::shared_ptr GeomAPI_Pnt2d::to3D(const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theDirY) { - boost::shared_ptr aSum = theOrigin->xyz()->added(theDirX->xyz()->multiplied(x())) + std::shared_ptr aSum = theOrigin->xyz()->added(theDirX->xyz()->multiplied(x())) ->added(theDirY->xyz()->multiplied(y())); - return boost::shared_ptr(new GeomAPI_Pnt(aSum)); + return std::shared_ptr(new GeomAPI_Pnt(aSum)); } -const boost::shared_ptr GeomAPI_Pnt2d::xy() +const std::shared_ptr GeomAPI_Pnt2d::xy() { - return boost::shared_ptr(new GeomAPI_XY(MY_PNT2D->X(), MY_PNT2D->Y())); + return std::shared_ptr(new GeomAPI_XY(MY_PNT2D->X(), MY_PNT2D->Y())); } -double GeomAPI_Pnt2d::distance(const boost::shared_ptr& theOther) const +double GeomAPI_Pnt2d::distance(const std::shared_ptr& theOther) const { return MY_PNT2D->Distance(theOther->impl()); } -bool GeomAPI_Pnt2d::isEqual(const boost::shared_ptr& theOther) const +bool GeomAPI_Pnt2d::isEqual(const std::shared_ptr& theOther) const { return distance(theOther) < Precision::Confusion(); } diff --git a/src/GeomAPI/GeomAPI_Pnt2d.h b/src/GeomAPI/GeomAPI_Pnt2d.h index 4470a2aa6..7d1716cb0 100644 --- a/src/GeomAPI/GeomAPI_Pnt2d.h +++ b/src/GeomAPI/GeomAPI_Pnt2d.h @@ -6,7 +6,7 @@ #define GeomAPI_Pnt2d_H_ #include -#include +#include class GeomAPI_XY; class GeomAPI_Pnt; @@ -23,7 +23,7 @@ class GEOMAPI_EXPORT GeomAPI_Pnt2d : public GeomAPI_Interface /// Creation of point by coordinates GeomAPI_Pnt2d(const double theX, const double theY); /// Creation of point by coordinates - GeomAPI_Pnt2d(const boost::shared_ptr& theCoords); + GeomAPI_Pnt2d(const std::shared_ptr& theCoords); /// returns X coordinate double x() const; @@ -36,18 +36,18 @@ class GEOMAPI_EXPORT GeomAPI_Pnt2d : public GeomAPI_Interface void setY(const double theY); /// Returns the 3D point - boost::shared_ptr to3D(const boost::shared_ptr& theOrigin, - const boost::shared_ptr& theDirX, - const boost::shared_ptr& theDirY); + std::shared_ptr to3D(const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theDirY); /// returns coordinates of the point - const boost::shared_ptr xy(); + const std::shared_ptr xy(); /// Distance between two points - double distance(const boost::shared_ptr& theOther) const; + double distance(const std::shared_ptr& theOther) const; /// Returns whether the distance between two points is less then precision confusion - bool isEqual(const boost::shared_ptr& theOther) const; + bool isEqual(const std::shared_ptr& theOther) const; }; #endif diff --git a/src/GeomAPI/GeomAPI_Shape.cpp b/src/GeomAPI/GeomAPI_Shape.cpp index 0e5bcb010..5b9694ccc 100644 --- a/src/GeomAPI/GeomAPI_Shape.cpp +++ b/src/GeomAPI/GeomAPI_Shape.cpp @@ -18,7 +18,7 @@ bool GeomAPI_Shape::isNull() const return MY_SHAPE->IsNull() == Standard_True; } -bool GeomAPI_Shape::isEqual(const boost::shared_ptr theShape) const +bool GeomAPI_Shape::isEqual(const std::shared_ptr theShape) const { if (isNull()) return theShape->isNull(); diff --git a/src/GeomAPI/GeomAPI_Shape.h b/src/GeomAPI/GeomAPI_Shape.h index 03f75d745..c55d9ab31 100644 --- a/src/GeomAPI/GeomAPI_Shape.h +++ b/src/GeomAPI/GeomAPI_Shape.h @@ -6,7 +6,7 @@ #define GeomAPI_Shape_H_ #include -#include +#include #include /**\class GeomAPI_Shape @@ -22,7 +22,7 @@ class GEOMAPI_EXPORT GeomAPI_Shape : public GeomAPI_Interface bool isNull() const; /// Returns whether the shapes are equal - virtual bool isEqual(const boost::shared_ptr theShape) const; + virtual bool isEqual(const std::shared_ptr theShape) const; /// Returns whether the shape is a vertex virtual bool isVertex() const; @@ -33,9 +33,9 @@ class GEOMAPI_EXPORT GeomAPI_Shape : public GeomAPI_Interface }; //! Pointer on list of shapes -typedef std::list > ListOfShape; +typedef std::list > ListOfShape; //! Pointer on attribute object -typedef boost::shared_ptr GeomShapePtr; +typedef std::shared_ptr GeomShapePtr; #endif diff --git a/src/GeomAPI/GeomAPI_XY.cpp b/src/GeomAPI/GeomAPI_XY.cpp index d3c2b86f3..beff35c27 100644 --- a/src/GeomAPI/GeomAPI_XY.cpp +++ b/src/GeomAPI/GeomAPI_XY.cpp @@ -33,29 +33,29 @@ void GeomAPI_XY::setY(const double theY) return MY_XY->SetY(theY); } -const boost::shared_ptr GeomAPI_XY::added(const boost::shared_ptr& theArg) +const std::shared_ptr GeomAPI_XY::added(const std::shared_ptr& theArg) { - boost::shared_ptr aResult(new GeomAPI_XY(MY_XY->X() + theArg->x(), MY_XY->Y() + theArg->y())); + std::shared_ptr aResult(new GeomAPI_XY(MY_XY->X() + theArg->x(), MY_XY->Y() + theArg->y())); return aResult; } -const boost::shared_ptr GeomAPI_XY::multiplied(const double theArg) +const std::shared_ptr GeomAPI_XY::multiplied(const double theArg) { - boost::shared_ptr aResult(new GeomAPI_XY(MY_XY->X() * theArg, MY_XY->Y() * theArg)); + std::shared_ptr aResult(new GeomAPI_XY(MY_XY->X() * theArg, MY_XY->Y() * theArg)); return aResult; } -double GeomAPI_XY::dot(const boost::shared_ptr& theArg) const +double GeomAPI_XY::dot(const std::shared_ptr& theArg) const { return MY_XY->Dot(theArg->impl()); } -double GeomAPI_XY::cross(const boost::shared_ptr& theArg) const +double GeomAPI_XY::cross(const std::shared_ptr& theArg) const { return MY_XY->Crossed(theArg->impl()); } -double GeomAPI_XY::distance(const boost::shared_ptr& theOther) const +double GeomAPI_XY::distance(const std::shared_ptr& theOther) const { gp_XY aResult(theOther->x() - x(), theOther->y() - y()); return aResult.Modulus(); diff --git a/src/GeomAPI/GeomAPI_XY.h b/src/GeomAPI/GeomAPI_XY.h index 5e0fef8c9..b4439b93d 100644 --- a/src/GeomAPI/GeomAPI_XY.h +++ b/src/GeomAPI/GeomAPI_XY.h @@ -6,7 +6,7 @@ #define GeomAPI_XY_H_ #include -#include +#include /**\class GeomAPI_XY * \ingroup DataModel @@ -30,17 +30,17 @@ class GEOMAPI_EXPORT GeomAPI_XY : public GeomAPI_Interface void setY(const double theY); /// result is sum of coordinates of this and the given argument - const boost::shared_ptr added(const boost::shared_ptr& theArg); + const std::shared_ptr added(const std::shared_ptr& theArg); /// result is coordinates multiplied by the argument - const boost::shared_ptr multiplied(const double theArg); + const std::shared_ptr multiplied(const double theArg); /// result is a scalar product of two triplets - double dot(const boost::shared_ptr& theArg) const; + double dot(const std::shared_ptr& theArg) const; /// result is a cross product of two triplets - double cross(const boost::shared_ptr& theArg) const; + double cross(const std::shared_ptr& theArg) const; /// Distance between two pairs - double distance(const boost::shared_ptr& theOther) const; + double distance(const std::shared_ptr& theOther) const; }; #endif diff --git a/src/GeomAPI/GeomAPI_XYZ.cpp b/src/GeomAPI/GeomAPI_XYZ.cpp index 37ba3aa9f..6d4b97c2f 100644 --- a/src/GeomAPI/GeomAPI_XYZ.cpp +++ b/src/GeomAPI/GeomAPI_XYZ.cpp @@ -43,42 +43,42 @@ void GeomAPI_XYZ::setZ(const double theZ) return MY_XYZ->SetZ(theZ); } -const boost::shared_ptr GeomAPI_XYZ::added( - const boost::shared_ptr& theArg) +const std::shared_ptr GeomAPI_XYZ::added( + const std::shared_ptr& theArg) { - boost::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() + theArg->x(), + std::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() + theArg->x(), MY_XYZ->Y() + theArg->y(), MY_XYZ->Z() + theArg->z())); return aResult; } -const boost::shared_ptr GeomAPI_XYZ::decreased( - const boost::shared_ptr& theArg) +const std::shared_ptr GeomAPI_XYZ::decreased( + const std::shared_ptr& theArg) { - boost::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() - theArg->x(), + std::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() - theArg->x(), MY_XYZ->Y() - theArg->y(), MY_XYZ->Z() - theArg->z())); return aResult; } -const boost::shared_ptr GeomAPI_XYZ::multiplied(const double theArg) +const std::shared_ptr GeomAPI_XYZ::multiplied(const double theArg) { - boost::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() * theArg, + std::shared_ptr aResult(new GeomAPI_XYZ(MY_XYZ->X() * theArg, MY_XYZ->Y() * theArg, MY_XYZ->Z() * theArg)); return aResult; } -double GeomAPI_XYZ::dot(const boost::shared_ptr& theArg) const +double GeomAPI_XYZ::dot(const std::shared_ptr& theArg) const { return MY_XYZ->Dot(theArg->impl()); } -const boost::shared_ptr GeomAPI_XYZ::cross( - const boost::shared_ptr& theArg) const +const std::shared_ptr GeomAPI_XYZ::cross( + const std::shared_ptr& theArg) const { gp_XYZ aResult = MY_XYZ->Crossed(theArg->impl()); - return boost::shared_ptr(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z())); + return std::shared_ptr(new GeomAPI_XYZ(aResult.X(), aResult.Y(), aResult.Z())); } -double GeomAPI_XYZ::distance(const boost::shared_ptr& theOther) const +double GeomAPI_XYZ::distance(const std::shared_ptr& theOther) const { gp_XYZ aResult(theOther->x() - x(), theOther->y() - y(), theOther->z() - z()); return aResult.Modulus(); diff --git a/src/GeomAPI/GeomAPI_XYZ.h b/src/GeomAPI/GeomAPI_XYZ.h index eadee91a3..2ff628824 100644 --- a/src/GeomAPI/GeomAPI_XYZ.h +++ b/src/GeomAPI/GeomAPI_XYZ.h @@ -6,7 +6,7 @@ #define GeomAPI_XYZ_H_ #include -#include +#include /**\class GeomAPI_XYZ * \ingroup DataModel @@ -34,19 +34,19 @@ class GEOMAPI_EXPORT GeomAPI_XYZ : public GeomAPI_Interface void setZ(const double theZ); /// result is sum of coordinates of this and the given argument - const boost::shared_ptr added(const boost::shared_ptr& theArg); + const std::shared_ptr added(const std::shared_ptr& theArg); /// result is difference between coordinates of this and the given argument - const boost::shared_ptr decreased(const boost::shared_ptr& theArg); + const std::shared_ptr decreased(const std::shared_ptr& theArg); /// result is coordinates multiplied by the argument - const boost::shared_ptr multiplied(const double theArg); + const std::shared_ptr multiplied(const double theArg); /// result is a scalar product of two triplets - double dot(const boost::shared_ptr& theArg) const; + double dot(const std::shared_ptr& theArg) const; /// result is a cross product of two triplets - const boost::shared_ptr cross(const boost::shared_ptr& theArg) const; + const std::shared_ptr cross(const std::shared_ptr& theArg) const; /// Distance between two triplets - double distance(const boost::shared_ptr& theOther) const; + double distance(const std::shared_ptr& theOther) const; }; #endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI.i b/src/GeomAlgoAPI/GeomAlgoAPI.i index c2dbb80f0..b93be2a7e 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI.i +++ b/src/GeomAlgoAPI/GeomAlgoAPI.i @@ -1,7 +1,6 @@ /* GeomAPI.i */ %module GeomAlgoAPI %{ - #include "memory" #include "GeomAlgoAPI.h" #include "GeomAlgoAPI_FaceBuilder.h" #include "GeomAlgoAPI_EdgeBuilder.h" @@ -16,10 +15,9 @@ %include "typemaps.i" %include "std_string.i" %include "std_list.i" -//%include -%include +%include "std_shared_ptr.i" -%template(ShapeList) std::list >; +%template(ShapeList) std::list >; // all supported interfaces %include "GeomAlgoAPI_FaceBuilder.h" diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp index 6d2e740be..24598c541 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp @@ -11,59 +11,59 @@ #include #include -boost::shared_ptr GeomAlgoAPI_Boolean::makeCut( - boost::shared_ptr theShape, - boost::shared_ptr theTool) +std::shared_ptr GeomAlgoAPI_Boolean::makeCut( + std::shared_ptr theShape, + std::shared_ptr theTool) { const TopoDS_Shape& aShape = theShape->impl(); const TopoDS_Shape& aTool = theTool->impl(); BRepAlgoAPI_Cut aCut(aShape, aTool); if (aCut.IsDone()) { - boost::shared_ptr aResult(new GeomAPI_Shape()); + std::shared_ptr aResult(new GeomAPI_Shape()); aResult->setImpl(new TopoDS_Shape(aCut.Shape())); return aResult; } - return boost::shared_ptr(); + return std::shared_ptr(); } -boost::shared_ptr GeomAlgoAPI_Boolean::makeFuse( - boost::shared_ptr theShape, - boost::shared_ptr theTool) +std::shared_ptr GeomAlgoAPI_Boolean::makeFuse( + std::shared_ptr theShape, + std::shared_ptr theTool) { const TopoDS_Shape& aShape = theShape->impl(); const TopoDS_Shape& aTool = theTool->impl(); BRepAlgoAPI_Fuse aFuse(aShape, aTool); if (aFuse.IsDone()) { - boost::shared_ptr aResult(new GeomAPI_Shape()); + std::shared_ptr aResult(new GeomAPI_Shape()); aResult->setImpl(new TopoDS_Shape(aFuse.Shape())); return aResult; } - return boost::shared_ptr(); + return std::shared_ptr(); } -boost::shared_ptr GeomAlgoAPI_Boolean::makeCommon( - boost::shared_ptr theShape, - boost::shared_ptr theTool) +std::shared_ptr GeomAlgoAPI_Boolean::makeCommon( + std::shared_ptr theShape, + std::shared_ptr theTool) { const TopoDS_Shape& aShape = theShape->impl(); const TopoDS_Shape& aTool = theTool->impl(); BRepAlgoAPI_Common aCommon(aShape, aTool); if (aCommon.IsDone()) { - boost::shared_ptr aResult(new GeomAPI_Shape()); + std::shared_ptr aResult(new GeomAPI_Shape()); aResult->setImpl(new TopoDS_Shape(aCommon.Shape())); return aResult; } - return boost::shared_ptr(); + return std::shared_ptr(); } //============================================================================ -GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(boost::shared_ptr theObject, - boost::shared_ptr theTool, +GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(std::shared_ptr theObject, + std::shared_ptr theTool, int theType) : myOperation(theType), myDone(false), myShape(new GeomAPI_Shape()) { @@ -72,8 +72,8 @@ GeomAlgoAPI_Boolean::GeomAlgoAPI_Boolean(boost::shared_ptr theObj //============================================================================ -void GeomAlgoAPI_Boolean::build(boost::shared_ptr theObject, - boost::shared_ptr theTool) +void GeomAlgoAPI_Boolean::build(std::shared_ptr theObject, + std::shared_ptr theTool) { const TopoDS_Shape& anObject = theObject->impl(); const TopoDS_Shape& aTool = theTool->impl(); @@ -117,12 +117,12 @@ void GeomAlgoAPI_Boolean::build(boost::shared_ptr theObject, if(aResult.ShapeType() == TopAbs_COMPOUND) aResult = GeomAlgoAPI_DFLoader::refineResult(aResult); myShape->setImpl(new TopoDS_Shape(aResult)); - boost::shared_ptr aGeomResult(new GeomAPI_Shape()); + std::shared_ptr aGeomResult(new GeomAPI_Shape()); aGeomResult->setImpl(new TopoDS_Shape(aResult)); // fill data map to keep correct orientation of sub-shapes for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) { - boost::shared_ptr aCurrentShape(new GeomAPI_Shape()); + std::shared_ptr aCurrentShape(new GeomAPI_Shape()); aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current())); myMap.bind(aCurrentShape, aCurrentShape); } @@ -142,7 +142,7 @@ const bool GeomAlgoAPI_Boolean::isValid() const } //============================================================================ -const boost::shared_ptr& GeomAlgoAPI_Boolean::shape () const +const std::shared_ptr& GeomAlgoAPI_Boolean::shape () const { return myShape; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h index a46ab91a9..7c315d9a6 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Boolean.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include /**\class GeomAlgoAPI_Boolean * \ingroup DataAlgo @@ -23,18 +23,18 @@ class GeomAlgoAPI_Boolean : public GeomAPI_Interface * \param[in] theTool toole shape for boolean * \return a solid as result of operation */ - GEOMALGOAPI_EXPORT static boost::shared_ptr makeCut( - boost::shared_ptr theShape, - boost::shared_ptr theTool); + GEOMALGOAPI_EXPORT static std::shared_ptr makeCut( + std::shared_ptr theShape, + std::shared_ptr theTool); /* \brief Creates fuse boolean operation * \param[in] theShape the main shape * \param[in] theTool second shape * \return a solid as result of operation */ - GEOMALGOAPI_EXPORT static boost::shared_ptr makeFuse( - boost::shared_ptr theShape, - boost::shared_ptr theTool); + GEOMALGOAPI_EXPORT static std::shared_ptr makeFuse( + std::shared_ptr theShape, + std::shared_ptr theTool); /* \brief Creates common boolean operation * \param[in] theObject the main shape @@ -42,9 +42,9 @@ class GeomAlgoAPI_Boolean : public GeomAPI_Interface * \param[in] theType type of the operation: Fuse, Cut, Common * \return a solid as result of operation */ - GEOMALGOAPI_EXPORT static boost::shared_ptr makeCommon( - boost::shared_ptr theObject, - boost::shared_ptr theTool); + GEOMALGOAPI_EXPORT static std::shared_ptr makeCommon( + std::shared_ptr theObject, + std::shared_ptr theTool); enum { BOOL_CUT, @@ -52,8 +52,8 @@ class GeomAlgoAPI_Boolean : public GeomAPI_Interface BOOL_COMMON }; /// Constructor - GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean (boost::shared_ptr theObject, - boost::shared_ptr theTool, + GEOMALGOAPI_EXPORT GeomAlgoAPI_Boolean (std::shared_ptr theObject, + std::shared_ptr theTool, int theType); /// Returns True if algorithm succeed @@ -63,7 +63,7 @@ class GeomAlgoAPI_Boolean : public GeomAPI_Interface GEOMALGOAPI_EXPORT const bool isValid() const; /// Returns result of the boolean algorithm which may be a Solid or a Face - GEOMALGOAPI_EXPORT const boost::shared_ptr& shape () const; + GEOMALGOAPI_EXPORT const std::shared_ptr& shape () const; /// Returns map of sub-shapes of the result. To be used for History keeping GEOMALGOAPI_EXPORT void mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const; @@ -76,13 +76,13 @@ class GeomAlgoAPI_Boolean : public GeomAPI_Interface private: /// builds resulting shape - void build(boost::shared_ptr theObject, - boost::shared_ptr theTool); + void build(std::shared_ptr theObject, + std::shared_ptr theTool); /// fields double mySize; bool myDone; int myOperation; - boost::shared_ptr myShape; + std::shared_ptr myShape; GeomAPI_DataMapOfShapeShape myMap; GeomAlgoAPI_MakeShape * myMkShape; }; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp index 934390faa..8ce54d347 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp @@ -9,20 +9,20 @@ #include #include -boost::shared_ptr GeomAlgoAPI_CompoundBuilder::compound( - std::list > theShapes) +std::shared_ptr GeomAlgoAPI_CompoundBuilder::compound( + std::list > theShapes) { BRep_Builder aBuilder; TopoDS_Compound aComp; aBuilder.MakeCompound(aComp); - std::list >::const_iterator anIt = theShapes.begin(), aLast = + std::list >::const_iterator anIt = theShapes.begin(), aLast = theShapes.end(); for (; anIt != aLast; anIt++) { aBuilder.Add(aComp, (*anIt)->impl()); } - boost::shared_ptr aRes(new GeomAPI_Shape); + std::shared_ptr aRes(new GeomAPI_Shape); aRes->setImpl(new TopoDS_Shape(aComp)); return aRes; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.h b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.h index bf9f8374a..dac10ee8c 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include @@ -23,8 +23,8 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_CompoundBuilder public: /// Creates compund of the given shapes /// \param theShapes a list of shapes - static boost::shared_ptr compound( - std::list > theShapes); + static std::shared_ptr compound( + std::list > theShapes); }; #endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp index 5f3aba03e..5d314dd8e 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.cpp @@ -13,25 +13,25 @@ #include #include -boost::shared_ptr GeomAlgoAPI_EdgeBuilder::line( - boost::shared_ptr theStart, boost::shared_ptr theEnd) +std::shared_ptr GeomAlgoAPI_EdgeBuilder::line( + std::shared_ptr theStart, std::shared_ptr theEnd) { const gp_Pnt& aStart = theStart->impl(); const gp_Pnt& anEnd = theEnd->impl(); if (aStart.IsEqual(anEnd, Precision::Confusion())) - return boost::shared_ptr(); + return std::shared_ptr(); if (Abs(aStart.SquareDistance(anEnd)) > 1.e+100) - return boost::shared_ptr(); + return std::shared_ptr(); BRepBuilderAPI_MakeEdge anEdgeBuilder(aStart, anEnd); - boost::shared_ptr aRes(new GeomAPI_Edge); + std::shared_ptr aRes(new GeomAPI_Edge); TopoDS_Edge anEdge = anEdgeBuilder.Edge(); aRes->setImpl(new TopoDS_Shape(anEdge)); return aRes; } -boost::shared_ptr GeomAlgoAPI_EdgeBuilder::lineCircle( - boost::shared_ptr theCenter, boost::shared_ptr theNormal, +std::shared_ptr GeomAlgoAPI_EdgeBuilder::lineCircle( + std::shared_ptr theCenter, std::shared_ptr theNormal, double theRadius) { const gp_Pnt& aCenter = theCenter->impl(); @@ -40,15 +40,15 @@ boost::shared_ptr GeomAlgoAPI_EdgeBuilder::lineCircle( gp_Circ aCircle(gp_Ax2(aCenter, aDir), theRadius); BRepBuilderAPI_MakeEdge anEdgeBuilder(aCircle); - boost::shared_ptr aRes(new GeomAPI_Edge); + std::shared_ptr aRes(new GeomAPI_Edge); TopoDS_Edge anEdge = anEdgeBuilder.Edge(); aRes->setImpl(new TopoDS_Shape(anEdge)); return aRes; } -boost::shared_ptr GeomAlgoAPI_EdgeBuilder::lineCircleArc( - boost::shared_ptr theCenter, boost::shared_ptr theStartPoint, - boost::shared_ptr theEndPoint, boost::shared_ptr theNormal) +std::shared_ptr GeomAlgoAPI_EdgeBuilder::lineCircleArc( + std::shared_ptr theCenter, std::shared_ptr theStartPoint, + std::shared_ptr theEndPoint, std::shared_ptr theNormal) { const gp_Pnt& aCenter = theCenter->impl(); const gp_Dir& aDir = theNormal->impl(); @@ -66,12 +66,12 @@ boost::shared_ptr GeomAlgoAPI_EdgeBuilder::lineCircleArc( else anEdgeBuilder = BRepBuilderAPI_MakeEdge(aCircle, aStart, anEnd); - boost::shared_ptr aRes(new GeomAPI_Edge); + std::shared_ptr aRes(new GeomAPI_Edge); anEdgeBuilder.Build(); if (anEdgeBuilder.IsDone()) aRes->setImpl(new TopoDS_Shape(anEdgeBuilder.Edge())); else - aRes = boost::shared_ptr(); + aRes = std::shared_ptr(); return aRes; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.h b/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.h index 1db144ed1..bc29d923c 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_EdgeBuilder.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include /**\class GeomAlgoAPI_EdgeBuilder * \ingroup DataAlgo @@ -20,19 +20,19 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_EdgeBuilder { public: /// Creates linear edge by two points - static boost::shared_ptr line(boost::shared_ptr theStart, - boost::shared_ptr theEnd); + static std::shared_ptr line(std::shared_ptr theStart, + std::shared_ptr theEnd); /// Creates linear edge in a form of a circle by a point and a circle radius - static boost::shared_ptr lineCircle(boost::shared_ptr theCenter, - boost::shared_ptr theNormal, + static std::shared_ptr lineCircle(std::shared_ptr theCenter, + std::shared_ptr theNormal, double theRadius); /// Creates linear edge in a form of a circle arc by a three points - static boost::shared_ptr lineCircleArc(boost::shared_ptr theCenter, - boost::shared_ptr theStartPoint, - boost::shared_ptr theEndPoint, - boost::shared_ptr theNormal); + static std::shared_ptr lineCircleArc(std::shared_ptr theCenter, + std::shared_ptr theStartPoint, + std::shared_ptr theEndPoint, + std::shared_ptr theNormal); }; #endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.cpp index d8eefb25d..7d76979b2 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.cpp @@ -19,14 +19,14 @@ #include #include #include -#include +#include #include #include const double tolerance = Precision::Angular(); // Constructor GeomAlgoAPI_Extrusion::GeomAlgoAPI_Extrusion( - boost::shared_ptr theBasis, double theSize) + std::shared_ptr theBasis, double theSize) : mySize(theSize), myDone(false), myShape(new GeomAPI_Shape()), myFirst(new GeomAPI_Shape()), myLast(new GeomAPI_Shape()) { @@ -34,7 +34,7 @@ GeomAlgoAPI_Extrusion::GeomAlgoAPI_Extrusion( } //============================================================================ -void GeomAlgoAPI_Extrusion::build(const boost::shared_ptr& theBasis) +void GeomAlgoAPI_Extrusion::build(const std::shared_ptr& theBasis) { bool isFirstNorm = true; gp_Dir aShapeNormal; @@ -60,7 +60,7 @@ void GeomAlgoAPI_Extrusion::build(const boost::shared_ptr& theBas aResult = aBuilder->Shape(); // fill data map to keep correct orientation of sub-shapes for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) { - boost::shared_ptr aCurrentShape(new GeomAPI_Shape()); + std::shared_ptr aCurrentShape(new GeomAPI_Shape()); aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current())); myMap.bind(aCurrentShape, aCurrentShape); } @@ -98,19 +98,19 @@ const bool GeomAlgoAPI_Extrusion::hasVolume() const } //============================================================================ -const boost::shared_ptr& GeomAlgoAPI_Extrusion::shape () const +const std::shared_ptr& GeomAlgoAPI_Extrusion::shape () const { return myShape; } //============================================================================ -const boost::shared_ptr& GeomAlgoAPI_Extrusion::firstShape() +const std::shared_ptr& GeomAlgoAPI_Extrusion::firstShape() { return myFirst; } //============================================================================ -const boost::shared_ptr& GeomAlgoAPI_Extrusion::lastShape() +const std::shared_ptr& GeomAlgoAPI_Extrusion::lastShape() { return myLast; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h b/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h index ead8a8a8d..26a22bf5d 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include /**\class GeomAlgoAPI_Extrusion * \ingroup DataAlgo * \brief Allows to create the prism based on a given face and a direction @@ -26,7 +26,7 @@ class GeomAlgoAPI_Extrusion : public GeomAPI_Interface * \return a solid or a face/shell which is obtained from specified one */ /// Constructor - GEOMALGOAPI_EXPORT GeomAlgoAPI_Extrusion (boost::shared_ptr theBasis, double theSize); + GEOMALGOAPI_EXPORT GeomAlgoAPI_Extrusion (std::shared_ptr theBasis, double theSize); /// Returns True if algorithm succeed GEOMALGOAPI_EXPORT const bool isDone() const; @@ -38,13 +38,13 @@ class GeomAlgoAPI_Extrusion : public GeomAPI_Interface GEOMALGOAPI_EXPORT const bool hasVolume() const; /// Returns result of the Extrusion algorithm which may be a Solid or a Face - GEOMALGOAPI_EXPORT const boost::shared_ptr& shape () const; + GEOMALGOAPI_EXPORT const std::shared_ptr& shape () const; /// Returns the first shape - GEOMALGOAPI_EXPORT const boost::shared_ptr& firstShape(); + GEOMALGOAPI_EXPORT const std::shared_ptr& firstShape(); /// returns last shape - GEOMALGOAPI_EXPORT const boost::shared_ptr& lastShape(); + GEOMALGOAPI_EXPORT const std::shared_ptr& lastShape(); /// Returns map of sub-shapes of the result. To be used for History keeping GEOMALGOAPI_EXPORT void mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const; @@ -56,13 +56,13 @@ class GeomAlgoAPI_Extrusion : public GeomAPI_Interface GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Extrusion(); private: /// builds resulting shape - void build(const boost::shared_ptr& theBasis); + void build(const std::shared_ptr& theBasis); /// fields double mySize; bool myDone; - boost::shared_ptr myShape; - boost::shared_ptr myFirst; - boost::shared_ptr myLast; + std::shared_ptr myShape; + std::shared_ptr myFirst; + std::shared_ptr myLast; GeomAPI_DataMapOfShapeShape myMap; GeomAlgoAPI_MakeShape * myMkShape; }; diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp index 85df8286a..b1a7d5e92 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.cpp @@ -10,8 +10,8 @@ #include #include -boost::shared_ptr GeomAlgoAPI_FaceBuilder::square( - boost::shared_ptr theCenter, boost::shared_ptr theNormal, +std::shared_ptr GeomAlgoAPI_FaceBuilder::square( + std::shared_ptr theCenter, std::shared_ptr theNormal, const double theSize) { const gp_Pnt& aCenter = theCenter->impl(); @@ -20,15 +20,15 @@ boost::shared_ptr GeomAlgoAPI_FaceBuilder::square( // half of the size in each direction from the center BRepBuilderAPI_MakeFace aFaceBuilder(aPlane, -theSize / 2., theSize / 2., -theSize / 2., theSize / 2.); - boost::shared_ptr aRes(new GeomAPI_Shape); + std::shared_ptr aRes(new GeomAPI_Shape); aRes->setImpl(new TopoDS_Shape(aFaceBuilder.Face())); return aRes; } -boost::shared_ptr GeomAlgoAPI_FaceBuilder::plane( - boost::shared_ptr theFace) +std::shared_ptr GeomAlgoAPI_FaceBuilder::plane( + std::shared_ptr theFace) { - boost::shared_ptr aResult; + std::shared_ptr aResult; if (!theFace) return aResult; // bad shape TopoDS_Shape aShape = theFace->impl(); @@ -47,6 +47,6 @@ boost::shared_ptr GeomAlgoAPI_FaceBuilder::plane( return aResult; // not planar double aA, aB, aC, aD; aPlane->Coefficients(aA, aB, aC, aD); - aResult = boost::shared_ptr(new GeomAPI_Pln(aA, aB, aC, aD)); + aResult = std::shared_ptr(new GeomAPI_Pln(aA, aB, aC, aD)); return aResult; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.h b/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.h index b95fad92b..4880566df 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_FaceBuilder.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include /**\class GeomAlgoAPI_FaceBuilder * \ingroup DataAlgo @@ -22,12 +22,12 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_FaceBuilder public: /// Creates square planar face by given point of the center, /// normal to the plane and size of square - static boost::shared_ptr square(boost::shared_ptr theCenter, - boost::shared_ptr theNormal, + static std::shared_ptr square(std::shared_ptr theCenter, + std::shared_ptr theNormal, const double theSize); /// Returns the plane of the planar face. If it is not planar, returns empty ptr. - static boost::shared_ptr plane(boost::shared_ptr theFace); + static std::shared_ptr plane(std::shared_ptr theFace); }; #endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp index 70cfad9f8..402457c95 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp @@ -20,21 +20,21 @@ void GeomAlgoAPI_MakeShape::init(void* theMkShape) setImpl((void *)implPtr()); } -const boost::shared_ptr GeomAlgoAPI_MakeShape::shape() const +const std::shared_ptr GeomAlgoAPI_MakeShape::shape() const { return myShape; } /// Returns the list of shapes generated from the shape void GeomAlgoAPI_MakeShape::generated( - const boost::shared_ptr theShape, ListOfShape& theHistory) + const std::shared_ptr theShape, ListOfShape& theHistory) { BRepBuilderAPI_MakeShape* aBuilder = implPtr(); if(aBuilder) { const TopTools_ListOfShape& aList = aBuilder->Generated(theShape->impl()); TopTools_ListIteratorOfListOfShape it(aList); for(;it.More();it.Next()) { - boost::shared_ptr aShape(new GeomAPI_Shape()); + std::shared_ptr aShape(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(it.Value())); theHistory.push_back(aShape); } @@ -43,14 +43,14 @@ void GeomAlgoAPI_MakeShape::generated( /// Returns the list of shapes modified from the shape void GeomAlgoAPI_MakeShape::modified( - const boost::shared_ptr theShape, ListOfShape& theHistory) + const std::shared_ptr theShape, ListOfShape& theHistory) { BRepBuilderAPI_MakeShape* aBuilder = implPtr(); if(aBuilder) { const TopTools_ListOfShape& aList = aBuilder->Modified(theShape->impl()); TopTools_ListIteratorOfListOfShape it(aList); for(;it.More();it.Next()) { - boost::shared_ptr aShape(new GeomAPI_Shape()); + std::shared_ptr aShape(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(it.Value())); theHistory.push_back(aShape); } @@ -58,7 +58,7 @@ void GeomAlgoAPI_MakeShape::modified( } /// Returns whether the shape is an edge -bool GeomAlgoAPI_MakeShape::isDeleted(const boost::shared_ptr theShape) +bool GeomAlgoAPI_MakeShape::isDeleted(const std::shared_ptr theShape) { bool isDeleted(false); BRepBuilderAPI_MakeShape* aBuilder = implPtr(); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h index 4fa0ef0a1..6848898b6 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h @@ -5,7 +5,7 @@ #define GeomAlgoAPI_MakeShape_H_ #include -#include +#include #include //#include /**\class GeomAlgoAPI_MakeShape @@ -21,23 +21,23 @@ class GeomAlgoAPI_MakeShape : public GeomAPI_Interface GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape(void* theBuilder); /// Returns a shape built by the shape construction algorithm - GEOMALGOAPI_EXPORT const boost::shared_ptr shape() const; + GEOMALGOAPI_EXPORT const std::shared_ptr shape() const; /// Returns the list of shapes generated from the shape GEOMALGOAPI_EXPORT virtual void generated( - const boost::shared_ptr theShape, ListOfShape& theHistory); + const std::shared_ptr theShape, ListOfShape& theHistory); /// Returns the list of shapes modified from the shape GEOMALGOAPI_EXPORT virtual void modified( - const boost::shared_ptr theShape, ListOfShape& theHistory); + const std::shared_ptr theShape, ListOfShape& theHistory); /// Returns whether the shape is an edge - GEOMALGOAPI_EXPORT virtual bool isDeleted(const boost::shared_ptr theShape); + GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr theShape); GEOMALGOAPI_EXPORT void init(void* theMkShape); protected: - boost::shared_ptr myShape; + std::shared_ptr myShape; }; #endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp index 053504d79..086cc419b 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.cpp @@ -8,13 +8,13 @@ #include #include -boost::shared_ptr GeomAlgoAPI_PointBuilder::point( - boost::shared_ptr thePoint) +std::shared_ptr GeomAlgoAPI_PointBuilder::point( + std::shared_ptr thePoint) { const gp_Pnt& aPnt = thePoint->impl(); BRepBuilderAPI_MakeVertex aMaker(aPnt); TopoDS_Vertex aVertex = aMaker.Vertex(); - boost::shared_ptr aRes(new GeomAPI_Shape); + std::shared_ptr aRes(new GeomAPI_Shape); aRes->setImpl(new TopoDS_Shape(aVertex)); return aRes; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h index ec6e417e4..78639d7fd 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_PointBuilder.h @@ -6,7 +6,7 @@ #define GeomAlgoAPI_PointBuilder_H_ #include -#include +#include class GeomAPI_Shape; class GeomAPI_Pnt; @@ -20,7 +20,7 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_PointBuilder { public: /// Creates linear edge by two points - static boost::shared_ptr point(boost::shared_ptr thePoint); + static std::shared_ptr point(std::shared_ptr thePoint); }; #endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp index ddd6d3977..4e894827d 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp @@ -80,11 +80,11 @@ static void removeWasteEdges(std::list::iterator& theStartVertex, void GeomAlgoAPI_SketchBuilder::createFaces( - const boost::shared_ptr& theOrigin, const boost::shared_ptr& theDirX, - const boost::shared_ptr& theDirY, const boost::shared_ptr& theNorm, - const std::list >& theFeatures, - std::list >& theResultFaces, - std::list >& theResultWires) + const std::shared_ptr& theOrigin, const std::shared_ptr& theDirX, + const std::shared_ptr& theDirY, const std::shared_ptr& theNorm, + const std::list >& theFeatures, + std::list >& theResultFaces, + std::list >& theResultWires) { if (theFeatures.empty()) return; @@ -95,10 +95,10 @@ void GeomAlgoAPI_SketchBuilder::createFaces( TopoDS_Shape aFeaturesCompound; // Obtain only edges from the features list - std::list > anEdges; - std::list >::const_iterator aFeatIt = theFeatures.begin(); + std::list > anEdges; + std::list >::const_iterator aFeatIt = theFeatures.begin(); for (; aFeatIt != theFeatures.end(); aFeatIt++) { - boost::shared_ptr aShape(*aFeatIt); + std::shared_ptr aShape(*aFeatIt); const TopoDS_Edge& anEdge = aShape->impl(); if (anEdge.ShapeType() == TopAbs_EDGE) anEdges.push_back(aShape); @@ -107,9 +107,9 @@ void GeomAlgoAPI_SketchBuilder::createFaces( if (anEdges.size() == 1) { // If there is only one feature, BOPAlgo_Builder will decline to work. Need to process it anyway aFeaturesCompound = anEdges.front()->impl(); } else { - std::list >::const_iterator anIt = anEdges.begin(); + std::list >::const_iterator anIt = anEdges.begin(); for (; anIt != anEdges.end(); anIt++) { - boost::shared_ptr aPreview(*anIt); + std::shared_ptr aPreview(*anIt); aBuilder.AddArgument(aPreview->impl()); } aPF.SetArguments(aBuilder.Arguments()); @@ -219,7 +219,7 @@ void GeomAlgoAPI_SketchBuilder::createFaces( TopoDS_Face aPatch; createFace(*aVertIter, anEdgeIter, aProcEdges.end(), aPlane, aPatch); if (!aPatch.IsNull()) { - boost::shared_ptr aFace(new GeomAPI_Shape); + std::shared_ptr aFace(new GeomAPI_Shape); aFace->setImpl(new TopoDS_Face(aPatch)); theResultFaces.push_back(aFace); } @@ -323,7 +323,7 @@ void GeomAlgoAPI_SketchBuilder::createFaces( std::list::const_iterator aTailIter = aTail.begin(); for (; aTailIter != aTail.end(); aTailIter++) if (!aTailIter->IsNull()) { - boost::shared_ptr aWire(new GeomAPI_Shape); + std::shared_ptr aWire(new GeomAPI_Shape); aWire->setImpl(new TopoDS_Shape(*aTailIter)); theResultWires.push_back(aWire); } @@ -371,30 +371,30 @@ void GeomAlgoAPI_SketchBuilder::createFaces( fixIntersections(theResultFaces); } -void GeomAlgoAPI_SketchBuilder::createFaces(const boost::shared_ptr& theOrigin, - const boost::shared_ptr& theDirX, - const boost::shared_ptr& theDirY, - const boost::shared_ptr& theNorm, - const boost::shared_ptr& theWire, - std::list >& theResultFaces) +void GeomAlgoAPI_SketchBuilder::createFaces(const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theDirY, + const std::shared_ptr& theNorm, + const std::shared_ptr& theWire, + std::list >& theResultFaces) { - boost::shared_ptr aWire = boost::dynamic_pointer_cast(theWire); + std::shared_ptr aWire = std::dynamic_pointer_cast(theWire); if(!aWire) return; // Filter wires, return only faces. - std::list > aFilteredWires; + std::list > aFilteredWires; createFaces(theOrigin, theDirX, theDirY, theNorm, aWire->getEdges(), theResultFaces, aFilteredWires); } void GeomAlgoAPI_SketchBuilder::fixIntersections( - std::list >& theFaces) + std::list >& theFaces) { BRepClass_FaceClassifier aClassifier; - std::list >::iterator anIter1 = theFaces.begin(); - std::list >::iterator anIter2; + std::list >::iterator anIter1 = theFaces.begin(); + std::list >::iterator anIter2; for (; anIter1 != theFaces.end(); anIter1++) { anIter2 = anIter1; for (++anIter2; anIter2 != theFaces.end(); anIter2++) { @@ -430,7 +430,7 @@ void GeomAlgoAPI_SketchBuilder::fixIntersections( (*anIter2)->setImpl(new TopoDS_Shape(anExp.Current())); isFirstFace = false; } else { - boost::shared_ptr aShape(new GeomAPI_Shape); + std::shared_ptr aShape(new GeomAPI_Shape); aShape->setImpl(new TopoDS_Shape(anExp.Current())); theFaces.push_back(aShape); } @@ -447,7 +447,7 @@ void GeomAlgoAPI_SketchBuilder::fixIntersections( (*anIter1)->setImpl(new TopoDS_Shape(anExp.Current())); isFirstFace = false; } else { - boost::shared_ptr aShape(new GeomAPI_Shape); + std::shared_ptr aShape(new GeomAPI_Shape); aShape->setImpl(new TopoDS_Shape(anExp.Current())); theFaces.push_back(aShape); } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h index 86505f82d..a2ed35849 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h @@ -7,7 +7,7 @@ #include -#include +#include #include #include @@ -34,13 +34,13 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_SketchBuilder * It finds the vertex with minimal coordinates along X axis (theDirX) and then * goes through the edges passing the surrounding area on the left. */ - static void createFaces(const boost::shared_ptr& theOrigin, - const boost::shared_ptr& theDirX, - const boost::shared_ptr& theDirY, - const boost::shared_ptr& theNorm, - const std::list >& theFeatures, - std::list >& theResultFaces, - std::list >& theResultWires); + static void createFaces(const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theDirY, + const std::shared_ptr& theNorm, + const std::list >& theFeatures, + std::list >& theResultFaces, + std::list >& theResultWires); /** \brief Creates list of faces and unclosed wires on basis of the features of the sketch * \param[in] theOrigin origin point of the sketch @@ -54,18 +54,18 @@ class GEOMALGOAPI_EXPORT GeomAlgoAPI_SketchBuilder * It finds the vertex with minimal coordinates along X axis (theDirX) and then * goes through the edges passing the surrounding area on the left. */ - static void createFaces(const boost::shared_ptr& theOrigin, - const boost::shared_ptr& theDirX, - const boost::shared_ptr& theDirY, - const boost::shared_ptr& theNorm, - const boost::shared_ptr& theWire, - std::list >& theResultFaces); + static void createFaces(const std::shared_ptr& theOrigin, + const std::shared_ptr& theDirX, + const std::shared_ptr& theDirY, + const std::shared_ptr& theNorm, + const std::shared_ptr& theWire, + std::list >& theResultFaces); /** \brief Searches intersections between the faces in the list * and make holes in the faces to avoid intersections * \param[in,out] theFaces list of faces to proccess */ - static void fixIntersections(std::list >& theFaces); + static void fixIntersections(std::list >& theFaces); }; #endif diff --git a/src/GeomData/GeomData_Dir.cpp b/src/GeomData/GeomData_Dir.cpp index ddf20ebbd..837c94073 100644 --- a/src/GeomData/GeomData_Dir.cpp +++ b/src/GeomData/GeomData_Dir.cpp @@ -21,7 +21,7 @@ void GeomData_Dir::setValue(const double theX, const double theY, const double t } } -void GeomData_Dir::setValue(const boost::shared_ptr& theDir) +void GeomData_Dir::setValue(const std::shared_ptr& theDir) { setValue(theDir->x(), theDir->y(), theDir->z()); } @@ -41,9 +41,9 @@ double GeomData_Dir::z() const return myCoords->Value(2); } -boost::shared_ptr GeomData_Dir::dir() +std::shared_ptr GeomData_Dir::dir() { - return boost::shared_ptr( + return std::shared_ptr( new GeomAPI_Dir(myCoords->Value(0), myCoords->Value(1), myCoords->Value(2))); } diff --git a/src/GeomData/GeomData_Dir.h b/src/GeomData/GeomData_Dir.h index b4dea091a..a11316a4b 100644 --- a/src/GeomData/GeomData_Dir.h +++ b/src/GeomData/GeomData_Dir.h @@ -9,7 +9,7 @@ #include "GeomDataAPI_Dir.h" #include #include -#include +#include class GeomAPI_Dir; @@ -24,7 +24,7 @@ class GeomData_Dir : public GeomDataAPI_Dir /// Defines the double value GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ); /// Defines the direction - GEOMDATA_EXPORT virtual void setValue(const boost::shared_ptr& theDir); + GEOMDATA_EXPORT virtual void setValue(const std::shared_ptr& theDir); /// Returns the X double value GEOMDATA_EXPORT virtual double x() const; @@ -33,7 +33,7 @@ class GeomData_Dir : public GeomDataAPI_Dir /// Returns the Z double value GEOMDATA_EXPORT virtual double z() const; /// Returns the direction of this attribute - GEOMDATA_EXPORT virtual boost::shared_ptr dir(); + GEOMDATA_EXPORT virtual std::shared_ptr dir(); protected: /// Initializes attributes diff --git a/src/GeomData/GeomData_Point.cpp b/src/GeomData/GeomData_Point.cpp index 61c92e12b..ca9f960df 100644 --- a/src/GeomData/GeomData_Point.cpp +++ b/src/GeomData/GeomData_Point.cpp @@ -20,7 +20,7 @@ void GeomData_Point::setValue(const double theX, const double theY, const double } } -void GeomData_Point::setValue(const boost::shared_ptr& thePoint) +void GeomData_Point::setValue(const std::shared_ptr& thePoint) { setValue(thePoint->x(), thePoint->y(), thePoint->z()); } @@ -40,9 +40,9 @@ double GeomData_Point::z() const return myCoords->Value(2); } -boost::shared_ptr GeomData_Point::pnt() +std::shared_ptr GeomData_Point::pnt() { - boost::shared_ptr aResult( + std::shared_ptr aResult( new GeomAPI_Pnt(myCoords->Value(0), myCoords->Value(1), myCoords->Value(2))); return aResult; } diff --git a/src/GeomData/GeomData_Point.h b/src/GeomData/GeomData_Point.h index 3d1ae7cef..507227f1b 100644 --- a/src/GeomData/GeomData_Point.h +++ b/src/GeomData/GeomData_Point.h @@ -22,7 +22,7 @@ class GeomData_Point : public GeomDataAPI_Point /// Defines the double value GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ); /// Defines the point - GEOMDATA_EXPORT virtual void setValue(const boost::shared_ptr& thePoint); + GEOMDATA_EXPORT virtual void setValue(const std::shared_ptr& thePoint); /// Returns the X double value GEOMDATA_EXPORT virtual double x() const; @@ -31,7 +31,7 @@ class GeomData_Point : public GeomDataAPI_Point /// Returns the Z double value GEOMDATA_EXPORT virtual double z() const; /// Returns the 3D point - GEOMDATA_EXPORT virtual boost::shared_ptr pnt(); + GEOMDATA_EXPORT virtual std::shared_ptr pnt(); protected: /// Initializes attributes diff --git a/src/GeomData/GeomData_Point2D.cpp b/src/GeomData/GeomData_Point2D.cpp index 924f80f8c..eee50b4e7 100644 --- a/src/GeomData/GeomData_Point2D.cpp +++ b/src/GeomData/GeomData_Point2D.cpp @@ -18,7 +18,7 @@ void GeomData_Point2D::setValue(const double theX, const double theY) } } -void GeomData_Point2D::setValue(const boost::shared_ptr& thePoint) +void GeomData_Point2D::setValue(const std::shared_ptr& thePoint) { setValue(thePoint->x(), thePoint->y()); } @@ -33,9 +33,9 @@ double GeomData_Point2D::y() const return myCoords->Value(1); } -boost::shared_ptr GeomData_Point2D::pnt() +std::shared_ptr GeomData_Point2D::pnt() { - boost::shared_ptr aResult( + std::shared_ptr aResult( new GeomAPI_Pnt2d(myCoords->Value(0), myCoords->Value(1))); return aResult; } diff --git a/src/GeomData/GeomData_Point2D.h b/src/GeomData/GeomData_Point2D.h index 4990948b8..f5989898e 100644 --- a/src/GeomData/GeomData_Point2D.h +++ b/src/GeomData/GeomData_Point2D.h @@ -22,14 +22,14 @@ class GeomData_Point2D : public GeomDataAPI_Point2D /// Defines the double value GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY); /// Defines the point - GEOMDATA_EXPORT virtual void setValue(const boost::shared_ptr& thePoint); + GEOMDATA_EXPORT virtual void setValue(const std::shared_ptr& thePoint); /// Returns the X double value GEOMDATA_EXPORT virtual double x() const; /// Returns the Y double value GEOMDATA_EXPORT virtual double y() const; /// Returns the 2D point - GEOMDATA_EXPORT virtual boost::shared_ptr pnt(); + GEOMDATA_EXPORT virtual std::shared_ptr pnt(); protected: /// Initializes attributes diff --git a/src/GeomDataAPI/GeomDataAPI.i b/src/GeomDataAPI/GeomDataAPI.i index 603831983..98496183e 100644 --- a/src/GeomDataAPI/GeomDataAPI.i +++ b/src/GeomDataAPI/GeomDataAPI.i @@ -1,17 +1,15 @@ /* GeomDataAPI.i */ %module GeomDataAPI %{ - #include - #include "ModelAPI_Attribute.h" #include "GeomDataAPI.h" #include "GeomDataAPI_Point.h" #include "GeomDataAPI_Dir.h" #include "GeomDataAPI_Point2D.h" - template boost::shared_ptr castTo(boost::shared_ptr theObject) + template std::shared_ptr castTo(std::shared_ptr theObject) { - return boost::dynamic_pointer_cast(theObject); + return std::dynamic_pointer_cast(theObject); } %} @@ -23,9 +21,8 @@ %include "typemaps.i" %include "std_string.i" %include "std_list.i" +%include "std_shared_ptr.i" -// boost pointers -%include %shared_ptr(ModelAPI_Attribute) %shared_ptr(GeomDataAPI_Point) %shared_ptr(GeomDataAPI_Dir) @@ -37,7 +34,7 @@ %include "GeomDataAPI_Dir.h" %include "GeomDataAPI_Point2D.h" -template boost::shared_ptr castTo(boost::shared_ptr theObject); +template std::shared_ptr castTo(std::shared_ptr theObject); %template(geomDataAPI_Point) castTo; %template(geomDataAPI_Dir) castTo; %template(geomDataAPI_Point2D) castTo; diff --git a/src/GeomDataAPI/GeomDataAPI_Dir.h b/src/GeomDataAPI/GeomDataAPI_Dir.h index e8c86f46a..c4bdb19ed 100644 --- a/src/GeomDataAPI/GeomDataAPI_Dir.h +++ b/src/GeomDataAPI/GeomDataAPI_Dir.h @@ -21,7 +21,7 @@ class GeomDataAPI_Dir : public ModelAPI_Attribute /// Defines the double value virtual void setValue(const double theX, const double theY, const double theZ) = 0; /// Defines the direction - virtual void setValue(const boost::shared_ptr& theDir) = 0; + virtual void setValue(const std::shared_ptr& theDir) = 0; /// Returns the X double value virtual double x() const = 0; @@ -30,7 +30,7 @@ class GeomDataAPI_Dir : public ModelAPI_Attribute /// Returns the Z double value virtual double z() const = 0; /// Returns the direction of this attribute - virtual boost::shared_ptr dir() = 0; + virtual std::shared_ptr dir() = 0; /// Returns the type of this class of attributes static inline std::string type() diff --git a/src/GeomDataAPI/GeomDataAPI_Point.h b/src/GeomDataAPI/GeomDataAPI_Point.h index 08ee73951..cc5f4f6f0 100644 --- a/src/GeomDataAPI/GeomDataAPI_Point.h +++ b/src/GeomDataAPI/GeomDataAPI_Point.h @@ -21,7 +21,7 @@ class GeomDataAPI_Point : public ModelAPI_Attribute /// Defines the double value virtual void setValue(const double theX, const double theY, const double theZ) = 0; /// Defines the point - virtual void setValue(const boost::shared_ptr& thePoint) = 0; + virtual void setValue(const std::shared_ptr& thePoint) = 0; /// Returns the X double value virtual double x() const = 0; @@ -30,7 +30,7 @@ class GeomDataAPI_Point : public ModelAPI_Attribute /// Returns the Z double value virtual double z() const = 0; /// Returns the 3D point - virtual boost::shared_ptr pnt() = 0; + virtual std::shared_ptr pnt() = 0; /// Returns the type of this class of attributes static inline std::string type() diff --git a/src/GeomDataAPI/GeomDataAPI_Point2D.h b/src/GeomDataAPI/GeomDataAPI_Point2D.h index c0eb001cf..73df28624 100644 --- a/src/GeomDataAPI/GeomDataAPI_Point2D.h +++ b/src/GeomDataAPI/GeomDataAPI_Point2D.h @@ -21,14 +21,14 @@ class GeomDataAPI_Point2D : public ModelAPI_Attribute /// Defines the double value virtual void setValue(const double theX, const double theY) = 0; /// Defines the point - virtual void setValue(const boost::shared_ptr& thePoint) = 0; + virtual void setValue(const std::shared_ptr& thePoint) = 0; /// Returns the X double value virtual double x() const = 0; /// Returns the Y double value virtual double y() const = 0; /// Returns the 2D point - virtual boost::shared_ptr pnt() = 0; + virtual std::shared_ptr pnt() = 0; /// Appends the delta values to point void move(const double theDeltaX, const double theDeltaY) diff --git a/src/GeomValidators/GeomValidators_Positive.cpp b/src/GeomValidators/GeomValidators_Positive.cpp index d2261b357..3362a47d3 100644 --- a/src/GeomValidators/GeomValidators_Positive.cpp +++ b/src/GeomValidators/GeomValidators_Positive.cpp @@ -21,7 +21,7 @@ GeomValidators_Positive::GeomValidators_Positive() bool GeomValidators_Positive::isValid( const AttributePtr& theAttribute, const std::list& theArguments) const { - boost::shared_ptr aDouble = - boost::dynamic_pointer_cast(theAttribute); + std::shared_ptr aDouble = + std::dynamic_pointer_cast(theAttribute); return aDouble->isInitialized() && aDouble->value() > 1.e-5; } diff --git a/src/Model/Model_Application.cpp b/src/Model/Model_Application.cpp index d53dc665c..6f315ee0e 100644 --- a/src/Model/Model_Application.cpp +++ b/src/Model/Model_Application.cpp @@ -19,14 +19,14 @@ Handle(Model_Application) Model_Application::getApplication() } //======================================================================= -const boost::shared_ptr& Model_Application::getDocument(string theDocID) +const std::shared_ptr& Model_Application::getDocument(string theDocID) { if (myDocs.find(theDocID) != myDocs.end()) return myDocs[theDocID]; static const std::string thePartSetKind("PartSet"); static const std::string thePartKind("Part"); - boost::shared_ptr aNew( + std::shared_ptr aNew( new Model_Document(theDocID, theDocID == "root" ? thePartSetKind : thePartKind)); myDocs[theDocID] = aNew; // load it if it must be loaded by demand diff --git a/src/Model/Model_Application.h b/src/Model/Model_Application.h index d9eb4bb20..3d905dc41 100644 --- a/src/Model/Model_Application.h +++ b/src/Model/Model_Application.h @@ -31,7 +31,7 @@ class Model_Application : public TDocStd_Application //! Retuns the application: one per process MODEL_EXPORT static Handle_Model_Application getApplication(); //! Returns the main document (on first call creates it) by the string identifier - MODEL_EXPORT const boost::shared_ptr& getDocument(std::string theDocID); + MODEL_EXPORT const std::shared_ptr& getDocument(std::string theDocID); //! Returns true if document has been created MODEL_EXPORT bool hasDocument(std::string theDocID); //! Deletes the document from the application @@ -60,7 +60,7 @@ class Model_Application : public TDocStd_Application private: /// Map from string identifiers to created documents of an application - std::map > myDocs; + std::map > myDocs; /// Path for the loaded by demand documents std::string myPath; /// Path for the loaded by demand documents diff --git a/src/Model/Model_AttributeDocRef.cpp b/src/Model/Model_AttributeDocRef.cpp index 67486266c..566533aaf 100644 --- a/src/Model/Model_AttributeDocRef.cpp +++ b/src/Model/Model_AttributeDocRef.cpp @@ -9,7 +9,7 @@ using namespace std; -void Model_AttributeDocRef::setValue(boost::shared_ptr theDoc) +void Model_AttributeDocRef::setValue(std::shared_ptr theDoc) { myDoc = theDoc; TCollection_ExtendedString aNewID(theDoc->id().c_str()); @@ -19,7 +19,7 @@ void Model_AttributeDocRef::setValue(boost::shared_ptr theDoc } } -boost::shared_ptr Model_AttributeDocRef::value() +std::shared_ptr Model_AttributeDocRef::value() { return myDoc; } diff --git a/src/Model/Model_AttributeDocRef.h b/src/Model/Model_AttributeDocRef.h index 6290e05a4..28fc60fd2 100644 --- a/src/Model/Model_AttributeDocRef.h +++ b/src/Model/Model_AttributeDocRef.h @@ -18,13 +18,13 @@ class Model_AttributeDocRef : public ModelAPI_AttributeDocRef { Handle_TDataStd_Comment myComment; ///< reference to document is identified as string-id - boost::shared_ptr myDoc; ///< document referenced by this attribute (if already loaded) + std::shared_ptr myDoc; ///< document referenced by this attribute (if already loaded) public: /// Defines the document referenced from this attribute - MODEL_EXPORT virtual void setValue(boost::shared_ptr theDoc); + MODEL_EXPORT virtual void setValue(std::shared_ptr theDoc); /// Returns document referenced from this attribute - MODEL_EXPORT virtual boost::shared_ptr value(); + MODEL_EXPORT virtual std::shared_ptr value(); protected: /// Initializes attibutes diff --git a/src/Model/Model_AttributeRefAttr.cpp b/src/Model/Model_AttributeRefAttr.cpp index 4e8a52b0e..0410e657b 100644 --- a/src/Model/Model_AttributeRefAttr.cpp +++ b/src/Model/Model_AttributeRefAttr.cpp @@ -14,9 +14,9 @@ bool Model_AttributeRefAttr::isObject() return myID->Get().Length() == 0; } -void Model_AttributeRefAttr::setAttr(boost::shared_ptr theAttr) +void Model_AttributeRefAttr::setAttr(std::shared_ptr theAttr) { - boost::shared_ptr aData = boost::dynamic_pointer_cast( + std::shared_ptr aData = std::dynamic_pointer_cast( theAttr->owner()->data()); string anID = aData->id(theAttr); if (myIsInitialized && object() == theAttr->owner() && myID->Get().IsEqual(anID.c_str())) @@ -26,21 +26,21 @@ void Model_AttributeRefAttr::setAttr(boost::shared_ptr theAt owner()->data()->sendAttributeUpdated(this); } -boost::shared_ptr Model_AttributeRefAttr::attr() +std::shared_ptr Model_AttributeRefAttr::attr() { ObjectPtr anObj = object(); if (anObj) { - boost::shared_ptr aData = boost::dynamic_pointer_cast(anObj->data()); + std::shared_ptr aData = std::dynamic_pointer_cast(anObj->data()); return aData->attribute(TCollection_AsciiString(myID->Get()).ToCString()); } // not initialized - return boost::shared_ptr(); + return std::shared_ptr(); } void Model_AttributeRefAttr::setObject(ObjectPtr theObject) { if (theObject && (!myIsInitialized || myID->Get().Length() != 0 || object() != theObject)) { - boost::shared_ptr aData = boost::dynamic_pointer_cast( + std::shared_ptr aData = std::dynamic_pointer_cast( theObject->data()); myRef->Set(aData->label().Father()); myID->Set(""); // feature is identified by the empty ID @@ -51,7 +51,7 @@ void Model_AttributeRefAttr::setObject(ObjectPtr theObject) ObjectPtr Model_AttributeRefAttr::object() { if (myRef->Get() != myRef->Label()) { // initialized - boost::shared_ptr aDoc = boost::dynamic_pointer_cast( + std::shared_ptr aDoc = std::dynamic_pointer_cast( owner()->document()); if (aDoc) { TDF_Label aRefLab = myRef->Get(); diff --git a/src/Model/Model_AttributeRefAttr.h b/src/Model/Model_AttributeRefAttr.h index 83eaf77f2..1833d3eb9 100644 --- a/src/Model/Model_AttributeRefAttr.h +++ b/src/Model/Model_AttributeRefAttr.h @@ -27,10 +27,10 @@ class Model_AttributeRefAttr : public ModelAPI_AttributeRefAttr MODEL_EXPORT virtual bool isObject(); /// Defines the reference to the attribute - MODEL_EXPORT virtual void setAttr(boost::shared_ptr theAttr); + MODEL_EXPORT virtual void setAttr(std::shared_ptr theAttr); /// Returns attribute referenced from this attribute - MODEL_EXPORT virtual boost::shared_ptr attr(); + MODEL_EXPORT virtual std::shared_ptr attr(); /// Defines the reference to the object MODEL_EXPORT virtual void setObject(ObjectPtr theFeature); diff --git a/src/Model/Model_AttributeRefList.cpp b/src/Model/Model_AttributeRefList.cpp index 014592f0d..8c304cb3b 100644 --- a/src/Model/Model_AttributeRefList.cpp +++ b/src/Model/Model_AttributeRefList.cpp @@ -12,7 +12,7 @@ using namespace std; void Model_AttributeRefList::append(ObjectPtr theObject) { - boost::shared_ptr aData = boost::dynamic_pointer_cast(theObject->data()); + std::shared_ptr aData = std::dynamic_pointer_cast(theObject->data()); myRef->Append(aData->label().Father()); // store label of the object owner()->data()->sendAttributeUpdated(this); @@ -20,7 +20,7 @@ void Model_AttributeRefList::append(ObjectPtr theObject) void Model_AttributeRefList::remove(ObjectPtr theObject) { - boost::shared_ptr aData = boost::dynamic_pointer_cast(theObject->data()); + std::shared_ptr aData = std::dynamic_pointer_cast(theObject->data()); myRef->Remove(aData->label().Father()); owner()->data()->sendAttributeUpdated(this); @@ -34,7 +34,7 @@ int Model_AttributeRefList::size() const list Model_AttributeRefList::list() { std::list aResult; - boost::shared_ptr aDoc = boost::dynamic_pointer_cast( + std::shared_ptr aDoc = std::dynamic_pointer_cast( owner()->document()); if (aDoc) { const TDF_LabelList& aList = myRef->List(); @@ -48,7 +48,7 @@ list Model_AttributeRefList::list() ObjectPtr Model_AttributeRefList::object(const int theIndex) const { - boost::shared_ptr aDoc = boost::dynamic_pointer_cast( + std::shared_ptr aDoc = std::dynamic_pointer_cast( owner()->document()); if (aDoc) { const TDF_LabelList& aList = myRef->List(); diff --git a/src/Model/Model_AttributeReference.cpp b/src/Model/Model_AttributeReference.cpp index 3781fb2a2..e209eb0e1 100644 --- a/src/Model/Model_AttributeReference.cpp +++ b/src/Model/Model_AttributeReference.cpp @@ -15,11 +15,11 @@ void Model_AttributeReference::setValue(ObjectPtr theObject) if(!theObject) return; if (!myIsInitialized || value() != theObject) { - boost::shared_ptr aData = boost::dynamic_pointer_cast( + std::shared_ptr aData = std::dynamic_pointer_cast( theObject->data()); - boost::shared_ptr aDoc = - boost::dynamic_pointer_cast(owner()->document()); + std::shared_ptr aDoc = + std::dynamic_pointer_cast(owner()->document()); myRef->Set(aData->label().Father()); // references to the feature label owner()->data()->sendAttributeUpdated(this); @@ -29,7 +29,7 @@ void Model_AttributeReference::setValue(ObjectPtr theObject) ObjectPtr Model_AttributeReference::value() { if (myIsInitialized) { - boost::shared_ptr aDoc = boost::dynamic_pointer_cast( + std::shared_ptr aDoc = std::dynamic_pointer_cast( owner()->document()); if (aDoc) { TDF_Label aRefLab = myRef->Get(); @@ -47,24 +47,24 @@ Model_AttributeReference::Model_AttributeReference(TDF_Label& theLabel) myRef = TDF_Reference::Set(theLabel, theLabel); // not initialized references to itself } else { if (owner()) { - boost::shared_ptr aDoc = - boost::dynamic_pointer_cast(owner()->document()); + std::shared_ptr aDoc = + std::dynamic_pointer_cast(owner()->document()); } } } -void Model_AttributeReference::setObject(const boost::shared_ptr& theObject) +void Model_AttributeReference::setObject(const std::shared_ptr& theObject) { if (owner() != theObject) { ModelAPI_AttributeReference::setObject(theObject); - boost::shared_ptr aDoc = - boost::dynamic_pointer_cast(owner()->document()); + std::shared_ptr aDoc = + std::dynamic_pointer_cast(owner()->document()); } } Model_AttributeReference::~Model_AttributeReference() { - boost::shared_ptr aDoc = - boost::dynamic_pointer_cast(owner()->document()); + std::shared_ptr aDoc = + std::dynamic_pointer_cast(owner()->document()); TDF_Label aLab = myRef->Get(); } diff --git a/src/Model/Model_AttributeReference.h b/src/Model/Model_AttributeReference.h index b41891bdb..eceb208cb 100644 --- a/src/Model/Model_AttributeReference.h +++ b/src/Model/Model_AttributeReference.h @@ -28,7 +28,7 @@ class Model_AttributeReference : public ModelAPI_AttributeReference MODEL_EXPORT ~Model_AttributeReference(); - MODEL_EXPORT virtual void setObject(const boost::shared_ptr& theObject); + MODEL_EXPORT virtual void setObject(const std::shared_ptr& theObject); protected: /// Objects are created for features automatically diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 05888b5d7..0ae4bf6a8 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -45,9 +45,9 @@ static const int kSTART_VERTEX_DELTA = 1000000; // TDF_Reference - from ReferenceAttribute, the context void Model_AttributeSelection::setValue(const ResultPtr& theContext, - const boost::shared_ptr& theSubShape) + const std::shared_ptr& theSubShape) { - const boost::shared_ptr& anOldShape = value(); + const std::shared_ptr& anOldShape = value(); bool isOldShape = (theSubShape == anOldShape || (theSubShape && anOldShape && theSubShape->isEqual(anOldShape))); if (isOldShape) return; // shape is the same, so context is also unchanged @@ -65,14 +65,14 @@ void Model_AttributeSelection::setValue(const ResultPtr& theContext, owner()->data()->sendAttributeUpdated(this); } -boost::shared_ptr Model_AttributeSelection::value() +std::shared_ptr Model_AttributeSelection::value() { - boost::shared_ptr aResult; + std::shared_ptr aResult; if (myIsInitialized) { Handle(TNaming_NamedShape) aSelection; if (selectionLabel().FindAttribute(TNaming_NamedShape::GetID(), aSelection)) { TopoDS_Shape aSelShape = aSelection->Get(); - aResult = boost::shared_ptr(new GeomAPI_Shape); + aResult = std::shared_ptr(new GeomAPI_Shape); aResult->setImpl(new TopoDS_Shape(aSelShape)); } } @@ -86,11 +86,11 @@ Model_AttributeSelection::Model_AttributeSelection(TDF_Label& theLabel) } ResultPtr Model_AttributeSelection::context() { - return boost::dynamic_pointer_cast(myRef.value()); + return std::dynamic_pointer_cast(myRef.value()); } -void Model_AttributeSelection::setObject(const boost::shared_ptr& theObject) +void Model_AttributeSelection::setObject(const std::shared_ptr& theObject) { ModelAPI_AttributeSelection::setObject(theObject); myRef.setObject(theObject); @@ -110,9 +110,9 @@ bool Model_AttributeSelection::update() } else if (aContext->groupName() == ModelAPI_ResultConstruction::group()) { // construction: identification by the results indexes, recompute faces and // take the face that more close by the indexes - boost::shared_ptr aWirePtr = - boost::dynamic_pointer_cast( - boost::dynamic_pointer_cast(aContext)->shape()); + std::shared_ptr aWirePtr = + std::dynamic_pointer_cast( + std::dynamic_pointer_cast(aContext)->shape()); if (aWirePtr && aWirePtr->hasPlane()) { TDF_Label aLab = myRef.myRef->Label(); // getting a type of selected shape @@ -123,26 +123,26 @@ bool Model_AttributeSelection::update() TopAbs_ShapeEnum aShapeType = (TopAbs_ShapeEnum)(aTypeAttr->Get()); // selected indexes will be needed in each "if" Handle(TDataStd_IntPackedMap) aSubIds; - boost::shared_ptr aNewSelected; + std::shared_ptr aNewSelected; bool aNoIndexes = !aLab.FindAttribute(TDataStd_IntPackedMap::GetID(), aSubIds) || aSubIds->Extent() == 0; // for now working only with composite features FeaturePtr aContextFeature = owner()->document()->feature(aContext); CompositeFeaturePtr aComposite = - boost::dynamic_pointer_cast(aContextFeature); + std::dynamic_pointer_cast(aContextFeature); if (!aComposite || aComposite->numberOfSubs() == 0) { return false; } if (aShapeType == TopAbs_FACE) { // If this is a wire with plane defined thin it is a sketch-like object - std::list > aFaces; + std::list > aFaces; GeomAlgoAPI_SketchBuilder::createFaces(aWirePtr->origin(), aWirePtr->dirX(), aWirePtr->dirY(), aWirePtr->norm(), aWirePtr, aFaces); if (aFaces.empty()) // no faces, update can not work correctly return false; // if there is no edges indexes, any face can be used: take the first - boost::shared_ptr aNewSelected; + std::shared_ptr aNewSelected; if (aNoIndexes) { aNewSelected = *(aFaces.begin()); } else { // searching for most looks-like initial face by the indexes @@ -152,11 +152,11 @@ bool Model_AttributeSelection::update() for(int a = 0; a < aSubNum; a++) { if (aSubIds->Contains(aComposite->subFeatureId(a))) { FeaturePtr aSub = aComposite->subFeature(a); - const std::list >& aResults = aSub->results(); - std::list >::const_iterator aRes; + const std::list >& aResults = aSub->results(); + std::list >::const_iterator aRes; for(aRes = aResults.cbegin(); aRes != aResults.cend(); aRes++) { ResultConstructionPtr aConstr = - boost::dynamic_pointer_cast(*aRes); + std::dynamic_pointer_cast(*aRes); if (aConstr->shape() && aConstr->shape()->isEdge()) { const TopoDS_Shape& aResShape = aConstr->shape()->impl(); TopoDS_Edge anEdge = TopoDS::Edge(aResShape); @@ -170,7 +170,7 @@ bool Model_AttributeSelection::update() } } // iterate new result faces and searching for these edges - std::list >::iterator aFacesIter = aFaces.begin(); + std::list >::iterator aFacesIter = aFaces.begin(); double aBestFound = 0; // best percentage of found edges for(; aFacesIter != aFaces.end(); aFacesIter++) { int aFound = 0, aNotFound = 0; @@ -209,11 +209,11 @@ bool Model_AttributeSelection::update() if (aSubIds->IsEmpty() || aSubIds->Contains(aComposite->subFeatureId(a))) { // found the appropriate feature FeaturePtr aFeature = aComposite->subFeature(a); - std::list >::const_iterator aResIter = + std::list >::const_iterator aResIter = aFeature->results().cbegin(); for(;aResIter != aFeature->results().cend(); aResIter++) { ResultConstructionPtr aRes = - boost::dynamic_pointer_cast(*aResIter); + std::dynamic_pointer_cast(*aResIter); if (aRes && aRes->shape() && aRes->shape()->isEdge()) { // found! selectConstruction(aContext, aRes->shape()); owner()->data()->sendAttributeUpdated(this); @@ -235,11 +235,11 @@ bool Model_AttributeSelection::update() else if (aSubIds->Contains(aFeatureID + kSTART_VERTEX_DELTA)) aVertexNum = 2; // found the feature with appropriate edge FeaturePtr aFeature = aComposite->subFeature(a); - std::list >::const_iterator aResIter = + std::list >::const_iterator aResIter = aFeature->results().cbegin(); for(;aResIter != aFeature->results().cend(); aResIter++) { ResultConstructionPtr aRes = - boost::dynamic_pointer_cast(*aResIter); + std::dynamic_pointer_cast(*aResIter); if (aRes && aRes->shape()) { if (aRes->shape()->isVertex() && aVertexNum == 0) { // found! selectConstruction(aContext, aRes->shape()); @@ -250,7 +250,7 @@ bool Model_AttributeSelection::update() int aVIndex = 1; for(TopExp_Explorer aVExp(anEdge, TopAbs_VERTEX); aVExp.More(); aVExp.Next()) { if (aVIndex == aVertexNum) { // found! - boost::shared_ptr aVertex(new GeomAPI_Shape); + std::shared_ptr aVertex(new GeomAPI_Shape); aVertex->setImpl(new TopoDS_Shape(aVExp.Current())); selectConstruction(aContext, aVertex); owner()->data()->sendAttributeUpdated(this); @@ -271,18 +271,18 @@ bool Model_AttributeSelection::update() void Model_AttributeSelection::selectBody( - const ResultPtr& theContext, const boost::shared_ptr& theSubShape) + const ResultPtr& theContext, const std::shared_ptr& theSubShape) { // perform the selection TNaming_Selector aSel(selectionLabel()); TopoDS_Shape aNewShape = theSubShape ? theSubShape->impl() : TopoDS_Shape(); TopoDS_Shape aContext; - ResultBodyPtr aBody = boost::dynamic_pointer_cast(myRef.value()); + ResultBodyPtr aBody = std::dynamic_pointer_cast(myRef.value()); if (aBody) aContext = aBody->shape()->impl(); else { - ResultConstructionPtr aConstr = boost::dynamic_pointer_cast(myRef.value()); + ResultConstructionPtr aConstr = std::dynamic_pointer_cast(myRef.value()); if (aConstr) { aContext = aConstr->shape()->impl(); } else { @@ -294,15 +294,15 @@ void Model_AttributeSelection::selectBody( } void Model_AttributeSelection::selectConstruction( - const ResultPtr& theContext, const boost::shared_ptr& theSubShape) + const ResultPtr& theContext, const std::shared_ptr& theSubShape) { FeaturePtr aContextFeature = owner()->document()->feature(theContext); CompositeFeaturePtr aComposite = - boost::dynamic_pointer_cast(aContextFeature); + std::dynamic_pointer_cast(aContextFeature); if (!aComposite || aComposite->numberOfSubs() == 0) { return; // saving of context is enough: result construction contains exactly the needed shape } - boost::shared_ptr aData = boost::dynamic_pointer_cast(owner()->data()); + std::shared_ptr aData = std::dynamic_pointer_cast(owner()->data()); TDF_Label aLab = myRef.myRef->Label(); // identify the reuslts of sub-object of the composite by edges const TopoDS_Shape& aSubShape = theSubShape->impl(); @@ -327,12 +327,12 @@ void Model_AttributeSelection::selectConstruction( const int aSubNum = aComposite->numberOfSubs(); for(int a = 0; a < aSubNum; a++) { FeaturePtr aSub = aComposite->subFeature(a); - const std::list >& aResults = aSub->results(); - std::list >::const_iterator aRes = aResults.cbegin(); + const std::list >& aResults = aSub->results(); + std::list >::const_iterator aRes = aResults.cbegin(); // there may be many shapes (circle and center): register if at least one is in selection for(; aRes != aResults.cend(); aRes++) { ResultConstructionPtr aConstr = - boost::dynamic_pointer_cast(*aRes); + std::dynamic_pointer_cast(*aRes); if (!aConstr->shape()) { continue; } diff --git a/src/Model/Model_AttributeSelection.h b/src/Model/Model_AttributeSelection.h index 150847679..f2d8106ea 100644 --- a/src/Model/Model_AttributeSelection.h +++ b/src/Model/Model_AttributeSelection.h @@ -20,16 +20,16 @@ class Model_AttributeSelection : public ModelAPI_AttributeSelection public: /// Defines the result and its selected sub-shape MODEL_EXPORT virtual void setValue( - const ResultPtr& theContext, const boost::shared_ptr& theSubShape); + const ResultPtr& theContext, const std::shared_ptr& theSubShape); /// Returns the selected subshape - MODEL_EXPORT virtual boost::shared_ptr value(); + MODEL_EXPORT virtual std::shared_ptr value(); /// Returns the context of the selection (the whole shape owner) MODEL_EXPORT virtual ResultPtr context(); /// Sets the feature object - MODEL_EXPORT virtual void setObject(const boost::shared_ptr& theObject); + MODEL_EXPORT virtual void setObject(const std::shared_ptr& theObject); /// Updates the underlied selection due to the changes in the referenced objects /// \returns false if update is failed @@ -42,10 +42,10 @@ protected: /// Performs the selection for the body result (TNaming selection) virtual void selectBody( - const ResultPtr& theContext, const boost::shared_ptr& theSubShape); + const ResultPtr& theContext, const std::shared_ptr& theSubShape); /// Performs the selection for the construction result (selection by index) virtual void selectConstruction( - const ResultPtr& theContext, const boost::shared_ptr& theSubShape); + const ResultPtr& theContext, const std::shared_ptr& theSubShape); /// Returns the label where TNaming_Selection results are stored /// Note: there must be no attributes stored at the same label because Selector clears this lab diff --git a/src/Model/Model_AttributeSelectionList.cpp b/src/Model/Model_AttributeSelectionList.cpp index 4a2012a33..96a2ccb32 100644 --- a/src/Model/Model_AttributeSelectionList.cpp +++ b/src/Model/Model_AttributeSelectionList.cpp @@ -13,13 +13,13 @@ using namespace std; void Model_AttributeSelectionList::append( - const ResultPtr& theContext, const boost::shared_ptr& theSubShape) + const ResultPtr& theContext, const std::shared_ptr& theSubShape) { int aNewTag = mySize->Get() + 1; TDF_Label aNewLab = mySize->Label().FindChild(aNewTag); - boost::shared_ptr aNewAttr = - boost::shared_ptr(new Model_AttributeSelection(aNewLab)); + std::shared_ptr aNewAttr = + std::shared_ptr(new Model_AttributeSelection(aNewLab)); if (owner()) { aNewAttr->setObject(owner()); } @@ -43,15 +43,15 @@ void Model_AttributeSelectionList::setSelectionType(int theType) mySelectionType->Set((double) theType); } -boost::shared_ptr +std::shared_ptr Model_AttributeSelectionList::value(const int theIndex) { TDF_Label aLabel = mySize->Label().FindChild(theIndex + 1); // create a new attribute each time, by demand // supporting of old attributes is too slow (synch each time) and buggy on redo // (if attribute is deleted and created, the abort updates attriute and makes the Attr invalid) - boost::shared_ptr aNewAttr = - boost::shared_ptr(new Model_AttributeSelection(aLabel)); + std::shared_ptr aNewAttr = + std::shared_ptr(new Model_AttributeSelection(aLabel)); if (owner()) { aNewAttr->setObject(owner()); } diff --git a/src/Model/Model_AttributeSelectionList.h b/src/Model/Model_AttributeSelectionList.h index e52937e72..602e5b238 100644 --- a/src/Model/Model_AttributeSelectionList.h +++ b/src/Model/Model_AttributeSelectionList.h @@ -25,7 +25,7 @@ class Model_AttributeSelectionList : public ModelAPI_AttributeSelectionList public: /// Adds the new reference to the end of the list MODEL_EXPORT virtual void append( - const ResultPtr& theContext, const boost::shared_ptr& theSubShape); + const ResultPtr& theContext, const std::shared_ptr& theSubShape); /// Returns the number ofselection attributes in the list MODEL_EXPORT virtual int size(); @@ -35,7 +35,7 @@ public: MODEL_EXPORT virtual void setSelectionType(int); /// Returns the attribute selection by the index (zero based) - MODEL_EXPORT virtual boost::shared_ptr value(const int theIndex); + MODEL_EXPORT virtual std::shared_ptr value(const int theIndex); /// Returns all attributes MODEL_EXPORT virtual void clear(); diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 90bb20e2e..77b834ada 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -93,22 +93,22 @@ void Model_Data::addAttribute(const std::string& theID, const std::string theAtt anAttr = new GeomData_Point2D(anAttrLab); } if (anAttr) { - myAttrs[theID] = boost::shared_ptr(anAttr); + myAttrs[theID] = std::shared_ptr(anAttr); anAttr->setObject(myObject); } else { Events_Error::send("Can not create unknown type of attribute " + theAttrType); } } -boost::shared_ptr Model_Data::document(const std::string& theID) +std::shared_ptr Model_Data::document(const std::string& theID) { - std::map >::iterator aFound = + std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { // TODO: generate error on unknown attribute request and/or add mechanism for customization - return boost::shared_ptr(); + return std::shared_ptr(); } - boost::shared_ptr aRes = boost::dynamic_pointer_cast< + std::shared_ptr aRes = std::dynamic_pointer_cast< ModelAPI_AttributeDocRef>(aFound->second); if (!aRes) { // TODO: generate error on invalid attribute type request @@ -116,15 +116,15 @@ boost::shared_ptr Model_Data::document(const std::stri return aRes; } -boost::shared_ptr Model_Data::real(const std::string& theID) +std::shared_ptr Model_Data::real(const std::string& theID) { - std::map >::iterator aFound = + std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { // TODO: generate error on unknown attribute request and/or add mechanism for customization - return boost::shared_ptr(); + return std::shared_ptr(); } - boost::shared_ptr aRes = boost::dynamic_pointer_cast< + std::shared_ptr aRes = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(aFound->second); if (!aRes) { // TODO: generate error on invalid attribute type request @@ -132,15 +132,15 @@ boost::shared_ptr Model_Data::real(const std::string& return aRes; } -boost::shared_ptr Model_Data::integer(const std::string& theID) +std::shared_ptr Model_Data::integer(const std::string& theID) { - std::map >::iterator aFound = + std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { // TODO: generate error on unknown attribute request and/or add mechanism for customization - return boost::shared_ptr(); + return std::shared_ptr(); } - boost::shared_ptr aRes = boost::dynamic_pointer_cast< + std::shared_ptr aRes = std::dynamic_pointer_cast< ModelAPI_AttributeInteger>(aFound->second); if (!aRes) { // TODO: generate error on invalid attribute type request @@ -148,15 +148,15 @@ boost::shared_ptr Model_Data::integer(const std::stri return aRes; } -boost::shared_ptr Model_Data::boolean(const std::string& theID) +std::shared_ptr Model_Data::boolean(const std::string& theID) { - std::map >::iterator aFound = + std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { // TODO: generate error on unknown attribute request and/or add mechanism for customization - return boost::shared_ptr(); + return std::shared_ptr(); } - boost::shared_ptr aRes = boost::dynamic_pointer_cast< + std::shared_ptr aRes = std::dynamic_pointer_cast< ModelAPI_AttributeBoolean>(aFound->second); if (!aRes) { // TODO: generate error on invalid attribute type request @@ -164,16 +164,16 @@ boost::shared_ptr Model_Data::boolean(const std::stri return aRes; } -boost::shared_ptr Model_Data::string(const std::string& theID) +std::shared_ptr Model_Data::string(const std::string& theID) { - std::map >::iterator aFound = + std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { // TODO: generate error on unknown attribute request and/or add mechanism for customization - return boost::shared_ptr(); + return std::shared_ptr(); } - boost::shared_ptr aRes = - boost::dynamic_pointer_cast(aFound->second); + std::shared_ptr aRes = + std::dynamic_pointer_cast(aFound->second); if (!aRes) { // TODO: generate error on invalid attribute type request } @@ -181,15 +181,15 @@ boost::shared_ptr Model_Data::string(const std::string } -boost::shared_ptr Model_Data::reference(const std::string& theID) +std::shared_ptr Model_Data::reference(const std::string& theID) { - std::map >::iterator aFound = + std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { // TODO: generate error on unknown attribute request and/or add mechanism for customization - return boost::shared_ptr(); + return std::shared_ptr(); } - boost::shared_ptr aRes = boost::dynamic_pointer_cast< + std::shared_ptr aRes = std::dynamic_pointer_cast< ModelAPI_AttributeReference>(aFound->second); if (!aRes) { // TODO: generate error on invalid attribute type request @@ -197,48 +197,48 @@ boost::shared_ptr Model_Data::reference(const std:: return aRes; } -boost::shared_ptr Model_Data::selection(const std::string& theID) +std::shared_ptr Model_Data::selection(const std::string& theID) { - std::map >::iterator aFound = + std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { // TODO: generate error on unknown attribute request and/or add mechanism for customization - return boost::shared_ptr(); + return std::shared_ptr(); } - boost::shared_ptr aRes = - boost::dynamic_pointer_cast(aFound->second); + std::shared_ptr aRes = + std::dynamic_pointer_cast(aFound->second); if (!aRes) { // TODO: generate error on invalid attribute type request } return aRes; } -boost::shared_ptr +std::shared_ptr Model_Data::selectionList(const std::string& theID) { - std::map >::iterator aFound = + std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { // TODO: generate error on unknown attribute request and/or add mechanism for customization - return boost::shared_ptr(); + return std::shared_ptr(); } - boost::shared_ptr aRes = - boost::dynamic_pointer_cast(aFound->second); + std::shared_ptr aRes = + std::dynamic_pointer_cast(aFound->second); if (!aRes) { // TODO: generate error on invalid attribute type request } return aRes; } -boost::shared_ptr Model_Data::refattr(const std::string& theID) +std::shared_ptr Model_Data::refattr(const std::string& theID) { - std::map >::iterator aFound = + std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { // TODO: generate error on unknown attribute request and/or add mechanism for customization - return boost::shared_ptr(); + return std::shared_ptr(); } - boost::shared_ptr aRes = boost::dynamic_pointer_cast< + std::shared_ptr aRes = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aFound->second); if (!aRes) { // TODO: generate error on invalid attribute type request @@ -246,15 +246,15 @@ boost::shared_ptr Model_Data::refattr(const std::stri return aRes; } -boost::shared_ptr Model_Data::reflist(const std::string& theID) +std::shared_ptr Model_Data::reflist(const std::string& theID) { - std::map >::iterator aFound = + std::map >::iterator aFound = myAttrs.find(theID); if (aFound == myAttrs.end()) { // TODO: generate error on unknown attribute request and/or add mechanism for customization - return boost::shared_ptr(); + return std::shared_ptr(); } - boost::shared_ptr aRes = boost::dynamic_pointer_cast< + std::shared_ptr aRes = std::dynamic_pointer_cast< ModelAPI_AttributeRefList>(aFound->second); if (!aRes) { // TODO: generate error on invalid attribute type request @@ -262,17 +262,17 @@ boost::shared_ptr Model_Data::reflist(const std::stri return aRes; } -boost::shared_ptr Model_Data::attribute(const std::string& theID) +std::shared_ptr Model_Data::attribute(const std::string& theID) { - boost::shared_ptr aResult; + std::shared_ptr aResult; if (myAttrs.find(theID) == myAttrs.end()) // no such attribute return aResult; return myAttrs[theID]; } -const std::string& Model_Data::id(const boost::shared_ptr& theAttr) +const std::string& Model_Data::id(const std::shared_ptr& theAttr) { - std::map >::iterator anAttr = + std::map >::iterator anAttr = myAttrs.begin(); for (; anAttr != myAttrs.end(); anAttr++) { if (anAttr->second == theAttr) @@ -283,9 +283,9 @@ const std::string& Model_Data::id(const boost::shared_ptr& t return anEmpty; } -bool Model_Data::isEqual(const boost::shared_ptr& theData) +bool Model_Data::isEqual(const std::shared_ptr& theData) { - boost::shared_ptr aData = boost::dynamic_pointer_cast(theData); + std::shared_ptr aData = std::dynamic_pointer_cast(theData); if (aData) return myLab.IsEqual(aData->myLab) == Standard_True ; return false; @@ -296,10 +296,10 @@ bool Model_Data::isValid() return !myLab.IsNull() && myLab.HasAttribute(); } -std::list > Model_Data::attributes(const std::string& theType) +std::list > Model_Data::attributes(const std::string& theType) { - std::list > aResult; - std::map >::iterator anAttrsIter = + std::list > aResult; + std::map >::iterator anAttrsIter = myAttrs.begin(); for (; anAttrsIter != myAttrs.end(); anAttrsIter++) { if (theType.empty() || anAttrsIter->second->attributeType() == theType) { @@ -312,7 +312,7 @@ std::list > Model_Data::attributes(const s std::list Model_Data::attributesIDs(const std::string& theType) { std::list aResult; - std::map >::iterator anAttrsIter = + std::map >::iterator anAttrsIter = myAttrs.begin(); for (; anAttrsIter != myAttrs.end(); anAttrsIter++) { if (theType.empty() || anAttrsIter->second->attributeType() == theType) { @@ -364,8 +364,8 @@ int Model_Data::featureId() const void Model_Data::eraseBackReferences() { myRefsToMe.clear(); - boost::shared_ptr aRes = - boost::dynamic_pointer_cast(myObject); + std::shared_ptr aRes = + std::dynamic_pointer_cast(myObject); if (aRes) aRes->setIsConcealed(false); } @@ -374,8 +374,8 @@ void Model_Data::addBackReference(FeaturePtr theFeature, std::string theAttrID) { myRefsToMe.insert(theFeature->data()->attribute(theAttrID)); if (ModelAPI_Session::get()->validators()->isConcealed(theFeature->getKind(), theAttrID)) { - boost::shared_ptr aRes = - boost::dynamic_pointer_cast(myObject); + std::shared_ptr aRes = + std::dynamic_pointer_cast(myObject); if (aRes) { aRes->setIsConcealed(true); } @@ -385,27 +385,27 @@ void Model_Data::addBackReference(FeaturePtr theFeature, std::string theAttrID) void Model_Data::referencesToObjects( std::list > >& theRefs) { - std::map >::iterator anAttr = myAttrs.begin(); + std::map >::iterator anAttr = myAttrs.begin(); std::list aReferenced; // not inside of cycle to avoid excess memory menagement for(; anAttr != myAttrs.end(); anAttr++) { std::string aType = anAttr->second->attributeType(); if (aType == ModelAPI_AttributeReference::type()) { // reference to object - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeReference>(anAttr->second); aReferenced.push_back(aRef->value()); theRefs.push_back(std::pair >(anAttr->first, aReferenced)); } else if (aType == ModelAPI_AttributeRefAttr::type()) { // reference to attribute or object - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(anAttr->second); aReferenced.push_back(aRef->isObject() ? aRef->object() : aRef->attr()->owner()); } else if (aType == ModelAPI_AttributeRefList::type()) { // list of references - aReferenced = boost::dynamic_pointer_cast(anAttr->second)->list(); + aReferenced = std::dynamic_pointer_cast(anAttr->second)->list(); } else if (aType == ModelAPI_AttributeSelection::type()) { // selection attribute - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeSelection>(anAttr->second); aReferenced.push_back(aRef->context()); } else if (aType == ModelAPI_AttributeSelectionList::type()) { // list of selection attributes - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeSelectionList>(anAttr->second); for(int a = aRef->size() - 1; a >= 0; a--) { aReferenced.push_back(aRef->value(a)->context()); diff --git a/src/Model/Model_Data.h b/src/Model/Model_Data.h index f23e684ca..1d82ad14b 100644 --- a/src/Model/Model_Data.h +++ b/src/Model/Model_Data.h @@ -21,7 +21,7 @@ #include -#include +#include #include #include @@ -40,7 +40,7 @@ class Model_Data : public ModelAPI_Data { TDF_Label myLab; ///< label of the feature in the document /// All attributes of the object identified by the attribute ID - std::map > myAttrs; + std::map > myAttrs; /// needed here to emit signal that object changed on change of the attribute ObjectPtr myObject; @@ -69,39 +69,39 @@ class Model_Data : public ModelAPI_Data /// Defines the name of the feature visible by the user in the object browser MODEL_EXPORT virtual void setName(const std::string& theName); /// Returns the attribute that references to another document - MODEL_EXPORT virtual boost::shared_ptr document(const std::string& theID); + MODEL_EXPORT virtual std::shared_ptr document(const std::string& theID); /// Returns the attribute that contains real value with double precision - MODEL_EXPORT virtual boost::shared_ptr real(const std::string& theID); + MODEL_EXPORT virtual std::shared_ptr real(const std::string& theID); /// Returns the attribute that contains integer value - MODEL_EXPORT virtual boost::shared_ptr + MODEL_EXPORT virtual std::shared_ptr integer(const std::string& theID); /// Returns the attribute that contains reference to a feature - MODEL_EXPORT virtual boost::shared_ptr + MODEL_EXPORT virtual std::shared_ptr reference(const std::string& theID); /// Returns the attribute that contains selection to a shape - MODEL_EXPORT virtual boost::shared_ptr + MODEL_EXPORT virtual std::shared_ptr selection(const std::string& theID); /// Returns the attribute that contains selection to a shape - MODEL_EXPORT virtual boost::shared_ptr + MODEL_EXPORT virtual std::shared_ptr selectionList(const std::string& theID); /// Returns the attribute that contains reference to an attribute of a feature - MODEL_EXPORT virtual boost::shared_ptr + MODEL_EXPORT virtual std::shared_ptr refattr(const std::string& theID); /// Returns the attribute that contains list of references to features - MODEL_EXPORT virtual boost::shared_ptr + MODEL_EXPORT virtual std::shared_ptr reflist(const std::string& theID); /// Returns the attribute that contains boolean value - MODEL_EXPORT virtual boost::shared_ptr + MODEL_EXPORT virtual std::shared_ptr boolean(const std::string& theID); /// Returns the attribute that contains real value with double precision - MODEL_EXPORT virtual boost::shared_ptr + MODEL_EXPORT virtual std::shared_ptr string(const std::string& theID); /// Returns the generic attribute by identifier /// \param theID identifier of the attribute - MODEL_EXPORT virtual boost::shared_ptr attribute(const std::string& theID); + MODEL_EXPORT virtual std::shared_ptr attribute(const std::string& theID); /// Returns all attributes of the feature of the given type /// or all attributes if "theType" is empty - MODEL_EXPORT virtual std::list > + MODEL_EXPORT virtual std::list > attributes(const std::string& theType); /// Returns all attributes ids of the feature of the given type /// or all attributes if "theType" is empty @@ -109,9 +109,9 @@ class Model_Data : public ModelAPI_Data /// Identifier by the id (not fast, iteration by map) /// \param theAttr attribute already created in this data - MODEL_EXPORT virtual const std::string& id(const boost::shared_ptr& theAttr); + MODEL_EXPORT virtual const std::string& id(const std::shared_ptr& theAttr); /// Returns true if data belongs to same features - MODEL_EXPORT virtual bool isEqual(const boost::shared_ptr& theData); + MODEL_EXPORT virtual bool isEqual(const std::shared_ptr& theData); /// Returns true if it is correctly connected t othe data model MODEL_EXPORT virtual bool isValid(); diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 1c9028567..0fa26c8d4 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -204,7 +204,7 @@ bool Model_Document::save(const char* theFileName, std::list& theRe void Model_Document::close(const bool theForever) { - boost::shared_ptr aPM = Model_Session::get(); + std::shared_ptr aPM = Model_Session::get(); if (this != aPM->moduleDocument().get() && this == aPM->activeDocument().get()) { aPM->setActiveDocument(aPM->moduleDocument()); } @@ -215,10 +215,10 @@ void Model_Document::close(const bool theForever) mySubs.clear(); // close for thid document needs no transaction in this document - boost::static_pointer_cast(Model_Session::get())->setCheckTransactions(false); + std::static_pointer_cast(Model_Session::get())->setCheckTransactions(false); // delete all features of this document - boost::shared_ptr aThis = + std::shared_ptr aThis = Model_Application::getApplication()->getDocument(myID); Events_Loop* aLoop = Events_Loop::loop(); NCollection_DataMap::Iterator aFeaturesIter(myObjs); @@ -240,7 +240,7 @@ void Model_Document::close(const bool theForever) myDoc->Close(); } - boost::static_pointer_cast(Model_Session::get())->setCheckTransactions(true); + std::static_pointer_cast(Model_Session::get())->setCheckTransactions(true); } void Model_Document::startOperation() @@ -289,7 +289,7 @@ void Model_Document::finishOperation() { // just to be sure that everybody knows that changes were performed if (!myDoc->HasOpenCommand() && myNestedNum != -1) - boost::static_pointer_cast(Model_Session::get()) + std::static_pointer_cast(Model_Session::get()) ->setCheckTransactions(false); // for nested transaction commit synchronizeBackRefs(); Events_Loop* aLoop = Events_Loop::loop(); @@ -303,7 +303,7 @@ void Model_Document::finishOperation() // and to rebuild everything after all updates and creates if (Model_Session::get()->moduleDocument().get() == this) { // once for root document Events_Loop::loop()->autoFlush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); - static boost::shared_ptr aFinishMsg + static std::shared_ptr aFinishMsg (new Events_Message(Events_Loop::eventByName("FinishOperation"))); Events_Loop::loop()->send(aFinishMsg); Events_Loop::loop()->autoFlush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED), false); @@ -312,7 +312,7 @@ void Model_Document::finishOperation() //aLoop->clear(Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); if (!myDoc->HasOpenCommand() && myNestedNum != -1) - boost::static_pointer_cast(Model_Session::get()) + std::static_pointer_cast(Model_Session::get()) ->setCheckTransactions(true); // for nested transaction commit // finish for all subs first: to avoid nested finishing and "isOperation" calls problems inside @@ -445,7 +445,7 @@ FeaturePtr Model_Document::addFeature(std::string theID) FeaturePtr aFeature = ModelAPI_Session::get()->createFeature(theID); if (!aFeature) return aFeature; - boost::shared_ptr aDocToAdd = boost::dynamic_pointer_cast( + std::shared_ptr aDocToAdd = std::dynamic_pointer_cast( aFeature->documentToAdd()); if (aFeature) { TDF_Label aFeatureLab; @@ -511,8 +511,8 @@ void Model_Document::removeFeature(FeaturePtr theFeature, const bool theCheck) // check the feature: it must have no depended objects on it std::list::const_iterator aResIter = theFeature->results().cbegin(); for(; aResIter != theFeature->results().cend(); aResIter++) { - boost::shared_ptr aData = - boost::dynamic_pointer_cast((*aResIter)->data()); + std::shared_ptr aData = + std::dynamic_pointer_cast((*aResIter)->data()); if (aData && !aData->refsToMe().empty()) { Events_Error::send( "Feature '" + theFeature->data()->name() + "' is used and can not be deleted"); @@ -521,7 +521,7 @@ void Model_Document::removeFeature(FeaturePtr theFeature, const bool theCheck) } } - boost::shared_ptr aData = boost::static_pointer_cast(theFeature->data()); + std::shared_ptr aData = std::static_pointer_cast(theFeature->data()); if (aData) { TDF_Label aFeatureLabel = aData->label().Father(); if (myObjs.IsBound(aFeatureLabel)) @@ -557,10 +557,10 @@ ObjectPtr Model_Document::object(TDF_Label theLabel) TDF_Label aFeatureLabel = theLabel.Father().Father(); // let's suppose it is result aFeature = feature(aFeatureLabel); if (aFeature) { - const std::list >& aResults = aFeature->results(); - std::list >::const_iterator aRIter = aResults.cbegin(); + const std::list >& aResults = aFeature->results(); + std::list >::const_iterator aRIter = aResults.cbegin(); for (; aRIter != aResults.cend(); aRIter++) { - boost::shared_ptr aResData = boost::dynamic_pointer_cast( + std::shared_ptr aResData = std::dynamic_pointer_cast( (*aRIter)->data()); if (aResData->label().Father().IsEqual(theLabel)) return *aRIter; @@ -569,7 +569,7 @@ ObjectPtr Model_Document::object(TDF_Label theLabel) return FeaturePtr(); // not found } -boost::shared_ptr Model_Document::subDocument(std::string theDocID) +std::shared_ptr Model_Document::subDocument(std::string theDocID) { // just store sub-document identifier here to manage it later if (mySubs.find(theDocID) == mySubs.end()) @@ -577,12 +577,12 @@ boost::shared_ptr Model_Document::subDocument(std::string the return Model_Application::getApplication()->getDocument(theDocID); } -boost::shared_ptr Model_Document::subDoc(std::string theDocID) +std::shared_ptr Model_Document::subDoc(std::string theDocID) { // just store sub-document identifier here to manage it later if (mySubs.find(theDocID) == mySubs.end()) mySubs.insert(theDocID); - return boost::dynamic_pointer_cast( + return std::dynamic_pointer_cast( Model_Application::getApplication()->getDocument(theDocID)); } @@ -616,8 +616,8 @@ ObjectPtr Model_Document::object(const std::string& theGroupID, const int theInd for (; aLabIter.More(); aLabIter.Next()) { TDF_Label aFLabel = aLabIter.Value()->Label(); FeaturePtr aFeature = feature(aFLabel); - const std::list >& aResults = aFeature->results(); - std::list >::const_iterator aRIter = aResults.begin(); + const std::list >& aResults = aFeature->results(); + std::list >::const_iterator aRIter = aResults.begin(); for (; aRIter != aResults.cend(); aRIter++) { if ((*aRIter)->groupName() != theGroupID) continue; bool isIn = theHidden && (*aRIter)->isInHistory(); @@ -655,8 +655,8 @@ int Model_Document::size(const std::string& theGroupID, const bool theHidden) FeaturePtr aFeature = feature(aFLabel); if (!aFeature) // may be on close continue; - const std::list >& aResults = aFeature->results(); - std::list >::const_iterator aRIter = aResults.begin(); + const std::list >& aResults = aFeature->results(); + std::list >::const_iterator aRIter = aResults.begin(); for (; aRIter != aResults.cend(); aRIter++) { if ((*aRIter)->groupName() != theGroupID) continue; bool isIn = theHidden; @@ -698,8 +698,8 @@ void Model_Document::setUniqueName(FeaturePtr theFeature) FeaturePtr aFeature = aFIter.Value(); bool isSameName = aFeature->data()->name() == aName; if (!isSameName) { // check also results to avoid same results names (actual for Parts) - const std::list >& aResults = aFeature->results(); - std::list >::const_iterator aRIter = aResults.begin(); + const std::list >& aResults = aFeature->results(); + std::list >::const_iterator aRIter = aResults.begin(); for (; aRIter != aResults.cend(); aRIter++) { isSameName = (*aRIter)->data()->name() == aName; } @@ -719,14 +719,14 @@ void Model_Document::setUniqueName(FeaturePtr theFeature) void Model_Document::initData(ObjectPtr theObj, TDF_Label theLab, const int theTag) { - boost::shared_ptr aThis = Model_Application::getApplication()->getDocument( + std::shared_ptr aThis = Model_Application::getApplication()->getDocument( myID); - boost::shared_ptr aData(new Model_Data); + std::shared_ptr aData(new Model_Data); aData->setLabel(theLab.FindChild(theTag)); aData->setObject(theObj); theObj->setDoc(aThis); theObj->setData(aData); - FeaturePtr aFeature = boost::dynamic_pointer_cast(theObj); + FeaturePtr aFeature = std::dynamic_pointer_cast(theObj); if (aFeature) { setUniqueName(aFeature); // must be before "initAttributes" because duplicate part uses name aFeature->initAttributes(); @@ -735,10 +735,10 @@ void Model_Document::initData(ObjectPtr theObj, TDF_Label theLab, const int theT void Model_Document::synchronizeFeatures(const bool theMarkUpdated, const bool theUpdateReferences) { - boost::shared_ptr aThis = + std::shared_ptr aThis = Model_Application::getApplication()->getDocument(myID); // after all updates, sends a message that groups of features were created or updated - boost::static_pointer_cast(Model_Session::get()) + std::static_pointer_cast(Model_Session::get()) ->setCheckTransactions(false); Events_Loop* aLoop = Events_Loop::loop(); aLoop->activateFlushes(false); @@ -798,8 +798,8 @@ void Model_Document::synchronizeFeatures(const bool theMarkUpdated, const bool t //} // results of this feature must be redisplayed (hided) static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); - const std::list >& aResults = aFeature->results(); - std::list >::const_iterator aRIter = aResults.begin(); + const std::list >& aResults = aFeature->results(); + std::list >::const_iterator aRIter = aResults.begin(); // redisplay also removed feature (used for sketch and AISObject) ModelAPI_EventCreator::get()->sendUpdated(aFeature, EVENT_DISP); aFeature->erase(); @@ -823,14 +823,14 @@ void Model_Document::synchronizeFeatures(const bool theMarkUpdated, const bool t aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY)); aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TOHIDE)); - boost::static_pointer_cast(Model_Session::get()) + std::static_pointer_cast(Model_Session::get()) ->setCheckTransactions(true); myExecuteFeatures = true; } void Model_Document::synchronizeBackRefs() { - boost::shared_ptr aThis = + std::shared_ptr aThis = Model_Application::getApplication()->getDocument(myID); // keeps the concealed flags of result to catch the change and create created/deleted events std::list > aConcealed; @@ -838,16 +838,16 @@ void Model_Document::synchronizeBackRefs() NCollection_DataMap::Iterator aFeatures(myObjs); for(; aFeatures.More(); aFeatures.Next()) { FeaturePtr aFeature = aFeatures.Value(); - boost::shared_ptr aFData = - boost::dynamic_pointer_cast(aFeature->data()); + std::shared_ptr aFData = + std::dynamic_pointer_cast(aFeature->data()); if (aFData) { aFData->eraseBackReferences(); } - const std::list >& aResults = aFeature->results(); - std::list >::const_iterator aRIter = aResults.begin(); + const std::list >& aResults = aFeature->results(); + std::list >::const_iterator aRIter = aResults.begin(); for (; aRIter != aResults.cend(); aRIter++) { - boost::shared_ptr aResData = - boost::dynamic_pointer_cast((*aRIter)->data()); + std::shared_ptr aResData = + std::dynamic_pointer_cast((*aRIter)->data()); if (aResData) { aConcealed.push_back(std::pair(*aRIter, (*aRIter)->isConcealed())); aResData->eraseBackReferences(); @@ -859,8 +859,8 @@ void Model_Document::synchronizeBackRefs() ModelAPI_ValidatorsFactory* aValidators = ModelAPI_Session::get()->validators(); for(aFeatures.Initialize(myObjs); aFeatures.More(); aFeatures.Next()) { FeaturePtr aFeature = aFeatures.Value(); - boost::shared_ptr aFData = - boost::dynamic_pointer_cast(aFeature->data()); + std::shared_ptr aFData = + std::dynamic_pointer_cast(aFeature->data()); if (aFData) { std::list > > aRefs; aFData->referencesToObjects(aRefs); @@ -869,8 +869,8 @@ void Model_Document::synchronizeBackRefs() std::list::iterator aRefTo = aRefsIter->second.begin(); for(; aRefTo != aRefsIter->second.end(); aRefTo++) { if (*aRefTo) { - boost::shared_ptr aRefData = - boost::dynamic_pointer_cast((*aRefTo)->data()); + std::shared_ptr aRefData = + std::dynamic_pointer_cast((*aRefTo)->data()); aRefData->addBackReference(aFeature, aRefsIter->first); // here the Concealed flag is updated } } @@ -891,18 +891,18 @@ void Model_Document::synchronizeBackRefs() } TDF_Label Model_Document::resultLabel( - const boost::shared_ptr& theFeatureData, const int theResultIndex) + const std::shared_ptr& theFeatureData, const int theResultIndex) { - const boost::shared_ptr& aData = - boost::dynamic_pointer_cast(theFeatureData); + const std::shared_ptr& aData = + std::dynamic_pointer_cast(theFeatureData); return aData->label().Father().FindChild(TAG_FEATURE_RESULTS).FindChild(theResultIndex + 1); } -void Model_Document::storeResult(boost::shared_ptr theFeatureData, - boost::shared_ptr theResult, +void Model_Document::storeResult(std::shared_ptr theFeatureData, + std::shared_ptr theResult, const int theResultIndex) { - boost::shared_ptr aThis = + std::shared_ptr aThis = Model_Application::getApplication()->getDocument(myID); theResult->setDoc(aThis); initData(theResult, resultLabel(theFeatureData, theResultIndex), TAG_FEATURE_ARGUMENTS); @@ -911,78 +911,78 @@ void Model_Document::storeResult(boost::shared_ptr theFeatureData } } -boost::shared_ptr Model_Document::createConstruction( - const boost::shared_ptr& theFeatureData, const int theIndex) +std::shared_ptr Model_Document::createConstruction( + const std::shared_ptr& theFeatureData, const int theIndex) { TDF_Label aLab = resultLabel(theFeatureData, theIndex); TDataStd_Comment::Set(aLab, ModelAPI_ResultConstruction::group().c_str()); ObjectPtr anOldObject = object(aLab); - boost::shared_ptr aResult; + std::shared_ptr aResult; if (anOldObject) { - aResult = boost::dynamic_pointer_cast(anOldObject); + aResult = std::dynamic_pointer_cast(anOldObject); } if (!aResult) { - aResult = boost::shared_ptr(new Model_ResultConstruction); + aResult = std::shared_ptr(new Model_ResultConstruction); storeResult(theFeatureData, aResult, theIndex); } return aResult; } -boost::shared_ptr Model_Document::createBody( - const boost::shared_ptr& theFeatureData, const int theIndex) +std::shared_ptr Model_Document::createBody( + const std::shared_ptr& theFeatureData, const int theIndex) { TDF_Label aLab = resultLabel(theFeatureData, theIndex); TDataStd_Comment::Set(aLab, ModelAPI_ResultBody::group().c_str()); ObjectPtr anOldObject = object(aLab); - boost::shared_ptr aResult; + std::shared_ptr aResult; if (anOldObject) { - aResult = boost::dynamic_pointer_cast(anOldObject); + aResult = std::dynamic_pointer_cast(anOldObject); } if (!aResult) { - aResult = boost::shared_ptr(new Model_ResultBody); + aResult = std::shared_ptr(new Model_ResultBody); storeResult(theFeatureData, aResult, theIndex); } return aResult; } -boost::shared_ptr Model_Document::createPart( - const boost::shared_ptr& theFeatureData, const int theIndex) +std::shared_ptr Model_Document::createPart( + const std::shared_ptr& theFeatureData, const int theIndex) { TDF_Label aLab = resultLabel(theFeatureData, theIndex); TDataStd_Comment::Set(aLab, ModelAPI_ResultPart::group().c_str()); ObjectPtr anOldObject = object(aLab); - boost::shared_ptr aResult; + std::shared_ptr aResult; if (anOldObject) { - aResult = boost::dynamic_pointer_cast(anOldObject); + aResult = std::dynamic_pointer_cast(anOldObject); } if (!aResult) { - aResult = boost::shared_ptr(new Model_ResultPart); + aResult = std::shared_ptr(new Model_ResultPart); storeResult(theFeatureData, aResult, theIndex); } return aResult; } -boost::shared_ptr Model_Document::createGroup( - const boost::shared_ptr& theFeatureData, const int theIndex) +std::shared_ptr Model_Document::createGroup( + const std::shared_ptr& theFeatureData, const int theIndex) { TDF_Label aLab = resultLabel(theFeatureData, theIndex); TDataStd_Comment::Set(aLab, ModelAPI_ResultGroup::group().c_str()); ObjectPtr anOldObject = object(aLab); - boost::shared_ptr aResult; + std::shared_ptr aResult; if (anOldObject) { - aResult = boost::dynamic_pointer_cast(anOldObject); + aResult = std::dynamic_pointer_cast(anOldObject); } if (!aResult) { - aResult = boost::shared_ptr(new Model_ResultGroup(theFeatureData)); + aResult = std::shared_ptr(new Model_ResultGroup(theFeatureData)); storeResult(theFeatureData, aResult, theIndex); } return aResult; } -boost::shared_ptr Model_Document::feature( - const boost::shared_ptr& theResult) +std::shared_ptr Model_Document::feature( + const std::shared_ptr& theResult) { - boost::shared_ptr aData = boost::dynamic_pointer_cast(theResult->data()); + std::shared_ptr aData = std::dynamic_pointer_cast(theResult->data()); if (aData) { TDF_Label aFeatureLab = aData->label().Father().Father().Father(); return feature(aFeatureLab); @@ -997,7 +997,7 @@ void Model_Document::updateResults(FeaturePtr theFeature) // check the existing results and remove them if there is nothing on the label std::list::const_iterator aResIter = theFeature->results().cbegin(); while(aResIter != theFeature->results().cend()) { - ResultPtr aBody = boost::dynamic_pointer_cast(*aResIter); + ResultPtr aBody = std::dynamic_pointer_cast(*aResIter); if (aBody) { if (!aBody->data()->isValid()) { // found a disappeared result => remove it diff --git a/src/Model/Model_Document.h b/src/Model/Model_Document.h index 05d7d76eb..519c57a19 100644 --- a/src/Model/Model_Document.h +++ b/src/Model/Model_Document.h @@ -90,10 +90,10 @@ class Model_Document : public ModelAPI_Document MODEL_EXPORT virtual ObjectPtr object(TDF_Label theLabel); //! Adds a new sub-document by the identifier, or returns existing one if it is already exist - MODEL_EXPORT virtual boost::shared_ptr subDocument(std::string theDocID); + MODEL_EXPORT virtual std::shared_ptr subDocument(std::string theDocID); //! Internal sub-document by ID - MODEL_EXPORT virtual boost::shared_ptr subDoc(std::string theDocID); + MODEL_EXPORT virtual std::shared_ptr subDoc(std::string theDocID); ///! Returns the id of hte document MODEL_EXPORT virtual const std::string& id() const @@ -114,21 +114,21 @@ class Model_Document : public ModelAPI_Document MODEL_EXPORT virtual int size(const std::string& theGroupID, const bool theHidden = false); /// Creates a construction cresults - MODEL_EXPORT virtual boost::shared_ptr createConstruction( - const boost::shared_ptr& theFeatureData, const int theIndex = 0); + MODEL_EXPORT virtual std::shared_ptr createConstruction( + const std::shared_ptr& theFeatureData, const int theIndex = 0); /// Creates a body results - MODEL_EXPORT virtual boost::shared_ptr createBody( - const boost::shared_ptr& theFeatureData, const int theIndex = 0); + MODEL_EXPORT virtual std::shared_ptr createBody( + const std::shared_ptr& theFeatureData, const int theIndex = 0); /// Creates a part results - MODEL_EXPORT virtual boost::shared_ptr createPart( - const boost::shared_ptr& theFeatureData, const int theIndex = 0); + MODEL_EXPORT virtual std::shared_ptr createPart( + const std::shared_ptr& theFeatureData, const int theIndex = 0); /// Creates a group results - MODEL_EXPORT virtual boost::shared_ptr createGroup( - const boost::shared_ptr& theFeatureData, const int theIndex = 0); + MODEL_EXPORT virtual std::shared_ptr createGroup( + const std::shared_ptr& theFeatureData, const int theIndex = 0); //! Returns a feature by result (owner of result) - MODEL_EXPORT virtual boost::shared_ptr - feature(const boost::shared_ptr& theResult); + MODEL_EXPORT virtual std::shared_ptr + feature(const std::shared_ptr& theResult); ///! Returns true if parametric updater need to execute feature on recomputartion ///! On abort, undo or redo it is not necessary: results in document are updated automatically @@ -166,12 +166,12 @@ class Model_Document : public ModelAPI_Document void initData(ObjectPtr theObj, TDF_Label theLab, const int theTag); //! Allows to store the result in the data tree of the document (attaches 'data' of result to tree) - MODEL_EXPORT virtual void storeResult(boost::shared_ptr theFeatureData, - boost::shared_ptr theResult, + MODEL_EXPORT virtual void storeResult(std::shared_ptr theFeatureData, + std::shared_ptr theResult, const int theResultIndex = 0); //! returns the label of result by index; creates this label if it was not created before - TDF_Label resultLabel(const boost::shared_ptr& theFeatureData, const int theResultIndex); + TDF_Label resultLabel(const std::shared_ptr& theFeatureData, const int theResultIndex); //! Updates the results list of the feature basing on the current data tree void updateResults(FeaturePtr theFeature); diff --git a/src/Model/Model_Events.cpp b/src/Model/Model_Events.cpp index 850b68d5d..a87fc9fb8 100644 --- a/src/Model/Model_Events.cpp +++ b/src/Model/Model_Events.cpp @@ -12,15 +12,15 @@ Model_EventCreator MY_CREATOR; void Model_EventCreator::sendUpdated(const ObjectPtr& theObject, const Events_ID& theEvent, const bool isGroupped) const { - boost::shared_ptr aMsg( + std::shared_ptr aMsg( new Model_ObjectUpdatedMessage(theObject, theEvent)); Events_Loop::loop()->send(aMsg, isGroupped); } -void Model_EventCreator::sendDeleted(const boost::shared_ptr& theDoc, +void Model_EventCreator::sendDeleted(const std::shared_ptr& theDoc, const std::string& theGroup) const { - boost::shared_ptr aMsg( + std::shared_ptr aMsg( new Model_ObjectDeletedMessage(theDoc, theGroup)); Events_Loop::loop()->send(aMsg, true); } @@ -45,17 +45,17 @@ const std::set& Model_ObjectUpdatedMessage::objects() const return myObjects; } -boost::shared_ptr Model_ObjectUpdatedMessage::newEmpty() +std::shared_ptr Model_ObjectUpdatedMessage::newEmpty() { ObjectPtr anEmptyObject; - return boost::shared_ptr( + return std::shared_ptr( new Model_ObjectUpdatedMessage(anEmptyObject, eventID())); } -void Model_ObjectUpdatedMessage::Join(const boost::shared_ptr& theJoined) +void Model_ObjectUpdatedMessage::Join(const std::shared_ptr& theJoined) { - boost::shared_ptr aJoined = - boost::dynamic_pointer_cast(theJoined); + std::shared_ptr aJoined = + std::dynamic_pointer_cast(theJoined); std::set::iterator aFIter = aJoined->myObjects.begin(); for (; aFIter != aJoined->myObjects.end(); aFIter++) { myObjects.insert(*aFIter); @@ -64,7 +64,7 @@ void Model_ObjectUpdatedMessage::Join(const boost::shared_ptr& theDoc, const std::string& theGroup) + const std::shared_ptr& theDoc, const std::string& theGroup) : ModelAPI_ObjectDeletedMessage(messageId(), 0), myDoc(theDoc) { @@ -72,9 +72,9 @@ Model_ObjectDeletedMessage::Model_ObjectDeletedMessage( myGroups.insert(theGroup); } -boost::shared_ptr Model_ObjectDeletedMessage::newEmpty() +std::shared_ptr Model_ObjectDeletedMessage::newEmpty() { - return boost::shared_ptr(new Model_ObjectDeletedMessage(myDoc, "")); + return std::shared_ptr(new Model_ObjectDeletedMessage(myDoc, "")); } const Events_ID Model_ObjectDeletedMessage::messageId() @@ -83,10 +83,10 @@ const Events_ID Model_ObjectDeletedMessage::messageId() return MY_ID; } -void Model_ObjectDeletedMessage::Join(const boost::shared_ptr& theJoined) +void Model_ObjectDeletedMessage::Join(const std::shared_ptr& theJoined) { - boost::shared_ptr aJoined = - boost::dynamic_pointer_cast(theJoined); + std::shared_ptr aJoined = + std::dynamic_pointer_cast(theJoined); std::set::iterator aGIter = aJoined->myGroups.begin(); for (; aGIter != aJoined->myGroups.end(); aGIter++) { myGroups.insert(*aGIter); diff --git a/src/Model/Model_Events.h b/src/Model/Model_Events.h index f30c44790..163c84581 100644 --- a/src/Model/Model_Events.h +++ b/src/Model/Model_Events.h @@ -16,7 +16,7 @@ class Model_EventCreator : public ModelAPI_EventCreator virtual void sendUpdated(const ObjectPtr& theObject, const Events_ID& theEvent, const bool isGroupped = true) const; /// creates deleted message and sends to the loop - virtual void sendDeleted(const boost::shared_ptr& theDoc, + virtual void sendDeleted(const std::shared_ptr& theDoc, const std::string& theGroup) const; /// must be one per application, the constructor for internal usage only @@ -39,26 +39,26 @@ class Model_ObjectUpdatedMessage : public ModelAPI_ObjectUpdatedMessage virtual const std::set& objects() const; //! Creates a new empty group (to store it in the loop before flush) - virtual boost::shared_ptr newEmpty(); + virtual std::shared_ptr newEmpty(); //! Allows to join the given message with the current one - virtual void Join(const boost::shared_ptr& theJoined); + virtual void Join(const std::shared_ptr& theJoined); }; /// Message that feature was deleted (used for Object Browser update) class Model_ObjectDeletedMessage : public ModelAPI_ObjectDeletedMessage { - boost::shared_ptr myDoc; ///< document owner of the feature + std::shared_ptr myDoc; ///< document owner of the feature std::set myGroups; ///< group identifiers that contained the deleted feature /// Use ModelAPI for creation of this event. - Model_ObjectDeletedMessage(const boost::shared_ptr& theDoc, + Model_ObjectDeletedMessage(const std::shared_ptr& theDoc, const std::string& theGroup); friend class Model_EventCreator; public: /// Returns the feature that has been updated - virtual boost::shared_ptr document() const + virtual std::shared_ptr document() const { return myDoc; } @@ -69,11 +69,11 @@ class Model_ObjectDeletedMessage : public ModelAPI_ObjectDeletedMessage return myGroups; } - virtual boost::shared_ptr newEmpty(); + virtual std::shared_ptr newEmpty(); virtual const Events_ID messageId(); - virtual void Join(const boost::shared_ptr& theJoined); + virtual void Join(const std::shared_ptr& theJoined); }; #endif diff --git a/src/Model/Model_FeatureValidator.cpp b/src/Model/Model_FeatureValidator.cpp index bcc09d11e..6e609dd5d 100644 --- a/src/Model/Model_FeatureValidator.cpp +++ b/src/Model/Model_FeatureValidator.cpp @@ -9,12 +9,12 @@ #include #include -#include +#include -bool Model_FeatureValidator::isValid(const boost::shared_ptr& theFeature, +bool Model_FeatureValidator::isValid(const std::shared_ptr& theFeature, const std::list& theArguments) const { - boost::shared_ptr aData = theFeature->data(); + std::shared_ptr aData = theFeature->data(); if (!aData) return false; if (!aData->isValid()) diff --git a/src/Model/Model_FeatureValidator.h b/src/Model/Model_FeatureValidator.h index 95a4ce1c5..b262ff0ea 100644 --- a/src/Model/Model_FeatureValidator.h +++ b/src/Model/Model_FeatureValidator.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include @@ -20,7 +20,7 @@ class Model_FeatureValidator : public ModelAPI_FeatureValidator public: /// Returns true if feature and/or attributes are valid /// \param theFeature the validated feature - MODEL_EXPORT virtual bool isValid(const boost::shared_ptr& theFeature, + MODEL_EXPORT virtual bool isValid(const std::shared_ptr& theFeature, const std::list& theArguments) const; // sets not obligatory attributes, not checked for initialization diff --git a/src/Model/Model_ResultBody.cpp b/src/Model/Model_ResultBody.cpp index 3b9fb24ab..59c65ac9e 100644 --- a/src/Model/Model_ResultBody.cpp +++ b/src/Model/Model_ResultBody.cpp @@ -33,9 +33,9 @@ Model_ResultBody::Model_ResultBody() setIsConcealed(false); } -void Model_ResultBody::store(const boost::shared_ptr& theShape) +void Model_ResultBody::store(const std::shared_ptr& theShape) { - boost::shared_ptr aData = boost::dynamic_pointer_cast(data()); + std::shared_ptr aData = std::dynamic_pointer_cast(data()); if (aData) { TDF_Label& aShapeLab = aData->shapeLab(); // clean builders @@ -52,10 +52,10 @@ void Model_ResultBody::store(const boost::shared_ptr& theShape) } } -void Model_ResultBody::storeGenerated(const boost::shared_ptr& theFromShape, - const boost::shared_ptr& theToShape) +void Model_ResultBody::storeGenerated(const std::shared_ptr& theFromShape, + const std::shared_ptr& theToShape) { - boost::shared_ptr aData = boost::dynamic_pointer_cast(data()); + std::shared_ptr aData = std::dynamic_pointer_cast(data()); if (aData) { TDF_Label& aShapeLab = aData->shapeLab(); // clean builders @@ -74,10 +74,10 @@ void Model_ResultBody::storeGenerated(const boost::shared_ptr& th } } -void Model_ResultBody::storeModified(const boost::shared_ptr& theOldShape, - const boost::shared_ptr& theNewShape) +void Model_ResultBody::storeModified(const std::shared_ptr& theOldShape, + const std::shared_ptr& theNewShape) { - boost::shared_ptr aData = boost::dynamic_pointer_cast(data()); + std::shared_ptr aData = std::dynamic_pointer_cast(data()); if (aData) { TDF_Label& aShapeLab = aData->shapeLab(); // clean builders @@ -96,22 +96,22 @@ void Model_ResultBody::storeModified(const boost::shared_ptr& the } } -boost::shared_ptr Model_ResultBody::shape() +std::shared_ptr Model_ResultBody::shape() { - boost::shared_ptr aData = boost::dynamic_pointer_cast(data()); + std::shared_ptr aData = std::dynamic_pointer_cast(data()); if (aData) { TDF_Label& aShapeLab = aData->shapeLab(); Handle(TNaming_NamedShape) aName; if (aShapeLab.FindAttribute(TNaming_NamedShape::GetID(), aName)) { TopoDS_Shape aShape = aName->Get(); if (!aShape.IsNull()) { - boost::shared_ptr aRes(new GeomAPI_Shape); + std::shared_ptr aRes(new GeomAPI_Shape); aRes->setImpl(new TopoDS_Shape(aShape)); return aRes; } } } - return boost::shared_ptr(); + return std::shared_ptr(); } void Model_ResultBody::clean() @@ -133,7 +133,7 @@ TNaming_Builder* Model_ResultBody::builder(const int theTag) myBuilders.insert(myBuilders.end(), theTag - myBuilders.size() + 1, NULL); } if (!myBuilders[theTag]) { - boost::shared_ptr aData = boost::dynamic_pointer_cast(data()); + std::shared_ptr aData = std::dynamic_pointer_cast(data()); myBuilders[theTag] = new TNaming_Builder(aData->shapeLab().FindChild(theTag)); //TCollection_AsciiString entry;// //TDF_Tool::Entry(aData->shapeLab().FindChild(theTag), entry); @@ -143,14 +143,14 @@ TNaming_Builder* Model_ResultBody::builder(const int theTag) } void Model_ResultBody::generated( - const boost::shared_ptr& theNewShape, const int theTag) + const std::shared_ptr& theNewShape, const int theTag) { TopoDS_Shape aShape = theNewShape->impl(); builder(theTag)->Generated(aShape); } -void Model_ResultBody::generated(const boost::shared_ptr& theOldShape, - const boost::shared_ptr& theNewShape, const int theTag) +void Model_ResultBody::generated(const std::shared_ptr& theOldShape, + const std::shared_ptr& theNewShape, const int theTag) { TopoDS_Shape anOldShape = theOldShape->impl(); TopoDS_Shape aNewShape = theNewShape->impl(); @@ -158,15 +158,15 @@ void Model_ResultBody::generated(const boost::shared_ptr& theOldS } -void Model_ResultBody::modified(const boost::shared_ptr& theOldShape, - const boost::shared_ptr& theNewShape, const int theTag) +void Model_ResultBody::modified(const std::shared_ptr& theOldShape, + const std::shared_ptr& theNewShape, const int theTag) { TopoDS_Shape anOldShape = theOldShape->impl(); TopoDS_Shape aNewShape = theNewShape->impl(); builder(theTag)->Modify(anOldShape, aNewShape); } -void Model_ResultBody::deleted(const boost::shared_ptr& theOldShape, +void Model_ResultBody::deleted(const std::shared_ptr& theOldShape, const int theTag) { TopoDS_Shape aShape = theOldShape->impl(); @@ -174,7 +174,7 @@ void Model_ResultBody::deleted(const boost::shared_ptr& theOldSha } void Model_ResultBody::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, - boost::shared_ptr theShapeIn, + std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag) { @@ -184,7 +184,7 @@ void Model_ResultBody::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, for (; ShapeExplorer.More(); ShapeExplorer.Next ()) { const TopoDS_Shape& aRoot = ShapeExplorer.Current (); if (!aView.Add(aRoot)) continue; - boost::shared_ptr aRShape(new GeomAPI_Shape()); + std::shared_ptr aRShape(new GeomAPI_Shape()); aRShape->setImpl((new TopoDS_Shape(aRoot))); if (theMS->isDeleted (aRShape)) { builder(theTag)->Delete(aRoot); @@ -194,7 +194,7 @@ void Model_ResultBody::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, void Model_ResultBody::loadAndOrientModifiedShapes ( GeomAlgoAPI_MakeShape* theMS, - boost::shared_ptr theShapeIn, + std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag, GeomAPI_DataMapOfShapeShape& theSubShapes) @@ -206,14 +206,14 @@ void Model_ResultBody::loadAndOrientModifiedShapes ( const TopoDS_Shape& aRoot = aShapeExplorer.Current (); if (!aView.Add(aRoot)) continue; ListOfShape aList; - boost::shared_ptr aRShape(new GeomAPI_Shape()); + std::shared_ptr aRShape(new GeomAPI_Shape()); aRShape->setImpl((new TopoDS_Shape(aRoot))); theMS->modified(aRShape, aList); - std::list >::const_iterator anIt = aList.begin(), aLast = aList.end(); + std::list >::const_iterator anIt = aList.begin(), aLast = aList.end(); for (; anIt != aLast; anIt++) { TopoDS_Shape aNewShape = (*anIt)->impl(); if (theSubShapes.isBound(*anIt)) { - boost::shared_ptr aMapShape(theSubShapes.find(*anIt)); + std::shared_ptr aMapShape(theSubShapes.find(*anIt)); aNewShape.Orientation(aMapShape->impl().Orientation()); } if (!aRoot.IsSame (aNewShape)) @@ -224,7 +224,7 @@ void Model_ResultBody::loadAndOrientModifiedShapes ( void Model_ResultBody::loadAndOrientGeneratedShapes ( GeomAlgoAPI_MakeShape* theMS, - boost::shared_ptr theShapeIn, + std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag, GeomAPI_DataMapOfShapeShape& theSubShapes) @@ -236,14 +236,14 @@ void Model_ResultBody::loadAndOrientGeneratedShapes ( const TopoDS_Shape& aRoot = aShapeExplorer.Current (); if (!aView.Add(aRoot)) continue; ListOfShape aList; - boost::shared_ptr aRShape(new GeomAPI_Shape()); + std::shared_ptr aRShape(new GeomAPI_Shape()); aRShape->setImpl((new TopoDS_Shape(aRoot))); theMS->generated(aRShape, aList); - std::list >::const_iterator anIt = aList.begin(), aLast = aList.end(); + std::list >::const_iterator anIt = aList.begin(), aLast = aList.end(); for (; anIt != aLast; anIt++) { TopoDS_Shape aNewShape = (*anIt)->impl(); if (theSubShapes.isBound(*anIt)) { - boost::shared_ptr aMapShape(theSubShapes.find(*anIt)); + std::shared_ptr aMapShape(theSubShapes.find(*anIt)); aNewShape.Orientation(aMapShape->impl().Orientation()); } if (!aRoot.IsSame (aNewShape)) @@ -286,7 +286,7 @@ void loadGeneratedDangleShapes( } //======================================================================= -void Model_ResultBody::loadNextLevels(boost::shared_ptr theShape, +void Model_ResultBody::loadNextLevels(std::shared_ptr theShape, int& theTag) { if(theShape->isNull()) return; @@ -352,7 +352,7 @@ void Model_ResultBody::loadNextLevels(boost::shared_ptr theShape, } //======================================================================= void Model_ResultBody::loadFirstLevel( - boost::shared_ptr theShape, int& theTag) + std::shared_ptr theShape, int& theTag) { if(theShape->isNull()) return; TopoDS_Shape aShape = theShape->impl(); @@ -363,17 +363,17 @@ void Model_ResultBody::loadFirstLevel( if (itr.Value().ShapeType() == TopAbs_COMPOUND || itr.Value().ShapeType() == TopAbs_COMPSOLID) { - boost::shared_ptr itrShape(new GeomAPI_Shape()); + std::shared_ptr itrShape(new GeomAPI_Shape()); itrShape->setImpl(new TopoDS_Shape(itr.Value())); loadFirstLevel(itrShape, theTag); } else { - boost::shared_ptr itrShape(new GeomAPI_Shape()); + std::shared_ptr itrShape(new GeomAPI_Shape()); itrShape->setImpl(new TopoDS_Shape(itr.Value())); loadNextLevels(itrShape, theTag); } } } else { - boost::shared_ptr itrShape(new GeomAPI_Shape()); + std::shared_ptr itrShape(new GeomAPI_Shape()); itrShape->setImpl(new TopoDS_Shape(aShape)); loadNextLevels(itrShape, theTag); } @@ -381,7 +381,7 @@ void Model_ResultBody::loadFirstLevel( //======================================================================= void Model_ResultBody::loadDisconnectedEdges( - boost::shared_ptr theShape, int& theTag) + std::shared_ptr theShape, int& theTag) { if(theShape->isNull()) return; TopoDS_Shape aShape = theShape->impl(); @@ -444,7 +444,7 @@ void Model_ResultBody::loadDisconnectedEdges( } } -void Model_ResultBody::loadDisconnectedVertexes(boost::shared_ptr theShape, int& theTag) +void Model_ResultBody::loadDisconnectedVertexes(std::shared_ptr theShape, int& theTag) { if(theShape->isNull()) return; TopoDS_Shape aShape = theShape->impl(); diff --git a/src/Model/Model_ResultBody.h b/src/Model/Model_ResultBody.h index 45330a31e..28f268d83 100644 --- a/src/Model/Model_ResultBody.h +++ b/src/Model/Model_ResultBody.h @@ -28,69 +28,69 @@ class Model_ResultBody : public ModelAPI_ResultBody std::vector myBuilders; public: /// Stores the shape (called by the execution method). - MODEL_EXPORT virtual void store(const boost::shared_ptr& theShape); + MODEL_EXPORT virtual void store(const std::shared_ptr& theShape); /// Stores the generated shape (called by the execution method). - MODEL_EXPORT virtual void storeGenerated(const boost::shared_ptr& theFromShape, - const boost::shared_ptr& theToShape); + MODEL_EXPORT virtual void storeGenerated(const std::shared_ptr& theFromShape, + const std::shared_ptr& theToShape); /// Stores the modified shape (called by the execution method). - MODEL_EXPORT virtual void storeModified(const boost::shared_ptr& theOldShape, - const boost::shared_ptr& theNewShape); + MODEL_EXPORT virtual void storeModified(const std::shared_ptr& theOldShape, + const std::shared_ptr& theNewShape); /// Returns the shape-result produced by this feature - MODEL_EXPORT virtual boost::shared_ptr shape(); + MODEL_EXPORT virtual std::shared_ptr shape(); /// Records the subshape newShape which was generated during a topological construction. /// As an example, consider the case of a face generated in construction of a box. - MODEL_EXPORT virtual void generated(const boost::shared_ptr& theNewShape, + MODEL_EXPORT virtual void generated(const std::shared_ptr& theNewShape, const int theTag = 1); /// Records the shape newShape which was generated from the shape oldShape during a topological /// construction. As an example, consider the case of a face generated from an edge in /// construction of a prism. - MODEL_EXPORT virtual void generated(const boost::shared_ptr& theOldShape, - const boost::shared_ptr& theNewShape, const int theTag = 1); + MODEL_EXPORT virtual void generated(const std::shared_ptr& theOldShape, + const std::shared_ptr& theNewShape, const int theTag = 1); /// Records the shape newShape which is a modification of the shape oldShape. /// As an example, consider the case of a face split or merged in a Boolean operation. - MODEL_EXPORT virtual void modified(const boost::shared_ptr& theOldShape, - const boost::shared_ptr& theNewShape, const int theTag = 1); + MODEL_EXPORT virtual void modified(const std::shared_ptr& theOldShape, + const std::shared_ptr& theNewShape, const int theTag = 1); /// Records the shape oldShape which was deleted from the current label. /// As an example, consider the case of a face removed by a Boolean operation. - MODEL_EXPORT virtual void deleted(const boost::shared_ptr& theOldShape, + MODEL_EXPORT virtual void deleted(const std::shared_ptr& theOldShape, const int theTag = 1); /// load deleted shapes MODEL_EXPORT virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, - boost::shared_ptr theShapeIn, + std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag); /// load and orient modified shapes MODEL_EXPORT virtual void loadAndOrientModifiedShapes ( GeomAlgoAPI_MakeShape* theMS, - boost::shared_ptr theShapeIn, + std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag, GeomAPI_DataMapOfShapeShape& theSubShapes); /// load and orient generated shapes MODEL_EXPORT virtual void loadAndOrientGeneratedShapes ( GeomAlgoAPI_MakeShape* theMS, - boost::shared_ptr theShapeIn, + std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag, GeomAPI_DataMapOfShapeShape& theSubShapes); /// Loads shapes of the first level (to be used during shape import) - MODEL_EXPORT virtual void loadFirstLevel(boost::shared_ptr theShape, int& theTag); + MODEL_EXPORT virtual void loadFirstLevel(std::shared_ptr theShape, int& theTag); /// Loads disconnected edges - MODEL_EXPORT virtual void loadDisconnectedEdges(boost::shared_ptr theShape, int& theTag); + MODEL_EXPORT virtual void loadDisconnectedEdges(std::shared_ptr theShape, int& theTag); /// Loads disconnected vetexes - MODEL_EXPORT virtual void loadDisconnectedVertexes(boost::shared_ptr theShape, int& theTag); + MODEL_EXPORT virtual void loadDisconnectedVertexes(std::shared_ptr theShape, int& theTag); /// Removes the stored builders MODEL_EXPORT virtual ~Model_ResultBody(); @@ -107,7 +107,7 @@ protected: private: /// Loads shapes of the next level (to be used during shape import) - void loadNextLevels(boost::shared_ptr theShape, int& theTag); + void loadNextLevels(std::shared_ptr theShape, int& theTag); friend class Model_Document; }; diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index 8af38252d..30a1cd467 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -4,12 +4,12 @@ #include -void Model_ResultConstruction::setShape(boost::shared_ptr theShape) +void Model_ResultConstruction::setShape(std::shared_ptr theShape) { myShape = theShape; } -boost::shared_ptr& Model_ResultConstruction::shape() +std::shared_ptr& Model_ResultConstruction::shape() { return myShape; } diff --git a/src/Model/Model_ResultConstruction.h b/src/Model/Model_ResultConstruction.h index 5b6e9b472..f2581f3df 100644 --- a/src/Model/Model_ResultConstruction.h +++ b/src/Model/Model_ResultConstruction.h @@ -17,8 +17,8 @@ */ class Model_ResultConstruction : public ModelAPI_ResultConstruction { - boost::shared_ptr myOwner; ///< owner of this result - boost::shared_ptr myShape; ///< shape of this result created "on the fly" + std::shared_ptr myOwner; ///< owner of this result + std::shared_ptr myShape; ///< shape of this result created "on the fly" bool myIsInHistory; public: /// By default object is displayed in the object browser. @@ -28,9 +28,9 @@ class Model_ResultConstruction : public ModelAPI_ResultConstruction } /// Sets the result - MODEL_EXPORT virtual void setShape(boost::shared_ptr theShape); + MODEL_EXPORT virtual void setShape(std::shared_ptr theShape); /// Returns the shape-result produced by this feature - MODEL_EXPORT virtual boost::shared_ptr& shape(); + MODEL_EXPORT virtual std::shared_ptr& shape(); /// Sets the flag that it must be displayed in history (default is true) MODEL_EXPORT virtual void setIsInHistory(const bool myIsInHistory); diff --git a/src/Model/Model_ResultGroup.cpp b/src/Model/Model_ResultGroup.cpp index 3e467395d..fbfe1d923 100644 --- a/src/Model/Model_ResultGroup.cpp +++ b/src/Model/Model_ResultGroup.cpp @@ -6,21 +6,21 @@ #include #include -Model_ResultGroup::Model_ResultGroup(boost::shared_ptr theOwnerData) +Model_ResultGroup::Model_ResultGroup(std::shared_ptr theOwnerData) { setIsConcealed(false); myOwnerData = theOwnerData; } -boost::shared_ptr Model_ResultGroup::shape() const +std::shared_ptr Model_ResultGroup::shape() const { - boost::shared_ptr aResult; + std::shared_ptr aResult; if (myOwnerData) { AttributeSelectionListPtr aList = myOwnerData->selectionList("group_list"); if (aList) { - std::list > aSubs; + std::list > aSubs; for(int a = aList->size() - 1; a >= 0; a--) { - boost::shared_ptr aSelection = aList->value(a)->value(); + std::shared_ptr aSelection = aList->value(a)->value(); if (aSelection && !aSelection->isNull()) { aSubs.push_back(aSelection); } diff --git a/src/Model/Model_ResultGroup.h b/src/Model/Model_ResultGroup.h index 30e358898..17d7b9da9 100644 --- a/src/Model/Model_ResultGroup.h +++ b/src/Model/Model_ResultGroup.h @@ -16,17 +16,17 @@ */ class Model_ResultGroup : public ModelAPI_ResultGroup { - boost::shared_ptr myOwnerData; ///< data of owner of this result + std::shared_ptr myOwnerData; ///< data of owner of this result public: /// Returns the compound of selected entities - MODEL_EXPORT virtual boost::shared_ptr shape() const; + MODEL_EXPORT virtual std::shared_ptr shape() const; /// Removes the stored builders MODEL_EXPORT virtual ~Model_ResultGroup() {} protected: /// Makes a body on the given feature data - Model_ResultGroup(boost::shared_ptr theOwnerData); + Model_ResultGroup(std::shared_ptr theOwnerData); friend class Model_Document; }; diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index a1fb09b01..3032d6f9d 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -7,14 +7,14 @@ #include #include -boost::shared_ptr Model_ResultPart::partDoc() +std::shared_ptr Model_ResultPart::partDoc() { return data()->document("PartDocument")->value(); } -boost::shared_ptr Model_ResultPart::owner() +std::shared_ptr Model_ResultPart::owner() { - return boost::shared_ptr(); // return empty pointer + return std::shared_ptr(); // return empty pointer } Model_ResultPart::Model_ResultPart() @@ -22,7 +22,7 @@ Model_ResultPart::Model_ResultPart() setIsConcealed(false); } -void Model_ResultPart::setData(boost::shared_ptr theData) +void Model_ResultPart::setData(std::shared_ptr theData) { ModelAPI_Result::setData(theData); if (theData) { @@ -32,10 +32,10 @@ void Model_ResultPart::setData(boost::shared_ptr theData) void Model_ResultPart::activate() { - boost::shared_ptr aDocRef = data()->document(DOC_REF()); + std::shared_ptr aDocRef = data()->document(DOC_REF()); if (!aDocRef->value()) { // create (or open) a document if it is not yet created - boost::shared_ptr aDoc = document()->subDocument(data()->name()); + std::shared_ptr aDoc = document()->subDocument(data()->name()); if (aDoc) { aDocRef->setValue(aDoc); } diff --git a/src/Model/Model_ResultPart.h b/src/Model/Model_ResultPart.h index e26413c3f..2df33884e 100644 --- a/src/Model/Model_ResultPart.h +++ b/src/Model/Model_ResultPart.h @@ -19,9 +19,9 @@ class Model_ResultPart : public ModelAPI_ResultPart { public: /// Returns the part-document of this result - MODEL_EXPORT virtual boost::shared_ptr partDoc(); + MODEL_EXPORT virtual std::shared_ptr partDoc(); /// Part has no stored feature: this method returns NULL - MODEL_EXPORT virtual boost::shared_ptr owner(); + MODEL_EXPORT virtual std::shared_ptr owner(); /// Sets this document as current and if it is not loaded yet, loads it MODEL_EXPORT virtual void activate(); @@ -31,7 +31,7 @@ protected: Model_ResultPart(); /// Sets the data manager of an object (document does), here also attributes are initialized - virtual void setData(boost::shared_ptr theData); + virtual void setData(std::shared_ptr theData); friend class Model_Document; }; diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index 2c624b8aa..d8e516698 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -27,7 +27,7 @@ using namespace std; static Model_Session* myImpl = new Model_Session(); // t oredirect all calls to the root document -#define ROOT_DOC boost::dynamic_pointer_cast(moduleDocument()) +#define ROOT_DOC std::dynamic_pointer_cast(moduleDocument()) bool Model_Session::load(const char* theFileName) { @@ -48,7 +48,7 @@ void Model_Session::closeAll() void Model_Session::startOperation() { ROOT_DOC->startOperation(); - static boost::shared_ptr aStartedMsg + static std::shared_ptr aStartedMsg (new Events_Message(Events_Loop::eventByName("StartOperation"))); Events_Loop::loop()->send(aStartedMsg); } @@ -61,7 +61,7 @@ void Model_Session::finishOperation() void Model_Session::abortOperation() { ROOT_DOC->abortOperation(); - static boost::shared_ptr anAbortMsg + static std::shared_ptr anAbortMsg (new Events_Message(Events_Loop::eventByName("AbortOperation"))); Events_Loop::loop()->send(anAbortMsg); } @@ -135,9 +135,9 @@ FeaturePtr Model_Session::createFeature(string theFeatureID) return FeaturePtr(); // return nothing } -boost::shared_ptr Model_Session::moduleDocument() +std::shared_ptr Model_Session::moduleDocument() { - return boost::shared_ptr( + return std::shared_ptr( Model_Application::getApplication()->getDocument("root")); } @@ -146,7 +146,7 @@ bool Model_Session::hasModuleDocument() return Model_Application::getApplication()->hasDocument("root"); } -boost::shared_ptr Model_Session::activeDocument() +std::shared_ptr Model_Session::activeDocument() { if (!myCurrentDoc || !Model_Application::getApplication()->hasDocument(myCurrentDoc->id())) myCurrentDoc = moduleDocument(); @@ -154,26 +154,26 @@ boost::shared_ptr Model_Session::activeDocument() } void Model_Session::setActiveDocument( - boost::shared_ptr theDoc, bool theSendSignal) + std::shared_ptr theDoc, bool theSendSignal) { if (myCurrentDoc != theDoc) { myCurrentDoc = theDoc; if (theSendSignal) { - static boost::shared_ptr aMsg(new Events_Message(Events_Loop::eventByName("CurrentDocumentChanged"))); + static std::shared_ptr aMsg(new Events_Message(Events_Loop::eventByName("CurrentDocumentChanged"))); Events_Loop::loop()->send(aMsg); } } } -std::list > Model_Session::allOpenedDocuments() +std::list > Model_Session::allOpenedDocuments() { - list > aResult; + list > aResult; aResult.push_back(moduleDocument()); // add subs recursively - list >::iterator aDoc = aResult.begin(); + list >::iterator aDoc = aResult.begin(); for(; aDoc != aResult.end(); aDoc++) { DocumentPtr anAPIDoc = *aDoc; - boost::shared_ptr aDoc = boost::dynamic_pointer_cast(anAPIDoc); + std::shared_ptr aDoc = std::dynamic_pointer_cast(anAPIDoc); if (aDoc) { std::set::const_iterator aSubIter = aDoc->subDocuments().cbegin(); for(; aSubIter != aDoc->subDocuments().cend(); aSubIter++) { @@ -186,14 +186,14 @@ std::list > Model_Session::allOpenedDocumen return aResult; } -boost::shared_ptr Model_Session::copy( - boost::shared_ptr theSource, std::string theID) +std::shared_ptr Model_Session::copy( + std::shared_ptr theSource, std::string theID) { // create a new document - boost::shared_ptr aNew = boost::dynamic_pointer_cast( + std::shared_ptr aNew = std::dynamic_pointer_cast( Model_Application::getApplication()->getDocument(theID)); // make a copy of all labels - TDF_Label aSourceRoot = boost::dynamic_pointer_cast(theSource)->document()->Main() + TDF_Label aSourceRoot = std::dynamic_pointer_cast(theSource)->document()->Main() .Father(); TDF_Label aTargetRoot = aNew->document()->Main().Father(); Handle(TDF_DataSet) aDS = new TDF_DataSet; @@ -211,7 +211,7 @@ Model_Session::Model_Session() { myPluginsInfoLoaded = false; myCheckTransactions = true; - ModelAPI_Session::setSession(boost::shared_ptr(this)); + ModelAPI_Session::setSession(std::shared_ptr(this)); // register the configuration reading listener Events_Loop* aLoop = Events_Loop::loop(); static const Events_ID kFeatureEvent = Events_Loop::eventByName(Config_FeatureMessage::MODEL_EVENT()); @@ -222,13 +222,13 @@ Model_Session::Model_Session() aLoop->registerListener(this, Events_Loop::eventByName(EVENT_VALIDATOR_LOADED)); } -void Model_Session::processEvent(const boost::shared_ptr& theMessage) +void Model_Session::processEvent(const std::shared_ptr& theMessage) { static const Events_ID kFeatureEvent = Events_Loop::eventByName(Config_FeatureMessage::MODEL_EVENT()); static const Events_ID kValidatorEvent = Events_Loop::eventByName(EVENT_VALIDATOR_LOADED); if (theMessage->eventID() == kFeatureEvent) { - const boost::shared_ptr aMsg = - boost::dynamic_pointer_cast(theMessage); + const std::shared_ptr aMsg = + std::dynamic_pointer_cast(theMessage); if (aMsg) { // proccess the plugin info, load plugin if (myPlugins.find(aMsg->id()) == myPlugins.end()) { @@ -236,8 +236,8 @@ void Model_Session::processEvent(const boost::shared_ptr& theMes aMsg->pluginLibrary(), aMsg->documentKind()); } } else { - const boost::shared_ptr aMsgAttr = - boost::dynamic_pointer_cast(theMessage); + const std::shared_ptr aMsgAttr = + std::dynamic_pointer_cast(theMessage); if (aMsgAttr) { if (!aMsgAttr->isObligatory()) { validators()->registerNotObligatory(aMsgAttr->featureId(), aMsgAttr->attributeId()); @@ -251,8 +251,8 @@ void Model_Session::processEvent(const boost::shared_ptr& theMes // plugins information was started to load, so, it will be loaded myPluginsInfoLoaded = true; } else if (theMessage->eventID() == kValidatorEvent) { - boost::shared_ptr aMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aMsg = + std::dynamic_pointer_cast(theMessage); if (aMsg) { if (aMsg->attributeId().empty()) { // feature validator validators()->assignValidator(aMsg->validatorId(), aMsg->featureId(), aMsg->parameters()); diff --git a/src/Model/Model_Session.h b/src/Model/Model_Session.h index 5186a2497..72977752a 100644 --- a/src/Model/Model_Session.h +++ b/src/Model/Model_Session.h @@ -27,7 +27,7 @@ class Model_Session : public ModelAPI_Session, public Events_Listener std::map > myPlugins; std::map myPluginObjs; ///< instances of the already plugins std::string myCurrentPluginName; ///< name of the plugin that must be loaded currently - boost::shared_ptr myCurrentDoc; ///< current working document + std::shared_ptr myCurrentDoc; ///< current working document bool myCheckTransactions; ///< if true, generates error if document is updated outside of transaction public: @@ -67,20 +67,20 @@ class Model_Session : public ModelAPI_Session, public Events_Listener MODEL_EXPORT virtual void redo(); /// Returns the root document of the application (that may contains sub-documents) - MODEL_EXPORT virtual boost::shared_ptr moduleDocument(); + MODEL_EXPORT virtual std::shared_ptr moduleDocument(); /// Return true if root document has been already created MODEL_EXPORT virtual bool hasModuleDocument(); /// Returns the current document that used for current work in the application - MODEL_EXPORT virtual boost::shared_ptr activeDocument(); + MODEL_EXPORT virtual std::shared_ptr activeDocument(); /// Defines the current document that used for current work in the application MODEL_EXPORT virtual void setActiveDocument( - boost::shared_ptr theDoc, bool theSendSignal = true); + std::shared_ptr theDoc, bool theSendSignal = true); /// Returns all the opened documents of the session (without postponed) - MODEL_EXPORT virtual std::list > allOpenedDocuments(); + MODEL_EXPORT virtual std::list > allOpenedDocuments(); /// Registers the plugin that creates features. /// It is obligatory for each plugin to call this function on loading to be found by @@ -88,11 +88,11 @@ class Model_Session : public ModelAPI_Session, public Events_Listener MODEL_EXPORT virtual void registerPlugin(ModelAPI_Plugin* thePlugin); /// Processes the configuration file reading - MODEL_EXPORT virtual void processEvent(const boost::shared_ptr& theMessage); + MODEL_EXPORT virtual void processEvent(const std::shared_ptr& theMessage); /// Copies the document to the new one wit hthe given id - MODEL_EXPORT virtual boost::shared_ptr copy( - boost::shared_ptr theSource, std::string theID); + MODEL_EXPORT virtual std::shared_ptr copy( + std::shared_ptr theSource, std::string theID); /// Returns the validators factory: the only one instance per application MODEL_EXPORT virtual ModelAPI_ValidatorsFactory* validators(); diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 910527bb2..8aa00217e 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -52,7 +52,7 @@ Model_Update::Model_Update() isAutomatic = Config_PropManager::findProp("Model update", "automatic_rebuild")->value() == "true"; } -void Model_Update::processEvent(const boost::shared_ptr& theMessage) +void Model_Update::processEvent(const std::shared_ptr& theMessage) { static Events_Loop* aLoop = Events_Loop::loop(); static const Events_ID kChangedEvent = aLoop->eventByName("PreferenceChanged"); @@ -74,8 +74,8 @@ void Model_Update::processEvent(const boost::shared_ptr& theMess } } else if (theMessage->eventID() == kCreatedEvent || theMessage->eventID() == kUpdatedEvent || theMessage->eventID() == kMovedEvent) { - boost::shared_ptr aMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aMsg = + std::dynamic_pointer_cast(theMessage); const std::set& anObjs = aMsg->objects(); std::set::const_iterator anObjIter = anObjs.cbegin(); for(; anObjIter != anObjs.cend(); anObjIter++) { @@ -93,10 +93,10 @@ void Model_Update::processEvent(const boost::shared_ptr& theMess } // the hardcode (DBC asked): hide the sketch referenced by extrusion on apply if (theMessage->eventID() == kOpFinishEvent) { - std::set >::iterator aFIter; + std::set >::iterator aFIter; for(aFIter = myJustCreatedOrUpdated.begin(); aFIter != myJustCreatedOrUpdated.end(); aFIter++) { - FeaturePtr aF = boost::dynamic_pointer_cast(*aFIter); + FeaturePtr aF = std::dynamic_pointer_cast(*aFIter); if (aF && aF->getKind() == "Extrusion") { if (aF->selection("extrusion_face")) { ResultPtr aSketchRes = aF->selection("extrusion_face")->context(); @@ -115,9 +115,9 @@ void Model_Update::processEvent(const boost::shared_ptr& theMess //Events_LongOp::start(this); isExecuted = true; - std::list > aDocs; - boost::shared_ptr aMsg = - boost::dynamic_pointer_cast(theMessage); + std::list > aDocs; + std::shared_ptr aMsg = + std::dynamic_pointer_cast(theMessage); if (aMsg) myInitial = aMsg->objects(); else { myInitial.clear(); @@ -127,20 +127,20 @@ void Model_Update::processEvent(const boost::shared_ptr& theMess } } // collect all documents involved into the update process - set >::iterator aFIter = myInitial.begin(); + set >::iterator aFIter = myInitial.begin(); for (; aFIter != myInitial.end(); aFIter++) { aDocs.push_back((*aFIter)->document()); } // iterate all features of features-documents to update them (including hidden) - std::set > alreadyUsed; - list >::iterator aDIter = aDocs.begin(); + std::set > alreadyUsed; + list >::iterator aDIter = aDocs.begin(); for (; aDIter != aDocs.end(); aDIter++) { if (alreadyUsed.find(*aDIter) != alreadyUsed.end()) continue; alreadyUsed.insert(*aDIter); int aNbFeatures = (*aDIter)->size(ModelAPI_Feature::group(), true); for (int aFIndex = 0; aFIndex < aNbFeatures; aFIndex++) { - FeaturePtr aFeature = boost::dynamic_pointer_cast( + FeaturePtr aFeature = std::dynamic_pointer_cast( (*aDIter)->object(ModelAPI_Feature::group(), aFIndex, true)); if (aFeature) updateFeature(aFeature); @@ -163,10 +163,10 @@ void Model_Update::processEvent(const boost::shared_ptr& theMess void Model_Update::redisplayWithResults(FeaturePtr theFeature) { // maske updated and redisplay all results static Events_ID EVENT_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY); - const std::list >& aResults = theFeature->results(); - std::list >::const_iterator aRIter = aResults.begin(); + const std::list >& aResults = theFeature->results(); + std::list >::const_iterator aRIter = aResults.begin(); for (; aRIter != aResults.cend(); aRIter++) { - boost::shared_ptr aRes = *aRIter; + std::shared_ptr aRes = *aRIter; aRes->data()->mustBeUpdated(false); myUpdated[aRes] = true; ModelAPI_EventCreator::get()->sendUpdated(aRes, EVENT_DISP); @@ -189,7 +189,7 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) // composite feature must be executed after sub-features execution CompositeFeaturePtr aComposite = - boost::dynamic_pointer_cast(theFeature); + std::dynamic_pointer_cast(theFeature); if (aComposite) { int aSubsNum = aComposite->numberOfSubs(); for(int a = 0; a < aSubsNum; a++) { @@ -199,8 +199,8 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) } // check all references: if referenced objects are updated, this object also must be updated std::list > > aRefs; - boost::shared_ptr aData = - boost::dynamic_pointer_cast(theFeature->data()); + std::shared_ptr aData = + std::dynamic_pointer_cast(theFeature->data()); aData->referencesToObjects(aRefs); std::list > >::iterator aRef = aRefs.begin(); for(; aRef != aRefs.end(); aRef++) { @@ -215,7 +215,7 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) //std::cout<<"Update feature "<getKind()<<" must be updated = "<(theFeature->document())->executeFeatures() || + if (std::dynamic_pointer_cast(theFeature->document())->executeFeatures() || !theFeature->isPersistentResult()) { if (aFactory->validate(theFeature)) { if (isAutomatic || (myJustCreatedOrUpdated.find(theFeature) != myJustCreatedOrUpdated.end()) || @@ -227,14 +227,14 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) theFeature->data()->attributes(ModelAPI_AttributeSelection::type()); list::iterator aRefsIter = aRefs.begin(); for (; aRefsIter != aRefs.end(); aRefsIter++) { - boost::shared_ptr aSel = - boost::dynamic_pointer_cast(*aRefsIter); + std::shared_ptr aSel = + std::dynamic_pointer_cast(*aRefsIter); aSel->update(); // this must be done on execution since it may be long operation } aRefs = theFeature->data()->attributes(ModelAPI_AttributeSelectionList::type()); for (aRefsIter = aRefs.begin(); aRefsIter != aRefs.end(); aRefsIter++) { - boost::shared_ptr aSel = - boost::dynamic_pointer_cast(*aRefsIter); + std::shared_ptr aSel = + std::dynamic_pointer_cast(*aRefsIter); for(int a = aSel->size() - 1; a >= 0; a--) { aSel->value(a)->update(); } @@ -270,10 +270,10 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) redisplayWithResults(theFeature); } else { // must be updatet, but not updated yet theFeature->data()->mustBeUpdated(true); - const std::list >& aResults = theFeature->results(); - std::list >::const_iterator aRIter = aResults.begin(); + const std::list >& aResults = theFeature->results(); + std::list >::const_iterator aRIter = aResults.begin(); for (; aRIter != aResults.cend(); aRIter++) { - boost::shared_ptr aRes = *aRIter; + std::shared_ptr aRes = *aRIter; aRes->data()->mustBeUpdated(true); } } @@ -285,8 +285,8 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) redisplayWithResults(theFeature); } } else { // returns also true is results were updated: for sketch that refers to sub-features but results of sub-features were changed - const std::list >& aResults = theFeature->results(); - std::list >::const_iterator aRIter = aResults.begin(); + const std::list >& aResults = theFeature->results(); + std::list >::const_iterator aRIter = aResults.begin(); for (; aRIter != aResults.cend(); aRIter++) { if (myInitial.find(*aRIter) != myInitial.end()) { aMustbeUpdated = true; @@ -299,7 +299,7 @@ bool Model_Update::updateFeature(FeaturePtr theFeature) return aMustbeUpdated; } -bool Model_Update::updateObject(boost::shared_ptr theObject, const bool theCyclic) +bool Model_Update::updateObject(std::shared_ptr theObject, const bool theCyclic) { if (myUpdated.find(theObject) != myUpdated.end()) return myUpdated[theObject]; // already processed @@ -308,7 +308,7 @@ bool Model_Update::updateObject(boost::shared_ptr theObject, co if (theCyclic) { // algorithm for update of all features by dependencies tree if (!theObject) return false; - FeaturePtr aFeature = boost::dynamic_pointer_cast(theObject); + FeaturePtr aFeature = std::dynamic_pointer_cast(theObject); if (aFeature) { // for feature just call update Feature return updateFeature(aFeature); } @@ -316,7 +316,7 @@ bool Model_Update::updateObject(boost::shared_ptr theObject, co if (myUpdated.find(theObject) != myUpdated.end()) return myUpdated[theObject]; // already processed // check the feature of this object must be executed - ResultPtr aResult = boost::dynamic_pointer_cast(theObject); + ResultPtr aResult = std::dynamic_pointer_cast(theObject); if (aResult) { FeaturePtr aResFeature = aResult->document()->feature(aResult); if (aResFeature) { diff --git a/src/Model/Model_Update.h b/src/Model/Model_Update.h index ab4e4c8ff..31d532da5 100644 --- a/src/Model/Model_Update.h +++ b/src/Model/Model_Update.h @@ -7,7 +7,7 @@ #include "Model.h" #include "Events_Listener.h" -#include +#include #include #include @@ -21,34 +21,34 @@ class ModelAPI_Feature; class Model_Update : public Events_Listener { /// initial set of updated features that must be processed - std::set > myInitial; + std::set > myInitial; /// already updated and processed features and modificated feature flag - std::map, bool> myUpdated; + std::map, bool> myUpdated; /// to know that all next updates are caused by this execution bool isExecuted; /// to know execute or not automatically all update bool isAutomatic; /// just created features: they must be updated immideately even in not-automatic mode for /// preview; cleared on commit operations - std::set > myJustCreatedOrUpdated; + std::set > myJustCreatedOrUpdated; public: /// Is called only once, on startup of the application Model_Update(); /// Processes the feature argument update: executes the results - MODEL_EXPORT virtual void processEvent(const boost::shared_ptr& theMessage); + MODEL_EXPORT virtual void processEvent(const std::shared_ptr& theMessage); protected: /// Recoursively checks and updates the feature if needed (calls the execute method) /// Returns true if feature was updated. - bool updateFeature(boost::shared_ptr theFeature); + bool updateFeature(std::shared_ptr theFeature); /// Recoursively checks and updates the object (result or feature) if needed (calls updateFeature) /// Returns true if object was updated. - bool updateObject(boost::shared_ptr theObject, const bool theCyclic = true); + bool updateObject(std::shared_ptr theObject, const bool theCyclic = true); /// Sends the redisplay events for feature and results, updates the updated status - void redisplayWithResults(boost::shared_ptr theFeature); + void redisplayWithResults(std::shared_ptr theFeature); }; #endif diff --git a/src/Model/Model_Validator.cpp b/src/Model/Model_Validator.cpp index e7750131e..cc3a612a5 100644 --- a/src/Model/Model_Validator.cpp +++ b/src/Model/Model_Validator.cpp @@ -141,7 +141,7 @@ void Model_ValidatorsFactory::addDefaultValidators(std::listsecond); } -bool Model_ValidatorsFactory::validate(const boost::shared_ptr& theFeature) const +bool Model_ValidatorsFactory::validate(const std::shared_ptr& theFeature) const { const static std::string kDefaultId = "Model_FeatureValidator"; // check feature validators first @@ -176,7 +176,7 @@ bool Model_ValidatorsFactory::validate(const boost::shared_ptr } } // check all attributes for validity - boost::shared_ptr aData = theFeature->data(); + std::shared_ptr aData = theFeature->data(); if (!aData || !aData->isValid()) return false; static const std::string kAllTypes = ""; diff --git a/src/Model/Model_Validator.h b/src/Model/Model_Validator.h index 5fa3a8a90..a6d369963 100644 --- a/src/Model/Model_Validator.h +++ b/src/Model/Model_Validator.h @@ -70,7 +70,7 @@ class Model_ValidatorsFactory : public ModelAPI_ValidatorsFactory MODEL_EXPORT virtual const ModelAPI_Validator* validator(const std::string& theID) const; /// Returns true if feature and all its attributes are valid. - MODEL_EXPORT virtual bool validate(const boost::shared_ptr& theFeature) const; + MODEL_EXPORT virtual bool validate(const std::shared_ptr& theFeature) const; /// register that this attribute in feature is not obligatory for the feature execution /// so, it is not needed for the standard validation mechanism diff --git a/src/ModelAPI/ModelAPI.i b/src/ModelAPI/ModelAPI.i index ba16e8f1c..c1ade993d 100644 --- a/src/ModelAPI/ModelAPI.i +++ b/src/ModelAPI/ModelAPI.i @@ -28,9 +28,9 @@ #include "ModelAPI_ResultPart.h" template - boost::shared_ptr boost_cast(boost::shared_ptr theObject) + std::shared_ptr shared_ptr_cast(std::shared_ptr theObject) { - return boost::dynamic_pointer_cast(theObject); + return std::dynamic_pointer_cast(theObject); } %} @@ -43,9 +43,9 @@ %include "typemaps.i" %include "std_string.i" %include "std_list.i" +%include "std_shared_ptr.i" -// boost pointers -%include +// shared pointers // For ModelAPI_ResultConstruction.shape() %shared_ptr(GeomAPI_Interface) %shared_ptr(GeomAPI_Shape) @@ -97,13 +97,13 @@ %include "ModelAPI_ResultBody.h" %include "ModelAPI_ResultPart.h" -%template(ObjectList) std::list >; -%template(ResultList) std::list >; +%template(ObjectList) std::list >; +%template(ResultList) std::list >; -template boost::shared_ptr boost_cast(boost::shared_ptr theObject); -%template(modelAPI_CompositeFeature) boost_cast; -%template(modelAPI_ResultConstruction) boost_cast; -%template(modelAPI_ResultBody) boost_cast; -%template(modelAPI_ResultPart) boost_cast; +template std::shared_ptr shared_ptr_cast(std::shared_ptr theObject); +%template(modelAPI_CompositeFeature) shared_ptr_cast; +%template(modelAPI_ResultConstruction) shared_ptr_cast; +%template(modelAPI_ResultBody) shared_ptr_cast; +%template(modelAPI_ResultPart) shared_ptr_cast; diff --git a/src/ModelAPI/ModelAPI_Attribute.h b/src/ModelAPI/ModelAPI_Attribute.h index cfef51724..27d65eb9b 100644 --- a/src/ModelAPI/ModelAPI_Attribute.h +++ b/src/ModelAPI/ModelAPI_Attribute.h @@ -7,7 +7,7 @@ #include "ModelAPI.h" #include -#include +#include class ModelAPI_Object; @@ -18,7 +18,7 @@ class ModelAPI_Object; class ModelAPI_Attribute { ///< needed here to emit signal that feature changed on change of the attribute - boost::shared_ptr myObject; + std::shared_ptr myObject; protected: // accessible from the attributes bool myIsInitialized; @@ -36,13 +36,13 @@ class ModelAPI_Attribute } /// Sets the owner of this attribute - MODELAPI_EXPORT virtual void setObject(const boost::shared_ptr& theObject) + MODELAPI_EXPORT virtual void setObject(const std::shared_ptr& theObject) { myObject = theObject; } /// Returns the owner of this attribute - MODELAPI_EXPORT const boost::shared_ptr& owner() const + MODELAPI_EXPORT const std::shared_ptr& owner() const { return myObject; } @@ -100,6 +100,6 @@ class ModelAPI_Attribute }; //! Pointer on attribute object -typedef boost::shared_ptr AttributePtr; +typedef std::shared_ptr AttributePtr; #endif diff --git a/src/ModelAPI/ModelAPI_AttributeBoolean.h b/src/ModelAPI/ModelAPI_AttributeBoolean.h index cf431322b..23c8f2403 100644 --- a/src/ModelAPI/ModelAPI_AttributeBoolean.h +++ b/src/ModelAPI/ModelAPI_AttributeBoolean.h @@ -45,6 +45,6 @@ class ModelAPI_AttributeBoolean : public ModelAPI_Attribute } }; -typedef boost::shared_ptr AttributeBooleanPtr; +typedef std::shared_ptr AttributeBooleanPtr; #endif diff --git a/src/ModelAPI/ModelAPI_AttributeDocRef.h b/src/ModelAPI/ModelAPI_AttributeDocRef.h index cf7cc84f3..b7c4bbcdf 100644 --- a/src/ModelAPI/ModelAPI_AttributeDocRef.h +++ b/src/ModelAPI/ModelAPI_AttributeDocRef.h @@ -17,10 +17,10 @@ class ModelAPI_AttributeDocRef : public ModelAPI_Attribute { public: /// Defines the document referenced from this attribute - MODELAPI_EXPORT virtual void setValue(boost::shared_ptr theDoc) = 0; + MODELAPI_EXPORT virtual void setValue(std::shared_ptr theDoc) = 0; /// Returns document referenced from this attribute - MODELAPI_EXPORT virtual boost::shared_ptr value() = 0; + MODELAPI_EXPORT virtual std::shared_ptr value() = 0; /// Returns the type of this class of attributes MODELAPI_EXPORT static std::string type() @@ -46,6 +46,6 @@ class ModelAPI_AttributeDocRef : public ModelAPI_Attribute } }; -typedef boost::shared_ptr AttributeDocRefPtr; +typedef std::shared_ptr AttributeDocRefPtr; #endif diff --git a/src/ModelAPI/ModelAPI_AttributeDouble.h b/src/ModelAPI/ModelAPI_AttributeDouble.h index e61dfa060..670c7f089 100644 --- a/src/ModelAPI/ModelAPI_AttributeDouble.h +++ b/src/ModelAPI/ModelAPI_AttributeDouble.h @@ -46,6 +46,6 @@ class ModelAPI_AttributeDouble : public ModelAPI_Attribute }; //! Pointer on double attribute -typedef boost::shared_ptr AttributeDoublePtr; +typedef std::shared_ptr AttributeDoublePtr; #endif diff --git a/src/ModelAPI/ModelAPI_AttributeInteger.h b/src/ModelAPI/ModelAPI_AttributeInteger.h index 6e63cafe7..16e70ee66 100644 --- a/src/ModelAPI/ModelAPI_AttributeInteger.h +++ b/src/ModelAPI/ModelAPI_AttributeInteger.h @@ -50,6 +50,6 @@ class ModelAPI_AttributeInteger : public ModelAPI_Attribute }; //! Pointer on double attribute -typedef boost::shared_ptr AttributeIntegerPtr; +typedef std::shared_ptr AttributeIntegerPtr; #endif diff --git a/src/ModelAPI/ModelAPI_AttributeRefAttr.h b/src/ModelAPI/ModelAPI_AttributeRefAttr.h index a3bf80601..5644cc47f 100644 --- a/src/ModelAPI/ModelAPI_AttributeRefAttr.h +++ b/src/ModelAPI/ModelAPI_AttributeRefAttr.h @@ -21,10 +21,10 @@ class ModelAPI_AttributeRefAttr : public ModelAPI_Attribute MODELAPI_EXPORT virtual bool isObject() = 0; /// Defines the reference to the attribute - MODELAPI_EXPORT virtual void setAttr(boost::shared_ptr theAttr) = 0; + MODELAPI_EXPORT virtual void setAttr(std::shared_ptr theAttr) = 0; /// Returns attribute referenced from this attribute - MODELAPI_EXPORT virtual boost::shared_ptr attr() = 0; + MODELAPI_EXPORT virtual std::shared_ptr attr() = 0; /// Defines the reference to the object MODELAPI_EXPORT virtual void setObject(ObjectPtr theFeature) = 0; @@ -56,6 +56,6 @@ class ModelAPI_AttributeRefAttr : public ModelAPI_Attribute } }; -typedef boost::shared_ptr AttributeRefAttrPtr; +typedef std::shared_ptr AttributeRefAttrPtr; #endif diff --git a/src/ModelAPI/ModelAPI_AttributeRefList.h b/src/ModelAPI/ModelAPI_AttributeRefList.h index d8edfe8d0..3036cc970 100644 --- a/src/ModelAPI/ModelAPI_AttributeRefList.h +++ b/src/ModelAPI/ModelAPI_AttributeRefList.h @@ -51,6 +51,6 @@ class ModelAPI_AttributeRefList : public ModelAPI_Attribute } }; -typedef boost::shared_ptr AttributeRefListPtr; +typedef std::shared_ptr AttributeRefListPtr; #endif diff --git a/src/ModelAPI/ModelAPI_AttributeReference.h b/src/ModelAPI/ModelAPI_AttributeReference.h index 5354e8af5..25508af85 100644 --- a/src/ModelAPI/ModelAPI_AttributeReference.h +++ b/src/ModelAPI/ModelAPI_AttributeReference.h @@ -46,6 +46,6 @@ class ModelAPI_AttributeReference : public ModelAPI_Attribute } }; -typedef boost::shared_ptr AttributeReferencePtr; +typedef std::shared_ptr AttributeReferencePtr; #endif diff --git a/src/ModelAPI/ModelAPI_AttributeSelection.h b/src/ModelAPI/ModelAPI_AttributeSelection.h index 40882dde4..80335f217 100644 --- a/src/ModelAPI/ModelAPI_AttributeSelection.h +++ b/src/ModelAPI/ModelAPI_AttributeSelection.h @@ -18,10 +18,10 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute public: /// Defines the result and its selected sub-shape virtual void setValue( - const ResultPtr& theContext, const boost::shared_ptr& theSubShape) = 0; + const ResultPtr& theContext, const std::shared_ptr& theSubShape) = 0; /// Returns the selected subshape - virtual boost::shared_ptr value() = 0; + virtual std::shared_ptr value() = 0; /// Returns the context of the selection (the whole shape owner) virtual ResultPtr context() = 0; @@ -55,6 +55,6 @@ class ModelAPI_AttributeSelection : public ModelAPI_Attribute }; //! Pointer on double attribute -typedef boost::shared_ptr AttributeSelectionPtr; +typedef std::shared_ptr AttributeSelectionPtr; #endif diff --git a/src/ModelAPI/ModelAPI_AttributeSelectionList.h b/src/ModelAPI/ModelAPI_AttributeSelectionList.h index aef9046ae..37647df68 100644 --- a/src/ModelAPI/ModelAPI_AttributeSelectionList.h +++ b/src/ModelAPI/ModelAPI_AttributeSelectionList.h @@ -19,7 +19,7 @@ class ModelAPI_AttributeSelectionList : public ModelAPI_Attribute public: /// Adds the new reference to the end of the list virtual void append( - const ResultPtr& theContext, const boost::shared_ptr& theSubShape) = 0; + const ResultPtr& theContext, const std::shared_ptr& theSubShape) = 0; /// Returns the number ofselection attributes in the list virtual int size() = 0; @@ -29,7 +29,7 @@ class ModelAPI_AttributeSelectionList : public ModelAPI_Attribute virtual void setSelectionType(int) = 0; /// Returns the attribute selection by the index (zero based) - virtual boost::shared_ptr value(const int theIndex) = 0; + virtual std::shared_ptr value(const int theIndex) = 0; /// Returns all attributes virtual void clear() = 0; @@ -59,6 +59,6 @@ class ModelAPI_AttributeSelectionList : public ModelAPI_Attribute }; //! Pointer on double attribute -typedef boost::shared_ptr AttributeSelectionListPtr; +typedef std::shared_ptr AttributeSelectionListPtr; #endif diff --git a/src/ModelAPI/ModelAPI_AttributeString.h b/src/ModelAPI/ModelAPI_AttributeString.h index 5b037f1c0..a111ba388 100644 --- a/src/ModelAPI/ModelAPI_AttributeString.h +++ b/src/ModelAPI/ModelAPI_AttributeString.h @@ -48,6 +48,6 @@ class ModelAPI_AttributeString : public ModelAPI_Attribute }; //! Pointer on double attribute -typedef boost::shared_ptr AttributeStringPtr; +typedef std::shared_ptr AttributeStringPtr; #endif diff --git a/src/ModelAPI/ModelAPI_CompositeFeature.h b/src/ModelAPI/ModelAPI_CompositeFeature.h index 878ca849f..e21a6aa09 100644 --- a/src/ModelAPI/ModelAPI_CompositeFeature.h +++ b/src/ModelAPI/ModelAPI_CompositeFeature.h @@ -17,13 +17,13 @@ class ModelAPI_CompositeFeature : public ModelAPI_Feature { public: /// Adds feature to the sketch and to its document - virtual boost::shared_ptr addFeature(std::string theID) = 0; + virtual std::shared_ptr addFeature(std::string theID) = 0; /// Returns the number of sub-elements virtual int numberOfSubs() const = 0; /// Returns the sub-feature by zero-base index - virtual boost::shared_ptr subFeature(const int theIndex) const = 0; + virtual std::shared_ptr subFeature(const int theIndex) const = 0; /// Returns the sub-feature unique identifier in this composite feature by zero-base index virtual int subFeatureId(const int theIndex) const = 0; @@ -33,6 +33,6 @@ public: }; //! Pointer on the composite feature object -typedef boost::shared_ptr CompositeFeaturePtr; +typedef std::shared_ptr CompositeFeaturePtr; #endif diff --git a/src/ModelAPI/ModelAPI_Data.h b/src/ModelAPI/ModelAPI_Data.h index 191345f1a..8cc137477 100644 --- a/src/ModelAPI/ModelAPI_Data.h +++ b/src/ModelAPI/ModelAPI_Data.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include class ModelAPI_AttributeDocRef; class ModelAPI_AttributeInteger; @@ -43,42 +43,42 @@ class MODELAPI_EXPORT ModelAPI_Data virtual void setName(const std::string& theName) = 0; /// Returns the attribute that references to another document - virtual boost::shared_ptr document(const std::string& theID) = 0; + virtual std::shared_ptr document(const std::string& theID) = 0; /// Returns the attribute that contains real value with double precision - virtual boost::shared_ptr real(const std::string& theID) = 0; + virtual std::shared_ptr real(const std::string& theID) = 0; /// Returns the attribute that contains integer value - virtual boost::shared_ptr integer(const std::string& theID) = 0; + virtual std::shared_ptr integer(const std::string& theID) = 0; /// Returns the attribute that contains reference to a feature - virtual boost::shared_ptr reference(const std::string& theID) = 0; + virtual std::shared_ptr reference(const std::string& theID) = 0; /// Returns the attribute that contains selection to a shape - virtual boost::shared_ptr selection(const std::string& theID) = 0; + virtual std::shared_ptr selection(const std::string& theID) = 0; /// Returns the attribute that contains selection to a shape - virtual boost::shared_ptr + virtual std::shared_ptr selectionList(const std::string& theID) = 0; /// Returns the attribute that contains reference to an attribute of a feature - virtual boost::shared_ptr refattr(const std::string& theID) = 0; + virtual std::shared_ptr refattr(const std::string& theID) = 0; /// Returns the attribute that contains list of references to features - virtual boost::shared_ptr reflist(const std::string& theID) = 0; + virtual std::shared_ptr reflist(const std::string& theID) = 0; /// Returns the attribute that contains boolean value - virtual boost::shared_ptr boolean(const std::string& theID) = 0; + virtual std::shared_ptr boolean(const std::string& theID) = 0; /// Returns the attribute that contains boolean value - virtual boost::shared_ptr string(const std::string& theID) = 0; + virtual std::shared_ptr string(const std::string& theID) = 0; /// Returns the generic attribute by identifier /// \param theID identifier of the attribute - virtual boost::shared_ptr attribute(const std::string& theID) = 0; + virtual std::shared_ptr attribute(const std::string& theID) = 0; /// Returns all attributes of the feature of the given type /// or all attributes if "theType" is empty - virtual std::list > + virtual std::list > attributes(const std::string& theType) = 0; /// Returns all attributes ids of the feature of the given type /// or all attributes if "theType" is empty virtual std::list attributesIDs(const std::string& theType) = 0; /// Identifier by the id (not fast, iteration by map) /// \param theAttr attribute already created in this data - virtual const std::string& id(const boost::shared_ptr& theAttr) = 0; + virtual const std::string& id(const std::shared_ptr& theAttr) = 0; /// Returns true if data belongs to same features - virtual bool isEqual(const boost::shared_ptr& theData) = 0; + virtual bool isEqual(const std::shared_ptr& theData) = 0; /// Returns true if it is correctly connected to the data model virtual bool isValid() = 0; @@ -111,7 +111,7 @@ class MODELAPI_EXPORT ModelAPI_Data virtual int featureId() const = 0; // returns all objects referenced to this - virtual const std::set >& refsToMe() = 0; + virtual const std::set >& refsToMe() = 0; protected: /// Objects are created for features automatically @@ -120,6 +120,6 @@ class MODELAPI_EXPORT ModelAPI_Data } }; -typedef boost::shared_ptr DataPtr; +typedef std::shared_ptr DataPtr; #endif diff --git a/src/ModelAPI/ModelAPI_Document.h b/src/ModelAPI/ModelAPI_Document.h index 0b67c44f1..84439e686 100644 --- a/src/ModelAPI/ModelAPI_Document.h +++ b/src/ModelAPI/ModelAPI_Document.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include @@ -40,14 +40,14 @@ public: //! Adds to the document the new feature of the given feature id //! \param creates feature and puts it in the document (if it is not action) - virtual boost::shared_ptr addFeature(std::string theID) = 0; + virtual std::shared_ptr addFeature(std::string theID) = 0; //! Removes the feature from the document - virtual void removeFeature(boost::shared_ptr theFeature, + virtual void removeFeature(std::shared_ptr theFeature, const bool theCheck = true) = 0; ///! Adds a new sub-document by the identifier, or returns existing one if it is already exist - virtual boost::shared_ptr subDocument(std::string theDocID) = 0; + virtual std::shared_ptr subDocument(std::string theDocID) = 0; ///! Returns the id of the document virtual const std::string& id() const = 0; @@ -56,7 +56,7 @@ public: //! \param theGroupID group that contains an object //! \param theIndex zero-based index of feature in the group //! \param theHidden if it is true, it counts also the features that are not in tree - virtual boost::shared_ptr object(const std::string& theGroupID, + virtual std::shared_ptr object(const std::string& theGroupID, const int theIndex, const bool theHidden = false) = 0; @@ -70,21 +70,21 @@ public: } /// Creates a construction cresults - virtual boost::shared_ptr createConstruction( - const boost::shared_ptr& theFeatureData, const int theIndex = 0) = 0; + virtual std::shared_ptr createConstruction( + const std::shared_ptr& theFeatureData, const int theIndex = 0) = 0; /// Creates a body results - virtual boost::shared_ptr createBody( - const boost::shared_ptr& theFeatureData, const int theIndex = 0) = 0; + virtual std::shared_ptr createBody( + const std::shared_ptr& theFeatureData, const int theIndex = 0) = 0; /// Creates a part results - virtual boost::shared_ptr createPart( - const boost::shared_ptr& theFeatureData, const int theIndex = 0) = 0; + virtual std::shared_ptr createPart( + const std::shared_ptr& theFeatureData, const int theIndex = 0) = 0; /// Creates a group results - virtual boost::shared_ptr createGroup( - const boost::shared_ptr& theFeatureData, const int theIndex = 0) = 0; + virtual std::shared_ptr createGroup( + const std::shared_ptr& theFeatureData, const int theIndex = 0) = 0; //! Returns a feature by result (owner of result) - virtual boost::shared_ptr feature( - const boost::shared_ptr& theResult) = 0; + virtual std::shared_ptr feature( + const std::shared_ptr& theResult) = 0; protected: /// Only for SWIG wrapping it is here @@ -94,6 +94,6 @@ protected: }; //! Pointer on document object -typedef boost::shared_ptr DocumentPtr; +typedef std::shared_ptr DocumentPtr; #endif diff --git a/src/ModelAPI/ModelAPI_Events.h b/src/ModelAPI/ModelAPI_Events.h index 380a66582..9141c146c 100644 --- a/src/ModelAPI/ModelAPI_Events.h +++ b/src/ModelAPI/ModelAPI_Events.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include @@ -48,10 +48,10 @@ class ModelAPI_ObjectUpdatedMessage : public Events_MessageGroup virtual const std::set& objects() const = 0; //! Creates a new empty group (to store it in the loop before flush) - virtual boost::shared_ptr newEmpty() = 0; + virtual std::shared_ptr newEmpty() = 0; //! Allows to join the given message with the current one - virtual void Join(const boost::shared_ptr& theJoined) = 0; + virtual void Join(const std::shared_ptr& theJoined) = 0; }; /// Message that feature was deleted (used for Object Browser update) @@ -65,16 +65,16 @@ class ModelAPI_ObjectDeletedMessage : public Events_MessageGroup public: /// Returns the feature that has been updated - virtual boost::shared_ptr document() const = 0; + virtual std::shared_ptr document() const = 0; /// Returns the group where the feature was deleted virtual const std::set& groups() const = 0; - virtual boost::shared_ptr newEmpty() = 0; + virtual std::shared_ptr newEmpty() = 0; virtual const Events_ID messageId() = 0; - virtual void Join(const boost::shared_ptr& theJoined) = 0; + virtual void Join(const std::shared_ptr& theJoined) = 0; }; /// Allows to create ModelAPI messages @@ -85,7 +85,7 @@ class MODELAPI_EXPORT ModelAPI_EventCreator virtual void sendUpdated(const ObjectPtr& theObject, const Events_ID& theEvent, const bool isGroupped = true) const = 0; /// creates deleted message and sends to the loop - virtual void sendDeleted(const boost::shared_ptr& theDoc, + virtual void sendDeleted(const std::shared_ptr& theDoc, const std::string& theGroup) const = 0; /// returns the creator instance diff --git a/src/ModelAPI/ModelAPI_Feature.cpp b/src/ModelAPI/ModelAPI_Feature.cpp index 94b1a64e8..5be82475e 100644 --- a/src/ModelAPI/ModelAPI_Feature.cpp +++ b/src/ModelAPI/ModelAPI_Feature.cpp @@ -10,22 +10,22 @@ #include #include -const std::list >& ModelAPI_Feature::results() +const std::list >& ModelAPI_Feature::results() { return myResults; } -boost::shared_ptr ModelAPI_Feature::firstResult() +std::shared_ptr ModelAPI_Feature::firstResult() { - return myResults.empty() ? boost::shared_ptr() : *(myResults.begin()); + return myResults.empty() ? std::shared_ptr() : *(myResults.begin()); } -boost::shared_ptr ModelAPI_Feature::lastResult() +std::shared_ptr ModelAPI_Feature::lastResult() { - return myResults.empty() ? boost::shared_ptr() : *(myResults.rbegin()); + return myResults.empty() ? std::shared_ptr() : *(myResults.rbegin()); } -void ModelAPI_Feature::setResult(const boost::shared_ptr& theResult) +void ModelAPI_Feature::setResult(const std::shared_ptr& theResult) { if (firstResult() == theResult) { // just updated static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED); @@ -34,7 +34,7 @@ void ModelAPI_Feature::setResult(const boost::shared_ptr& theRe } // created while (!myResults.empty()) { // remove one by one with messages - boost::shared_ptr aRes = *(myResults.begin()); + std::shared_ptr aRes = *(myResults.begin()); myResults.erase(myResults.begin()); ModelAPI_EventCreator::get()->sendDeleted(aRes->document(), aRes->groupName()); } @@ -45,10 +45,10 @@ void ModelAPI_Feature::setResult(const boost::shared_ptr& theRe Events_Loop::loop()->flush(anEvent); } -void ModelAPI_Feature::setResult(const boost::shared_ptr& theResult, +void ModelAPI_Feature::setResult(const std::shared_ptr& theResult, const int theIndex) { - std::list >::iterator aResIter = myResults.begin(); + std::list >::iterator aResIter = myResults.begin(); for (int anIndex = 0; anIndex < theIndex; anIndex++) { aResIter++; } @@ -66,9 +66,9 @@ void ModelAPI_Feature::setResult(const boost::shared_ptr& theRe } } -void ModelAPI_Feature::removeResult(const boost::shared_ptr& theResult) +void ModelAPI_Feature::removeResult(const std::shared_ptr& theResult) { - std::list >::iterator aResIter = myResults.begin(); + std::list >::iterator aResIter = myResults.begin(); for(; aResIter != myResults.end(); aResIter++) { ResultPtr aRes = *aResIter; if (aRes == theResult) { @@ -94,7 +94,7 @@ void ModelAPI_Feature::eraseResults() static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); - std::list >::iterator aResIter = myResults.begin(); + std::list >::iterator aResIter = myResults.begin(); for(; aResIter != myResults.end(); aResIter++) { (*aResIter)->data()->erase(); ModelAPI_EventCreator::get()->sendDeleted(document(), (*aResIter)->groupName()); @@ -107,7 +107,7 @@ void ModelAPI_Feature::eraseResults() } } -boost::shared_ptr ModelAPI_Feature::documentToAdd() +std::shared_ptr ModelAPI_Feature::documentToAdd() { return ModelAPI_Session::get()->activeDocument(); } @@ -119,7 +119,7 @@ void ModelAPI_Feature::erase() static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); while (!myResults.empty()) { // remove one by one with messages - boost::shared_ptr aRes = *(myResults.begin()); + std::shared_ptr aRes = *(myResults.begin()); myResults.erase(myResults.begin()); aECreator->sendDeleted(aRes->document(), aRes->groupName()); aECreator->sendUpdated(aRes, EVENT_DISP); @@ -134,9 +134,9 @@ ModelAPI_Feature::~ModelAPI_Feature() FeaturePtr ModelAPI_Feature::feature(ObjectPtr theObject) { - FeaturePtr aFeature = boost::dynamic_pointer_cast(theObject); + FeaturePtr aFeature = std::dynamic_pointer_cast(theObject); if (!aFeature) { - ResultPtr aResult = boost::dynamic_pointer_cast(theObject); + ResultPtr aResult = std::dynamic_pointer_cast(theObject); if (aResult) { DocumentPtr aDoc = aResult->document(); return aDoc->feature(aResult); diff --git a/src/ModelAPI/ModelAPI_Feature.h b/src/ModelAPI/ModelAPI_Feature.h index c266b505e..a01adf4b1 100644 --- a/src/ModelAPI/ModelAPI_Feature.h +++ b/src/ModelAPI/ModelAPI_Feature.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -38,7 +38,7 @@ class ModelAPI_Result; class ModelAPI_Feature : public ModelAPI_Object { ///< list of current results of this feature - std::list > myResults; + std::list > myResults; public: /// Returns the unique kind of a feature (like "Point") virtual const std::string& getKind() = 0; @@ -51,7 +51,7 @@ class ModelAPI_Feature : public ModelAPI_Object } /// Returns document this feature belongs to - virtual boost::shared_ptr document() const + virtual std::shared_ptr document() const { return ModelAPI_Object::document(); } @@ -69,18 +69,18 @@ class ModelAPI_Feature : public ModelAPI_Object virtual void execute() = 0; /// returns the current results of the feature - MODELAPI_EXPORT const std::list >& results(); + MODELAPI_EXPORT const std::list >& results(); /// returns the first result in the list or NULL reference - MODELAPI_EXPORT boost::shared_ptr firstResult(); + MODELAPI_EXPORT std::shared_ptr firstResult(); /// returns the last result in the list or NULL reference - MODELAPI_EXPORT boost::shared_ptr lastResult(); + MODELAPI_EXPORT std::shared_ptr lastResult(); /// sets the alone result - MODELAPI_EXPORT void setResult(const boost::shared_ptr& theResult); + MODELAPI_EXPORT void setResult(const std::shared_ptr& theResult); /// sets the result by index (zero based), results before this must be set before - MODELAPI_EXPORT void setResult(const boost::shared_ptr& theResult, + MODELAPI_EXPORT void setResult(const std::shared_ptr& theResult, const int theIndex); /// removes the result from the feature - MODELAPI_EXPORT void removeResult(const boost::shared_ptr& theResult); + MODELAPI_EXPORT void removeResult(const std::shared_ptr& theResult); /// removes all results from the feature MODELAPI_EXPORT void eraseResults(); /// removes all fields from this feature: results, data, etc @@ -99,12 +99,12 @@ class ModelAPI_Feature : public ModelAPI_Object /// Must return document where the new feature must be added to /// By default it is current document - MODELAPI_EXPORT virtual boost::shared_ptr documentToAdd(); + MODELAPI_EXPORT virtual std::shared_ptr documentToAdd(); /// To virtually destroy the fields of successors MODELAPI_EXPORT virtual ~ModelAPI_Feature(); - MODELAPI_EXPORT static boost::shared_ptr feature(ObjectPtr theObject); + MODELAPI_EXPORT static std::shared_ptr feature(ObjectPtr theObject); // // Helper methods, aliases for data()->method() @@ -114,57 +114,57 @@ class ModelAPI_Feature : public ModelAPI_Object return data()->name(); } - inline boost::shared_ptr boolean(const std::string& theID) + inline std::shared_ptr boolean(const std::string& theID) { return data()->boolean(theID); } - inline boost::shared_ptr document(const std::string& theID) + inline std::shared_ptr document(const std::string& theID) { return data()->document(theID); } - inline boost::shared_ptr real(const std::string& theID) + inline std::shared_ptr real(const std::string& theID) { return data()->real(theID); } - inline boost::shared_ptr integer(const std::string& theID) + inline std::shared_ptr integer(const std::string& theID) { return data()->integer(theID); } - inline boost::shared_ptr refattr(const std::string& theID) + inline std::shared_ptr refattr(const std::string& theID) { return data()->refattr(theID); } - inline boost::shared_ptr reference(const std::string& theID) + inline std::shared_ptr reference(const std::string& theID) { return data()->reference(theID); } - inline boost::shared_ptr reflist(const std::string& theID) + inline std::shared_ptr reflist(const std::string& theID) { return data()->reflist(theID); } - inline boost::shared_ptr selection(const std::string& theID) + inline std::shared_ptr selection(const std::string& theID) { return data()->selection(theID); } - inline boost::shared_ptr selectionList(const std::string& theID) + inline std::shared_ptr selectionList(const std::string& theID) { return data()->selectionList(theID); } - inline boost::shared_ptr string(const std::string& theID) + inline std::shared_ptr string(const std::string& theID) { return data()->string(theID); } - inline boost::shared_ptr attribute(const std::string& theID) + inline std::shared_ptr attribute(const std::string& theID) { return data()->attribute(theID); } @@ -172,7 +172,7 @@ class ModelAPI_Feature : public ModelAPI_Object }; //! Pointer on feature object -typedef boost::shared_ptr FeaturePtr; +typedef std::shared_ptr FeaturePtr; #endif diff --git a/src/ModelAPI/ModelAPI_FeatureValidator.h b/src/ModelAPI/ModelAPI_FeatureValidator.h index 3dafdf813..6d44a735a 100644 --- a/src/ModelAPI/ModelAPI_FeatureValidator.h +++ b/src/ModelAPI/ModelAPI_FeatureValidator.h @@ -15,7 +15,7 @@ class ModelAPI_FeatureValidator : public ModelAPI_Validator /// \param theFeature the validated feature /// \param theAttr the validated attribute ID, empty string of feature is validated /// \param theArguments list of string, feature attribute names: dependent attributes - virtual bool isValid(const boost::shared_ptr& theFeature, + virtual bool isValid(const std::shared_ptr& theFeature, const std::list& theArguments) const = 0; }; diff --git a/src/ModelAPI/ModelAPI_Object.h b/src/ModelAPI/ModelAPI_Object.h index aba6567eb..be4880540 100644 --- a/src/ModelAPI/ModelAPI_Object.h +++ b/src/ModelAPI/ModelAPI_Object.h @@ -8,7 +8,7 @@ #include "ModelAPI.h" #include "ModelAPI_Data.h" -#include +#include class ModelAPI_Data; class ModelAPI_Document; @@ -24,8 +24,8 @@ class ModelAPI_Document; */ class ModelAPI_Object { - boost::shared_ptr myData; ///< manager of the data model of a feature - boost::shared_ptr myDoc; ///< document this object belongs to + std::shared_ptr myData; ///< manager of the data model of a feature + std::shared_ptr myDoc; ///< document this object belongs to public: /// By default object is displayed in the object browser. virtual bool isInHistory() @@ -34,19 +34,19 @@ class ModelAPI_Object } /// Returns the data manager of this object: attributes - virtual boost::shared_ptr data() const + virtual std::shared_ptr data() const { return myData; } /// Returns true if object refers to the same data model instance - virtual bool isSame(const boost::shared_ptr& theObject) + virtual bool isSame(const std::shared_ptr& theObject) { return theObject.get() == this; } /// Returns document this feature belongs to - virtual boost::shared_ptr document() const + virtual std::shared_ptr document() const { return myDoc; } @@ -63,13 +63,13 @@ class ModelAPI_Object protected: /// Sets the data manager of an object (document does) - virtual void setData(boost::shared_ptr theData) + virtual void setData(std::shared_ptr theData) { myData = theData; } /// Sets the data manager of an object (document does) - virtual void setDoc(boost::shared_ptr theDoc) + virtual void setDoc(std::shared_ptr theDoc) { myDoc = theDoc; } @@ -84,6 +84,6 @@ class ModelAPI_Object }; -typedef boost::shared_ptr ObjectPtr; +typedef std::shared_ptr ObjectPtr; #endif diff --git a/src/ModelAPI/ModelAPI_Plugin.h b/src/ModelAPI/ModelAPI_Plugin.h index 5222b4c7b..0e910ae1f 100644 --- a/src/ModelAPI/ModelAPI_Plugin.h +++ b/src/ModelAPI/ModelAPI_Plugin.h @@ -7,7 +7,7 @@ #include "ModelAPI.h" #include -#include +#include class ModelAPI_Feature; @@ -20,7 +20,7 @@ class MODELAPI_EXPORT ModelAPI_Plugin { public: /// Creates the feature object of this plugin by the feature string ID - virtual boost::shared_ptr createFeature(std::string theFeatureID) = 0; + virtual std::shared_ptr createFeature(std::string theFeatureID) = 0; /// To virtually destroy the fields of successors virtual ~ModelAPI_Plugin() diff --git a/src/ModelAPI/ModelAPI_Result.h b/src/ModelAPI/ModelAPI_Result.h index eb664ec22..fe674e308 100644 --- a/src/ModelAPI/ModelAPI_Result.h +++ b/src/ModelAPI/ModelAPI_Result.h @@ -33,6 +33,6 @@ class ModelAPI_Result : public ModelAPI_Object }; //! Pointer on feature object -typedef boost::shared_ptr ResultPtr; +typedef std::shared_ptr ResultPtr; #endif diff --git a/src/ModelAPI/ModelAPI_ResultBody.h b/src/ModelAPI/ModelAPI_ResultBody.h index cce169833..2a213f25b 100644 --- a/src/ModelAPI/ModelAPI_ResultBody.h +++ b/src/ModelAPI/ModelAPI_ResultBody.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include /**\class ModelAPI_ResultBody @@ -37,73 +37,73 @@ public: } /// Stores the shape (called by the execution method). - virtual void store(const boost::shared_ptr& theShape) = 0; + virtual void store(const std::shared_ptr& theShape) = 0; /// Stores the generated shape (called by the execution method). - virtual void storeGenerated(const boost::shared_ptr& theFromShape, - const boost::shared_ptr& theToShape) = 0; + virtual void storeGenerated(const std::shared_ptr& theFromShape, + const std::shared_ptr& theToShape) = 0; /// Stores the modified shape (called by the execution method). - virtual void storeModified(const boost::shared_ptr& theOldShape, - const boost::shared_ptr& theNewShape) = 0; + virtual void storeModified(const std::shared_ptr& theOldShape, + const std::shared_ptr& theNewShape) = 0; /// Returns the shape-result produced by this feature - virtual boost::shared_ptr shape() = 0; + virtual std::shared_ptr shape() = 0; /// Records the subshape newShape which was generated during a topological construction. /// As an example, consider the case of a face generated in construction of a box. virtual void generated( - const boost::shared_ptr& theNewShape, const int theTag = 1) = 0; + const std::shared_ptr& theNewShape, const int theTag = 1) = 0; /// Records the shape newShape which was generated from the shape oldShape during a topological /// construction. As an example, consider the case of a face generated from an edge in /// construction of a prism. - virtual void generated(const boost::shared_ptr& theOldShape, - const boost::shared_ptr& theNewShape, const int theTag = 1) = 0; + virtual void generated(const std::shared_ptr& theOldShape, + const std::shared_ptr& theNewShape, const int theTag = 1) = 0; /// Records the shape newShape which is a modification of the shape oldShape. /// As an example, consider the case of a face split or merged in a Boolean operation. - virtual void modified(const boost::shared_ptr& theOldShape, - const boost::shared_ptr& theNewShape, const int theTag = 1) = 0; + virtual void modified(const std::shared_ptr& theOldShape, + const std::shared_ptr& theNewShape, const int theTag = 1) = 0; /// Records the shape oldShape which was deleted from the current label. /// As an example, consider the case of a face removed by a Boolean operation. virtual void deleted( - const boost::shared_ptr& theOldShape, const int theTag = 1) = 0; + const std::shared_ptr& theOldShape, const int theTag = 1) = 0; /// load deleted shapes virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, - boost::shared_ptr theShapeIn, + std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag) = 0; /// load and orient modified shapes virtual void loadAndOrientModifiedShapes ( GeomAlgoAPI_MakeShape* theMS, - boost::shared_ptr theShapeIn, + std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag, GeomAPI_DataMapOfShapeShape& theSubShapes) = 0; /// load and orient generated shapes virtual void loadAndOrientGeneratedShapes ( GeomAlgoAPI_MakeShape* theMS, - boost::shared_ptr theShapeIn, + std::shared_ptr theShapeIn, const int theKindOfShape, const int theTag, GeomAPI_DataMapOfShapeShape& theSubShapes) = 0; /// load shapes of the first level (to be used during shape import) - virtual void loadFirstLevel(boost::shared_ptr theShape, int& theTag) = 0; + virtual void loadFirstLevel(std::shared_ptr theShape, int& theTag) = 0; /// load disconnected edges - virtual void loadDisconnectedEdges(boost::shared_ptr theShape, int& theTag) = 0; + virtual void loadDisconnectedEdges(std::shared_ptr theShape, int& theTag) = 0; /// load disconnected vetexes - virtual void loadDisconnectedVertexes(boost::shared_ptr theShape, int& theTag) = 0; + virtual void loadDisconnectedVertexes(std::shared_ptr theShape, int& theTag) = 0; protected: }; //! Pointer on feature object -typedef boost::shared_ptr ResultBodyPtr; +typedef std::shared_ptr ResultBodyPtr; #endif diff --git a/src/ModelAPI/ModelAPI_ResultConstruction.h b/src/ModelAPI/ModelAPI_ResultConstruction.h index 972b3a965..4ff1a0189 100644 --- a/src/ModelAPI/ModelAPI_ResultConstruction.h +++ b/src/ModelAPI/ModelAPI_ResultConstruction.h @@ -34,16 +34,16 @@ class ModelAPI_ResultConstruction : public ModelAPI_Result } /// Returns the shape-result produced by this feature - virtual boost::shared_ptr& shape() = 0; + virtual std::shared_ptr& shape() = 0; /// Sets the result - virtual void setShape(boost::shared_ptr theShape) = 0; + virtual void setShape(std::shared_ptr theShape) = 0; /// Sets the flag that it must be displayed in history (default is true) virtual void setIsInHistory(const bool isInHistory) = 0; }; //! Pointer on feature object -typedef boost::shared_ptr ResultConstructionPtr; +typedef std::shared_ptr ResultConstructionPtr; #endif diff --git a/src/ModelAPI/ModelAPI_ResultGroup.h b/src/ModelAPI/ModelAPI_ResultGroup.h index a8b183c12..465218d3b 100644 --- a/src/ModelAPI/ModelAPI_ResultGroup.h +++ b/src/ModelAPI/ModelAPI_ResultGroup.h @@ -7,7 +7,7 @@ #include "ModelAPI_Result.h" #include -#include +#include #include /**\class ModelAPI_ResultGroup @@ -33,10 +33,10 @@ public: } /// Returns the compound of selected entities - virtual boost::shared_ptr shape() const = 0; + virtual std::shared_ptr shape() const = 0; }; //! Pointer on feature object -typedef boost::shared_ptr ResultGroupPtr; +typedef std::shared_ptr ResultGroupPtr; #endif diff --git a/src/ModelAPI/ModelAPI_ResultParameters.h b/src/ModelAPI/ModelAPI_ResultParameters.h index 5c67cbcc0..2023a7da2 100644 --- a/src/ModelAPI/ModelAPI_ResultParameters.h +++ b/src/ModelAPI/ModelAPI_ResultParameters.h @@ -32,6 +32,6 @@ class ModelAPI_ResultParameters : public ModelAPI_Result }; //! Pointer on feature object -typedef boost::shared_ptr ResultParametersPtr; +typedef std::shared_ptr ResultParametersPtr; #endif diff --git a/src/ModelAPI/ModelAPI_ResultPart.h b/src/ModelAPI/ModelAPI_ResultPart.h index bd7a7deea..f0db94ee3 100644 --- a/src/ModelAPI/ModelAPI_ResultPart.h +++ b/src/ModelAPI/ModelAPI_ResultPart.h @@ -40,13 +40,13 @@ class ModelAPI_ResultPart : public ModelAPI_Result } /// Returns the part-document of this result - virtual boost::shared_ptr partDoc() = 0; + virtual std::shared_ptr partDoc() = 0; /// Sets this document as current and if it is not loaded yet, loads it virtual void activate() = 0; }; //! Pointer on feature object -typedef boost::shared_ptr ResultPartPtr; +typedef std::shared_ptr ResultPartPtr; #endif diff --git a/src/ModelAPI/ModelAPI_Session.cpp b/src/ModelAPI/ModelAPI_Session.cpp index db8a54ca2..c7b784d3a 100644 --- a/src/ModelAPI/ModelAPI_Session.cpp +++ b/src/ModelAPI/ModelAPI_Session.cpp @@ -42,18 +42,18 @@ using namespace std; #endif /// Manager that will be initialized from Model package, one per application -boost::shared_ptr MY_MANAGER; +std::shared_ptr MY_MANAGER; ModelAPI_Session::ModelAPI_Session() { } -void ModelAPI_Session::setSession(boost::shared_ptr theManager) +void ModelAPI_Session::setSession(std::shared_ptr theManager) { MY_MANAGER = theManager; } -boost::shared_ptr ModelAPI_Session::get() +std::shared_ptr ModelAPI_Session::get() { if (!MY_MANAGER) { // import Model library that implements this interface of ModelAPI Config_ModuleReader::loadLibrary("Model"); diff --git a/src/ModelAPI/ModelAPI_Session.h b/src/ModelAPI/ModelAPI_Session.h index 95199bbab..811174e7c 100644 --- a/src/ModelAPI/ModelAPI_Session.h +++ b/src/ModelAPI/ModelAPI_Session.h @@ -8,7 +8,7 @@ #include "ModelAPI.h" #include #include -#include +#include class ModelAPI_Feature; class ModelAPI_Plugin; @@ -26,7 +26,7 @@ class MODELAPI_EXPORT ModelAPI_Session { public: /// Returns the real implementation (the alone instance per application) of the plugin manager - static boost::shared_ptr get(); + static std::shared_ptr get(); //! Loads the OCAF document from the file. //! \param theFileName full name of the file to load @@ -69,23 +69,23 @@ class MODELAPI_EXPORT ModelAPI_Session virtual void registerPlugin(ModelAPI_Plugin* thePlugin) = 0; /// Returns the root document of the application (that may contains sub-documents) - virtual boost::shared_ptr moduleDocument() = 0; + virtual std::shared_ptr moduleDocument() = 0; /// Return true if root document has been already created virtual bool hasModuleDocument() = 0; /// Returns the current document that used for current work in the application - virtual boost::shared_ptr activeDocument() = 0; + virtual std::shared_ptr activeDocument() = 0; /// Defines the current document that used for current work in the application virtual void setActiveDocument( - boost::shared_ptr theDoc, bool theSendSignal = true) = 0; + std::shared_ptr theDoc, bool theSendSignal = true) = 0; /// Returns all the opened documents of the session (without postponed) - virtual std::list > allOpenedDocuments() = 0; + virtual std::list > allOpenedDocuments() = 0; /// Copies the document to the new one with the given id - virtual boost::shared_ptr copy(boost::shared_ptr theSource, + virtual std::shared_ptr copy(std::shared_ptr theSource, std::string theID) = 0; /// Returns the validators factory: the only one instance per application @@ -101,13 +101,13 @@ class MODELAPI_EXPORT ModelAPI_Session protected: /// Creates the feature object using plugins functionality - virtual boost::shared_ptr createFeature(std::string theFeatureID) = 0; + virtual std::shared_ptr createFeature(std::string theFeatureID) = 0; - static void setSession(boost::shared_ptr theManager); + static void setSession(std::shared_ptr theManager); friend class Model_Document; }; -typedef boost::shared_ptr SessionPtr; +typedef std::shared_ptr SessionPtr; #endif diff --git a/src/ModelAPI/ModelAPI_Tools.cpp b/src/ModelAPI/ModelAPI_Tools.cpp index 8656f2fd7..bc086953b 100644 --- a/src/ModelAPI/ModelAPI_Tools.cpp +++ b/src/ModelAPI/ModelAPI_Tools.cpp @@ -9,21 +9,21 @@ namespace ModelAPI_Tools { - boost::shared_ptr shape(const ResultPtr& theResult) + std::shared_ptr shape(const ResultPtr& theResult) { - ResultBodyPtr aBody = boost::dynamic_pointer_cast(theResult); + ResultBodyPtr aBody = std::dynamic_pointer_cast(theResult); if (aBody) return aBody->shape(); - ResultConstructionPtr aConstruct = boost::dynamic_pointer_cast( + ResultConstructionPtr aConstruct = std::dynamic_pointer_cast( theResult); if (aConstruct) return aConstruct->shape(); - ResultGroupPtr aGroup = boost::dynamic_pointer_cast(theResult); + ResultGroupPtr aGroup = std::dynamic_pointer_cast(theResult); if (aGroup) return aGroup->shape(); - return boost::shared_ptr(); + return std::shared_ptr(); } } diff --git a/src/ModelAPI/ModelAPI_Tools.h b/src/ModelAPI/ModelAPI_Tools.h index bec1b9da1..5fce98955 100644 --- a/src/ModelAPI/ModelAPI_Tools.h +++ b/src/ModelAPI/ModelAPI_Tools.h @@ -11,7 +11,7 @@ namespace ModelAPI_Tools { /// Returns shape from the given Result object -MODELAPI_EXPORT boost::shared_ptr shape(const ResultPtr& theResult); +MODELAPI_EXPORT std::shared_ptr shape(const ResultPtr& theResult); } ; diff --git a/src/ModelAPI/ModelAPI_Validator.h b/src/ModelAPI/ModelAPI_Validator.h index cd73508d5..a4eb79416 100644 --- a/src/ModelAPI/ModelAPI_Validator.h +++ b/src/ModelAPI/ModelAPI_Validator.h @@ -6,7 +6,7 @@ #define ModelAPI_Validator_H_ #include -#include +#include #include class ModelAPI_Feature; @@ -31,7 +31,7 @@ class MODELAPI_EXPORT ModelAPI_Validator } }; -typedef boost::shared_ptr ValidatorPtr; +typedef std::shared_ptr ValidatorPtr; /**\class ModelAPI_ValidatorsFactory * \ingroup DataModel @@ -77,7 +77,7 @@ class MODELAPI_EXPORT ModelAPI_ValidatorsFactory virtual const ModelAPI_Validator* validator(const std::string& theID) const = 0; /// Returns true if feature and all its attributes are valid. - virtual bool validate(const boost::shared_ptr& theFeature) const = 0; + virtual bool validate(const std::shared_ptr& theFeature) const = 0; /// register that this attribute in feature is not obligatory for the feature execution /// so, it is not needed for the standard validation mechanism diff --git a/src/ModuleBase/ModuleBase_IModule.cpp b/src/ModuleBase/ModuleBase_IModule.cpp index 36e09437e..daece8b0d 100644 --- a/src/ModuleBase/ModuleBase_IModule.cpp +++ b/src/ModuleBase/ModuleBase_IModule.cpp @@ -42,8 +42,8 @@ void ModuleBase_IModule::launchOperation(const QString& theCmdId) void ModuleBase_IModule::sendOperation(ModuleBase_Operation* theOperation) { static Events_ID aModuleEvent = Events_Loop::eventByName(EVENT_OPERATION_LAUNCHED); - boost::shared_ptr aMessage = - boost::shared_ptr(new Config_PointerMessage(aModuleEvent, this)); + std::shared_ptr aMessage = + std::shared_ptr(new Config_PointerMessage(aModuleEvent, this)); aMessage->setPointer(theOperation); Events_Loop::loop()->send(aMessage); } diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index 25c0bf246..7e77804ac 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -11,7 +11,7 @@ #include -#include +#include class Config_WidgetAPI; class ModuleBase_WidgetValue; diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index e906b9323..c7525d742 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -132,7 +132,7 @@ FeaturePtr ModuleBase_Operation::createFeature( if (theCompositeFeature) { myFeature = theCompositeFeature->addFeature(getDescription()->operationId().toStdString()); } else { - boost::shared_ptr aDoc = document(); + std::shared_ptr aDoc = document(); myFeature = aDoc->addFeature(getDescription()->operationId().toStdString()); } if (myFeature) { // TODO: generate an error if feature was not created @@ -175,7 +175,7 @@ bool ModuleBase_Operation::hasObject(ObjectPtr theObj) const } -boost::shared_ptr ModuleBase_Operation::document() const +std::shared_ptr ModuleBase_Operation::document() const { return ModelAPI_Session::get()->moduleDocument(); } @@ -330,7 +330,7 @@ void ModuleBase_Operation::initSelection(ModuleBase_ISelection* theSelection, double aX, anY; if (getViewerPoint(aPrs, theViewer, aX, anY)) - aValue->setPoint(boost::shared_ptr(new GeomAPI_Pnt2d(aX, anY))); + aValue->setPoint(std::shared_ptr(new GeomAPI_Pnt2d(aX, anY))); myPreSelection.append(aValue); } } @@ -351,7 +351,7 @@ bool ModuleBase_Operation::setWidgetValue(ObjectPtr theFeature, double theX, dou return false; ModuleBase_WidgetValueFeature* aValue = new ModuleBase_WidgetValueFeature(); aValue->setObject(theFeature); - aValue->setPoint(boost::shared_ptr(new GeomAPI_Pnt2d(theX, theY))); + aValue->setPoint(std::shared_ptr(new GeomAPI_Pnt2d(theX, theY))); bool isApplyed = aActiveWgt->setValue(aValue); delete aValue; diff --git a/src/ModuleBase/ModuleBase_Operation.h b/src/ModuleBase/ModuleBase_Operation.h index cf92faa43..f1b0ae218 100644 --- a/src/ModuleBase/ModuleBase_Operation.h +++ b/src/ModuleBase/ModuleBase_Operation.h @@ -209,7 +209,7 @@ signals: virtual bool canBeCommitted() const; /// Returns pointer to the root document. - boost::shared_ptr document() const; + std::shared_ptr document() const; /// Set value to the active widget /// \param theFeature the feature diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 6de0bba8f..73f066fc3 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -19,9 +19,9 @@ IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_ResultPrs, AIS_Shape); ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult) : AIS_Shape(TopoDS_Shape()), myResult(theResult), myIsSketchMode(false) { - boost::shared_ptr aShapePtr = ModelAPI_Tools::shape(theResult); - boost::shared_ptr aWirePtr = - boost::dynamic_pointer_cast(aShapePtr); + std::shared_ptr aShapePtr = ModelAPI_Tools::shape(theResult); + std::shared_ptr aWirePtr = + std::dynamic_pointer_cast(aShapePtr); if (aWirePtr) { if (aWirePtr->hasPlane() ) { // If this is a wire with plane defined thin it is a sketch-like object @@ -45,7 +45,7 @@ void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { - boost::shared_ptr aShapePtr = ModelAPI_Tools::shape(myResult); + std::shared_ptr aShapePtr = ModelAPI_Tools::shape(myResult); if (!aShapePtr) return; myOriginalShape = aShapePtr->impl(); @@ -63,7 +63,7 @@ void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& a TopoDS_Compound aComp; aBuilder.MakeCompound(aComp); aBuilder.Add(aComp, myOriginalShape); - std::list>::const_iterator aIt; + std::list>::const_iterator aIt; for (aIt = myFacesList.cbegin(); aIt != myFacesList.cend(); ++aIt) { TopoDS_Shape aFace = (*aIt)->impl(); aBuilder.Add(aComp, aFace); diff --git a/src/ModuleBase/ModuleBase_ResultPrs.h b/src/ModuleBase/ModuleBase_ResultPrs.h index 0d2d058ce..62b82389c 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.h +++ b/src/ModuleBase/ModuleBase_ResultPrs.h @@ -35,7 +35,7 @@ private: bool myIsSketchMode; TopoDS_Shape myOriginalShape; - std::list > myFacesList; + std::list > myFacesList; }; diff --git a/src/ModuleBase/ModuleBase_ViewerFilters.cpp b/src/ModuleBase/ModuleBase_ViewerFilters.cpp index 1d17c6859..a7e2cd3f7 100644 --- a/src/ModuleBase/ModuleBase_ViewerFilters.cpp +++ b/src/ModuleBase/ModuleBase_ViewerFilters.cpp @@ -31,7 +31,7 @@ Standard_Boolean ModuleBase_ShapeDocumentFilter::IsOk(const Handle(SelectMgr_Ent Handle(AIS_InteractiveObject) aAisObj = Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); if (!aAisObj.IsNull()) { - boost::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); + std::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aAisObj)); ObjectPtr aObj = myWorkshop->findPresentedObject(aAISObj); if (aObj) { @@ -96,14 +96,14 @@ Standard_Boolean ModuleBase_ObjectTypesFilter::IsOk(const Handle(SelectMgr_Entit Handle(AIS_InteractiveObject) aAisObj = Handle(AIS_InteractiveObject)::DownCast(theOwner->Selectable()); if (!aAisObj.IsNull()) { - boost::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); + std::shared_ptr aAISObj = AISObjectPtr(new GeomAPI_AISObject()); aAISObj->setImpl(new Handle(AIS_InteractiveObject)(aAisObj)); ObjectPtr aObj = myWorkshop->findPresentedObject(aAISObj); foreach (QString aType, myTypes) { if (aType.toLower() == "construction") { ResultConstructionPtr aConstr = - boost::dynamic_pointer_cast(aObj); + std::dynamic_pointer_cast(aObj); return (aConstr != NULL); } // ToDo: Process other types of objects } diff --git a/src/ModuleBase/ModuleBase_ViewerPrs.h b/src/ModuleBase/ModuleBase_ViewerPrs.h index 83c9e3193..b9bcb2b9d 100644 --- a/src/ModuleBase/ModuleBase_ViewerPrs.h +++ b/src/ModuleBase/ModuleBase_ViewerPrs.h @@ -7,7 +7,7 @@ #include "ModuleBase.h" -#include +#include #include #include #include diff --git a/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp b/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp index cc0197d57..4e0ceee4c 100644 --- a/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetBoolValue.cpp @@ -45,7 +45,7 @@ QWidget* ModuleBase_WidgetBoolValue::getControl() const bool ModuleBase_WidgetBoolValue::storeValue() const { DataPtr aData = myFeature->data(); - boost::shared_ptr aBool = aData->boolean(attributeID()); + std::shared_ptr aBool = aData->boolean(attributeID()); aBool->setValue(myCheckBox->isChecked()); updateObject(myFeature); return true; @@ -54,7 +54,7 @@ bool ModuleBase_WidgetBoolValue::storeValue() const bool ModuleBase_WidgetBoolValue::restoreValue() { DataPtr aData = myFeature->data(); - boost::shared_ptr aRef = aData->boolean(attributeID()); + std::shared_ptr aRef = aData->boolean(attributeID()); bool isBlocked = myCheckBox->blockSignals(true); myCheckBox->setChecked(aRef->value()); diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.cpp b/src/ModuleBase/ModuleBase_WidgetChoice.cpp index 65c6c1890..b2d017db6 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.cpp +++ b/src/ModuleBase/ModuleBase_WidgetChoice.cpp @@ -47,7 +47,7 @@ ModuleBase_WidgetChoice::~ModuleBase_WidgetChoice() bool ModuleBase_WidgetChoice::storeValue() const { DataPtr aData = myFeature->data(); - boost::shared_ptr aIntAttr = aData->integer(attributeID()); + std::shared_ptr aIntAttr = aData->integer(attributeID()); aIntAttr->setValue(myCombo->currentIndex()); updateObject(myFeature); @@ -57,7 +57,7 @@ bool ModuleBase_WidgetChoice::storeValue() const bool ModuleBase_WidgetChoice::restoreValue() { DataPtr aData = myFeature->data(); - boost::shared_ptr aIntAttr = aData->integer(attributeID()); + std::shared_ptr aIntAttr = aData->integer(attributeID()); bool isBlocked = myCombo->blockSignals(true); myCombo->setCurrentIndex(aIntAttr->value()); diff --git a/src/ModuleBase/ModuleBase_WidgetFeature.cpp b/src/ModuleBase/ModuleBase_WidgetFeature.cpp index 0b84e8444..3b28aeb6a 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeature.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFeature.cpp @@ -117,12 +117,12 @@ bool ModuleBase_WidgetFeature::setObject(const ObjectPtr& theObject, bool theSen bool ModuleBase_WidgetFeature::storeValue() const { - //FeaturePtr aFeature = boost::dynamic_pointer_cast(theObject); + //FeaturePtr aFeature = std::dynamic_pointer_cast(theObject); if (!myObject) return false; - boost::shared_ptr aData = myFeature->data(); - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aData = myFeature->data(); + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(attributeID())); ModuleBase_WidgetFeature* that = (ModuleBase_WidgetFeature*) this; @@ -134,8 +134,8 @@ bool ModuleBase_WidgetFeature::storeValue() const bool ModuleBase_WidgetFeature::restoreValue() { - boost::shared_ptr aData = myFeature->data(); - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aData = myFeature->data(); + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(attributeID())); ObjectPtr anObjPtr = aRef->object(); diff --git a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp index cea8d1ec4..9c052588d 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.cpp @@ -54,7 +54,7 @@ bool ModuleBase_WidgetFeatureOrAttribute::setValue(ModuleBase_WidgetValue* theVa if (aFeatureValue) { ObjectPtr aObject = aFeatureValue->object(); - boost::shared_ptr anAttribute = findAttribute(aFeatureValue); + std::shared_ptr anAttribute = findAttribute(aFeatureValue); if (anAttribute) { isDone = setAttribute(anAttribute, false); } @@ -71,12 +71,12 @@ bool ModuleBase_WidgetFeatureOrAttribute::setValue(ModuleBase_WidgetValue* theVa bool ModuleBase_WidgetFeatureOrAttribute::storeValue() const { - //FeaturePtr aFeature = boost::dynamic_pointer_cast(theFeature); + //FeaturePtr aFeature = std::dynamic_pointer_cast(theFeature); //if (!aFeature) // return false; - boost::shared_ptr aData = myFeature->data(); - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aData = myFeature->data(); + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(attributeID())); if (myObject) @@ -92,8 +92,8 @@ bool ModuleBase_WidgetFeatureOrAttribute::storeValue() const bool ModuleBase_WidgetFeatureOrAttribute::restoreValue() { - boost::shared_ptr aData = myFeature->data(); - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aData = myFeature->data(); + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(attributeID())); ObjectPtr aObj = aRef->object(); @@ -114,27 +114,27 @@ bool ModuleBase_WidgetFeatureOrAttribute::restoreValue() return false; } -boost::shared_ptr ModuleBase_WidgetFeatureOrAttribute::findAttribute( +std::shared_ptr ModuleBase_WidgetFeatureOrAttribute::findAttribute( ModuleBase_WidgetValue* theValue) { - boost::shared_ptr anAttribute; + std::shared_ptr anAttribute; ModuleBase_WidgetValueFeature* aFeatureValue = dynamic_cast(theValue); if (!aFeatureValue) return anAttribute; - boost::shared_ptr aValuePoint = aFeatureValue->point(); + std::shared_ptr aValuePoint = aFeatureValue->point(); if (aValuePoint) { ObjectPtr aObject = aFeatureValue->object(); FeaturePtr aFeature = ModelAPI_Feature::feature(aObject); if (aFeature) { // find the given point in the feature attributes - std::list > anAttiributes = aFeature->data() + std::list > anAttiributes = aFeature->data() ->attributes(GeomDataAPI_Point2D::type()); - std::list >::const_iterator anIt = anAttiributes + std::list >::const_iterator anIt = anAttiributes .begin(), aLast = anAttiributes.end(); for (; anIt != aLast && !anAttribute; anIt++) { - boost::shared_ptr aCurPoint = boost::dynamic_pointer_cast< + std::shared_ptr aCurPoint = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(*anIt); if (aCurPoint && aCurPoint->pnt()->distance(aValuePoint) < Precision::Confusion()) anAttribute = aCurPoint; @@ -145,7 +145,7 @@ boost::shared_ptr ModuleBase_WidgetFeatureOrAttribute::findA } bool ModuleBase_WidgetFeatureOrAttribute::setAttribute( - const boost::shared_ptr& theAttribute, bool theSendEvent) + const std::shared_ptr& theAttribute, bool theSendEvent) { if (!theAttribute) // || !featureKinds().contains(theAttribute->attributeType().c_str())) return false; diff --git a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.h b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.h index 1dfd055ce..5fac25197 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.h +++ b/src/ModuleBase/ModuleBase_WidgetFeatureOrAttribute.h @@ -47,16 +47,16 @@ Q_OBJECT /// Returns the feature attribute if it can be found by the given value /// \param theValue the widget value /// \return an attribute or null - boost::shared_ptr findAttribute(ModuleBase_WidgetValue* theValue); + std::shared_ptr findAttribute(ModuleBase_WidgetValue* theValue); /// Set the attribute /// \param theAttribute value /// \return the boolean result of the attribute set - bool setAttribute(const boost::shared_ptr& theAttribute, bool theSendEvent = + bool setAttribute(const std::shared_ptr& theAttribute, bool theSendEvent = true); protected: - boost::shared_ptr myAttribute; /// < the attribute + std::shared_ptr myAttribute; /// < the attribute }; #endif diff --git a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp index 259560e38..2fb71922a 100644 --- a/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFileSelector.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include ModuleBase_WidgetFileSelector::ModuleBase_WidgetFileSelector(QWidget* theParent, diff --git a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp index bf311c59f..19771a66f 100644 --- a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp +++ b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include ModuleBase_WidgetLineEdit::ModuleBase_WidgetLineEdit(QWidget* theParent, diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 87c62ba39..ea21968a1 100644 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParent, @@ -78,7 +78,7 @@ bool ModuleBase_WidgetMultiSelector::storeValue() const return false; DataPtr aData = myFeature->data(); AttributeSelectionListPtr aSelectionListAttr = - boost::dynamic_pointer_cast(aData->attribute(attributeID())); + std::dynamic_pointer_cast(aData->attribute(attributeID())); if (aSelectionListAttr) { aSelectionListAttr->clear(); @@ -104,7 +104,7 @@ bool ModuleBase_WidgetMultiSelector::restoreValue() return false; DataPtr aData = myFeature->data(); AttributeSelectionListPtr aSelectionListAttr = - boost::dynamic_pointer_cast(aData->attribute(attributeID())); + std::dynamic_pointer_cast(aData->attribute(attributeID())); if (aSelectionListAttr) { mySelection.clear(); @@ -182,7 +182,7 @@ void ModuleBase_WidgetMultiSelector::onSelectionChanged() NCollection_List::Iterator aShpIt(aSelectedShapes); GeomShapePtr aShape; for (aIt = aOwnersList.cbegin(); aIt != aOwnersList.cend(); aShpIt.Next(), aIt++) { - ResultPtr aResult = boost::dynamic_pointer_cast(*aIt); + ResultPtr aResult = std::dynamic_pointer_cast(*aIt); if (myFeature) { // We can not select a result of our feature const std::list& aResList = myFeature->results(); @@ -197,7 +197,7 @@ void ModuleBase_WidgetMultiSelector::onSelectionChanged() if(isSkipSelf) continue; } - aShape = boost::shared_ptr(new GeomAPI_Shape()); + aShape = std::shared_ptr(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(aShpIt.Value())); mySelection.append(GeomSelection(aResult, aShape)); } diff --git a/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp b/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp index 21cef047d..130870221 100644 --- a/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp +++ b/src/ModuleBase/ModuleBase_WidgetPoint2D.cpp @@ -81,7 +81,7 @@ bool ModuleBase_WidgetPoint2D::setValue(ModuleBase_WidgetValue* theValue) ModuleBase_WidgetValueFeature* aFeatureValue = dynamic_cast(theValue); if (aFeatureValue) { - boost::shared_ptr aPoint = aFeatureValue->point(); + std::shared_ptr aPoint = aFeatureValue->point(); if (aPoint) { setPoint(aPoint); isDone = true; @@ -91,7 +91,7 @@ bool ModuleBase_WidgetPoint2D::setValue(ModuleBase_WidgetValue* theValue) return isDone; } -void ModuleBase_WidgetPoint2D::setPoint(const boost::shared_ptr& thePoint) +void ModuleBase_WidgetPoint2D::setPoint(const std::shared_ptr& thePoint) { bool isBlocked = this->blockSignals(true); @@ -104,8 +104,8 @@ void ModuleBase_WidgetPoint2D::setPoint(const boost::shared_ptr& bool ModuleBase_WidgetPoint2D::storeValue() const { - boost::shared_ptr aData = myFeature->data(); - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aData = myFeature->data(); + std::shared_ptr aPoint = std::dynamic_pointer_cast( aData->attribute(attributeID())); ModuleBase_WidgetPoint2D* that = (ModuleBase_WidgetPoint2D*) this; @@ -126,8 +126,8 @@ bool ModuleBase_WidgetPoint2D::storeValue() const bool ModuleBase_WidgetPoint2D::restoreValue() { - boost::shared_ptr aData = myFeature->data(); - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aData = myFeature->data(); + std::shared_ptr aPoint = std::dynamic_pointer_cast( aData->attribute(attributeID())); #ifdef _DEBUG @@ -160,8 +160,8 @@ bool ModuleBase_WidgetPoint2D::initFromPrevious(ObjectPtr theObject) { if (myOptionParam.length() == 0) return false; - boost::shared_ptr aData = theObject->data(); - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aData = theObject->data(); + std::shared_ptr aPoint = std::dynamic_pointer_cast( aData->attribute(myOptionParam)); if (aPoint) { bool isBlocked = this->blockSignals(true); diff --git a/src/ModuleBase/ModuleBase_WidgetPoint2D.h b/src/ModuleBase/ModuleBase_WidgetPoint2D.h index 29d65a7b2..394211980 100644 --- a/src/ModuleBase/ModuleBase_WidgetPoint2D.h +++ b/src/ModuleBase/ModuleBase_WidgetPoint2D.h @@ -64,7 +64,7 @@ signals: protected: /// Fill the widget values by given point /// \param thePoint the point - void setPoint(const boost::shared_ptr& thePoint); + void setPoint(const std::shared_ptr& thePoint); private: QGroupBox* myGroupBox; ///< the parent group box for all intenal widgets diff --git a/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp b/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp index 56496ebd1..210f4bcba 100644 --- a/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp +++ b/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.cpp @@ -33,9 +33,9 @@ bool ModuleBase_WidgetPoint2dDistance::setValue(ModuleBase_WidgetValue* theValue ModuleBase_WidgetValueFeature* aFeatureValue = dynamic_cast(theValue); if (aFeatureValue) { - boost::shared_ptr aPnt = aFeatureValue->point(); + std::shared_ptr aPnt = aFeatureValue->point(); ObjectPtr aObject = aFeatureValue->object(); - FeaturePtr aFeature = boost::dynamic_pointer_cast(aObject); + FeaturePtr aFeature = std::dynamic_pointer_cast(aObject); if (aFeature && aPnt) { setPoint(aFeature, aPnt); isDone = true; @@ -46,10 +46,10 @@ bool ModuleBase_WidgetPoint2dDistance::setValue(ModuleBase_WidgetValue* theValue } void ModuleBase_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature, - const boost::shared_ptr& thePnt) + const std::shared_ptr& thePnt) { - boost::shared_ptr aData = theFeature->data(); - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aData = theFeature->data(); + std::shared_ptr aPoint = std::dynamic_pointer_cast( aData->attribute(myFirstPntName)); if (!aPoint) return; diff --git a/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.h b/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.h index 164e78bac..e80aa393b 100644 --- a/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.h +++ b/src/ModuleBase/ModuleBase_WidgetPoint2dDistance.h @@ -30,7 +30,7 @@ Q_OBJECT protected: /// Set the second point which defines a value in the widget as a distance with a first point defined by feature - void setPoint(FeaturePtr theFeature, const boost::shared_ptr& thePnt); + void setPoint(FeaturePtr theFeature, const std::shared_ptr& thePnt); private: std::string myFirstPntName; diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index 76c2da206..91cc255e8 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include @@ -127,18 +127,18 @@ bool ModuleBase_WidgetShapeSelector::storeValue() const DataPtr aData = myFeature->data(); if (myUseSubShapes) { - boost::shared_ptr aSelect = - boost::dynamic_pointer_cast(aData->attribute(attributeID())); + std::shared_ptr aSelect = + std::dynamic_pointer_cast(aData->attribute(attributeID())); - ResultPtr aBody = boost::dynamic_pointer_cast(mySelectedObject); + ResultPtr aBody = std::dynamic_pointer_cast(mySelectedObject); if (aBody) { aSelect->setValue(aBody, myShape); updateObject(myFeature); return true; } } else { - boost::shared_ptr aRef = - boost::dynamic_pointer_cast(aData->attribute(attributeID())); + std::shared_ptr aRef = + std::dynamic_pointer_cast(aData->attribute(attributeID())); ObjectPtr aObject = aRef->value(); if (!(aObject && aObject->isSame(mySelectedObject))) { @@ -156,13 +156,13 @@ bool ModuleBase_WidgetShapeSelector::restoreValue() DataPtr aData = myFeature->data(); bool isBlocked = this->blockSignals(true); if (myUseSubShapes) { - boost::shared_ptr aSelect = aData->selection(attributeID()); + std::shared_ptr aSelect = aData->selection(attributeID()); if (aSelect) { mySelectedObject = aSelect->context(); myShape = aSelect->value(); } } else { - boost::shared_ptr aRef = aData->reference(attributeID()); + std::shared_ptr aRef = aData->reference(attributeID()); mySelectedObject = aRef->value(); } updateSelectionName(); @@ -189,14 +189,14 @@ void ModuleBase_WidgetShapeSelector::onSelectionChanged() return; // Check that the selected object is result (others can not be accepted) - ResultPtr aRes = boost::dynamic_pointer_cast(aObject); + ResultPtr aRes = std::dynamic_pointer_cast(aObject); if (!aRes) return; if (myFeature) { // We can not select a result of our feature - const std::list>& aResList = myFeature->results(); - std::list >::const_iterator aIt; + const std::list>& aResList = myFeature->results(); + std::list >::const_iterator aIt; for (aIt = aResList.cbegin(); aIt != aResList.cend(); ++aIt) { if ((*aIt) == aRes) return; @@ -223,7 +223,7 @@ void ModuleBase_WidgetShapeSelector::onSelectionChanged() std::list aOwners; myWorkshop->selection()->selectedShapes(aShapeList, aOwners); if (aShapeList.Extent() > 0) { - aShape = boost::shared_ptr(new GeomAPI_Shape()); + aShape = std::shared_ptr(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(aShapeList.First())); } } @@ -243,7 +243,7 @@ void ModuleBase_WidgetShapeSelector::onSelectionChanged() } //******************************************************************** -void ModuleBase_WidgetShapeSelector::setObject(ObjectPtr theObj, boost::shared_ptr theShape) +void ModuleBase_WidgetShapeSelector::setObject(ObjectPtr theObj, std::shared_ptr theShape) { mySelectedObject = theObj; myShape = theShape; @@ -262,10 +262,10 @@ void ModuleBase_WidgetShapeSelector::setObject(ObjectPtr theObj, boost::shared_p //******************************************************************** bool ModuleBase_WidgetShapeSelector::acceptObjectShape(const ObjectPtr theResult) const { - ResultPtr aResult = boost::dynamic_pointer_cast(theResult); + ResultPtr aResult = std::dynamic_pointer_cast(theResult); // Check that the shape of necessary type - boost::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); + std::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); if (!aShapePtr) return false; TopoDS_Shape aShape = aShapePtr->impl(); @@ -289,7 +289,7 @@ bool ModuleBase_WidgetShapeSelector::acceptObjectShape(const ObjectPtr theResult } //******************************************************************** -bool ModuleBase_WidgetShapeSelector::acceptSubShape(boost::shared_ptr theShape) const +bool ModuleBase_WidgetShapeSelector::acceptSubShape(std::shared_ptr theShape) const { TopoDS_Shape aShape = theShape->impl(); foreach (QString aType, myShapeTypes) { @@ -310,7 +310,7 @@ bool ModuleBase_WidgetShapeSelector::acceptObjectType(const ObjectPtr theObject) foreach (QString aType, myObjectTypes) { if (aType.toLower() == "construction") { ResultConstructionPtr aConstr = - boost::dynamic_pointer_cast(theObject); + std::dynamic_pointer_cast(theObject); return (aConstr != NULL); } // ToDo: Process other types of objects } diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h index ad3d3b857..7284d8ae5 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h @@ -83,7 +83,7 @@ Q_OBJECT /// Returns true if selected shape corresponds to requested shape types /// This method is called only in sub-shapes selection mode - virtual bool acceptSubShape(boost::shared_ptr theShape) const; + virtual bool acceptSubShape(std::shared_ptr theShape) const; /// Returns true if selected object corresponds to requested Object type /// Thid method is used in any selection mode @@ -91,7 +91,7 @@ Q_OBJECT // Set the given object as a value of the widget - void setObject(ObjectPtr theObj, boost::shared_ptr theShape = boost::shared_ptr()); + void setObject(ObjectPtr theObj, std::shared_ptr theShape = std::shared_ptr()); //----------- Class members ------------- private: @@ -102,7 +102,7 @@ Q_OBJECT ModuleBase_IWorkshop* myWorkshop; ObjectPtr mySelectedObject; - boost::shared_ptr myShape; + std::shared_ptr myShape; QStringList myShapeTypes; QStringList myObjectTypes; diff --git a/src/ModuleBase/ModuleBase_WidgetValueFeature.cpp b/src/ModuleBase/ModuleBase_WidgetValueFeature.cpp index e6a4f818c..43d3a7cfe 100644 --- a/src/ModuleBase/ModuleBase_WidgetValueFeature.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValueFeature.cpp @@ -24,12 +24,12 @@ const ObjectPtr& ModuleBase_WidgetValueFeature::object() const return myResult; } -void ModuleBase_WidgetValueFeature::setPoint(const boost::shared_ptr& thePoint) +void ModuleBase_WidgetValueFeature::setPoint(const std::shared_ptr& thePoint) { myPoint = thePoint; } -const boost::shared_ptr& ModuleBase_WidgetValueFeature::point() const +const std::shared_ptr& ModuleBase_WidgetValueFeature::point() const { return myPoint; } diff --git a/src/ModuleBase/ModuleBase_WidgetValueFeature.h b/src/ModuleBase/ModuleBase_WidgetValueFeature.h index 53abb591b..d11a6bfd9 100644 --- a/src/ModuleBase/ModuleBase_WidgetValueFeature.h +++ b/src/ModuleBase/ModuleBase_WidgetValueFeature.h @@ -10,7 +10,7 @@ #include -#include +#include class GeomAPI_Pnt2d; @@ -36,15 +36,15 @@ class ModuleBase_WidgetValueFeature : public ModuleBase_WidgetValue /// Fill the widget values by given point /// \param thePoint the point - MODULEBASE_EXPORT void setPoint(const boost::shared_ptr& thePoint); + MODULEBASE_EXPORT void setPoint(const std::shared_ptr& thePoint); /// Returns the widget point /// \return the current point - MODULEBASE_EXPORT const boost::shared_ptr& point() const; + MODULEBASE_EXPORT const std::shared_ptr& point() const; private: ObjectPtr myResult; - boost::shared_ptr myPoint; + std::shared_ptr myPoint; }; #endif diff --git a/src/PartSet/PartSet_Listener.cpp b/src/PartSet/PartSet_Listener.cpp index 8d34fb041..d12987ede 100644 --- a/src/PartSet/PartSet_Listener.cpp +++ b/src/PartSet/PartSet_Listener.cpp @@ -39,7 +39,7 @@ PartSet_Listener::~PartSet_Listener() } //****************************************************** -void PartSet_Listener::processEvent(const boost::shared_ptr& theMessage) +void PartSet_Listener::processEvent(const std::shared_ptr& theMessage) { ModuleBase_Operation* anOperation = myModule->xWorkshop()->operationMgr()->currentOperation(); PartSet_OperationSketchBase* aSketchOp = dynamic_cast(anOperation); @@ -49,8 +49,8 @@ void PartSet_Listener::processEvent(const boost::shared_ptr& the XGUI_Displayer* aDisplayer = myModule->xWorkshop()->displayer(); QString aType = QString(theMessage->eventID().eventText()); if (aType == EVENT_OBJECT_CREATED) { - boost::shared_ptr aUpdMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aUpdMsg = + std::dynamic_pointer_cast(theMessage); std::set aFeatures = aUpdMsg->objects(); PartSet_OperationSketch* aSketchOp = @@ -76,8 +76,8 @@ void PartSet_Listener::processEvent(const boost::shared_ptr& the XGUI_Displayer* aDisplayer = myModule->xWorkshop()->displayer(); FeaturePtr aFeature = aCreationOp->feature(); const std::list& aResults = aFeature->results(); - boost::shared_ptr aUpdMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aUpdMsg = + std::dynamic_pointer_cast(theMessage); std::set aFeatures = aUpdMsg->objects(); std::set::const_iterator aObjIt, aNoObj = aFeatures.cend(); @@ -90,9 +90,9 @@ void PartSet_Listener::processEvent(const boost::shared_ptr& the } } } else if (aType == EVENT_OBJECT_DELETED) { - boost::shared_ptr aDelMsg = - boost::dynamic_pointer_cast(theMessage); - boost::shared_ptr aDoc = aDelMsg->document(); + std::shared_ptr aDelMsg = + std::dynamic_pointer_cast(theMessage); + std::shared_ptr aDoc = aDelMsg->document(); std::set aGroups = aDelMsg->groups(); std::set::const_iterator anIt = aGroups.begin(), aLast = aGroups.end(); diff --git a/src/PartSet/PartSet_Listener.h b/src/PartSet/PartSet_Listener.h index 272a40063..8950d2f64 100644 --- a/src/PartSet/PartSet_Listener.h +++ b/src/PartSet/PartSet_Listener.h @@ -26,7 +26,7 @@ class PARTSET_EXPORT PartSet_Listener : public Events_Listener virtual ~PartSet_Listener(); /// This method is called by loop when the event is started to process. - virtual void processEvent(const boost::shared_ptr& theMessage); + virtual void processEvent(const std::shared_ptr& theMessage); private: PartSet_Module* myModule; ///< the current module diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index d2c0d9de8..092b0769f 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -204,7 +204,7 @@ void PartSet_Module::onContextMenuCommand(const QString& theId, bool isChecked) { QList aFeatures = workshop()->selection()->selectedObjects(); if (theId == "EDIT_CMD" && (aFeatures.size() > 0)) { - FeaturePtr aFeature = boost::dynamic_pointer_cast(aFeatures.first()); + FeaturePtr aFeature = std::dynamic_pointer_cast(aFeatures.first()); if (aFeature) editFeature(aFeature); } @@ -481,7 +481,7 @@ void PartSet_Module::updateCurrentPreview(const std::string& theCmdId) std::list::const_iterator anIt = aList.begin(), aLast = aList.end(); for (; anIt != aLast; anIt++) { - boost::shared_ptr aSPFeature = boost::dynamic_pointer_cast< + std::shared_ptr aSPFeature = std::dynamic_pointer_cast< SketchPlugin_Feature>(*anIt); if (!aSPFeature) continue; @@ -505,7 +505,7 @@ void PartSet_Module::editFeature(FeaturePtr theFeature) // if (theFeature->getKind() == SKETCH_KIND) { //FeaturePtr aFeature = theFeature; //if (XGUI_Tools::isModelObject(aFeature)) { - // ObjectPtr aObject = boost::dynamic_pointer_cast(aFeature); + // ObjectPtr aObject = std::dynamic_pointer_cast(aFeature); // aFeature = aObject->featureRef(); //} @@ -518,14 +518,14 @@ void PartSet_Module::editFeature(FeaturePtr theFeature) void PartSet_Module::onStorePoint2D(ObjectPtr theFeature, const std::string& theAttribute) { - FeaturePtr aFeature = boost::dynamic_pointer_cast(theFeature); + FeaturePtr aFeature = std::dynamic_pointer_cast(theFeature); PartSet_OperationSketchBase* aPreviewOp = dynamic_cast(myWorkshop->currentOperation()); if (!aPreviewOp) return; - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aPoint = std::dynamic_pointer_cast( aFeature->data()->attribute(theAttribute)); PartSet_Tools::setConstraints(aPreviewOp->sketch(), aFeature, theAttribute, aPoint->x(), @@ -559,7 +559,7 @@ XGUI_Workshop* PartSet_Module::xWorkshop() const QIntList PartSet_Module::sketchSelectionModes(ObjectPtr theFeature) { QIntList aModes; - FeaturePtr aFeature = boost::dynamic_pointer_cast(theFeature); + FeaturePtr aFeature = std::dynamic_pointer_cast(theFeature); if (aFeature) { if (aFeature->getKind() == SketchPlugin_Sketch::ID()) { aModes.append(TopAbs_FACE); @@ -579,9 +579,9 @@ QIntList PartSet_Module::sketchSelectionModes(ObjectPtr theFeature) gp_Pln PartSet_Module::getSketchPlane(FeaturePtr theSketch) const { DataPtr aData = theSketch->data(); - boost::shared_ptr anOrigin = boost::dynamic_pointer_cast( + std::shared_ptr anOrigin = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::ORIGIN_ID())); - boost::shared_ptr aNorm = boost::dynamic_pointer_cast( + std::shared_ptr aNorm = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::NORM_ID())); gp_Pnt aOrig(anOrigin->x(), anOrigin->y(), anOrigin->z()); gp_Dir aDir(aNorm->x(), aNorm->y(), aNorm->z()); diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index a3a188ad0..b42c1a93d 100644 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -15,7 +15,7 @@ #include -#include +#include class PartSet_Listener; class ModelAPI_Feature; diff --git a/src/PartSet/PartSet_OperationFeatureBase.cpp b/src/PartSet/PartSet_OperationFeatureBase.cpp index 2d53041c0..65689f2e6 100644 --- a/src/PartSet/PartSet_OperationFeatureBase.cpp +++ b/src/PartSet/PartSet_OperationFeatureBase.cpp @@ -117,7 +117,7 @@ bool PartSet_OperationFeatureBase::getViewerPoint(ModuleBase_ViewerPrs thePrs, return false; ModuleBase_WidgetValueFeature* aValue = new ModuleBase_WidgetValueFeature(); aValue->setObject(theFeature); - aValue->setPoint(boost::shared_ptr(new GeomAPI_Pnt2d(theX, theY))); + aValue->setPoint(std::shared_ptr(new GeomAPI_Pnt2d(theX, theY))); bool isApplyed = aActiveWgt->setValue(aValue); delete aValue; diff --git a/src/PartSet/PartSet_OperationFeatureEdit.cpp b/src/PartSet/PartSet_OperationFeatureEdit.cpp index a49e63dc7..d44dfa3d7 100644 --- a/src/PartSet/PartSet_OperationFeatureEdit.cpp +++ b/src/PartSet/PartSet_OperationFeatureEdit.cpp @@ -116,7 +116,7 @@ void PartSet_OperationFeatureEdit::fillFeature2Attribute( continue; // append the attribute of the vertex if it is found on the current feature - boost::shared_ptr aPoint2D = PartSet_Tools::getFeaturePoint( + std::shared_ptr aPoint2D = PartSet_Tools::getFeaturePoint( aFeature, aX, anY); std::string anAttribute = aFeature->data()->id(aPoint2D); std::list aList; @@ -239,8 +239,8 @@ void PartSet_OperationFeatureEdit::mouseMoved(QMouseEvent* theEvent, ModuleBase_ // std::list anAttributes = aFeatIter->second; // // perform edit for the feature // if (anAttributes.empty()) { - // boost::shared_ptr aSketchFeature = - // boost::dynamic_pointer_cast(aFeature); + // std::shared_ptr aSketchFeature = + // std::dynamic_pointer_cast(aFeature); // if (aSketchFeature) { // aSketchFeature->move(aDeltaX, aDeltaY); // } @@ -250,7 +250,7 @@ void PartSet_OperationFeatureEdit::mouseMoved(QMouseEvent* theEvent, ModuleBase_ // std::list::const_iterator anAttrIter = anAttributes.begin(), // anAttrEnd = anAttributes.end(); // for (; anAttrIter != anAttrEnd; anAttrIter++) { - // boost::shared_ptr aPointAttr = boost::dynamic_pointer_cast< + // std::shared_ptr aPointAttr = std::dynamic_pointer_cast< // GeomDataAPI_Point2D>(aFeature->data()->attribute(*anAttrIter)); // if (aPointAttr) { // aPointAttr->move(aDeltaX, aDeltaY); @@ -262,7 +262,7 @@ void PartSet_OperationFeatureEdit::mouseMoved(QMouseEvent* theEvent, ModuleBase_ //} //else { // multieditoperation - //boost::shared_ptr aSketchFeature = boost::dynamic_pointer_cast< + //std::shared_ptr aSketchFeature = std::dynamic_pointer_cast< // SketchPlugin_Feature>(feature()); bool isMoved = false; @@ -290,8 +290,8 @@ void PartSet_OperationFeatureEdit::mouseMoved(QMouseEvent* theEvent, ModuleBase_ std::list anAttributes = aFeatIter->second; // perform edit for the feature if (anAttributes.empty()) { - boost::shared_ptr aSketchFeature = - boost::dynamic_pointer_cast(aFeature); + std::shared_ptr aSketchFeature = + std::dynamic_pointer_cast(aFeature); if (aSketchFeature) { aSketchFeature->move(aDeltaX, aDeltaY); isMoved = true; @@ -302,7 +302,7 @@ void PartSet_OperationFeatureEdit::mouseMoved(QMouseEvent* theEvent, ModuleBase_ std::list::const_iterator anAttrIter = anAttributes.begin(), anAttrEnd = anAttributes.end(); for (; anAttrIter != anAttrEnd; anAttrIter++) { - boost::shared_ptr aPointAttr = boost::dynamic_pointer_cast< + std::shared_ptr aPointAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aFeature->data()->attribute(*anAttrIter)); if (aPointAttr) { aPointAttr->move(aDeltaX, aDeltaY); diff --git a/src/PartSet/PartSet_OperationSketch.cpp b/src/PartSet/PartSet_OperationSketch.cpp index c3ca9d922..5d9454d7a 100644 --- a/src/PartSet/PartSet_OperationSketch.cpp +++ b/src/PartSet/PartSet_OperationSketch.cpp @@ -51,7 +51,7 @@ PartSet_OperationSketch::~PartSet_OperationSketch() CompositeFeaturePtr PartSet_OperationSketch::sketch() const { - return boost::dynamic_pointer_cast(feature()); + return std::dynamic_pointer_cast(feature()); } void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, ModuleBase_IViewer* theViewer, ModuleBase_ISelection* theSelection) @@ -104,20 +104,20 @@ void PartSet_OperationSketch::selectionChanged(ModuleBase_ISelection* theSelecti // We have to select a plane before any operation TopoDS_Shape aShape = aPrs.shape(); if (!aShape.IsNull()) { - boost::shared_ptr aDir = setSketchPlane(aShape); + std::shared_ptr aDir = setSketchPlane(aShape); flushUpdated(); emit featureConstructed(feature(), FM_Hide); // If selection is not a sketcher presentation then it has to be stored as // External shape if (feature() != aPrs.object()) { - //boost::shared_ptr aSketch = - // boost::dynamic_pointer_cast(feature()); + //std::shared_ptr aSketch = + // std::dynamic_pointer_cast(feature()); DataPtr aData = feature()->data(); AttributeSelectionPtr aSelAttr = - boost::dynamic_pointer_cast + std::dynamic_pointer_cast (aData->attribute(SketchPlugin_Feature::EXTERNAL_ID())); if (aSelAttr) { - ResultPtr aRes = boost::dynamic_pointer_cast(aPrs.object()); + ResultPtr aRes = std::dynamic_pointer_cast(aPrs.object()); if (aRes) { GeomShapePtr aShapePtr(new GeomAPI_Shape()); aShapePtr->setImpl(new TopoDS_Shape(aShape)); @@ -176,16 +176,16 @@ std::list PartSet_OperationSketch::subFeatures() const if (!aFeature) return aFeaList; - boost::shared_ptr aData = aFeature->data(); + std::shared_ptr aData = aFeature->data(); if (!aData->isValid()) return std::list(); - boost::shared_ptr aRefList = boost::dynamic_pointer_cast< + std::shared_ptr aRefList = std::dynamic_pointer_cast< ModelAPI_AttributeRefList>(aData->attribute(SketchPlugin_Sketch::FEATURES_ID())); std::list aList = aRefList->list(); std::list::iterator aIt; for (aIt = aList.begin(); aIt != aList.end(); ++aIt) { - FeaturePtr aFeature = boost::dynamic_pointer_cast(*aIt); + FeaturePtr aFeature = std::dynamic_pointer_cast(*aIt); if (aFeature) aFeaList.push_back(aFeature); } @@ -227,59 +227,59 @@ bool PartSet_OperationSketch::hasSketchPlane() const bool aHasPlane = false; if (feature()) { - boost::shared_ptr aData = feature()->data(); + std::shared_ptr aData = feature()->data(); AttributeDoublePtr anAttr; - boost::shared_ptr aNormal = boost::dynamic_pointer_cast( + std::shared_ptr aNormal = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::NORM_ID())); aHasPlane = aNormal && !(aNormal->x() == 0 && aNormal->y() == 0 && aNormal->z() == 0); } return aHasPlane; } -boost::shared_ptr PartSet_OperationSketch::setSketchPlane(const TopoDS_Shape& theShape) +std::shared_ptr PartSet_OperationSketch::setSketchPlane(const TopoDS_Shape& theShape) { if (theShape.IsNull()) - return boost::shared_ptr(); + return std::shared_ptr(); // get selected shape - boost::shared_ptr aGShape(new GeomAPI_Shape); + std::shared_ptr aGShape(new GeomAPI_Shape); aGShape->setImpl(new TopoDS_Shape(theShape)); // get plane parameters - boost::shared_ptr aPlane = GeomAlgoAPI_FaceBuilder::plane(aGShape); + std::shared_ptr aPlane = GeomAlgoAPI_FaceBuilder::plane(aGShape); // set plane parameters to feature - boost::shared_ptr aData = feature()->data(); + std::shared_ptr aData = feature()->data(); double anA, aB, aC, aD; aPlane->coefficients(anA, aB, aC, aD); // calculate attributes of the sketch - boost::shared_ptr aNormDir(new GeomAPI_Dir(anA, aB, aC)); - boost::shared_ptr aCoords = aNormDir->xyz(); - boost::shared_ptr aZero(new GeomAPI_XYZ(0, 0, 0)); + std::shared_ptr aNormDir(new GeomAPI_Dir(anA, aB, aC)); + std::shared_ptr aCoords = aNormDir->xyz(); + std::shared_ptr aZero(new GeomAPI_XYZ(0, 0, 0)); aCoords = aCoords->multiplied(-aD * aCoords->distance(aZero)); - boost::shared_ptr anOrigPnt(new GeomAPI_Pnt(aCoords)); + std::shared_ptr anOrigPnt(new GeomAPI_Pnt(aCoords)); // X axis is preferable to be dirX on the sketch const double tol = Precision::Confusion(); bool isX = fabs(anA - 1.0) < tol && fabs(aB) < tol && fabs(aC) < tol; - boost::shared_ptr aTempDir( + std::shared_ptr aTempDir( isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0)); - boost::shared_ptr aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir))); - boost::shared_ptr aXDir(new GeomAPI_Dir(aYDir->cross(aNormDir))); + std::shared_ptr aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir))); + std::shared_ptr aXDir(new GeomAPI_Dir(aYDir->cross(aNormDir))); - boost::shared_ptr anOrigin = boost::dynamic_pointer_cast( + std::shared_ptr anOrigin = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::ORIGIN_ID())); anOrigin->setValue(anOrigPnt); - boost::shared_ptr aNormal = boost::dynamic_pointer_cast( + std::shared_ptr aNormal = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::NORM_ID())); aNormal->setValue(aNormDir); - boost::shared_ptr aDirX = boost::dynamic_pointer_cast( + std::shared_ptr aDirX = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::DIRX_ID())); aDirX->setValue(aXDir); - boost::shared_ptr aDirY = boost::dynamic_pointer_cast( + std::shared_ptr aDirY = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::DIRY_ID())); aDirY->setValue(aYDir); - boost::shared_ptr aDir = aPlane->direction(); + std::shared_ptr aDir = aPlane->direction(); return aDir; } diff --git a/src/PartSet/PartSet_OperationSketch.h b/src/PartSet/PartSet_OperationSketch.h index 216b4d94d..1a770e16b 100644 --- a/src/PartSet/PartSet_OperationSketch.h +++ b/src/PartSet/PartSet_OperationSketch.h @@ -87,7 +87,7 @@ Q_OBJECT /// Set the plane to the current sketch /// \param theShape the shape /// \return selected direction - boost::shared_ptr setSketchPlane(const TopoDS_Shape& theShape); + std::shared_ptr setSketchPlane(const TopoDS_Shape& theShape); /// Called on selection changed when the operation is active virtual void selectionChanged(ModuleBase_ISelection* theSelection); diff --git a/src/PartSet/PartSet_OperationSketchBase.cpp b/src/PartSet/PartSet_OperationSketchBase.cpp index 1f7550403..310658e9b 100644 --- a/src/PartSet/PartSet_OperationSketchBase.cpp +++ b/src/PartSet/PartSet_OperationSketchBase.cpp @@ -35,17 +35,17 @@ PartSet_OperationSketchBase::~PartSet_OperationSketchBase() { } -boost::shared_ptr PartSet_OperationSketchBase::preview(FeaturePtr theFeature) +std::shared_ptr PartSet_OperationSketchBase::preview(FeaturePtr theFeature) { - boost::shared_ptr aFeature = boost::dynamic_pointer_cast< + std::shared_ptr aFeature = std::dynamic_pointer_cast< SketchPlugin_Feature>(theFeature); if (aFeature) { ResultPtr aRes = aFeature->firstResult(); - ResultBodyPtr aBody = boost::dynamic_pointer_cast(aRes); + ResultBodyPtr aBody = std::dynamic_pointer_cast(aRes); if (aBody) return aBody->shape(); } - return boost::shared_ptr(); + return std::shared_ptr(); } std::list PartSet_OperationSketchBase::subFeatures() const diff --git a/src/PartSet/PartSet_OperationSketchBase.h b/src/PartSet/PartSet_OperationSketchBase.h index ef3991a9a..dacfb8fd7 100644 --- a/src/PartSet/PartSet_OperationSketchBase.h +++ b/src/PartSet/PartSet_OperationSketchBase.h @@ -56,7 +56,7 @@ Q_OBJECT /// Returns the feature preview shape /// \param theFeature the feature object to obtain the preview - static boost::shared_ptr preview(FeaturePtr theFeature); + static std::shared_ptr preview(FeaturePtr theFeature); /// Returns the list of the nested features /// \return the list of subfeatures diff --git a/src/PartSet/PartSet_TestOCC.cpp b/src/PartSet/PartSet_TestOCC.cpp index bd9b24833..29c5829a0 100644 --- a/src/PartSet/PartSet_TestOCC.cpp +++ b/src/PartSet/PartSet_TestOCC.cpp @@ -37,7 +37,7 @@ void PartSet_TestOCC::testSelection(XGUI_Workshop* theWorkshop) theWorkshop->viewer()->activeView()); PartSet_TestOCC::changeTestLine(theWorkshop); } - boost::shared_ptr anIO = theWorkshop->displayer()->getAISObject(myTestObject); + std::shared_ptr anIO = theWorkshop->displayer()->getAISObject(myTestObject); if (!anIO->empty()) { theWorkshop->viewer()->AISContext()->MoveTo(0, 0, theWorkshop->viewer()->activeView()); theWorkshop->viewer()->AISContext()->Select(0, 0, 2500, 2500, @@ -132,26 +132,26 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop) if (aPreviewOp) { // create a line - boost::shared_ptr aDoc = ModelAPI_Session::get()->moduleDocument(); + std::shared_ptr aDoc = ModelAPI_Session::get()->moduleDocument(); FeaturePtr aFeature = aDoc->addFeature(SketchPlugin_Line::ID()); if (aFeature) // TODO: generate an error if feature was not created aFeature->execute(); - boost::shared_ptr aSketch = boost::dynamic_pointer_cast< + std::shared_ptr aSketch = std::dynamic_pointer_cast< SketchPlugin_Feature>(aPreviewOp->sketch()); aSketch->addSub(aFeature); PartSet_Tools::setFeaturePoint(aFeature, 100, 100, SketchPlugin_Line::START_ID()); PartSet_Tools::setFeaturePoint(aFeature, 150, 300, SketchPlugin_Line::END_ID()); - boost::shared_ptr aPreview = PartSet_OperationSketchBase::preview(aFeature); + std::shared_ptr aPreview = PartSet_OperationSketchBase::preview(aFeature); XGUI_Displayer* aDisplayer = theWorkshop->displayer(); - boost::shared_ptr aPrevAIS; - boost::shared_ptr aSPFeature = boost::dynamic_pointer_cast< + std::shared_ptr aPrevAIS; + std::shared_ptr aSPFeature = std::dynamic_pointer_cast< SketchPlugin_Feature>(aFeature); - //boost::shared_ptr anAIS = aSPFeature->getAISObject(aPrevAIS); + //std::shared_ptr anAIS = aSPFeature->getAISObject(aPrevAIS); //if (!anAIS->empty()) aDisplayer->display(aFeature, false); //aDisplayer->redisplay(aFeature->firstResult(), anAIS, false); @@ -168,7 +168,7 @@ void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop) PartSet_Tools::setFeaturePoint(aFeature, 100+aDelta, 200+aDelta, SketchPlugin_Line::START_ID()); PartSet_Tools::setFeaturePoint(aFeature, 300+aDelta, 500+aDelta, SketchPlugin_Line::END_ID()); - boost::shared_ptr aPreview = PartSet_OperationSketchBase::preview(aFeature); + std::shared_ptr aPreview = PartSet_OperationSketchBase::preview(aFeature); Handle(AIS_InteractiveObject) anAIS = PartSet_Presentation::createPresentation( aFeature, aSketch, aPreview ? aPreview->impl() : TopoDS_Shape(), NULL); @@ -204,12 +204,12 @@ void PartSet_TestOCC::changeTestLine(XGUI_Workshop* theWorkshop) // TODO //PartSet_Tools::setFeaturePoint(aFeature, -100/*aDelta*/, -100/*aDelta*/, LINE_ATTR_START); //PartSet_Tools::setFeaturePoint(aFeature, 200/*aDelta*2*/, 200/*aDelta*2*/, LINE_ATTR_END); - //boost::shared_ptr aPreview = PartSet_OperationSketchBase::preview(aFeature); + //std::shared_ptr aPreview = PartSet_OperationSketchBase::preview(aFeature); - boost::shared_ptr aPrevAIS; - boost::shared_ptr aSPFeature = boost::dynamic_pointer_cast< + std::shared_ptr aPrevAIS; + std::shared_ptr aSPFeature = std::dynamic_pointer_cast< SketchPlugin_Feature>(aFeature); - //boost::shared_ptr anAIS = aSPFeature->getAISObject(aPrevAIS); + //std::shared_ptr anAIS = aSPFeature->getAISObject(aPrevAIS); //if (!anAIS->empty()) theWorkshop->displayer()->display(aFeature, true); // theWorkshop->displayer()->redisplay(aFeature, anAIS, true); diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 364d7c9d2..c97b6c68f 100644 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -88,14 +88,14 @@ Handle(V3d_View) theView, return; AttributeDoublePtr anAttr; - boost::shared_ptr aData = theSketch->data(); + std::shared_ptr aData = theSketch->data(); - boost::shared_ptr anOrigin = boost::dynamic_pointer_cast( + std::shared_ptr anOrigin = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::ORIGIN_ID())); - boost::shared_ptr aX = boost::dynamic_pointer_cast( + std::shared_ptr aX = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::DIRX_ID())); - boost::shared_ptr anY = boost::dynamic_pointer_cast( + std::shared_ptr anY = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::DIRY_ID())); gp_Pnt anOriginPnt(anOrigin->x(), anOrigin->y(), anOrigin->z()); @@ -112,7 +112,7 @@ Handle(V3d_View) theView, gp_Vec anEyeVec(EyePoint, AtPoint); anEyeVec.Normalize(); - boost::shared_ptr aNormal = boost::dynamic_pointer_cast( + std::shared_ptr aNormal = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::NORM_ID())); gp_Vec aNormalVec(aNormal->x(), aNormal->y(), aNormal->z()); @@ -132,19 +132,19 @@ void PartSet_Tools::convertTo3D(const double theX, const double theY, FeaturePtr if (!theSketch) return; - boost::shared_ptr aData = theSketch->data(); + std::shared_ptr aData = theSketch->data(); - boost::shared_ptr aC = boost::dynamic_pointer_cast( + std::shared_ptr aC = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::ORIGIN_ID())); - boost::shared_ptr aX = boost::dynamic_pointer_cast( + std::shared_ptr aX = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::DIRX_ID())); - boost::shared_ptr aY = boost::dynamic_pointer_cast( + std::shared_ptr aY = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::DIRY_ID())); - boost::shared_ptr aSum = aC->pnt()->xyz()->added(aX->dir()->xyz()->multiplied(theX)) + std::shared_ptr aSum = aC->pnt()->xyz()->added(aX->dir()->xyz()->multiplied(theX)) ->added(aY->dir()->xyz()->multiplied(theY)); - boost::shared_ptr aPoint = boost::shared_ptr(new GeomAPI_Pnt(aSum)); + std::shared_ptr aPoint = std::shared_ptr(new GeomAPI_Pnt(aSum)); thePoint = gp_Pnt(aPoint->x(), aPoint->y(), aPoint->z()); } @@ -169,7 +169,7 @@ ObjectPtr PartSet_Tools::nearestFeature(QPoint thePoint, Handle_V3d_View theView ObjectPtr aDeltaObject; CompositeFeaturePtr aSketch = - boost::dynamic_pointer_cast(theSketch); + std::dynamic_pointer_cast(theSketch); // 1. find it in the selected list by the selected point if (!aDeltaObject) { double aX, anY; @@ -183,13 +183,13 @@ ObjectPtr PartSet_Tools::nearestFeature(QPoint thePoint, Handle_V3d_View theView if (!aPrs.object()) continue; FeaturePtr aFeature = ModelAPI_Feature::feature(aPrs.object()); - boost::shared_ptr aSketchFeature = boost::dynamic_pointer_cast< + std::shared_ptr aSketchFeature = std::dynamic_pointer_cast< SketchPlugin_Feature>(aFeature); if (!aSketchFeature || !aSketch->isSub(aSketchFeature)) continue; double aDelta = aSketchFeature->distanceToPoint( - boost::shared_ptr(new GeomAPI_Pnt2d(aX, anY))); + std::shared_ptr(new GeomAPI_Pnt2d(aX, anY))); if (aMinDelta < 0 || aMinDelta > aDelta) { aMinDelta = aDelta; // TODO aDeltaObject = aPrs.result(); @@ -210,23 +210,23 @@ ObjectPtr PartSet_Tools::nearestFeature(QPoint thePoint, Handle_V3d_View theView return aDeltaObject; } -boost::shared_ptr PartSet_Tools::document() +std::shared_ptr PartSet_Tools::document() { return ModelAPI_Session::get()->moduleDocument(); } -boost::shared_ptr PartSet_Tools::getFeaturePoint(FeaturePtr theFeature, +std::shared_ptr PartSet_Tools::getFeaturePoint(FeaturePtr theFeature, double theX, double theY) { - boost::shared_ptr aClickedPoint = boost::shared_ptr( + std::shared_ptr aClickedPoint = std::shared_ptr( new GeomAPI_Pnt2d(theX, theY)); - std::list > anAttiributes = + std::list > anAttiributes = theFeature->data()->attributes(GeomDataAPI_Point2D::type()); - std::list >::const_iterator anIt = anAttiributes.begin(), + std::list >::const_iterator anIt = anAttiributes.begin(), aLast = anAttiributes.end(); - boost::shared_ptr aFPoint; + std::shared_ptr aFPoint; for (; anIt != aLast && !aFPoint; anIt++) { - boost::shared_ptr aCurPoint = boost::dynamic_pointer_cast< + std::shared_ptr aCurPoint = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(*anIt); if (aCurPoint && aCurPoint->pnt()->distance(aClickedPoint) < Precision::Confusion()) aFPoint = aCurPoint; @@ -240,8 +240,8 @@ void PartSet_Tools::setFeatureValue(FeaturePtr theFeature, double theValue, { if (!theFeature) return; - boost::shared_ptr aData = theFeature->data(); - AttributeDoublePtr anAttribute = boost::dynamic_pointer_cast( + std::shared_ptr aData = theFeature->data(); + AttributeDoublePtr anAttribute = std::dynamic_pointer_cast( aData->attribute(theAttribute)); if (anAttribute) anAttribute->setValue(theValue); @@ -253,8 +253,8 @@ double PartSet_Tools::featureValue(FeaturePtr theFeature, const std::string& the isValid = false; double aValue = 0; if (theFeature) { - boost::shared_ptr aData = theFeature->data(); - AttributeDoublePtr anAttribute = boost::dynamic_pointer_cast( + std::shared_ptr aData = theFeature->data(); + AttributeDoublePtr anAttribute = std::dynamic_pointer_cast( aData->attribute(theAttribute)); if (anAttribute) { aValue = anAttribute->value(); @@ -271,11 +271,11 @@ FeaturePtr PartSet_Tools::feature(FeaturePtr theFeature, const std::string& theA if (!theFeature) return aFeature; - boost::shared_ptr aData = theFeature->data(); - boost::shared_ptr anAttr = boost::dynamic_pointer_cast< + std::shared_ptr aData = theFeature->data(); + std::shared_ptr anAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(theAttribute)); if (anAttr) { - aFeature = boost::dynamic_pointer_cast(anAttr->object()); + aFeature = std::dynamic_pointer_cast(anAttr->object()); if (!theKind.empty() && aFeature && aFeature->getKind() != theKind) { aFeature = FeaturePtr(); } @@ -284,24 +284,24 @@ FeaturePtr PartSet_Tools::feature(FeaturePtr theFeature, const std::string& theA } void PartSet_Tools::createConstraint(CompositeFeaturePtr theSketch, - boost::shared_ptr thePoint1, - boost::shared_ptr thePoint2) + std::shared_ptr thePoint1, + std::shared_ptr thePoint2) { FeaturePtr aFeature; if (theSketch) { aFeature = theSketch->addFeature(SketchPlugin_ConstraintCoincidence::ID()); } else { - boost::shared_ptr aDoc = document(); + std::shared_ptr aDoc = document(); aFeature = aDoc->addFeature(SketchPlugin_ConstraintCoincidence::ID()); } - boost::shared_ptr aData = aFeature->data(); + std::shared_ptr aData = aFeature->data(); - boost::shared_ptr aRef1 = boost::dynamic_pointer_cast< + std::shared_ptr aRef1 = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_A())); aRef1->setAttr(thePoint1); - boost::shared_ptr aRef2 = boost::dynamic_pointer_cast< + std::shared_ptr aRef2 = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_B())); aRef2->setAttr(thePoint2); @@ -314,32 +314,32 @@ void PartSet_Tools::setConstraints(CompositeFeaturePtr theSketch, FeaturePtr the double theClickedY) { // find a feature point by the selection mode - //boost::shared_ptr aPoint = featurePoint(theMode); - boost::shared_ptr aFeaturePoint = boost::dynamic_pointer_cast< + //std::shared_ptr aPoint = featurePoint(theMode); + std::shared_ptr aFeaturePoint = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(theFeature->data()->attribute(theAttribute)); if (!aFeaturePoint) return; // get all sketch features. If the point with the given coordinates belong to any sketch feature, // the constraint is created between the feature point and the found sketch point - boost::shared_ptr aData = theSketch->data(); - boost::shared_ptr aRefList = boost::dynamic_pointer_cast< + std::shared_ptr aData = theSketch->data(); + std::shared_ptr aRefList = std::dynamic_pointer_cast< ModelAPI_AttributeRefList>(aData->attribute(SketchPlugin_Sketch::FEATURES_ID())); std::list aFeatures = aRefList->list(); std::list::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end(); - std::list > anAttiributes; - boost::shared_ptr aClickedPoint = boost::shared_ptr( + std::list > anAttiributes; + std::shared_ptr aClickedPoint = std::shared_ptr( new GeomAPI_Pnt2d(theClickedX, theClickedY)); for (; anIt != aLast; anIt++) { - FeaturePtr aFeature = boost::dynamic_pointer_cast(*anIt); + FeaturePtr aFeature = std::dynamic_pointer_cast(*anIt); // find the given point in the feature attributes anAttiributes = aFeature->data()->attributes(GeomDataAPI_Point2D::type()); - std::list >::const_iterator anIt = anAttiributes.begin(), + std::list >::const_iterator anIt = anAttiributes.begin(), aLast = anAttiributes.end(); - boost::shared_ptr aFPoint; + std::shared_ptr aFPoint; for (; anIt != aLast && !aFPoint; anIt++) { - boost::shared_ptr aCurPoint = boost::dynamic_pointer_cast< + std::shared_ptr aCurPoint = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(*anIt); if (aCurPoint && aCurPoint->pnt()->distance(aClickedPoint) < Precision::Confusion()) aFPoint = aCurPoint; @@ -349,37 +349,37 @@ void PartSet_Tools::setConstraints(CompositeFeaturePtr theSketch, FeaturePtr the } } -boost::shared_ptr PartSet_Tools::sketchPlane(CompositeFeaturePtr theSketch) +std::shared_ptr PartSet_Tools::sketchPlane(CompositeFeaturePtr theSketch) { - boost::shared_ptr aPlane; + std::shared_ptr aPlane; double aA, aB, aC, aD; - boost::shared_ptr aData = theSketch->data(); - boost::shared_ptr anOrigin = boost::dynamic_pointer_cast( + std::shared_ptr aData = theSketch->data(); + std::shared_ptr anOrigin = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::ORIGIN_ID())); - boost::shared_ptr aNormal = boost::dynamic_pointer_cast( + std::shared_ptr aNormal = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Sketch::NORM_ID())); aA = aNormal->x(); aB = aNormal->y(); aC = aNormal->z(); aD = 0; - aPlane = boost::shared_ptr(new GeomAPI_Pln(aA, aB, aC, aD)); + aPlane = std::shared_ptr(new GeomAPI_Pln(aA, aB, aC, aD)); return aPlane; } -boost::shared_ptr PartSet_Tools::point3D(boost::shared_ptr thePoint2D, +std::shared_ptr PartSet_Tools::point3D(std::shared_ptr thePoint2D, CompositeFeaturePtr theSketch) { - boost::shared_ptr aPoint; + std::shared_ptr aPoint; if (!theSketch || !thePoint2D) return aPoint; - boost::shared_ptr aC = boost::dynamic_pointer_cast( + std::shared_ptr aC = std::dynamic_pointer_cast( theSketch->data()->attribute(SketchPlugin_Sketch::ORIGIN_ID())); - boost::shared_ptr aX = boost::dynamic_pointer_cast( + std::shared_ptr aX = std::dynamic_pointer_cast( theSketch->data()->attribute(SketchPlugin_Sketch::DIRX_ID())); - boost::shared_ptr aY = boost::dynamic_pointer_cast( + std::shared_ptr aY = std::dynamic_pointer_cast( theSketch->data()->attribute(SketchPlugin_Sketch::DIRY_ID())); return thePoint2D->to3D(aC->pnt(), aX->dir(), aY->dir()); @@ -400,7 +400,7 @@ ResultPtr PartSet_Tools::createFixedObjectByEdge(const ModuleBase_ViewerPrs& the return ResultPtr(); // Check that we already have such external edge - boost::shared_ptr aInEdge = boost::shared_ptr(new GeomAPI_Edge()); + std::shared_ptr aInEdge = std::shared_ptr(new GeomAPI_Edge()); aInEdge->setImpl(new TopoDS_Shape(aShape)); ResultPtr aResult = findExternalEdge(theSketch, aInEdge); if (aResult) @@ -418,8 +418,8 @@ ResultPtr PartSet_Tools::createFixedObjectByEdge(const ModuleBase_ViewerPrs& the aMyFeature = theSketch->addFeature(SketchPlugin_Line::ID()); //DataPtr aData = myFeature->data(); - //boost::shared_ptr anEndAttr = - // boost::dynamic_pointer_cast(aData->attribute(SketchPlugin_Line::END_ID())); + //std::shared_ptr anEndAttr = + // std::dynamic_pointer_cast(aData->attribute(SketchPlugin_Line::END_ID())); //double aX, aY; //gp_Pnt Pnt1 = aAdaptor.Value(aStart); @@ -448,12 +448,12 @@ ResultPtr PartSet_Tools::createFixedObjectByEdge(const ModuleBase_ViewerPrs& the if (aMyFeature) { DataPtr aData = aMyFeature->data(); AttributeSelectionPtr anAttr = - boost::dynamic_pointer_cast + std::dynamic_pointer_cast (aData->attribute(SketchPlugin_Feature::EXTERNAL_ID())); - ResultPtr aRes = boost::dynamic_pointer_cast(thePrs.object()); + ResultPtr aRes = std::dynamic_pointer_cast(thePrs.object()); if (anAttr && aRes) { - boost::shared_ptr anEdge(new GeomAPI_Shape); + std::shared_ptr anEdge(new GeomAPI_Shape); anEdge->setImpl(new TopoDS_Shape(aShape)); anAttr->setValue(aRes, anEdge); @@ -481,21 +481,21 @@ bool PartSet_Tools::isContainPresentation(const QList& the return false; } -ResultPtr PartSet_Tools::findExternalEdge(CompositeFeaturePtr theSketch, boost::shared_ptr theEdge) +ResultPtr PartSet_Tools::findExternalEdge(CompositeFeaturePtr theSketch, std::shared_ptr theEdge) { for (int i = 0; i < theSketch->numberOfSubs(); i++) { FeaturePtr aFeature = theSketch->subFeature(i); - boost::shared_ptr aSketchFea = - boost::dynamic_pointer_cast(aFeature); + std::shared_ptr aSketchFea = + std::dynamic_pointer_cast(aFeature); if (aSketchFea) { if (aSketchFea->isExternal()) { std::list aResults = aSketchFea->results(); std::list::const_iterator aIt; for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) { ResultConstructionPtr aRes = - boost::dynamic_pointer_cast(*aIt); + std::dynamic_pointer_cast(*aIt); if (aRes) { - boost::shared_ptr aShape = aRes->shape(); + std::shared_ptr aShape = aRes->shape(); if (aShape) { if (theEdge->isEqual(aShape)) return aRes; diff --git a/src/PartSet/PartSet_Tools.h b/src/PartSet/PartSet_Tools.h index 30838ae09..5dda6eafb 100644 --- a/src/PartSet/PartSet_Tools.h +++ b/src/PartSet/PartSet_Tools.h @@ -15,7 +15,7 @@ #include -#include +#include class Handle_V3d_View; class ModuleBase_ViewerPrs; @@ -68,14 +68,14 @@ class PARTSET_EXPORT PartSet_Tools const QList& theHighlighted); /// Returns pointer to the root document. - static boost::shared_ptr document(); + static std::shared_ptr document(); /// Returns a point attribute of the feature by the coordinates if it is /// \param theFeature the feature /// \param theX the horizontal coordinate /// \param theY the vertical coordinate - static boost::shared_ptr getFeaturePoint(FeaturePtr theFeature, + static std::shared_ptr getFeaturePoint(FeaturePtr theFeature, double theX, double theY); /// \brief Save the double to the feature. If the attribute is double, it is filled. @@ -104,8 +104,8 @@ class PARTSET_EXPORT PartSet_Tools /// \param thePoint1 the first point /// \param thePoint1 the second point static void createConstraint(CompositeFeaturePtr theSketch, - boost::shared_ptr thePoint1, - boost::shared_ptr thePoint2); + std::shared_ptr thePoint1, + std::shared_ptr thePoint2); /// Creates constrains of the current /// \param theSketch a sketch feature @@ -120,13 +120,13 @@ class PARTSET_EXPORT PartSet_Tools /// Create a sketch plane instance /// \param theSketch a sketch feature /// \return API object of geom plane - static boost::shared_ptr sketchPlane(CompositeFeaturePtr theSketch); + static std::shared_ptr sketchPlane(CompositeFeaturePtr theSketch); /// Create a point 3D on a basis of point 2D and sketch feature /// \param thePoint2D a point on a sketch /// \param theSketch a sketch feature /// \return API object of point 3D - static boost::shared_ptr point3D(boost::shared_ptr thePoint2D, + static std::shared_ptr point3D(std::shared_ptr thePoint2D, CompositeFeaturePtr theSketch); /// Check whether there is a constraint with the feature kind given /// \param theKind a feature kind @@ -150,7 +150,7 @@ class PARTSET_EXPORT PartSet_Tools /// \param theSketch - the sketch feature /// \param theEdge - the edge /// \return result object with external edge if it is found - static ResultPtr findExternalEdge(CompositeFeaturePtr theSketch, boost::shared_ptr theEdge); + static ResultPtr findExternalEdge(CompositeFeaturePtr theSketch, std::shared_ptr theEdge); /// Returns whether the selected presentation has a shape with the vertex type /// \param thePrs a selected presentation diff --git a/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp b/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp index 8c6e8cc0a..f92c0e912 100644 --- a/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Duplicate.cpp @@ -21,11 +21,11 @@ void PartSetPlugin_Duplicate::initAttributes() PartSetPlugin_Part::initAttributes(); data()->addAttribute(ORIGIN_REF(), ModelAPI_AttributeRefAttr::type()); - boost::shared_ptr aPManager = ModelAPI_Session::get(); - boost::shared_ptr aRoot = aPManager->moduleDocument(); - boost::shared_ptr aSource; // searching for source document attribute + std::shared_ptr aPManager = ModelAPI_Session::get(); + std::shared_ptr aRoot = aPManager->moduleDocument(); + std::shared_ptr aSource; // searching for source document attribute for (int a = aRoot->size(getGroup()) - 1; a >= 0; a--) { - aSource = boost::dynamic_pointer_cast(aRoot->object(getGroup(), a)); + aSource = std::dynamic_pointer_cast(aRoot->object(getGroup(), a)); if (aSource && aSource->data() && aSource->data()->document(ModelAPI_ResultPart::DOC_REF())->value() == aPManager->activeDocument()) @@ -33,7 +33,7 @@ void PartSetPlugin_Duplicate::initAttributes() aSource.reset(); } if (aSource) { - boost::shared_ptr aCopy = aPManager->copy( + std::shared_ptr aCopy = aPManager->copy( aSource->data()->document(ModelAPI_ResultPart::DOC_REF())->value(), data()->name()); data()->refattr(ORIGIN_REF())->setObject(aSource); } diff --git a/src/PartSetPlugin/PartSetPlugin_Part.cpp b/src/PartSetPlugin/PartSetPlugin_Part.cpp index 48d338267..47fa360a9 100644 --- a/src/PartSetPlugin/PartSetPlugin_Part.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Part.cpp @@ -21,7 +21,7 @@ void PartSetPlugin_Part::initAttributes() void PartSetPlugin_Part::execute() { - ResultPartPtr aResult = boost::dynamic_pointer_cast(firstResult()); + ResultPartPtr aResult = std::dynamic_pointer_cast(firstResult()); if (!aResult) { aResult = document()->createPart(data()); setResult(aResult); @@ -29,7 +29,7 @@ void PartSetPlugin_Part::execute() } } -boost::shared_ptr PartSetPlugin_Part::documentToAdd() +std::shared_ptr PartSetPlugin_Part::documentToAdd() { return ModelAPI_Session::get()->moduleDocument(); } diff --git a/src/PartSetPlugin/PartSetPlugin_Part.h b/src/PartSetPlugin/PartSetPlugin_Part.h index ef1dd528c..5a9b4202c 100644 --- a/src/PartSetPlugin/PartSetPlugin_Part.h +++ b/src/PartSetPlugin/PartSetPlugin_Part.h @@ -41,7 +41,7 @@ class PartSetPlugin_Part : public ModelAPI_Feature /// Request for initialization of data model of the feature: adding all attributes PARTSETPLUGIN_EXPORT virtual void initAttributes(); - PARTSETPLUGIN_EXPORT virtual boost::shared_ptr documentToAdd(); + PARTSETPLUGIN_EXPORT virtual std::shared_ptr documentToAdd(); /// Returns true if this feature must be displayed in the history (top level of Part tree) PARTSETPLUGIN_EXPORT virtual bool isInHistory() diff --git a/src/PartSetPlugin/PartSetPlugin_Remove.cpp b/src/PartSetPlugin/PartSetPlugin_Remove.cpp index d459d9753..3f2cd80fe 100644 --- a/src/PartSetPlugin/PartSetPlugin_Remove.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Remove.cpp @@ -12,12 +12,12 @@ void PartSetPlugin_Remove::execute() { - boost::shared_ptr aPManager = ModelAPI_Session::get(); - boost::shared_ptr aRoot = aPManager->moduleDocument(); - boost::shared_ptr aCurrent; - boost::shared_ptr a; + std::shared_ptr aPManager = ModelAPI_Session::get(); + std::shared_ptr aRoot = aPManager->moduleDocument(); + std::shared_ptr aCurrent; + std::shared_ptr a; for (int a = aRoot->size(ModelAPI_ResultPart::group()) - 1; a >= 0; a--) { - ResultPartPtr aPart = boost::dynamic_pointer_cast( + ResultPartPtr aPart = std::dynamic_pointer_cast( aRoot->object(ModelAPI_ResultPart::group(), a)); if (aPart && aPart->data()->document(ModelAPI_ResultPart::DOC_REF())->value() diff --git a/src/SketchPlugin/SketchPlugin_Arc.cpp b/src/SketchPlugin/SketchPlugin_Arc.cpp index 7d25c48c3..9f717bd70 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.cpp +++ b/src/SketchPlugin/SketchPlugin_Arc.cpp @@ -41,43 +41,43 @@ void SketchPlugin_Arc::execute() // otherwise AIS object is used to visualize the arc's preview if (aSketch && isFeatureValid()) { // compute a circle point in 3D view - boost::shared_ptr aCenterAttr = boost::dynamic_pointer_cast< + std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Arc::CENTER_ID())); // compute the arc start point - boost::shared_ptr aStartAttr = boost::dynamic_pointer_cast< + std::shared_ptr aStartAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Arc::START_ID())); - boost::shared_ptr aCenter(aSketch->to3D(aCenterAttr->x(), aCenterAttr->y())); + std::shared_ptr aCenter(aSketch->to3D(aCenterAttr->x(), aCenterAttr->y())); // make a visible point - boost::shared_ptr aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter); - boost::shared_ptr aConstr1 = document()->createConstruction( + std::shared_ptr aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter); + std::shared_ptr aConstr1 = document()->createConstruction( data(), 0); aConstr1->setShape(aCenterPointShape); aConstr1->setIsInHistory(false); setResult(aConstr1, 0); // make a visible circle - boost::shared_ptr aNDir = boost::dynamic_pointer_cast( + std::shared_ptr aNDir = std::dynamic_pointer_cast( aSketch->data()->attribute(SketchPlugin_Sketch::NORM_ID())); bool aHasPlane = aNDir && !(aNDir->x() == 0 && aNDir->y() == 0 && aNDir->z() == 0); if (aHasPlane) { - boost::shared_ptr aNormal = aNDir->dir(); - boost::shared_ptr aStartPoint(aSketch->to3D(aStartAttr->x(), aStartAttr->y())); + std::shared_ptr aNormal = aNDir->dir(); + std::shared_ptr aStartPoint(aSketch->to3D(aStartAttr->x(), aStartAttr->y())); // compute and change the arc end point - boost::shared_ptr anEndAttr = boost::dynamic_pointer_cast< + std::shared_ptr anEndAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Arc::END_ID())); - boost::shared_ptr aCircleForArc( + std::shared_ptr aCircleForArc( new GeomAPI_Circ2d(aCenterAttr->pnt(), aStartAttr->pnt())); - boost::shared_ptr aProjection = aCircleForArc->project(anEndAttr->pnt()); + std::shared_ptr aProjection = aCircleForArc->project(anEndAttr->pnt()); if (aProjection && anEndAttr->pnt()->distance(aProjection) > tolerance) anEndAttr->setValue(aProjection); - boost::shared_ptr aEndPoint(aSketch->to3D(anEndAttr->x(), anEndAttr->y())); + std::shared_ptr aEndPoint(aSketch->to3D(anEndAttr->x(), anEndAttr->y())); - boost::shared_ptr aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc( + std::shared_ptr aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc( aCenter, aStartPoint, aEndPoint, aNormal); if (aCircleShape) { - boost::shared_ptr aConstr2 = document()->createConstruction( + std::shared_ptr aConstr2 = document()->createConstruction( data(), 1); aConstr2->setShape(aCircleShape); aConstr2->setIsInHistory(false); @@ -94,33 +94,33 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious) // if the feature is valid, the execute() method should be performed, AIS object is empty if (!isFeatureValid()) { // compute a circle point in 3D view - boost::shared_ptr aCenterAttr = boost::dynamic_pointer_cast< + std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Arc::CENTER_ID())); if (aCenterAttr->isInitialized()) { - boost::shared_ptr aCenter(aSketch->to3D(aCenterAttr->x(), aCenterAttr->y())); + std::shared_ptr aCenter(aSketch->to3D(aCenterAttr->x(), aCenterAttr->y())); - boost::shared_ptr aStartAttr = boost::dynamic_pointer_cast< + std::shared_ptr aStartAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Arc::START_ID())); if (aStartAttr->isInitialized()) { // make a visible circle - boost::shared_ptr aNDir = boost::dynamic_pointer_cast( + std::shared_ptr aNDir = std::dynamic_pointer_cast( aSketch->data()->attribute(SketchPlugin_Sketch::NORM_ID())); bool aHasPlane = aNDir && !(aNDir->x() == 0 && aNDir->y() == 0 && aNDir->z() == 0); if (aHasPlane) { - boost::shared_ptr aNormal = aNDir->dir(); - boost::shared_ptr aStartPoint(aSketch->to3D(aStartAttr->x(), aStartAttr->y())); - boost::shared_ptr aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc( + std::shared_ptr aNormal = aNDir->dir(); + std::shared_ptr aStartPoint(aSketch->to3D(aStartAttr->x(), aStartAttr->y())); + std::shared_ptr aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircleArc( aCenter, aStartPoint, aStartPoint, aNormal); if (aCircleShape) { - std::list > aShapes; + std::list > aShapes; // make a visible point - boost::shared_ptr aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter); + std::shared_ptr aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter); aShapes.push_back(aCenterPointShape); aShapes.push_back(aCircleShape); if (!aShapes.empty()) { - boost::shared_ptr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes); + std::shared_ptr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aShapes); AISObjectPtr anAIS = thePrevious; if (!anAIS) anAIS = AISObjectPtr(new GeomAPI_AISObject); @@ -138,39 +138,39 @@ AISObjectPtr SketchPlugin_Arc::getAISObject(AISObjectPtr thePrevious) void SketchPlugin_Arc::move(double theDeltaX, double theDeltaY) { - boost::shared_ptr aData = data(); + std::shared_ptr aData = data(); if (!aData->isValid()) return; - boost::shared_ptr aPoint1 = boost::dynamic_pointer_cast( + std::shared_ptr aPoint1 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Arc::CENTER_ID())); aPoint1->move(theDeltaX, theDeltaY); - boost::shared_ptr aPoint2 = boost::dynamic_pointer_cast( + std::shared_ptr aPoint2 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Arc::START_ID())); aPoint2->move(theDeltaX, theDeltaY); - boost::shared_ptr aPoint3 = boost::dynamic_pointer_cast( + std::shared_ptr aPoint3 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Arc::END_ID())); aPoint3->move(theDeltaX, theDeltaY); } -double SketchPlugin_Arc::distanceToPoint(const boost::shared_ptr& thePoint) +double SketchPlugin_Arc::distanceToPoint(const std::shared_ptr& thePoint) { double aDelta = 0; - boost::shared_ptr aData = data(); + std::shared_ptr aData = data(); - boost::shared_ptr aPoint1 = boost::dynamic_pointer_cast( + std::shared_ptr aPoint1 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Arc::CENTER_ID())); aDelta = aPoint1->pnt()->distance(thePoint); - boost::shared_ptr aPoint2 = boost::dynamic_pointer_cast( + std::shared_ptr aPoint2 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Arc::START_ID())); double aDistance = aPoint2->pnt()->distance(thePoint); if (aDelta < aDistance) aDelta = aDistance; - boost::shared_ptr aPoint3 = boost::dynamic_pointer_cast( + std::shared_ptr aPoint3 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Arc::END_ID())); aDistance = aPoint3->pnt()->distance(thePoint); if (aDelta < aDistance) @@ -185,11 +185,11 @@ bool SketchPlugin_Arc::isFixed() { bool SketchPlugin_Arc::isFeatureValid() { - boost::shared_ptr aCenterAttr = boost::dynamic_pointer_cast< + std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Arc::CENTER_ID())); - boost::shared_ptr aStartAttr = boost::dynamic_pointer_cast< + std::shared_ptr aStartAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Arc::START_ID())); - boost::shared_ptr anEndAttr = boost::dynamic_pointer_cast< + std::shared_ptr anEndAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Arc::END_ID())); return aCenterAttr->isInitialized() && aStartAttr->isInitialized() && anEndAttr->isInitialized(); diff --git a/src/SketchPlugin/SketchPlugin_Arc.h b/src/SketchPlugin/SketchPlugin_Arc.h index a60774336..3958adbd7 100644 --- a/src/SketchPlugin/SketchPlugin_Arc.h +++ b/src/SketchPlugin/SketchPlugin_Arc.h @@ -72,7 +72,7 @@ class SketchPlugin_Arc : public SketchPlugin_Feature, public GeomAPI_IPresentabl /// Return the distance between the feature and the point /// \param thePoint the point - virtual double distanceToPoint(const boost::shared_ptr& thePoint); + virtual double distanceToPoint(const std::shared_ptr& thePoint); /// Use plugin manager for features creation SketchPlugin_Arc(); diff --git a/src/SketchPlugin/SketchPlugin_Circle.cpp b/src/SketchPlugin/SketchPlugin_Circle.cpp index a65a6b7c6..209f9744a 100644 --- a/src/SketchPlugin/SketchPlugin_Circle.cpp +++ b/src/SketchPlugin/SketchPlugin_Circle.cpp @@ -36,37 +36,37 @@ void SketchPlugin_Circle::execute() { SketchPlugin_Sketch* aSketch = sketch(); if (aSketch) { - std::list > aShapes; + std::list > aShapes; // compute a circle point in 3D view - boost::shared_ptr aCenterAttr = boost::dynamic_pointer_cast< + std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(CENTER_ID())); AttributeDoublePtr aRadiusAttr = - boost::dynamic_pointer_cast(data()->attribute(RADIUS_ID())); + std::dynamic_pointer_cast(data()->attribute(RADIUS_ID())); if (aCenterAttr->isInitialized() && aRadiusAttr->isInitialized()) { - boost::shared_ptr aCenter(aSketch->to3D(aCenterAttr->x(), aCenterAttr->y())); + std::shared_ptr aCenter(aSketch->to3D(aCenterAttr->x(), aCenterAttr->y())); //std::cout<<"Execute circle "<x()<<" "<y()<<" "<z()< aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter); - boost::shared_ptr aConstr1 = document()->createConstruction( + std::shared_ptr aCenterPointShape = GeomAlgoAPI_PointBuilder::point(aCenter); + std::shared_ptr aConstr1 = document()->createConstruction( data(), 0); aConstr1->setShape(aCenterPointShape); aConstr1->setIsInHistory(false); setResult(aConstr1, 0); // make a visible circle - boost::shared_ptr aNDir = boost::dynamic_pointer_cast( + std::shared_ptr aNDir = std::dynamic_pointer_cast( aSketch->data()->attribute(SketchPlugin_Sketch::NORM_ID())); bool aHasPlane = aNDir && !(aNDir->x() == 0 && aNDir->y() == 0 && aNDir->z() == 0); if (aHasPlane) { - boost::shared_ptr aNormal(new GeomAPI_Dir(aNDir->x(), aNDir->y(), aNDir->z())); + std::shared_ptr aNormal(new GeomAPI_Dir(aNDir->x(), aNDir->y(), aNDir->z())); // compute the circle radius double aRadius = aRadiusAttr->value(); - boost::shared_ptr aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircle( + std::shared_ptr aCircleShape = GeomAlgoAPI_EdgeBuilder::lineCircle( aCenter, aNormal, aRadius); aShapes.push_back(aCircleShape); - boost::shared_ptr aConstr2 = document()->createConstruction( + std::shared_ptr aConstr2 = document()->createConstruction( data(), 1); aConstr2->setShape(aCircleShape); aConstr2->setIsInHistory(false); @@ -78,20 +78,20 @@ void SketchPlugin_Circle::execute() void SketchPlugin_Circle::move(double theDeltaX, double theDeltaY) { - boost::shared_ptr aData = data(); + std::shared_ptr aData = data(); if (!aData->isValid()) return; - boost::shared_ptr aPoint1 = boost::dynamic_pointer_cast( + std::shared_ptr aPoint1 = std::dynamic_pointer_cast( aData->attribute(CENTER_ID())); aPoint1->move(theDeltaX, theDeltaY); } -double SketchPlugin_Circle::distanceToPoint(const boost::shared_ptr& thePoint) +double SketchPlugin_Circle::distanceToPoint(const std::shared_ptr& thePoint) { - boost::shared_ptr aData = data(); - boost::shared_ptr aPoint = - boost::dynamic_pointer_cast(aData->attribute(CENTER_ID())); + std::shared_ptr aData = data(); + std::shared_ptr aPoint = + std::dynamic_pointer_cast(aData->attribute(CENTER_ID())); return aPoint->pnt()->distance(thePoint); } @@ -102,14 +102,14 @@ bool SketchPlugin_Circle::isFixed() { void SketchPlugin_Circle::attributeChanged() { static bool myIsUpdated = false; // to avoid infinitive cycle on attrubtes change - boost::shared_ptr aSelection = data()->selection(EXTERNAL_ID())->value(); + std::shared_ptr aSelection = data()->selection(EXTERNAL_ID())->value(); // update arguments due to the selection value if (aSelection && !aSelection->isNull() && aSelection->isEdge() && !myIsUpdated) { myIsUpdated = true; - boost::shared_ptr anEdge( new GeomAPI_Edge(aSelection)); - boost::shared_ptr aCirc = anEdge->circle(); - boost::shared_ptr aCenterAttr = - boost::dynamic_pointer_cast(attribute(CENTER_ID())); + std::shared_ptr anEdge( new GeomAPI_Edge(aSelection)); + std::shared_ptr aCirc = anEdge->circle(); + std::shared_ptr aCenterAttr = + std::dynamic_pointer_cast(attribute(CENTER_ID())); aCenterAttr->setValue(sketch()->to2D(aCirc->center())); real(RADIUS_ID())->setValue(aCirc->radius()); myIsUpdated = false; diff --git a/src/SketchPlugin/SketchPlugin_Circle.h b/src/SketchPlugin/SketchPlugin_Circle.h index 70ee0c892..8ceef34eb 100644 --- a/src/SketchPlugin/SketchPlugin_Circle.h +++ b/src/SketchPlugin/SketchPlugin_Circle.h @@ -74,7 +74,7 @@ class SketchPlugin_Circle : public SketchPlugin_Feature //, public GeomAPI_IPre /// Return the distance between the feature and the point /// \param thePoint the point - virtual double distanceToPoint(const boost::shared_ptr& thePoint); + virtual double distanceToPoint(const std::shared_ptr& thePoint); /// Called on change of any argument-attribute of this object SKETCHPLUGIN_EXPORT virtual void attributeChanged(); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintBase.cpp b/src/SketchPlugin/SketchPlugin_ConstraintBase.cpp index f8ecab365..3dd0b9224 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintBase.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintBase.cpp @@ -20,7 +20,7 @@ void SketchPlugin_ConstraintBase::move(const double theDeltaX, const double theD } double SketchPlugin_ConstraintBase::distanceToPoint( - const boost::shared_ptr& thePoint) + const std::shared_ptr& thePoint) { return 0; } diff --git a/src/SketchPlugin/SketchPlugin_ConstraintBase.h b/src/SketchPlugin/SketchPlugin_ConstraintBase.h index b027076cc..7299aabe0 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintBase.h +++ b/src/SketchPlugin/SketchPlugin_ConstraintBase.h @@ -51,7 +51,7 @@ class SketchPlugin_ConstraintBase : public SketchPlugin_Constraint, public GeomA /// Return the distance between the feature and the point /// \param thePoint the point - virtual double distanceToPoint(const boost::shared_ptr& thePoint); + virtual double distanceToPoint(const std::shared_ptr& thePoint); protected: /// \brief Use plugin manager for features creation diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index 89faf4208..611d85a0f 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -32,8 +32,8 @@ void SketchPlugin_ConstraintDistance::initAttributes() //************************************************************************************* void SketchPlugin_ConstraintDistance::execute() { - boost::shared_ptr aData = data(); - AttributeDoublePtr anAttrValue = boost::dynamic_pointer_cast( + std::shared_ptr aData = data(); + AttributeDoublePtr anAttrValue = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Constraint::VALUE())); if(anAttrValue->isInitialized()) @@ -51,29 +51,29 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi if (!sketch()) return thePrevious; - boost::shared_ptr aPlane = sketch()->plane(); + std::shared_ptr aPlane = sketch()->plane(); DataPtr aData = data(); - boost::shared_ptr aPoint_A = getFeaturePoint( + std::shared_ptr aPoint_A = getFeaturePoint( aData, SketchPlugin_Constraint::ENTITY_A()); - boost::shared_ptr aPoint_B = getFeaturePoint( + std::shared_ptr aPoint_B = getFeaturePoint( aData, SketchPlugin_Constraint::ENTITY_B()); - boost::shared_ptr aPnt_A; - boost::shared_ptr aPnt_B; + std::shared_ptr aPnt_A; + std::shared_ptr aPnt_B; if (aPoint_A && aPoint_B) { aPnt_A = aPoint_A->pnt(); aPnt_B = aPoint_B->pnt(); } else if (!aPoint_A && aPoint_B) { - boost::shared_ptr aLine = getFeatureLine( + std::shared_ptr aLine = getFeatureLine( aData, SketchPlugin_Constraint::ENTITY_A()); if (aLine) { aPnt_B = aPoint_B->pnt(); aPnt_A = getProjectionPoint(aLine, aPnt_B); } } else if (aPoint_A && !aPoint_B) { - boost::shared_ptr aLine = getFeatureLine( + std::shared_ptr aLine = getFeatureLine( aData, SketchPlugin_Constraint::ENTITY_B()); if (aLine) { aPnt_A = aPoint_A->pnt(); @@ -83,23 +83,23 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi if (!aPnt_A || !aPnt_B) return AISObjectPtr(); - boost::shared_ptr aFlyOutAttr = boost::dynamic_pointer_cast< + std::shared_ptr aFlyOutAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); - boost::shared_ptr aPoint1 = sketch()->to3D(aPnt_A->x(), aPnt_A->y()); - boost::shared_ptr aPoint2 = sketch()->to3D(aPnt_B->x(), aPnt_B->y()); - boost::shared_ptr aFlyoutPnt = boost::shared_ptr(); + std::shared_ptr aPoint1 = sketch()->to3D(aPnt_A->x(), aPnt_A->y()); + std::shared_ptr aPoint2 = sketch()->to3D(aPnt_B->x(), aPnt_B->y()); + std::shared_ptr aFlyoutPnt = std::shared_ptr(); if(aFlyOutAttr->isInitialized()) { aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()); } else { - boost::shared_ptr aLine = boost::shared_ptr(new GeomAPI_Lin2d(aPnt_A, aPnt_B)); + std::shared_ptr aLine = std::shared_ptr(new GeomAPI_Lin2d(aPnt_A, aPnt_B)); double aDist = aPoint1->distance(aPoint2)/5.; - boost::shared_ptr aFPnt = aLine->shiftedLocation(aDist); + std::shared_ptr aFPnt = aLine->shiftedLocation(aDist); aFlyOutAttr->setValue(aFPnt); aFlyoutPnt = sketch()->to3D(aFPnt->x(), aFPnt->y()); } // value calculation - boost::shared_ptr aValueAttr = boost::dynamic_pointer_cast< + std::shared_ptr aValueAttr = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE())); double aValue = aValueAttr->value(); // Issue #196: checking the positivity of the distance constraint @@ -123,11 +123,11 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi //************************************************************************************* void SketchPlugin_ConstraintDistance::move(double theDeltaX, double theDeltaY) { - boost::shared_ptr aData = data(); + std::shared_ptr aData = data(); if (!aData->isValid()) return; - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aPoint = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); aPoint->move(theDeltaX, theDeltaY); } @@ -136,23 +136,23 @@ double SketchPlugin_ConstraintDistance::calculateCurrentDistance() const { double aDistance = -1.; - boost::shared_ptr aData = data(); - boost::shared_ptr aPointA = + std::shared_ptr aData = data(); + std::shared_ptr aPointA = getFeaturePoint(aData, SketchPlugin_Constraint::ENTITY_A()); - boost::shared_ptr aPointB = + std::shared_ptr aPointB = getFeaturePoint(aData, SketchPlugin_Constraint::ENTITY_B()); if (aPointA && aPointB) { // both points aDistance = aPointA->pnt()->distance(aPointB->pnt()); } else { if (!aPointA && aPointB) { //Line and point - boost::shared_ptr aLine = + std::shared_ptr aLine = getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_A()); if (aLine) { aDistance = aLine->distanceToPoint(aPointB->pnt()); } } else if (aPointA && !aPointB) { // Point and line - boost::shared_ptr aLine = + std::shared_ptr aLine = getFeatureLine(aData, SketchPlugin_Constraint::ENTITY_B()); if (aLine) { aDistance = aLine->distanceToPoint(aPointA->pnt()); @@ -164,60 +164,60 @@ double SketchPlugin_ConstraintDistance::calculateCurrentDistance() const //************************************************************************************* -boost::shared_ptr getFeaturePoint(DataPtr theData, +std::shared_ptr getFeaturePoint(DataPtr theData, const std::string& theAttribute) { - boost::shared_ptr aPointAttr; + std::shared_ptr aPointAttr; if (!theData) return aPointAttr; FeaturePtr aFeature; - boost::shared_ptr anAttr = boost::dynamic_pointer_cast< + std::shared_ptr anAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute)); if (anAttr) aFeature = ModelAPI_Feature::feature(anAttr->object()); if (aFeature && aFeature->getKind() == SketchPlugin_Point::ID()) - aPointAttr = boost::dynamic_pointer_cast( + aPointAttr = std::dynamic_pointer_cast( aFeature->data()->attribute(SketchPlugin_Point::COORD_ID())); else if (aFeature && aFeature->getKind() == SketchPlugin_Circle::ID()) - aPointAttr = boost::dynamic_pointer_cast( + aPointAttr = std::dynamic_pointer_cast( aFeature->data()->attribute(SketchPlugin_Circle::CENTER_ID())); else if (anAttr->attr()) { - aPointAttr = boost::dynamic_pointer_cast(anAttr->attr()); + aPointAttr = std::dynamic_pointer_cast(anAttr->attr()); } return aPointAttr; } //************************************************************************************* -boost::shared_ptr getFeatureLine(DataPtr theData, +std::shared_ptr getFeatureLine(DataPtr theData, const std::string& theAttribute) { - boost::shared_ptr aLine; + std::shared_ptr aLine; if (!theData) return aLine; - boost::shared_ptr anAttr = boost::dynamic_pointer_cast< + std::shared_ptr anAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(theData->attribute(theAttribute)); if (anAttr) { FeaturePtr aFeature = ModelAPI_Feature::feature(anAttr->object()); if (aFeature && aFeature->getKind() == SketchPlugin_Line::ID()) { - aLine = boost::dynamic_pointer_cast(aFeature); + aLine = std::dynamic_pointer_cast(aFeature); } } return aLine; } //************************************************************************************* -boost::shared_ptr getProjectionPoint( - const boost::shared_ptr& theLine, - const boost::shared_ptr& thePoint) +std::shared_ptr getProjectionPoint( + const std::shared_ptr& theLine, + const std::shared_ptr& thePoint) { - boost::shared_ptr aData = theLine->data(); - boost::shared_ptr aPoint1 = boost::dynamic_pointer_cast( + std::shared_ptr aData = theLine->data(); + std::shared_ptr aPoint1 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Line::START_ID())); - boost::shared_ptr aPoint2 = boost::dynamic_pointer_cast( + std::shared_ptr aPoint2 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Line::END_ID())); GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y()); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.h b/src/SketchPlugin/SketchPlugin_ConstraintDistance.h index b5981d017..8ac80c313 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.h +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.h @@ -64,14 +64,14 @@ class SketchPlugin_ConstraintDistance : public SketchPlugin_ConstraintBase }; /// Obtain the point object from specified constraint parameter -boost::shared_ptr getFeaturePoint(DataPtr theData, +std::shared_ptr getFeaturePoint(DataPtr theData, const std::string& theAttribute); -boost::shared_ptr getFeatureLine(DataPtr theData, +std::shared_ptr getFeatureLine(DataPtr theData, const std::string& theAttribute); -boost::shared_ptr getProjectionPoint( - const boost::shared_ptr& theLine, - const boost::shared_ptr& thePoint); +std::shared_ptr getProjectionPoint( + const std::shared_ptr& theLine, + const std::shared_ptr& thePoint); #endif diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp index ff8a480b4..5b3d0f05f 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp @@ -31,19 +31,19 @@ void SketchPlugin_ConstraintLength::initAttributes() void SketchPlugin_ConstraintLength::execute() { - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A())); FeaturePtr aFeature = ModelAPI_Feature::feature(aRef->object()); if (aFeature) { // set length value - boost::shared_ptr aPoint1 = boost::dynamic_pointer_cast< + std::shared_ptr aPoint1 = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aFeature->data()->attribute(SketchPlugin_Line::START_ID())); - boost::shared_ptr aPoint2 = boost::dynamic_pointer_cast< + std::shared_ptr aPoint2 = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aFeature->data()->attribute(SketchPlugin_Line::END_ID())); double aLenght = aPoint1->pnt()->distance(aPoint2->pnt()); - boost::shared_ptr aValueAttr = boost::dynamic_pointer_cast< + std::shared_ptr aValueAttr = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE())); if(!aValueAttr->isInitialized()) { aValueAttr->setValue(aLenght); @@ -56,9 +56,9 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou if (!sketch()) return thePrevious; - boost::shared_ptr aPlane = sketch()->plane(); + std::shared_ptr aPlane = sketch()->plane(); - boost::shared_ptr anAttr = boost::dynamic_pointer_cast< + std::shared_ptr anAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A())); if (!anAttr) return thePrevious; @@ -66,30 +66,30 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou if (!aFeature || aFeature->getKind() != SketchPlugin_Line::ID()) return thePrevious; - boost::shared_ptr aFlyOutAttr = boost::dynamic_pointer_cast< + std::shared_ptr aFlyOutAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); DataPtr aData = aFeature->data(); - boost::shared_ptr aStartPoint = boost::dynamic_pointer_cast< + std::shared_ptr aStartPoint = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Line::START_ID())); - boost::shared_ptr anEndPoint = boost::dynamic_pointer_cast< + std::shared_ptr anEndPoint = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Line::END_ID())); - boost::shared_ptr aPoint1 = sketch()->to3D(aStartPoint->x(), aStartPoint->y()); - boost::shared_ptr aPoint2 = sketch()->to3D(anEndPoint->x(), anEndPoint->y()); - boost::shared_ptr aFlyoutPnt = boost::shared_ptr(); + std::shared_ptr aPoint1 = sketch()->to3D(aStartPoint->x(), aStartPoint->y()); + std::shared_ptr aPoint2 = sketch()->to3D(anEndPoint->x(), anEndPoint->y()); + std::shared_ptr aFlyoutPnt = std::shared_ptr(); if (aFlyOutAttr->isInitialized()) { aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()); } else { - boost::shared_ptr aLine = - boost::shared_ptr(new GeomAPI_Lin2d(aStartPoint->pnt(), anEndPoint->pnt())); + std::shared_ptr aLine = + std::shared_ptr(new GeomAPI_Lin2d(aStartPoint->pnt(), anEndPoint->pnt())); double aDist = aPoint1->distance(aPoint2)/5.; - boost::shared_ptr aFPnt = aLine->shiftedLocation(aDist); + std::shared_ptr aFPnt = aLine->shiftedLocation(aDist); aFlyOutAttr->setValue(aFPnt); aFlyoutPnt = sketch()->to3D(aFPnt->x(), aFPnt->y()); } // value calculation - boost::shared_ptr aValueAttr = boost::dynamic_pointer_cast< + std::shared_ptr aValueAttr = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE())); double aValue = aValueAttr->value(); @@ -106,11 +106,11 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou void SketchPlugin_ConstraintLength::move(double theDeltaX, double theDeltaY) { - boost::shared_ptr aData = data(); + std::shared_ptr aData = data(); if (!aData->isValid()) return; - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aPoint = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); aPoint->move(theDeltaX, theDeltaY); } diff --git a/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp b/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp index ae105caa3..a2f50adf7 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintParallel.cpp @@ -37,10 +37,10 @@ AISObjectPtr SketchPlugin_ConstraintParallel::getAISObject(AISObjectPtr thePrevi if (!sketch()) return thePrevious; - boost::shared_ptr aData = data(); - boost::shared_ptr anAttr1 = boost::dynamic_pointer_cast< + std::shared_ptr aData = data(); + std::shared_ptr anAttr1 = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_A())); - boost::shared_ptr anAttr2 = boost::dynamic_pointer_cast< + std::shared_ptr anAttr2 = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_B())); if (!anAttr1 || !anAttr1->isObject() || !anAttr2 || !anAttr2->isObject()) return thePrevious; @@ -48,32 +48,32 @@ AISObjectPtr SketchPlugin_ConstraintParallel::getAISObject(AISObjectPtr thePrevi FeaturePtr aFeature = ModelAPI_Feature::feature(anAttr1->object()); if (!aFeature) return thePrevious; - boost::shared_ptr aLine1Feature = - boost::dynamic_pointer_cast(aFeature); + std::shared_ptr aLine1Feature = + std::dynamic_pointer_cast(aFeature); aFeature = ModelAPI_Feature::feature(anAttr2->object()); if (!aFeature) return thePrevious; - boost::shared_ptr aLine2Feature = - boost::dynamic_pointer_cast(aFeature); + std::shared_ptr aLine2Feature = + std::dynamic_pointer_cast(aFeature); if (!aLine1Feature || !aLine2Feature) return thePrevious; - boost::shared_ptr aPlane = sketch()->plane(); - boost::shared_ptr aLine1, aLine2; - boost::shared_ptr aConst1 = boost::dynamic_pointer_cast< + std::shared_ptr aPlane = sketch()->plane(); + std::shared_ptr aLine1, aLine2; + std::shared_ptr aConst1 = std::dynamic_pointer_cast< ModelAPI_ResultConstruction>(anAttr1->object()); if (aConst1) aLine1 = aConst1->shape(); - boost::shared_ptr aConst2 = boost::dynamic_pointer_cast< + std::shared_ptr aConst2 = std::dynamic_pointer_cast< ModelAPI_ResultConstruction>(anAttr2->object()); if (aConst2) aLine2 = aConst2->shape(); - boost::shared_ptr aFlyoutAttr = boost::dynamic_pointer_cast< + std::shared_ptr aFlyoutAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); - boost::shared_ptr aFlyoutPnt = boost::shared_ptr();; + std::shared_ptr aFlyoutPnt = std::shared_ptr();; if(aFlyoutAttr->isInitialized()) { aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y()); } @@ -92,11 +92,11 @@ AISObjectPtr SketchPlugin_ConstraintParallel::getAISObject(AISObjectPtr thePrevi void SketchPlugin_ConstraintParallel::move(double theDeltaX, double theDeltaY) { - boost::shared_ptr aData = data(); + std::shared_ptr aData = data(); if (!aData->isValid()) return; - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aPoint = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); aPoint->move(theDeltaX, theDeltaY); } diff --git a/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp b/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp index 31772fb16..e4f396ab7 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.cpp @@ -36,10 +36,10 @@ AISObjectPtr SketchPlugin_ConstraintPerpendicular::getAISObject(AISObjectPtr the if (!sketch()) return thePrevious; - boost::shared_ptr aData = data(); - boost::shared_ptr anAttr1 = boost::dynamic_pointer_cast< + std::shared_ptr aData = data(); + std::shared_ptr anAttr1 = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_A())); - boost::shared_ptr anAttr2 = boost::dynamic_pointer_cast< + std::shared_ptr anAttr2 = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_B())); if (!anAttr1 || !anAttr1->isObject() || !anAttr2 || !anAttr2->isObject()) return thePrevious; @@ -47,25 +47,25 @@ AISObjectPtr SketchPlugin_ConstraintPerpendicular::getAISObject(AISObjectPtr the FeaturePtr aFeature = ModelAPI_Feature::feature(anAttr1->object()); if (!aFeature) return thePrevious; - boost::shared_ptr aLine1Feature = - boost::dynamic_pointer_cast(aFeature); + std::shared_ptr aLine1Feature = + std::dynamic_pointer_cast(aFeature); aFeature = ModelAPI_Feature::feature(anAttr2->object()); if (!aFeature) return thePrevious; - boost::shared_ptr aLine2Feature = - boost::dynamic_pointer_cast(aFeature); + std::shared_ptr aLine2Feature = + std::dynamic_pointer_cast(aFeature); if (!aLine1Feature || !aLine2Feature) return thePrevious; - boost::shared_ptr aPlane = sketch()->plane(); - boost::shared_ptr aLine1, aLine2; - boost::shared_ptr aConst1 = boost::dynamic_pointer_cast< + std::shared_ptr aPlane = sketch()->plane(); + std::shared_ptr aLine1, aLine2; + std::shared_ptr aConst1 = std::dynamic_pointer_cast< ModelAPI_ResultConstruction>(anAttr1->object()); if (aConst1) aLine1 = aConst1->shape(); - boost::shared_ptr aConst2 = boost::dynamic_pointer_cast< + std::shared_ptr aConst2 = std::dynamic_pointer_cast< ModelAPI_ResultConstruction>(anAttr2->object()); if (aConst2) aLine2 = aConst2->shape(); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp index fd429a544..8da7b3606 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp @@ -34,26 +34,26 @@ void SketchPlugin_ConstraintRadius::initAttributes() void SketchPlugin_ConstraintRadius::execute() { - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A())); FeaturePtr aFeature = ModelAPI_Feature::feature(aRef->object()); if (aFeature) { double aRadius = 0; - boost::shared_ptr aData = aFeature->data(); + std::shared_ptr aData = aFeature->data(); if (aFeature->getKind() == SketchPlugin_Circle::ID()) { - AttributeDoublePtr anAttribute = boost::dynamic_pointer_cast( + AttributeDoublePtr anAttribute = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Circle::RADIUS_ID())); if (anAttribute) aRadius = anAttribute->value(); } else if (aFeature->getKind() == SketchPlugin_Arc::ID()) { - boost::shared_ptr aCenterAttr = boost::dynamic_pointer_cast< + std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Arc::CENTER_ID())); - boost::shared_ptr aStartAttr = boost::dynamic_pointer_cast< + std::shared_ptr aStartAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Arc::START_ID())); if (aCenterAttr && aStartAttr) aRadius = aCenterAttr->pnt()->distance(aStartAttr->pnt()); } - boost::shared_ptr aValueAttr = boost::dynamic_pointer_cast< + std::shared_ptr aValueAttr = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(data()->attribute(SketchPlugin_Constraint::VALUE())); if(!aValueAttr->isInitialized()) { aValueAttr->setValue(aRadius); @@ -66,8 +66,8 @@ AISObjectPtr SketchPlugin_ConstraintRadius::getAISObject(AISObjectPtr thePreviou if (!sketch()) return thePrevious; - boost::shared_ptr aData = data(); - boost::shared_ptr anAttr = boost::dynamic_pointer_cast< + std::shared_ptr aData = data(); + std::shared_ptr anAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_A())); if (!anAttr) return thePrevious; @@ -77,53 +77,53 @@ AISObjectPtr SketchPlugin_ConstraintRadius::getAISObject(AISObjectPtr thePreviou return thePrevious; // Flyout point - boost::shared_ptr aFlyoutAttr = boost::dynamic_pointer_cast< + std::shared_ptr aFlyoutAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); - boost::shared_ptr aFlyoutPnt; + std::shared_ptr aFlyoutPnt; if (aFlyoutAttr->isInitialized()) { aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y()); } // Prepare a circle aData = aFeature->data(); - boost::shared_ptr aCenterAttr; + std::shared_ptr aCenterAttr; double aRadius; if (aKind == SketchPlugin_Circle::ID()) { - aCenterAttr = boost::dynamic_pointer_cast( + aCenterAttr = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Circle::CENTER_ID())); - AttributeDoublePtr aCircRadius = boost::dynamic_pointer_cast( + AttributeDoublePtr aCircRadius = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Circle::RADIUS_ID())); aRadius = aCircRadius->value(); if (!aFlyoutPnt) { double aShift = aRadius * 1.1; - boost::shared_ptr aPnt = aCenterAttr->pnt(); - boost::shared_ptr aFPnt = - boost::shared_ptr(new GeomAPI_Pnt2d(aPnt->x() + aShift, aPnt->y() + aShift)); + std::shared_ptr aPnt = aCenterAttr->pnt(); + std::shared_ptr aFPnt = + std::shared_ptr(new GeomAPI_Pnt2d(aPnt->x() + aShift, aPnt->y() + aShift)); aFlyoutAttr->setValue(aFPnt); aFlyoutPnt = sketch()->to3D(aFPnt->x(), aFPnt->y()); } } else if (aKind == SketchPlugin_Arc::ID()) { - aCenterAttr = boost::dynamic_pointer_cast( + aCenterAttr = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Arc::CENTER_ID())); - boost::shared_ptr aStartAttr = boost::dynamic_pointer_cast< + std::shared_ptr aStartAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Arc::START_ID())); aRadius = aCenterAttr->pnt()->distance(aStartAttr->pnt()); if (!aFlyoutPnt) { - boost::shared_ptr aStartAttr = boost::dynamic_pointer_cast< + std::shared_ptr aStartAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Arc::START_ID())); aFlyoutAttr->setValue(aStartAttr->pnt()); aFlyoutPnt = sketch()->to3D(aStartAttr->pnt()->x(), aStartAttr->pnt()->y()); } } - boost::shared_ptr aCenter = sketch()->to3D(aCenterAttr->x(), aCenterAttr->y()); - boost::shared_ptr aNDir = boost::dynamic_pointer_cast( + std::shared_ptr aCenter = sketch()->to3D(aCenterAttr->x(), aCenterAttr->y()); + std::shared_ptr aNDir = std::dynamic_pointer_cast( sketch()->data()->attribute(SketchPlugin_Sketch::NORM_ID())); - boost::shared_ptr aNormal = aNDir->dir(); - boost::shared_ptr aCircle(new GeomAPI_Circ(aCenter, aNormal, aRadius)); + std::shared_ptr aNormal = aNDir->dir(); + std::shared_ptr aCircle(new GeomAPI_Circ(aCenter, aNormal, aRadius)); // Value - boost::shared_ptr aValueAttr = boost::dynamic_pointer_cast< + std::shared_ptr aValueAttr = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE())); double aValue = aRadius; if (aValueAttr && aValueAttr->isInitialized()) @@ -142,11 +142,11 @@ AISObjectPtr SketchPlugin_ConstraintRadius::getAISObject(AISObjectPtr thePreviou void SketchPlugin_ConstraintRadius::move(double theDeltaX, double theDeltaY) { - boost::shared_ptr aData = data(); + std::shared_ptr aData = data(); if (!aData->isValid()) return; - boost::shared_ptr aRef = boost::dynamic_pointer_cast< + std::shared_ptr aRef = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(data()->attribute(SketchPlugin_Constraint::ENTITY_A())); FeaturePtr aFeature = ModelAPI_Feature::feature(aRef->object()); if (!aFeature) @@ -156,21 +156,21 @@ void SketchPlugin_ConstraintRadius::move(double theDeltaX, double theDeltaY) aCenterAttrName = SketchPlugin_Circle::CENTER_ID(); else if (aFeature->getKind() == SketchPlugin_Arc::ID()) aCenterAttrName = SketchPlugin_Arc::CENTER_ID(); - boost::shared_ptr aCenterAttr = boost::dynamic_pointer_cast< + std::shared_ptr aCenterAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aFeature->data()->attribute(aCenterAttrName)); - boost::shared_ptr aCenter = aCenterAttr->pnt(); + std::shared_ptr aCenter = aCenterAttr->pnt(); // The specified delta applied on the circle curve, // so it will be scaled due to distance between flyout and center points - boost::shared_ptr aFlyoutAttr = boost::dynamic_pointer_cast< + std::shared_ptr aFlyoutAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); - boost::shared_ptr aFlyout = aFlyoutAttr->pnt(); + std::shared_ptr aFlyout = aFlyoutAttr->pnt(); - boost::shared_ptr aRadius = boost::dynamic_pointer_cast< + std::shared_ptr aRadius = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE())); double aScale = aFlyout->distance(aCenter) / aRadius->value(); - boost::shared_ptr aCircle(new GeomAPI_Circ2d(aCenter, aFlyout)); + std::shared_ptr aCircle(new GeomAPI_Circ2d(aCenter, aFlyout)); aFlyout->setX(aFlyout->x() + aScale * theDeltaX); aFlyout->setY(aFlyout->y() + aScale * theDeltaY); aFlyout = aCircle->project(aFlyout); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp index 847ecfc86..7653eb59b 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRigid.cpp @@ -28,28 +28,28 @@ AISObjectPtr SketchPlugin_ConstraintRigid::getAISObject(AISObjectPtr thePrevious if (!sketch()) return thePrevious; - boost::shared_ptr aData = data(); - boost::shared_ptr anAttr = boost::dynamic_pointer_cast< + std::shared_ptr aData = data(); + std::shared_ptr anAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(SketchPlugin_Constraint::ENTITY_A())); if (!anAttr /*|| !anAttr->isObject()*/) return thePrevious; - boost::shared_ptr aShape; + std::shared_ptr aShape; if (anAttr->isObject()) { - boost::shared_ptr aConst; - aConst = boost::dynamic_pointer_cast(anAttr->object()); + std::shared_ptr aConst; + aConst = std::dynamic_pointer_cast(anAttr->object()); if (!aConst) return thePrevious; aShape = aConst->shape(); } else { - boost::shared_ptr aPointAttr = - boost::dynamic_pointer_cast(anAttr->attr()); + std::shared_ptr aPointAttr = + std::dynamic_pointer_cast(anAttr->attr()); if (!aPointAttr) return thePrevious; - boost::shared_ptr aPoint(sketch()->to3D(aPointAttr->x(), aPointAttr->y())); + std::shared_ptr aPoint(sketch()->to3D(aPointAttr->x(), aPointAttr->y())); aShape = GeomAlgoAPI_PointBuilder::point(aPoint); } @@ -57,7 +57,7 @@ AISObjectPtr SketchPlugin_ConstraintRigid::getAISObject(AISObjectPtr thePrevious if (!anAIS) anAIS = AISObjectPtr(new GeomAPI_AISObject); - boost::shared_ptr aPlane = sketch()->plane(); + std::shared_ptr aPlane = sketch()->plane(); anAIS->createFixed(aShape, aPlane); // Set color from preferences diff --git a/src/SketchPlugin/SketchPlugin_Feature.cpp b/src/SketchPlugin/SketchPlugin_Feature.cpp index 2d46d8ca1..42c5956b8 100644 --- a/src/SketchPlugin/SketchPlugin_Feature.cpp +++ b/src/SketchPlugin/SketchPlugin_Feature.cpp @@ -18,8 +18,8 @@ SketchPlugin_Sketch* SketchPlugin_Feature::sketch() const std::set& aBackRefs = data()->refsToMe(); std::set::const_iterator aBackRef = aBackRefs.begin(); for(; aBackRef != aBackRefs.end(); aBackRef++) { - boost::shared_ptr aSketch = - boost::dynamic_pointer_cast((*aBackRef)->owner()); + std::shared_ptr aSketch = + std::dynamic_pointer_cast((*aBackRef)->owner()); if (aSketch) { mySketch = aSketch.get(); break; @@ -29,13 +29,13 @@ SketchPlugin_Sketch* SketchPlugin_Feature::sketch() return mySketch; } -AISObjectPtr SketchPlugin_Feature::simpleAISObject(boost::shared_ptr theRes, +AISObjectPtr SketchPlugin_Feature::simpleAISObject(std::shared_ptr theRes, AISObjectPtr thePrevious) { - boost::shared_ptr aConstr = boost::dynamic_pointer_cast< + std::shared_ptr aConstr = std::dynamic_pointer_cast< ModelAPI_ResultConstruction>(theRes); - boost::shared_ptr aPreview; + std::shared_ptr aPreview; if (aConstr) aPreview = aConstr->shape(); diff --git a/src/SketchPlugin/SketchPlugin_Feature.h b/src/SketchPlugin/SketchPlugin_Feature.h index 2f4c3aaf1..5bd3814b4 100644 --- a/src/SketchPlugin/SketchPlugin_Feature.h +++ b/src/SketchPlugin/SketchPlugin_Feature.h @@ -24,7 +24,7 @@ class SketchPlugin_Feature : public ModelAPI_Feature { public: /// Simple creation of interactive object by the result of the object - static AISObjectPtr simpleAISObject(boost::shared_ptr theRes, + static AISObjectPtr simpleAISObject(std::shared_ptr theRes, AISObjectPtr thePrevious); /// Reference to the external edge or vertex as a AttributeSelection @@ -47,7 +47,7 @@ class SketchPlugin_Feature : public ModelAPI_Feature /// Return the distance between the feature and the point /// \param thePoint the point - virtual double distanceToPoint(const boost::shared_ptr& thePoint) = 0; + virtual double distanceToPoint(const std::shared_ptr& thePoint) = 0; /// Construction result is allways recomuted on the fly SKETCHPLUGIN_EXPORT virtual bool isPersistentResult() {return false;} @@ -77,7 +77,7 @@ protected: friend class SketchPlugin_Sketch; private: - boost::shared_ptr myPreview; ///< the preview shape + std::shared_ptr myPreview; ///< the preview shape SketchPlugin_Sketch* mySketch; /// sketch that contains this feature }; diff --git a/src/SketchPlugin/SketchPlugin_Line.cpp b/src/SketchPlugin/SketchPlugin_Line.cpp index 501478a32..2cba979ce 100644 --- a/src/SketchPlugin/SketchPlugin_Line.cpp +++ b/src/SketchPlugin/SketchPlugin_Line.cpp @@ -36,20 +36,20 @@ void SketchPlugin_Line::execute() SketchPlugin_Sketch* aSketch = sketch(); if (aSketch) { // compute a start point in 3D view - boost::shared_ptr aStartAttr = boost::dynamic_pointer_cast< + std::shared_ptr aStartAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(START_ID())); // compute an end point in 3D view - boost::shared_ptr anEndAttr = boost::dynamic_pointer_cast< + std::shared_ptr anEndAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(END_ID())); if (aStartAttr->isInitialized() && anEndAttr->isInitialized()) { - boost::shared_ptr aStart(aSketch->to3D(aStartAttr->x(), aStartAttr->y())); - boost::shared_ptr anEnd(aSketch->to3D(anEndAttr->x(), anEndAttr->y())); + std::shared_ptr aStart(aSketch->to3D(aStartAttr->x(), aStartAttr->y())); + std::shared_ptr anEnd(aSketch->to3D(anEndAttr->x(), anEndAttr->y())); //std::cout<<"Execute line "<x()<<" "<y()<<" "<z()<<" - " // <x()<<" "<y()<<" "<z()< anEdge = GeomAlgoAPI_EdgeBuilder::line(aStart, anEnd); + std::shared_ptr anEdge = GeomAlgoAPI_EdgeBuilder::line(aStart, anEnd); // store the result - boost::shared_ptr aConstr = document()->createConstruction( + std::shared_ptr aConstr = document()->createConstruction( data()); aConstr->setShape(anEdge); aConstr->setIsInHistory(false); @@ -60,33 +60,33 @@ void SketchPlugin_Line::execute() void SketchPlugin_Line::move(double theDeltaX, double theDeltaY) { - boost::shared_ptr aData = data(); + std::shared_ptr aData = data(); if (!aData->isValid()) return; - boost::shared_ptr aPoint1 = boost::dynamic_pointer_cast + std::shared_ptr aPoint1 = std::dynamic_pointer_cast (aData->attribute(START_ID())); aPoint1->move(theDeltaX, theDeltaY); - boost::shared_ptr aPoint2 = boost::dynamic_pointer_cast + std::shared_ptr aPoint2 = std::dynamic_pointer_cast (aData->attribute(END_ID())); aPoint2->move(theDeltaX, theDeltaY); } -double SketchPlugin_Line::distanceToPoint(const boost::shared_ptr& thePoint) +double SketchPlugin_Line::distanceToPoint(const std::shared_ptr& thePoint) { double aDelta = 0; - boost::shared_ptr aData = data(); - boost::shared_ptr aPoint1 = - boost::dynamic_pointer_cast(aData->attribute(START_ID())); - boost::shared_ptr aPoint2 = - boost::dynamic_pointer_cast(aData->attribute(END_ID())); + std::shared_ptr aData = data(); + std::shared_ptr aPoint1 = + std::dynamic_pointer_cast(aData->attribute(START_ID())); + std::shared_ptr aPoint2 = + std::dynamic_pointer_cast(aData->attribute(END_ID())); GeomAPI_Lin2d aLin2d(aPoint1->x(), aPoint1->y(), aPoint2->x(), aPoint2->y()); if (false/*projection*/) { // TODO: if it has not been necessary, remove this block - boost::shared_ptr aResult = aLin2d.project(thePoint); + std::shared_ptr aResult = aLin2d.project(thePoint); aDelta = aResult->distance(thePoint); } else { // distance aDelta = aLin2d.distance(thePoint); @@ -101,16 +101,16 @@ bool SketchPlugin_Line::isFixed() { void SketchPlugin_Line::attributeChanged() { static bool myIsUpdated = false; // to avoid infinitive cycle on attrubtes change - boost::shared_ptr aSelection = data()->selection(EXTERNAL_ID())->value(); + std::shared_ptr aSelection = data()->selection(EXTERNAL_ID())->value(); // update arguments due to the selection value if (aSelection && !aSelection->isNull() && aSelection->isEdge() && !myIsUpdated) { myIsUpdated = true; - boost::shared_ptr anEdge( new GeomAPI_Edge(aSelection)); - boost::shared_ptr aStartAttr = - boost::dynamic_pointer_cast(attribute(START_ID())); + std::shared_ptr anEdge( new GeomAPI_Edge(aSelection)); + std::shared_ptr aStartAttr = + std::dynamic_pointer_cast(attribute(START_ID())); aStartAttr->setValue(sketch()->to2D(anEdge->firstPoint())); - boost::shared_ptr anEndAttr = - boost::dynamic_pointer_cast(attribute(END_ID())); + std::shared_ptr anEndAttr = + std::dynamic_pointer_cast(attribute(END_ID())); anEndAttr->setValue(sketch()->to2D(anEdge->lastPoint())); myIsUpdated = false; } diff --git a/src/SketchPlugin/SketchPlugin_Line.h b/src/SketchPlugin/SketchPlugin_Line.h index 3943eafd3..a9e3e606c 100644 --- a/src/SketchPlugin/SketchPlugin_Line.h +++ b/src/SketchPlugin/SketchPlugin_Line.h @@ -65,7 +65,7 @@ class SketchPlugin_Line : public SketchPlugin_Feature /// Return the distance between the feature and the point /// \param thePoint the point - virtual double distanceToPoint(const boost::shared_ptr& thePoint); + virtual double distanceToPoint(const std::shared_ptr& thePoint); /// Called on change of any argument-attribute of this object SKETCHPLUGIN_EXPORT virtual void attributeChanged(); diff --git a/src/SketchPlugin/SketchPlugin_Point.cpp b/src/SketchPlugin/SketchPlugin_Point.cpp index 7cbdb647c..cd862a6ad 100644 --- a/src/SketchPlugin/SketchPlugin_Point.cpp +++ b/src/SketchPlugin/SketchPlugin_Point.cpp @@ -34,13 +34,13 @@ void SketchPlugin_Point::execute() SketchPlugin_Sketch* aSketch = sketch(); if (aSketch) { // compute a point in 3D view - boost::shared_ptr aPoint = - boost::dynamic_pointer_cast( + std::shared_ptr aPoint = + std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Point::COORD_ID())); - boost::shared_ptr aPoint3D(aSketch->to3D(aPoint->x(), aPoint->y())); + std::shared_ptr aPoint3D(aSketch->to3D(aPoint->x(), aPoint->y())); // make a visible point - boost::shared_ptr aPointShape = GeomAlgoAPI_PointBuilder::point(aPoint3D); - boost::shared_ptr aConstr = document()->createConstruction(data()); + std::shared_ptr aPointShape = GeomAlgoAPI_PointBuilder::point(aPoint3D); + std::shared_ptr aConstr = document()->createConstruction(data()); aConstr->setShape(aPointShape); aConstr->setIsInHistory(false); setResult(aConstr); @@ -49,19 +49,19 @@ void SketchPlugin_Point::execute() void SketchPlugin_Point::move(double theDeltaX, double theDeltaY) { - boost::shared_ptr aData = data(); + std::shared_ptr aData = data(); if (!aData->isValid()) return; - boost::shared_ptr aPoint1 = boost::dynamic_pointer_cast( + std::shared_ptr aPoint1 = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Point::COORD_ID())); aPoint1->move(theDeltaX, theDeltaY); } -double SketchPlugin_Point::distanceToPoint(const boost::shared_ptr& thePoint) +double SketchPlugin_Point::distanceToPoint(const std::shared_ptr& thePoint) { - boost::shared_ptr aData = data(); - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aData = data(); + std::shared_ptr aPoint = std::dynamic_pointer_cast( aData->attribute(SketchPlugin_Point::COORD_ID())); return aPoint->pnt()->distance(thePoint); diff --git a/src/SketchPlugin/SketchPlugin_Point.h b/src/SketchPlugin/SketchPlugin_Point.h index 48415b18c..50eb4591d 100644 --- a/src/SketchPlugin/SketchPlugin_Point.h +++ b/src/SketchPlugin/SketchPlugin_Point.h @@ -58,7 +58,7 @@ class SketchPlugin_Point : public SketchPlugin_Feature /// Return the distance between the feature and the point /// \param thePoint the point - virtual double distanceToPoint(const boost::shared_ptr& thePoint); + virtual double distanceToPoint(const std::shared_ptr& thePoint); /// Use plugin manager for features creation SketchPlugin_Point(); diff --git a/src/SketchPlugin/SketchPlugin_ResultValidators.cpp b/src/SketchPlugin/SketchPlugin_ResultValidators.cpp index 0e39fcb03..043f45a0d 100644 --- a/src/SketchPlugin/SketchPlugin_ResultValidators.cpp +++ b/src/SketchPlugin/SketchPlugin_ResultValidators.cpp @@ -10,7 +10,7 @@ ResultPtr result(const ObjectPtr theObject) { - return boost::dynamic_pointer_cast(theObject); + return std::dynamic_pointer_cast(theObject); } bool SketchPlugin_ResultPointValidator::isValid(const ObjectPtr theObject) const @@ -18,7 +18,7 @@ bool SketchPlugin_ResultPointValidator::isValid(const ObjectPtr theObject) const ResultPtr aResult = result(theObject); if (!aResult) return false; - boost::shared_ptr aShape = ModelAPI_Tools::shape(aResult); + std::shared_ptr aShape = ModelAPI_Tools::shape(aResult); return aShape && aShape->isVertex(); } @@ -27,7 +27,7 @@ bool SketchPlugin_ResultLineValidator::isValid(const ObjectPtr theObject) const ResultPtr aResult = result(theObject); if (!aResult) return false; - boost::shared_ptr aShape = ModelAPI_Tools::shape(aResult); + std::shared_ptr aShape = ModelAPI_Tools::shape(aResult); return aShape && aShape->isEdge() && GeomAPI_Curve(aShape).isLine(); } @@ -36,6 +36,6 @@ bool SketchPlugin_ResultArcValidator::isValid(const ObjectPtr theObject) const ResultPtr aResult = result(theObject); if (!aResult) return false; - boost::shared_ptr aShape = ModelAPI_Tools::shape(aResult); + std::shared_ptr aShape = ModelAPI_Tools::shape(aResult); return aShape && aShape->isEdge() && GeomAPI_Curve(aShape).isCircle(); } diff --git a/src/SketchPlugin/SketchPlugin_Sketch.cpp b/src/SketchPlugin/SketchPlugin_Sketch.cpp index e1ac62b0c..4902305a8 100644 --- a/src/SketchPlugin/SketchPlugin_Sketch.cpp +++ b/src/SketchPlugin/SketchPlugin_Sketch.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -56,16 +56,16 @@ void SketchPlugin_Sketch::execute() { if (!data()->isValid()) return; - boost::shared_ptr aRefList = boost::dynamic_pointer_cast< + std::shared_ptr aRefList = std::dynamic_pointer_cast< ModelAPI_AttributeRefList>(data()->attribute(SketchPlugin_Sketch::FEATURES_ID())); - boost::shared_ptr anOrigin = boost::dynamic_pointer_cast( + std::shared_ptr anOrigin = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::ORIGIN_ID())); - boost::shared_ptr aDirX = boost::dynamic_pointer_cast( + std::shared_ptr aDirX = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::DIRX_ID())); - boost::shared_ptr aDirY = boost::dynamic_pointer_cast( + std::shared_ptr aDirY = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::DIRY_ID())); - boost::shared_ptr aNorm = boost::dynamic_pointer_cast( + std::shared_ptr aNorm = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::NORM_ID())); std::list aFeatures = aRefList->list(); @@ -73,10 +73,10 @@ void SketchPlugin_Sketch::execute() return; std::list::const_iterator anIt = aFeatures.begin(), aLast = aFeatures.end(); - boost::shared_ptr aFeature; - std::list > aFeaturesPreview; + std::shared_ptr aFeature; + std::list > aFeaturesPreview; for (; anIt != aLast; anIt++) { - aFeature = boost::dynamic_pointer_cast(*anIt); + aFeature = std::dynamic_pointer_cast(*anIt); if (aFeature) { if (!aFeature->sketch()) // on load document the back references are missed aFeature->setSketch(this); @@ -86,13 +86,13 @@ void SketchPlugin_Sketch::execute() continue; } - const std::list >& aRes = aFeature->results(); - std::list >::const_iterator aResIter = aRes.cbegin(); + const std::list >& aRes = aFeature->results(); + std::list >::const_iterator aResIter = aRes.cbegin(); for (; aResIter != aRes.cend(); aResIter++) { - boost::shared_ptr aConstr = boost::dynamic_pointer_cast< + std::shared_ptr aConstr = std::dynamic_pointer_cast< ModelAPI_ResultConstruction>(*aResIter); if (aConstr) { - boost::shared_ptr aShape = aConstr->shape(); + std::shared_ptr aShape = aConstr->shape(); if (aShape) aFeaturesPreview.push_back(aShape); } @@ -104,8 +104,8 @@ void SketchPlugin_Sketch::execute() return; // Collect all edges as one big wire - boost::shared_ptr aBigWire(new GeomAPI_PlanarEdges); - std::list >::const_iterator aShapeIt = aFeaturesPreview.begin(); + std::shared_ptr aBigWire(new GeomAPI_PlanarEdges); + std::list >::const_iterator aShapeIt = aFeaturesPreview.begin(); for (; aShapeIt != aFeaturesPreview.end(); ++aShapeIt) { aBigWire->addEdge(*aShapeIt); } @@ -116,16 +116,16 @@ void SketchPlugin_Sketch::execute() // GeomAlgoAPI_SketchBuilder::createFaces(anOrigin->pnt(), aDirX->dir(), aDirY->dir(), aNorm->dir(), // aFeaturesPreview, aLoops, aWires); - boost::shared_ptr aConstr = document()->createConstruction(data()); + std::shared_ptr aConstr = document()->createConstruction(data()); aConstr->setShape(aBigWire); setResult(aConstr); } -boost::shared_ptr SketchPlugin_Sketch::addFeature(std::string theID) +std::shared_ptr SketchPlugin_Sketch::addFeature(std::string theID) { - boost::shared_ptr aNew = document()->addFeature(theID); + std::shared_ptr aNew = document()->addFeature(theID); if (aNew) { - boost::dynamic_pointer_cast(aNew)->setSketch(this); + std::dynamic_pointer_cast(aNew)->setSketch(this); data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->append(aNew); } return aNew; @@ -136,10 +136,10 @@ int SketchPlugin_Sketch::numberOfSubs() const return data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->size(); } -boost::shared_ptr SketchPlugin_Sketch::subFeature(const int theIndex) const +std::shared_ptr SketchPlugin_Sketch::subFeature(const int theIndex) const { ObjectPtr anObj = data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->object(theIndex); - return boost::dynamic_pointer_cast(anObj); + return std::dynamic_pointer_cast(anObj); } int SketchPlugin_Sketch::subFeatureId(const int theIndex) const @@ -150,9 +150,9 @@ int SketchPlugin_Sketch::subFeatureId(const int theIndex) const bool SketchPlugin_Sketch::isSub(ObjectPtr theObject) const { // check is this feature of result - FeaturePtr aFeature = boost::dynamic_pointer_cast(theObject); + FeaturePtr aFeature = std::dynamic_pointer_cast(theObject); if (!aFeature) { - ResultPtr aRes = boost::dynamic_pointer_cast(theObject); + ResultPtr aRes = std::dynamic_pointer_cast(theObject); if (aRes) aFeature = document()->feature(aRes); } @@ -166,29 +166,29 @@ bool SketchPlugin_Sketch::isSub(ObjectPtr theObject) const return false; } -boost::shared_ptr SketchPlugin_Sketch::to3D(const double theX, const double theY) +std::shared_ptr SketchPlugin_Sketch::to3D(const double theX, const double theY) { - boost::shared_ptr aC = boost::dynamic_pointer_cast( + std::shared_ptr aC = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::ORIGIN_ID())); - boost::shared_ptr aX = boost::dynamic_pointer_cast( + std::shared_ptr aX = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::DIRX_ID())); - boost::shared_ptr aY = boost::dynamic_pointer_cast( + std::shared_ptr aY = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::DIRY_ID())); - boost::shared_ptr aSum = aC->pnt()->xyz()->added(aX->dir()->xyz()->multiplied(theX)) + std::shared_ptr aSum = aC->pnt()->xyz()->added(aX->dir()->xyz()->multiplied(theX)) ->added(aY->dir()->xyz()->multiplied(theY)); - return boost::shared_ptr(new GeomAPI_Pnt(aSum)); + return std::shared_ptr(new GeomAPI_Pnt(aSum)); } -boost::shared_ptr SketchPlugin_Sketch::to2D( - const boost::shared_ptr& thePnt) +std::shared_ptr SketchPlugin_Sketch::to2D( + const std::shared_ptr& thePnt) { - boost::shared_ptr aC = boost::dynamic_pointer_cast( + std::shared_ptr aC = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::ORIGIN_ID())); - boost::shared_ptr aX = boost::dynamic_pointer_cast( + std::shared_ptr aX = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::DIRX_ID())); - boost::shared_ptr aY = boost::dynamic_pointer_cast( + std::shared_ptr aY = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::DIRY_ID())); return thePnt->to2D(aC->pnt(), aX->dir(), aY->dir()); } @@ -196,50 +196,50 @@ boost::shared_ptr SketchPlugin_Sketch::to2D( bool SketchPlugin_Sketch::isPlaneSet() { - boost::shared_ptr aNormal = boost::dynamic_pointer_cast( + std::shared_ptr aNormal = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::NORM_ID())); return aNormal && !(aNormal->x() == 0 && aNormal->y() == 0 && aNormal->z() == 0); } -boost::shared_ptr SketchPlugin_Sketch::plane() +std::shared_ptr SketchPlugin_Sketch::plane() { - boost::shared_ptr anOrigin = boost::dynamic_pointer_cast( + std::shared_ptr anOrigin = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::ORIGIN_ID())); - boost::shared_ptr aNorm = boost::dynamic_pointer_cast( + std::shared_ptr aNorm = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::NORM_ID())); if (!anOrigin || !aNorm) - return boost::shared_ptr(); + return std::shared_ptr(); - return boost::shared_ptr(new GeomAPI_Pln(anOrigin->pnt(), aNorm->dir())); + return std::shared_ptr(new GeomAPI_Pln(anOrigin->pnt(), aNorm->dir())); } void addPlane(double theX, double theY, double theZ, - std::list >& theShapes) + std::list >& theShapes) { - boost::shared_ptr anOrigin(new GeomAPI_Pnt(0, 0, 0)); - boost::shared_ptr aNormal(new GeomAPI_Dir(theX, theY, theZ)); + std::shared_ptr anOrigin(new GeomAPI_Pnt(0, 0, 0)); + std::shared_ptr aNormal(new GeomAPI_Dir(theX, theY, theZ)); double aSize = Config_PropManager::integer("Sketch planes", "Size of planes", PLANE_SIZE); - boost::shared_ptr aFace = GeomAlgoAPI_FaceBuilder::square(anOrigin, aNormal, + std::shared_ptr aFace = GeomAlgoAPI_FaceBuilder::square(anOrigin, aNormal, aSize); theShapes.push_back(aFace); } AISObjectPtr SketchPlugin_Sketch::getAISObject(AISObjectPtr thePrevious) { - boost::shared_ptr aNorm = boost::dynamic_pointer_cast( + std::shared_ptr aNorm = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::NORM_ID())); if (!aNorm || (aNorm->x() == 0 && aNorm->y() == 0 && aNorm->z() == 0)) { AISObjectPtr aAIS = thePrevious; if (!aAIS) { - std::list > aFaces; + std::list > aFaces; addPlane(1, 0, 0, aFaces); // YZ plane addPlane(0, 1, 0, aFaces); // XZ plane addPlane(0, 0, 1, aFaces); // XY plane - boost::shared_ptr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aFaces); + std::shared_ptr aCompound = GeomAlgoAPI_CompoundBuilder::compound(aFaces); aAIS = AISObjectPtr(new GeomAPI_AISObject()); aAIS->createShape(aCompound); @@ -257,12 +257,12 @@ AISObjectPtr SketchPlugin_Sketch::getAISObject(AISObjectPtr thePrevious) void SketchPlugin_Sketch::erase() { - boost::shared_ptr aRefList = boost::dynamic_pointer_cast< + std::shared_ptr aRefList = std::dynamic_pointer_cast< ModelAPI_AttributeRefList>(data()->attribute(SketchPlugin_Sketch::FEATURES_ID())); std::list aFeatures = aRefList->list(); std::list::const_iterator anIt = aFeatures.begin(); for (; anIt != aFeatures.end(); anIt++) { - FeaturePtr aFeature = boost::dynamic_pointer_cast(*anIt); + FeaturePtr aFeature = std::dynamic_pointer_cast(*anIt); if (aFeature) { // subs are referenced from sketch, but must be removed for sure, so not checkings document()->removeFeature(aFeature, false); @@ -274,44 +274,44 @@ void SketchPlugin_Sketch::erase() void SketchPlugin_Sketch::attributeChanged() { static bool kIsUpdated = false; // to avoid infinitive cycle on attrubtes change static bool kIsAttrChanged = false; - boost::shared_ptr aSelection = + std::shared_ptr aSelection = data()->selection(SketchPlugin_Feature::EXTERNAL_ID())->value(); if (aSelection && !kIsUpdated) { // update arguments due to the selection value kIsUpdated = true; // update the sketch plane - boost::shared_ptr aPlane = GeomAlgoAPI_FaceBuilder::plane(aSelection); + std::shared_ptr aPlane = GeomAlgoAPI_FaceBuilder::plane(aSelection); if (aPlane) { double anA, aB, aC, aD; aPlane->coefficients(anA, aB, aC, aD); // calculate attributes of the sketch - boost::shared_ptr aNormDir(new GeomAPI_Dir(anA, aB, aC)); - boost::shared_ptr aCoords = aNormDir->xyz(); - boost::shared_ptr aZero(new GeomAPI_XYZ(0, 0, 0)); + std::shared_ptr aNormDir(new GeomAPI_Dir(anA, aB, aC)); + std::shared_ptr aCoords = aNormDir->xyz(); + std::shared_ptr aZero(new GeomAPI_XYZ(0, 0, 0)); aCoords = aCoords->multiplied(-aD * aCoords->distance(aZero)); - boost::shared_ptr anOrigPnt(new GeomAPI_Pnt(aCoords)); + std::shared_ptr anOrigPnt(new GeomAPI_Pnt(aCoords)); // X axis is preferable to be dirX on the sketch static const double tol = 1.e-7; bool isX = fabs(anA - 1.0) < tol && fabs(aB) < tol && fabs(aC) < tol; - boost::shared_ptr aTempDir( + std::shared_ptr aTempDir( isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0)); - boost::shared_ptr aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir))); - boost::shared_ptr aXDir(new GeomAPI_Dir(aYDir->cross(aNormDir))); + std::shared_ptr aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir))); + std::shared_ptr aXDir(new GeomAPI_Dir(aYDir->cross(aNormDir))); kIsAttrChanged = false; // track the attributes were really changed during the plane update - boost::shared_ptr anOrigin = boost::dynamic_pointer_cast + std::shared_ptr anOrigin = std::dynamic_pointer_cast (data()->attribute(SketchPlugin_Sketch::ORIGIN_ID())); anOrigin->setValue(anOrigPnt); - boost::shared_ptr aNormal = boost::dynamic_pointer_cast( + std::shared_ptr aNormal = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::NORM_ID())); aNormal->setValue(aNormDir); - boost::shared_ptr aDirX = boost::dynamic_pointer_cast( + std::shared_ptr aDirX = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::DIRX_ID())); aDirX->setValue(aXDir); - boost::shared_ptr aDirY = boost::dynamic_pointer_cast( + std::shared_ptr aDirY = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Sketch::DIRY_ID())); aDirY->setValue(aYDir); - boost::shared_ptr aDir = aPlane->direction(); + std::shared_ptr aDir = aPlane->direction(); if (kIsAttrChanged) { /* now it is in updater @@ -319,8 +319,8 @@ void SketchPlugin_Sketch::attributeChanged() { ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators(); list aSubs = data()->reflist(SketchPlugin_Sketch::FEATURES_ID())->list(); for(list::iterator aSubIt = aSubs.begin(); aSubIt != aSubs.end(); aSubIt++) { - boost::shared_ptr aFeature = - boost::dynamic_pointer_cast(*aSubIt); + std::shared_ptr aFeature = + std::dynamic_pointer_cast(*aSubIt); if (aFeature && aFactory->validate(aFeature)) { aFeature->execute(); } diff --git a/src/SketchPlugin/SketchPlugin_Sketch.h b/src/SketchPlugin/SketchPlugin_Sketch.h index 6a07b55c9..c4802d483 100644 --- a/src/SketchPlugin/SketchPlugin_Sketch.h +++ b/src/SketchPlugin/SketchPlugin_Sketch.h @@ -88,14 +88,14 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_IPr /// Return the distance between the feature and the point /// \param thePoint the point - virtual double distanceToPoint(const boost::shared_ptr& thePoint) + virtual double distanceToPoint(const std::shared_ptr& thePoint) { return 0; } ; /// Converts a 2D sketch space point into point in 3D space - SKETCHPLUGIN_EXPORT boost::shared_ptr to3D(const double theX, const double theY); + SKETCHPLUGIN_EXPORT std::shared_ptr to3D(const double theX, const double theY); /// Returns true if this feature must be displayed in the history (top level of Part tree) SKETCHPLUGIN_EXPORT virtual bool isInHistory() @@ -107,20 +107,20 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_IPr SketchPlugin_Sketch(); /// Returns the basis plane for the sketch - boost::shared_ptr plane(); + std::shared_ptr plane(); virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious); /// removes also all sub-sketch elements SKETCHPLUGIN_EXPORT virtual void erase(); - SKETCHPLUGIN_EXPORT virtual boost::shared_ptr addFeature(std::string theID); + SKETCHPLUGIN_EXPORT virtual std::shared_ptr addFeature(std::string theID); /// Returns the number of sub-elements SKETCHPLUGIN_EXPORT virtual int numberOfSubs() const; /// Returns the sub-feature by zero-base index - SKETCHPLUGIN_EXPORT virtual boost::shared_ptr + SKETCHPLUGIN_EXPORT virtual std::shared_ptr subFeature(const int theIndex) const; /// Returns the sub-feature unique identifier in this composite feature by zero-base index @@ -133,7 +133,7 @@ class SketchPlugin_Sketch : public ModelAPI_CompositeFeature, public GeomAPI_IPr SKETCHPLUGIN_EXPORT virtual bool isPersistentResult() {return false;} /// Returns the point projected into the sketch plane - boost::shared_ptr to2D(const boost::shared_ptr& thePnt); + std::shared_ptr to2D(const std::shared_ptr& thePnt); SKETCHPLUGIN_EXPORT virtual void attributeChanged(); protected: @@ -143,7 +143,7 @@ protected: /// \param theZ the Z normal value /// \param theShapes the list of result shapes //void addPlane(double theX, double theY, double theZ, - // std::list >& theShapes) const; + // std::list >& theShapes) const; /// Checks whether the plane is set in the sketch. /// \returns the boolean state diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index 822ddaf6c..ce58a0b3b 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -27,7 +27,7 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const FeaturePtr& theFeature, return true; // If it is a line then we have to check that first attribute id not a line - boost::shared_ptr aPoint = getFeaturePoint(theFeature->data(), aParamA); + std::shared_ptr aPoint = getFeaturePoint(theFeature->data(), aParamA); if (aPoint) return true; return false; @@ -36,11 +36,11 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const FeaturePtr& theFeature, bool SketchPlugin_DistanceAttrValidator::isValid( const AttributePtr& theAttribute, const std::list& theArguments ) const { - boost::shared_ptr anAttr = - boost::dynamic_pointer_cast(theAttribute); + std::shared_ptr anAttr = + std::dynamic_pointer_cast(theAttribute); if (anAttr) { const ObjectPtr& anObj = theAttribute->owner(); - const FeaturePtr aFeature = boost::dynamic_pointer_cast(anObj); + const FeaturePtr aFeature = std::dynamic_pointer_cast(anObj); return isValid(aFeature, theArguments, anAttr->object()); } return true; // it may be not reference attribute, in this case, it is OK @@ -50,13 +50,13 @@ bool SketchPlugin_DifferentObjectsValidator::isValid(const FeaturePtr& theFeatur const std::list& theArguments, const ObjectPtr& theObject) const { - std::list > anAttrs = + std::list > anAttrs = theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type()); - std::list >::iterator anAttr = anAttrs.begin(); + std::list >::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { if (*anAttr) { - boost::shared_ptr aRef = - boost::dynamic_pointer_cast(*anAttr); + std::shared_ptr aRef = + std::dynamic_pointer_cast(*anAttr); // check the object is already presented if (aRef->isObject() && aRef->object() == theObject) return false; @@ -68,19 +68,19 @@ bool SketchPlugin_DifferentObjectsValidator::isValid(const FeaturePtr& theFeatur bool SketchPlugin_DifferentObjectsValidator::isValid( const AttributePtr& theAttribute, const std::list& theArguments ) const { - boost::shared_ptr anOrigAttr = - boost::dynamic_pointer_cast(theAttribute); + std::shared_ptr anOrigAttr = + std::dynamic_pointer_cast(theAttribute); if (anOrigAttr && anOrigAttr->isObject()) { const ObjectPtr& anObj = theAttribute->owner(); - const FeaturePtr aFeature = boost::dynamic_pointer_cast(anObj); + const FeaturePtr aFeature = std::dynamic_pointer_cast(anObj); - std::list > anAttrs = + std::list > anAttrs = aFeature->data()->attributes(ModelAPI_AttributeRefAttr::type()); - std::list >::iterator anAttr = anAttrs.begin(); + std::list >::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { if (*anAttr && *anAttr != theAttribute) { - boost::shared_ptr aRef = - boost::dynamic_pointer_cast(*anAttr); + std::shared_ptr aRef = + std::dynamic_pointer_cast(*anAttr); // check the object is already presented if (aRef->isObject() && aRef->object() == anOrigAttr->object()) return false; @@ -93,13 +93,13 @@ bool SketchPlugin_DifferentObjectsValidator::isValid( bool SketchPlugin_DifferentObjectsValidator::isValid(const FeaturePtr& theFeature, const std::list& theArguments, const AttributePtr& theAttribute) const { - std::list > anAttrs = + std::list > anAttrs = theFeature->data()->attributes(ModelAPI_AttributeRefAttr::type()); - std::list >::iterator anAttr = anAttrs.begin(); + std::list >::iterator anAttr = anAttrs.begin(); for(; anAttr != anAttrs.end(); anAttr++) { if (*anAttr) { - boost::shared_ptr aRef = - boost::dynamic_pointer_cast(*anAttr); + std::shared_ptr aRef = + std::dynamic_pointer_cast(*anAttr); // check the object is already presented if (!aRef->isObject() && aRef->attr() == theAttribute) return false; diff --git a/src/SketchSolver/SketchSolver_Constraint.cpp b/src/SketchSolver/SketchSolver_Constraint.cpp index 6d4fdee33..caccc5223 100644 --- a/src/SketchSolver/SketchSolver_Constraint.cpp +++ b/src/SketchSolver/SketchSolver_Constraint.cpp @@ -40,17 +40,17 @@ enum AttrType }; /// Calculate type of the attribute -static AttrType typeOfAttribute(boost::shared_ptr theAttribute); +static AttrType typeOfAttribute(std::shared_ptr theAttribute); SketchSolver_Constraint::SketchSolver_Constraint() - : myConstraint(boost::shared_ptr()), + : myConstraint(std::shared_ptr()), myType(SLVS_C_UNKNOWN), myAttributesList() { } SketchSolver_Constraint::SketchSolver_Constraint( - boost::shared_ptr theConstraint) + std::shared_ptr theConstraint) : myConstraint(theConstraint), myAttributesList() { @@ -58,7 +58,7 @@ SketchSolver_Constraint::SketchSolver_Constraint( } const int& SketchSolver_Constraint::getType( - boost::shared_ptr theConstraint) + std::shared_ptr theConstraint) { myType = SLVS_C_UNKNOWN; if (!theConstraint) @@ -81,7 +81,7 @@ const int& SketchSolver_Constraint::getType( int aPt2d = 0; // bit-mapped field, each bit indicates whether the attribute is 2D point int aPt3d = 0; // bit-mapped field, the same information for 3D points for (unsigned int indAttr = 0; indAttr < CONSTRAINT_ATTR_SIZE; indAttr++) { - boost::shared_ptr anAttr = + std::shared_ptr anAttr = aConstrData->attribute(SketchPlugin_Constraint::ATTRIBUTE(indAttr)); if (!anAttr) continue; @@ -112,7 +112,7 @@ const int& SketchSolver_Constraint::getType( int aNbPoints = 0; int aNbEntities = 0; for (unsigned int indAttr = 0; indAttr < CONSTRAINT_ATTR_SIZE; indAttr++) { - boost::shared_ptr anAttr = + std::shared_ptr anAttr = aConstrData->attribute(SketchPlugin_Constraint::ATTRIBUTE(indAttr)); switch (typeOfAttribute(anAttr)) { case POINT2D: @@ -138,7 +138,7 @@ const int& SketchSolver_Constraint::getType( if (aConstraintKind.compare(SketchPlugin_ConstraintLength::ID()) == 0) { int aNbLines = 0; for (unsigned int indAttr = 0; indAttr < CONSTRAINT_ATTR_SIZE; indAttr++) { - boost::shared_ptr anAttr = + std::shared_ptr anAttr = aConstrData->attribute(SketchPlugin_Constraint::ATTRIBUTE(indAttr)); if (typeOfAttribute(anAttr) == LINE) myAttributesList[aNbLines++] = SketchPlugin_Constraint::ATTRIBUTE(indAttr); @@ -154,7 +154,7 @@ const int& SketchSolver_Constraint::getType( if (isParallel || isPerpendicular) { int aNbEntities = 2; // lines in SolveSpace constraints should start from SketchPlugin_Constraint::ENTITY_C() attribute for (unsigned int indAttr = 0; indAttr < CONSTRAINT_ATTR_SIZE; indAttr++) { - boost::shared_ptr anAttr = + std::shared_ptr anAttr = aConstrData->attribute(SketchPlugin_Constraint::ATTRIBUTE(indAttr)); if (typeOfAttribute(anAttr) == LINE) myAttributesList[aNbEntities++] = SketchPlugin_Constraint::ATTRIBUTE(indAttr); @@ -168,7 +168,7 @@ const int& SketchSolver_Constraint::getType( if (aConstraintKind.compare(SketchPlugin_ConstraintRadius::ID()) == 0) { int aNbEntities = 2; // lines in SolveSpace constraints should started from SketchPlugin_Constraint::ENTITY_C() attribute for (unsigned int indAttr = 0; indAttr < CONSTRAINT_ATTR_SIZE; indAttr++) { - boost::shared_ptr anAttr = + std::shared_ptr anAttr = aConstrData->attribute(SketchPlugin_Constraint::ATTRIBUTE(indAttr)); AttrType aType = typeOfAttribute(anAttr); if (aType == CIRCLE || aType == ARC) @@ -184,7 +184,7 @@ const int& SketchSolver_Constraint::getType( // Verify that only one entity is filled int aNbAttrs = 0; for (unsigned int indAttr = 0; indAttr < CONSTRAINT_ATTR_SIZE; indAttr++) { - boost::shared_ptr anAttr = + std::shared_ptr anAttr = aConstrData->attribute(SketchPlugin_Constraint::ATTRIBUTE(indAttr)); AttrType aType = typeOfAttribute(anAttr); if (aType != UNKNOWN) @@ -201,15 +201,15 @@ const int& SketchSolver_Constraint::getType( } // ================= Auxiliary functions ============================== -AttrType typeOfAttribute(boost::shared_ptr theAttribute) +AttrType typeOfAttribute(std::shared_ptr theAttribute) { - boost::shared_ptr anAttrRef = boost::dynamic_pointer_cast< + std::shared_ptr anAttrRef = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(theAttribute); if (!anAttrRef) return UNKNOWN; if (anAttrRef->isObject()) { - ResultConstructionPtr aRC = boost::dynamic_pointer_cast( + ResultConstructionPtr aRC = std::dynamic_pointer_cast( anAttrRef->object()); if (!aRC || !aRC->shape()) return UNKNOWN; @@ -217,7 +217,7 @@ AttrType typeOfAttribute(boost::shared_ptr theAttribute) if (aRC->shape()->isVertex()) return POINT3D; else if (aRC->shape()->isEdge()) { - boost::shared_ptr anEdge = boost::dynamic_pointer_cast( + std::shared_ptr anEdge = std::dynamic_pointer_cast( aRC->shape()); if (anEdge->isLine()) return LINE; diff --git a/src/SketchSolver/SketchSolver_Constraint.h b/src/SketchSolver/SketchSolver_Constraint.h index 0d20edd38..4caa73b49 100644 --- a/src/SketchSolver/SketchSolver_Constraint.h +++ b/src/SketchSolver/SketchSolver_Constraint.h @@ -20,14 +20,14 @@ class SketchSolver_Constraint { public: SketchSolver_Constraint(); - SketchSolver_Constraint(boost::shared_ptr theConstraint); + SketchSolver_Constraint(std::shared_ptr theConstraint); /** \brief Compute constraint type according to SolveSpace identifiers * and verify that constraint parameters are correct * \param[in] theConstraint constraint which type should be determined * \return identifier of constraint type or SLVS_C_UNKNOWN if the type is wrong */ - const int& getType(boost::shared_ptr theConstraint); + const int& getType(std::shared_ptr theConstraint); /// \brief Returns the type of myConstraint member inline const int& getType() const { @@ -41,7 +41,7 @@ class SketchSolver_Constraint } private: - boost::shared_ptr myConstraint; + std::shared_ptr myConstraint; int myType; std::vector myAttributesList; }; diff --git a/src/SketchSolver/SketchSolver_ConstraintGroup.cpp b/src/SketchSolver/SketchSolver_ConstraintGroup.cpp index 2eb18737c..050c262b5 100644 --- a/src/SketchSolver/SketchSolver_ConstraintGroup.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintGroup.cpp @@ -68,7 +68,7 @@ static int Search(const uint32_t& theEntityID, const std::vector& theEntities // ======================================================== SketchSolver_ConstraintGroup::SketchSolver_ConstraintGroup( - boost::shared_ptr theWorkplane) + std::shared_ptr theWorkplane) : myID(++myGroupIndexer), myParamMaxID(0), myEntityMaxID(0), @@ -116,7 +116,7 @@ SketchSolver_ConstraintGroup::~SketchSolver_ConstraintGroup() // Purpose: verify the group is based on the given workplane // ============================================================================ bool SketchSolver_ConstraintGroup::isBaseWorkplane( - boost::shared_ptr theWorkplane) const + std::shared_ptr theWorkplane) const { return theWorkplane == mySketch; } @@ -127,7 +127,7 @@ bool SketchSolver_ConstraintGroup::isBaseWorkplane( // Purpose: verify are there any entities in the group used by given constraint // ============================================================================ bool SketchSolver_ConstraintGroup::isInteract( - boost::shared_ptr theFeature) const + std::shared_ptr theFeature) const { // Check the group is empty if (isEmpty()) @@ -136,37 +136,37 @@ bool SketchSolver_ConstraintGroup::isInteract( // Check if the feature is already in the group if (myEntityFeatMap.find(theFeature) != myEntityFeatMap.end()) return true; - boost::shared_ptr aConstr = - boost::dynamic_pointer_cast(theFeature); + std::shared_ptr aConstr = + std::dynamic_pointer_cast(theFeature); if (aConstr && myConstraintMap.find(aConstr) != myConstraintMap.end()) return true; // Go through the attributes and verify if some of them already in the group - std::list> + std::list> anAttrList = theFeature->data()->attributes(std::string()); - std::list>::const_iterator + std::list>::const_iterator anAttrIter = anAttrList.begin(); for ( ; anAttrIter != anAttrList.end(); anAttrIter++) { - boost::shared_ptr aCAttrRef = - boost::dynamic_pointer_cast(*anAttrIter); + std::shared_ptr aCAttrRef = + std::dynamic_pointer_cast(*anAttrIter); if (!aCAttrRef || !aCAttrRef->isObject()) { - boost::shared_ptr anAttr = + std::shared_ptr anAttr = aCAttrRef ? aCAttrRef->attr() : *anAttrIter; if (myEntityAttrMap.find(anAttr) != myEntityAttrMap.end()) return true; } else { - ResultConstructionPtr aRC = boost::dynamic_pointer_cast( + ResultConstructionPtr aRC = std::dynamic_pointer_cast( aCAttrRef->object()); if (!aRC) continue; - boost::shared_ptr aDoc = aRC->document(); + std::shared_ptr aDoc = aRC->document(); FeaturePtr aFeature = aDoc->feature(aRC); if (myEntityFeatMap.find(aFeature) != myEntityFeatMap.end()) return true; // search attributes of a feature to be parameters of constraint - std::list > aFeatAttrList = + std::list > aFeatAttrList = aFeature->data()->attributes(std::string()); - std::list >::const_iterator aFAIter = aFeatAttrList + std::list >::const_iterator aFAIter = aFeatAttrList .begin(); for (; aFAIter != aFeatAttrList.end(); aFAIter++) if (myEntityAttrMap.find(*aFAIter) != myEntityAttrMap.end()) @@ -191,18 +191,18 @@ void SketchSolver_ConstraintGroup::checkConstraintConsistence(Slvs_Constraint& t // point coordinates int aPtPos = Search(theConstraint.ptA, myEntities); int aPtParamPos = Search(myEntities[aPtPos].param[0], myParams); - boost::shared_ptr aPoint( + std::shared_ptr aPoint( new GeomAPI_XY(myParams[aPtParamPos].val, myParams[aPtParamPos + 1].val)); // line coordinates int aLnPos = Search(theConstraint.entityA, myEntities); aPtPos = Search(myEntities[aLnPos].point[0], myEntities); aPtParamPos = Search(myEntities[aPtPos].param[0], myParams); - boost::shared_ptr aStart( + std::shared_ptr aStart( new GeomAPI_XY(-myParams[aPtParamPos].val, -myParams[aPtParamPos + 1].val)); aPtPos = Search(myEntities[aLnPos].point[1], myEntities); aPtParamPos = Search(myEntities[aPtPos].param[0], myParams); - boost::shared_ptr aEnd( + std::shared_ptr aEnd( new GeomAPI_XY(myParams[aPtParamPos].val, myParams[aPtParamPos + 1].val)); aEnd = aEnd->added(aStart); @@ -218,7 +218,7 @@ void SketchSolver_ConstraintGroup::checkConstraintConsistence(Slvs_Constraint& t // Purpose: create/update the constraint in the group // ============================================================================ bool SketchSolver_ConstraintGroup::changeConstraint( - boost::shared_ptr theConstraint) + std::shared_ptr theConstraint) { // There is no workplane yet, something wrong if (myWorkplane.h == SLVS_E_UNKNOWN) @@ -245,7 +245,7 @@ bool SketchSolver_ConstraintGroup::changeConstraint( // Create constraint parameters double aDistance = 0.0; // scalar value of the constraint - AttributeDoublePtr aDistAttr = boost::dynamic_pointer_cast( + AttributeDoublePtr aDistAttr = std::dynamic_pointer_cast( theConstraint->data()->attribute(SketchPlugin_Constraint::VALUE())); if (aDistAttr) { aDistance = aDistAttr->value(); @@ -267,7 +267,7 @@ bool SketchSolver_ConstraintGroup::changeConstraint( Slvs_hEntity aConstrEnt[CONSTRAINT_ATTR_SIZE]; // parameters of the constraint for (unsigned int indAttr = 0; indAttr < CONSTRAINT_ATTR_SIZE; indAttr++) { aConstrEnt[indAttr] = SLVS_E_UNKNOWN; - boost::shared_ptr aConstrAttr = boost::dynamic_pointer_cast< + std::shared_ptr aConstrAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>( theConstraint->data()->attribute(aConstraintAttributes[indAttr])); if (!aConstrAttr) @@ -276,11 +276,11 @@ bool SketchSolver_ConstraintGroup::changeConstraint( // Convert the object of the attribute to the feature FeaturePtr aFeature; if (aConstrAttr->isObject() && aConstrAttr->object()) { - ResultConstructionPtr aRC = boost::dynamic_pointer_cast( + ResultConstructionPtr aRC = std::dynamic_pointer_cast( aConstrAttr->object()); if (!aRC) continue; - boost::shared_ptr aDoc = aRC->document(); + std::shared_ptr aDoc = aRC->document(); aFeature = aDoc->feature(aRC); } @@ -396,7 +396,7 @@ bool SketchSolver_ConstraintGroup::changeConstraint( // Purpose: create/update the "Rigid" constraint in the group // ============================================================================ bool SketchSolver_ConstraintGroup::changeRigidConstraint( - boost::shared_ptr theConstraint) + std::shared_ptr theConstraint) { // Search this constraint in the current group to update it ConstraintMap::const_iterator aConstrMapIter = myConstraintMap.find(theConstraint); @@ -415,7 +415,7 @@ bool SketchSolver_ConstraintGroup::changeRigidConstraint( const std::vector& aConstraintAttributes = aConstraint.getAttributes(); Slvs_hEntity aConstrEnt = SLVS_E_UNKNOWN; - boost::shared_ptr aConstrAttr = boost::dynamic_pointer_cast< + std::shared_ptr aConstrAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>( theConstraint->data()->attribute(aConstraintAttributes[0])); if (!aConstrAttr) @@ -424,11 +424,11 @@ bool SketchSolver_ConstraintGroup::changeRigidConstraint( // Convert the object of the attribute to the feature FeaturePtr aFeature; if (aConstrAttr->isObject() && aConstrAttr->object()) { - ResultConstructionPtr aRC = boost::dynamic_pointer_cast( + ResultConstructionPtr aRC = std::dynamic_pointer_cast( aConstrAttr->object()); if (!aRC) return false; - boost::shared_ptr aDoc = aRC->document(); + std::shared_ptr aDoc = aRC->document(); aFeature = aDoc->feature(aRC); } @@ -436,12 +436,12 @@ bool SketchSolver_ConstraintGroup::changeRigidConstraint( if (aConstrMapIter == myConstraintMap.end()) { // Add new constraint // Check the fixed entity is not a point. - boost::shared_ptr aConstrAttr = boost::dynamic_pointer_cast< + std::shared_ptr aConstrAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(theConstraint->data()->attribute(aConstraintAttributes[0])); - boost::shared_ptr aPoint = - boost::dynamic_pointer_cast(aConstrAttr->attr()); - boost::shared_ptr aPoint2D = - boost::dynamic_pointer_cast(aConstrAttr->attr()); + std::shared_ptr aPoint = + std::dynamic_pointer_cast(aConstrAttr->attr()); + std::shared_ptr aPoint2D = + std::dynamic_pointer_cast(aConstrAttr->attr()); if (aPoint || aPoint2D) { // Create SolveSpace constraint structure Slvs_Constraint aConstraint = Slvs_MakeConstraint( @@ -463,16 +463,16 @@ bool SketchSolver_ConstraintGroup::changeRigidConstraint( bool isCircle = false; if (aFeature) { if (aFeature->getKind() == SketchPlugin_Arc::ID()) { - boost::shared_ptr aCenter = - boost::dynamic_pointer_cast( + std::shared_ptr aCenter = + std::dynamic_pointer_cast( aFeature->data()->attribute(SketchPlugin_Arc::CENTER_ID())); - boost::shared_ptr aStart = - boost::dynamic_pointer_cast( + std::shared_ptr aStart = + std::dynamic_pointer_cast( aFeature->data()->attribute(SketchPlugin_Arc::START_ID())); aRadius = aStart->pnt()->distance(aCenter->pnt()); isArc = true; } else if (aFeature->getKind() == SketchPlugin_Circle::ID()) { - aRadius = boost::dynamic_pointer_cast( + aRadius = std::dynamic_pointer_cast( aFeature->data()->attribute(SketchPlugin_Circle::RADIUS_ID()))->value(); isCircle = true; } @@ -544,10 +544,10 @@ bool SketchSolver_ConstraintGroup::changeRigidConstraint( // Purpose: create/update the element affected by any constraint // ============================================================================ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity( - boost::shared_ptr theEntity) + std::shared_ptr theEntity) { // If the entity is already in the group, try to find it - std::map, Slvs_hEntity>::const_iterator aEntIter = + std::map, Slvs_hEntity>::const_iterator aEntIter = myEntityAttrMap.find(theEntity); int aEntPos; std::vector::const_iterator aParamIter; // looks at first parameter of already existent entity or at the end of vector otherwise @@ -589,7 +589,7 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity( aNewEntity.h = SLVS_E_UNKNOWN; // Point in 3D - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aPoint = std::dynamic_pointer_cast( theEntity); if (aPoint) { Slvs_hParam aX = changeParameter(aPoint->x(), aParamIter); @@ -603,8 +603,8 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity( return SLVS_E_UNKNOWN; // Point in 2D - boost::shared_ptr aPoint2D = - boost::dynamic_pointer_cast(theEntity); + std::shared_ptr aPoint2D = + std::dynamic_pointer_cast(theEntity); if (aPoint2D) { Slvs_hParam aU = changeParameter(aPoint2D->x(), aParamIter); Slvs_hParam aV = changeParameter(aPoint2D->y(), aParamIter); @@ -612,7 +612,7 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity( aNewEntity = Slvs_MakePoint2d(++myEntityMaxID, myID, myWorkplane.h, aU, aV); } else { // Scalar value (used for the distance entities) - AttributeDoublePtr aScalar = boost::dynamic_pointer_cast(theEntity); + AttributeDoublePtr aScalar = std::dynamic_pointer_cast(theEntity); if (aScalar) { Slvs_hParam aValue = changeParameter(aScalar->value(), aParamIter); if (!isEntExists) // New entity @@ -659,7 +659,7 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity(FeaturePtr theEntity) aNewEntity.h = SLVS_E_UNKNOWN; // SketchPlugin features - boost::shared_ptr aFeature = boost::dynamic_pointer_cast< + std::shared_ptr aFeature = std::dynamic_pointer_cast< SketchPlugin_Feature>(theEntity); if (aFeature) { // Verify the feature by its kind const std::string& aFeatureKind = aFeature->getKind(); @@ -748,11 +748,11 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeEntity(FeaturePtr theEntity) // Purpose: create/update the normal of workplane // ============================================================================ Slvs_hEntity SketchSolver_ConstraintGroup::changeNormal( - boost::shared_ptr theDirX, boost::shared_ptr theDirY, - boost::shared_ptr theNorm) + std::shared_ptr theDirX, std::shared_ptr theDirY, + std::shared_ptr theNorm) { - boost::shared_ptr aDirX = boost::dynamic_pointer_cast(theDirX); - boost::shared_ptr aDirY = boost::dynamic_pointer_cast(theDirY); + std::shared_ptr aDirX = std::dynamic_pointer_cast(theDirX); + std::shared_ptr aDirY = std::dynamic_pointer_cast(theDirY); if (!aDirX || !aDirY || (fabs(aDirX->x()) + fabs(aDirX->y()) + fabs(aDirX->z()) < tolerance) || (fabs(aDirY->x()) + fabs(aDirY->y()) + fabs(aDirY->z()) < tolerance)) return SLVS_E_UNKNOWN; @@ -764,7 +764,7 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeNormal( double aNormCoord[4] = { qw, qx, qy, qz }; // Try to find existent normal - std::map, Slvs_hEntity>::const_iterator aEntIter = + std::map, Slvs_hEntity>::const_iterator aEntIter = myEntityAttrMap.find(theNorm); std::vector::const_iterator aParamIter; // looks to the first parameter of already existent entity or to the end of vector otherwise if (aEntIter == myEntityAttrMap.end()) // no such entity => should be created @@ -797,7 +797,7 @@ Slvs_hEntity SketchSolver_ConstraintGroup::changeNormal( // Class: SketchSolver_ConstraintGroup // Purpose: create workplane for the group // ============================================================================ -bool SketchSolver_ConstraintGroup::addWorkplane(boost::shared_ptr theSketch) +bool SketchSolver_ConstraintGroup::addWorkplane(std::shared_ptr theSketch) { if (myWorkplane.h || theSketch->getKind().compare(SketchPlugin_Sketch::ID()) != 0) return false; // the workplane already exists or the function parameter is not Sketch @@ -817,13 +817,13 @@ bool SketchSolver_ConstraintGroup::updateWorkplane() if (!mySketch->data()) return false; // case sketch is deleted // Get parameters of workplane - boost::shared_ptr aDirX = mySketch->data()->attribute( + std::shared_ptr aDirX = mySketch->data()->attribute( SketchPlugin_Sketch::DIRX_ID()); - boost::shared_ptr aDirY = mySketch->data()->attribute( + std::shared_ptr aDirY = mySketch->data()->attribute( SketchPlugin_Sketch::DIRY_ID()); - boost::shared_ptr aNorm = mySketch->data()->attribute( + std::shared_ptr aNorm = mySketch->data()->attribute( SketchPlugin_Sketch::NORM_ID()); - boost::shared_ptr anOrigin = mySketch->data()->attribute( + std::shared_ptr anOrigin = mySketch->data()->attribute( SketchPlugin_Sketch::ORIGIN_ID()); // Transform them into SolveSpace format Slvs_hEntity aNormalWP = changeNormal(aDirX, aDirY, aNorm); @@ -893,7 +893,7 @@ bool SketchSolver_ConstraintGroup::resolveConstraints() return true; // We should go through the attributes map, because only attributes have valued parameters - std::map, Slvs_hEntity>::iterator anEntIter = + std::map, Slvs_hEntity>::iterator anEntIter = myEntityAttrMap.begin(); for (; anEntIter != myEntityAttrMap.end(); anEntIter++) if (updateAttribute(anEntIter->first, anEntIter->second)) @@ -938,7 +938,7 @@ void SketchSolver_ConstraintGroup::mergeGroups(const SketchSolver_ConstraintGrou if (myTempPointWhereDragged.empty()) myTempPointWhereDragged = theGroup.myTempPointWhereDragged; else if (!theGroup.myTempPointWhereDragged.empty()) { // Need to create additional transient constraint - std::map, Slvs_hEntity>::const_iterator aFeatureIter = + std::map, Slvs_hEntity>::const_iterator aFeatureIter = theGroup.myEntityAttrMap.begin(); for (; aFeatureIter != theGroup.myEntityAttrMap.end(); aFeatureIter++) if (aFeatureIter->second == myTempPointWDrgdID) { @@ -1106,13 +1106,13 @@ bool SketchSolver_ConstraintGroup::updateGroup() // Check if some entities are invalid too std::set anEntToRemove; - std::map, Slvs_hEntity>::iterator + std::map, Slvs_hEntity>::iterator anAttrIter = myEntityAttrMap.begin(); while (anAttrIter != myEntityAttrMap.end()) { if (!anAttrIter->first->owner() || !anAttrIter->first->owner()->data() || !anAttrIter->first->owner()->data()->isValid()) { anEntToRemove.insert(anAttrIter->second); - std::map, Slvs_hEntity>::iterator + std::map, Slvs_hEntity>::iterator aRemovedIter = anAttrIter; anAttrIter++; myEntityAttrMap.erase(aRemovedIter); @@ -1135,10 +1135,10 @@ bool SketchSolver_ConstraintGroup::updateGroup() // Probably, need to update coincidence constraints if (isCCRemoved && !myExtraCoincidence.empty()) { // Make a copy, because the new list of unused constrtaints will be generated - std::set > anExtraCopy = myExtraCoincidence; + std::set > anExtraCopy = myExtraCoincidence; myExtraCoincidence.clear(); - std::set >::iterator aCIter = anExtraCopy.begin(); + std::set >::iterator aCIter = anExtraCopy.begin(); for (; aCIter != anExtraCopy.end(); aCIter++) if ((*aCIter)->data() && (*aCIter)->data()->isValid()) changeConstraint(*aCIter); @@ -1153,7 +1153,7 @@ bool SketchSolver_ConstraintGroup::updateGroup() // Purpose: update features of sketch after resolving constraints // ============================================================================ bool SketchSolver_ConstraintGroup::updateAttribute( - boost::shared_ptr theAttribute, const Slvs_hEntity& theEntityID) + std::shared_ptr theAttribute, const Slvs_hEntity& theEntityID) { // Search the position of the first parameter of the entity int anEntPos = Search(theEntityID, myEntities); @@ -1162,7 +1162,7 @@ bool SketchSolver_ConstraintGroup::updateAttribute( // Look over supported types of entities // Point in 3D - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aPoint = std::dynamic_pointer_cast( theAttribute); if (aPoint) { if (fabs(aPoint->x() - myParams[aFirstParamPos].val) > tolerance @@ -1176,8 +1176,8 @@ bool SketchSolver_ConstraintGroup::updateAttribute( } // Point in 2D - boost::shared_ptr aPoint2D = - boost::dynamic_pointer_cast(theAttribute); + std::shared_ptr aPoint2D = + std::dynamic_pointer_cast(theAttribute); if (aPoint2D) { if (fabs(aPoint2D->x() - myParams[aFirstParamPos].val) > tolerance || fabs(aPoint2D->y() - myParams[aFirstParamPos + 1].val) > tolerance) { @@ -1188,7 +1188,7 @@ bool SketchSolver_ConstraintGroup::updateAttribute( } // Scalar value - AttributeDoublePtr aScalar = boost::dynamic_pointer_cast(theAttribute); + AttributeDoublePtr aScalar = std::dynamic_pointer_cast(theAttribute); if (aScalar) { if (fabs(aScalar->value() - myParams[aFirstParamPos].val) > tolerance) { aScalar->setValue(myParams[aFirstParamPos].val); @@ -1207,7 +1207,7 @@ bool SketchSolver_ConstraintGroup::updateAttribute( // Purpose: search the entity in this group and update it // ============================================================================ void SketchSolver_ConstraintGroup::updateEntityIfPossible( - boost::shared_ptr theEntity) + std::shared_ptr theEntity) { if (myEntityAttrMap.find(theEntity) != myEntityAttrMap.end()) { // If the attribute is a point and it is changed (the group needs to rebuild), @@ -1223,9 +1223,9 @@ void SketchSolver_ConstraintGroup::updateEntityIfPossible( if (myNeedToSolve) // the entity is changed { // Verify the entity is a point and add temporary constraint of permanency - boost::shared_ptr aPoint = boost::dynamic_pointer_cast( + std::shared_ptr aPoint = std::dynamic_pointer_cast( theEntity); - boost::shared_ptr aPoint2D = boost::dynamic_pointer_cast< + std::shared_ptr aPoint2D = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(theEntity); if (aPoint || aPoint2D) addTemporaryConstraintWhereDragged(theEntity); @@ -1246,11 +1246,11 @@ void SketchSolver_ConstraintGroup::updateEntityIfPossible( // which was moved by user // ============================================================================ void SketchSolver_ConstraintGroup::addTemporaryConstraintWhereDragged( - boost::shared_ptr theEntity, + std::shared_ptr theEntity, bool theAllowToFit) { // Find identifier of the entity - std::map, Slvs_hEntity>::const_iterator anEntIter = + std::map, Slvs_hEntity>::const_iterator anEntIter = myEntityAttrMap.find(theEntity); if (anEntIter == myEntityAttrMap.end()) return; @@ -1338,7 +1338,7 @@ void SketchSolver_ConstraintGroup::removeTemporaryConstraints( // Purpose: remove constraint and all unused entities // ============================================================================ void SketchSolver_ConstraintGroup::removeConstraint( - boost::shared_ptr theConstraint) + std::shared_ptr theConstraint) { ConstraintMap::iterator anIterToRemove = myConstraintMap.find(theConstraint); if (anIterToRemove == myConstraintMap.end()) @@ -1392,11 +1392,11 @@ void SketchSolver_ConstraintGroup::removeConstraint( return; // Remove unused entities - std::map, Slvs_hEntity>::iterator anEntAttrIter = + std::map, Slvs_hEntity>::iterator anEntAttrIter = myEntityAttrMap.begin(); while (anEntAttrIter != myEntityAttrMap.end()) { if (anEntToRemove.find(anEntAttrIter->second) != anEntToRemove.end()) { - std::map, Slvs_hEntity>::iterator aRemovedIter = + std::map, Slvs_hEntity>::iterator aRemovedIter = anEntAttrIter; anEntAttrIter++; myEntityAttrMap.erase(aRemovedIter); @@ -1503,17 +1503,17 @@ bool SketchSolver_ConstraintGroup::addCoincidentPoints(const Slvs_hEntity& thePo // Purpose: emit the signal to update constraints // ============================================================================ void SketchSolver_ConstraintGroup::updateRelatedConstraints( - boost::shared_ptr theEntity) const + std::shared_ptr theEntity) const { ConstraintMap::const_iterator aConstrIter = myConstraintMap.begin(); for (; aConstrIter != myConstraintMap.end(); aConstrIter++) { - std::list > anAttributes = aConstrIter->first->data() + std::list > anAttributes = aConstrIter->first->data() ->attributes(std::string()); - std::list >::iterator anAttrIter = anAttributes.begin(); + std::list >::iterator anAttrIter = anAttributes.begin(); for (; anAttrIter != anAttributes.end(); anAttrIter++) { bool isUpd = (*anAttrIter == theEntity); - boost::shared_ptr aRefAttr = boost::dynamic_pointer_cast< + std::shared_ptr aRefAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(*anAttrIter); if (aRefAttr && !aRefAttr->isObject() && aRefAttr->attr() == theEntity) isUpd = true; @@ -1528,16 +1528,16 @@ void SketchSolver_ConstraintGroup::updateRelatedConstraints( } void SketchSolver_ConstraintGroup::updateRelatedConstraints( - boost::shared_ptr theFeature) const + std::shared_ptr theFeature) const { ConstraintMap::const_iterator aConstrIter = myConstraintMap.begin(); for (; aConstrIter != myConstraintMap.end(); aConstrIter++) { - std::list > anAttributes = aConstrIter->first->data() + std::list > anAttributes = aConstrIter->first->data() ->attributes(std::string()); - std::list >::iterator anAttrIter = anAttributes.begin(); + std::list >::iterator anAttrIter = anAttributes.begin(); for (; anAttrIter != anAttributes.end(); anAttrIter++) { - boost::shared_ptr aRefAttr = boost::dynamic_pointer_cast< + std::shared_ptr aRefAttr = std::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(*anAttrIter); if (aRefAttr && aRefAttr->isObject() && aRefAttr->object() == theFeature) { static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_UPDATED); diff --git a/src/SketchSolver/SketchSolver_ConstraintGroup.h b/src/SketchSolver/SketchSolver_ConstraintGroup.h index c8a673029..46dbd9e0e 100644 --- a/src/SketchSolver/SketchSolver_ConstraintGroup.h +++ b/src/SketchSolver/SketchSolver_ConstraintGroup.h @@ -16,7 +16,7 @@ #include #include -typedef std::map< boost::shared_ptr, std::vector > +typedef std::map< std::shared_ptr, std::vector > ConstraintMap; /** \class SketchSolver_ConstraintGroup @@ -30,7 +30,7 @@ class SketchSolver_ConstraintGroup * Throws an exception if theWorkplane is not an object of SketchPlugin_Sketch type * \remark Type of theSketch is not verified inside */ - SketchSolver_ConstraintGroup(boost::shared_ptr theWorkplane); + SketchSolver_ConstraintGroup(std::shared_ptr theWorkplane); ~SketchSolver_ConstraintGroup(); @@ -56,22 +56,22 @@ class SketchSolver_ConstraintGroup * \param[in] theConstraint constraint to be changed * \return \c true if the constraint added or updated successfully */ - bool changeConstraint(boost::shared_ptr theConstraint); - bool changeRigidConstraint(boost::shared_ptr theConstraint); + bool changeConstraint(std::shared_ptr theConstraint); + bool changeRigidConstraint(std::shared_ptr theConstraint); /** \brief Verifies the feature attributes are used in this group * \param[in] theFeature constraint or any other object for verification of interaction * \return \c true if some of attributes are used in current group */ - bool isInteract(boost::shared_ptr theFeature) const; + bool isInteract(std::shared_ptr theFeature) const; /** \brief Verifies the specified feature is equal to the base workplane for this group * \param[in] theWorkplane the feature to be compared with base workplane * \return \c true if workplanes are the same */ - bool isBaseWorkplane(boost::shared_ptr theWorkplane) const; + bool isBaseWorkplane(std::shared_ptr theWorkplane) const; - boost::shared_ptr getWorkplane() const + std::shared_ptr getWorkplane() const { return mySketch; } @@ -84,7 +84,7 @@ class SketchSolver_ConstraintGroup /** \brief If the entity is in this group it will updated * \param[in] theEntity attribute, which values should update SolveSpace entity */ - void updateEntityIfPossible(boost::shared_ptr theEntity); + void updateEntityIfPossible(std::shared_ptr theEntity); /** \brief Searches invalid features and constraints in the group and avoids them * \return \c true if the group several constraints were removed @@ -109,8 +109,8 @@ class SketchSolver_ConstraintGroup /** \brief Searches the constraints built on the entity and emit the signal to update them * \param[in] theEntity attribute of the constraint */ - void updateRelatedConstraints(boost::shared_ptr theEntity) const; - void updateRelatedConstraints(boost::shared_ptr theFeature) const; + void updateRelatedConstraints(std::shared_ptr theEntity) const; + void updateRelatedConstraints(std::shared_ptr theFeature) const; /** \brief Adds or updates an entity in the group * @@ -120,7 +120,7 @@ class SketchSolver_ConstraintGroup * \param[in] theEntity the object of constraint * \return identifier of changed entity or 0 if entity could not be changed */ - Slvs_hEntity changeEntity(boost::shared_ptr theEntity); + Slvs_hEntity changeEntity(std::shared_ptr theEntity); Slvs_hEntity changeEntity(FeaturePtr theEntity); protected: @@ -137,9 +137,9 @@ protected: * \param[in] theNorm attribute for the normal (used to identify newly created entity) * \return identifier of created or updated normal */ - Slvs_hEntity changeNormal(boost::shared_ptr theDirX, - boost::shared_ptr theDirY, - boost::shared_ptr theNorm); + Slvs_hEntity changeNormal(std::shared_ptr theDirX, + std::shared_ptr theDirY, + std::shared_ptr theNorm); /** \brief Adds or updates a parameter in the group * \param[in] theParam the value of parameter @@ -158,14 +158,14 @@ protected: /** \brief Removes constraints from the group * \param[in] theConstraint constraint to be removed */ - void removeConstraint(boost::shared_ptr theConstraint); + void removeConstraint(std::shared_ptr theConstraint); /** \brief Change values of attribute by parameters received from SolveSpace solver * \param[in,out] theAttribute pointer to the attribute to be changed * \param[in] theEntityID identifier of SolveSpace entity, which contains updated data * \return \c true if the attribute's value has changed */ - bool updateAttribute(boost::shared_ptr theAttribute, + bool updateAttribute(std::shared_ptr theAttribute, const Slvs_hEntity& theEntityID); /** \brief Adds a constraint for a point which should not be changed during computations @@ -174,7 +174,7 @@ protected: * the 'dragged' field of SolveSpace solver, so this entity * may be changed a little during solution */ - void addTemporaryConstraintWhereDragged(boost::shared_ptr theEntity, + void addTemporaryConstraintWhereDragged(std::shared_ptr theEntity, bool theAllowToFit = true); /** \brief Remove all temporary constraint after computation finished @@ -188,7 +188,7 @@ protected: * \param[in] theSketch parameters of workplane are the attributes of this sketch * \return \c true if success, \c false if workplane parameters are not consistent */ - bool addWorkplane(boost::shared_ptr theSketch); + bool addWorkplane(std::shared_ptr theSketch); /** \brief Add the entities of constraint for points coincidence into the appropriate list * \param[in] thePoint1 identifier of the first point @@ -224,14 +224,14 @@ protected: std::list myTempConstraints; ///< The list of identifiers of temporary constraints (SLVS_C_WHERE_DRAGGED) applied for all other points moved by user // SketchPlugin entities - boost::shared_ptr mySketch; ///< Equivalent to workplane + std::shared_ptr mySketch; ///< Equivalent to workplane ConstraintMap myConstraintMap; ///< The map between SketchPlugin and SolveSpace constraints - std::map, Slvs_hEntity> myEntityAttrMap; ///< The map between "attribute" parameters of constraints and their equivalent SolveSpace entities + std::map, Slvs_hEntity> myEntityAttrMap; ///< The map between "attribute" parameters of constraints and their equivalent SolveSpace entities std::map myEntityFeatMap; ///< The map between "feature" parameters of constraints and their equivalent SolveSpace entities // Conincident items std::vector > myCoincidentPoints; ///< Stores the lists of identifiers of coincident points (to avoid unnecessary coincidence constraints) - std::set > myExtraCoincidence; ///< Additional coincidence constraints which are not necessary (coincidence between points already done + std::set > myExtraCoincidence; ///< Additional coincidence constraints which are not necessary (coincidence between points already done ///< by other constraints) but created by GUI tools. Useful when some coincidence constraints were removed }; diff --git a/src/SketchSolver/SketchSolver_ConstraintManager.cpp b/src/SketchSolver/SketchSolver_ConstraintManager.cpp index ef7420ab5..6cad183e4 100644 --- a/src/SketchSolver/SketchSolver_ConstraintManager.cpp +++ b/src/SketchSolver/SketchSolver_ConstraintManager.cpp @@ -61,15 +61,15 @@ SketchSolver_ConstraintManager::~SketchSolver_ConstraintManager() // Purpose: listen the event loop and process the message // ============================================================================ void SketchSolver_ConstraintManager::processEvent( - const boost::shared_ptr& theMessage) + const std::shared_ptr& theMessage) { if (myIsComputed) return; if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED) || theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED) || theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_MOVED)) { - boost::shared_ptr anUpdateMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr anUpdateMsg = + std::dynamic_pointer_cast(theMessage); std::set aFeatures = anUpdateMsg->objects(); bool isMovedEvt = theMessage->eventID() @@ -77,8 +77,8 @@ void SketchSolver_ConstraintManager::processEvent( if (isMovedEvt) { std::set::iterator aFeatIter; for (aFeatIter = aFeatures.begin(); aFeatIter != aFeatures.end(); aFeatIter++) { - boost::shared_ptr aSFeature = - boost::dynamic_pointer_cast(*aFeatIter); + std::shared_ptr aSFeature = + std::dynamic_pointer_cast(*aFeatIter); if (aSFeature) updateEntity(aSFeature); } @@ -86,20 +86,20 @@ void SketchSolver_ConstraintManager::processEvent( std::set::iterator aFeatIter; // iterate sketchers fisrt to create all sketches before (on load may exist several sketches) for (aFeatIter = aFeatures.begin(); aFeatIter != aFeatures.end(); aFeatIter++) { - FeaturePtr aFeature = boost::dynamic_pointer_cast(*aFeatIter); + FeaturePtr aFeature = std::dynamic_pointer_cast(*aFeatIter); if (!aFeature) continue; const std::string& aFeatureKind = aFeature->getKind(); if (aFeatureKind.compare(SketchPlugin_Sketch::ID()) == 0) { - boost::shared_ptr aSketch = boost::dynamic_pointer_cast< + std::shared_ptr aSketch = std::dynamic_pointer_cast< ModelAPI_CompositeFeature>(aFeature); changeWorkplane(aSketch); } } // then get anything but not the sketch for (aFeatIter = aFeatures.begin(); aFeatIter != aFeatures.end(); aFeatIter++) { - boost::shared_ptr aFeature = - boost::dynamic_pointer_cast(*aFeatIter); + std::shared_ptr aFeature = + std::dynamic_pointer_cast(*aFeatIter); if (!aFeature) continue; changeConstraintOrEntity(aFeature); @@ -109,8 +109,8 @@ void SketchSolver_ConstraintManager::processEvent( // Solve the set of constraints resolveConstraints(); } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED)) { - boost::shared_ptr aDeleteMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aDeleteMsg = + std::dynamic_pointer_cast(theMessage); const std::set& aFeatureGroups = aDeleteMsg->groups(); // Find SketchPlugin_Sketch::ID() in groups. The constraint groups should be updated when an object removed from Sketch @@ -148,7 +148,7 @@ void SketchSolver_ConstraintManager::processEvent( // Purpose: update workplane by given parameters of the sketch // ============================================================================ bool SketchSolver_ConstraintManager::changeWorkplane( - boost::shared_ptr theSketch) + std::shared_ptr theSketch) { bool aResult = true; // changed when a workplane wrongly updated bool isUpdated = false; @@ -179,21 +179,21 @@ bool SketchSolver_ConstraintManager::changeWorkplane( // Purpose: create/update the constraint or the feature and place it into appropriate group // ============================================================================ bool SketchSolver_ConstraintManager::changeConstraintOrEntity( - boost::shared_ptr theFeature) + std::shared_ptr theFeature) { // Search the groups which this feature touches std::set aGroups; findGroups(theFeature, aGroups); - boost::shared_ptr aConstraint = - boost::dynamic_pointer_cast(theFeature); + std::shared_ptr aConstraint = + std::dynamic_pointer_cast(theFeature); // Process the groups list if (aGroups.size() == 0) { // There are no groups applicable for this constraint => create new one // The group will be created only for constraints, not for features if (!aConstraint) return false; - boost::shared_ptr aWP = findWorkplane(aConstraint); + std::shared_ptr aWP = findWorkplane(aConstraint); if (!aWP) return false; SketchSolver_ConstraintGroup* aGroup = new SketchSolver_ConstraintGroup(aWP); @@ -259,7 +259,7 @@ bool SketchSolver_ConstraintManager::changeConstraintOrEntity( // Purpose: update any element on the sketch, which is used by constraints // ============================================================================ void SketchSolver_ConstraintManager::updateEntity( - boost::shared_ptr theFeature) + std::shared_ptr theFeature) { // Create list of attributes depending on type of the feature std::vector anAttrList; @@ -292,7 +292,7 @@ void SketchSolver_ConstraintManager::updateEntity( for (aGroupIter = myGroups.begin(); aGroupIter != myGroups.end(); aGroupIter++) { if ((*aGroupIter)->isEmpty()) continue; - boost::shared_ptr anAttribute = boost::dynamic_pointer_cast< + std::shared_ptr anAttribute = std::dynamic_pointer_cast< ModelAPI_Attribute>(theFeature->data()->attribute(*anAttrIter)); (*aGroupIter)->updateEntityIfPossible(anAttribute); } @@ -310,10 +310,10 @@ void SketchSolver_ConstraintManager::updateEntity( // Purpose: search groups of entities interacting with given feature // ============================================================================ void SketchSolver_ConstraintManager::findGroups( - boost::shared_ptr theFeature, + std::shared_ptr theFeature, std::set& theGroupIDs) const { - boost::shared_ptr aWP = findWorkplane(theFeature); + std::shared_ptr aWP = findWorkplane(theFeature); SketchSolver_ConstraintGroup* anEmptyGroup = 0; // appropriate empty group for specified constraint std::vector::const_iterator aGroupIter; @@ -335,19 +335,19 @@ void SketchSolver_ConstraintManager::findGroups( // Class: SketchSolver_Session // Purpose: search workplane containing given feature // ============================================================================ -boost::shared_ptr SketchSolver_ConstraintManager::findWorkplane( - boost::shared_ptr theFeature) const +std::shared_ptr SketchSolver_ConstraintManager::findWorkplane( + std::shared_ptr theFeature) const { // Already verified workplanes - std::set > aVerified; + std::set > aVerified; std::vector::const_iterator aGroupIter; for (aGroupIter = myGroups.begin(); aGroupIter != myGroups.end(); aGroupIter++) { - boost::shared_ptr aWP = (*aGroupIter)->getWorkplane(); + std::shared_ptr aWP = (*aGroupIter)->getWorkplane(); if (aVerified.find(aWP) != aVerified.end()) continue; - boost::shared_ptr aWPFeatures = boost::dynamic_pointer_cast< + std::shared_ptr aWPFeatures = std::dynamic_pointer_cast< ModelAPI_AttributeRefList>(aWP->data()->attribute(SketchPlugin_Sketch::FEATURES_ID())); std::list aFeaturesList = aWPFeatures->list(); std::list::const_iterator anIter; @@ -357,7 +357,7 @@ boost::shared_ptr SketchSolver_ConstraintManager::fin aVerified.insert(aWP); } - return boost::shared_ptr(); + return std::shared_ptr(); } // ============================================================================ diff --git a/src/SketchSolver/SketchSolver_ConstraintManager.h b/src/SketchSolver/SketchSolver_ConstraintManager.h index 422ae0347..c37637a39 100644 --- a/src/SketchSolver/SketchSolver_ConstraintManager.h +++ b/src/SketchSolver/SketchSolver_ConstraintManager.h @@ -42,7 +42,7 @@ class SketchSolver_ConstraintManager : public Events_Listener /** \brief Implementation of Event Listener method * \param[in] theMessage the data of the event */ - virtual void processEvent(const boost::shared_ptr& theMessage); + virtual void processEvent(const std::shared_ptr& theMessage); protected: SketchSolver_ConstraintManager(); @@ -52,32 +52,32 @@ class SketchSolver_ConstraintManager : public Events_Listener * \param[in] theFeature sketch feature to be changed * \return \c true if the feature changed successfully */ - bool changeConstraintOrEntity(boost::shared_ptr theFeature); + bool changeConstraintOrEntity(std::shared_ptr theFeature); /** \brief Removes a constraint from the manager * \param[in] theConstraint constraint to be removed * \return \c true if the constraint removed successfully */ - bool removeConstraint(boost::shared_ptr theConstraint); + bool removeConstraint(std::shared_ptr theConstraint); /** \brief Adds or updates a workplane in the manager * \param[in] theSketch the feature to create or update workplane * \return \c true if the workplane changed successfully * \remark Type of theSketch is not verified inside */ - bool changeWorkplane(boost::shared_ptr theSketch); + bool changeWorkplane(std::shared_ptr theSketch); /** \brief Removes a workplane from the manager. * All groups based on such workplane will be removed too. * \param[in] theSketch the feature to be removed * \return \c true if the workplane removed successfully */ - bool removeWorkplane(boost::shared_ptr theSketch); + bool removeWorkplane(std::shared_ptr theSketch); /** \brief Updates entity which is neither workplane nor constraint * \param[in] theFeature entity to be updated */ - void updateEntity(boost::shared_ptr theFeature); + void updateEntity(std::shared_ptr theFeature); /** \brief Goes through the list of groups and solve the constraints */ @@ -88,15 +88,15 @@ class SketchSolver_ConstraintManager : public Events_Listener * \param[in] theFeature object to be found * \param[out] theGroups list of group indexes interacted with the feature */ - void findGroups(boost::shared_ptr theFeature, + void findGroups(std::shared_ptr theFeature, std::set& theGroupIDs) const; /** \brief Searches in the list of groups the workplane which constains specified feature * \param[in] theFeature object to be found * \return workplane containing the feature */ - boost::shared_ptr findWorkplane( - boost::shared_ptr theFeature) const; + std::shared_ptr findWorkplane( + std::shared_ptr theFeature) const; private: static SketchSolver_ConstraintManager* _self; ///< Self pointer to implement singleton functionality diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 3063959fb..73808b9af 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -123,8 +123,8 @@ QMenu* XGUI_ContextMenuMgr::objectBrowserMenu() const bool hasFeature = false; foreach(ObjectPtr aObj, aObjects) { - FeaturePtr aFeature = boost::dynamic_pointer_cast(aObj); - ResultPtr aResult = boost::dynamic_pointer_cast(aObj); + FeaturePtr aFeature = std::dynamic_pointer_cast(aObj); + ResultPtr aResult = std::dynamic_pointer_cast(aObj); if (aResult) hasResult = true; if (aFeature) @@ -136,7 +136,7 @@ QMenu* XGUI_ContextMenuMgr::objectBrowserMenu() const if (aSelected == 1) { ObjectPtr aObject = aObjects.first(); if (aObject) { - ResultPartPtr aPart = boost::dynamic_pointer_cast(aObject); + ResultPartPtr aPart = std::dynamic_pointer_cast(aObject); if (aPart) { if (aMgr->activeDocument() == aPart->partDoc()) aMenu->addAction(action("DEACTIVATE_PART_CMD")); @@ -205,7 +205,7 @@ void XGUI_ContextMenuMgr::addViewerItems(QMenu* theMenu) const bool isShading = false; foreach(ObjectPtr aObject, aObjects) { - ResultPtr aRes = boost::dynamic_pointer_cast(aObject); + ResultPtr aRes = std::dynamic_pointer_cast(aObject); if (aRes && myWorkshop->displayer()->isVisible(aRes)) { isVisible = true; isShading = (myWorkshop->displayer()->displayMode(aObject) == XGUI_Displayer::Shading); diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index f20953891..a37d228eb 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -53,14 +53,14 @@ void XGUI_Displayer::display(ObjectPtr theObject, bool isUpdateViewer) } else { AISObjectPtr anAIS; - GeomPresentablePtr aPrs = boost::dynamic_pointer_cast(theObject); + GeomPresentablePtr aPrs = std::dynamic_pointer_cast(theObject); bool isShading = false; if (aPrs) { anAIS = aPrs->getAISObject(AISObjectPtr()); } else { - ResultPtr aResult = boost::dynamic_pointer_cast(theObject); + ResultPtr aResult = std::dynamic_pointer_cast(theObject); if (aResult) { - boost::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); + std::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); if (aShapePtr) { anAIS = AISObjectPtr(new GeomAPI_AISObject()); anAIS->setImpl(new Handle(AIS_InteractiveObject)(new ModuleBase_ResultPrs(aResult))); @@ -126,7 +126,7 @@ void XGUI_Displayer::redisplay(ObjectPtr theObject, bool isUpdateViewer) AISObjectPtr aAISObj = getAISObject(theObject); Handle(AIS_InteractiveObject) aAISIO = aAISObj->impl(); - GeomPresentablePtr aPrs = boost::dynamic_pointer_cast(theObject); + GeomPresentablePtr aPrs = std::dynamic_pointer_cast(theObject); if (aPrs) { AISObjectPtr aAIS_Obj = aPrs->getAISObject(aAISObj); if (!aAIS_Obj) { diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index 3bffe38a0..575dba31f 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -8,7 +8,7 @@ #include "XGUI.h" #include -#include +#include #include diff --git a/src/XGUI/XGUI_DocumentDataModel.cpp b/src/XGUI/XGUI_DocumentDataModel.cpp index 42d96c8be..1ed348e1c 100644 --- a/src/XGUI/XGUI_DocumentDataModel.cpp +++ b/src/XGUI/XGUI_DocumentDataModel.cpp @@ -45,20 +45,20 @@ XGUI_DocumentDataModel::~XGUI_DocumentDataModel() clearSubModels(); } -void XGUI_DocumentDataModel::processEvent(const boost::shared_ptr& theMessage) +void XGUI_DocumentDataModel::processEvent(const std::shared_ptr& theMessage) { DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument(); // Created object event ******************* if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED)) { - boost::shared_ptr aUpdMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aUpdMsg = + std::dynamic_pointer_cast(theMessage); std::set aObjects = aUpdMsg->objects(); std::set::const_iterator aIt; for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) { ObjectPtr aObject = (*aIt); - FeaturePtr aFeature = boost::dynamic_pointer_cast(aObject); + FeaturePtr aFeature = std::dynamic_pointer_cast(aObject); if (aFeature && (!aFeature->isInHistory())) continue; @@ -97,8 +97,8 @@ void XGUI_DocumentDataModel::processEvent(const boost::shared_ptreventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED)) { - boost::shared_ptr aUpdMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aUpdMsg = + std::dynamic_pointer_cast(theMessage); DocumentPtr aDoc = aUpdMsg->document(); std::set aGroups = aUpdMsg->groups(); @@ -141,7 +141,7 @@ void XGUI_DocumentDataModel::processEvent(const boost::shared_ptreventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED)) { - //boost::shared_ptr aUpdMsg = boost::dynamic_pointer_cast(theMessage); + //std::shared_ptr aUpdMsg = std::dynamic_pointer_cast(theMessage); //ObjectPtr aFeature = aUpdMsg->feature(); //DocumentPtr aDoc = aFeature->document(); @@ -204,7 +204,7 @@ QVariant XGUI_DocumentDataModel::data(const QModelIndex& theIndex, int theRole) int aOffset = historyOffset(); DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument(); ObjectPtr aObj = aRootDoc->object(ModelAPI_Feature::group(), theIndex.row() - aOffset); - FeaturePtr aFeature = boost::dynamic_pointer_cast(aObj); + FeaturePtr aFeature = std::dynamic_pointer_cast(aObj); if (!aFeature) return QVariant(); switch (theRole) { @@ -541,7 +541,7 @@ QModelIndex XGUI_DocumentDataModel::objectIndex(const ObjectPtr theObject) const DocumentPtr aDoc = theObject->document(); if (aDoc == aRootDoc) { // This feature belongs to histrory or top model - FeaturePtr aFeature = boost::dynamic_pointer_cast(theObject); + FeaturePtr aFeature = std::dynamic_pointer_cast(theObject); if (aFeature) { int aId; int aNb = aRootDoc->size(ModelAPI_Feature::group()); diff --git a/src/XGUI/XGUI_DocumentDataModel.h b/src/XGUI/XGUI_DocumentDataModel.h index a7e9fc944..ac1466134 100644 --- a/src/XGUI/XGUI_DocumentDataModel.h +++ b/src/XGUI/XGUI_DocumentDataModel.h @@ -28,7 +28,7 @@ Q_OBJECT virtual ~XGUI_DocumentDataModel(); // Event Listener method - virtual void processEvent(const boost::shared_ptr& theMessage); + virtual void processEvent(const std::shared_ptr& theMessage); virtual QVariant data(const QModelIndex& theIndex, int theRole) const; virtual QVariant headerData(int theSection, Qt::Orientation theOrient, int theRole = diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 699d6e518..0f8244534 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -58,7 +58,7 @@ void XGUI_DataTree::mouseDoubleClickEvent(QMouseEvent* theEvent) QModelIndex aIndex = currentIndex(); XGUI_DocumentDataModel* aModel = dataModel(); ObjectPtr aObject = aModel->object(aIndex); - ResultPartPtr aPart = boost::dynamic_pointer_cast(aObject); + ResultPartPtr aPart = std::dynamic_pointer_cast(aObject); if (aPart) { aPart->activate(); } @@ -352,7 +352,7 @@ void XGUI_ObjectsBrowser::setObjectsSelected(const QList& theObjects) } //*************************************************** -void XGUI_ObjectsBrowser::processEvent(const boost::shared_ptr& theMessage) +void XGUI_ObjectsBrowser::processEvent(const std::shared_ptr& theMessage) { myDocModel->processEvent(theMessage); } diff --git a/src/XGUI/XGUI_ObjectsBrowser.h b/src/XGUI/XGUI_ObjectsBrowser.h index 9e7f901d7..15e5e3690 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.h +++ b/src/XGUI/XGUI_ObjectsBrowser.h @@ -97,7 +97,7 @@ Q_OBJECT void rebuildDataTree(); - void processEvent(const boost::shared_ptr& theMessage); + void processEvent(const std::shared_ptr& theMessage); // Resets the object browser into initial state void clearContent(); diff --git a/src/XGUI/XGUI_PartDataModel.cpp b/src/XGUI/XGUI_PartDataModel.cpp index 75b573034..c7f1b81a2 100644 --- a/src/XGUI/XGUI_PartDataModel.cpp +++ b/src/XGUI/XGUI_PartDataModel.cpp @@ -19,7 +19,7 @@ //ObjectPtr featureObj(const ObjectPtr& theFeature) //{ -// ObjectPtr aObject = boost::dynamic_pointer_cast(theFeature); +// ObjectPtr aObject = std::dynamic_pointer_cast(theFeature); // if (aObject) // return aObject->featureRef(); // return theFeature; @@ -259,7 +259,7 @@ QVariant XGUI_PartDataModel::data(const QModelIndex& theIndex, int theRole) cons DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument(); ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultPart::group(), myId); if (aObject) - return boost::dynamic_pointer_cast(aObject)->data()->name().c_str(); + return std::dynamic_pointer_cast(aObject)->data()->name().c_str(); } case ParamsFolder: return tr("Parameters") + QString(" (%1)").arg(rowCount(theIndex)); @@ -273,14 +273,14 @@ QVariant XGUI_PartDataModel::data(const QModelIndex& theIndex, int theRole) cons ObjectPtr aObject = partDocument()->object(ModelAPI_ResultParameters::group(), theIndex.row()); if (aObject) - return boost::dynamic_pointer_cast(aObject)->data()->name().c_str(); + return std::dynamic_pointer_cast(aObject)->data()->name().c_str(); } break; case ConstructObject: { ObjectPtr aObject = partDocument()->object(ModelAPI_ResultConstruction::group(), theIndex.row()); if (aObject) - return boost::dynamic_pointer_cast(aObject)->data()->name().c_str(); + return std::dynamic_pointer_cast(aObject)->data()->name().c_str(); } break; case BodiesObject: { @@ -326,7 +326,7 @@ QVariant XGUI_PartDataModel::data(const QModelIndex& theIndex, int theRole) cons } case HistoryObject: { ObjectPtr aObject = partDocument()->object(ModelAPI_Feature::group(), theIndex.row() - 4); - FeaturePtr aFeature = boost::dynamic_pointer_cast(aObject); + FeaturePtr aFeature = std::dynamic_pointer_cast(aObject); if (aFeature) return QIcon(XGUI_Workshop::featureIcon(aFeature->getKind())); } @@ -447,7 +447,7 @@ DocumentPtr XGUI_PartDataModel::partDocument() const { DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument(); ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultPart::group(), myId); - ResultPartPtr aPart = boost::dynamic_pointer_cast(aObject); + ResultPartPtr aPart = std::dynamic_pointer_cast(aObject); if (aPart) return aPart->partDoc(); return DocumentPtr(); // null if not found @@ -507,7 +507,7 @@ ResultPartPtr XGUI_PartDataModel::part() const { DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument(); ObjectPtr aObj = aRootDoc->object(ModelAPI_ResultPart::group(), myId); - return boost::dynamic_pointer_cast(aObj); + return std::dynamic_pointer_cast(aObj); } QModelIndex XGUI_PartDataModel::objectIndex(const ObjectPtr& theObject) const diff --git a/src/XGUI/XGUI_QtEvents.cpp b/src/XGUI/XGUI_QtEvents.cpp index a8e620178..ac4f00e87 100644 --- a/src/XGUI/XGUI_QtEvents.cpp +++ b/src/XGUI/XGUI_QtEvents.cpp @@ -10,7 +10,7 @@ QEvent::Type PostponeMessageQtEvent::PostponeMessageQtEventType = QEvent::Type(QEvent::registerEventType()); -boost::shared_ptr PostponeMessageQtEvent::postponedMessage() +std::shared_ptr PostponeMessageQtEvent::postponedMessage() { return myMessage; } diff --git a/src/XGUI/XGUI_QtEvents.h b/src/XGUI/XGUI_QtEvents.h index 4fdb33857..5c389fade 100644 --- a/src/XGUI/XGUI_QtEvents.h +++ b/src/XGUI/XGUI_QtEvents.h @@ -21,7 +21,7 @@ class XGUI_EXPORT PostponeMessageQtEvent : public QEvent public: static QEvent::Type PostponeMessageQtEventType; - PostponeMessageQtEvent(const boost::shared_ptr& theMessage) + PostponeMessageQtEvent(const std::shared_ptr& theMessage) : QEvent(PostponeMessageQtEventType), myMessage(theMessage) { @@ -31,10 +31,10 @@ class XGUI_EXPORT PostponeMessageQtEvent : public QEvent return PostponeMessageQtEventType; } - boost::shared_ptr postponedMessage(); + std::shared_ptr postponedMessage(); private: - boost::shared_ptr myMessage; + std::shared_ptr myMessage; }; #endif /* XGUI_QEVENTS_H_ */ diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index 95a219c6a..84e43abf3 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -76,7 +76,7 @@ std::string featureInfo(FeaturePtr theFeature) if (theFeature->data()) { return theFeature; } else { - ObjectPtr aObject = boost::dynamic_pointer_cast(theFeature); + ObjectPtr aObject = std::dynamic_pointer_cast(theFeature); return aObject->featureRef(); } }*/ diff --git a/src/XGUI/XGUI_Tools.h b/src/XGUI/XGUI_Tools.h index 518d5e597..cc80b28be 100644 --- a/src/XGUI/XGUI_Tools.h +++ b/src/XGUI/XGUI_Tools.h @@ -7,7 +7,7 @@ #include -#include +#include /*! \brief Return directory part of the file path. diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 12e6bb7b3..12f3a4767 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -256,7 +256,7 @@ XGUI_Workbench* XGUI_Workshop::addWorkbench(const QString& theName) } //****************************************************** -void XGUI_Workshop::processEvent(const boost::shared_ptr& theMessage) +void XGUI_Workshop::processEvent(const std::shared_ptr& theMessage) { if (QApplication::instance()->thread() != QThread::currentThread()) { #ifdef _DEBUG @@ -270,8 +270,8 @@ void XGUI_Workshop::processEvent(const boost::shared_ptr& theMes //A message to start feature creation received. if (theMessage->eventID() == Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) { - boost::shared_ptr aFeatureMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aFeatureMsg = + std::dynamic_pointer_cast(theMessage); if (!aFeatureMsg->isInternal()) { addFeature(aFeatureMsg); } @@ -279,8 +279,8 @@ void XGUI_Workshop::processEvent(const boost::shared_ptr& theMes // Process creation of Part else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED)) { - boost::shared_ptr aUpdMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aUpdMsg = + std::dynamic_pointer_cast(theMessage); onFeatureCreatedMsg(aUpdMsg); if (myUpdatePrefs) { if (mySalomeConnector) @@ -294,22 +294,22 @@ void XGUI_Workshop::processEvent(const boost::shared_ptr& theMes // Redisplay feature else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY)) { - boost::shared_ptr aUpdMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aUpdMsg = + std::dynamic_pointer_cast(theMessage); onFeatureRedisplayMsg(aUpdMsg); } //Update property panel on corresponding message. If there is no current operation (no //property panel), or received message has different feature to the current - do nothing. else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED)) { - boost::shared_ptr anUpdateMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr anUpdateMsg = + std::dynamic_pointer_cast(theMessage); onFeatureUpdatedMsg(anUpdateMsg); } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED)) { - boost::shared_ptr aDelMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aDelMsg = + std::dynamic_pointer_cast(theMessage); onObjectDeletedMsg(aDelMsg); } @@ -321,8 +321,8 @@ void XGUI_Workshop::processEvent(const boost::shared_ptr& theMes } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_TOSHOW)) { - boost::shared_ptr anUpdateMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr anUpdateMsg = + std::dynamic_pointer_cast(theMessage); const std::set& aObjList = anUpdateMsg->objects(); QList aList; std::set::const_iterator aIt; @@ -332,8 +332,8 @@ void XGUI_Workshop::processEvent(const boost::shared_ptr& theMes } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_TOHIDE)) { - boost::shared_ptr anUpdateMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr anUpdateMsg = + std::dynamic_pointer_cast(theMessage); const std::set& aObjList = anUpdateMsg->objects(); QList aList; std::set::const_iterator aIt; @@ -344,8 +344,8 @@ void XGUI_Workshop::processEvent(const boost::shared_ptr& theMes //An operation passed by message. Start it, process and commit. else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OPERATION_LAUNCHED)) { - boost::shared_ptr aPartSetMsg = - boost::dynamic_pointer_cast(theMessage); + std::shared_ptr aPartSetMsg = + std::dynamic_pointer_cast(theMessage); //myPropertyPanel->cleanContent(); ModuleBase_Operation* anOperation = (ModuleBase_Operation*) aPartSetMsg->pointer(); @@ -371,7 +371,7 @@ void XGUI_Workshop::processEvent(const boost::shared_ptr& theMes } std::string aGrpName = ModelAPI_ResultPart::group(); for (int i = 0; i < aDoc->size(aGrpName); i++) { - ResultPartPtr aPart = boost::dynamic_pointer_cast(aDoc->object(aGrpName, i)); + ResultPartPtr aPart = std::dynamic_pointer_cast(aDoc->object(aGrpName, i)); if (aPart->partDoc() == aActiveDoc) { activatePart(aPart); // Activate a part which corresponds to active Doc return; @@ -382,7 +382,7 @@ void XGUI_Workshop::processEvent(const boost::shared_ptr& theMes } else { //Show error dialog if error message received. - boost::shared_ptr anAppError = boost::dynamic_pointer_cast(theMessage); + std::shared_ptr anAppError = std::dynamic_pointer_cast(theMessage); if (anAppError) { emit errorOccurred(QString::fromLatin1(anAppError->description())); } @@ -404,7 +404,7 @@ void XGUI_Workshop::onStartWaiting() } //****************************************************** -void XGUI_Workshop::onFeatureUpdatedMsg(const boost::shared_ptr& theMsg) +void XGUI_Workshop::onFeatureUpdatedMsg(const std::shared_ptr& theMsg) { std::set aFeatures = theMsg->objects(); if (myOperationMgr->hasOperation()) { @@ -424,7 +424,7 @@ void XGUI_Workshop::onFeatureUpdatedMsg(const boost::shared_ptr& theMsg) +void XGUI_Workshop::onFeatureRedisplayMsg(const std::shared_ptr& theMsg) { std::set aObjects = theMsg->objects(); std::set::const_iterator aIt; @@ -433,7 +433,7 @@ void XGUI_Workshop::onFeatureRedisplayMsg(const boost::shared_ptrdata() || !aObj->data()->isValid(); if (!aHide) { // check that this is not hidden result - ResultPtr aRes = boost::dynamic_pointer_cast(aObj); + ResultPtr aRes = std::dynamic_pointer_cast(aObj); aHide = aRes && aRes->isConcealed(); } if (aHide) @@ -465,7 +465,7 @@ void XGUI_Workshop::onFeatureRedisplayMsg(const boost::shared_ptr& theMsg) +void XGUI_Workshop::onFeatureCreatedMsg(const std::shared_ptr& theMsg) { std::set aObjects = theMsg->objects(); @@ -473,7 +473,7 @@ void XGUI_Workshop::onFeatureCreatedMsg(const boost::shared_ptr(*aIt); + ResultPartPtr aPart = std::dynamic_pointer_cast(*aIt); if (aPart) { aHasPart = true; // If a feature is created from the aplication's python console @@ -496,7 +496,7 @@ void XGUI_Workshop::onFeatureCreatedMsg(const boost::shared_ptr& theMsg) +void XGUI_Workshop::onObjectDeletedMsg(const std::shared_ptr& theMsg) { if (myObjectBrowser) myObjectBrowser->processEvent(theMsg); @@ -561,7 +561,7 @@ bool XGUI_Workshop::event(QEvent * theEvent) { PostponeMessageQtEvent* aPostponedEv = dynamic_cast(theEvent); if (aPostponedEv) { - boost::shared_ptr aEventPtr = aPostponedEv->postponedMessage(); + std::shared_ptr aEventPtr = aPostponedEv->postponedMessage(); processEvent(aEventPtr); return true; } @@ -571,7 +571,7 @@ bool XGUI_Workshop::event(QEvent * theEvent) /* * */ -void XGUI_Workshop::addFeature(const boost::shared_ptr& theMessage) +void XGUI_Workshop::addFeature(const std::shared_ptr& theMessage) { if (!theMessage) { #ifdef _DEBUG @@ -831,7 +831,7 @@ void XGUI_Workshop::onRebuild() aMgr->startOperation(); } static const Events_ID aRebuildEvent = Events_Loop::loop()->eventByName("Rebuild"); - Events_Loop::loop()->send(boost::shared_ptr( + Events_Loop::loop()->send(std::shared_ptr( new Events_Message(aRebuildEvent, this))); if (!aWasOperation) { aMgr->finishOperation(); @@ -1080,7 +1080,7 @@ void XGUI_Workshop::changeCurrentDocument(ObjectPtr theObj) { SessionPtr aMgr = ModelAPI_Session::get(); if (theObj) { - ResultPartPtr aPart = boost::dynamic_pointer_cast(theObj); + ResultPartPtr aPart = std::dynamic_pointer_cast(theObj); if (aPart) { DocumentPtr aPartDoc = aPart->partDoc(); if (aPartDoc) { @@ -1109,7 +1109,7 @@ void XGUI_Workshop::onContextMenuCommand(const QString& theId, bool isChecked) { QList aObjects = mySelector->selection()->selectedObjects(); if ((theId == "ACTIVATE_PART_CMD") && (aObjects.size() > 0)) { - ResultPartPtr aPart = boost::dynamic_pointer_cast(aObjects.first()); + ResultPartPtr aPart = std::dynamic_pointer_cast(aObjects.first()); activatePart(aPart); } else if (theId == "DEACTIVATE_PART_CMD") activatePart(ResultPartPtr()); @@ -1170,7 +1170,7 @@ void XGUI_Workshop::activateLastPart() DocumentPtr aDoc = aMgr->moduleDocument(); std::string aGrpName = ModelAPI_ResultPart::group(); ObjectPtr aLastPart = aDoc->object(aGrpName, aDoc->size(aGrpName) - 1); - ResultPartPtr aPart = boost::dynamic_pointer_cast(aLastPart); + ResultPartPtr aPart = std::dynamic_pointer_cast(aLastPart); if (aPart) { activatePart(aPart); } @@ -1189,7 +1189,7 @@ void XGUI_Workshop::deleteObjects(const QList& theList) aMgr->startOperation(); foreach (ObjectPtr aObj, theList) { - ResultPartPtr aPart = boost::dynamic_pointer_cast(aObj); + ResultPartPtr aPart = std::dynamic_pointer_cast(aObj); if (aPart) { DocumentPtr aDoc = aPart->document(); if (aDoc == aMgr->activeDocument()) { @@ -1197,7 +1197,7 @@ void XGUI_Workshop::deleteObjects(const QList& theList) } //aMgr->moduleDocument()->removeFeature(aPart->owner()); } else { - FeaturePtr aFeature = boost::dynamic_pointer_cast(aObj); + FeaturePtr aFeature = std::dynamic_pointer_cast(aObj); if (aFeature) aObj->document()->removeFeature(aFeature); } @@ -1212,7 +1212,7 @@ void XGUI_Workshop::showObjects(const QList& theList, bool isVisible) { foreach (ObjectPtr aObj, theList) { - ResultPtr aRes = boost::dynamic_pointer_cast(aObj); + ResultPtr aRes = std::dynamic_pointer_cast(aObj); if (aRes) { if (isVisible) { myDisplayer->display(aRes, false); @@ -1287,7 +1287,7 @@ void XGUI_Workshop::displayAllResults() displayDocumentResults(aRootDoc); for (int i = 0; i < aRootDoc->size(ModelAPI_ResultPart::group()); i++) { ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultPart::group(), i); - ResultPartPtr aPart = boost::dynamic_pointer_cast(aObject); + ResultPartPtr aPart = std::dynamic_pointer_cast(aObject); displayDocumentResults(aPart->partDoc()); } myDisplayer->updateViewer(); diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index 764e19f2d..43751c0dd 100644 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -105,7 +105,7 @@ Q_OBJECT XGUI_Workbench* addWorkbench(const QString& theName); //! Redefinition of Events_Listener method - virtual void processEvent(const boost::shared_ptr& theMessage); + virtual void processEvent(const std::shared_ptr& theMessage); //! Returns an object which provides interface to Salome Module (LightApp_Module) XGUI_SalomeConnector* salomeConnector() const @@ -219,13 +219,13 @@ signals: protected: bool event(QEvent * theEvent); //Event-loop processing methods: - void addFeature(const boost::shared_ptr&); + void addFeature(const std::shared_ptr&); void connectWithOperation(ModuleBase_Operation* theOperation); - void onFeatureUpdatedMsg(const boost::shared_ptr& theMsg); - void onFeatureCreatedMsg(const boost::shared_ptr& theMsg); - void onFeatureRedisplayMsg(const boost::shared_ptr& theMsg); - void onObjectDeletedMsg(const boost::shared_ptr& theMsg); + void onFeatureUpdatedMsg(const std::shared_ptr& theMsg); + void onFeatureCreatedMsg(const std::shared_ptr& theMsg); + void onFeatureRedisplayMsg(const std::shared_ptr& theMsg); + void onObjectDeletedMsg(const std::shared_ptr& theMsg); void validateOperation(const QString& theOperationId); -- 2.39.2