X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Pipe.cpp;h=b02103c32a13093e2b98575e6281301946dacfd1;hb=4f565b2204d3fba046aa8c851abada2a5a17bf6c;hp=787a37fcc07b4582c88c90e030877961a9621da0;hpb=f98f887290d4e2b4bd6618389911e82b6b9674f3;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp index 787a37fcc..b02103c32 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp @@ -78,7 +78,8 @@ void FeaturesPlugin_Pipe::execute() GeomAPI_Shape::ShapeType aST = aBaseShape->shapeType(); ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aBaseObjectSelection->context()); - if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) && aST == GeomAPI_Shape::WIRE) { + if(aConstruction.get() && !aBaseShape->isEqual(aConstruction->shape()) && + aST == GeomAPI_Shape::WIRE) { // It is a wire on the sketch, store it to make face later. aSketchWiresMap[aConstruction].push_back(aBaseShape); continue; @@ -88,7 +89,8 @@ void FeaturesPlugin_Pipe::execute() } } else { // This may be the whole sketch result selected, check and get faces. - ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aBaseObjectSelection->context()); + ResultConstructionPtr aConstruction = + std::dynamic_pointer_cast(aBaseObjectSelection->context()); if(!aConstruction.get()) { setError("Error: One of selected sketches does not have results."); return; @@ -103,7 +105,8 @@ void FeaturesPlugin_Pipe::execute() } } else { for(int aFaceIndex = 0; aFaceIndex < aFacesNum; aFaceIndex++) { - std::shared_ptr aBaseFace = std::dynamic_pointer_cast(aConstruction->face(aFaceIndex)); + std::shared_ptr aBaseFace = + std::dynamic_pointer_cast(aConstruction->face(aFaceIndex)); if(!aBaseFace.get() || aBaseFace->isNull()) { setError("Error: One of the faces on selected sketch is Null."); return; @@ -132,8 +135,10 @@ void FeaturesPlugin_Pipe::execute() if(aCreationMethod == CREATION_METHOD_SIMPLE()) { ListOfShape aShells; ListOfShape aFreeFaces; - std::shared_ptr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList); - GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aShells, aFreeFaces); + std::shared_ptr aFacesCompound = + GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList); + GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, + aShells, aFreeFaces); aBaseShapesList.insert(aBaseShapesList.end(), aFreeFaces.begin(), aFreeFaces.end()); aBaseShapesList.insert(aBaseShapesList.end(), aShells.begin(), aShells.end()); } else { @@ -146,7 +151,8 @@ void FeaturesPlugin_Pipe::execute() setError("Error: Path selection is empty."); return; } - std::shared_ptr aPathShape = std::dynamic_pointer_cast(aPathSelection->value()); + std::shared_ptr aPathShape = + std::dynamic_pointer_cast(aPathSelection->value()); if(!aPathShape.get()) { // Probaply it is a construction. aPathShape = aPathSelection->context()->shape(); @@ -204,8 +210,10 @@ void FeaturesPlugin_Pipe::execute() // Generating result for each object. int aResultIndex = 0; - if(aCreationMethod == CREATION_METHOD_SIMPLE() || aCreationMethod == CREATION_METHOD_BINORMAL()) { - for(ListOfShape::const_iterator anIter = aBaseShapesList.cbegin(); anIter != aBaseShapesList.cend(); anIter++) { + if(aCreationMethod == CREATION_METHOD_SIMPLE() || + aCreationMethod == CREATION_METHOD_BINORMAL()) { + for(ListOfShape::const_iterator + anIter = aBaseShapesList.cbegin(); anIter != aBaseShapesList.cend(); anIter++) { std::shared_ptr aBaseShape = *anIter; GeomAlgoAPI_Pipe aPipeAlgo = aCreationMethod == @@ -309,20 +317,24 @@ void FeaturesPlugin_Pipe::storeResult(const std::shared_ptr theBa } } - if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { + if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX || + aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, GeomAPI_Shape::VERTEX, - aGenTag++, aGenName + "Edge", *aMapOfSubShapes.get()); + aGenTag++, aGenName + "Edge", *aMapOfSubShapes.get()); } - if(aShapeTypeToExplode == GeomAPI_Shape::EDGE || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { + if(aShapeTypeToExplode == GeomAPI_Shape::EDGE || + aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, GeomAPI_Shape::EDGE, - aGenTag++, aGenName + "Face", *aMapOfSubShapes.get()); + aGenTag++, aGenName + "Face", *aMapOfSubShapes.get()); } - aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, aShapeTypeToExplode, aGenTag++, aGenName, *aMapOfSubShapes.get()); + aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, theBaseShape, aShapeTypeToExplode, + aGenTag++, aGenName, *aMapOfSubShapes.get()); // Store from shapes. int aFromTag = aGenTag; - storeShapes(aResultBody, aBaseShapeType, aMapOfSubShapes, thePipeAlgo.fromShapes(), "From_", aFromTag); + storeShapes(aResultBody, aBaseShapeType, aMapOfSubShapes, + thePipeAlgo.fromShapes(), "From_", aFromTag); // Store to shapes. int aToTag = aFromTag; @@ -346,7 +358,8 @@ void FeaturesPlugin_Pipe::storeResult(const ListOfShape& theBaseShapes, int aGenTag = 1; std::shared_ptr aMapOfSubShapes = thePipeAlgo.mapOfSubShapes(); - for(ListOfShape::const_iterator anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) { + for(ListOfShape::const_iterator + anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) { GeomShapePtr aBaseShape = *anIter; GeomAPI_Shape::ShapeType aBaseShapeType = aBaseShape->shapeType(); GeomAPI_Shape::ShapeType aShapeTypeToExplode; @@ -374,16 +387,19 @@ void FeaturesPlugin_Pipe::storeResult(const ListOfShape& theBaseShapes, break; } } - aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, aBaseShape, aShapeTypeToExplode, aGenTag++, aGenName, *aMapOfSubShapes.get()); + aResultBody->loadAndOrientGeneratedShapes(&thePipeAlgo, aBaseShape, aShapeTypeToExplode, + aGenTag++, aGenName, *aMapOfSubShapes.get()); } // Store from shapes. int aFromTag = aGenTag; - storeShapes(aResultBody, theBaseShapes.front()->shapeType(), aMapOfSubShapes, thePipeAlgo.fromShapes(), "From", aFromTag); + storeShapes(aResultBody, theBaseShapes.front()->shapeType(), aMapOfSubShapes, + thePipeAlgo.fromShapes(), "From", aFromTag); // Store to shapes. int aToTag = aFromTag; - storeShapes(aResultBody, theBaseShapes.back()->shapeType(), aMapOfSubShapes, thePipeAlgo.toShapes(), "To", aToTag); + storeShapes(aResultBody, theBaseShapes.back()->shapeType(), + aMapOfSubShapes, thePipeAlgo.toShapes(), "To", aToTag); setResult(aResultBody, theResultIndex); @@ -391,11 +407,11 @@ void FeaturesPlugin_Pipe::storeResult(const ListOfShape& theBaseShapes, //================================================================================================== void FeaturesPlugin_Pipe::storeShapes(ResultBodyPtr theResultBody, - const GeomAPI_Shape::ShapeType theBaseShapeType, - const std::shared_ptr theMapOfSubShapes, - const ListOfShape& theShapes, - const std::string theName, - int& theTag) + const GeomAPI_Shape::ShapeType theBaseShapeType, + const std::shared_ptr theMapOfSubShapes, + const ListOfShape& theShapes, + const std::string theName, + int& theTag) { GeomAPI_Shape::ShapeType aShapeTypeToExplore = GeomAPI_Shape::FACE; std::string aShapeTypeStr = "Face";