From 0bada2df7b7948c756effe42fe860cc1b93b77af Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 7 Nov 2016 12:19:38 +0300 Subject: [PATCH] Issue #1834: Fix length of lines --- src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp | 15 ++-- src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h | 13 +-- src/ModelHighAPI/ModelHighAPI_Double.cpp | 1 + src/ModelHighAPI/ModelHighAPI_Double.h | 1 + src/ModelHighAPI/ModelHighAPI_Dumper.cpp | 20 +++-- src/ModelHighAPI/ModelHighAPI_Dumper.h | 61 ++++++++------ .../ModelHighAPI_FeatureStore.cpp | 9 +- src/ModelHighAPI/ModelHighAPI_Integer.cpp | 1 + src/ModelHighAPI/ModelHighAPI_Integer.h | 1 + src/ModelHighAPI/ModelHighAPI_Interface.cpp | 7 +- src/ModelHighAPI/ModelHighAPI_Interface.h | 1 + src/ModelHighAPI/ModelHighAPI_Macro.h | 4 +- src/ModelHighAPI/ModelHighAPI_RefAttr.cpp | 1 + src/ModelHighAPI/ModelHighAPI_RefAttr.h | 9 +- src/ModelHighAPI/ModelHighAPI_Reference.h | 4 +- src/ModelHighAPI/ModelHighAPI_Selection.cpp | 16 +++- src/ModelHighAPI/ModelHighAPI_Selection.h | 15 ++-- src/ModelHighAPI/ModelHighAPI_Services.cpp | 7 +- src/ModelHighAPI/ModelHighAPI_Services.h | 1 + src/ModelHighAPI/ModelHighAPI_Tools.cpp | 7 +- src/ModelHighAPI/ModelHighAPI_Tools.h | 1 + src/ModuleBase/ModuleBase_DoubleSpinBox.cpp | 11 ++- src/ModuleBase/ModuleBase_FilterValidated.cpp | 3 +- src/ModuleBase/ModuleBase_IModule.cpp | 12 +-- src/ModuleBase/ModuleBase_Tools.cpp | 84 ++++++++++++------- src/ModuleBase/ModuleBase_Tools.h | 6 +- src/ModuleBase/ModuleBase_ViewerPrs.cpp | 6 +- src/ModuleBase/ModuleBase_WidgetEditor.h | 3 +- .../ModuleBase_WidgetSelectorStore.h | 6 +- src/ModuleBase/ModuleBase_WidgetValidator.cpp | 9 +- 30 files changed, 215 insertions(+), 120 deletions(-) diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp index bcecd78f4..206057239 100755 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.cpp @@ -27,9 +27,9 @@ namespace ModelGeomAlgo_Point2D { std::shared_ptr getPointOfRefAttr(ModelAPI_Feature* theFeature, - const std::string& theAttribute, - const std::string& theObjectFeatureKind, - const std::string& theObjectFeatureAttribute) + const std::string& theAttribute, + const std::string& theObjectFeatureKind, + const std::string& theObjectFeatureAttribute) { std::shared_ptr aPointAttr; @@ -176,7 +176,7 @@ namespace ModelGeomAlgo_Point2D { } std::string getPontAttributesInfo(const std::shared_ptr& theFeature, - const std::set >& theAttributesOnly) + const std::set >& theAttributesOnly) { std::string anInfo; @@ -203,10 +203,11 @@ namespace ModelGeomAlgo_Point2D { std::string aValue = "not defined"; std::string aType = theAttribute->attributeType(); if (aType == GeomDataAPI_Point2D::typeId()) { - std::shared_ptr aPoint = std::dynamic_pointer_cast( - theAttribute); + std::shared_ptr aPoint = + std::dynamic_pointer_cast(theAttribute); if (aPoint.get() && aPoint->isInitialized()) { - aValue = std::string("(" + doubleToString(aPoint->x()) + ", "+ doubleToString(aPoint->y()) + ")"); + aValue = std::string("(" + doubleToString(aPoint->x()) + ", "+ + doubleToString(aPoint->y()) + ")"); } } anInfo.append(theAttribute->id() + ": " + aValue); diff --git a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h index 7f1e89bdf..ab445624b 100755 --- a/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h +++ b/src/ModelGeomAlgo/ModelGeomAlgo_Point2D.h @@ -42,7 +42,8 @@ namespace ModelGeomAlgo_Point2D { /// Fills container of point 2D attributes, which refer to the feature through the references /// features with the given kind /// \param theObject an object where references should be searched (e.g. a sketch line or result) - /// \param theReferenceFeatureKind a kind of the feature to be processed (e.g. coincidence constraint) + /// \param theReferenceFeatureKind a kind of the feature to be processed + /// (e.g. coincidence constraint) /// \param theAttributes a container of found point 2D attributes /// \param theObjectFeatureKind a feature kind in object of attribute that satisfies the search /// \param theObjectFeatureAttribute a feature attribute in object that satisfies the search @@ -50,11 +51,11 @@ namespace ModelGeomAlgo_Point2D { /// should be skipped /// \returns found point attribute or NULL MODELGEOMALGO_EXPORT void getPointsOfReference(const std::shared_ptr& theObject, - const std::string& theReferenceFeatureKind, - std::set >& theAttributes, - const std::string& theObjectFeatureKind = "", - const std::string& theObjectFeatureAttribute = "", - const bool isSkipFeatureAttributes = true); + const std::string& theReferenceFeatureKind, + std::set >& theAttributes, + const std::string& theObjectFeatureKind = "", + const std::string& theObjectFeatureAttribute = "", + const bool isSkipFeatureAttributes = true); /// Removes attributes which points are out of the base shape /// \param theBaseShape a shape of check diff --git a/src/ModelHighAPI/ModelHighAPI_Double.cpp b/src/ModelHighAPI/ModelHighAPI_Double.cpp index c62a0f678..aee0ec811 100644 --- a/src/ModelHighAPI/ModelHighAPI_Double.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Double.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Double.cpp // Purpose: // diff --git a/src/ModelHighAPI/ModelHighAPI_Double.h b/src/ModelHighAPI/ModelHighAPI_Double.h index fdab71d1e..3e3b0fee5 100644 --- a/src/ModelHighAPI/ModelHighAPI_Double.h +++ b/src/ModelHighAPI/ModelHighAPI_Double.h @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Double.h // Purpose: // diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp index b43241e36..2216f59f5 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.cpp @@ -236,7 +236,8 @@ bool ModelHighAPI_Dumper::process(const std::shared_ptr& theD return isOk; } -bool ModelHighAPI_Dumper::process(const std::shared_ptr& theComposite, bool isForce) +bool ModelHighAPI_Dumper::process(const std::shared_ptr& theComposite, + bool isForce) { // increase composite features stack ++gCompositeStackDepth; @@ -279,8 +280,9 @@ bool ModelHighAPI_Dumper::process(const std::shared_ptr& theComposite, - bool theDumpModelDo) +bool ModelHighAPI_Dumper::processSubs( + const std::shared_ptr& theComposite, + bool theDumpModelDo) { bool isOk = true; // dump all sub-features; @@ -424,7 +426,8 @@ void ModelHighAPI_Dumper::dumpEntitySetName() } // set result deflection if (!isDefaultDeflection(*aResIt)) { - AttributeDoublePtr aDeflectionAttr = (*aResIt)->data()->real(ModelAPI_Result::DEFLECTION_ID()); + AttributeDoublePtr aDeflectionAttr = + (*aResIt)->data()->real(ModelAPI_Result::DEFLECTION_ID()); if(aDeflectionAttr.get() && aDeflectionAttr->isInitialized()) { *this << *aResIt; myDumpBuffer << ".setDeflection(" << aDeflectionAttr->value() << ")" << std::endl; @@ -643,7 +646,8 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(const ResultPtr& theResult) FeaturePtr aFeature = ModelAPI_Feature::feature(theResult); int anIndex = 0; std::list aResults = aFeature->results(); - for(std::list::const_iterator anIt = aResults.cbegin(); anIt != aResults.cend(); ++anIt, ++anIndex) { + for(std::list::const_iterator + anIt = aResults.cbegin(); anIt != aResults.cend(); ++anIt, ++anIndex) { if(theResult->isSame(*anIt)) { break; } @@ -784,7 +788,8 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<( return *this; } - myDumpBuffer << "\"" << aShape->shapeTypeStr() << "\", \"" << theAttrSelect->namingName() << "\")"; + myDumpBuffer << "\"" << aShape->shapeTypeStr() << "\", \"" << + theAttrSelect->namingName() << "\")"; return *this; } @@ -814,7 +819,8 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<( } else { isAdded = true; } - myDumpBuffer << "model.selection(\"" << aShape->shapeTypeStr() << "\", \"" << anAttribute->namingName() << "\")"; + myDumpBuffer << "model.selection(\"" << + aShape->shapeTypeStr() << "\", \"" << anAttribute->namingName() << "\")"; } myDumpBuffer << "]"; diff --git a/src/ModelHighAPI/ModelHighAPI_Dumper.h b/src/ModelHighAPI/ModelHighAPI_Dumper.h index 01d866756..ace8be67a 100644 --- a/src/ModelHighAPI/ModelHighAPI_Dumper.h +++ b/src/ModelHighAPI/ModelHighAPI_Dumper.h @@ -76,18 +76,22 @@ public: /// Add module to list of imported modules /// \param theModuleName name of the module to be imported - /// \param theObject name of the entity to be imported from the module (if empty, while module will be imported) + /// \param theObject name of the entity to be imported + /// from the module (if empty, while module will be imported) MODELHIGHAPI_EXPORT void importModule(const std::string& theModuleName, const std::string& theObject = std::string()); /// Returns name of specified entity /// \param theEntity [in] named entity - /// \param theSaveNotDumped [in] if \c true, the entity should be stored as not dumped (will be dumped automatically) - /// \param theUseEntityName [in] if \c true, the entity name should be used "as is" without changing default name + /// \param theSaveNotDumped [in] + /// if \c true, the entity should be stored as not dumped (will be dumped automatically) + /// \param theUseEntityName [in] + /// if \c true, the entity name should be used "as is" without changing default name /// \return name of the entity MODELHIGHAPI_EXPORT - const std::string& name(const EntityPtr& theEntity, bool theSaveNotDumped = true, bool theUseEntityName = false); + const std::string& name(const EntityPtr& theEntity, bool theSaveNotDumped = true, + bool theUseEntityName = false); /// Returns name of parent composite feature for specified entity MODELHIGHAPI_EXPORT @@ -139,7 +143,7 @@ public: friend MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& operator<<(ModelHighAPI_Dumper& theDumper, - std::basic_ostream& (*theEndl)(std::basic_ostream&)); + std::basic_ostream& (*theEndl)(std::basic_ostream&)); /// Dump GeomAPI_Pnt in the following form: /// "GeomAPI_Pnt(X, Y, Z)" @@ -184,32 +188,32 @@ public: ModelHighAPI_Dumper& operator<<(const ResultPtr& theResult); /// Dump Attribute - MODELHIGHAPI_EXPORT - ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theAttr); + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + operator<<(const std::shared_ptr& theAttr); /// Dump Object - MODELHIGHAPI_EXPORT - ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theObject); + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + operator<<(const std::shared_ptr& theObject); /// Dump AttributeRefAttr - MODELHIGHAPI_EXPORT - ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theRefAttr); + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + operator<<(const std::shared_ptr& theRefAttr); /// Dump AttributeRefAttrList as follows: /// "[obj1, obj2, obj3, ...]" - MODELHIGHAPI_EXPORT - ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theRefAttrList); + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + operator<<(const std::shared_ptr& theRefAttrList); /// Dump AttributeRefList as follows: /// "[obj1, obj2, obj3, ...]" - MODELHIGHAPI_EXPORT - ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theRefList); + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + operator<<(const std::shared_ptr& theRefList); /// Dump AttributeSelection - MODELHIGHAPI_EXPORT - ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theAttrSelect); + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + operator<<(const std::shared_ptr& theAttrSelect); /// Dump AttributeSelectionList - MODELHIGHAPI_EXPORT - ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theAttrSelList); + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + operator<<(const std::shared_ptr& theAttrSelList); /// Dump AttributeReference - MODELHIGHAPI_EXPORT - ModelHighAPI_Dumper& operator<<(const std::shared_ptr& theReference); + MODELHIGHAPI_EXPORT ModelHighAPI_Dumper& + operator<<(const std::shared_ptr& theReference); /// Clear dump buffer MODELHIGHAPI_EXPORT @@ -229,13 +233,15 @@ private: bool process(const std::shared_ptr& theDoc); /// Dump composite feature and all it sub-features - bool process(const std::shared_ptr& theComposite, bool isForce = false); + bool process(const std::shared_ptr& theComposite, + bool isForce = false); /// Iterate all features in composite feature and dump them into intermediate buffer /// \param theComposite [in] parent composite feature /// \param theDumpModelDo [in] shows that command "model.do()" should be written at the end MODELHIGHAPI_EXPORT - bool processSubs(const std::shared_ptr& theComposite, bool theDumpModelDo = false); + bool processSubs(const std::shared_ptr& theComposite, + bool theDumpModelDo = false); /// Check the entity is already dumped bool isDumped(const EntityPtr& theEntity) const; @@ -269,9 +275,11 @@ private: struct LastDumpedEntity { EntityPtr myEntity; ///< last dumped entity bool myUserName; ///< the entity hase user-defined name - std::list myResults; ///< results of this entity, which has user-defined names or specific colors + /// results of this entity, which has user-defined names or specific colors + std::list myResults; - LastDumpedEntity(EntityPtr theEntity, bool theUserName, const std::list& theResults) + LastDumpedEntity(EntityPtr theEntity, bool theUserName, + const std::list& theResults) : myEntity(theEntity), myUserName(theUserName), myResults(theResults) {} }; @@ -289,7 +297,8 @@ private: NbFeaturesMap myFeatureCount; ///< number of features of each kind protected: - std::set myNotDumpedEntities; ///< list of entities, used by other features but not dumped yet + /// list of entities, used by other features but not dumped yet + std::set myNotDumpedEntities; friend class SketchAPI_Sketch; }; diff --git a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp index bf32bdbbd..6417e5241 100644 --- a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp +++ b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp @@ -79,7 +79,8 @@ std::string ModelHighAPI_FeatureStore::compare(FeaturePtr theFeature) { void ModelHighAPI_FeatureStore::storeData(std::shared_ptr theData, std::map& theAttrs) { - theAttrs["__name__"] = theData->name(); // store name to keep also this information and output if needed + // store name to keep also this information and output if needed + theAttrs["__name__"] = theData->name(); std::list > allAttrs = theData->attributes(""); std::list >::iterator anAttr = allAttrs.begin(); for(; anAttr != allAttrs.end(); anAttr++) { @@ -117,7 +118,8 @@ std::string ModelHighAPI_FeatureStore::compareData(std::shared_ptr 0) @@ -302,7 +304,8 @@ std::string ModelHighAPI_FeatureStore::dumpShape(std::shared_ptr& } // output the main characteristics if (GeomAlgoAPI_ShapeTools::volume(theShape) > 1.e-7) { - aResult<<"Volume: "< aCenter = GeomAlgoAPI_ShapeTools::centreOfMass(theShape); aResult<<"Center of mass: "; diff --git a/src/ModelHighAPI/ModelHighAPI_Integer.cpp b/src/ModelHighAPI/ModelHighAPI_Integer.cpp index e59f605f1..047b31abb 100644 --- a/src/ModelHighAPI/ModelHighAPI_Integer.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Integer.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Integer.cpp // Purpose: // diff --git a/src/ModelHighAPI/ModelHighAPI_Integer.h b/src/ModelHighAPI/ModelHighAPI_Integer.h index 9d7758fbd..36be4ca20 100644 --- a/src/ModelHighAPI/ModelHighAPI_Integer.h +++ b/src/ModelHighAPI/ModelHighAPI_Integer.h @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Integer.h // Purpose: // diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.cpp b/src/ModelHighAPI/ModelHighAPI_Interface.cpp index cfea20834..4cb6f5293 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Interface.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Interface.cpp // Purpose: // @@ -17,7 +18,8 @@ #include "ModelHighAPI_Selection.h" //-------------------------------------------------------------------------------------- -ModelHighAPI_Interface::ModelHighAPI_Interface(const std::shared_ptr & theFeature) +ModelHighAPI_Interface::ModelHighAPI_Interface( + const std::shared_ptr & theFeature) : myFeature(theFeature) { @@ -36,7 +38,8 @@ std::shared_ptr ModelHighAPI_Interface::feature() const std::shared_ptr ModelHighAPI_Interface::subFeature(const int theIndex) const { - CompositeFeaturePtr aCompositeFeature = std::dynamic_pointer_cast(myFeature); + CompositeFeaturePtr aCompositeFeature = + std::dynamic_pointer_cast(myFeature); if(!aCompositeFeature.get()) { return InterfacePtr(); } diff --git a/src/ModelHighAPI/ModelHighAPI_Interface.h b/src/ModelHighAPI/ModelHighAPI_Interface.h index c6fa134bc..9cf22791e 100644 --- a/src/ModelHighAPI/ModelHighAPI_Interface.h +++ b/src/ModelHighAPI/ModelHighAPI_Interface.h @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Interface.h // Purpose: // diff --git a/src/ModelHighAPI/ModelHighAPI_Macro.h b/src/ModelHighAPI/ModelHighAPI_Macro.h index f6bfc6cee..2b9297018 100644 --- a/src/ModelHighAPI/ModelHighAPI_Macro.h +++ b/src/ModelHighAPI/ModelHighAPI_Macro.h @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Macro.h // Purpose: // @@ -43,7 +44,8 @@ public: //-------------------------------------------------------------------------------------- -// Used in INTERFACE_N inside START_INIT/END_INIT for set variable with attribute received from feature +// Used in INTERFACE_N inside START_INIT/END_INIT for +// set variable with attribute received from feature #define SET_ATTRIBUTE(NAME, TYPE, ATT_NAME) \ VAR_NAME(NAME) = std::dynamic_pointer_cast(feature()->attribute(ATT_NAME)); \ if (!VAR_NAME(NAME)) \ diff --git a/src/ModelHighAPI/ModelHighAPI_RefAttr.cpp b/src/ModelHighAPI/ModelHighAPI_RefAttr.cpp index 6bb6aeb3b..6d76c152b 100644 --- a/src/ModelHighAPI/ModelHighAPI_RefAttr.cpp +++ b/src/ModelHighAPI/ModelHighAPI_RefAttr.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_RefAttr.cpp // Purpose: // diff --git a/src/ModelHighAPI/ModelHighAPI_RefAttr.h b/src/ModelHighAPI/ModelHighAPI_RefAttr.h index 816e5f59a..3d48f9f5d 100644 --- a/src/ModelHighAPI/ModelHighAPI_RefAttr.h +++ b/src/ModelHighAPI/ModelHighAPI_RefAttr.h @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_RefAttr.h // Purpose: // @@ -43,12 +44,12 @@ public: virtual ~ModelHighAPI_RefAttr(); /// Fill attribute values - MODELHIGHAPI_EXPORT - virtual void fillAttribute(const std::shared_ptr & theAttribute) const; + MODELHIGHAPI_EXPORT virtual + void fillAttribute(const std::shared_ptr & theAttribute) const; /// Append to list attribute - MODELHIGHAPI_EXPORT - virtual void appendToList(const std::shared_ptr & theAttribute) const; + MODELHIGHAPI_EXPORT virtual + void appendToList(const std::shared_ptr & theAttribute) const; /// Check the object is empty MODELHIGHAPI_EXPORT diff --git a/src/ModelHighAPI/ModelHighAPI_Reference.h b/src/ModelHighAPI/ModelHighAPI_Reference.h index f960791ce..e25d33d4d 100644 --- a/src/ModelHighAPI/ModelHighAPI_Reference.h +++ b/src/ModelHighAPI/ModelHighAPI_Reference.h @@ -41,8 +41,8 @@ public: virtual ~ModelHighAPI_Reference(); /// Fill attribute values - MODELHIGHAPI_EXPORT - virtual void fillAttribute(const std::shared_ptr & theAttribute) const; + MODELHIGHAPI_EXPORT virtual + void fillAttribute(const std::shared_ptr & theAttribute) const; /// Append to list attribute MODELHIGHAPI_EXPORT diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.cpp b/src/ModelHighAPI/ModelHighAPI_Selection.cpp index e66fdb594..72bfdff59 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Selection.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Selection.cpp // Purpose: // @@ -43,8 +44,12 @@ void ModelHighAPI_Selection::fillAttribute( { switch(myVariantType) { case VT_Empty: return; - case VT_ResultSubShapePair: theAttribute->setValue(myResultSubShapePair.first, myResultSubShapePair.second); return; - case VT_TypeSubShapeNamePair: theAttribute->selectSubShape(myTypeSubShapeNamePair.first, myTypeSubShapeNamePair.second); return; + case VT_ResultSubShapePair: + theAttribute->setValue(myResultSubShapePair.first, myResultSubShapePair.second); + return; + case VT_TypeSubShapeNamePair: + theAttribute->selectSubShape(myTypeSubShapeNamePair.first, myTypeSubShapeNamePair.second); + return; } } @@ -54,7 +59,9 @@ void ModelHighAPI_Selection::appendToList( { switch(myVariantType) { case VT_Empty: return; - case VT_ResultSubShapePair: theAttribute->append(myResultSubShapePair.first, myResultSubShapePair.second); return; + case VT_ResultSubShapePair: + theAttribute->append(myResultSubShapePair.first, myResultSubShapePair.second); + return; case VT_TypeSubShapeNamePair: // Note: the reverse order (first - type, second - sub-shape name) theAttribute->append(myTypeSubShapeNamePair.second, myTypeSubShapeNamePair.first); @@ -118,7 +125,8 @@ void ModelHighAPI_Selection::setDeflection(double theValue) if (myVariantType != VT_ResultSubShapePair) return; - AttributeDoublePtr aDeflectionAttr = myResultSubShapePair.first->data()->real(ModelAPI_Result::DEFLECTION_ID()); + AttributeDoublePtr aDeflectionAttr = + myResultSubShapePair.first->data()->real(ModelAPI_Result::DEFLECTION_ID()); aDeflectionAttr->setValue(theValue); } diff --git a/src/ModelHighAPI/ModelHighAPI_Selection.h b/src/ModelHighAPI/ModelHighAPI_Selection.h index 782edec4b..c0c65f26e 100644 --- a/src/ModelHighAPI/ModelHighAPI_Selection.h +++ b/src/ModelHighAPI/ModelHighAPI_Selection.h @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Selection.h // Purpose: // @@ -19,7 +20,8 @@ class ModelAPI_AttributeSelection; class ModelAPI_AttributeSelectionList; class ModelAPI_Result; //-------------------------------------------------------------------------------------- -typedef std::pair, std::shared_ptr > ResultSubShapePair; +typedef std::pair, std::shared_ptr > + ResultSubShapePair; typedef std::pair TypeSubShapeNamePair; //-------------------------------------------------------------------------------------- /**\class ModelHighAPI_Selection @@ -43,7 +45,8 @@ public: /// Constructor for result and sub-shape MODELHIGHAPI_EXPORT ModelHighAPI_Selection(const std::shared_ptr& theContext, - const std::shared_ptr& theSubShape = std::shared_ptr()); + const std::shared_ptr& theSubShape = + std::shared_ptr()); /// Constructor for sub-shape by the textual Name MODELHIGHAPI_EXPORT ModelHighAPI_Selection(const std::string& theType, @@ -53,12 +56,12 @@ public: virtual ~ModelHighAPI_Selection(); /// Fill attribute values - MODELHIGHAPI_EXPORT - virtual void fillAttribute(const std::shared_ptr & theAttribute) const; + MODELHIGHAPI_EXPORT virtual + void fillAttribute(const std::shared_ptr & theAttribute) const; /// Append to list attribute - MODELHIGHAPI_EXPORT - virtual void appendToList(const std::shared_ptr & theAttribute) const; + MODELHIGHAPI_EXPORT virtual + void appendToList(const std::shared_ptr & theAttribute) const; /// \return variant type. MODELHIGHAPI_EXPORT diff --git a/src/ModelHighAPI/ModelHighAPI_Services.cpp b/src/ModelHighAPI/ModelHighAPI_Services.cpp index 4b40b09e1..47f432041 100644 --- a/src/ModelHighAPI/ModelHighAPI_Services.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Services.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Services.cpp // Purpose: // @@ -66,8 +67,10 @@ std::string defaultPlane(const std::shared_ptr& theOrigin, return std::string("XOZ"); } // YOZ - else if (fabs(theNormal->x() - 1.0) < aTol && fabs(theNormal->y()) < aTol && fabs(theNormal->z()) < aTol && - fabs(theDirX->x()) < aTol && fabs(theDirX->y() - 1.0) < aTol && fabs(theDirX->z()) < aTol) + else if (fabs(theNormal->x() - 1.0) < aTol && + fabs(theNormal->y()) < aTol && fabs(theNormal->z()) < aTol && + fabs(theDirX->x()) < aTol && fabs(theDirX->y() - 1.0) < aTol && + fabs(theDirX->z()) < aTol) return std::string("YOZ"); return std::string(); diff --git a/src/ModelHighAPI/ModelHighAPI_Services.h b/src/ModelHighAPI/ModelHighAPI_Services.h index 4e719429d..b02e778e9 100644 --- a/src/ModelHighAPI/ModelHighAPI_Services.h +++ b/src/ModelHighAPI/ModelHighAPI_Services.h @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Services.h // Purpose: // diff --git a/src/ModelHighAPI/ModelHighAPI_Tools.cpp b/src/ModelHighAPI/ModelHighAPI_Tools.cpp index 23f65ebc6..abb75c38b 100644 --- a/src/ModelHighAPI/ModelHighAPI_Tools.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Tools.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Tools.cpp // Purpose: // @@ -204,7 +205,8 @@ GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr) { GeomAPI_Shape::ShapeType aShapeType = GeomAPI_Shape::SHAPE; - std::transform(theShapeTypeStr.begin(), theShapeTypeStr.end(), theShapeTypeStr.begin(), ::tolower); + std::transform(theShapeTypeStr.begin(), theShapeTypeStr.end(), + theShapeTypeStr.begin(), ::tolower); if(theShapeTypeStr == "compound") { aShapeType = GeomAPI_Shape::COMPOUND; @@ -297,7 +299,8 @@ std::string storeFeatures(const std::string& theDocName, DocumentPtr theDoc, ModelAPI_Tools::allResults(aFeat, allResults); std::list::iterator aRes = allResults.begin(); for(; aRes != allResults.end(); aRes++) { - if ((*aRes)->groupName() == ModelAPI_ResultPart::group()) { // recoursively store features of sub-documents + // recoursively store features of sub-documents + if ((*aRes)->groupName() == ModelAPI_ResultPart::group()) { DocumentPtr aDoc = std::dynamic_pointer_cast(*aRes)->partDoc(); if (aDoc.get()) { std::string anError = storeFeatures((*aRes)->data()->name(), aDoc, theStore, theCompare); diff --git a/src/ModelHighAPI/ModelHighAPI_Tools.h b/src/ModelHighAPI/ModelHighAPI_Tools.h index 5db774d70..e999efdfc 100644 --- a/src/ModelHighAPI/ModelHighAPI_Tools.h +++ b/src/ModelHighAPI/ModelHighAPI_Tools.h @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D // Name : ModelHighAPI_Tools.h // Purpose: // diff --git a/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp b/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp index 856c5d193..89b15fa14 100644 --- a/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_DoubleSpinBox.cpp @@ -64,10 +64,13 @@ ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* theParent, int thePr // VSR 01/07/2010: Disable thousands separator for spin box // (to avoid inconsistency of double-2-string and string-2-double conversion) QLocale loc; - loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator); + loc.setNumberOptions(loc.numberOptions() | + QLocale::OmitGroupSeparator | + QLocale::RejectGroupSeparator); setLocale(loc); - // MPV 15/09/2014: this must be set before setDecimals; otherwise in release mode setDecimals may crash + // MPV 15/09/2014: this must be set before setDecimals; + // otherwise in release mode setDecimals may crash myPrecision = thePrecision; // Use precision equal to default Qt decimals @@ -290,7 +293,9 @@ QValidator::State ModuleBase_DoubleSpinBox::validate(QString& str, int& pos) con if (overhead == 0) state = v.validate(str, pos); else { - if ((uint)(str.length()) >= overhead && str.startsWith(pref) && str.right(suff.length()) == suff) { + if ((uint)(str.length()) >= overhead && + str.startsWith(pref) && + str.right(suff.length()) == suff) { QString core = str.mid(pref.length(), str.length() - overhead); int corePos = pos - pref.length(); state = v.validate(core, corePos); diff --git a/src/ModuleBase/ModuleBase_FilterValidated.cpp b/src/ModuleBase/ModuleBase_FilterValidated.cpp index 097eb60cb..21fe81e3a 100644 --- a/src/ModuleBase/ModuleBase_FilterValidated.cpp +++ b/src/ModuleBase/ModuleBase_FilterValidated.cpp @@ -20,7 +20,8 @@ IMPLEMENT_STANDARD_HANDLE(ModuleBase_FilterValidated, SelectMgr_Filter); IMPLEMENT_STANDARD_RTTIEXT(ModuleBase_FilterValidated, SelectMgr_Filter); -Standard_Boolean ModuleBase_FilterValidated::IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const +Standard_Boolean ModuleBase_FilterValidated:: + IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const { bool aValid = true; ModuleBase_Operation* anOperation = myWorkshop->module()->currentOperation(); diff --git a/src/ModuleBase/ModuleBase_IModule.cpp b/src/ModuleBase/ModuleBase_IModule.cpp index 73ab7d310..6327f8c10 100644 --- a/src/ModuleBase/ModuleBase_IModule.cpp +++ b/src/ModuleBase/ModuleBase_IModule.cpp @@ -72,10 +72,12 @@ void ModuleBase_IModule::launchModal(const QString& theCmdId) void ModuleBase_IModule::launchOperation(const QString& theCmdId) { /// selection should be obtained from workshop before ask if the operation can be started as - /// the canStartOperation method performs commit/abort of previous operation. Sometimes commit/abort - /// may cause selection clear(Sketch operation) as a result it will be lost and is not used for preselection. + /// the canStartOperation method performs commit/abort of previous operation. + /// Sometimes commit/abort may cause selection clear(Sketch operation) as a result + /// it will be lost and is not used for preselection. ModuleBase_ISelection* aSelection = myWorkshop->selection(); - QList aPreSelected = aSelection->getSelected(ModuleBase_ISelection::AllControls); + QList aPreSelected = + aSelection->getSelected(ModuleBase_ISelection::AllControls); if (!myWorkshop->canStartOperation(theCmdId)) return; @@ -118,8 +120,8 @@ ModuleBase_Operation* ModuleBase_IModule::getNewOperation(const std::string& the } bool ModuleBase_IModule::customizeObject(ObjectPtr theObject, - const ModuleBase_IModule::ModuleBase_CustomizeFlag& theFlag, - const bool theUpdateViewer) + const ModuleBase_IModule::ModuleBase_CustomizeFlag& theFlag, + const bool theUpdateViewer) { return false; } diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 1a436ee44..ae98b8a18 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -317,9 +317,10 @@ QString objectInfo(const ObjectPtr& theObj, const bool isUseAttributesInfo) if (isUseAttributesInfo) { std::set > anAttributes; std::string aPointsInfo = ModelGeomAlgo_Point2D::getPontAttributesInfo(aFeature, - anAttributes).c_str(); + anAttributes).c_str(); if (!aPointsInfo.empty()) - aFeatureStr.append(QString(", attributes: %1").arg(aPointsInfo.c_str()).toStdString().c_str()); + aFeatureStr.append(QString(", attributes: %1") + .arg(aPointsInfo.c_str()).toStdString().c_str()); } } @@ -468,7 +469,8 @@ QString activeOwners(Handle(AIS_InteractiveContext)& theContext, const bool theS return aValue; } -QString selectedOwners(Handle(AIS_InteractiveContext)& theContext, const bool theShapeInfoOnly = true) +QString selectedOwners(Handle(AIS_InteractiveContext)& theContext, + const bool theShapeInfoOnly = true) { QStringList anObjects; if (theContext.IsNull()) @@ -637,17 +639,20 @@ ObjectPtr getObject(const AttributePtr& theAttribute) ObjectPtr anObject; std::string anAttrType = theAttribute->attributeType(); if (anAttrType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeRefAttrPtr anAttr = + std::dynamic_pointer_cast(theAttribute); if (anAttr != NULL && anAttr->isObject()) anObject = anAttr->object(); } if (anAttrType == ModelAPI_AttributeSelection::typeId()) { - AttributeSelectionPtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeSelectionPtr anAttr = + std::dynamic_pointer_cast(theAttribute); if (anAttr != NULL) anObject = anAttr->context(); } if (anAttrType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr anAttr = std::dynamic_pointer_cast(theAttribute); + AttributeReferencePtr anAttr = + std::dynamic_pointer_cast(theAttribute); if (anAttr.get() != NULL) anObject = anAttr->value(); } @@ -704,7 +709,8 @@ void getParameters(QStringList& theParameters) } } -std::string findGreedAttribute(ModuleBase_IWorkshop* theWorkshop, const FeaturePtr& theFeature) +std::string findGreedAttribute(ModuleBase_IWorkshop* theWorkshop, + const FeaturePtr& theFeature) { std::string anAttributeId; @@ -729,14 +735,16 @@ bool hasObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, std::string aType = theAttribute->attributeType(); if (aType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr aRef = std::dynamic_pointer_cast(theAttribute); + AttributeReferencePtr aRef = + std::dynamic_pointer_cast(theAttribute); ObjectPtr aObject = aRef->value(); aHasObject = aObject && aObject->isSame(theObject); //if (!(aObject && aObject->isSame(theObject))) { // aRef->setValue(theObject); //} } else if (aType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); + AttributeRefAttrPtr aRefAttr = + std::dynamic_pointer_cast(theAttribute); AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape); if (anAttribute.get()) { @@ -762,17 +770,17 @@ bool hasObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, std::dynamic_pointer_cast(theAttribute); ResultPtr aResult = std::dynamic_pointer_cast(theObject); aHasObject = aSelectionListAttr->isInList(aResult, theShape, theTemporarily); - //if (!theCheckIfAttributeHasObject || !aSelectionListAttr->isInList(aResult, theShape, theTemporarily)) - // aSelectionListAttr->append(aResult, theShape, theTemporarily); } else if (aType == ModelAPI_AttributeRefList::typeId()) { - AttributeRefListPtr aRefListAttr = std::dynamic_pointer_cast(theAttribute); + AttributeRefListPtr aRefListAttr = + std::dynamic_pointer_cast(theAttribute); aHasObject = aRefListAttr->isInList(theObject); //if (!theCheckIfAttributeHasObject || !aRefListAttr->isInList(theObject)) // aRefListAttr->append(theObject); } else if (aType == ModelAPI_AttributeRefAttrList::typeId()) { - AttributeRefAttrListPtr aRefAttrListAttr = std::dynamic_pointer_cast(theAttribute); + AttributeRefAttrListPtr aRefAttrListAttr = + std::dynamic_pointer_cast(theAttribute); AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape); if (anAttribute.get()) { @@ -799,13 +807,15 @@ bool setObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, bool isDone = true; std::string aType = theAttribute->attributeType(); if (aType == ModelAPI_AttributeReference::typeId()) { - AttributeReferencePtr aRef = std::dynamic_pointer_cast(theAttribute); + AttributeReferencePtr aRef = + std::dynamic_pointer_cast(theAttribute); ObjectPtr aObject = aRef->value(); if (!(aObject && aObject->isSame(theObject))) { aRef->setValue(theObject); } } else if (aType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); + AttributeRefAttrPtr aRefAttr = + std::dynamic_pointer_cast(theAttribute); AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape); if (anAttribute.get()) @@ -828,11 +838,13 @@ bool setObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, AttributeSelectionListPtr aSelectionListAttr = std::dynamic_pointer_cast(theAttribute); ResultPtr aResult = std::dynamic_pointer_cast(theObject); - if (!theCheckIfAttributeHasObject || !aSelectionListAttr->isInList(aResult, theShape, theTemporarily)) + if (!theCheckIfAttributeHasObject || + !aSelectionListAttr->isInList(aResult, theShape, theTemporarily)) aSelectionListAttr->append(aResult, theShape, theTemporarily); } else if (aType == ModelAPI_AttributeRefList::typeId()) { - AttributeRefListPtr aRefListAttr = std::dynamic_pointer_cast(theAttribute); + AttributeRefListPtr aRefListAttr = + std::dynamic_pointer_cast(theAttribute); if (!theCheckIfAttributeHasObject || !aRefListAttr->isInList(theObject)) { if (theObject.get()) aRefListAttr->append(theObject); @@ -841,7 +853,8 @@ bool setObject(const AttributePtr& theAttribute, const ObjectPtr& theObject, } } else if (aType == ModelAPI_AttributeRefAttrList::typeId()) { - AttributeRefAttrListPtr aRefAttrListAttr = std::dynamic_pointer_cast(theAttribute); + AttributeRefAttrListPtr aRefAttrListAttr = + std::dynamic_pointer_cast(theAttribute); AttributePtr anAttribute = theWorkshop->module()->findAttribute(theObject, theShape); if (anAttribute.get()) { @@ -869,7 +882,8 @@ GeomShapePtr getShape(const AttributePtr& theAttribute, ModuleBase_IWorkshop* th std::string aType = theAttribute->attributeType(); if (aType == ModelAPI_AttributeReference::typeId()) { } else if (aType == ModelAPI_AttributeRefAttr::typeId()) { - AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); + AttributeRefAttrPtr aRefAttr = + std::dynamic_pointer_cast(theAttribute); if (aRefAttr.get() && !aRefAttr->isObject()) { AttributePtr anAttribute = aRefAttr->attr(); aShape = theWorkshop->module()->findShape(anAttribute); @@ -952,7 +966,8 @@ QString wrapTextByWords(const QString& theValue, QWidget* theWidget, } //************************************************************** -void refsToFeatureInFeatureDocument(const ObjectPtr& theObject, std::set& theRefFeatures) +void refsToFeatureInFeatureDocument(const ObjectPtr& theObject, + std::set& theRefFeatures) { FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); if (aFeature.get()) { @@ -1052,7 +1067,8 @@ bool askToDelete(const std::set theFeatures, std::string aNotActivatedNames; if (!ModelAPI_Tools::allDocumentsActivated(aNotActivatedNames)) { if (ModuleBase_Tools::hasModuleDocumentFeature(theFeatures)) - aNotActivatedDocWrn = QObject::tr("Selected objects can be used in Part documents which are not loaded:%1.\n") + aNotActivatedDocWrn = + QObject::tr("Selected objects can be used in Part documents which are not loaded:%1.\n") .arg(aNotActivatedNames.c_str()); } @@ -1128,17 +1144,25 @@ bool askToDelete(const std::set theFeatures, if (!thePrefixInfo.empty()) aText = thePrefixInfo.c_str(); QString aSep = ", "; - if (!aPartFeatureNames.empty()) - aText += QString(QObject::tr("The following parts will be deleted: %1.\n")).arg(aPartFeatureNames.join(aSep)); + if (!aPartFeatureNames.empty()) { + aText += QString(QObject::tr("The following parts will be deleted: %1.\n")) + .arg(aPartFeatureNames.join(aSep)); + } if (!aNotActivatedDocWrn.isEmpty()) aText += aNotActivatedDocWrn; - if (!anOtherFeatureNames.empty()) - aText += QString(QObject::tr("Features are used in the following features: %1.\nThese features will be deleted.\n")) + if (!anOtherFeatureNames.empty()) { + const char* aMsg = "Features are used in the following features: %1.\nThese \ + features will be deleted.\n"; + aText += QString(QObject::tr(aMsg)) .arg(anOtherFeatureNames.join(aSep)); + } if (!aParamFeatureNames.empty()) { - aText += QString(QObject::tr("Parameters are used in the following features: %1.\nThese features will be deleted.\nOr parameters could be replaced by their values.\n")) + const char* aMsg = "Parameters are used in the following features: %1.\nThese features will \ + be deleted.\nOr parameters could be replaced by their values.\n"; + aText += QString(QObject::tr(aMsg)) .arg(aParamFeatureNames.join(aSep)); - QPushButton *aReplaceButton = aMessageBox.addButton(QObject::tr("Replace"), QMessageBox::ActionRole); + QPushButton *aReplaceButton = + aMessageBox.addButton(QObject::tr("Replace"), QMessageBox::ActionRole); } if (!aText.isEmpty()) { @@ -1155,7 +1179,8 @@ bool askToDelete(const std::set theFeatures, ModelAPI_ReplaceParameterMessage::send(aObj, 0); } else - theReferencesToDelete.insert(aFeaturesRefsToParameterOnly.begin(), aFeaturesRefsToParameterOnly.end()); + theReferencesToDelete.insert(aFeaturesRefsToParameterOnly.begin(), + aFeaturesRefsToParameterOnly.end()); } return true; } @@ -1208,7 +1233,8 @@ void setPointBallHighlighting(AIS_Shape* theAIS) aPixMap = new Image_AlienPixMap(); if(!aPixMap->Load(aFile.c_str())) { // The icon for constraint is not found - static const std::string aMsg = "Error: Point market not found by path: \"" + aFile + "\". Falling back."; + static const std::string aMsg = + "Error: Point market not found by path: \"" + aFile + "\". Falling back."; //Events_InfoMessage("ModuleBase_Tools::setPointBallHighlighting", aMsg).send(); } } diff --git a/src/ModuleBase/ModuleBase_Tools.h b/src/ModuleBase/ModuleBase_Tools.h index 9c529b341..6e4e89b41 100755 --- a/src/ModuleBase/ModuleBase_Tools.h +++ b/src/ModuleBase/ModuleBase_Tools.h @@ -82,7 +82,8 @@ MODULEBASE_EXPORT QPixmap composite(const QString& theAdditionalIcon, const QStr /// Generates the pixmap lighter than the resources pixmap. /// Pixmap \a theIcon is lighted according to the given value. /// If the lighter value is greater than 100, this functions returns a lighter pixmap. -/// Setting lighter value to 150 returns a color that is 50% brighter. If the factor is less than 100, +/// Setting lighter value to 150 returns a color that is 50% brighter. +/// If the factor is less than 100, /// the return pixmap is darker. If the factor is 0 or negative, the return pixmap is unspecified. /// \param resource text of the pixmap @@ -133,7 +134,8 @@ MODULEBASE_EXPORT QAction* createAction(const QIcon& theIcon, const QString& the /// \param theObj an object /// \param isUseAttributesInfo a flag whether the attribute values information is used /// \return a string -MODULEBASE_EXPORT QString objectInfo(const ObjectPtr& theObj, const bool isUseAttributesInfo = false); +MODULEBASE_EXPORT QString objectInfo(const ObjectPtr& theObj, + const bool isUseAttributesInfo = false); /// Converts the AIS context information in a string information. /// \param theContext a viewer context diff --git a/src/ModuleBase/ModuleBase_ViewerPrs.cpp b/src/ModuleBase/ModuleBase_ViewerPrs.cpp index f7ad01c50..38e4c71a3 100644 --- a/src/ModuleBase/ModuleBase_ViewerPrs.cpp +++ b/src/ModuleBase/ModuleBase_ViewerPrs.cpp @@ -52,7 +52,8 @@ bool ModuleBase_ViewerPrs::isEqual(ModuleBase_ViewerPrs* thePrs) const // and set in the sub-solid AIS. ViewerPrs of these fictive owners are accepted as equal // as they use the same shape and result(of compsolid) Handle(StdSelect_BRepOwner) aCSolidOwner1 = Handle(StdSelect_BRepOwner)::DownCast(myOwner); - Handle(StdSelect_BRepOwner) aCSolidOwner2 = Handle(StdSelect_BRepOwner)::DownCast(thePrs->owner()); + Handle(StdSelect_BRepOwner) aCSolidOwner2 = + Handle(StdSelect_BRepOwner)::DownCast(thePrs->owner()); isEqualIO = !aCSolidOwner1.IsNull() && !aCSolidOwner2.IsNull(); if (!aCSolidOwner1.IsNull() && !aCSolidOwner2.IsNull()) isEqualOwner = (aCSolidOwner1->Shape().IsNull() && aCSolidOwner2->Shape().IsNull()) || @@ -93,7 +94,8 @@ bool ModuleBase_ViewerPrs::operator==(const ModuleBase_ViewerPrs& thePrs) // and set in the sub-solid AIS. ViewerPrs of these fictive owners are accepted as equal // as they use the same shape and result(of compsolid) Handle(StdSelect_BRepOwner) aCSolidOwner1 = Handle(StdSelect_BRepOwner)::DownCast(myOwner); - Handle(StdSelect_BRepOwner) aCSolidOwner2 = Handle(StdSelect_BRepOwner)::DownCast(thePrs.owner()); + Handle(StdSelect_BRepOwner) aCSolidOwner2 = + Handle(StdSelect_BRepOwner)::DownCast(thePrs.owner()); isEqualIO = !aCSolidOwner1.IsNull() && !aCSolidOwner2.IsNull(); if (!aCSolidOwner1.IsNull() && !aCSolidOwner1.IsNull()) isEqualOwner = (aCSolidOwner1->Shape().IsNull() && aCSolidOwner2->Shape().IsNull()) || diff --git a/src/ModuleBase/ModuleBase_WidgetEditor.h b/src/ModuleBase/ModuleBase_WidgetEditor.h index d9c0671f7..97a01ac3b 100644 --- a/src/ModuleBase/ModuleBase_WidgetEditor.h +++ b/src/ModuleBase/ModuleBase_WidgetEditor.h @@ -36,7 +36,8 @@ Q_OBJECT /// Destructor virtual ~ModuleBase_WidgetEditor(); - /// Set focus to the first control of the current widget. The focus policy of the control is checked. + /// Set focus to the first control of the current widget. + /// The focus policy of the control is checked. /// If the widget has the NonFocus focus policy, it is skipped. /// \return the state whether the widget can accept the focus virtual bool focusTo(); diff --git a/src/ModuleBase/ModuleBase_WidgetSelectorStore.h b/src/ModuleBase/ModuleBase_WidgetSelectorStore.h index ed727db8c..91a77ba94 100755 --- a/src/ModuleBase/ModuleBase_WidgetSelectorStore.h +++ b/src/ModuleBase/ModuleBase_WidgetSelectorStore.h @@ -17,7 +17,8 @@ class ModuleBase_IWorkshop; /** * \ingroup GUI - Provides for an attribute backup of values. It is possible to store/ restore the attribute values. + Provides for an attribute backup of values. + It is possible to store/ restore the attribute values. */ class ModuleBase_WidgetSelectorStore { @@ -42,7 +43,8 @@ class ModuleBase_WidgetSelectorStore private: /// backup parameters of the model attribute. The class processes three types of attribute: - /// Reference, RefAttr and Selection. Depending on the attribute type, only the attribute parameter + /// Reference, RefAttr and Selection. + /// Depending on the attribute type, only the attribute parameter /// values are reserved in the backup /// An attribute object ObjectPtr myObject; diff --git a/src/ModuleBase/ModuleBase_WidgetValidator.cpp b/src/ModuleBase/ModuleBase_WidgetValidator.cpp index 191a277ee..e4b1a4fdd 100755 --- a/src/ModuleBase/ModuleBase_WidgetValidator.cpp +++ b/src/ModuleBase/ModuleBase_WidgetValidator.cpp @@ -63,7 +63,8 @@ void ModuleBase_WidgetValidator::clearValidatedCash() myInvalidPrs.clear(); } -bool ModuleBase_WidgetValidator::getValidState(const ModuleBase_ViewerPrsPtr& theValue, bool& theValid) +bool ModuleBase_WidgetValidator::getValidState(const ModuleBase_ViewerPrsPtr& theValue, + bool& theValid) { bool aValidPrs = myValidPrs.contains(theValue); bool anInvalidPrs = myInvalidPrs.contains(theValue); @@ -77,7 +78,8 @@ bool ModuleBase_WidgetValidator::getValidState(const ModuleBase_ViewerPrsPtr& th } //******************************************************************** -void ModuleBase_WidgetValidator::storeValidState(const ModuleBase_ViewerPrsPtr& theValue, const bool theValid) +void ModuleBase_WidgetValidator::storeValidState(const ModuleBase_ViewerPrsPtr& theValue, + const bool theValid) { bool aValidPrs = myInvalidPrs.contains(theValue); bool anInvalidPrs = myInvalidPrs.contains(theValue); @@ -97,7 +99,8 @@ void ModuleBase_WidgetValidator::storeValidState(const ModuleBase_ViewerPrsPtr& // myValidPrs.removeOne(theValue); } #ifdef DEBUG_VALID_STATE - qDebug(QString("storeValidState: myValidPrs.size() = %1, myInvalidPrs.size() = %2").arg(myValidPrs.count()) + qDebug(QString("storeValidState: myValidPrs.size() = %1, myInvalidPrs.size() = %2") + .arg(myValidPrs.count()) .arg(myInvalidPrs.count()).toStdString().c_str()); #endif } -- 2.39.2