From b60b14b88cd5b0973643f552b4f128cfe9bf2152 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 9 Nov 2016 16:41:46 +0300 Subject: [PATCH] Issue #1834: Fix length of lines --- src/FeaturesAPI/FeaturesAPI_Boolean.cpp | 6 +- src/FeaturesAPI/FeaturesAPI_Boolean.h | 9 +- src/FeaturesAPI/FeaturesAPI_Extrusion.cpp | 64 ++--- src/FeaturesAPI/FeaturesAPI_Extrusion.h | 36 ++- .../FeaturesAPI_ExtrusionBoolean.cpp | 239 ++++++++++-------- .../FeaturesAPI_ExtrusionBoolean.h | 36 ++- src/FeaturesAPI/FeaturesAPI_Group.h | 3 +- src/FeaturesAPI/FeaturesAPI_Intersection.cpp | 16 +- src/FeaturesAPI/FeaturesAPI_Intersection.h | 6 +- src/FeaturesAPI/FeaturesAPI_Partition.cpp | 8 +- src/FeaturesAPI/FeaturesAPI_Partition.h | 3 +- src/FeaturesAPI/FeaturesAPI_Pipe.cpp | 20 +- src/FeaturesAPI/FeaturesAPI_Pipe.h | 15 +- src/FeaturesAPI/FeaturesAPI_Placement.cpp | 6 +- src/FeaturesAPI/FeaturesAPI_Placement.h | 15 +- src/FeaturesAPI/FeaturesAPI_Recover.cpp | 6 +- src/FeaturesAPI/FeaturesAPI_Recover.h | 9 +- .../FeaturesAPI_RemoveSubShapes.cpp | 23 +- src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h | 6 +- src/FeaturesAPI/FeaturesAPI_Revolution.cpp | 50 ++-- src/FeaturesAPI/FeaturesAPI_Revolution.h | 36 ++- .../FeaturesAPI_RevolutionBoolean.cpp | 152 ++++++----- .../FeaturesAPI_RevolutionBoolean.h | 36 ++- src/FeaturesAPI/FeaturesAPI_Rotation.cpp | 3 +- src/FeaturesAPI/FeaturesAPI_Rotation.h | 9 +- src/FeaturesAPI/FeaturesAPI_Translation.cpp | 24 +- src/FeaturesAPI/FeaturesAPI_Translation.h | 9 +- src/FeaturesAPI/FeaturesAPI_Union.cpp | 12 +- src/FeaturesAPI/FeaturesAPI_Union.h | 3 +- src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp | 130 ++++++---- .../FeaturesPlugin_CompositeBoolean.cpp | 49 ++-- .../FeaturesPlugin_CompositeSketch.cpp | 65 +++-- .../FeaturesPlugin_CompositeSketch.h | 3 +- .../FeaturesPlugin_Extrusion.cpp | 6 +- .../FeaturesPlugin_ExtrusionBoolean.cpp | 9 +- .../FeaturesPlugin_ExtrusionBoolean.h | 3 +- .../FeaturesPlugin_Intersection.cpp | 25 +- .../FeaturesPlugin_Intersection.h | 3 +- .../FeaturesPlugin_Partition.cpp | 9 +- src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp | 62 +++-- src/FeaturesPlugin/FeaturesPlugin_Pipe.h | 3 +- .../FeaturesPlugin_Placement.cpp | 17 +- .../FeaturesPlugin_RemoveSubShapes.cpp | 3 +- .../FeaturesPlugin_Revolution.cpp | 13 +- .../FeaturesPlugin_RevolutionBoolean.cpp | 9 +- .../FeaturesPlugin_RevolutionBoolean.h | 3 +- .../FeaturesPlugin_Rotation.cpp | 27 +- .../FeaturesPlugin_Translation.cpp | 30 ++- src/FeaturesPlugin/FeaturesPlugin_Union.cpp | 22 +- .../FeaturesPlugin_ValidatorTransform.cpp | 3 +- .../FeaturesPlugin_Validators.cpp | 152 +++++++---- 51 files changed, 930 insertions(+), 576 deletions(-) diff --git a/src/FeaturesAPI/FeaturesAPI_Boolean.cpp b/src/FeaturesAPI/FeaturesAPI_Boolean.cpp index f47eab172..e99beb77c 100644 --- a/src/FeaturesAPI/FeaturesAPI_Boolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Boolean.cpp @@ -70,7 +70,8 @@ void FeaturesAPI_Boolean::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); FeaturesPlugin_Boolean::OperationType aType = - (FeaturesPlugin_Boolean::OperationType)aBase->integer(FeaturesPlugin_Boolean::TYPE_ID())->value(); + (FeaturesPlugin_Boolean::OperationType)aBase->integer( + FeaturesPlugin_Boolean::TYPE_ID())->value(); theDumper << aBase << " = model.add"; @@ -83,7 +84,8 @@ void FeaturesAPI_Boolean::dump(ModelHighAPI_Dumper& theDumper) const } const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anObjects = aBase->selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID()); + AttributeSelectionListPtr anObjects = + aBase->selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID()); AttributeSelectionListPtr aTools = aBase->selectionList(FeaturesPlugin_Boolean::TOOL_LIST_ID()); theDumper << "(" << aDocName << ", " << anObjects << ", " << aTools << ")" << std::endl; diff --git a/src/FeaturesAPI/FeaturesAPI_Boolean.h b/src/FeaturesAPI/FeaturesAPI_Boolean.h index f314158cd..e8f423528 100644 --- a/src/FeaturesAPI/FeaturesAPI_Boolean.h +++ b/src/FeaturesAPI/FeaturesAPI_Boolean.h @@ -39,9 +39,12 @@ public: virtual ~FeaturesAPI_Boolean(); INTERFACE_3(FeaturesPlugin_Boolean::ID(), - boolType, FeaturesPlugin_Boolean::TYPE_ID(), ModelAPI_AttributeInteger, /** Operation type */, - mainObjects, FeaturesPlugin_Boolean::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */, - toolObjects, FeaturesPlugin_Boolean::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList, /** Tool objects*/) + boolType, FeaturesPlugin_Boolean::TYPE_ID(), + ModelAPI_AttributeInteger, /** Operation type */, + mainObjects, FeaturesPlugin_Boolean::OBJECT_LIST_ID(), + ModelAPI_AttributeSelectionList, /** Main objects */, + toolObjects, FeaturesPlugin_Boolean::TOOL_LIST_ID(), + ModelAPI_AttributeSelectionList, /** Tool objects*/) /// Set operation type. FEATURESAPI_EXPORT diff --git a/src/FeaturesAPI/FeaturesAPI_Extrusion.cpp b/src/FeaturesAPI/FeaturesAPI_Extrusion.cpp index 62f0d0470..341002dd6 100644 --- a/src/FeaturesAPI/FeaturesAPI_Extrusion.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Extrusion.cpp @@ -20,8 +20,8 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Double& theSize) + const std::list& theBaseObjects, + const ModelHighAPI_Double& theSize) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -32,9 +32,9 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theDirection, - const ModelHighAPI_Double& theSize) + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theDirection, + const ModelHighAPI_Double& theSize) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -46,9 +46,9 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Double& theToSize, - const ModelHighAPI_Double& theFromSize) + const std::list& theBaseObjects, + const ModelHighAPI_Double& theToSize, + const ModelHighAPI_Double& theFromSize) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -59,10 +59,10 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theDirection, - const ModelHighAPI_Double& theToSize, - const ModelHighAPI_Double& theFromSize) + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theDirection, + const ModelHighAPI_Double& theToSize, + const ModelHighAPI_Double& theFromSize) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -74,11 +74,11 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theToObject, - const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, - const ModelHighAPI_Double& theFromOffset) + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -89,12 +89,12 @@ FeaturesAPI_Extrusion::FeaturesAPI_Extrusion(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theDirection, - const ModelHighAPI_Selection& theToObject, - const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, - const ModelHighAPI_Double& theFromOffset) + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theDirection, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -190,14 +190,17 @@ void FeaturesAPI_Extrusion::dump(ModelHighAPI_Dumper& theDumper) const const std::string& aDocName = theDumper.name(aBase->document()); AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Extrusion::SKETCH_ID()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID()); - AttributeSelectionPtr anAttrDirection = aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID()); + AttributeSelectionPtr anAttrDirection = + aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID()); theDumper << aBase << " = model.addExtrusion(" << aDocName << ", "; anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects; theDumper << ", " << anAttrDirection; - std::string aCreationMethod = aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value(); + std::string aCreationMethod = + aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value(); if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES()) { AttributeDoublePtr anAttrToSize = aBase->real(FeaturesPlugin_Extrusion::TO_SIZE_ID()); @@ -205,12 +208,15 @@ void FeaturesAPI_Extrusion::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrToSize << ", " << anAttrFromSize; } else if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES()) { - AttributeSelectionPtr anAttrToObject = aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID()); + AttributeSelectionPtr anAttrToObject = + aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID()); AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Extrusion::TO_OFFSET_ID()); - AttributeSelectionPtr anAttrFromObject = aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID()); + AttributeSelectionPtr anAttrFromObject = + aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID()); AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Extrusion::FROM_OFFSET_ID()); - theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset; + theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << + ", " << anAttrFromObject << ", " << anAttrFromOffset; } theDumper << ")" << std::endl; diff --git a/src/FeaturesAPI/FeaturesAPI_Extrusion.h b/src/FeaturesAPI/FeaturesAPI_Extrusion.h index 9350d9817..9f6261bd5 100644 --- a/src/FeaturesAPI/FeaturesAPI_Extrusion.h +++ b/src/FeaturesAPI/FeaturesAPI_Extrusion.h @@ -79,16 +79,26 @@ public: virtual ~FeaturesAPI_Extrusion(); INTERFACE_10(FeaturesPlugin_Extrusion::ID(), - sketch, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */, - baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */, - direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */, - creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */, - toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */, - fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */, - toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */, - toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */, - fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */, - fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */) + sketch, FeaturesPlugin_Extrusion::SKETCH_ID(), + ModelAPI_AttributeReference, /** Sketch launcher */, + baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */, + direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), + ModelAPI_AttributeSelection, /** Direction */, + creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), + ModelAPI_AttributeString, /** Creation method */, + toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), + ModelAPI_AttributeDouble, /** To size */, + fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), + ModelAPI_AttributeDouble, /** From size */, + toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), + ModelAPI_AttributeSelection, /** To object */, + toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), + ModelAPI_AttributeDouble, /** To offset */, + fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), + ModelAPI_AttributeSelection, /** From object */, + fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), + ModelAPI_AttributeDouble, /** From offset */) /// Modify base attribute of the feature. FEATURESAPI_EXPORT @@ -104,13 +114,15 @@ public: /// Modify CreationMethod, to_size, from_size attributes of the feature. FEATURESAPI_EXPORT - void setSizes(const ModelHighAPI_Double& theToSize, const ModelHighAPI_Double& theFromSize); + void setSizes(const ModelHighAPI_Double& theToSize, + const ModelHighAPI_Double& theFromSize); /// Modify creation_method, to_size, from_size attributes of the feature. FEATURESAPI_EXPORT void setSize(const ModelHighAPI_Double& theSize); - /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature. + /// Modify creation_method, to_object, to_offset, + /// from_object, from_offset attributes of the feature. FEATURESAPI_EXPORT void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject, const ModelHighAPI_Double& theToOffset, diff --git a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp index 974f07694..eb73b8ba2 100644 --- a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.cpp @@ -12,7 +12,8 @@ #include //================================================================================================== -FeaturesAPI_ExtrusionBoolean::FeaturesAPI_ExtrusionBoolean(const std::shared_ptr& theFeature) +FeaturesAPI_ExtrusionBoolean::FeaturesAPI_ExtrusionBoolean( + const std::shared_ptr& theFeature) : ModelHighAPI_Interface(theFeature) { } @@ -97,7 +98,8 @@ void FeaturesAPI_ExtrusionBoolean::setPlanesAndOffsets(const ModelHighAPI_Select } //================================================================================================== -void FeaturesAPI_ExtrusionBoolean::setBooleanObjects(const std::list& theBooleanObjects) +void FeaturesAPI_ExtrusionBoolean::setBooleanObjects( + const std::list& theBooleanObjects) { fillAttribute(theBooleanObjects, mybooleanObjects); @@ -111,8 +113,10 @@ void FeaturesAPI_ExtrusionBoolean::dump(ModelHighAPI_Dumper& theDumper) const const std::string& aDocName = theDumper.name(aBase->document()); AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Extrusion::SKETCH_ID()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID()); - AttributeSelectionPtr anAttrDirection = aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Extrusion::BASE_OBJECTS_ID()); + AttributeSelectionPtr anAttrDirection = + aBase->selection(FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID()); theDumper << aBase << " = model.addExtrusion"; if(aBase->getKind() == FeaturesPlugin_ExtrusionCut::ID()) { @@ -124,7 +128,8 @@ void FeaturesAPI_ExtrusionBoolean::dump(ModelHighAPI_Dumper& theDumper) const anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects; theDumper << ", " << anAttrDirection; - std::string aCreationMethod = aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value(); + std::string aCreationMethod = + aBase->string(FeaturesPlugin_Extrusion::CREATION_METHOD())->value(); if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_SIZES()) { AttributeDoublePtr anAttrToSize = aBase->real(FeaturesPlugin_Extrusion::TO_SIZE_ID()); @@ -132,15 +137,19 @@ void FeaturesAPI_ExtrusionBoolean::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrToSize << ", " << anAttrFromSize; } else if(aCreationMethod == FeaturesPlugin_Extrusion::CREATION_METHOD_BY_PLANES()) { - AttributeSelectionPtr anAttrToObject = aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID()); + AttributeSelectionPtr anAttrToObject = + aBase->selection(FeaturesPlugin_Extrusion::TO_OBJECT_ID()); AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Extrusion::TO_OFFSET_ID()); - AttributeSelectionPtr anAttrFromObject = aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID()); + AttributeSelectionPtr anAttrFromObject = + aBase->selection(FeaturesPlugin_Extrusion::FROM_OBJECT_ID()); AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Extrusion::FROM_OFFSET_ID()); - theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset; + theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << + ", " << anAttrFromObject << ", " << anAttrFromOffset; } - AttributeSelectionListPtr anAttrBoolObjects = aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID()); + AttributeSelectionListPtr anAttrBoolObjects = + aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID()); theDumper << ", " << anAttrBoolObjects << ")" << std::endl; if(anAttrSketch->isInitialized()) { @@ -158,17 +167,19 @@ void FeaturesAPI_ExtrusionBoolean::execIfBaseNotEmpty() //================================================================================================== -FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr& theFeature) +FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut( + const std::shared_ptr& theFeature) : FeaturesAPI_ExtrusionBoolean(theFeature) { initialize(); } //================================================================================================== -FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Double& theSize, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Double& theSize, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -181,11 +192,12 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theDirection, - const ModelHighAPI_Double& theSize, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theDirection, + const ModelHighAPI_Double& theSize, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -199,11 +211,12 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Double& theToSize, - const ModelHighAPI_Double& theFromSize, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Double& theToSize, + const ModelHighAPI_Double& theFromSize, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -216,12 +229,13 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theDirection, - const ModelHighAPI_Double& theToSize, - const ModelHighAPI_Double& theFromSize, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theDirection, + const ModelHighAPI_Double& theToSize, + const ModelHighAPI_Double& theFromSize, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -235,13 +249,14 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theToObject, - const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, - const ModelHighAPI_Double& theFromOffset, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -256,14 +271,15 @@ FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theDirection, - const ModelHighAPI_Selection& theToObject, - const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, - const ModelHighAPI_Double& theFromOffset, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionCut::FeaturesAPI_ExtrusionCut( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theDirection, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -284,8 +300,10 @@ ExtrusionCutPtr addExtrusionCut(const std::shared_ptr& thePar const ModelHighAPI_Double& theSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); - return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theSize, theBooleanObjects)); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); + return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, + theSize, theBooleanObjects)); } //================================================================================================== @@ -295,8 +313,10 @@ ExtrusionCutPtr addExtrusionCut(const std::shared_ptr& thePar const ModelHighAPI_Double& theSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); - return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection, theSize, theBooleanObjects)); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); + return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection, + theSize, theBooleanObjects)); } //================================================================================================== @@ -306,8 +326,10 @@ ExtrusionCutPtr addExtrusionCut(const std::shared_ptr& thePar const ModelHighAPI_Double& theFromSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); - return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theToSize, theFromSize, theBooleanObjects)); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); + return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, + theToSize, theFromSize, theBooleanObjects)); } //================================================================================================== @@ -318,7 +340,8 @@ ExtrusionCutPtr addExtrusionCut(const std::shared_ptr& thePar const ModelHighAPI_Double& theFromSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection, @@ -336,7 +359,8 @@ ExtrusionCutPtr addExtrusionCut(const std::shared_ptr& thePar const ModelHighAPI_Double& theFromOffset, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theToObject, @@ -356,7 +380,8 @@ ExtrusionCutPtr addExtrusionCut(const std::shared_ptr& thePar const ModelHighAPI_Double& theFromOffset, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionCut::ID()); return ExtrusionCutPtr(new FeaturesAPI_ExtrusionCut(aFeature, theBaseObjects, theDirection, @@ -369,17 +394,19 @@ ExtrusionCutPtr addExtrusionCut(const std::shared_ptr& thePar //================================================================================================== -FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr& theFeature) +FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse( + const std::shared_ptr& theFeature) : FeaturesAPI_ExtrusionBoolean(theFeature) { initialize(); } //================================================================================================== -FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Double& theSize, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Double& theSize, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -392,11 +419,12 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theDirection, - const ModelHighAPI_Double& theSize, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theDirection, + const ModelHighAPI_Double& theSize, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -410,11 +438,12 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Double& theToSize, - const ModelHighAPI_Double& theFromSize, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Double& theToSize, + const ModelHighAPI_Double& theFromSize, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -427,12 +456,13 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theDirection, - const ModelHighAPI_Double& theToSize, - const ModelHighAPI_Double& theFromSize, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theDirection, + const ModelHighAPI_Double& theToSize, + const ModelHighAPI_Double& theFromSize, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -446,13 +476,14 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theToObject, - const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, - const ModelHighAPI_Double& theFromOffset, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -467,14 +498,15 @@ FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theDirection, - const ModelHighAPI_Selection& theToObject, - const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, - const ModelHighAPI_Double& theFromOffset, - const std::list& theBooleanObjects) +FeaturesAPI_ExtrusionFuse::FeaturesAPI_ExtrusionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theDirection, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects) : FeaturesAPI_ExtrusionBoolean(theFeature) { if(initialize()) { @@ -495,8 +527,10 @@ ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr& theP const ModelHighAPI_Double& theSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); - return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theSize, theBooleanObjects)); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); + return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, + theSize, theBooleanObjects)); } //================================================================================================== @@ -506,8 +540,10 @@ ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr& theP const ModelHighAPI_Double& theSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); - return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theDirection, theSize, theBooleanObjects)); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); + return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, + theDirection, theSize, theBooleanObjects)); } //================================================================================================== @@ -517,8 +553,10 @@ ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr& theP const ModelHighAPI_Double& theFromSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); - return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theToSize, theFromSize, theBooleanObjects)); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); + return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, + theToSize, theFromSize, theBooleanObjects)); } //================================================================================================== @@ -529,7 +567,8 @@ ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr& theP const ModelHighAPI_Double& theFromSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theDirection, @@ -547,7 +586,8 @@ ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr& theP const ModelHighAPI_Double& theFromOffset, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theToObject, @@ -567,7 +607,8 @@ ExtrusionFusePtr addExtrusionFuse(const std::shared_ptr& theP const ModelHighAPI_Double& theFromOffset, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_ExtrusionFuse::ID()); return ExtrusionFusePtr(new FeaturesAPI_ExtrusionFuse(aFeature, theBaseObjects, theDirection, diff --git a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.h b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.h index 4894c5fc8..67d4129df 100644 --- a/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.h +++ b/src/FeaturesAPI/FeaturesAPI_ExtrusionBoolean.h @@ -30,17 +30,28 @@ public: virtual ~FeaturesAPI_ExtrusionBoolean(); INTERFACE_11("", - sketch, FeaturesPlugin_Extrusion::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */, - baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */, - direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), ModelAPI_AttributeSelection, /** Direction */, - creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */, - toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble, /** To size */, - fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble, /** From size */, - toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */, - toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */, - fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */, - fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */, - booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Boolean objects */) + sketch, FeaturesPlugin_Extrusion::SKETCH_ID(), + ModelAPI_AttributeReference, /** Sketch launcher */, + baseObjects, FeaturesPlugin_Extrusion::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */, + direction, FeaturesPlugin_Extrusion::DIRECTION_OBJECT_ID(), + ModelAPI_AttributeSelection, /** Direction */, + creationMethod, FeaturesPlugin_Extrusion::CREATION_METHOD(), + ModelAPI_AttributeString, /** Creation method */, + toSize, FeaturesPlugin_Extrusion::TO_SIZE_ID(), + ModelAPI_AttributeDouble, /** To size */, + fromSize, FeaturesPlugin_Extrusion::FROM_SIZE_ID(), + ModelAPI_AttributeDouble, /** From size */, + toObject, FeaturesPlugin_Extrusion::TO_OBJECT_ID(), + ModelAPI_AttributeSelection, /** To object */, + toOffset, FeaturesPlugin_Extrusion::TO_OFFSET_ID(), + ModelAPI_AttributeDouble, /** To offset */, + fromObject, FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), + ModelAPI_AttributeSelection, /** From object */, + fromOffset, FeaturesPlugin_Extrusion::FROM_OFFSET_ID(), + ModelAPI_AttributeDouble, /** From offset */, + booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Boolean objects */) /// Modify base attribute of the feature. FEATURESAPI_EXPORT @@ -62,7 +73,8 @@ public: FEATURESAPI_EXPORT void setSize(const ModelHighAPI_Double& theSize); - /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature. + /// Modify creation_method, to_object, to_offset, from_object, + /// from_offset attributes of the feature. FEATURESAPI_EXPORT void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject, const ModelHighAPI_Double& theToOffset, diff --git a/src/FeaturesAPI/FeaturesAPI_Group.h b/src/FeaturesAPI/FeaturesAPI_Group.h index fece502f2..f4d2dd11b 100644 --- a/src/FeaturesAPI/FeaturesAPI_Group.h +++ b/src/FeaturesAPI/FeaturesAPI_Group.h @@ -37,7 +37,8 @@ public: virtual ~FeaturesAPI_Group(); INTERFACE_1(FeaturesPlugin_Group::ID(), - groupList, FeaturesPlugin_Group::LIST_ID(), ModelAPI_AttributeSelectionList, /** Group list*/) + groupList, FeaturesPlugin_Group::LIST_ID(), + ModelAPI_AttributeSelectionList, /** Group list*/) /// Set main objects. FEATURESAPI_EXPORT diff --git a/src/FeaturesAPI/FeaturesAPI_Intersection.cpp b/src/FeaturesAPI/FeaturesAPI_Intersection.cpp index 8cd80eb47..803600f7d 100644 --- a/src/FeaturesAPI/FeaturesAPI_Intersection.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Intersection.cpp @@ -10,16 +10,18 @@ #include //================================================================================================== -FeaturesAPI_Intersection::FeaturesAPI_Intersection(const std::shared_ptr& theFeature) +FeaturesAPI_Intersection::FeaturesAPI_Intersection( + const std::shared_ptr& theFeature) : ModelHighAPI_Interface(theFeature) { initialize(); } //================================================================================================== -FeaturesAPI_Intersection::FeaturesAPI_Intersection(const std::shared_ptr& theFeature, - const std::list& theObjects, - const std::list& theTools) +FeaturesAPI_Intersection::FeaturesAPI_Intersection( + const std::shared_ptr& theFeature, + const std::list& theObjects, + const std::list& theTools) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -58,8 +60,10 @@ void FeaturesAPI_Intersection::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID()); - AttributeSelectionListPtr anAttrTools = aBase->selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID()); + AttributeSelectionListPtr anAttrTools = + aBase->selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID()); theDumper << aBase << " = model.addIntersection(" << aDocName << ", " << anAttrObjects << ", " << anAttrTools << ")" << std::endl; diff --git a/src/FeaturesAPI/FeaturesAPI_Intersection.h b/src/FeaturesAPI/FeaturesAPI_Intersection.h index 78a6d5156..2d86bc3ac 100644 --- a/src/FeaturesAPI/FeaturesAPI_Intersection.h +++ b/src/FeaturesAPI/FeaturesAPI_Intersection.h @@ -38,8 +38,10 @@ public: virtual ~FeaturesAPI_Intersection(); INTERFACE_2(FeaturesPlugin_Intersection::ID(), - objects, FeaturesPlugin_Intersection::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList, /** Objects */, - tools, FeaturesPlugin_Intersection::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList, /** Tools */) + objects, FeaturesPlugin_Intersection::OBJECT_LIST_ID(), + ModelAPI_AttributeSelectionList, /** Objects */, + tools, FeaturesPlugin_Intersection::TOOL_LIST_ID(), + ModelAPI_AttributeSelectionList, /** Tools */) /// Modify objects attribute of the feature. FEATURESAPI_EXPORT diff --git a/src/FeaturesAPI/FeaturesAPI_Partition.cpp b/src/FeaturesAPI/FeaturesAPI_Partition.cpp index 3580a0997..ff4a4c35c 100644 --- a/src/FeaturesAPI/FeaturesAPI_Partition.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Partition.cpp @@ -18,7 +18,7 @@ FeaturesAPI_Partition::FeaturesAPI_Partition(const std::shared_ptr& theFeature, - const std::list& theBaseObjects) + const std::list& theBaseObjects) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -46,9 +46,11 @@ void FeaturesAPI_Partition::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Partition::BASE_OBJECTS_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Partition::BASE_OBJECTS_ID()); - theDumper << aBase << " = model.addPartition(" << aDocName << ", " << anAttrObjects << ")" << std::endl; + theDumper << aBase << " = model.addPartition(" << aDocName << + ", " << anAttrObjects << ")" << std::endl; } //================================================================================================== diff --git a/src/FeaturesAPI/FeaturesAPI_Partition.h b/src/FeaturesAPI/FeaturesAPI_Partition.h index cc7831d8f..c87fb1ccc 100644 --- a/src/FeaturesAPI/FeaturesAPI_Partition.h +++ b/src/FeaturesAPI/FeaturesAPI_Partition.h @@ -37,7 +37,8 @@ public: virtual ~FeaturesAPI_Partition(); INTERFACE_1(FeaturesPlugin_Partition::ID(), - baseObjects, FeaturesPlugin_Partition::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */) + baseObjects, FeaturesPlugin_Partition::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */) /// Modify base attribute of the feature. FEATURESAPI_EXPORT diff --git a/src/FeaturesAPI/FeaturesAPI_Pipe.cpp b/src/FeaturesAPI/FeaturesAPI_Pipe.cpp index 86c042a52..97ce2d8a2 100644 --- a/src/FeaturesAPI/FeaturesAPI_Pipe.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Pipe.cpp @@ -85,9 +85,10 @@ void FeaturesAPI_Pipe::setByBasePath(const std::list& th } //================================================================================================== -void FeaturesAPI_Pipe::setByBasePathBiNormal(const std::list& theBaseObjects, - const ModelHighAPI_Selection& thePath, - const ModelHighAPI_Selection& theBiNoramal) +void FeaturesAPI_Pipe::setByBasePathBiNormal( + const std::list& theBaseObjects, + const ModelHighAPI_Selection& thePath, + const ModelHighAPI_Selection& theBiNoramal) { fillAttribute(FeaturesPlugin_Pipe::CREATION_METHOD_BINORMAL(), mycreationMethod); fillAttribute(theBaseObjects, mybaseObjects); @@ -98,9 +99,10 @@ void FeaturesAPI_Pipe::setByBasePathBiNormal(const std::list& theBaseObjects, - const ModelHighAPI_Selection& thePath, - const std::list& theLocations) +void FeaturesAPI_Pipe::setByBasePathLocations( + const std::list& theBaseObjects, + const ModelHighAPI_Selection& thePath, + const std::list& theLocations) { fillAttribute(FeaturesPlugin_Pipe::CREATION_METHOD_LOCATIONS(), mycreationMethod); fillAttribute(theBaseObjects, mybaseObjects); @@ -116,7 +118,8 @@ void FeaturesAPI_Pipe::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Pipe::BASE_OBJECTS_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Pipe::BASE_OBJECTS_ID()); AttributeSelectionPtr anAttrPath = aBase->selection(FeaturesPlugin_Pipe::PATH_OBJECT_ID()); theDumper << aBase << " = model.addPipe(" << aDocName << ", " @@ -131,7 +134,8 @@ void FeaturesAPI_Pipe::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrBiNormal; } else if(aCreationMethod == FeaturesPlugin_Pipe::CREATION_METHOD_LOCATIONS()) { - AttributeSelectionListPtr anAttrLocations = aBase->selectionList(FeaturesPlugin_Pipe::LOCATIONS_ID()); + AttributeSelectionListPtr anAttrLocations = + aBase->selectionList(FeaturesPlugin_Pipe::LOCATIONS_ID()); theDumper << ", " << anAttrLocations; } diff --git a/src/FeaturesAPI/FeaturesAPI_Pipe.h b/src/FeaturesAPI/FeaturesAPI_Pipe.h index e45fd369f..7a90b8172 100644 --- a/src/FeaturesAPI/FeaturesAPI_Pipe.h +++ b/src/FeaturesAPI/FeaturesAPI_Pipe.h @@ -52,11 +52,16 @@ public: virtual ~FeaturesAPI_Pipe(); INTERFACE_5(FeaturesPlugin_Pipe::ID(), - baseObjects, FeaturesPlugin_Pipe::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */, - path, FeaturesPlugin_Pipe::PATH_OBJECT_ID(), ModelAPI_AttributeSelection, /** Path */, - creationMethod, FeaturesPlugin_Pipe::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */, - biNormal, FeaturesPlugin_Pipe::BINORMAL_ID(), ModelAPI_AttributeSelection, /** Bi-Normal */, - locations, FeaturesPlugin_Pipe::LOCATIONS_ID(), ModelAPI_AttributeSelectionList, /** Locations */) + baseObjects, FeaturesPlugin_Pipe::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */, + path, FeaturesPlugin_Pipe::PATH_OBJECT_ID(), + ModelAPI_AttributeSelection, /** Path */, + creationMethod, FeaturesPlugin_Pipe::CREATION_METHOD(), + ModelAPI_AttributeString, /** Creation method */, + biNormal, FeaturesPlugin_Pipe::BINORMAL_ID(), + ModelAPI_AttributeSelection, /** Bi-Normal */, + locations, FeaturesPlugin_Pipe::LOCATIONS_ID(), + ModelAPI_AttributeSelectionList, /** Locations */) /// Modify base attribute of the feature. FEATURESAPI_EXPORT diff --git a/src/FeaturesAPI/FeaturesAPI_Placement.cpp b/src/FeaturesAPI/FeaturesAPI_Placement.cpp index 5d3aff8b4..9be8820cc 100644 --- a/src/FeaturesAPI/FeaturesAPI_Placement.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Placement.cpp @@ -86,8 +86,10 @@ void FeaturesAPI_Placement::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Placement::OBJECTS_LIST_ID()); - AttributeSelectionPtr anAttrStartShape = aBase->selection(FeaturesPlugin_Placement::START_SHAPE_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Placement::OBJECTS_LIST_ID()); + AttributeSelectionPtr anAttrStartShape = + aBase->selection(FeaturesPlugin_Placement::START_SHAPE_ID()); AttributeSelectionPtr anAttrEndShape = aBase->selection(FeaturesPlugin_Placement::END_SHAPE_ID()); AttributeBooleanPtr anAttrReverse = aBase->boolean(FeaturesPlugin_Placement::REVERSE_ID()); AttributeBooleanPtr anAttrCentering = aBase->boolean(FeaturesPlugin_Placement::CENTERING_ID()); diff --git a/src/FeaturesAPI/FeaturesAPI_Placement.h b/src/FeaturesAPI/FeaturesAPI_Placement.h index 2b157611f..b6068a7b9 100644 --- a/src/FeaturesAPI/FeaturesAPI_Placement.h +++ b/src/FeaturesAPI/FeaturesAPI_Placement.h @@ -41,11 +41,16 @@ public: virtual ~FeaturesAPI_Placement(); INTERFACE_5(FeaturesPlugin_Placement::ID(), - objects, FeaturesPlugin_Placement::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */, - startShape, FeaturesPlugin_Placement::START_SHAPE_ID(), ModelAPI_AttributeSelection, /** Start shape */, - endShape, FeaturesPlugin_Placement::END_SHAPE_ID(), ModelAPI_AttributeSelection, /** End shape */, - reverseDirection, FeaturesPlugin_Placement::REVERSE_ID(), ModelAPI_AttributeBoolean, /** Reverse direction flag */, - centering, FeaturesPlugin_Placement::CENTERING_ID(), ModelAPI_AttributeBoolean, /** Centering flag */) + objects, FeaturesPlugin_Placement::OBJECTS_LIST_ID(), + ModelAPI_AttributeSelectionList, /** Main objects */, + startShape, FeaturesPlugin_Placement::START_SHAPE_ID(), + ModelAPI_AttributeSelection, /** Start shape */, + endShape, FeaturesPlugin_Placement::END_SHAPE_ID(), + ModelAPI_AttributeSelection, /** End shape */, + reverseDirection, FeaturesPlugin_Placement::REVERSE_ID(), + ModelAPI_AttributeBoolean, /** Reverse direction flag */, + centering, FeaturesPlugin_Placement::CENTERING_ID(), + ModelAPI_AttributeBoolean, /** Centering flag */) /// Set objects. FEATURESAPI_EXPORT diff --git a/src/FeaturesAPI/FeaturesAPI_Recover.cpp b/src/FeaturesAPI/FeaturesAPI_Recover.cpp index 368f54a4d..7f86b7a57 100644 --- a/src/FeaturesAPI/FeaturesAPI_Recover.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Recover.cpp @@ -62,8 +62,10 @@ void FeaturesAPI_Recover::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeReferencePtr anAttrBaseFeature = aBase->reference(FeaturesPlugin_Recover::BASE_FEATURE()); - AttributeRefListPtr anAttrRecoveredEntities = aBase->reflist(FeaturesPlugin_Recover::RECOVERED_ENTITIES()); + AttributeReferencePtr anAttrBaseFeature = + aBase->reference(FeaturesPlugin_Recover::BASE_FEATURE()); + AttributeRefListPtr anAttrRecoveredEntities = + aBase->reflist(FeaturesPlugin_Recover::RECOVERED_ENTITIES()); AttributeBooleanPtr anAttrPersistent = aBase->boolean(FeaturesPlugin_Recover::PERSISTENT()); FeaturePtr aFeature = ModelAPI_Feature::feature(anAttrBaseFeature->value()); diff --git a/src/FeaturesAPI/FeaturesAPI_Recover.h b/src/FeaturesAPI/FeaturesAPI_Recover.h index e7f57d426..862e018a2 100644 --- a/src/FeaturesAPI/FeaturesAPI_Recover.h +++ b/src/FeaturesAPI/FeaturesAPI_Recover.h @@ -39,9 +39,12 @@ public: virtual ~FeaturesAPI_Recover(); INTERFACE_3(FeaturesPlugin_Recover::ID(), - baseFeature, FeaturesPlugin_Recover::BASE_FEATURE(), ModelAPI_AttributeReference, /** Concealed feature */, - recoveredList, FeaturesPlugin_Recover::RECOVERED_ENTITIES(), ModelAPI_AttributeRefList, /** Recover list*/, - isPersistent, FeaturesPlugin_Recover::PERSISTENT(), ModelAPI_AttributeBoolean, /** Is persistent flag */) + baseFeature, FeaturesPlugin_Recover::BASE_FEATURE(), + ModelAPI_AttributeReference, /** Concealed feature */, + recoveredList, FeaturesPlugin_Recover::RECOVERED_ENTITIES(), + ModelAPI_AttributeRefList, /** Recover list*/, + isPersistent, FeaturesPlugin_Recover::PERSISTENT(), + ModelAPI_AttributeBoolean, /** Is persistent flag */) /// Set base feature. FEATURESAPI_EXPORT diff --git a/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.cpp b/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.cpp index b5dd098c9..ab5841b5b 100644 --- a/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.cpp +++ b/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.cpp @@ -10,15 +10,17 @@ #include //================================================================================================== -FeaturesAPI_RemoveSubShapes::FeaturesAPI_RemoveSubShapes(const std::shared_ptr& theFeature) +FeaturesAPI_RemoveSubShapes::FeaturesAPI_RemoveSubShapes( + const std::shared_ptr& theFeature) : ModelHighAPI_Interface(theFeature) { initialize(); } //================================================================================================== -FeaturesAPI_RemoveSubShapes::FeaturesAPI_RemoveSubShapes(const std::shared_ptr& theFeature, - const ModelHighAPI_Selection& theBase) +FeaturesAPI_RemoveSubShapes::FeaturesAPI_RemoveSubShapes( + const std::shared_ptr& theFeature, + const ModelHighAPI_Selection& theBase) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -43,7 +45,8 @@ void FeaturesAPI_RemoveSubShapes::setBase(const ModelHighAPI_Selection& theBase) } //================================================================================================== -void FeaturesAPI_RemoveSubShapes::setSubShapesToKeep(const std::list& theSubShapes) +void FeaturesAPI_RemoveSubShapes::setSubShapesToKeep( + const std::list& theSubShapes) { fillAttribute(theSubShapes, mysubshapes); @@ -56,10 +59,13 @@ void FeaturesAPI_RemoveSubShapes::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionPtr anAttrBaseShape = aBase->selection(FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID()); - AttributeSelectionListPtr anAttrSubShapes = aBase->selectionList(FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID()); + AttributeSelectionPtr anAttrBaseShape = + aBase->selection(FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID()); + AttributeSelectionListPtr anAttrSubShapes = + aBase->selectionList(FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID()); - theDumper << aBase << " = model.addRemoveSubShapes(" << aDocName << ", " << anAttrBaseShape << ")" << std::endl; + theDumper << aBase << " = model.addRemoveSubShapes(" << aDocName << + ", " << anAttrBaseShape << ")" << std::endl; theDumper << aBase << ".setSubShapesToKeep(" << anAttrSubShapes << ")" << std::endl; } @@ -67,6 +73,7 @@ void FeaturesAPI_RemoveSubShapes::dump(ModelHighAPI_Dumper& theDumper) const RemoveSubShapesPtr addRemoveSubShapes(const std::shared_ptr& thePart, const ModelHighAPI_Selection& theBase) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesAPI_RemoveSubShapes::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesAPI_RemoveSubShapes::ID()); return RemoveSubShapesPtr(new FeaturesAPI_RemoveSubShapes(aFeature, theBase)); } diff --git a/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h b/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h index b6e4d587e..86fe3e437 100644 --- a/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h +++ b/src/FeaturesAPI/FeaturesAPI_RemoveSubShapes.h @@ -37,8 +37,10 @@ public: virtual ~FeaturesAPI_RemoveSubShapes(); INTERFACE_2(FeaturesPlugin_RemoveSubShapes::ID(), - base, FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID(), ModelAPI_AttributeSelection, /** Base */, - subshapes, FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID(), ModelAPI_AttributeSelectionList, /** Subshapes */) + base, FeaturesPlugin_RemoveSubShapes::BASE_SHAPE_ID(), + ModelAPI_AttributeSelection, /** Base */, + subshapes, FeaturesPlugin_RemoveSubShapes::SUBSHAPES_ID(), + ModelAPI_AttributeSelectionList, /** Subshapes */) /// Modify objects attribute of the feature. FEATURESAPI_EXPORT diff --git a/src/FeaturesAPI/FeaturesAPI_Revolution.cpp b/src/FeaturesAPI/FeaturesAPI_Revolution.cpp index 173a61594..a0dd09ed4 100644 --- a/src/FeaturesAPI/FeaturesAPI_Revolution.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Revolution.cpp @@ -19,10 +19,11 @@ FeaturesAPI_Revolution::FeaturesAPI_Revolution(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theAxis, - const ModelHighAPI_Double& theAngle) +FeaturesAPI_Revolution::FeaturesAPI_Revolution( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theAngle) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -33,11 +34,12 @@ FeaturesAPI_Revolution::FeaturesAPI_Revolution(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theAxis, - const ModelHighAPI_Double& theToAngle, - const ModelHighAPI_Double& theFromAngle) +FeaturesAPI_Revolution::FeaturesAPI_Revolution( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -48,13 +50,14 @@ FeaturesAPI_Revolution::FeaturesAPI_Revolution(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theAxis, - const ModelHighAPI_Selection& theToObject, - const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, - const ModelHighAPI_Double& theFromOffset) +FeaturesAPI_Revolution::FeaturesAPI_Revolution( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -151,14 +154,16 @@ void FeaturesAPI_Revolution::dump(ModelHighAPI_Dumper& theDumper) const const std::string& aDocName = theDumper.name(aBase->document()); AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Revolution::SKETCH_ID()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Revolution::BASE_OBJECTS_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Revolution::BASE_OBJECTS_ID()); AttributeSelectionPtr anAttrAxis = aBase->selection(FeaturesPlugin_Revolution::AXIS_OBJECT_ID()); theDumper << aBase << " = model.addRevolution(" << aDocName << ", "; anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects; theDumper << ", " << anAttrAxis; - std::string aCreationMethod = aBase->string(FeaturesPlugin_Revolution::CREATION_METHOD())->value(); + std::string aCreationMethod = + aBase->string(FeaturesPlugin_Revolution::CREATION_METHOD())->value(); if(aCreationMethod == FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES()) { AttributeDoublePtr anAttrToAngle = aBase->real(FeaturesPlugin_Revolution::TO_ANGLE_ID()); @@ -166,12 +171,15 @@ void FeaturesAPI_Revolution::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrToAngle << ", " << anAttrFromAngle; } else if(aCreationMethod == FeaturesPlugin_Revolution::CREATION_METHOD_BY_PLANES()) { - AttributeSelectionPtr anAttrToObject = aBase->selection(FeaturesPlugin_Revolution::TO_OBJECT_ID()); + AttributeSelectionPtr anAttrToObject = + aBase->selection(FeaturesPlugin_Revolution::TO_OBJECT_ID()); AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Revolution::TO_OFFSET_ID()); - AttributeSelectionPtr anAttrFromObject = aBase->selection(FeaturesPlugin_Revolution::FROM_OBJECT_ID()); + AttributeSelectionPtr anAttrFromObject = + aBase->selection(FeaturesPlugin_Revolution::FROM_OBJECT_ID()); AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Revolution::FROM_OFFSET_ID()); - theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset; + theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << + ", " << anAttrFromObject << ", " << anAttrFromOffset; } theDumper << ")" << std::endl; diff --git a/src/FeaturesAPI/FeaturesAPI_Revolution.h b/src/FeaturesAPI/FeaturesAPI_Revolution.h index e011ee403..fad2ce17b 100644 --- a/src/FeaturesAPI/FeaturesAPI_Revolution.h +++ b/src/FeaturesAPI/FeaturesAPI_Revolution.h @@ -58,16 +58,26 @@ public: virtual ~FeaturesAPI_Revolution(); INTERFACE_10(FeaturesPlugin_Revolution::ID(), - sketch, FeaturesPlugin_Revolution::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */, - baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */, - axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis */, - creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */, - toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), ModelAPI_AttributeDouble, /** To angle */, - fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), ModelAPI_AttributeDouble, /** From angle */, - toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */, - toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */, - fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */, - fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */) + sketch, FeaturesPlugin_Revolution::SKETCH_ID(), + ModelAPI_AttributeReference, /** Sketch launcher */, + baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */, + axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), + ModelAPI_AttributeSelection, /** Axis */, + creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), + ModelAPI_AttributeString, /** Creation method */, + toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), + ModelAPI_AttributeDouble, /** To angle */, + fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), + ModelAPI_AttributeDouble, /** From angle */, + toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), + ModelAPI_AttributeSelection, /** To object */, + toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), + ModelAPI_AttributeDouble, /** To offset */, + fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), + ModelAPI_AttributeSelection, /** From object */, + fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), + ModelAPI_AttributeDouble, /** From offset */) /// Modify base attribute of the feature. FEATURESAPI_EXPORT @@ -83,13 +93,15 @@ public: /// Modify CreationMethod, to_angle, from_angle attributes of the feature. FEATURESAPI_EXPORT - void setAngles(const ModelHighAPI_Double& theToAngle, const ModelHighAPI_Double& theFromAngle); + void setAngles(const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle); /// Modify CreationMethod, to_angle, from_angle attributes of the feature. FEATURESAPI_EXPORT void setAngle(const ModelHighAPI_Double& theAngle); - /// Modify CreationMethod, to_object, to_offset, from_object, from_offset attributes of the feature. + /// Modify CreationMethod, to_object, to_offset, + /// from_object, from_offset attributes of the feature. FEATURESAPI_EXPORT void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject, const ModelHighAPI_Double& theToOffset, diff --git a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp index cf897c960..bfdca9b56 100644 --- a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp @@ -12,7 +12,8 @@ #include //================================================================================================== -FeaturesAPI_RevolutionBoolean::FeaturesAPI_RevolutionBoolean(const std::shared_ptr& theFeature) +FeaturesAPI_RevolutionBoolean::FeaturesAPI_RevolutionBoolean( + const std::shared_ptr& theFeature) : ModelHighAPI_Interface(theFeature) { } @@ -84,7 +85,7 @@ void FeaturesAPI_RevolutionBoolean::setAngle(const ModelHighAPI_Double& theAngle //================================================================================================== void FeaturesAPI_RevolutionBoolean::setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject, const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Selection& theFromObject, const ModelHighAPI_Double& theFromOffset) { fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_PLANES(), mycreationMethod); @@ -97,7 +98,8 @@ void FeaturesAPI_RevolutionBoolean::setPlanesAndOffsets(const ModelHighAPI_Selec } //================================================================================================== -void FeaturesAPI_RevolutionBoolean::setBooleanObjects(const std::list& theBooleanObjects) +void FeaturesAPI_RevolutionBoolean::setBooleanObjects( + const std::list& theBooleanObjects) { fillAttribute(theBooleanObjects, mybooleanObjects); @@ -110,9 +112,12 @@ void FeaturesAPI_RevolutionBoolean::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeReferencePtr anAttrSketch = aBase->reference(FeaturesPlugin_Revolution::SKETCH_ID()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Revolution::BASE_OBJECTS_ID()); - AttributeSelectionPtr anAttrAxis = aBase->selection(FeaturesPlugin_Revolution::AXIS_OBJECT_ID()); + AttributeReferencePtr anAttrSketch = + aBase->reference(FeaturesPlugin_Revolution::SKETCH_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Revolution::BASE_OBJECTS_ID()); + AttributeSelectionPtr anAttrAxis = + aBase->selection(FeaturesPlugin_Revolution::AXIS_OBJECT_ID()); theDumper << aBase << " = model.addRevolution"; if(aBase->getKind() == FeaturesPlugin_RevolutionCut::ID()) { @@ -124,7 +129,8 @@ void FeaturesAPI_RevolutionBoolean::dump(ModelHighAPI_Dumper& theDumper) const anAttrSketch->isInitialized() ? theDumper << "[]" : theDumper << anAttrObjects; theDumper << ", " << anAttrAxis; - std::string aCreationMethod = aBase->string(FeaturesPlugin_Revolution::CREATION_METHOD())->value(); + std::string aCreationMethod = + aBase->string(FeaturesPlugin_Revolution::CREATION_METHOD())->value(); if(aCreationMethod == FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES()) { AttributeDoublePtr anAttrToAngle = aBase->real(FeaturesPlugin_Revolution::TO_ANGLE_ID()); @@ -132,15 +138,21 @@ void FeaturesAPI_RevolutionBoolean::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrToAngle << ", " << anAttrFromAngle; } else if(aCreationMethod == FeaturesPlugin_Revolution::CREATION_METHOD_BY_PLANES()) { - AttributeSelectionPtr anAttrToObject = aBase->selection(FeaturesPlugin_Revolution::TO_OBJECT_ID()); - AttributeDoublePtr anAttrToOffset = aBase->real(FeaturesPlugin_Revolution::TO_OFFSET_ID()); - AttributeSelectionPtr anAttrFromObject = aBase->selection(FeaturesPlugin_Revolution::FROM_OBJECT_ID()); - AttributeDoublePtr anAttrFromOffset = aBase->real(FeaturesPlugin_Revolution::FROM_OFFSET_ID()); - - theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset; + AttributeSelectionPtr anAttrToObject = + aBase->selection(FeaturesPlugin_Revolution::TO_OBJECT_ID()); + AttributeDoublePtr anAttrToOffset = + aBase->real(FeaturesPlugin_Revolution::TO_OFFSET_ID()); + AttributeSelectionPtr anAttrFromObject = + aBase->selection(FeaturesPlugin_Revolution::FROM_OBJECT_ID()); + AttributeDoublePtr anAttrFromOffset = + aBase->real(FeaturesPlugin_Revolution::FROM_OFFSET_ID()); + + theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << + ", " << anAttrFromObject << ", " << anAttrFromOffset; } - AttributeSelectionListPtr anAttrBoolObjects = aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID()); + AttributeSelectionListPtr anAttrBoolObjects = + aBase->selectionList(FeaturesPlugin_CompositeBoolean::OBJECTS_ID()); theDumper << ", " << anAttrBoolObjects << ")" << std::endl; if(anAttrSketch->isInitialized()) { @@ -157,18 +169,20 @@ void FeaturesAPI_RevolutionBoolean::execIfBaseNotEmpty() } //================================================================================================== -FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature) +FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut( + const std::shared_ptr& theFeature) : FeaturesAPI_RevolutionBoolean(theFeature) { initialize(); } //================================================================================================== -FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theAxis, - const ModelHighAPI_Double& theSize, - const std::list& theBooleanObjects) +FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theSize, + const std::list& theBooleanObjects) : FeaturesAPI_RevolutionBoolean(theFeature) { if(initialize()) { @@ -182,12 +196,13 @@ FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theAxis, - const ModelHighAPI_Double& theToAngle, - const ModelHighAPI_Double& theFromAngle, - const std::list& theBooleanObjects) +FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle, + const std::list& theBooleanObjects) : FeaturesAPI_RevolutionBoolean(theFeature) { if(initialize()) { @@ -201,14 +216,15 @@ FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theAxis, - const ModelHighAPI_Selection& theToObject, - const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, - const ModelHighAPI_Double& theFromOffset, - const std::list& theBooleanObjects) +FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects) : FeaturesAPI_RevolutionBoolean(theFeature) { if(initialize()) { @@ -230,8 +246,10 @@ RevolutionCutPtr addRevolutionCut(const std::shared_ptr& theP const ModelHighAPI_Double& theSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); - return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects)); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); + return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, + theAxis, theSize, theBooleanObjects)); } //================================================================================================== @@ -242,7 +260,8 @@ RevolutionCutPtr addRevolutionCut(const std::shared_ptr& theP const ModelHighAPI_Double& theFromAngle, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, theAxis, @@ -261,7 +280,8 @@ RevolutionCutPtr addRevolutionCut(const std::shared_ptr& theP const ModelHighAPI_Double& theFromOffset, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, theAxis, @@ -274,18 +294,20 @@ RevolutionCutPtr addRevolutionCut(const std::shared_ptr& theP //================================================================================================== -FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature) +FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( + const std::shared_ptr& theFeature) : FeaturesAPI_RevolutionBoolean(theFeature) { initialize(); } //================================================================================================== -FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theAxis, - const ModelHighAPI_Double& theSize, - const std::list& theBooleanObjects) +FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theSize, + const std::list& theBooleanObjects) : FeaturesAPI_RevolutionBoolean(theFeature) { if(initialize()) { @@ -299,12 +321,13 @@ FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theAxis, - const ModelHighAPI_Double& theToAngle, - const ModelHighAPI_Double& theFromAngle, - const std::list& theBooleanObjects) +FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Double& theToAngle, + const ModelHighAPI_Double& theFromAngle, + const std::list& theBooleanObjects) : FeaturesAPI_RevolutionBoolean(theFeature) { if(initialize()) { @@ -318,14 +341,15 @@ FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse(const std::shared_ptr& theFeature, - const std::list& theBaseObjects, - const ModelHighAPI_Selection& theAxis, - const ModelHighAPI_Selection& theToObject, - const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, - const ModelHighAPI_Double& theFromOffset, - const std::list& theBooleanObjects) +FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const ModelHighAPI_Selection& theToObject, + const ModelHighAPI_Double& theToOffset, + const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Double& theFromOffset, + const std::list& theBooleanObjects) : FeaturesAPI_RevolutionBoolean(theFeature) { if(initialize()) { @@ -347,8 +371,10 @@ RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& th const ModelHighAPI_Double& theSize, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); - return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, theAxis, theSize, theBooleanObjects)); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); + return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, + theAxis, theSize, theBooleanObjects)); } //================================================================================================== @@ -359,7 +385,8 @@ RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& th const ModelHighAPI_Double& theFromAngle, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, theAxis, @@ -378,7 +405,8 @@ RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& th const ModelHighAPI_Double& theFromOffset, const std::list& theBooleanObjects) { - std::shared_ptr aFeature = thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, theAxis, diff --git a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h index f4986ffd3..10daa0d3d 100644 --- a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h +++ b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.h @@ -32,17 +32,28 @@ public: virtual ~FeaturesAPI_RevolutionBoolean(); INTERFACE_11("", - sketch, FeaturesPlugin_Revolution::SKETCH_ID(), ModelAPI_AttributeReference, /** Sketch launcher */, - baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */, - axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis */, - creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */, - toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), ModelAPI_AttributeDouble, /** To angle */, - fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), ModelAPI_AttributeDouble, /** From angle */, - toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), ModelAPI_AttributeSelection, /** To object */, - toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), ModelAPI_AttributeDouble, /** To offset */, - fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), ModelAPI_AttributeSelection, /** From object */, - fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), ModelAPI_AttributeDouble, /** From offset */, - booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Boolean objects */) + sketch, FeaturesPlugin_Revolution::SKETCH_ID(), + ModelAPI_AttributeReference, /** Sketch launcher */, + baseObjects, FeaturesPlugin_Revolution::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */, + axis, FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), + ModelAPI_AttributeSelection, /** Axis */, + creationMethod, FeaturesPlugin_Revolution::CREATION_METHOD(), + ModelAPI_AttributeString, /** Creation method */, + toAngle, FeaturesPlugin_Revolution::TO_ANGLE_ID(), + ModelAPI_AttributeDouble, /** To angle */, + fromAngle, FeaturesPlugin_Revolution::FROM_ANGLE_ID(), + ModelAPI_AttributeDouble, /** From angle */, + toObject, FeaturesPlugin_Revolution::TO_OBJECT_ID(), + ModelAPI_AttributeSelection, /** To object */, + toOffset, FeaturesPlugin_Revolution::TO_OFFSET_ID(), + ModelAPI_AttributeDouble, /** To offset */, + fromObject, FeaturesPlugin_Revolution::FROM_OBJECT_ID(), + ModelAPI_AttributeSelection, /** From object */, + fromOffset, FeaturesPlugin_Revolution::FROM_OFFSET_ID(), + ModelAPI_AttributeDouble, /** From offset */, + booleanObjects, FeaturesPlugin_CompositeBoolean::OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Boolean objects */) /// Modify base attribute of the feature. FEATURESAPI_EXPORT @@ -64,7 +75,8 @@ public: FEATURESAPI_EXPORT void setAngle(const ModelHighAPI_Double& theAngle); - /// Modify creation_method, to_object, to_offset, from_object, from_offset attributes of the feature. + /// Modify creation_method, to_object, to_offset, from_object, + /// from_offset attributes of the feature. FEATURESAPI_EXPORT void setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject, const ModelHighAPI_Double& theToOffset, diff --git a/src/FeaturesAPI/FeaturesAPI_Rotation.cpp b/src/FeaturesAPI/FeaturesAPI_Rotation.cpp index d24aa0890..366a751b4 100644 --- a/src/FeaturesAPI/FeaturesAPI_Rotation.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Rotation.cpp @@ -66,7 +66,8 @@ void FeaturesAPI_Rotation::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Rotation::OBJECTS_LIST_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Rotation::OBJECTS_LIST_ID()); AttributeSelectionPtr anAttrAxis = aBase->selection(FeaturesPlugin_Rotation::AXIS_OBJECT_ID()); AttributeDoublePtr anAttrAngle = aBase->real(FeaturesPlugin_Rotation::ANGLE_ID()); diff --git a/src/FeaturesAPI/FeaturesAPI_Rotation.h b/src/FeaturesAPI/FeaturesAPI_Rotation.h index 03fd636ad..243af921b 100644 --- a/src/FeaturesAPI/FeaturesAPI_Rotation.h +++ b/src/FeaturesAPI/FeaturesAPI_Rotation.h @@ -40,9 +40,12 @@ public: virtual ~FeaturesAPI_Rotation(); INTERFACE_3(FeaturesPlugin_Rotation::ID(), - mainObjects, FeaturesPlugin_Rotation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */, - axisObject, FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis object */, - angle, FeaturesPlugin_Rotation::ANGLE_ID(), ModelAPI_AttributeDouble, /** Angle */) + mainObjects, FeaturesPlugin_Rotation::OBJECTS_LIST_ID(), + ModelAPI_AttributeSelectionList, /** Main objects */, + axisObject, FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), + ModelAPI_AttributeSelection, /** Axis object */, + angle, FeaturesPlugin_Rotation::ANGLE_ID(), + ModelAPI_AttributeDouble, /** Angle */) /// Set main objects. FEATURESAPI_EXPORT diff --git a/src/FeaturesAPI/FeaturesAPI_Translation.cpp b/src/FeaturesAPI/FeaturesAPI_Translation.cpp index e70df5b8c..07717134d 100644 --- a/src/FeaturesAPI/FeaturesAPI_Translation.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Translation.cpp @@ -10,17 +10,19 @@ #include //================================================================================================== -FeaturesAPI_Translation::FeaturesAPI_Translation(const std::shared_ptr& theFeature) +FeaturesAPI_Translation::FeaturesAPI_Translation( + const std::shared_ptr& theFeature) : ModelHighAPI_Interface(theFeature) { initialize(); } //================================================================================================== -FeaturesAPI_Translation::FeaturesAPI_Translation(const std::shared_ptr& theFeature, - const std::list& theMainObjects, - const ModelHighAPI_Selection& theAxisObject, - const ModelHighAPI_Double& theDistance) +FeaturesAPI_Translation::FeaturesAPI_Translation( + const std::shared_ptr& theFeature, + const std::list& theMainObjects, + const ModelHighAPI_Selection& theAxisObject, + const ModelHighAPI_Double& theDistance) : ModelHighAPI_Interface(theFeature) { if(initialize()) { @@ -37,7 +39,8 @@ FeaturesAPI_Translation::~FeaturesAPI_Translation() } //================================================================================================== -void FeaturesAPI_Translation::setMainObjects(const std::list& theMainObjects) +void FeaturesAPI_Translation::setMainObjects( + const std::list& theMainObjects) { fillAttribute(theMainObjects, mymainObjects); @@ -66,8 +69,10 @@ void FeaturesAPI_Translation::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID()); - AttributeSelectionPtr anAttrAxis = aBase->selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID()); + AttributeSelectionPtr anAttrAxis = + aBase->selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID()); AttributeDoublePtr anAttrDistance = aBase->real(FeaturesPlugin_Translation::DISTANCE_ID()); theDumper << aBase << " = model.addTranslation(" << aDocName << ", " @@ -81,5 +86,6 @@ TranslationPtr addTranslation(const std::shared_ptr& thePart, const ModelHighAPI_Double& theDistance) { std::shared_ptr aFeature = thePart->addFeature(FeaturesAPI_Translation::ID()); - return TranslationPtr(new FeaturesAPI_Translation(aFeature, theMainObjects, theAxisObject, theDistance)); + return TranslationPtr(new FeaturesAPI_Translation(aFeature, theMainObjects, + theAxisObject, theDistance)); } diff --git a/src/FeaturesAPI/FeaturesAPI_Translation.h b/src/FeaturesAPI/FeaturesAPI_Translation.h index 995b880a8..8d44d8578 100644 --- a/src/FeaturesAPI/FeaturesAPI_Translation.h +++ b/src/FeaturesAPI/FeaturesAPI_Translation.h @@ -40,9 +40,12 @@ public: virtual ~FeaturesAPI_Translation(); INTERFACE_3(FeaturesPlugin_Translation::ID(), - mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */, - axisObject, FeaturesPlugin_Translation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis object */, - distance, FeaturesPlugin_Translation::DISTANCE_ID(), ModelAPI_AttributeDouble, /** Distance */) + mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(), + ModelAPI_AttributeSelectionList, /** Main objects */, + axisObject, FeaturesPlugin_Translation::AXIS_OBJECT_ID(), + ModelAPI_AttributeSelection, /** Axis object */, + distance, FeaturesPlugin_Translation::DISTANCE_ID(), + ModelAPI_AttributeDouble, /** Distance */) /// Set main objects. FEATURESAPI_EXPORT diff --git a/src/FeaturesAPI/FeaturesAPI_Union.cpp b/src/FeaturesAPI/FeaturesAPI_Union.cpp index a3580a303..ca8f0d6fc 100644 --- a/src/FeaturesAPI/FeaturesAPI_Union.cpp +++ b/src/FeaturesAPI/FeaturesAPI_Union.cpp @@ -9,14 +9,14 @@ #include #include -//================================================================================================== +//================================================================================================ FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr& theFeature) : ModelHighAPI_Interface(theFeature) { initialize(); } -//================================================================================================== +//================================================================================================ FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr& theFeature, const std::list& theBaseObjects) : ModelHighAPI_Interface(theFeature) @@ -26,7 +26,7 @@ FeaturesAPI_Union::FeaturesAPI_Union(const std::shared_ptr& th } } -//================================================================================================== +//================================================================================================ FeaturesAPI_Union::~FeaturesAPI_Union() { @@ -46,9 +46,11 @@ void FeaturesAPI_Union::dump(ModelHighAPI_Dumper& theDumper) const FeaturePtr aBase = feature(); const std::string& aDocName = theDumper.name(aBase->document()); - AttributeSelectionListPtr anAttrObjects = aBase->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); + AttributeSelectionListPtr anAttrObjects = + aBase->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); - theDumper << aBase << " = model.addUnion(" << aDocName << ", " << anAttrObjects << ")" << std::endl; + theDumper << aBase << " = model.addUnion(" << aDocName << + ", " << anAttrObjects << ")" << std::endl; } //================================================================================================== diff --git a/src/FeaturesAPI/FeaturesAPI_Union.h b/src/FeaturesAPI/FeaturesAPI_Union.h index e07a9b168..2e60a523b 100644 --- a/src/FeaturesAPI/FeaturesAPI_Union.h +++ b/src/FeaturesAPI/FeaturesAPI_Union.h @@ -37,7 +37,8 @@ public: virtual ~FeaturesAPI_Union(); INTERFACE_1(FeaturesPlugin_Union::ID(), - baseObjects, FeaturesPlugin_Union::BASE_OBJECTS_ID(), ModelAPI_AttributeSelectionList, /** Base objects */) + baseObjects, FeaturesPlugin_Union::BASE_OBJECTS_ID(), + ModelAPI_AttributeSelectionList, /** Base objects */) /// Modify base attribute of the feature. FEATURESAPI_EXPORT diff --git a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp index c2c9cdd1f..dedb288a0 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Boolean.cpp @@ -76,7 +76,8 @@ void FeaturesPlugin_Boolean::execute() std::map, ListOfShape> aCompSolidsObjects; // Getting objects. - AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID()); + AttributeSelectionListPtr anObjectsSelList = + selectionList(FeaturesPlugin_Boolean::OBJECT_LIST_ID()); for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); @@ -87,7 +88,8 @@ void FeaturesPlugin_Boolean::execute() ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext); if(aResCompSolidPtr.get()) { std::shared_ptr aContextShape = aResCompSolidPtr->shape(); - std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); + std::map, ListOfShape>::iterator + anIt = aCompSolidsObjects.begin(); for(; anIt != aCompSolidsObjects.end(); anIt++) { if(anIt->first->isEqual(aContextShape)) { aCompSolidsObjects[anIt->first].push_back(anObject); @@ -136,7 +138,8 @@ void FeaturesPlugin_Boolean::execute() } // For solids cut each object with all tools. - for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) { + for(ListOfShape::iterator + anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) { std::shared_ptr anObject = *anObjectsIt; ListOfShape aListWithObject; aListWithObject.push_back(anObject); @@ -145,12 +148,14 @@ void FeaturesPlugin_Boolean::execute() switch(aType) { case BOOL_CUT: { - aBoolAlgo = GeomAlgoAPI_Boolean(aListWithObject, aTools, GeomAlgoAPI_Boolean::BOOL_CUT); + aBoolAlgo = + GeomAlgoAPI_Boolean(aListWithObject, aTools, GeomAlgoAPI_Boolean::BOOL_CUT); aResShape = aBoolAlgo.shape(); break; } case BOOL_COMMON: { - aBoolAlgo = GeomAlgoAPI_Boolean(aListWithObject, aTools, GeomAlgoAPI_Boolean::BOOL_COMMON); + aBoolAlgo = + GeomAlgoAPI_Boolean(aListWithObject, aTools, GeomAlgoAPI_Boolean::BOOL_COMMON); aResShape = aBoolAlgo.shape(); break; } @@ -192,22 +197,26 @@ void FeaturesPlugin_Boolean::execute() } if(GeomAlgoAPI_ShapeTools::volume(aResShape) > 1.e-27) { - std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aResultBody, anObject, aTools, aResShape, aBoolAlgo, *aBoolAlgo.mapOfSubShapes().get()); + std::shared_ptr aResultBody = + document()->createBody(data(), aResultIndex); + loadNamingDS(aResultBody, anObject, aTools, aResShape, + aBoolAlgo, *aBoolAlgo.mapOfSubShapes().get()); setResult(aResultBody, aResultIndex); aResultIndex++; } } // Compsolids handling - for(std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); - anIt != aCompSolidsObjects.end(); anIt++) { + for(std::map, ListOfShape>::iterator + anIt = aCompSolidsObjects.begin(); + anIt != aCompSolidsObjects.end(); anIt++) { std::shared_ptr aCompSolid = anIt->first; ListOfShape& aUsedInOperationSolids = anIt->second; // Collecting solids from compsolids which will not be modified in boolean operation. ListOfShape aNotUsedSolids; - for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { + for(GeomAPI_ShapeExplorer + anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { std::shared_ptr aSolidInCompSolid = anExp.current(); ListOfShape::iterator anIt = aUsedInOperationSolids.begin(); for(; anIt != aUsedInOperationSolids.end(); anIt++) { @@ -266,7 +275,8 @@ void FeaturesPlugin_Boolean::execute() // Add result to not used solids from compsolid. ListOfShape aShapesToAdd = aNotUsedSolids; aShapesToAdd.push_back(aBoolAlgo->shape()); - std::shared_ptr aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); + std::shared_ptr aFillerAlgo( + new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); if(!aFillerAlgo->isDone()) { std::string aFeatureError = "Error: PaveFiller algorithm failed."; setError(aFeatureError); @@ -277,8 +287,10 @@ void FeaturesPlugin_Boolean::execute() aMapOfShapes.merge(aFillerAlgo->mapOfSubShapes()); if(GeomAlgoAPI_ShapeTools::volume(aFillerAlgo->shape()) > 1.e-27) { - std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aResultBody, aCompSolid, aTools, aFillerAlgo->shape(), aMakeShapeList, aMapOfShapes); + std::shared_ptr aResultBody = + document()->createBody(data(), aResultIndex); + loadNamingDS(aResultBody, aCompSolid, aTools, + aFillerAlgo->shape(), aMakeShapeList, aMapOfShapes); setResult(aResultBody, aResultIndex); aResultIndex++; } @@ -286,7 +298,8 @@ void FeaturesPlugin_Boolean::execute() break; } case BOOL_FUSE: { - if((anObjects.size() + aTools.size() + aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) { + if((anObjects.size() + aTools.size() + + aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) { std::string aFeatureError = "Error: Not enough objects for boolean operation."; setError(aFeatureError); return; @@ -297,16 +310,20 @@ void FeaturesPlugin_Boolean::execute() aSolidsToFuse.insert(aSolidsToFuse.end(), anObjects.begin(), anObjects.end()); aSolidsToFuse.insert(aSolidsToFuse.end(), aTools.begin(), aTools.end()); - // Collecting solids from compsolids which will not be modified in boolean operation and will be added to result. + // Collecting solids from compsolids which will not be modified + // in boolean operation and will be added to result. ListOfShape aShapesToAdd; - for(std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); - anIt != aCompSolidsObjects.end(); anIt++) { + for(std::map, ListOfShape>::iterator + anIt = aCompSolidsObjects.begin(); + anIt != aCompSolidsObjects.end(); anIt++) { std::shared_ptr aCompSolid = anIt->first; ListOfShape& aUsedInOperationSolids = anIt->second; - aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedInOperationSolids.begin(), aUsedInOperationSolids.end()); + aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedInOperationSolids.begin(), + aUsedInOperationSolids.end()); // Collect solids from compsolid which will not be modified in boolean operation. - for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { + for(GeomAPI_ShapeExplorer + anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { std::shared_ptr aSolidInCompSolid = anExp.current(); ListOfShape::iterator anIt = aUsedInOperationSolids.begin(); for(; anIt != aUsedInOperationSolids.end(); anIt++) { @@ -328,22 +345,26 @@ void FeaturesPlugin_Boolean::execute() GeomAPI_DataMapOfShapeShape aMapOfShapes; std::shared_ptr aCuttedEdgesAndFaces; if(!anEdgesAndFaces.empty()) { - std::shared_ptr aCutAlgo(new GeomAlgoAPI_Boolean(anEdgesAndFaces, anOriginalShapes, GeomAlgoAPI_Boolean::BOOL_CUT)); + std::shared_ptr aCutAlgo(new GeomAlgoAPI_Boolean(anEdgesAndFaces, + anOriginalShapes, GeomAlgoAPI_Boolean::BOOL_CUT)); if(aCutAlgo->isDone()) { aCuttedEdgesAndFaces = aCutAlgo->shape(); aMakeShapeList.appendAlgo(aCutAlgo); aMapOfShapes.merge(aCutAlgo->mapOfSubShapes()); } } - anOriginalShapes.insert(anOriginalShapes.end(), anEdgesAndFaces.begin(), anEdgesAndFaces.end()); + anOriginalShapes.insert(anOriginalShapes.end(), anEdgesAndFaces.begin(), + anEdgesAndFaces.end()); // If we have compsolids then cut with not used solids all others. if(!aShapesToAdd.empty()) { aSolidsToFuse.clear(); - for(ListOfShape::iterator anIt = anOriginalShapes.begin(); anIt != anOriginalShapes.end(); anIt++) { + for(ListOfShape::iterator + anIt = anOriginalShapes.begin(); anIt != anOriginalShapes.end(); anIt++) { ListOfShape aOneObjectList; aOneObjectList.push_back(*anIt); - std::shared_ptr aCutAlgo(new GeomAlgoAPI_Boolean(aOneObjectList, aShapesToAdd, GeomAlgoAPI_Boolean::BOOL_CUT)); + std::shared_ptr aCutAlgo( + new GeomAlgoAPI_Boolean(aOneObjectList, aShapesToAdd, GeomAlgoAPI_Boolean::BOOL_CUT)); if(GeomAlgoAPI_ShapeTools::volume(aCutAlgo->shape()) > 1.e-27) { aSolidsToFuse.push_back(aCutAlgo->shape()); @@ -368,8 +389,8 @@ void FeaturesPlugin_Boolean::execute() aShape = aTools.front(); } else if((anObjects.size() + aTools.size()) > 1){ std::shared_ptr aFuseAlgo(new GeomAlgoAPI_Boolean(anObjects, - aTools, - GeomAlgoAPI_Boolean::BOOL_FUSE)); + aTools, + GeomAlgoAPI_Boolean::BOOL_FUSE)); // Checking that the algorithm worked properly. if(!aFuseAlgo->isDone()) { @@ -403,7 +424,8 @@ void FeaturesPlugin_Boolean::execute() if(aShape.get()) { aShapesToAdd.push_back(aShape); } - std::shared_ptr aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); + std::shared_ptr aFillerAlgo( + new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); if(!aFillerAlgo->isDone()) { std::string aFeatureError = "Error: PaveFiller algorithm failed."; setError(aFeatureError); @@ -427,8 +449,10 @@ void FeaturesPlugin_Boolean::execute() std::shared_ptr aBackShape = anOriginalShapes.back(); anOriginalShapes.pop_back(); - std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aResultBody, aBackShape, anOriginalShapes, aShape, aMakeShapeList, aMapOfShapes); + std::shared_ptr aResultBody = + document()->createBody(data(), aResultIndex); + loadNamingDS(aResultBody, aBackShape, anOriginalShapes, + aShape, aMakeShapeList, aMapOfShapes); setResult(aResultBody, aResultIndex); aResultIndex++; break; @@ -449,17 +473,21 @@ void FeaturesPlugin_Boolean::execute() ListOfShape aShapesToSmash; aShapesToSmash.insert(aShapesToSmash.end(), anObjects.begin(), anObjects.end()); - // Collecting solids from compsolids which will not be modified in boolean operation and will be added to result. + // Collecting solids from compsolids which will not be modified in + // boolean operation and will be added to result. ListOfShape aShapesToAdd; - for(std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); + for(std::map, ListOfShape>::iterator + anIt = aCompSolidsObjects.begin(); anIt != aCompSolidsObjects.end(); anIt++) { std::shared_ptr aCompSolid = anIt->first; ListOfShape& aUsedInOperationSolids = anIt->second; anOriginalShapes.push_back(aCompSolid); - aShapesToSmash.insert(aShapesToSmash.end(), aUsedInOperationSolids.begin(), aUsedInOperationSolids.end()); + aShapesToSmash.insert(aShapesToSmash.end(), aUsedInOperationSolids.begin(), + aUsedInOperationSolids.end()); // Collect solids from compsolid which will not be modified in boolean operation. - for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { + for(GeomAPI_ShapeExplorer + anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { std::shared_ptr aSolidInCompSolid = anExp.current(); ListOfShape::iterator anIt = aUsedInOperationSolids.begin(); for(; anIt != aUsedInOperationSolids.end(); anIt++) { @@ -477,9 +505,10 @@ void FeaturesPlugin_Boolean::execute() GeomAPI_DataMapOfShapeShape aMapOfShapes; if(!aShapesToAdd.empty()) { // Cut objects with not used solids. - std::shared_ptr anObjectsCutAlgo(new GeomAlgoAPI_Boolean(aShapesToSmash, - aShapesToAdd, - GeomAlgoAPI_Boolean::BOOL_CUT)); + std::shared_ptr anObjectsCutAlgo(new GeomAlgoAPI_Boolean( + aShapesToSmash, + aShapesToAdd, + GeomAlgoAPI_Boolean::BOOL_CUT)); if(GeomAlgoAPI_ShapeTools::volume(anObjectsCutAlgo->shape()) > 1.e-27) { aShapesToSmash.clear(); @@ -490,8 +519,8 @@ void FeaturesPlugin_Boolean::execute() // Cut tools with not used solids. std::shared_ptr aToolsCutAlgo(new GeomAlgoAPI_Boolean(aTools, - aShapesToAdd, - GeomAlgoAPI_Boolean::BOOL_CUT)); + aShapesToAdd, + GeomAlgoAPI_Boolean::BOOL_CUT)); if(GeomAlgoAPI_ShapeTools::volume(aToolsCutAlgo->shape()) > 1.e-27) { aTools.clear(); @@ -503,8 +532,8 @@ void FeaturesPlugin_Boolean::execute() // Cut objects with tools. std::shared_ptr aBoolAlgo(new GeomAlgoAPI_Boolean(aShapesToSmash, - aTools, - GeomAlgoAPI_Boolean::BOOL_CUT)); + aTools, + GeomAlgoAPI_Boolean::BOOL_CUT)); // Checking that the algorithm worked properly. if(!aBoolAlgo->isDone()) { @@ -529,7 +558,8 @@ void FeaturesPlugin_Boolean::execute() aShapesToAdd.push_back(aBoolAlgo->shape()); aShapesToAdd.insert(aShapesToAdd.end(), aTools.begin(), aTools.end()); - std::shared_ptr aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); + std::shared_ptr aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, + true)); if(!aFillerAlgo->isDone()) { std::string aFeatureError = "Error: PaveFiller algorithm failed."; setError(aFeatureError); @@ -552,8 +582,10 @@ void FeaturesPlugin_Boolean::execute() std::shared_ptr aFrontShape = anOriginalShapes.front(); anOriginalShapes.pop_front(); - std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); - loadNamingDS(aResultBody, aFrontShape, anOriginalShapes, aShape, aMakeShapeList, aMapOfShapes); + std::shared_ptr aResultBody = + document()->createBody(data(), aResultIndex); + loadNamingDS(aResultBody, aFrontShape, anOriginalShapes, + aShape, aMakeShapeList, aMapOfShapes); setResult(aResultBody, aResultIndex); aResultIndex++; @@ -583,7 +615,8 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr t } else { const int aModifyTag = 1; const int aDeletedTag = 2; - const int aSubsolidsTag = 3; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids + /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids + const int aSubsolidsTag = 3; const int anEdgesAndFacesTag = 10000; theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag); @@ -594,11 +627,13 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr t theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE, aModifyTag, aModName, theMapOfShapes); - theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE, aDeletedTag); + theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape, + GeomAPI_Shape::FACE, aDeletedTag); int aTag; std::string aName; - for(ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++) { + for(ListOfShape::const_iterator + anIter = theTools.begin(); anIter != theTools.end(); anIter++) { if((*anIter)->shapeType() == GeomAPI_Shape::EDGE) { aTag = anEdgesAndFacesTag; aName = aModEName; @@ -610,8 +645,9 @@ void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr t aTag = aModifyTag; aName = aModName; } - theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, aName == aModEName ? GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, - aTag, aName, theMapOfShapes); + theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, + aName == aModEName ? GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, + aTag, aName, theMapOfShapes); theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag); } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index 507cd2da4..44ea7eddd 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -36,7 +36,8 @@ void FeaturesPlugin_CompositeBoolean::executeCompositeBoolean() // Getting tools. ListOfShape aTools; - for(ListOfMakeShape::const_iterator anIt = aGenMakeShapes.cbegin(); anIt != aGenMakeShapes.cend(); ++anIt) { + for(ListOfMakeShape::const_iterator + anIt = aGenMakeShapes.cbegin(); anIt != aGenMakeShapes.cend(); ++anIt) { aTools.push_back((*anIt)->shape()); } @@ -132,13 +133,14 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, } // For solids cut each object with all tools. - for(ListOfShape::const_iterator anIt = anObjects.cbegin(); anIt != anObjects.cend(); ++anIt) { + for(ListOfShape::const_iterator + anIt = anObjects.cbegin(); anIt != anObjects.cend(); ++anIt) { GeomShapePtr anObject = *anIt; ListOfShape aListWithObject; aListWithObject.push_back(anObject); std::shared_ptr aBoolAlgo(new GeomAlgoAPI_Boolean(aListWithObject, - theTools, - GeomAlgoAPI_Boolean::BOOL_CUT)); + theTools, + GeomAlgoAPI_Boolean::BOOL_CUT)); // Checking that the algorithm worked properly. if(!aBoolAlgo->isDone() || aBoolAlgo->shape()->isNull() || !aBoolAlgo->isValid()) { @@ -160,7 +162,8 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, // Collecting solids from compsolids which will not be modified in boolean operation. ListOfShape aShapesToAdd; - for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { + for(GeomAPI_ShapeExplorer + anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { GeomShapePtr aSolidInCompSolid = anExp.current(); ListOfShape::const_iterator aUsedShapesIt = aUsedShapes.cbegin(); for(; aUsedShapesIt != aUsedShapes.cend(); ++aUsedShapesIt) { @@ -174,8 +177,8 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, } std::shared_ptr aBoolAlgo(new GeomAlgoAPI_Boolean(aUsedShapes, - theTools, - GeomAlgoAPI_Boolean::BOOL_CUT)); + theTools, + GeomAlgoAPI_Boolean::BOOL_CUT)); // Checking that the algorithm worked properly. if(!aBoolAlgo->isDone() || aBoolAlgo->shape()->isNull() || !aBoolAlgo->isValid()) { @@ -188,7 +191,8 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, // Add result to not used solids from compsolid. aShapesToAdd.push_back(aBoolAlgo->shape()); - std::shared_ptr aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); + std::shared_ptr aFillerAlgo( + new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); if(!aFillerAlgo->isDone() || aFillerAlgo->shape()->isNull() || !aFillerAlgo->isValid()) { myFeature->setError("Error: PaveFiller algorithm failed."); return false; @@ -220,7 +224,8 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, } } - if((anObjects.size() + aTools.size() + aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) { + if((anObjects.size() + aTools.size() + + aCompSolidsObjects.size() + anEdgesAndFaces.size()) < 2) { myFeature->setError("Error: Not enough objects for boolean operation."); return false; } @@ -230,7 +235,8 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, aSolidsToFuse.insert(aSolidsToFuse.end(), anObjects.begin(), anObjects.end()); aSolidsToFuse.insert(aSolidsToFuse.end(), aTools.begin(), aTools.end()); - // Collecting solids from compsolids which will not be modified in boolean operation and will be added to result. + // Collecting solids from compsolids which will not be + // modified in boolean operation and will be added to result. ListOfShape aShapesToAdd; for(std::map::iterator anIt = aCompSolidsObjects.begin(); anIt != aCompSolidsObjects.end(); anIt++) { @@ -239,7 +245,8 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, aSolidsToFuse.insert(aSolidsToFuse.end(), aUsedShapes.begin(), aUsedShapes.end()); // Collect solids from compsolid which will not be modified in boolean operation. - for(GeomAPI_ShapeExplorer anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { + for(GeomAPI_ShapeExplorer + anExp(aCompSolid, GeomAPI_Shape::SOLID); anExp.more(); anExp.next()) { GeomShapePtr aSolidInCompSolid = anExp.current(); ListOfShape::iterator anIt = aUsedShapes.begin(); for(; anIt != aUsedShapes.end(); anIt++) { @@ -262,8 +269,8 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, std::shared_ptr aMakeShapeList(new GeomAlgoAPI_MakeShapeList()); if(!anEdgesAndFaces.empty() && !aCutTools.empty()) { std::shared_ptr aCutAlgo(new GeomAlgoAPI_Boolean(anEdgesAndFaces, - aCutTools, - GeomAlgoAPI_Boolean::BOOL_CUT)); + aCutTools, + GeomAlgoAPI_Boolean::BOOL_CUT)); if(aCutAlgo->isDone() && !aCutAlgo->shape()->isNull() && aCutAlgo->isValid()) { anEdgesAndFaces.clear(); anEdgesAndFaces.push_back(aCutAlgo->shape()); @@ -274,8 +281,8 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, // If we have compsolids then cut with not used solids all others. if(!aShapesToAdd.empty()) { std::shared_ptr aCutAlgo(new GeomAlgoAPI_Boolean(aSolidsToFuse, - aShapesToAdd, - GeomAlgoAPI_Boolean::BOOL_CUT)); + aShapesToAdd, + GeomAlgoAPI_Boolean::BOOL_CUT)); if(aCutAlgo->isDone() && GeomAlgoAPI_ShapeTools::volume(aCutAlgo->shape()) > 1.e-27) { aSolidsToFuse.clear(); aSolidsToFuse.push_back(aCutAlgo->shape()); @@ -294,8 +301,8 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, aTools = aSolidsToFuse; std::shared_ptr aFuseAlgo(new GeomAlgoAPI_Boolean(anObjects, - aTools, - GeomAlgoAPI_Boolean::BOOL_FUSE)); + aTools, + GeomAlgoAPI_Boolean::BOOL_FUSE)); // Checking that the algorithm worked properly. if(!aFuseAlgo->isDone() || aFuseAlgo->shape()->isNull() || !aFuseAlgo->isValid()) { @@ -314,7 +321,8 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, aShapesToAdd.push_back(aFusedShape); } - std::shared_ptr aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); + std::shared_ptr aFillerAlgo( + new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); if(!aFillerAlgo->isDone() || aFillerAlgo->shape()->isNull() || !aFillerAlgo->isValid()) { myFeature->setError("Error: PaveFiller algorithm failed."); return false; @@ -364,8 +372,9 @@ void FeaturesPlugin_CompositeBoolean::storeModificationHistory(ResultBodyPtr the aTag = aModTag; aName = aModName; } - theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), *anIt, (*anIt)->shapeType() == GeomAPI_Shape::EDGE ? - GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get()); + theResultBody->loadAndOrientModifiedShapes(theMakeShape.get(), *anIt, + (*anIt)->shapeType() == GeomAPI_Shape::EDGE ? + GeomAPI_Shape::EDGE : GeomAPI_Shape::FACE, aTag, aName, *aMap.get()); theResultBody->loadDeletedShapes(theMakeShape.get(), *anIt, GeomAPI_Shape::FACE, aDelTag); } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp index 5fd04a114..da470abe1 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.cpp @@ -69,7 +69,8 @@ int FeaturesPlugin_CompositeSketch::numberOfSubs(bool forTree) const } //================================================================================================= -std::shared_ptr FeaturesPlugin_CompositeSketch::subFeature(const int theIndex, bool forTree) +std::shared_ptr FeaturesPlugin_CompositeSketch::subFeature(const int theIndex, + bool forTree) { if(theIndex == 0) { return std::dynamic_pointer_cast(data()->reference(SKETCH_ID())->value()); @@ -148,7 +149,8 @@ void FeaturesPlugin_CompositeSketch::getBaseShapes(ListOfShape& theBaseShapesLis } 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; @@ -170,7 +172,8 @@ void FeaturesPlugin_CompositeSketch::getBaseShapes(ListOfShape& theBaseShapesLis aBaseShape = aConstruction->shape(); if(aBaseShape.get() && !aBaseShape->isNull()) { GeomAPI_Shape::ShapeType aST = aBaseShape->shapeType(); - if(aST != GeomAPI_Shape::VERTEX && aST != GeomAPI_Shape::EDGE && aST != GeomAPI_Shape::WIRE && + if(aST != GeomAPI_Shape::VERTEX && aST != GeomAPI_Shape::EDGE && + aST != GeomAPI_Shape::WIRE && aST != GeomAPI_Shape::FACE && aST != GeomAPI_Shape::SHELL) { setError("Error: Selected shapes has unsupported type."); return; @@ -210,16 +213,19 @@ void FeaturesPlugin_CompositeSketch::getBaseShapes(ListOfShape& theBaseShapesLis ListOfShape aShells; ListOfShape aFreeFaces; GeomShapePtr aFacesCompound = GeomAlgoAPI_CompoundBuilder::compound(aBaseFacesList); - GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, aShells, aFreeFaces); + GeomAlgoAPI_ShapeTools::combineShapes(aFacesCompound, GeomAPI_Shape::SHELL, + aShells, aFreeFaces); theBaseShapesList.insert(theBaseShapesList.end(), aFreeFaces.begin(), aFreeFaces.end()); theBaseShapesList.insert(theBaseShapesList.end(), aShells.begin(), aShells.end()); } else { - theBaseShapesList.insert(theBaseShapesList.end(), aBaseFacesList.begin(), aBaseFacesList.end()); + theBaseShapesList.insert(theBaseShapesList.end(), aBaseFacesList.begin(), + aBaseFacesList.end()); } } //================================================================================================= -bool FeaturesPlugin_CompositeSketch::isMakeShapeValid(const std::shared_ptr theMakeShape) +bool FeaturesPlugin_CompositeSketch::isMakeShapeValid( + const std::shared_ptr theMakeShape) { // Check that algo is done. if(!theMakeShape->isDone()) { @@ -244,8 +250,8 @@ bool FeaturesPlugin_CompositeSketch::isMakeShapeValid(const std::shared_ptr theMakeShape, - const int theIndex) + const std::shared_ptr theMakeShape, + const int theIndex) { // Create result body. ResultBodyPtr aResultBody = document()->createBody(data(), theIndex); @@ -262,9 +268,9 @@ void FeaturesPlugin_CompositeSketch::storeResult(const GeomShapePtr theBaseShape //================================================================================================= void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theResultBody, - const GeomShapePtr theBaseShape, - const std::shared_ptr theMakeShape, - int& theTag) + const GeomShapePtr theBaseShape, + const std::shared_ptr theMakeShape, + int& theTag) { GeomAPI_Shape::ShapeType aBaseShapeType = theBaseShape->shapeType(); GeomAPI_Shape::ShapeType aShapeTypeToExplode = GeomAPI_Shape::SHAPE; @@ -298,32 +304,41 @@ void FeaturesPlugin_CompositeSketch::storeGenerationHistory(ResultBodyPtr theRes } } - if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { - theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape, GeomAPI_Shape::VERTEX, - theTag++, aGenName + "Edge", *aMapOfSubShapes.get()); + if(aShapeTypeToExplode == GeomAPI_Shape::VERTEX || + aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { + theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape, + GeomAPI_Shape::VERTEX, + theTag++, aGenName + "Edge", + *aMapOfSubShapes.get()); } - if(aShapeTypeToExplode == GeomAPI_Shape::EDGE || aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { - theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), theBaseShape, GeomAPI_Shape::EDGE, - theTag++, aGenName + "Face", *aMapOfSubShapes.get()); + if(aShapeTypeToExplode == GeomAPI_Shape::EDGE || + aShapeTypeToExplode == GeomAPI_Shape::COMPOUND) { + theResultBody->loadAndOrientGeneratedShapes(theMakeShape.get(), + theBaseShape, GeomAPI_Shape::EDGE, + theTag++, aGenName + "Face", + *aMapOfSubShapes.get()); } - std::shared_ptr aMakeSweep = std::dynamic_pointer_cast(theMakeShape); + std::shared_ptr aMakeSweep = + std::dynamic_pointer_cast(theMakeShape); if(aMakeSweep.get()) { // Store from shapes. - storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes, aMakeSweep->fromShapes(), "From_", theTag); + storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes, + aMakeSweep->fromShapes(), "From_", theTag); // Store to shapes. - storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes, aMakeSweep->toShapes(), "To_", theTag); + storeShapes(theResultBody, aBaseShapeType, aMapOfSubShapes, + aMakeSweep->toShapes(), "To_", theTag); } } //================================================================================================= void FeaturesPlugin_CompositeSketch::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"; diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.h b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.h index 21479418c..46620a2ed 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.h +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeSketch.h @@ -40,7 +40,8 @@ public: FEATURESPLUGIN_EXPORT virtual int numberOfSubs(bool forTree = false) const; /// \return the sub-feature by zero-base index. - FEATURESPLUGIN_EXPORT virtual std::shared_ptr subFeature(const int theIndex, bool forTree = false); + FEATURESPLUGIN_EXPORT virtual + std::shared_ptr subFeature(const int theIndex, bool forTree = false); /// \return the sub-feature unique identifier in this composite feature by zero-base index. FEATURESPLUGIN_EXPORT virtual int subFeatureId(const int theIndex) const; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp index 8238b1743..c80171dfd 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Extrusion.cpp @@ -63,7 +63,8 @@ void FeaturesPlugin_Extrusion::execute() int aResultIndex = 0; ListOfShape::const_iterator aBaseIt = aBaseShapesList.cbegin(); ListOfMakeShape::const_iterator anAlgoIt = aMakeShapesList.cbegin(); - for(; aBaseIt != aBaseShapesList.cend() && anAlgoIt != aMakeShapesList.cend(); ++aBaseIt, ++anAlgoIt) { + for(; aBaseIt != aBaseShapesList.cend() && anAlgoIt != aMakeShapesList.cend(); + ++aBaseIt, ++anAlgoIt) { storeResult(*aBaseIt, *anAlgoIt, aResultIndex++); } @@ -130,7 +131,8 @@ bool FeaturesPlugin_Extrusion::makeExtrusions(ListOfShape& theBaseShapes, } // Generating result for each base shape. - for(ListOfShape::const_iterator anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) { + for(ListOfShape::const_iterator + anIter = theBaseShapes.cbegin(); anIter != theBaseShapes.cend(); anIter++) { std::shared_ptr aBaseShape = *anIter; std::shared_ptr aPrismAlgo(new GeomAlgoAPI_Prism(aBaseShape, aDir, diff --git a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp index 4501a8191..2fa5ea282 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.cpp @@ -23,9 +23,10 @@ bool FeaturesPlugin_ExtrusionBoolean::makeGeneration(ListOfShape& theBaseShapes, //================================================================================================= void FeaturesPlugin_ExtrusionBoolean::storeGenerationHistory(ResultBodyPtr theResultBody, - const GeomShapePtr theBaseShape, - const std::shared_ptr theMakeShape, - int& theTag) + const GeomShapePtr theBaseShape, + const std::shared_ptr theMakeShape, + int& theTag) { - FeaturesPlugin_Extrusion::storeGenerationHistory(theResultBody, theBaseShape, theMakeShape, theTag); + FeaturesPlugin_Extrusion::storeGenerationHistory(theResultBody, theBaseShape, + theMakeShape, theTag); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h index 4e4cbad45..76a45d8c5 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_ExtrusionBoolean.h @@ -13,7 +13,8 @@ /// \class FeaturesPlugin_ExtrusionBoolean /// \ingroup Plugins /// \brief Interface for the composite extrusion feature. -class FeaturesPlugin_ExtrusionBoolean: public FeaturesPlugin_Extrusion, public FeaturesPlugin_CompositeBoolean +class FeaturesPlugin_ExtrusionBoolean: public FeaturesPlugin_Extrusion, + public FeaturesPlugin_CompositeBoolean { public: /// Request for initialization of data model of the feature: adding all attributes. diff --git a/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp b/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp index 16d625770..55a254d73 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Intersection.cpp @@ -24,8 +24,10 @@ FeaturesPlugin_Intersection::FeaturesPlugin_Intersection() //================================================================================================= void FeaturesPlugin_Intersection::initAttributes() { - data()->addAttribute(FeaturesPlugin_Intersection::OBJECT_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); - data()->addAttribute(FeaturesPlugin_Intersection::TOOL_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); + data()->addAttribute(FeaturesPlugin_Intersection::OBJECT_LIST_ID(), + ModelAPI_AttributeSelectionList::typeId()); + data()->addAttribute(FeaturesPlugin_Intersection::TOOL_LIST_ID(), + ModelAPI_AttributeSelectionList::typeId()); } //================================================================================================= @@ -34,9 +36,11 @@ void FeaturesPlugin_Intersection::execute() ListOfShape anObjects, aTools; // Getting objects. - AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID()); + AttributeSelectionListPtr anObjectsSelList = + selectionList(FeaturesPlugin_Intersection::OBJECT_LIST_ID()); for (int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { - std::shared_ptr anObjectAttr = anObjectsSelList->value(anObjectsIndex); + std::shared_ptr anObjectAttr = + anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); if (!anObject.get()) { return; @@ -45,7 +49,8 @@ void FeaturesPlugin_Intersection::execute() } // Getting tools. - AttributeSelectionListPtr aToolsSelList = selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID()); + AttributeSelectionListPtr aToolsSelList = + selectionList(FeaturesPlugin_Intersection::TOOL_LIST_ID()); for (int aToolsIndex = 0; aToolsIndex < aToolsSelList->size(); aToolsIndex++) { std::shared_ptr aToolAttr = aToolsSelList->value(aToolsIndex); std::shared_ptr aTool = aToolAttr->value(); @@ -63,7 +68,8 @@ void FeaturesPlugin_Intersection::execute() int aResultIndex = 0; // Create result for each object. - for (ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) { + for (ListOfShape::iterator + anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++) { std::shared_ptr anObject = *anObjectsIt; ListOfShape aListWithObject; aListWithObject.push_back(anObject); GeomAlgoAPI_Intersection anIntersectionAlgo(aListWithObject, aTools); @@ -105,7 +111,8 @@ void FeaturesPlugin_Intersection::loadNamingDS(std::shared_ptr aResultShape = theMakeShape.shape(); std::shared_ptr aMapOfShapes = theMakeShape.mapOfSubShapes(); const int aDeletedTag = 1; - const int aSubsolidsTag = 2; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids + /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids + const int aSubsolidsTag = 2; const int aModifyTag = 100000; int aModifyToolsTag = 200000; std::ostringstream aStream; @@ -125,9 +132,9 @@ void FeaturesPlugin_Intersection::loadNamingDS(std::shared_ptrloadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::VERTEX, - aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true); + aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true); theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::EDGE, - aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true); + aModifyToolsTag, aStream.str(), *aMapOfShapes.get(), true); theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag); aModifyToolsTag += 10000; } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Intersection.h b/src/FeaturesPlugin/FeaturesPlugin_Intersection.h index 2c8fff3d5..1b87fff36 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Intersection.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Intersection.h @@ -18,7 +18,8 @@ class GeomAlgoAPI_MakeShape; /// \class FeaturesPlugin_Intersection /// \ingroup Plugins /// \brief Intersection feature takes a list of shapes as objects and list of shapes as tools. -/// The types of objects and tools may be different: whole objects, compsoilds, solids, shells, faces or edges. +/// The types of objects and tools may be different: +/// whole objects, compsoilds, solids, shells, faces or edges. /// The result is less than the minimal dimension from pair of intersection: /// for two solids or two faces it is wire, for the edge and face it is vertex, etc. class FeaturesPlugin_Intersection : public ModelAPI_Feature diff --git a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp index f1ec8123b..9268f95d7 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp @@ -87,7 +87,8 @@ void FeaturesPlugin_Partition::execute() } // Create single result. - std::shared_ptr aPartitionAlgo(new GeomAlgoAPI_Partition(anObjects, aTools)); + std::shared_ptr aPartitionAlgo( + new GeomAlgoAPI_Partition(anObjects, aTools)); // Checking that the algorithm worked properly. if (!aPartitionAlgo->isDone()) { @@ -161,7 +162,8 @@ void FeaturesPlugin_Partition::storeResult( } const int aDelTag = 1; - const int aSubTag = 2; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids + /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids + const int aSubTag = 2; int aModTag = aSubTag + 10000; const std::string aModName = "Modified"; @@ -202,7 +204,8 @@ GeomShapePtr findBase(const GeomShapePtr theObjectShape, GeomShapePtr anObjectSubShape = anObjectSubShapesExp.current(); ListOfShape aModifiedShapes; theMakeShape->modified(anObjectSubShape, aModifiedShapes); - for(ListOfShape::const_iterator aModIt = aModifiedShapes.cbegin(); aModIt != aModifiedShapes.cend(); ++aModIt) { + for(ListOfShape::const_iterator + aModIt = aModifiedShapes.cbegin(); aModIt != aModifiedShapes.cend(); ++aModIt) { GeomShapePtr aModShape = *aModIt; if(aMapOfSubShapes->isBound(aModShape)) { aModShape = aMapOfSubShapes->find(aModShape); diff --git a/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp b/src/FeaturesPlugin/FeaturesPlugin_Pipe.cpp index 787a37fcc..af528e2ff 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"; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Pipe.h b/src/FeaturesPlugin/FeaturesPlugin_Pipe.h index aba97b091..9fedeee8c 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Pipe.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Pipe.h @@ -17,7 +17,8 @@ /// \class FeaturesPlugin_Pipe /// \ingroup Plugins /// \brief Feature for creation of extrusion along a path. -/// Pipe creates extrusion of objects along a path. It produces the following results from objects:\n +/// Pipe creates extrusion of objects along a path. +/// It produces the following results from objects:\n /// Vertex -> Edge\n /// Edge -> Face\n /// Wire -> Shell\n diff --git a/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp b/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp index 627d10666..d3fc14903 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Placement.cpp @@ -47,7 +47,8 @@ void FeaturesPlugin_Placement::execute() return; } for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { - std::shared_ptr anObjectAttr = anObjectsSelList->value(anObjectsIndex); + std::shared_ptr anObjectAttr = + anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); if(!anObject.get()) { // may be for not-activated parts eraseResults(); @@ -142,7 +143,8 @@ void FeaturesPlugin_Placement::execute() for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end(); anObjectsIt++, aContext++) { - if ((*aContext)->groupName() == ModelAPI_ResultPart::group()) { // for part results just set transformation + // for part results just set transformation + if ((*aContext)->groupName() == ModelAPI_ResultPart::group()) { ResultPartPtr anOrigin = std::dynamic_pointer_cast(*aContext); ResultPartPtr aResultPart = document()->copyPart(anOrigin, data(), aResultIndex); aResultPart->setTrsf(aContextRes, aTrsf); @@ -169,7 +171,8 @@ void FeaturesPlugin_Placement::execute() } //LoadNamingDS - std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); + std::shared_ptr aResultBody = + document()->createBody(data(), aResultIndex); loadNamingDS(aTransformAlgo, aResultBody, aBaseShape); setResult(aResultBody, aResultIndex); } @@ -200,16 +203,16 @@ void FeaturesPlugin_Placement::loadNamingDS(GeomAlgoAPI_Transform& theTransformA case GeomAPI_Shape::SOLID: case GeomAPI_Shape::SHELL: theResultBody->loadAndOrientModifiedShapes(&theTransformAlgo, - theBaseShape, GeomAPI_Shape::FACE, - aPlacedTag, aPlacedName + "_Face", *aSubShapes.get()); + theBaseShape, GeomAPI_Shape::FACE, + aPlacedTag, aPlacedName + "_Face", *aSubShapes.get()); case GeomAPI_Shape::FACE: case GeomAPI_Shape::WIRE: theResultBody->loadAndOrientModifiedShapes(&theTransformAlgo, theBaseShape, GeomAPI_Shape::EDGE, - ++aPlacedTag, aPlacedName + "_Edge", *aSubShapes.get()); + ++aPlacedTag, aPlacedName + "_Edge", *aSubShapes.get()); case GeomAPI_Shape::EDGE: theResultBody->loadAndOrientModifiedShapes(&theTransformAlgo, theBaseShape, GeomAPI_Shape::VERTEX, - ++aPlacedTag, aPlacedName + "_Vertex", *aSubShapes.get()); + ++aPlacedTag, aPlacedName + "_Vertex", *aSubShapes.get()); } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp b/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp index 84541fcd1..e29d8558f 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_RemoveSubShapes.cpp @@ -45,7 +45,8 @@ void FeaturesPlugin_RemoveSubShapes::attributeChanged(const std::string& theID) aSubShapesAttrList->clear(); ResultPtr aContext = aShapeAttrSelection->context(); - ResultCompSolidPtr aResultCompSolid = std::dynamic_pointer_cast(aContext); + ResultCompSolidPtr aResultCompSolid = + std::dynamic_pointer_cast(aContext); if(!aResultCompSolid.get()) { return; } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp b/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp index 53e4e5328..4ef29b4da 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Revolution.cpp @@ -61,7 +61,8 @@ void FeaturesPlugin_Revolution::execute() int aResultIndex = 0; ListOfShape::const_iterator aBaseIt = aBaseShapesList.cbegin(); ListOfMakeShape::const_iterator anAlgoIt = aMakeShapesList.cbegin(); - for(; aBaseIt != aBaseShapesList.cend() && anAlgoIt != aMakeShapesList.cend(); ++aBaseIt, ++anAlgoIt) { + for(; aBaseIt != aBaseShapesList.cend() && anAlgoIt != aMakeShapesList.cend(); + ++aBaseIt, ++anAlgoIt) { storeResult(*aBaseIt, *anAlgoIt, aResultIndex++); } @@ -133,12 +134,14 @@ bool FeaturesPlugin_Revolution::makeRevolutions(ListOfShape& theBaseShapes, } // Generating result for each base shape. - 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; - std::shared_ptr aRevolAlgo(new GeomAlgoAPI_Revolution(aBaseShape, anAxis, - aToShape, aToAngle, - aFromShape, aFromAngle)); + std::shared_ptr aRevolAlgo(new GeomAlgoAPI_Revolution( + aBaseShape, anAxis, + aToShape, aToAngle, + aFromShape, aFromAngle)); if(!isMakeShapeValid(aRevolAlgo)) { return false; } diff --git a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp index 479fd51e9..de4c0a9e2 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.cpp @@ -23,9 +23,10 @@ bool FeaturesPlugin_RevolutionBoolean::makeGeneration(ListOfShape& theBaseShapes //================================================================================================= void FeaturesPlugin_RevolutionBoolean::storeGenerationHistory(ResultBodyPtr theResultBody, - const GeomShapePtr theBaseShape, - const std::shared_ptr theMakeShape, - int& theTag) + const GeomShapePtr theBaseShape, + const std::shared_ptr theMakeShape, + int& theTag) { - FeaturesPlugin_Revolution::storeGenerationHistory(theResultBody, theBaseShape, theMakeShape, theTag); + FeaturesPlugin_Revolution::storeGenerationHistory(theResultBody, theBaseShape, + theMakeShape, theTag); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h index fc0252ba1..371cc0905 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h +++ b/src/FeaturesPlugin/FeaturesPlugin_RevolutionBoolean.h @@ -13,7 +13,8 @@ /// \class FeaturesPlugin_RevolutionBoolean /// \ingroup Plugins /// \brief Interface for the composite revolution feature. -class FeaturesPlugin_RevolutionBoolean : public FeaturesPlugin_Revolution, public FeaturesPlugin_CompositeBoolean +class FeaturesPlugin_RevolutionBoolean : public FeaturesPlugin_Revolution, + public FeaturesPlugin_CompositeBoolean { public: /// Request for initialization of data model of the feature: adding all attributes. diff --git a/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp b/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp index f7768c405..59b02f42e 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp @@ -26,7 +26,8 @@ void FeaturesPlugin_Rotation::initAttributes() std::dynamic_pointer_cast(data()->addAttribute( FeaturesPlugin_Rotation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId())); - data()->addAttribute(FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), + ModelAPI_AttributeSelection::typeId()); data()->addAttribute(FeaturesPlugin_Rotation::ANGLE_ID(), ModelAPI_AttributeDouble::typeId()); } @@ -36,12 +37,14 @@ void FeaturesPlugin_Rotation::execute() // Getting objects. ListOfShape anObjects; std::list aContextes; - AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Rotation::OBJECTS_LIST_ID()); + AttributeSelectionListPtr anObjectsSelList = + selectionList(FeaturesPlugin_Rotation::OBJECTS_LIST_ID()); if (anObjectsSelList->size() == 0) { return; } for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { - std::shared_ptr anObjectAttr = anObjectsSelList->value(anObjectsIndex); + std::shared_ptr anObjectAttr = + anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); if(!anObject.get()) { return; @@ -53,7 +56,8 @@ void FeaturesPlugin_Rotation::execute() //Getting axis. std::shared_ptr anAxis; std::shared_ptr anEdge; - std::shared_ptr anObjRef = selection(FeaturesPlugin_Rotation::AXIS_OBJECT_ID()); + std::shared_ptr anObjRef = + selection(FeaturesPlugin_Rotation::AXIS_OBJECT_ID()); if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->value())); } else if (anObjRef && !anObjRef->value() && anObjRef->context() && @@ -61,7 +65,8 @@ void FeaturesPlugin_Rotation::execute() 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())); + anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), + anEdge->line()->direction())); } // Getting angle. @@ -132,16 +137,16 @@ void FeaturesPlugin_Rotation::loadNamingDS(GeomAlgoAPI_Rotation& theRotaionAlgo, case GeomAPI_Shape::SOLID: case GeomAPI_Shape::SHELL: theResultBody->loadAndOrientModifiedShapes(&theRotaionAlgo, - theBaseShape, GeomAPI_Shape::FACE, - aRotatedTag, aRotatedName + "_Face", *aSubShapes.get()); + theBaseShape, GeomAPI_Shape::FACE, + aRotatedTag, aRotatedName + "_Face", *aSubShapes.get()); case GeomAPI_Shape::FACE: case GeomAPI_Shape::WIRE: theResultBody->loadAndOrientModifiedShapes(&theRotaionAlgo, - theBaseShape, GeomAPI_Shape::EDGE, - ++aRotatedTag, aRotatedName + "_Edge", *aSubShapes.get()); + theBaseShape, GeomAPI_Shape::EDGE, + ++aRotatedTag, aRotatedName + "_Edge", *aSubShapes.get()); case GeomAPI_Shape::EDGE: theResultBody->loadAndOrientModifiedShapes(&theRotaionAlgo, - theBaseShape, GeomAPI_Shape::VERTEX, - ++aRotatedTag, aRotatedName + "_Vertex", *aSubShapes.get()); + theBaseShape, GeomAPI_Shape::VERTEX, + ++aRotatedTag, aRotatedName + "_Vertex", *aSubShapes.get()); } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp index 9e616107b..a060576f0 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp @@ -28,8 +28,10 @@ void FeaturesPlugin_Translation::initAttributes() std::dynamic_pointer_cast(data()->addAttribute( FeaturesPlugin_Translation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId())); - data()->addAttribute(FeaturesPlugin_Translation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); - data()->addAttribute(FeaturesPlugin_Translation::DISTANCE_ID(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(FeaturesPlugin_Translation::AXIS_OBJECT_ID(), + ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(FeaturesPlugin_Translation::DISTANCE_ID(), + ModelAPI_AttributeDouble::typeId()); } //================================================================================================= @@ -38,12 +40,14 @@ void FeaturesPlugin_Translation::execute() // Getting objects. ListOfShape anObjects; std::list aContextes; - AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID()); + AttributeSelectionListPtr anObjectsSelList = + selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID()); if (anObjectsSelList->size() == 0) { return; } for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { - std::shared_ptr anObjectAttr = anObjectsSelList->value(anObjectsIndex); + std::shared_ptr anObjectAttr = + anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); if(!anObject.get()) { // may be for not-activated parts eraseResults(); @@ -56,7 +60,8 @@ void FeaturesPlugin_Translation::execute() //Getting axis. std::shared_ptr anAxis; std::shared_ptr anEdge; - std::shared_ptr anObjRef = selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID()); + std::shared_ptr anObjRef = + selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID()); if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->value())); } else if (anObjRef && !anObjRef->value() && anObjRef->context() && @@ -64,7 +69,8 @@ void FeaturesPlugin_Translation::execute() 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())); + anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), + anEdge->line()->direction())); } // Getting distance. @@ -135,16 +141,16 @@ void FeaturesPlugin_Translation::loadNamingDS(GeomAlgoAPI_Translation& theTransl case GeomAPI_Shape::SOLID: case GeomAPI_Shape::SHELL: theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo, - theBaseShape, GeomAPI_Shape::FACE, - aTranslatedTag, aTranslatedName + "_Face", *aSubShapes.get()); + theBaseShape, GeomAPI_Shape::FACE, + aTranslatedTag, aTranslatedName + "_Face", *aSubShapes.get()); case GeomAPI_Shape::FACE: case GeomAPI_Shape::WIRE: theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo, - theBaseShape, GeomAPI_Shape::EDGE, - ++aTranslatedTag, aTranslatedName + "_Edge", *aSubShapes.get()); + theBaseShape, GeomAPI_Shape::EDGE, + ++aTranslatedTag, aTranslatedName + "_Edge", *aSubShapes.get()); case GeomAPI_Shape::EDGE: theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo, - theBaseShape, GeomAPI_Shape::VERTEX, - ++aTranslatedTag, aTranslatedName + "_Vertex", *aSubShapes.get()); + theBaseShape, GeomAPI_Shape::VERTEX, + ++aTranslatedTag, aTranslatedName + "_Vertex", *aSubShapes.get()); } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp index 1d97c92aa..a7c62749a 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Union.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Union.cpp @@ -34,7 +34,8 @@ void FeaturesPlugin_Union::execute() std::map, ListOfShape> aCompSolidsObjects; // Getting objects. - AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); + AttributeSelectionListPtr anObjectsSelList = + selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); for(int anObjectsIndex = 0; anObjectsIndex < anObjectsSelList->size(); anObjectsIndex++) { AttributeSelectionPtr anObjectAttr = anObjectsSelList->value(anObjectsIndex); std::shared_ptr anObject = anObjectAttr->value(); @@ -45,7 +46,8 @@ void FeaturesPlugin_Union::execute() ResultCompSolidPtr aResCompSolidPtr = ModelAPI_Tools::compSolidOwner(aContext); if(aResCompSolidPtr.get()) { std::shared_ptr aContextShape = aResCompSolidPtr->shape(); - std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); + std::map, ListOfShape>::iterator + anIt = aCompSolidsObjects.begin(); for(; anIt != aCompSolidsObjects.end(); anIt++) { if(anIt->first->isEqual(aContextShape)) { aCompSolidsObjects[anIt->first].push_back(anObject); @@ -60,9 +62,11 @@ void FeaturesPlugin_Union::execute() } } - // Collecting solids from compsolids which will not be modified in boolean operation and will be added to result. + // Collecting solids from compsolids which will not be modified in + // boolean operation and will be added to result. ListOfShape aShapesToAdd; - for(std::map, ListOfShape>::iterator anIt = aCompSolidsObjects.begin(); + for(std::map, ListOfShape>::iterator + anIt = aCompSolidsObjects.begin(); anIt != aCompSolidsObjects.end(); anIt++) { std::shared_ptr aCompSolid = anIt->first; ListOfShape& aUsedInOperationSolids = anIt->second; @@ -92,8 +96,8 @@ void FeaturesPlugin_Union::execute() ListOfShape aTools; aTools.splice(aTools.begin(), anObjects, anObjects.begin()); std::shared_ptr aFuseAlgo(new GeomAlgoAPI_Boolean(anObjects, - aTools, - GeomAlgoAPI_Boolean::BOOL_FUSE)); + aTools, + GeomAlgoAPI_Boolean::BOOL_FUSE)); // Checking that the algorithm worked properly. GeomAlgoAPI_MakeShapeList aMakeShapeList; @@ -122,7 +126,8 @@ void FeaturesPlugin_Union::execute() // Combine result with not used solids from compsolid. if(aShapesToAdd.size() > 0) { aShapesToAdd.push_back(aShape); - std::shared_ptr aFillerAlgo(new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); + std::shared_ptr aFillerAlgo( + new GeomAlgoAPI_PaveFiller(aShapesToAdd, true)); if(!aFillerAlgo->isDone()) { setError("Error: PaveFiller algorithm failed."); return; @@ -144,7 +149,8 @@ void FeaturesPlugin_Union::execute() // Store result and naming. const int aModifyTag = 1; const int aDeletedTag = 2; - const int aSubsolidsTag = 3; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids + /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids + const int aSubsolidsTag = 3; const std::string aModName = "Modified"; std::shared_ptr aResultBody = document()->createBody(data()); diff --git a/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp b/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp index 4057abd68..d64b506b0 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp @@ -48,7 +48,8 @@ bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute if (!aValid) { std::string aResultGroupName = isPartSetDocument ? ModelAPI_ResultPart::group() : ModelAPI_ResultBody::group(); - theError = "Objects from the %1 group can be selected in the %2 document, but an objects from the %3 group is selected."; + theError = "Objects from the %1 group can be selected in the %2 document, \ + but an objects from the %3 group is selected."; theError.arg(aResultGroupName).arg(aDocument->kind()).arg(anErrorGroupName); } return aValid; diff --git a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp index c29889567..be031014b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Validators.cpp @@ -44,7 +44,8 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute, const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionPtr aPathAttrSelection = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr aPathAttrSelection = + std::dynamic_pointer_cast(theAttribute); if(!aPathAttrSelection.get()) { theError = "Error: This validator can only work with path selector in \"Pipe\" feature."; return false; @@ -57,7 +58,8 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute, return false; } GeomShapePtr aContextShape = aContext->shape(); - if(aPathShape.get() && aPathShape->shapeType() == GeomAPI_Shape::WIRE && !aPathShape->isEqual(aContextShape)) { + if(aPathShape.get() && aPathShape->shapeType() == GeomAPI_Shape::WIRE && + !aPathShape->isEqual(aContextShape)) { theError = "Error: Local selection of wires not allowed."; return false; } @@ -66,9 +68,10 @@ bool FeaturesPlugin_ValidatorPipePath::isValid(const AttributePtr& theAttribute, } //================================================================================================== -bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptr& theFeature, - const std::list& theArguments, - Events_InfoMessage& theError) const +bool FeaturesPlugin_ValidatorPipeLocations::isValid( + const std::shared_ptr& theFeature, + const std::list& theArguments, + Events_InfoMessage& theError) const { static const std::string aCreationMethodID = "creation_method"; static const std::string aBaseObjectsID = "base_objects"; @@ -105,7 +108,8 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptrsize() > 0 && aLocationsSelectionList->size() != aBaseObjectsSelectionList->size()) { + if(aLocationsSelectionList->size() > 0 && + aLocationsSelectionList->size() != aBaseObjectsSelectionList->size()) { theError = "Error: Number of locations should be the same as base objects."; return false; } @@ -114,7 +118,8 @@ bool FeaturesPlugin_ValidatorPipeLocations::isValid(const std::shared_ptrattributeType(); if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr aListAttr = + std::dynamic_pointer_cast(theAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { AttributeSelectionPtr aSelectionAttr = aListAttr->value(anIndex); ResultPtr aContext = aSelectionAttr->context(); @@ -151,9 +157,11 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA return false; } - ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast(aContext); + ResultConstructionPtr aResultConstruction = + std::dynamic_pointer_cast(aContext); if(!aResultConstruction.get()) { - // It is not a result construction. If shape is compound check that it contains only faces and edges. + // It is not a result construction. + // If shape is compound check that it contains only faces and edges. GeomShapePtr aShape = aSelectionAttr->value(); if(!aShape.get()) { aShape = aContext->shape(); @@ -177,8 +185,10 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA GeomShapePtr aContextShape = aResultConstruction->shape(); if(!aShape.get()) { // Whole sketch selected. - if(aSelectedSketchesFromObjects.find(aResultConstruction) != aSelectedSketchesFromObjects.cend()) { - theError = "Error: Object from this sketch is already selected. Sketch is not allowed for selection."; + if(aSelectedSketchesFromObjects.find(aResultConstruction) != + aSelectedSketchesFromObjects.cend()) { + theError = "Error: Object from this sketch is already selected. \ + Sketch is not allowed for selection."; return false; } @@ -186,7 +196,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA } else { // Object from sketch selected. if(aSelectedSketches.find(aResultConstruction) != aSelectedSketches.cend()) { - theError = "Error: Whole sketch with this object is already selected. Don't allow to select this object."; + theError = "Error: Whole sketch with this object is already selected. \ + Don't allow to select this object."; return false; } @@ -198,7 +209,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA } if(aSelectedWiresFromObjects.isBound(aWire)) { - theError = "Error: Objects with such wire already selected. Don't allow to select this object."; + theError = + "Error: Objects with such wire already selected. Don't allow to select this object."; return false; } @@ -214,8 +226,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValid(const AttributePtr& theA //================================================================================================== bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const AttributePtr& theAttribute, - const std::list& theArguments, - Events_InfoMessage& theError) const + const std::list& theArguments, + Events_InfoMessage& theError) const { if(!theAttribute.get()) { theError = "Error: Empty attribute."; @@ -224,7 +236,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute std::string anAttributeType = theAttribute->attributeType(); if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr aListAttr = + std::dynamic_pointer_cast(theAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { // If at least one attribute is invalid, the result is false. if(!isValidAttribute(aListAttr->value(anIndex), theArguments, theError)) { @@ -233,7 +246,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute } } else if(anAttributeType == ModelAPI_AttributeSelection::typeId()) { // Getting context. - AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttr = + std::dynamic_pointer_cast(theAttribute); ResultPtr aContext = anAttr->context(); if(!aContext.get()) { theError = "Error: Attribute have empty context."; @@ -250,7 +264,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute return false; } - ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aContext); + ResultConstructionPtr aConstruction = + std::dynamic_pointer_cast(aContext); if(aConstruction.get()) { // Construciotn selected. Check that is is not infinite. if(aConstruction->isInfinite()) { @@ -265,7 +280,8 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute } } else { // Shape on construction selected. Check that it is a face or wire. - if(aShape->shapeType() == GeomAPI_Shape::WIRE || aShape->shapeType() == GeomAPI_Shape::FACE) { + if(aShape->shapeType() == GeomAPI_Shape::WIRE || + aShape->shapeType() == GeomAPI_Shape::FACE) { return true; } } @@ -275,14 +291,17 @@ bool FeaturesPlugin_ValidatorBaseForGeneration::isValidAttribute(const Attribute if(!aShape->isEqual(aContextShape)) { // Local selection on body does not allowed. - theError = "Error: Selected shape is in the local selection. Only global selection is allowed."; + theError = + "Error: Selected shape is in the local selection. Only global selection is allowed."; return false; } // Check that object is a shape with allowed type. GeomValidators_ShapeType aShapeTypeValidator; if(!aShapeTypeValidator.isValid(anAttr, theArguments, theError)) { - theError = "Error: Selected shape has unacceptable type. Acceptable types are: faces or wires on sketch, whole sketch(if it has at least one face), and whole objects with shape types: %1"; + theError = "Error: Selected shape has unacceptable type. Acceptable types are: faces or \ + wires on sketch, whole sketch(if it has at least one face), \ + and whole objects with shape types: %1"; std::string anArgumentString; for(auto anIt = theArguments.cbegin(); anIt != theArguments.cend(); ++anIt) { if (!anArgumentString.empty()) @@ -351,16 +370,18 @@ bool FeaturesPlugin_ValidatorCompositeLauncher::isValid(const AttributePtr& theA } //================================================================================================== -bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptr& theFeature, - const std::list& theArguments, - Events_InfoMessage& theError) const +bool FeaturesPlugin_ValidatorExtrusionDir::isValid( + const std::shared_ptr& theFeature, + const std::list& theArguments, + Events_InfoMessage& theError) const { if(theArguments.size() != 2) { theError = "Error: Validator should be used with 2 parameters for extrusion."; return false; } - std::list::const_iterator anArgsIt = theArguments.begin(), aLast = theArguments.end(); + std::list::const_iterator + anArgsIt = theArguments.begin(), aLast = theArguments.end(); AttributePtr aCheckAttribute = theFeature->attribute(*anArgsIt); ++anArgsIt; @@ -380,7 +401,8 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptr aDirEdge(new GeomAPI_Edge(aDirShape)); // If faces selected check that direction not parallel with them. - AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(aCheckAttribute); + AttributeSelectionListPtr aListAttr = + std::dynamic_pointer_cast(aCheckAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { AttributeSelectionPtr anAttr = aListAttr->value(anIndex); GeomShapePtr aShapeInList = anAttr->value(); @@ -399,8 +422,10 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptrcontext()->shape(); } bool isParallel = true; - if(aShapeInList->shapeType() == GeomAPI_Shape::FACE || aShapeInList->shapeType() == GeomAPI_Shape::SHELL) { - for(GeomAPI_ShapeExplorer anExp(aShapeInList, GeomAPI_Shape::FACE); anExp.more(); anExp.next()) { + if(aShapeInList->shapeType() == GeomAPI_Shape::FACE || + aShapeInList->shapeType() == GeomAPI_Shape::SHELL) { + for(GeomAPI_ShapeExplorer + anExp(aShapeInList, GeomAPI_Shape::FACE); anExp.more(); anExp.next()) { std::shared_ptr aFace(new GeomAPI_Face(anExp.current())); isParallel = GeomAlgoAPI_ShapeTools::isParallel(aDirEdge, aFace); if(isParallel) { @@ -408,7 +433,8 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptrshapeType() == GeomAPI_Shape::COMPOUND) { - std::shared_ptr aPlanarEdges = std::dynamic_pointer_cast(aShapeInList); + std::shared_ptr aPlanarEdges = + std::dynamic_pointer_cast(aShapeInList); if(aPlanarEdges.get()) { std::shared_ptr aSketchDir = aPlanarEdges->norm(); if(aDirEdge->isLine()) { @@ -424,7 +450,8 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isValid(const std::shared_ptrattributeType(); if(anAttributeType == ModelAPI_AttributeSelectionList::typeId()) { - AttributeSelectionListPtr aListAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr aListAttr = + std::dynamic_pointer_cast(theAttribute); for(int anIndex = 0; anIndex < aListAttr->size(); ++anIndex) { // If at least one attribute is invalid, the result is false. if(!isShapesCanBeEmpty(aListAttr->value(anIndex), theError)) { @@ -457,7 +486,8 @@ bool FeaturesPlugin_ValidatorExtrusionDir::isShapesCanBeEmpty(const AttributePtr } } else if(anAttributeType == ModelAPI_AttributeSelection::typeId()) { // Getting context. - AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttr = + std::dynamic_pointer_cast(theAttribute); ResultPtr aContext = anAttr->context(); if(!aContext.get()) { return false; @@ -489,9 +519,11 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr anAttrSelectionList = + std::dynamic_pointer_cast(theAttribute); if(!anAttrSelectionList.get()) { - theError = "Error: This validator can only work with selection list attributes in \"Boolean\" feature."; + theError = + "Error: This validator can only work with selection list attributes in \"Boolean\" feature."; return false; } FeaturePtr aFeature = std::dynamic_pointer_cast(theAttribute->owner()); @@ -554,10 +586,11 @@ bool FeaturesPlugin_ValidatorBooleanSelection::isValid(const AttributePtr& theAt //================================================================================================== bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, - Events_InfoMessage& theError) const + const std::list& theArguments, + Events_InfoMessage& theError) const { - AttributeSelectionListPtr anAttrSelectionList = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr anAttrSelectionList = + std::dynamic_pointer_cast(theAttribute); if(!anAttrSelectionList.get()) { theError = "Error: This validator can only work with selection list in \"Partition\" feature."; return false; @@ -577,13 +610,15 @@ bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& the } ResultPtr aContext = aSelectAttr->context(); - ResultConstructionPtr aResultConstruction = std::dynamic_pointer_cast(aContext); + ResultConstructionPtr aResultConstruction = + std::dynamic_pointer_cast(aContext); if(aResultConstruction.get()) { theError = "Error: Only body shapes and construction planes are allowed for selection."; return false; } - ResultCompSolidPtr aResultCompsolid = std::dynamic_pointer_cast(aContext); + ResultCompSolidPtr aResultCompsolid = + std::dynamic_pointer_cast(aContext); if(aResultCompsolid.get()) { continue; } @@ -598,12 +633,14 @@ bool FeaturesPlugin_ValidatorPartitionSelection::isValid(const AttributePtr& the //================================================================================================== bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, - Events_InfoMessage& theError) const + const std::list& theArguments, + Events_InfoMessage& theError) const { - AttributeSelectionListPtr aSubShapesAttrList = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr aSubShapesAttrList = + std::dynamic_pointer_cast(theAttribute); if(!aSubShapesAttrList.get()) { - theError = "Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature."; + theError = + "Error: This validator can only work with selection list in \"Remove Sub-Shapes\" feature."; return false; } @@ -651,9 +688,10 @@ bool FeaturesPlugin_ValidatorRemoveSubShapesSelection::isValid(const AttributePt } //================================================================================================== -bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid(const std::shared_ptr& theFeature, - const std::list& theArguments, - Events_InfoMessage& theError) const +bool FeaturesPlugin_ValidatorRemoveSubShapesResult::isValid( + const std::shared_ptr& theFeature, + const std::list& theArguments, + Events_InfoMessage& theError) const { static const std::string aBaseShapeID = "base_shape"; static const std::string aSubShapesID = "subshapes"; @@ -714,7 +752,8 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr const std::list& theArguments, Events_InfoMessage& theError) const { - AttributeSelectionListPtr aBaseObjectsAttrList = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionListPtr aBaseObjectsAttrList = + std::dynamic_pointer_cast(theAttribute); if(!aBaseObjectsAttrList.get()) { theError = "Error: This validator can only work with selection list in \"%1\" feature."; theError.arg(FeaturesPlugin_Union::ID()); @@ -724,7 +763,8 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr for(int anIndex = 0; anIndex < aBaseObjectsAttrList->size(); ++anIndex) { bool isSameFound = false; AttributeSelectionPtr anAttrSelectionInList = aBaseObjectsAttrList->value(anIndex); - ResultCompSolidPtr aResult = std::dynamic_pointer_cast(anAttrSelectionInList->context()); + ResultCompSolidPtr aResult = + std::dynamic_pointer_cast(anAttrSelectionInList->context()); if(!aResult.get()) { continue; } @@ -738,9 +778,10 @@ bool FeaturesPlugin_ValidatorUnionSelection::isValid(const AttributePtr& theAttr } //================================================================================================== -bool FeaturesPlugin_ValidatorUnionArguments::isValid(const std::shared_ptr& theFeature, - const std::list& theArguments, - Events_InfoMessage& theError) const +bool FeaturesPlugin_ValidatorUnionArguments::isValid( + const std::shared_ptr& theFeature, + const std::list& theArguments, + Events_InfoMessage& theError) const { // Check feature kind. if(theFeature->getKind() != FeaturesPlugin_Union::ID()) { @@ -750,7 +791,8 @@ bool FeaturesPlugin_ValidatorUnionArguments::isValid(const std::shared_ptrselectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); + AttributeSelectionListPtr aBaseObejctsAttrList = + theFeature->selectionList(FeaturesPlugin_Union::BASE_OBJECTS_ID()); if(!aBaseObejctsAttrList.get()) { theError = "Error: Could not get \"%1\" attribute."; theError.arg(FeaturesPlugin_Union::BASE_OBJECTS_ID()); -- 2.30.2