From 8ca8dcce41467a32024022e8930716d0d635d82f Mon Sep 17 00:00:00 2001 From: spo Date: Fri, 31 Jul 2015 12:20:47 +0300 Subject: [PATCH] Fix: critical make_shared problem in Debian 6 --- src/Config/Config_ValidatorReader.cpp | 4 +-- .../FeaturesPlugin_ExtrusionBoolean.cpp | 6 ++--- .../FeaturesPlugin_Revolution.cpp | 6 ++--- .../FeaturesPlugin_RevolutionBoolean.cpp | 8 +++--- src/GeomAlgoAPI/GeomAlgoAPI_Movement.cpp | 3 +-- src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp | 3 +-- src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp | 10 +++---- src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp | 26 +++++++++---------- src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp | 3 +-- src/Model/Model_ResultPart.cpp | 2 +- src/PartSet/PartSet_WidgetSketchLabel.cpp | 2 +- src/PartSetPlugin/PartSetPlugin_Plugin.cpp | 4 +-- src/SketchPlugin/SketchPlugin_Plugin.cpp | 4 +-- src/XGUI/XGUI_ActionsMgr.cpp | 4 +-- 14 files changed, 39 insertions(+), 46 deletions(-) diff --git a/src/Config/Config_ValidatorReader.cpp b/src/Config/Config_ValidatorReader.cpp index ef969cd55..dfeb81cc7 100644 --- a/src/Config/Config_ValidatorReader.cpp +++ b/src/Config/Config_ValidatorReader.cpp @@ -92,8 +92,8 @@ void Config_ValidatorReader::processSelectionFilter(xmlNodePtr theNode) { Events_ID aFilterEvent = Events_Loop::eventByName(EVENT_SELFILTER_LOADED); Events_Loop* aEvLoop = Events_Loop::loop(); - std::shared_ptr aMessage = - std::make_shared(aFilterEvent, this); + std::shared_ptr aMessage( + new Config_SelectionFilterMessage(aFilterEvent, this)); std::string aSelectionFilterId; std::list aParameters; getParametersInfo(theNode, aSelectionFilterId, aParameters); diff --git a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp index 4df58cd62..7fceaf804 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp @@ -74,9 +74,7 @@ void FeaturesPlugin_ExtrusionBoolean::makeSolids(const ListOfShape& theFaces, theResults.clear(); for(ListOfShape::const_iterator aFacesIt = theFaces.begin(); aFacesIt != theFaces.end(); aFacesIt++) { std::shared_ptr aBaseShape = *aFacesIt; - std::shared_ptr aPrismAlgo = std::make_shared(aBaseShape, - aToShape, aToSize, - aFromShape, aFromSize); + std::shared_ptr aPrismAlgo = std::shared_ptr(new GeomAlgoAPI_Prism(aBaseShape, aToShape, aToSize, aFromShape, aFromSize)); // Checking that the algorithm worked properly. if(!aPrismAlgo->isDone() || !aPrismAlgo->shape().get() || aPrismAlgo->shape()->isNull() || @@ -88,4 +86,4 @@ void FeaturesPlugin_ExtrusionBoolean::makeSolids(const ListOfShape& theFaces, theResults.push_back(aPrismAlgo->shape()); theAlgos.push_back(aPrismAlgo); } -} \ No newline at end of file +} diff --git a/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp b/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp index 3bd64910c..829268839 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp @@ -64,12 +64,12 @@ void FeaturesPlugin_Revolution::execute() std::shared_ptr anEdge; std::shared_ptr anObjRef = selection(AXIS_OBJECT_ID()); if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) { - anEdge = std::make_shared(anObjRef->value()); + anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->value())); } else if(anObjRef->context() && anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) { - anEdge = std::make_shared(anObjRef->context()->shape()); + anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->context()->shape())); } if(anEdge) { - anAxis = std::make_shared(anEdge->line()->location(), anEdge->line()->direction()); + anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction())); } // Getting angles. diff --git a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp index e99a26428..ee3e750db 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp @@ -48,7 +48,7 @@ void FeaturesPlugin_RevolutionBoolean::makeSolids(const ListOfShape& theFaces, if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->value())); } else if(anObjRef->context() && anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) { - anEdge = std::make_shared(anObjRef->context()->shape()); + anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->context()->shape())); } if(anEdge) { anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction())); @@ -91,9 +91,7 @@ void FeaturesPlugin_RevolutionBoolean::makeSolids(const ListOfShape& theFaces, theResults.clear(); for(ListOfShape::const_iterator aFacesIt = theFaces.begin(); aFacesIt != theFaces.end(); aFacesIt++) { std::shared_ptr aBaseShape = *aFacesIt; - std::shared_ptr aRevolAlgo = std::make_shared(aBaseShape, anAxis, - aToShape, aToAngle, - aFromShape, aFromAngle); + std::shared_ptr aRevolAlgo = std::shared_ptr(new GeomAlgoAPI_Revolution(aBaseShape, anAxis, aToShape, aToAngle, aFromShape, aFromAngle)); // Checking that the algorithm worked properly. if(!aRevolAlgo->isDone() || !aRevolAlgo->shape().get() || aRevolAlgo->shape()->isNull() || @@ -105,4 +103,4 @@ void FeaturesPlugin_RevolutionBoolean::makeSolids(const ListOfShape& theFaces, theResults.push_back(aRevolAlgo->shape()); theAlgos.push_back(aRevolAlgo); } -} \ No newline at end of file +} diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Movement.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Movement.cpp index a35988cde..9be419ffe 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Movement.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Movement.cpp @@ -53,8 +53,7 @@ void GeomAlgoAPI_Movement::build(std::shared_ptr theSourceShape, TopLoc_Location aDelta(aTrsf); aResult = aSourceShape.Moved(aDelta); // store the accumulated information about the result and this delta - myTrsf = std::make_shared( - new gp_Trsf(aTrsf * aSourceShape.Location().Transformation())); + myTrsf = std::shared_ptr(new GeomAPI_Trsf(new gp_Trsf(aTrsf * aSourceShape.Location().Transformation()))); myDone = true; // is OK for sure } else { BRepBuilderAPI_Transform* aBuilder = new BRepBuilderAPI_Transform(aSourceShape, aTrsf, true); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp index d8fd7a749..6e28fc603 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Placement.cpp @@ -195,8 +195,7 @@ void GeomAlgoAPI_Placement::build( TopoDS_Shape aResult = aSourceShape.Moved(aDelta); myShape->setImpl(new TopoDS_Shape(aResult)); // store the accumulated information about the result and this delta - myTrsf = std::make_shared( - new gp_Trsf(aTrsf * aSourceShape.Location().Transformation())); + myTrsf = std::shared_ptr(new GeomAPI_Trsf(new gp_Trsf(aTrsf * aSourceShape.Location().Transformation()))); myDone = true; // it is allways true for simple transformation generation } else { // internal rebuild of the shape // Transform the shape with copying it diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp index 4c7eb7ed1..0677d7fc6 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Prism.cpp @@ -111,19 +111,19 @@ void GeomAlgoAPI_Prism::build(const std::shared_ptr& theBasis, aResult = GeomAlgoAPI_DFLoader::refineResult(aResult); } // fill data map to keep correct orientation of sub-shapes - myMap = std::make_shared(); + myMap = std::shared_ptr(new GeomAPI_DataMapOfShapeShape()); for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) { std::shared_ptr aCurrentShape(new GeomAPI_Shape()); aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current())); myMap->bind(aCurrentShape, aCurrentShape); } - myShape = std::make_shared(); + myShape = std::shared_ptr(new GeomAPI_Shape()); myShape->setImpl(new TopoDS_Shape(aResult)); - myFirst = std::make_shared(); + myFirst = std::shared_ptr(new GeomAPI_Shape()); myFirst->setImpl(new TopoDS_Shape(aBuilder->Modified(aFromShape).First())); - myLast = std::make_shared(); + myLast = std::shared_ptr(new GeomAPI_Shape()); myLast->setImpl(new TopoDS_Shape(aBuilder->Modified(aToShape).First())); - myMkShape = std::make_shared(); + myMkShape = std::shared_ptr(new GeomAlgoAPI_MakeShape()); myMkShape->setImpl(aBuilder); } } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp index 1489fcd4b..f47d8a06f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Revolution.cpp @@ -127,8 +127,8 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr& theBasi gp_Ax1 anAxis = theAxis->impl(); ListOfMakeShape aListOfMakeShape; - myFirst = std::make_shared(); - myLast = std::make_shared(); + myFirst = std::shared_ptr(new GeomAPI_Shape()); + myLast = std::shared_ptr(new GeomAPI_Shape()); TopoDS_Shape aResult; if(!theFromShape && !theToShape) { // Case 1: When only angles was set. @@ -138,7 +138,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr& theBasi BRepBuilderAPI_Transform* aBaseTransform = new BRepBuilderAPI_Transform(aBasisFace, aBaseTrsf, true); - aListOfMakeShape.push_back(std::make_shared(aBaseTransform)); + aListOfMakeShape.push_back(std::shared_ptr(new GeomAlgoAPI_MakeShape(aBaseTransform))); TopoDS_Shape aRotatedBaseShape = aBaseTransform->Shape(); // Making revolution to the angle equal to the sum of "from angle" and "to angle". @@ -151,7 +151,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr& theBasi if(!aRevolBuilder->IsDone()) { return; } - aListOfMakeShape.push_back(std::make_shared(aRevolBuilder)); + aListOfMakeShape.push_back(std::shared_ptr(new GeomAlgoAPI_MakeShape(aRevolBuilder))); aResult = aRevolBuilder->Shape(); // Setting naming. @@ -198,7 +198,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr& theBasi // Making revolution to the 360 angle. BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aBasisFace, anAxis, 2 * M_PI, Standard_True); aRevolBuilder->Build(); - aListOfMakeShape.push_back(std::make_shared(aRevolBuilder)); + aListOfMakeShape.push_back(std::shared_ptr(new GeomAlgoAPI_MakeShape(aRevolBuilder))); TopoDS_Shape aRevolShape = aRevolBuilder->Shape(); // Cutting revolution with from plane. @@ -207,7 +207,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr& theBasi if(!aFromCutBuilder->IsDone()) { return; } - aListOfMakeShape.push_back(std::make_shared(aFromCutBuilder)); + aListOfMakeShape.push_back(std::shared_ptr(new GeomAlgoAPI_MakeShape(aFromCutBuilder))); aResult = aFromCutBuilder->Shape(); // Cutting revolution with to plane. @@ -216,7 +216,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr& theBasi if(!aToCutBuilder->IsDone()) { return; } - aListOfMakeShape.push_back(std::make_shared(aToCutBuilder)); + aListOfMakeShape.push_back(std::shared_ptr(new GeomAlgoAPI_MakeShape(aToCutBuilder))); aResult = aToCutBuilder->Shape(); // If after cut we got more than one solids then take closest to the center of mass of the base face. @@ -281,7 +281,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr& theBasi // Making revolution to the 360 angle. BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aBasisFace, anAxis, 2 * M_PI, Standard_True); aRevolBuilder->Build(); - aListOfMakeShape.push_back(std::make_shared(aRevolBuilder)); + aListOfMakeShape.push_back(std::shared_ptr(new GeomAlgoAPI_MakeShape(aRevolBuilder))); TopoDS_Shape aRevolShape = aRevolBuilder->Shape(); // Cutting revolution with bounding plane. @@ -290,7 +290,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr& theBasi if(!aBoundingCutBuilder->IsDone()) { return; } - aListOfMakeShape.push_back(std::make_shared(aBoundingCutBuilder)); + aListOfMakeShape.push_back(std::shared_ptr(new GeomAlgoAPI_MakeShape(aBoundingCutBuilder))); aResult = aBoundingCutBuilder->Shape(); TopExp_Explorer anExp1(aResult, TopAbs_SOLID); @@ -323,7 +323,7 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr& theBasi TopoDS_Shape aCutResult = aBasisCutBuilder->Shape(); TopExp_Explorer anExp(aCutResult, TopAbs_SOLID); if(anExp.More()) { - aListOfMakeShape.push_back(std::make_shared(aBasisCutBuilder)); + aListOfMakeShape.push_back(std::shared_ptr(new GeomAlgoAPI_MakeShape(aBasisCutBuilder))); aResult = aCutResult; } } @@ -354,15 +354,15 @@ void GeomAlgoAPI_Revolution::build(const std::shared_ptr& theBasi } // fill data map to keep correct orientation of sub-shapes - myMap = std::make_shared(); + myMap = std::shared_ptr(new GeomAPI_DataMapOfShapeShape()); for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) { std::shared_ptr aCurrentShape(new GeomAPI_Shape()); aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current())); myMap->bind(aCurrentShape, aCurrentShape); } - myShape = std::make_shared(); + myShape = std::shared_ptr(new GeomAPI_Shape()); myShape->setImpl(new TopoDS_Shape(aResult)); - myMkShape = std::make_shared(); + myMkShape = std::shared_ptr(new GeomAlgoAPI_MakeShapeList()); myDone = true; return; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp index dc150f194..1d1d84959 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Rotation.cpp @@ -51,8 +51,7 @@ void GeomAlgoAPI_Rotation::build(std::shared_ptr theSourceShape, if (theSimpleTransform) { TopLoc_Location aDelta(aTrsf); aResult = aSourceShape.Moved(aDelta); - myTrsf = std::make_shared( - new gp_Trsf(aTrsf * aSourceShape.Location().Transformation())); + myTrsf = std::shared_ptr(new GeomAPI_Trsf(new gp_Trsf(aTrsf * aSourceShape.Location().Transformation()))); myDone = true; // is OK for sure } else { BRepBuilderAPI_Transform* aBuilder = new BRepBuilderAPI_Transform(aSourceShape, aTrsf, true); diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index 872dbaf02..96957848a 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -288,7 +288,7 @@ void Model_ResultPart::setTrsf(std::shared_ptr theThis, { updateShape(); if (theTransformation.get()) { - myTrsf = std::make_shared(theTransformation->impl()); + myTrsf = std::shared_ptr(new gp_Trsf(theTransformation->impl())); } // the result must be explicitly updated static Events_Loop* aLoop = Events_Loop::loop(); diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 566552ba6..f0bfdc8a2 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -135,7 +135,7 @@ void PartSet_WidgetSketchLabel::updateByPlaneSelected(const ModuleBase_ViewerPrs // selection happens in OCC viewer if (!aShape.IsNull()) { - aGShape = std::make_shared(); + aGShape = std::shared_ptr(new GeomAPI_Shape()); aGShape->setImpl(new TopoDS_Shape(aShape)); if (aSelAttr && aSelAttr->context()) { diff --git a/src/PartSetPlugin/PartSetPlugin_Plugin.cpp b/src/PartSetPlugin/PartSetPlugin_Plugin.cpp index c4d504346..f892c57a7 100644 --- a/src/PartSetPlugin/PartSetPlugin_Plugin.cpp +++ b/src/PartSetPlugin/PartSetPlugin_Plugin.cpp @@ -58,8 +58,8 @@ std::shared_ptr PartSetPlugin_Plugin::getFeaturesS { const Events_ID kResponseEvent = Events_Loop::loop()->eventByName(EVENT_FEATURE_STATE_RESPONSE); - std::shared_ptr aMsg = - std::make_shared(kResponseEvent, this); + std::shared_ptr aMsg( + new ModelAPI_FeatureStateMessage(kResponseEvent, this)); std::string aStdDocKind = ModelAPI_Session::get()->activeDocument()->kind(); bool aDocIsPart = (aStdDocKind == PartSetPlugin_Part::ID()); aMsg->setState(PartSetPlugin_Part::ID(), true); diff --git a/src/SketchPlugin/SketchPlugin_Plugin.cpp b/src/SketchPlugin/SketchPlugin_Plugin.cpp index 7742fa5c1..1852d4a74 100644 --- a/src/SketchPlugin/SketchPlugin_Plugin.cpp +++ b/src/SketchPlugin/SketchPlugin_Plugin.cpp @@ -156,8 +156,8 @@ std::shared_ptr SketchPlugin_Plugin ::getFeaturesState(const std::shared_ptr& theFeature) const { const Events_ID kResponseEvent = Events_Loop::loop()->eventByName(EVENT_FEATURE_STATE_RESPONSE); - std::shared_ptr aMsg = - std::make_shared(kResponseEvent, this); + std::shared_ptr aMsg( + new ModelAPI_FeatureStateMessage(kResponseEvent, this)); bool aHasSketchPlane = false; std::shared_ptr aSketchFeature = diff --git a/src/XGUI/XGUI_ActionsMgr.cpp b/src/XGUI/XGUI_ActionsMgr.cpp index 83d3e09b0..525d58892 100644 --- a/src/XGUI/XGUI_ActionsMgr.cpp +++ b/src/XGUI/XGUI_ActionsMgr.cpp @@ -357,8 +357,8 @@ void XGUI_ActionsMgr::updateByPlugins(FeaturePtr anActiveFeature) { static Events_ID aStateRequestEventId = Events_Loop::loop()->eventByName( EVENT_FEATURE_STATE_REQUEST); - std::shared_ptr aMsg = - std::make_shared(aStateRequestEventId, this); + std::shared_ptr aMsg( + new ModelAPI_FeatureStateMessage(aStateRequestEventId, this)); aMsg->setFeature(anActiveFeature); Events_Loop::loop()->send(aMsg, false); } -- 2.30.2