From 6ffc58e695559e8997bbc8b977b537f1c63d45a8 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 9 Nov 2016 17:26:10 +0300 Subject: [PATCH] Issue #1834: Fix length of lines --- src/Config/Config_AttributeMessage.cpp | 3 +- src/Config/Config_DataModelReader.cpp | 3 +- src/Config/Config_FeatureReader.cpp | 18 +++-- src/Config/Config_ModuleReader.cpp | 3 +- src/Config/Config_ModuleReader.h | 9 ++- src/Config/Config_PropManager.cpp | 6 +- src/Config/Config_PropManager.h | 6 +- src/ConnectorAPI/ConnectorAPI_Connector.cpp | 2 + src/ConnectorAPI/ConnectorAPI_Connector.h | 2 + src/ConstructionAPI/ConstructionAPI_Axis.cpp | 23 +++++-- src/ConstructionAPI/ConstructionAPI_Axis.h | 65 +++++++++++++------ src/ConstructionAPI/ConstructionAPI_Plane.cpp | 32 ++++++--- src/ConstructionAPI/ConstructionAPI_Plane.h | 63 ++++++++++++------ src/ConstructionAPI/ConstructionAPI_Point.cpp | 2 + src/ConstructionAPI/ConstructionAPI_Point.h | 18 +---- .../ConstructionPlugin_Axis.cpp | 3 +- .../ConstructionPlugin_Plane.cpp | 30 +++++---- .../ConstructionPlugin_Plugin.cpp | 3 +- .../ConstructionPlugin_Point.cpp | 2 +- .../ConstructionPlugin_Validators.cpp | 22 ++++--- src/Events/Events_InfoMessage.h | 3 +- src/Events/Events_Message.h | 3 +- src/ExchangeAPI/ExchangeAPI_Export.cpp | 14 ++-- src/ExchangeAPI/ExchangeAPI_Export.h | 2 + src/ExchangeAPI/ExchangeAPI_Import.cpp | 8 ++- src/ExchangeAPI/ExchangeAPI_Import.h | 5 +- .../ExchangePlugin_ExportFeature.cpp | 36 ++++++---- .../ExchangePlugin_ImportFeature.cpp | 7 +- 28 files changed, 257 insertions(+), 136 deletions(-) diff --git a/src/Config/Config_AttributeMessage.cpp b/src/Config/Config_AttributeMessage.cpp index b154d9cbf..e1df96c3d 100644 --- a/src/Config/Config_AttributeMessage.cpp +++ b/src/Config/Config_AttributeMessage.cpp @@ -61,7 +61,8 @@ const std::list >& Config_AttributeMessage:: return myCases; } -void Config_AttributeMessage::setCases(const std::list >& theCases) +void Config_AttributeMessage::setCases(const std::list >& theCases) { myCases = theCases; } diff --git a/src/Config/Config_DataModelReader.cpp b/src/Config/Config_DataModelReader.cpp index afd688ed5..b9c000104 100644 --- a/src/Config/Config_DataModelReader.cpp +++ b/src/Config/Config_DataModelReader.cpp @@ -29,7 +29,8 @@ void Config_DataModelReader::processNode(xmlNodePtr theNode) std::string aName = getProperty(theNode, FOLDER_NAME); std::string aGroupType = getProperty(theNode, GROUP_TYPE); if (aName.empty() || aGroupType.empty()) - Events_InfoMessage("Config_DataModelReader", "Reading dataModel.xml: wrong folder definition.").send(); + Events_InfoMessage("Config_DataModelReader", + "Reading dataModel.xml: wrong folder definition.").send(); std::string aIcon = getProperty(theNode, NODE_ICON); std::string aEmpty = getProperty(theNode, SHOW_EMPTY); diff --git a/src/Config/Config_FeatureReader.cpp b/src/Config/Config_FeatureReader.cpp index 5fdd12f6a..ed25f9821 100644 --- a/src/Config/Config_FeatureReader.cpp +++ b/src/Config/Config_FeatureReader.cpp @@ -51,7 +51,8 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) Events_ID aMenuItemEvent = Events_Loop::eventByName(myEventGenerated); if (isNode(theNode, NODE_FEATURE, NULL)) { storeAttribute(theNode, _ID); - std::shared_ptr aMessage(new Config_FeatureMessage(aMenuItemEvent, this)); + std::shared_ptr + aMessage(new Config_FeatureMessage(aMenuItemEvent, this)); fillFeature(theNode, aMessage); myFeatures.push_back(getProperty(theNode, _ID)); //If a feature has xml definition for it's widget: @@ -64,7 +65,8 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) } else if (myIsProcessWidgets) { // widgets, like shape_selector or containers, like toolbox if (isAttributeNode(theNode)) { - std::shared_ptr aMessage(new Config_AttributeMessage(aMenuItemEvent, this)); + std::shared_ptr + aMessage(new Config_AttributeMessage(aMenuItemEvent, this)); aMessage->setFeatureId(restoreAttribute(NODE_FEATURE, _ID)); std::string anAttributeID = getProperty(theNode, _ID); if (!anAttributeID.empty()) { @@ -73,7 +75,8 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) aMessage->setConcealment(getBooleanAttribute(theNode, ATTR_CONCEALMENT, false)); std::list > aCases; - xmlNodePtr aCaseNode = hasParentRecursive(theNode, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, WDG_OPTIONALBOX, NULL); + xmlNodePtr aCaseNode = + hasParentRecursive(theNode, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, WDG_OPTIONALBOX, NULL); while(aCaseNode) { std::string aCaseNodeID = getProperty(aCaseNode, _ID); std::string aSwitchNodeID = ""; @@ -86,14 +89,16 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) aSwitchNode = hasParentRecursive(aCaseNode, WDG_TOOLBOX, NULL); } if (!xmlStrcmp(aName, (const xmlChar *) WDG_OPTIONALBOX)) { - /// the box is optional, attribute is in case if the optional attribute value is not empty + /// the box is optional, attribute is in case + /// if the optional attribute value is not empty aSwitchNode = aCaseNode; } if (aSwitchNode) aSwitchNodeID = getProperty(aSwitchNode, _ID); aCases.push_back(std::make_pair(aSwitchNodeID, aCaseNodeID)); - aCaseNode = hasParentRecursive(aSwitchNode, WDG_SWITCH_CASE, WDG_TOOLBOX_BOX, WDG_OPTIONALBOX, NULL); + aCaseNode = hasParentRecursive(aSwitchNode, WDG_SWITCH_CASE, + WDG_TOOLBOX_BOX, WDG_OPTIONALBOX, NULL); } aMessage->setCases(aCases); Events_Loop::loop()->send(aMessage); @@ -135,7 +140,8 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theFeatureNode, outFeatureMessage->setId(getProperty(theFeatureNode, _ID)); outFeatureMessage->setPluginLibrary(myLibraryName); outFeatureMessage->setNestedFeatures(getProperty(theFeatureNode, FEATURE_NESTED)); - outFeatureMessage->setActionsWhenNested(getNormalizedProperty(theFeatureNode, FEATURE_WHEN_NESTED)); + outFeatureMessage->setActionsWhenNested(getNormalizedProperty(theFeatureNode, + FEATURE_WHEN_NESTED)); outFeatureMessage->setModal(getBooleanAttribute(theFeatureNode, FEATURE_MODAL, false)); bool isInternal = getBooleanAttribute(theFeatureNode, ATTR_INTERNAL, false); diff --git a/src/Config/Config_ModuleReader.cpp b/src/Config/Config_ModuleReader.cpp index dfd442b7e..1b206fba6 100644 --- a/src/Config/Config_ModuleReader.cpp +++ b/src/Config/Config_ModuleReader.cpp @@ -72,7 +72,8 @@ void Config_ModuleReader::addFeature(const std::string& theFeatureName, if (myFeaturesInFiles.count(theFeatureName)) { std::string anErrorMsg = "Can not register feature '%1' in plugin '%2'." " There is a feature with the same ID."; - Events_InfoMessage("Config_ModuleReader", anErrorMsg).arg(theFeatureName).arg(thePluginConfig).send(); + Events_InfoMessage("Config_ModuleReader", anErrorMsg) + .arg(theFeatureName).arg(thePluginConfig).send(); return; } diff --git a/src/Config/Config_ModuleReader.h b/src/Config/Config_ModuleReader.h index a50fd028c..a8b1910bc 100644 --- a/src/Config/Config_ModuleReader.h +++ b/src/Config/Config_ModuleReader.h @@ -36,7 +36,8 @@ class Config_ModuleReader : public Config_XMLReader CONFIG_EXPORT Config_ModuleReader(const char* theEventGenerated = 0); /// Destructor CONFIG_EXPORT virtual ~Config_ModuleReader(); - /// Returns map that describes which file contains a feature (the feature is key, the file is value) + /// Returns map that describes which file contains a feature + /// (the feature is key, the file is value) CONFIG_EXPORT const std::map& featuresInFiles() const; /// Returns list of module's xml files CONFIG_EXPORT const std::set& modulePluginFiles() const; @@ -69,13 +70,15 @@ class Config_ModuleReader : public Config_XMLReader std::string addPlugin(const std::string& aPluginLibrary, const std::string& aPluginScript, const std::string& aPluginConf); - /// Save feature in myFeaturesInFiles. Generates an error if the feature name is already registered. + /// Save feature in myFeaturesInFiles. + /// Generates an error if the feature name is already registered. void addFeature(const std::string& theFeatureName, const std::string& thePluginConfig); private: std::map myFeaturesInFiles; ///< a feature name is key, a file is value std::set myPluginFiles; ///< a feature name is key, a file is value - static std::map myPluginTypes; ///< a plugin name is key, a plugin type is value + /// a plugin name is key, a plugin type is value + static std::map myPluginTypes; static std::set myDependencyModules; ///< set of loaded modules const char* myEventGenerated; ///< gives ability to send Feature_Messages to various listeners }; diff --git a/src/Config/Config_PropManager.cpp b/src/Config/Config_PropManager.cpp index c6e71b88e..de17ec1a5 100644 --- a/src/Config/Config_PropManager.cpp +++ b/src/Config/Config_PropManager.cpp @@ -13,8 +13,10 @@ bool stringToBoolean(const std::string& theInt); Config_Properties Config_PropManager::myProps; -Config_Prop* Config_PropManager::registerProp(const std::string& theSection, const std::string& theName, - const std::string& theTitle, Config_Prop::PropType theType, +Config_Prop* Config_PropManager::registerProp(const std::string& theSection, + const std::string& theName, + const std::string& theTitle, + Config_Prop::PropType theType, const std::string& theDefaultValue) { Config_Prop* aProp = findProp(theSection, theName); diff --git a/src/Config/Config_PropManager.h b/src/Config/Config_PropManager.h index 9b2ced3ea..bb7854b10 100644 --- a/src/Config/Config_PropManager.h +++ b/src/Config/Config_PropManager.h @@ -32,8 +32,10 @@ class Config_PropManager * \param theDefValue - default and initial value of the property * Returns True if the property succesfully registered */ - CONFIG_EXPORT static Config_Prop* registerProp(const std::string& theSection, const std::string& theName, - const std::string& theTitle, Config_Prop::PropType theType, const std::string& theDefValue = ""); + CONFIG_EXPORT static Config_Prop* registerProp(const std::string& theSection, + const std::string& theName, + const std::string& theTitle, Config_Prop::PropType theType, + const std::string& theDefValue = ""); //! Finds property in the given section by the given name, if property not found returns NULL CONFIG_EXPORT static Config_Prop* findProp( const std::string& theSection, const std::string& theName); diff --git a/src/ConnectorAPI/ConnectorAPI_Connector.cpp b/src/ConnectorAPI/ConnectorAPI_Connector.cpp index 7662f4197..35b12b263 100644 --- a/src/ConnectorAPI/ConnectorAPI_Connector.cpp +++ b/src/ConnectorAPI/ConnectorAPI_Connector.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-2016 CEA/DEN, EDF R&D + // Name : ConnectorAPI_Connector.cpp // Purpose: // diff --git a/src/ConnectorAPI/ConnectorAPI_Connector.h b/src/ConnectorAPI/ConnectorAPI_Connector.h index 5ddf0bfe7..9c8c210ab 100644 --- a/src/ConnectorAPI/ConnectorAPI_Connector.h +++ b/src/ConnectorAPI/ConnectorAPI_Connector.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-2016 CEA/DEN, EDF R&D + // Name : ConnectorAPI_Connector.h // Purpose: // diff --git a/src/ConstructionAPI/ConstructionAPI_Axis.cpp b/src/ConstructionAPI/ConstructionAPI_Axis.cpp index 7f1debcfa..6883edf46 100644 --- a/src/ConstructionAPI/ConstructionAPI_Axis.cpp +++ b/src/ConstructionAPI/ConstructionAPI_Axis.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-2016 CEA/DEN, EDF R&D + // Name : ConstructionAPI_Axis.cpp // Purpose: // @@ -86,7 +88,8 @@ ConstructionAPI_Axis::ConstructionAPI_Axis(const std::shared_ptrselection(ConstructionPlugin_Axis::POINT_FIRST()); - AttributeSelectionPtr anAttrSecondPnt = aBase->selection(ConstructionPlugin_Axis::POINT_SECOND()); + AttributeSelectionPtr anAttrFirstPnt = + aBase->selection(ConstructionPlugin_Axis::POINT_FIRST()); + AttributeSelectionPtr anAttrSecondPnt = + aBase->selection(ConstructionPlugin_Axis::POINT_SECOND()); theDumper << ", " << anAttrFirstPnt << ", " << anAttrSecondPnt; } else if(aCreationMethod == ConstructionPlugin_Axis::CREATION_METHOD_BY_LINE()) { @@ -283,7 +289,8 @@ void ConstructionAPI_Axis::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrLine; } else if(aCreationMethod == ConstructionPlugin_Axis::CREATION_METHOD_BY_CYLINDRICAL_FACE()) { - AttributeSelectionPtr anAttrFace = aBase->selection(ConstructionPlugin_Axis::CYLINDRICAL_FACE()); + AttributeSelectionPtr anAttrFace = + aBase->selection(ConstructionPlugin_Axis::CYLINDRICAL_FACE()); theDumper << ", " << anAttrFace; } else if(aCreationMethod == ConstructionPlugin_Axis::CREATION_METHOD_BY_PLANE_AND_POINT()) { @@ -299,7 +306,8 @@ void ConstructionAPI_Axis::dump(ModelHighAPI_Dumper& theDumper) const if(aBase->string(ConstructionPlugin_Axis::USE_OFFSET1())->isInitialized() && !aBase->string(ConstructionPlugin_Axis::USE_OFFSET1())->value().empty()) { AttributeDoublePtr anAttrOffset1 = aBase->real(ConstructionPlugin_Axis::OFFSET1()); - AttributeBooleanPtr anAttrReverseOffset1 = aBase->boolean(ConstructionPlugin_Axis::REVERSE_OFFSET1()); + AttributeBooleanPtr anAttrReverseOffset1 = + aBase->boolean(ConstructionPlugin_Axis::REVERSE_OFFSET1()); theDumper << ", " << anAttrOffset1 << ", " << anAttrReverseOffset1; } @@ -307,7 +315,8 @@ void ConstructionAPI_Axis::dump(ModelHighAPI_Dumper& theDumper) const if(aBase->string(ConstructionPlugin_Axis::USE_OFFSET2())->isInitialized() && !aBase->string(ConstructionPlugin_Axis::USE_OFFSET2())->value().empty()) { AttributeDoublePtr anAttrOffset2 = aBase->real(ConstructionPlugin_Axis::OFFSET2()); - AttributeBooleanPtr anAttrReverseOffset2 = aBase->boolean(ConstructionPlugin_Axis::REVERSE_OFFSET2()); + AttributeBooleanPtr anAttrReverseOffset2 = + aBase->boolean(ConstructionPlugin_Axis::REVERSE_OFFSET2()); theDumper << ", " << anAttrOffset2 << ", " << anAttrReverseOffset2; } } else if(aCreationMethod == ConstructionPlugin_Axis::CREATION_METHOD_BY_POINT_AND_DIRECTION()) { diff --git a/src/ConstructionAPI/ConstructionAPI_Axis.h b/src/ConstructionAPI/ConstructionAPI_Axis.h index e9bdb6bfc..477ce6c37 100644 --- a/src/ConstructionAPI/ConstructionAPI_Axis.h +++ b/src/ConstructionAPI/ConstructionAPI_Axis.h @@ -1,5 +1,7 @@ // Copyright (C) 2014-2016 CEA/DEN, EDF R&D +// Copyright (C) 2014-2016 CEA/DEN, EDF R&D + // Name : ConstructionAPI_Axis.h // Purpose: // @@ -87,27 +89,48 @@ public: virtual ~ConstructionAPI_Axis(); INTERFACE_21(ConstructionPlugin_Axis::ID(), - creationMethod, ConstructionPlugin_Axis::METHOD(), ModelAPI_AttributeString, /** Creation method */, - firstPoint, ConstructionPlugin_Axis::POINT_FIRST(), ModelAPI_AttributeSelection, /** First point */, - secondPoint, ConstructionPlugin_Axis::POINT_SECOND(), ModelAPI_AttributeSelection, /** Second point */, - cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(), ModelAPI_AttributeSelection, /** Cylindrical face */, - xDirection, ConstructionPlugin_Axis::X_DIRECTION(), ModelAPI_AttributeDouble, /** X direction */, - yDirection, ConstructionPlugin_Axis::Y_DIRECTION(), ModelAPI_AttributeDouble, /** Y direction */, - zDirection, ConstructionPlugin_Axis::Z_DIRECTION(), ModelAPI_AttributeDouble, /** Z direction */, - xDimension, ConstructionPlugin_Axis::DX(), ModelAPI_AttributeDouble, /** X dimension */, - yDimension, ConstructionPlugin_Axis::DY(), ModelAPI_AttributeDouble, /** Y dimension */, - zDimension, ConstructionPlugin_Axis::DZ(), ModelAPI_AttributeDouble, /** Z dimension */, - line, ConstructionPlugin_Axis::LINE(), ModelAPI_AttributeSelection, /** Line */, - plane, ConstructionPlugin_Axis::PLANE(), ModelAPI_AttributeSelection, /** Plane */, - point, ConstructionPlugin_Axis::POINT(), ModelAPI_AttributeSelection, /** Point */, - plane1, ConstructionPlugin_Axis::PLANE1(), ModelAPI_AttributeSelection, /** Plane 1 */, - useOffset1, ConstructionPlugin_Axis::USE_OFFSET1(), ModelAPI_AttributeString, /** Use offset 1 */, - offset1, ConstructionPlugin_Axis::OFFSET1(), ModelAPI_AttributeDouble, /** Offset 1 */, - reverseOffset1, ConstructionPlugin_Axis::REVERSE_OFFSET1(), ModelAPI_AttributeBoolean, /** Reverse offset 1 */, - plane2, ConstructionPlugin_Axis::PLANE2(), ModelAPI_AttributeSelection, /** Plane 2 */, - useOffset2, ConstructionPlugin_Axis::USE_OFFSET2(), ModelAPI_AttributeString, /** Use offset 2 */, - offset2, ConstructionPlugin_Axis::OFFSET2(), ModelAPI_AttributeDouble, /** Offset 2 */, - reverseOffset2, ConstructionPlugin_Axis::REVERSE_OFFSET2(), ModelAPI_AttributeBoolean, /** Reverse offset 2 */) + creationMethod, ConstructionPlugin_Axis::METHOD(), + ModelAPI_AttributeString, /** Creation method */, + firstPoint, ConstructionPlugin_Axis::POINT_FIRST(), + ModelAPI_AttributeSelection, /** First point */, + secondPoint, ConstructionPlugin_Axis::POINT_SECOND(), + ModelAPI_AttributeSelection, /** Second point */, + cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(), + ModelAPI_AttributeSelection, /** Cylindrical face */, + xDirection, ConstructionPlugin_Axis::X_DIRECTION(), + ModelAPI_AttributeDouble, /** X direction */, + yDirection, ConstructionPlugin_Axis::Y_DIRECTION(), + ModelAPI_AttributeDouble, /** Y direction */, + zDirection, ConstructionPlugin_Axis::Z_DIRECTION(), + ModelAPI_AttributeDouble, /** Z direction */, + xDimension, ConstructionPlugin_Axis::DX(), + ModelAPI_AttributeDouble, /** X dimension */, + yDimension, ConstructionPlugin_Axis::DY(), + ModelAPI_AttributeDouble, /** Y dimension */, + zDimension, ConstructionPlugin_Axis::DZ(), + ModelAPI_AttributeDouble, /** Z dimension */, + line, ConstructionPlugin_Axis::LINE(), + ModelAPI_AttributeSelection, /** Line */, + plane, ConstructionPlugin_Axis::PLANE(), + ModelAPI_AttributeSelection, /** Plane */, + point, ConstructionPlugin_Axis::POINT(), + ModelAPI_AttributeSelection, /** Point */, + plane1, ConstructionPlugin_Axis::PLANE1(), + ModelAPI_AttributeSelection, /** Plane 1 */, + useOffset1, ConstructionPlugin_Axis::USE_OFFSET1(), + ModelAPI_AttributeString, /** Use offset 1 */, + offset1, ConstructionPlugin_Axis::OFFSET1(), + ModelAPI_AttributeDouble, /** Offset 1 */, + reverseOffset1, ConstructionPlugin_Axis::REVERSE_OFFSET1(), + ModelAPI_AttributeBoolean, /** Reverse offset 1 */, + plane2, ConstructionPlugin_Axis::PLANE2(), + ModelAPI_AttributeSelection, /** Plane 2 */, + useOffset2, ConstructionPlugin_Axis::USE_OFFSET2(), + ModelAPI_AttributeString, /** Use offset 2 */, + offset2, ConstructionPlugin_Axis::OFFSET2(), + ModelAPI_AttributeDouble, /** Offset 2 */, + reverseOffset2, ConstructionPlugin_Axis::REVERSE_OFFSET2(), + ModelAPI_AttributeBoolean, /** Reverse offset 2 */) /// Set points CONSTRUCTIONAPI_EXPORT diff --git a/src/ConstructionAPI/ConstructionAPI_Plane.cpp b/src/ConstructionAPI/ConstructionAPI_Plane.cpp index b7de5703c..9d7a3d96e 100644 --- a/src/ConstructionAPI/ConstructionAPI_Plane.cpp +++ b/src/ConstructionAPI/ConstructionAPI_Plane.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-2016 CEA/DEN, EDF R&D + // Name : ConstructionAPI_Plane.cpp // Purpose: // @@ -106,7 +108,8 @@ void ConstructionAPI_Plane::setByFaceAndDistance(const ModelHighAPI_Selection& t { fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_OTHER_PLANE(), mycreationMethod); fillAttribute(theFace, myplane); - fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_DISTANCE_FROM_OTHER(), mycreationMethodByOtherPlane); + fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_DISTANCE_FROM_OTHER(), + mycreationMethodByOtherPlane); fillAttribute(theDistance, mydistance); fillAttribute(theIsReverse, myreverse); @@ -158,7 +161,8 @@ void ConstructionAPI_Plane::setByLineAndPoint(const ModelHighAPI_Selection& theL void ConstructionAPI_Plane::setByTwoParallelPlanes(const ModelHighAPI_Selection& thePlane1, const ModelHighAPI_Selection& thePlane2) { - fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_TWO_PARALLEL_PLANES(), mycreationMethod); + fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_TWO_PARALLEL_PLANES(), + mycreationMethod); fillAttribute(thePlane1, myplane1); fillAttribute(thePlane2, myplane2); @@ -171,7 +175,8 @@ void ConstructionAPI_Plane::setByCoincidentToPoint(const ModelHighAPI_Selection& { fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_OTHER_PLANE(), mycreationMethod); fillAttribute(thePlane, myplane); - fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_COINCIDENT_TO_POINT(), mycreationMethodByOtherPlane); + fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_COINCIDENT_TO_POINT(), + mycreationMethodByOtherPlane); fillAttribute(thePoint, mycoincidentPoint); execute(); @@ -184,7 +189,8 @@ void ConstructionAPI_Plane::setByRotation(const ModelHighAPI_Selection& thePlane { fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_OTHER_PLANE(), mycreationMethod); fillAttribute(thePlane, myplane); - fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_ROTATION(), mycreationMethodByOtherPlane); + fillAttribute(ConstructionPlugin_Plane::CREATION_METHOD_BY_ROTATION(), + mycreationMethodByOtherPlane); fillAttribute(theAxis, myaxis); fillAttribute(theAngle, myangle); @@ -199,7 +205,8 @@ void ConstructionAPI_Plane::dump(ModelHighAPI_Dumper& theDumper) const theDumper << aBase << " = model.addPlane(" << aDocName; - std::string aCreationMethod = aBase->string(ConstructionPlugin_Plane::CREATION_METHOD())->value(); + std::string aCreationMethod = + aBase->string(ConstructionPlugin_Plane::CREATION_METHOD())->value(); if(aCreationMethod == ConstructionPlugin_Plane::CREATION_METHOD_BY_GENERAL_EQUATION()) { AttributeDoublePtr anAttrA = aBase->real(ConstructionPlugin_Plane::A()); @@ -217,7 +224,8 @@ void ConstructionAPI_Plane::dump(ModelHighAPI_Dumper& theDumper) const } else if(aCreationMethod == ConstructionPlugin_Plane::CREATION_METHOD_BY_LINE_AND_POINT()) { AttributeSelectionPtr anAttrLine = aBase->selection(ConstructionPlugin_Plane::LINE()); AttributeSelectionPtr anAttrPoint = aBase->selection(ConstructionPlugin_Plane::POINT()); - AttributeBooleanPtr anAttrPerpendicular = aBase->boolean(ConstructionPlugin_Plane::PERPENDICULAR()); + AttributeBooleanPtr anAttrPerpendicular = + aBase->boolean(ConstructionPlugin_Plane::PERPENDICULAR()); theDumper << ", " << anAttrLine << ", " << anAttrPoint << ", " << anAttrPerpendicular; } else if(aCreationMethod == ConstructionPlugin_Plane::CREATION_METHOD_BY_OTHER_PLANE()) { @@ -225,13 +233,16 @@ void ConstructionAPI_Plane::dump(ModelHighAPI_Dumper& theDumper) const std::string aCreationMethodOption = aBase->string(ConstructionPlugin_Plane::CREATION_METHOD_BY_OTHER_PLANE_OPTION())->value(); - if(aCreationMethodOption == ConstructionPlugin_Plane::CREATION_METHOD_BY_DISTANCE_FROM_OTHER()) { + if(aCreationMethodOption == + ConstructionPlugin_Plane::CREATION_METHOD_BY_DISTANCE_FROM_OTHER()) { AttributeDoublePtr anAttrDistance = aBase->real(ConstructionPlugin_Plane::DISTANCE()); AttributeBooleanPtr anAttrReverse = aBase->boolean(ConstructionPlugin_Plane::REVERSE()); theDumper << ", " << anAttrPlane << ", " << anAttrDistance << ", " << anAttrReverse; - } else if(aCreationMethodOption == ConstructionPlugin_Plane::CREATION_METHOD_BY_COINCIDENT_TO_POINT()) { - AttributeSelectionPtr anAttrPoint = aBase->selection(ConstructionPlugin_Plane::COINCIDENT_POINT()); + } else if(aCreationMethodOption == + ConstructionPlugin_Plane::CREATION_METHOD_BY_COINCIDENT_TO_POINT()) { + AttributeSelectionPtr anAttrPoint = + aBase->selection(ConstructionPlugin_Plane::COINCIDENT_POINT()); theDumper << ", " << anAttrPlane << ", " << anAttrPoint; } else if(aCreationMethodOption == ConstructionPlugin_Plane::CREATION_METHOD_BY_ROTATION()) { @@ -240,7 +251,8 @@ void ConstructionAPI_Plane::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrPlane << ", " << anAttrAxis << ", " << anAttrAngle; } - } else if(aCreationMethod == ConstructionPlugin_Plane::CREATION_METHOD_BY_TWO_PARALLEL_PLANES()) { + } else if(aCreationMethod == + ConstructionPlugin_Plane::CREATION_METHOD_BY_TWO_PARALLEL_PLANES()) { AttributeSelectionPtr anAttrPlane1 = aBase->selection(ConstructionPlugin_Plane::PLANE1()); AttributeSelectionPtr anAttrPlane2 = aBase->selection(ConstructionPlugin_Plane::PLANE2()); diff --git a/src/ConstructionAPI/ConstructionAPI_Plane.h b/src/ConstructionAPI/ConstructionAPI_Plane.h index 48eef87db..b2d206e8c 100644 --- a/src/ConstructionAPI/ConstructionAPI_Plane.h +++ b/src/ConstructionAPI/ConstructionAPI_Plane.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-2016 CEA/DEN, EDF R&D + // Name : ConstructionAPI_Plane.h // Purpose: // @@ -74,26 +76,47 @@ public: virtual ~ConstructionAPI_Plane(); INTERFACE_20(ConstructionPlugin_Plane::ID(), - creationMethod, ConstructionPlugin_Plane::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */, - A, ConstructionPlugin_Plane::A(), ModelAPI_AttributeDouble, /** Parameter A for general equation */, - B, ConstructionPlugin_Plane::B(), ModelAPI_AttributeDouble, /** Parameter B for general equation */, - C, ConstructionPlugin_Plane::C(), ModelAPI_AttributeDouble, /** Parameter C for general equation */, - D, ConstructionPlugin_Plane::D(), ModelAPI_AttributeDouble, /** Parameter D for general equation */, - point1, ConstructionPlugin_Plane::POINT1(), ModelAPI_AttributeSelection, /** Point 1 for plane */, - point2, ConstructionPlugin_Plane::POINT2(), ModelAPI_AttributeSelection, /** Point 2 for plane */, - point3, ConstructionPlugin_Plane::POINT3(), ModelAPI_AttributeSelection, /** Point 3 for plane */, - line, ConstructionPlugin_Plane::LINE(), ModelAPI_AttributeSelection, /** Line for plane */, - point, ConstructionPlugin_Plane::POINT(), ModelAPI_AttributeSelection, /** Point for plane */, - perpendicular, ConstructionPlugin_Plane::PERPENDICULAR(), ModelAPI_AttributeBoolean, /** Perpendicular flag */, - creationMethodByOtherPlane, ConstructionPlugin_Plane::CREATION_METHOD_BY_OTHER_PLANE_OPTION(), ModelAPI_AttributeString, /** Creation method by other plane*/, - plane, ConstructionPlugin_Plane::PLANE(), ModelAPI_AttributeSelection, /** Plane face */, - distance, ConstructionPlugin_Plane::DISTANCE(), ModelAPI_AttributeDouble, /** Distance */, - reverse, ConstructionPlugin_Plane::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse flag */, - coincidentPoint, ConstructionPlugin_Plane::COINCIDENT_POINT(), ModelAPI_AttributeSelection, /** Coincident point */, - axis, ConstructionPlugin_Plane::AXIS(), ModelAPI_AttributeSelection, /** Axis for rotation */, - angle, ConstructionPlugin_Plane::ANGLE(), ModelAPI_AttributeDouble, /** Rotation angle */, - plane1, ConstructionPlugin_Plane::PLANE1(), ModelAPI_AttributeSelection, /** Plane 1 */, - plane2, ConstructionPlugin_Plane::PLANE2(), ModelAPI_AttributeSelection, /** Plane 2 */) + creationMethod, ConstructionPlugin_Plane::CREATION_METHOD(), + ModelAPI_AttributeString, /** Creation method */, + A, ConstructionPlugin_Plane::A(), + ModelAPI_AttributeDouble, /** Parameter A for general equation */, + B, ConstructionPlugin_Plane::B(), + ModelAPI_AttributeDouble, /** Parameter B for general equation */, + C, ConstructionPlugin_Plane::C(), + ModelAPI_AttributeDouble, /** Parameter C for general equation */, + D, ConstructionPlugin_Plane::D(), + ModelAPI_AttributeDouble, /** Parameter D for general equation */, + point1, ConstructionPlugin_Plane::POINT1(), + ModelAPI_AttributeSelection, /** Point 1 for plane */, + point2, ConstructionPlugin_Plane::POINT2(), + ModelAPI_AttributeSelection, /** Point 2 for plane */, + point3, ConstructionPlugin_Plane::POINT3(), + ModelAPI_AttributeSelection, /** Point 3 for plane */, + line, ConstructionPlugin_Plane::LINE(), + ModelAPI_AttributeSelection, /** Line for plane */, + point, ConstructionPlugin_Plane::POINT(), + ModelAPI_AttributeSelection, /** Point for plane */, + perpendicular, ConstructionPlugin_Plane::PERPENDICULAR(), + ModelAPI_AttributeBoolean, /** Perpendicular flag */, + creationMethodByOtherPlane, + ConstructionPlugin_Plane::CREATION_METHOD_BY_OTHER_PLANE_OPTION(), + ModelAPI_AttributeString, /** Creation method by other plane*/, + plane, ConstructionPlugin_Plane::PLANE(), + ModelAPI_AttributeSelection, /** Plane face */, + distance, ConstructionPlugin_Plane::DISTANCE(), + ModelAPI_AttributeDouble, /** Distance */, + reverse, ConstructionPlugin_Plane::REVERSE(), + ModelAPI_AttributeBoolean, /** Reverse flag */, + coincidentPoint, ConstructionPlugin_Plane::COINCIDENT_POINT(), + ModelAPI_AttributeSelection, /** Coincident point */, + axis, ConstructionPlugin_Plane::AXIS(), + ModelAPI_AttributeSelection, /** Axis for rotation */, + angle, ConstructionPlugin_Plane::ANGLE(), + ModelAPI_AttributeDouble, /** Rotation angle */, + plane1, ConstructionPlugin_Plane::PLANE1(), + ModelAPI_AttributeSelection, /** Plane 1 */, + plane2, ConstructionPlugin_Plane::PLANE2(), + ModelAPI_AttributeSelection, /** Plane 2 */) /// Set face and distance CONSTRUCTIONAPI_EXPORT diff --git a/src/ConstructionAPI/ConstructionAPI_Point.cpp b/src/ConstructionAPI/ConstructionAPI_Point.cpp index 5e9aea6e1..2c86fbbb7 100644 --- a/src/ConstructionAPI/ConstructionAPI_Point.cpp +++ b/src/ConstructionAPI/ConstructionAPI_Point.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-2016 CEA/DEN, EDF R&D + // Name : ConstructionAPI_Point.cpp // Purpose: // diff --git a/src/ConstructionAPI/ConstructionAPI_Point.h b/src/ConstructionAPI/ConstructionAPI_Point.h index 6c2b295bb..aa454fcfb 100644 --- a/src/ConstructionAPI/ConstructionAPI_Point.h +++ b/src/ConstructionAPI/ConstructionAPI_Point.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-2016 CEA/DEN, EDF R&D + // Name : ConstructionAPI_Point.h // Purpose: // @@ -58,22 +60,6 @@ public: y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */, z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */) - //INTERFACE_14(ConstructionPlugin_Point::ID(), - // creationMethod, ConstructionPlugin_Point::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */, - // x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */, - // y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */, - // z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */, - // edge, ConstructionPlugin_Point::EDGE(), ModelAPI_AttributeSelection, /** Edge attribute */, - // distanceValue, ConstructionPlugin_Point::DISTANCE_VALUE(), ModelAPI_AttributeDouble, /** Distance value attribute */, - // distancePercent, ConstructionPlugin_Point::DISTANCE_PERCENT(), ModelAPI_AttributeBoolean, /** Distance percent attribute */, - // reverse, ConstructionPlugin_Point::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse attribute */, - // point, ConstructionPlugin_Point::POINT(), ModelAPI_AttributeSelection, /** Point attribute */, - // plane, ConstructionPlugin_Point::PLANE(), ModelAPI_AttributeSelection, /** Plane attribute */, - // firstLine, ConstructionPlugin_Point::FIRST_LINE(), ModelAPI_AttributeSelection, /** First line attribute */, - // secondLine, ConstructionPlugin_Point::SECOND_LINE(), ModelAPI_AttributeSelection, /** Second line attribute */, - // intersectionLine, ConstructionPlugin_Point::INTERSECTION_LINE(), ModelAPI_AttributeSelection, /** Intersection line attribute */, - // intersectionPlane, ConstructionPlugin_Point::INTERSECTION_PLANE(), ModelAPI_AttributeSelection, /** Intersection plane attribute */ - //) /// Set point values. CONSTRUCTIONAPI_EXPORT diff --git a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp index 1317356de..8c59aa01c 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp @@ -171,7 +171,8 @@ void ConstructionPlugin_Axis::createAxisByDimensions() double aDY = data()->real(DY())->value(); double aDZ = data()->real(DZ())->value(); - if (fabs(aDX) < MINIMAL_LENGTH() && fabs(aDY) < MINIMAL_LENGTH() && fabs(aDZ) < MINIMAL_LENGTH()){ + if (fabs(aDX) < MINIMAL_LENGTH() && fabs(aDY) < MINIMAL_LENGTH() && + fabs(aDZ) < MINIMAL_LENGTH()) { setError("Axis builder with dimensions :: all dimensions are null", false); return ; } diff --git a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp index 6fc73fa04..754a5aa46 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp @@ -34,8 +34,9 @@ static GeomShapePtr faceByThreeVertices(const std::shared_ptr theV1, const std::shared_ptr theV2, const std::shared_ptr theV3); -static std::shared_ptr makeRectangularFace(const std::shared_ptr theFace, - const std::shared_ptr thePln); +static std::shared_ptr makeRectangularFace( + const std::shared_ptr theFace, + const std::shared_ptr thePln); //================================================================================================== ConstructionPlugin_Plane::ConstructionPlugin_Plane() @@ -45,7 +46,8 @@ ConstructionPlugin_Plane::ConstructionPlugin_Plane() //================================================================================================== void ConstructionPlugin_Plane::initAttributes() { - data()->addAttribute(ConstructionPlugin_Plane::CREATION_METHOD(), ModelAPI_AttributeString::typeId()); + data()->addAttribute(ConstructionPlugin_Plane::CREATION_METHOD(), + ModelAPI_AttributeString::typeId()); data()->addAttribute(PLANE(), ModelAPI_AttributeSelection::typeId()); data()->addAttribute(DISTANCE(), ModelAPI_AttributeDouble::typeId()); @@ -87,7 +89,8 @@ void ConstructionPlugin_Plane::execute() GeomShapePtr aShape; std::string aCreationMethod = string(CREATION_METHOD())->value(); - if(aCreationMethod == CREATION_METHOD_BY_GENERAL_EQUATION() || aCreationMethod == "PlaneByGeneralEquation") { + if(aCreationMethod == CREATION_METHOD_BY_GENERAL_EQUATION() || + aCreationMethod == "PlaneByGeneralEquation") { aShape = createByGeneralEquation(); } else if(aCreationMethod == CREATION_METHOD_BY_THREE_POINTS()) { aShape = createByThreePoints(); @@ -122,11 +125,12 @@ void ConstructionPlugin_Plane::execute() //================================================================================================== bool ConstructionPlugin_Plane::customisePresentation(ResultPtr theResult, AISObjectPtr thePrs, - std::shared_ptr theDefaultPrs) + std::shared_ptr theDefaultPrs) { std::vector aColor; // get color from the attribute of the result - if (theResult.get() != NULL && theResult->data()->attribute(ModelAPI_Result::COLOR_ID()).get() != NULL) { + if (theResult.get() != NULL && + theResult->data()->attribute(ModelAPI_Result::COLOR_ID()).get() != NULL) { AttributeIntArrayPtr aColorAttr = theResult->data()->intArray(ModelAPI_Result::COLOR_ID()); if (aColorAttr.get() && aColorAttr->size()) { aColor.push_back(aColorAttr->value(0)); @@ -328,8 +332,9 @@ std::shared_ptr ConstructionPlugin_Plane::createByRotation() } std::shared_ptr anEdge(new GeomAPI_Edge(anAxisShape)); - std::shared_ptr anAxis = std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), - anEdge->line()->direction())); + std::shared_ptr anAxis = + std::shared_ptr(new GeomAPI_Ax1(anEdge->line()->location(), + anEdge->line()->direction())); // Getting angle. double anAngle = real(ANGLE())->value(); @@ -379,13 +384,15 @@ GeomShapePtr faceByThreeVertices(const std::shared_ptr theV1, const std::shared_ptr theV2, const std::shared_ptr theV3) { - std::shared_ptr aFace = GeomAlgoAPI_FaceBuilder::planarFaceByThreeVertices(theV1, theV2, theV3); + std::shared_ptr aFace = + GeomAlgoAPI_FaceBuilder::planarFaceByThreeVertices(theV1, theV2, theV3); ListOfShape anObjects; anObjects.push_back(theV1); anObjects.push_back(theV2); anObjects.push_back(theV3); - std::list > aBoundingPoints = GeomAlgoAPI_ShapeTools::getBoundingBox(anObjects, 1.0); + std::list > aBoundingPoints = + GeomAlgoAPI_ShapeTools::getBoundingBox(anObjects, 1.0); GeomShapePtr aRes = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aFace, aBoundingPoints); return aRes; @@ -424,7 +431,8 @@ std::shared_ptr makeRectangularFace(const std::shared_ptr aResFace = GeomAlgoAPI_FaceBuilder::planarFace(thePln, - aMinX2d - aWgap, aMinY2d - aHgap, aMaxX2d - aMinX2d + 2. * aWgap, aMaxY2d - aMinY2d + 2. * aHgap); + aMinX2d - aWgap, aMinY2d - aHgap, aMaxX2d - aMinX2d + 2. * aWgap, + aMaxY2d - aMinY2d + 2. * aHgap); return aResFace; } diff --git a/src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp b/src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp index dab24920d..40c016f50 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp @@ -37,7 +37,8 @@ ConstructionPlugin_Plugin::ConstructionPlugin_Plugin() ModelAPI_Session::get()->registerPlugin(this); // register construction properties - Config_PropManager::registerProp("Visualization", "construction_plane_color", "Construction plane color", + Config_PropManager::registerProp("Visualization", "construction_plane_color", + "Construction plane color", Config_Prop::Color, ConstructionPlugin_Plane::DEFAULT_COLOR()); } diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp index e5d40b7c1..fa0cf672a 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp @@ -86,7 +86,7 @@ void ConstructionPlugin_Point::execute() //================================================================================================== bool ConstructionPlugin_Point::customisePresentation(ResultPtr theResult, AISObjectPtr thePrs, - std::shared_ptr theDefaultPrs) + std::shared_ptr theDefaultPrs) { bool isCustomized = theDefaultPrs.get() != NULL && theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs); diff --git a/src/ConstructionPlugin/ConstructionPlugin_Validators.cpp b/src/ConstructionPlugin/ConstructionPlugin_Validators.cpp index 6fa9cbd24..e9d239b82 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Validators.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Validators.cpp @@ -29,7 +29,8 @@ bool ConstructionPlugin_ValidatorPointLines::isValid(const AttributePtr& theAttr { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); - AttributeSelectionPtr aLineAttribute1 = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr aLineAttribute1 = + std::dynamic_pointer_cast(theAttribute); AttributeSelectionPtr aLineAttribute2 = aFeature->selection(theArguments.front()); GeomShapePtr aLineShape1 = aLineAttribute1->value(); @@ -86,7 +87,8 @@ bool ConstructionPlugin_ValidatorPointLineAndPlaneNotParallel::isValid( { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); - AttributeSelectionPtr anAttribute1 = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttribute1 = + std::dynamic_pointer_cast(theAttribute); AttributeSelectionPtr anAttribute2 = aFeature->selection(theArguments.front()); std::shared_ptr aLin; @@ -133,12 +135,13 @@ bool ConstructionPlugin_ValidatorPointLineAndPlaneNotParallel::isValid( //================================================================================================== bool ConstructionPlugin_ValidatorPlaneThreePoints::isValid(const AttributePtr& theAttribute, - const std::list& theArguments, - Events_InfoMessage& theError) const + const std::list& theArguments, + Events_InfoMessage& theError) const { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); - AttributeSelectionPtr aPointAttribute1 = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr aPointAttribute1 = + std::dynamic_pointer_cast(theAttribute); AttributeSelectionPtr aPointAttribute2 = aFeature->selection(theArguments.front()); AttributeSelectionPtr aPointAttribute3 = aFeature->selection(theArguments.back()); @@ -208,7 +211,8 @@ bool ConstructionPlugin_ValidatorPlaneLinePoint::isValid( { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); - AttributeSelectionPtr anAttribute1 = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttribute1 = + std::dynamic_pointer_cast(theAttribute); AttributeSelectionPtr anAttribute2 = aFeature->selection(theArguments.front()); std::shared_ptr aLin; @@ -265,7 +269,8 @@ bool ConstructionPlugin_ValidatorPlaneTwoParallelPlanes::isValid( { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); - AttributeSelectionPtr anAttribute1 = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttribute1 = + std::dynamic_pointer_cast(theAttribute); AttributeSelectionPtr anAttribute2 = aFeature->selection(theArguments.front()); std::shared_ptr aPln1; @@ -317,7 +322,8 @@ bool ConstructionPlugin_ValidatorAxisTwoNotParallelPlanes::isValid( { FeaturePtr aFeature = ModelAPI_Feature::feature(theAttribute->owner()); - AttributeSelectionPtr anAttribute1 = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttribute1 = + std::dynamic_pointer_cast(theAttribute); AttributeSelectionPtr anAttribute2 = aFeature->selection(theArguments.front()); std::shared_ptr aPln1; diff --git a/src/Events/Events_InfoMessage.h b/src/Events/Events_InfoMessage.h index 77ebdb1c4..b5e33ec3c 100644 --- a/src/Events/Events_InfoMessage.h +++ b/src/Events/Events_InfoMessage.h @@ -24,7 +24,8 @@ public: /// Constructor /// \param theSender a pointer on sender object - explicit Events_InfoMessage(const void* theSender = 0):Events_Message(Events_Loop::eventByName("InfoMessage"), theSender) {} + explicit Events_InfoMessage(const void* theSender = 0): + Events_Message(Events_Loop::eventByName("InfoMessage"), theSender) {} /// Constructor /// \param theSender a pointer on sender object diff --git a/src/Events/Events_Message.h b/src/Events/Events_Message.h index c55149ff2..68b757e8f 100644 --- a/src/Events/Events_Message.h +++ b/src/Events/Events_Message.h @@ -21,7 +21,8 @@ */ class EVENTS_EXPORT Events_ID { - char* myID; ///< pointer to the text-identifier of the event, unique pointer for all events of such type + /// pointer to the text-identifier of the event, unique pointer for all events of such type + char* myID; Events_ID(char* theID) { diff --git a/src/ExchangeAPI/ExchangeAPI_Export.cpp b/src/ExchangeAPI/ExchangeAPI_Export.cpp index 68a0b4645..5b1dd9a98 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Export.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // Name : ExchangeAPI_Export.cpp // Purpose: // @@ -15,10 +17,12 @@ void exportToFile(const std::shared_ptr & thePart, const std::string & theFileFormat) { // TODO(spo): check that thePart is not empty - std::shared_ptr aFeature = thePart->addFeature(ExchangePlugin_ExportFeature::ID()); + std::shared_ptr aFeature = + thePart->addFeature(ExchangePlugin_ExportFeature::ID()); fillAttribute("Regular", aFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID())); fillAttribute(theFilePath, aFeature->string(ExchangePlugin_ExportFeature::FILE_PATH_ID())); - fillAttribute(theSelectionList, aFeature->selectionList(ExchangePlugin_ExportFeature::SELECTION_LIST_ID())); + fillAttribute(theSelectionList, + aFeature->selectionList(ExchangePlugin_ExportFeature::SELECTION_LIST_ID())); fillAttribute(theFileFormat, aFeature->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID())); aFeature->execute(); } @@ -29,11 +33,13 @@ void exportToXAO(const std::shared_ptr & thePart, const std::string & theGeometryName) { // TODO(spo): check that thePart is not empty - std::shared_ptr aFeature = thePart->addFeature(ExchangePlugin_ExportFeature::ID()); + std::shared_ptr aFeature = + thePart->addFeature(ExchangePlugin_ExportFeature::ID()); fillAttribute("XAO", aFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID())); fillAttribute(theFilePath, aFeature->string(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID())); fillAttribute(theAuthor, aFeature->string(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID())); - fillAttribute(theGeometryName, aFeature->string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID())); + fillAttribute(theGeometryName, + aFeature->string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID())); fillAttribute("XAO", aFeature->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID())); aFeature->execute(); } diff --git a/src/ExchangeAPI/ExchangeAPI_Export.h b/src/ExchangeAPI/ExchangeAPI_Export.h index 9846f5cf6..6a7025f8b 100644 --- a/src/ExchangeAPI/ExchangeAPI_Export.h +++ b/src/ExchangeAPI/ExchangeAPI_Export.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // Name : ExchangeAPI_Export.h // Purpose: // diff --git a/src/ExchangeAPI/ExchangeAPI_Import.cpp b/src/ExchangeAPI/ExchangeAPI_Import.cpp index cf8b40089..12b987f4a 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.cpp +++ b/src/ExchangeAPI/ExchangeAPI_Import.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // Name : ExchangeAPI_Import.cpp // Purpose: // @@ -62,11 +64,13 @@ void ExchangeAPI_Import::dump(ModelHighAPI_Dumper& theDumper) const // to make import have results theDumper << "model.do()" << std::endl; - CompositeFeaturePtr aCompositeFeature = std::dynamic_pointer_cast(aBase); + CompositeFeaturePtr aCompositeFeature = + std::dynamic_pointer_cast(aBase); if(aCompositeFeature.get()) { int aNbOfSubs = aCompositeFeature->numberOfSubs(); for(int anIndex = 0; anIndex < aNbOfSubs; ++anIndex) { - std::string aSubFeatureGet = theDumper.name(aBase) + ".subFeature(" + std::to_string((long long)anIndex) + ")"; + std::string aSubFeatureGet = + theDumper.name(aBase) + ".subFeature(" + std::to_string((long long)anIndex) + ")"; theDumper.dumpSubFeatureNameAndColor(aSubFeatureGet, aCompositeFeature->subFeature(anIndex)); } } diff --git a/src/ExchangeAPI/ExchangeAPI_Import.h b/src/ExchangeAPI/ExchangeAPI_Import.h index 7f55c7342..dd6a3d014 100644 --- a/src/ExchangeAPI/ExchangeAPI_Import.h +++ b/src/ExchangeAPI/ExchangeAPI_Import.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // Name : ExchangeAPI_Import.h // Purpose: // @@ -36,7 +38,8 @@ public: virtual ~ExchangeAPI_Import(); INTERFACE_1(ExchangePlugin_ImportFeature::ID(), - filePath, ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString, /** File path */ + filePath, ExchangePlugin_ImportFeature::FILE_PATH_ID(), + ModelAPI_AttributeString, /** File path */ ) /// Set point values diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index 14311b75c..2c031fb4f 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -55,18 +55,27 @@ ExchangePlugin_ExportFeature::~ExchangePlugin_ExportFeature() */ void ExchangePlugin_ExportFeature::initAttributes() { - data()->addAttribute(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID(), ModelAPI_AttributeString::typeId()); - data()->addAttribute(ExchangePlugin_ExportFeature::FILE_PATH_ID(), ModelAPI_AttributeString::typeId()); - data()->addAttribute(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID(), ModelAPI_AttributeString::typeId()); - data()->addAttribute(ExchangePlugin_ExportFeature::FILE_FORMAT_ID(), ModelAPI_AttributeString::typeId()); - data()->addAttribute(ExchangePlugin_ExportFeature::SELECTION_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); - data()->addAttribute(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID(), ModelAPI_AttributeString::typeId()); - data()->addAttribute(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID(), ModelAPI_AttributeString::typeId()); - - //ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::SELECTION_LIST_ID()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::XAO_AUTHOR_ID()); - ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID()); + data()->addAttribute(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID(), + ModelAPI_AttributeString::typeId()); + data()->addAttribute(ExchangePlugin_ExportFeature::FILE_PATH_ID(), + ModelAPI_AttributeString::typeId()); + data()->addAttribute(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID(), + ModelAPI_AttributeString::typeId()); + data()->addAttribute(ExchangePlugin_ExportFeature::FILE_FORMAT_ID(), + ModelAPI_AttributeString::typeId()); + data()->addAttribute(ExchangePlugin_ExportFeature::SELECTION_LIST_ID(), + ModelAPI_AttributeSelectionList::typeId()); + data()->addAttribute(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID(), + ModelAPI_AttributeString::typeId()); + data()->addAttribute(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID(), + ModelAPI_AttributeString::typeId()); + + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + ExchangePlugin_ExportFeature::XAO_AUTHOR_ID()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), + ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID()); } void ExchangePlugin_ExportFeature::attributeChanged(const std::string& theID) @@ -227,7 +236,8 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName) // complex conversion of reference id to element index int aReferenceID = aSelection->Id(); std::string aReferenceString = XAO::XaoUtils::intToString(aReferenceID); - int anElementID = aXao.getGeometry()->getElementIndexByReference(aGroupDimension, aReferenceString); + int anElementID = + aXao.getGeometry()->getElementIndexByReference(aGroupDimension, aReferenceString); aXaoGroup->add(anElementID); } diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index 4107115ce..70bab6e93 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -52,8 +52,11 @@ ExchangePlugin_ImportFeature::~ExchangePlugin_ImportFeature() */ void ExchangePlugin_ImportFeature::initAttributes() { - data()->addAttribute(ExchangePlugin_ImportFeature::FILE_PATH_ID(), ModelAPI_AttributeString::typeId()); - AttributePtr aFeaturesAttribute = data()->addAttribute(ExchangePlugin_ImportFeature::FEATURES_ID(), ModelAPI_AttributeRefList::typeId()); + data()->addAttribute(ExchangePlugin_ImportFeature::FILE_PATH_ID(), + ModelAPI_AttributeString::typeId()); + AttributePtr aFeaturesAttribute = + data()->addAttribute(ExchangePlugin_ImportFeature::FEATURES_ID(), + ModelAPI_AttributeRefList::typeId()); aFeaturesAttribute->setIsArgument(false); ModelAPI_Session::get()->validators()->registerNotObligatory( -- 2.39.2