{
Events_ID aFilterEvent = Events_Loop::eventByName(EVENT_SELFILTER_LOADED);
Events_Loop* aEvLoop = Events_Loop::loop();
- std::shared_ptr<Config_SelectionFilterMessage> aMessage =
- std::make_shared<Config_SelectionFilterMessage>(aFilterEvent, this);
+ std::shared_ptr<Config_SelectionFilterMessage> aMessage(
+ new Config_SelectionFilterMessage(aFilterEvent, this));
std::string aSelectionFilterId;
std::list<std::string> aParameters;
getParametersInfo(theNode, aSelectionFilterId, aParameters);
theResults.clear();
for(ListOfShape::const_iterator aFacesIt = theFaces.begin(); aFacesIt != theFaces.end(); aFacesIt++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *aFacesIt;
- std::shared_ptr<GeomAlgoAPI_Prism> aPrismAlgo = std::make_shared<GeomAlgoAPI_Prism>(aBaseShape,
- aToShape, aToSize,
- aFromShape, aFromSize);
+ std::shared_ptr<GeomAlgoAPI_Prism> aPrismAlgo = std::shared_ptr<GeomAlgoAPI_Prism>(new GeomAlgoAPI_Prism(aBaseShape, aToShape, aToSize, aFromShape, aFromSize));
// Checking that the algorithm worked properly.
if(!aPrismAlgo->isDone() || !aPrismAlgo->shape().get() || aPrismAlgo->shape()->isNull() ||
theResults.push_back(aPrismAlgo->shape());
theAlgos.push_back(aPrismAlgo);
}
-}
\ No newline at end of file
+}
std::shared_ptr<GeomAPI_Edge> anEdge;
std::shared_ptr<ModelAPI_AttributeSelection> anObjRef = selection(AXIS_OBJECT_ID());
if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
- anEdge = std::make_shared<GeomAPI_Edge>(anObjRef->value());
+ anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
} else if(anObjRef->context() && anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
- anEdge = std::make_shared<GeomAPI_Edge>(anObjRef->context()->shape());
+ anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
}
if(anEdge) {
- anAxis = std::make_shared<GeomAPI_Ax1>(anEdge->line()->location(), anEdge->line()->direction());
+ anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction()));
}
// Getting angles.
if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) {
anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->value()));
} else if(anObjRef->context() && anObjRef->context()->shape() && anObjRef->context()->shape()->isEdge()) {
- anEdge = std::make_shared<GeomAPI_Edge>(anObjRef->context()->shape());
+ anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(anObjRef->context()->shape()));
}
if(anEdge) {
anAxis = std::shared_ptr<GeomAPI_Ax1>(new GeomAPI_Ax1(anEdge->line()->location(), anEdge->line()->direction()));
theResults.clear();
for(ListOfShape::const_iterator aFacesIt = theFaces.begin(); aFacesIt != theFaces.end(); aFacesIt++) {
std::shared_ptr<GeomAPI_Shape> aBaseShape = *aFacesIt;
- std::shared_ptr<GeomAlgoAPI_Revolution> aRevolAlgo = std::make_shared<GeomAlgoAPI_Revolution>(aBaseShape, anAxis,
- aToShape, aToAngle,
- aFromShape, aFromAngle);
+ std::shared_ptr<GeomAlgoAPI_Revolution> aRevolAlgo = std::shared_ptr<GeomAlgoAPI_Revolution>(new GeomAlgoAPI_Revolution(aBaseShape, anAxis, aToShape, aToAngle, aFromShape, aFromAngle));
// Checking that the algorithm worked properly.
if(!aRevolAlgo->isDone() || !aRevolAlgo->shape().get() || aRevolAlgo->shape()->isNull() ||
theResults.push_back(aRevolAlgo->shape());
theAlgos.push_back(aRevolAlgo);
}
-}
\ No newline at end of file
+}
TopLoc_Location aDelta(aTrsf);
aResult = aSourceShape.Moved(aDelta);
// store the accumulated information about the result and this delta
- myTrsf = std::make_shared<GeomAPI_Trsf>(
- new gp_Trsf(aTrsf * aSourceShape.Location().Transformation()));
+ myTrsf = std::shared_ptr<GeomAPI_Trsf>(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);
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<GeomAPI_Trsf>(
- new gp_Trsf(aTrsf * aSourceShape.Location().Transformation()));
+ myTrsf = std::shared_ptr<GeomAPI_Trsf>(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
aResult = GeomAlgoAPI_DFLoader::refineResult(aResult);
}
// fill data map to keep correct orientation of sub-shapes
- myMap = std::make_shared<GeomAPI_DataMapOfShapeShape>();
+ myMap = std::shared_ptr<GeomAPI_DataMapOfShapeShape>(new GeomAPI_DataMapOfShapeShape());
for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) {
std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current()));
myMap->bind(aCurrentShape, aCurrentShape);
}
- myShape = std::make_shared<GeomAPI_Shape>();
+ myShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
myShape->setImpl(new TopoDS_Shape(aResult));
- myFirst = std::make_shared<GeomAPI_Shape>();
+ myFirst = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
myFirst->setImpl(new TopoDS_Shape(aBuilder->Modified(aFromShape).First()));
- myLast = std::make_shared<GeomAPI_Shape>();
+ myLast = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
myLast->setImpl(new TopoDS_Shape(aBuilder->Modified(aToShape).First()));
- myMkShape = std::make_shared<GeomAlgoAPI_MakeShape>();
+ myMkShape = std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape());
myMkShape->setImpl(aBuilder);
}
}
gp_Ax1 anAxis = theAxis->impl<gp_Ax1>();
ListOfMakeShape aListOfMakeShape;
- myFirst = std::make_shared<GeomAPI_Shape>();
- myLast = std::make_shared<GeomAPI_Shape>();
+ myFirst = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
+ myLast = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
TopoDS_Shape aResult;
if(!theFromShape && !theToShape) { // Case 1: When only angles was set.
BRepBuilderAPI_Transform* aBaseTransform = new BRepBuilderAPI_Transform(aBasisFace,
aBaseTrsf,
true);
- aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aBaseTransform));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBaseTransform)));
TopoDS_Shape aRotatedBaseShape = aBaseTransform->Shape();
// Making revolution to the angle equal to the sum of "from angle" and "to angle".
if(!aRevolBuilder->IsDone()) {
return;
}
- aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aRevolBuilder));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aRevolBuilder)));
aResult = aRevolBuilder->Shape();
// Setting naming.
// 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<GeomAlgoAPI_MakeShape>(aRevolBuilder));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aRevolBuilder)));
TopoDS_Shape aRevolShape = aRevolBuilder->Shape();
// Cutting revolution with from plane.
if(!aFromCutBuilder->IsDone()) {
return;
}
- aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aFromCutBuilder));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aFromCutBuilder)));
aResult = aFromCutBuilder->Shape();
// Cutting revolution with to plane.
if(!aToCutBuilder->IsDone()) {
return;
}
- aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aToCutBuilder));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(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.
// 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<GeomAlgoAPI_MakeShape>(aRevolBuilder));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aRevolBuilder)));
TopoDS_Shape aRevolShape = aRevolBuilder->Shape();
// Cutting revolution with bounding plane.
if(!aBoundingCutBuilder->IsDone()) {
return;
}
- aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aBoundingCutBuilder));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBoundingCutBuilder)));
aResult = aBoundingCutBuilder->Shape();
TopExp_Explorer anExp1(aResult, TopAbs_SOLID);
TopoDS_Shape aCutResult = aBasisCutBuilder->Shape();
TopExp_Explorer anExp(aCutResult, TopAbs_SOLID);
if(anExp.More()) {
- aListOfMakeShape.push_back(std::make_shared<GeomAlgoAPI_MakeShape>(aBasisCutBuilder));
+ aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBasisCutBuilder)));
aResult = aCutResult;
}
}
}
// fill data map to keep correct orientation of sub-shapes
- myMap = std::make_shared<GeomAPI_DataMapOfShapeShape>();
+ myMap = std::shared_ptr<GeomAPI_DataMapOfShapeShape>(new GeomAPI_DataMapOfShapeShape());
for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) {
std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current()));
myMap->bind(aCurrentShape, aCurrentShape);
}
- myShape = std::make_shared<GeomAPI_Shape>();
+ myShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
myShape->setImpl(new TopoDS_Shape(aResult));
- myMkShape = std::make_shared<GeomAlgoAPI_MakeShapeList>();
+ myMkShape = std::shared_ptr<GeomAlgoAPI_MakeShapeList>(new GeomAlgoAPI_MakeShapeList());
myDone = true;
return;
}
if (theSimpleTransform) {
TopLoc_Location aDelta(aTrsf);
aResult = aSourceShape.Moved(aDelta);
- myTrsf = std::make_shared<GeomAPI_Trsf>(
- new gp_Trsf(aTrsf * aSourceShape.Location().Transformation()));
+ myTrsf = std::shared_ptr<GeomAPI_Trsf>(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);
{
updateShape();
if (theTransformation.get()) {
- myTrsf = std::make_shared<gp_Trsf>(theTransformation->impl<gp_Trsf>());
+ myTrsf = std::shared_ptr<gp_Trsf>(new gp_Trsf(theTransformation->impl<gp_Trsf>()));
}
// the result must be explicitly updated
static Events_Loop* aLoop = Events_Loop::loop();
// selection happens in OCC viewer
if (!aShape.IsNull()) {
- aGShape = std::make_shared<GeomAPI_Shape>();
+ aGShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
aGShape->setImpl(new TopoDS_Shape(aShape));
if (aSelAttr && aSelAttr->context()) {
{
const Events_ID kResponseEvent =
Events_Loop::loop()->eventByName(EVENT_FEATURE_STATE_RESPONSE);
- std::shared_ptr<ModelAPI_FeatureStateMessage> aMsg =
- std::make_shared<ModelAPI_FeatureStateMessage>(kResponseEvent, this);
+ std::shared_ptr<ModelAPI_FeatureStateMessage> 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);
::getFeaturesState(const std::shared_ptr<ModelAPI_Feature>& theFeature) const
{
const Events_ID kResponseEvent = Events_Loop::loop()->eventByName(EVENT_FEATURE_STATE_RESPONSE);
- std::shared_ptr<ModelAPI_FeatureStateMessage> aMsg =
- std::make_shared<ModelAPI_FeatureStateMessage>(kResponseEvent, this);
+ std::shared_ptr<ModelAPI_FeatureStateMessage> aMsg(
+ new ModelAPI_FeatureStateMessage(kResponseEvent, this));
bool aHasSketchPlane = false;
std::shared_ptr<SketchPlugin_Sketch> aSketchFeature =
{
static Events_ID aStateRequestEventId = Events_Loop::loop()->eventByName(
EVENT_FEATURE_STATE_REQUEST);
- std::shared_ptr<ModelAPI_FeatureStateMessage> aMsg =
- std::make_shared<ModelAPI_FeatureStateMessage>(aStateRequestEventId, this);
+ std::shared_ptr<ModelAPI_FeatureStateMessage> aMsg(
+ new ModelAPI_FeatureStateMessage(aStateRequestEventId, this));
aMsg->setFeature(anActiveFeature);
Events_Loop::loop()->send(aMsg, false);
}