X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBuildPlugin%2FBuildPlugin_Wire.cpp;h=c8004f617fe6bed1e243e9325ef75496bb743907;hb=b38bb339a84175749f2742d906db858e3377c86b;hp=14d5158945d7b90c37d8caf0ad884013228bad24;hpb=c782d00ac4c46d04bd56a665fa843736c09b1151;p=modules%2Fshaper.git diff --git a/src/BuildPlugin/BuildPlugin_Wire.cpp b/src/BuildPlugin/BuildPlugin_Wire.cpp index 14d515894..c8004f617 100644 --- a/src/BuildPlugin/BuildPlugin_Wire.cpp +++ b/src/BuildPlugin/BuildPlugin_Wire.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -85,10 +85,11 @@ void BuildPlugin_Wire::execute() //================================================================================================= bool BuildPlugin_Wire::customAction(const std::string& theActionId) { - if(theActionId == "add_contour") { + if(theActionId == ADD_CONTOUR_ACTION_ID()) { return addContour(); } else { - Events_Error::send("Error: Feature \"" + getKind() + "\" does not support action \"" + theActionId + "\"."); + std::string aMsg = "Error: Feature \"%1\" does not support action \"%2\"."; + Events_InfoMessage("BuildPlugin_Wire", aMsg).arg(getKind()).arg(theActionId).send(); } return false; @@ -100,7 +101,7 @@ bool BuildPlugin_Wire::addContour() // Get base objects list. AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID()); if(aSelectionList->size() == 0) { - Events_Error::send("Error: Empty selection list."); + Events_InfoMessage("BuildPlugin_Wire", "Error: Empty selection list.").send(); return false; } @@ -121,12 +122,14 @@ bool BuildPlugin_Wire::addContour() // Check that it is edge on sketch. ResultPtr aContext = aSelection->context(); - ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aContext); + ResultConstructionPtr aConstruction = + std::dynamic_pointer_cast(aContext); if(!aConstruction.get()) { continue; } GeomShapePtr aContextShape = aConstruction->shape(); - std::shared_ptr aPlanarEdges = std::dynamic_pointer_cast(aContextShape); + std::shared_ptr aPlanarEdges = + std::dynamic_pointer_cast(aContextShape); if(!aPlanarEdges.get()) { continue; } @@ -148,15 +151,18 @@ bool BuildPlugin_Wire::addContour() AttributeSelectionPtr aSelection = *aListIt; std::shared_ptr anEdgeInList(new GeomAPI_Edge(aSelection->value())); - ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aSelection->context()); + ResultConstructionPtr aConstruction = + std::dynamic_pointer_cast(aSelection->context()); // Iterate on wires and add wire with this edge. std::shared_ptr aFoundWire; for(int anIndex = 0; anIndex < aConstruction->facesNum(); ++anIndex) { std::shared_ptr aFace = aConstruction->face(anIndex); - for(GeomAPI_ShapeExplorer aWireExp(aFace, GeomAPI_Shape::WIRE); aWireExp.more(); aWireExp.next()) { + for(GeomAPI_ShapeExplorer + aWireExp(aFace, GeomAPI_Shape::WIRE); aWireExp.more(); aWireExp.next()) { GeomShapePtr aWireOnFace = aWireExp.current(); - for(GeomAPI_ShapeExplorer anExp(aWireOnFace, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) { + for(GeomAPI_ShapeExplorer + anExp(aWireOnFace, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) { std::shared_ptr anEdgeOnFace(new GeomAPI_Edge(anExp.current())); if(anEdgeInList->isEqual(anEdgeOnFace)) { aFoundWire = aWireOnFace; @@ -171,7 +177,8 @@ bool BuildPlugin_Wire::addContour() // If wire with the same edge found. Add all other edges to list. if(aFoundWire.get()) { - for(GeomAPI_ShapeExplorer anExp(aFoundWire, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) { + for(GeomAPI_ShapeExplorer + anExp(aFoundWire, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) { std::shared_ptr anEdgeOnFace(new GeomAPI_Edge(anExp.current())); ListOfShape::const_iterator anEdgesIt = anAddedEdges.cbegin(); for(; anEdgesIt != anAddedEdges.cend(); ++anEdgesIt) { @@ -189,7 +196,8 @@ bool BuildPlugin_Wire::addContour() } if(!isAnyContourAdded) { - Events_Error::send("Error: Contours already closed or no contours found for selected edges."); + Events_InfoMessage("BuildPlugin_Wire", + "Error: Contours already closed or no contours found for selected edges.").send(); return false; }