From: vsv Date: Wed, 9 Nov 2016 15:37:43 +0000 (+0300) Subject: Issue #1834: Fix length of lines X-Git-Tag: V_2.6.0~102 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6a9cd4195f90b65c0259152ea30944c7b0df3850;p=modules%2Fshaper.git Issue #1834: Fix length of lines --- diff --git a/cpplint.cfg b/cpplint.cfg index f90ce4245..cc3f964d7 100644 --- a/cpplint.cfg +++ b/cpplint.cfg @@ -1,3 +1,4 @@ linelength=100 -filter=-whitespace,+whitespace/line_length,-readability,-build,-runtime +filter=-whitespace,+whitespace/end_of_line,-readability,-build,-runtime root=src +#+whitespace/line_length diff --git a/src/BuildAPI/BuildAPI_Edge.h b/src/BuildAPI/BuildAPI_Edge.h index 2d9fe087e..91b6329f9 100644 --- a/src/BuildAPI/BuildAPI_Edge.h +++ b/src/BuildAPI/BuildAPI_Edge.h @@ -36,7 +36,8 @@ public: virtual ~BuildAPI_Edge(); INTERFACE_1(BuildPlugin_Edge::ID(), - baseObjects, BuildPlugin_Edge::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */) + baseObjects, BuildPlugin_Edge::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */) /// Modify base attribute of the feature. BUILDAPI_EXPORT diff --git a/src/BuildAPI/BuildAPI_Face.h b/src/BuildAPI/BuildAPI_Face.h index 997499bbb..c614eb411 100644 --- a/src/BuildAPI/BuildAPI_Face.h +++ b/src/BuildAPI/BuildAPI_Face.h @@ -36,7 +36,8 @@ public: virtual ~BuildAPI_Face(); INTERFACE_1(BuildPlugin_Face::ID(), - baseObjects, BuildPlugin_Face::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */) + baseObjects, BuildPlugin_Face::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */) /// Modify base attribute of the feature. BUILDAPI_EXPORT diff --git a/src/BuildAPI/BuildAPI_Shell.h b/src/BuildAPI/BuildAPI_Shell.h index 0e6338842..a0fcecc3f 100644 --- a/src/BuildAPI/BuildAPI_Shell.h +++ b/src/BuildAPI/BuildAPI_Shell.h @@ -36,7 +36,8 @@ public: virtual ~BuildAPI_Shell(); INTERFACE_1(BuildPlugin_Shell::ID(), - baseObjects, BuildPlugin_Shell::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */) + baseObjects, BuildPlugin_Shell::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */) /// Modify base attribute of the feature. BUILDAPI_EXPORT diff --git a/src/BuildAPI/BuildAPI_SubShapes.h b/src/BuildAPI/BuildAPI_SubShapes.h index 492df6fdc..8871a7e3f 100644 --- a/src/BuildAPI/BuildAPI_SubShapes.h +++ b/src/BuildAPI/BuildAPI_SubShapes.h @@ -37,8 +37,10 @@ public: virtual ~BuildAPI_SubShapes(); INTERFACE_2(BuildPlugin_SubShapes::ID(), - baseShape, BuildPlugin_SubShapes::BASE_SHAPE_ID(), ModelAPI_AttributeSelection, /** Base shape */, - subShapes, BuildPlugin_SubShapes::SUBSHAPES_ID(), ModelAPI_AttributeSelectionList, /** Sub-shapes */) + baseShape, BuildPlugin_SubShapes::BASE_SHAPE_ID(), + ModelAPI_AttributeSelection, /** Base shape */, + subShapes, BuildPlugin_SubShapes::SUBSHAPES_ID(), + ModelAPI_AttributeSelectionList, /** Sub-shapes */) /// Modify base attribute of the feature. BUILDAPI_EXPORT diff --git a/src/BuildAPI/BuildAPI_Vertex.h b/src/BuildAPI/BuildAPI_Vertex.h index d4dc4b8c5..f14e87897 100644 --- a/src/BuildAPI/BuildAPI_Vertex.h +++ b/src/BuildAPI/BuildAPI_Vertex.h @@ -36,7 +36,8 @@ public: virtual ~BuildAPI_Vertex(); INTERFACE_1(BuildPlugin_Vertex::ID(), - baseObjects, BuildPlugin_Vertex::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */) + baseObjects, BuildPlugin_Vertex::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */) /// Modify base attribute of the feature. BUILDAPI_EXPORT diff --git a/src/BuildAPI/BuildAPI_Wire.h b/src/BuildAPI/BuildAPI_Wire.h index 68430929e..b86b7e653 100644 --- a/src/BuildAPI/BuildAPI_Wire.h +++ b/src/BuildAPI/BuildAPI_Wire.h @@ -36,7 +36,8 @@ public: virtual ~BuildAPI_Wire(); INTERFACE_1(BuildPlugin_Wire::ID(), - baseObjects, BuildPlugin_Wire::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */) + baseObjects, BuildPlugin_Wire::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */) /// Modify base attribute of the feature. BUILDAPI_EXPORT diff --git a/src/BuildPlugin/BuildPlugin_Face.cpp b/src/BuildPlugin/BuildPlugin_Face.cpp index 0f2080298..774cfdf39 100644 --- a/src/BuildPlugin/BuildPlugin_Face.cpp +++ b/src/BuildPlugin/BuildPlugin_Face.cpp @@ -79,7 +79,8 @@ void BuildPlugin_Face::execute() // Get faces. ListOfShape aFaces; - GeomAlgoAPI_SketchBuilder::createFaces(aPln->location(), aPln->xDirection(), aPln->direction(), anEdges, aFaces); + GeomAlgoAPI_SketchBuilder::createFaces(aPln->location(), aPln->xDirection(), + aPln->direction(), anEdges, aFaces); // Get wires from faces. ListOfShape aWires; @@ -111,7 +112,8 @@ void BuildPlugin_Face::execute() for(ListOfShape::const_iterator anIt = anEdges.cbegin(); anIt != anEdges.cend(); ++anIt) { std::shared_ptr anEdgeInList(new GeomAPI_Edge(*anIt)); if(anEdgeInList->isEqual(anEdgeInResult)) { - aResultBody->modified(anEdgeInList, anEdgeInResult, "Edge_" + std::to_string((long long)anEdgeIndex), anEdgeIndex); + aResultBody->modified(anEdgeInList, anEdgeInResult, + "Edge_" + std::to_string((long long)anEdgeIndex), anEdgeIndex); ++anEdgeIndex; break; } diff --git a/src/BuildPlugin/BuildPlugin_Shell.cpp b/src/BuildPlugin/BuildPlugin_Shell.cpp index 3575c48b5..b90e74945 100644 --- a/src/BuildPlugin/BuildPlugin_Shell.cpp +++ b/src/BuildPlugin/BuildPlugin_Shell.cpp @@ -72,7 +72,8 @@ void BuildPlugin_Shell::execute() ResultBodyPtr aResultBody = document()->createBody(data(), anIndex); aResultBody->store(aShell); for(ListOfShape::const_iterator anIt = aShapes.cbegin(); anIt != aShapes.cend(); ++anIt) { - for(GeomAPI_ShapeExplorer aFaceExp(*anIt, GeomAPI_Shape::FACE); aFaceExp.more(); aFaceExp.next()) { + for(GeomAPI_ShapeExplorer + aFaceExp(*anIt, GeomAPI_Shape::FACE); aFaceExp.more(); aFaceExp.next()) { GeomShapePtr aFace = aFaceExp.current(); ListOfShape aHistory; aSewingAlgo.modified(aFace, aHistory); diff --git a/src/BuildPlugin/BuildPlugin_SubShapes.cpp b/src/BuildPlugin/BuildPlugin_SubShapes.cpp index ebbe753ba..0eaa6a2e7 100644 --- a/src/BuildPlugin/BuildPlugin_SubShapes.cpp +++ b/src/BuildPlugin/BuildPlugin_SubShapes.cpp @@ -115,12 +115,13 @@ void BuildPlugin_SubShapes::execute() aResultBody->storeModified(aBaseShape, aResultShape); aResultBody->loadAndOrientModifiedShapes(&aBuilder, aBaseShape, GeomAPI_Shape::EDGE, aModEdgeTag, "Modified_Edge", *aBuilder.mapOfSubShapes().get()); - for(ListOfShape::const_iterator anIt = aShapesToAdd.cbegin(); anIt != aShapesToAdd.cend(); ++anIt) { + for(ListOfShape::const_iterator + anIt = aShapesToAdd.cbegin(); anIt != aShapesToAdd.cend(); ++anIt) { GeomAPI_Shape::ShapeType aShType = (*anIt)->shapeType(); aResultBody->loadAndOrientModifiedShapes(&aBuilder, *anIt, aShType, - aShType == GeomAPI_Shape::VERTEX ? aModVertexTag : aModEdgeTag, - aShType == GeomAPI_Shape::VERTEX ? "Modified_Vertex" : "Modified_Edge", - *aBuilder.mapOfSubShapes().get()); + aShType == GeomAPI_Shape::VERTEX ? aModVertexTag : aModEdgeTag, + aShType == GeomAPI_Shape::VERTEX ? "Modified_Vertex" : "Modified_Edge", + *aBuilder.mapOfSubShapes().get()); } setResult(aResultBody); } diff --git a/src/BuildPlugin/BuildPlugin_Validators.cpp b/src/BuildPlugin/BuildPlugin_Validators.cpp index b75c77e54..4ff1e7dfb 100644 --- a/src/BuildPlugin/BuildPlugin_Validators.cpp +++ b/src/BuildPlugin/BuildPlugin_Validators.cpp @@ -32,7 +32,8 @@ bool BuildPlugin_ValidatorBaseForBuild::isValid(const AttributePtr& theAttribute { // Get base objects list. if(theAttribute->attributeType() != ModelAPI_AttributeSelectionList::typeId()) { - std::string aMsg = "Error: BuildPlugin_ValidatorBaseForBuild does not support attribute type '%1'\nOnly '%2' is supported."; + std::string aMsg = "Error: BuildPlugin_ValidatorBaseForBuild does " + "not support attribute type '%1'\nOnly '%2' is supported."; Events_InfoMessage("BuildPlugin_Validators", aMsg). arg(theAttribute->attributeType()).arg(ModelAPI_AttributeSelectionList::typeId()).send(); return false; @@ -78,14 +79,16 @@ bool BuildPlugin_ValidatorBaseForBuild::isValid(const AttributePtr& theAttribute } // Check that it is shape on sketch. - ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aContext); + ResultConstructionPtr aConstruction = + std::dynamic_pointer_cast(aContext); if(aConstruction.get()) { if(aConstruction->isInfinite()) { theError = "Inifinte objects not acceptable."; return false; } - std::shared_ptr anEdges = std::dynamic_pointer_cast(aContextShape); + std::shared_ptr anEdges = + std::dynamic_pointer_cast(aContextShape); if(anEdges.get()) { if(aShape->isEqual(aContextShape)) { // It is whole sketch. @@ -113,7 +116,8 @@ bool BuildPlugin_ValidatorBaseForWire::isValid(const std::shared_ptrlocation(), aPln->xDirection(), aPln->direction(), anEdges, aFaces); + GeomAlgoAPI_SketchBuilder::createFaces(aPln->location(), aPln->xDirection(), + aPln->direction(), anEdges, aFaces); if(aFaces.empty()) { theError = "Selected objects does not have closed contours."; return false; @@ -223,7 +230,8 @@ bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptrattributeType() != ModelAPI_AttributeSelectionList::typeId()) { - std::string aMsg = "Error: BuildPlugin_ValidatorSubShapesSelection does not support attribute type \"" + std::string aMsg = + "Error: BuildPlugin_ValidatorSubShapesSelection does not support attribute type \"" "%1\"\n Only \"%2\" supported."; Events_InfoMessage("BuildPlugin_Validators", aMsg). arg(theAttribute->attributeType()).arg(ModelAPI_AttributeSelectionList::typeId()).send(); diff --git a/src/BuildPlugin/BuildPlugin_Validators.h b/src/BuildPlugin/BuildPlugin_Validators.h index a72a882f1..4edd43894 100644 --- a/src/BuildPlugin/BuildPlugin_Validators.h +++ b/src/BuildPlugin/BuildPlugin_Validators.h @@ -12,7 +12,8 @@ /// \class BuildPlugin_ValidatorBaseForBuild /// \ingroup Validators -/// \brief A validator for selection base shapes for build features. Allows to select shapes on sketch and +/// \brief A validator for selection base shapes for build features. +/// Allows to select shapes on sketch and /// whole objects with allowed type. class BuildPlugin_ValidatorBaseForBuild: public ModelAPI_AttributeValidator { diff --git a/src/BuildPlugin/BuildPlugin_Wire.cpp b/src/BuildPlugin/BuildPlugin_Wire.cpp index 4b7231a72..15a832b7d 100644 --- a/src/BuildPlugin/BuildPlugin_Wire.cpp +++ b/src/BuildPlugin/BuildPlugin_Wire.cpp @@ -122,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; } @@ -149,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; @@ -172,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) {