]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
refactor: Running clang-tidy again
authorSONOLET Aymeric <aymeric.sonolet@cea.fr>
Wed, 3 Jan 2024 10:43:10 +0000 (11:43 +0100)
committerSONOLET Aymeric <aymeric.sonolet@cea.fr>
Wed, 3 Jan 2024 10:43:10 +0000 (11:43 +0100)
29 files changed:
src/ExchangePlugin/ExchangePlugin_ExportPart.cpp
src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp
src/FeaturesPlugin/FeaturesPlugin_Recover.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeInfo.h
src/GeomAlgoImpl/GEOMAlgo_Algo.cxx
src/ModelAPI/ModelAPI_ResultBody.h
src/ModelHighAPI/ModelHighAPI_RefAttr.cpp
src/ModelHighAPI/ModelHighAPI_Selection.cpp
src/ModuleBase/ModuleBase_IErrorMgr.cpp
src/ModuleBase/ModuleBase_IErrorMgr.h
src/ModuleBase/ModuleBase_Operation.cpp
src/ModuleBase/ModuleBase_Operation.h
src/ModuleBase/ModuleBase_WidgetCreatorFactory.h
src/PartSet/PartSet_PreviewPlanes.cpp
src/PartSet/PartSet_PreviewSketchPlane.cpp
src/PartSet/PartSet_TreeNodes.h
src/SHAPERGUI/SHAPERGUI.h
src/SketchPlugin/SketchPlugin_MacroBSpline.cpp
src/SketchPlugin/SketchPlugin_MultiRotation.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_EntityWrapper.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_PointArrayWrapper.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.h
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Tools.cpp
src/SketchSolver/SketchSolver_Constraint.cpp
src/SketchSolver/SketchSolver_Constraint.h
src/SketchSolver/SketchSolver_Storage.h
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

index ea6c76bb8fca8d04d027809eff357f2dca807e21..aceeeba2229d7b880108de55807d6adb0bbfff90 100644 (file)
@@ -158,9 +158,8 @@ static void allReferencedFeatures(const std::set<FeaturePtr> &theFeatures,
     theFeature->data()->referencesToObjects(aRefs);
 
     for (auto &aRef : aRefs) {
-      for (auto anObjIt = aRef.second.begin(); anObjIt != aRef.second.end();
-           ++anObjIt) {
-        FeaturePtr aFeature = ModelAPI_Feature::feature(*anObjIt);
+      for (auto &anObjIt : aRef.second) {
+        FeaturePtr aFeature = ModelAPI_Feature::feature(anObjIt);
         if (aFeature && !isCoordinate(aFeature) &&
             theReferencedFeatures.find(aFeature) == theReferencedFeatures.end())
           aReferences.insert(aFeature);
index 7f3df9557fe805a3ee76bcf9b9106550e7226b75..91857a3db66eb9b654aa790dc7ca585cc6a3c7d2 100644 (file)
@@ -54,7 +54,7 @@
 #include <iomanip>
 #include <sstream>
 
-FeaturesPlugin_Measurement::FeaturesPlugin_Measurement() {}
+FeaturesPlugin_Measurement::FeaturesPlugin_Measurement() = default;
 
 void FeaturesPlugin_Measurement::initAttributes() {
   data()->addAttribute(FeaturesPlugin_Measurement::MEASURE_KIND(),
index a8d1415a5e46304cdd464d8686851e8ca0e4ccb4..927882ddc5208aaf11fe648390e61e7d984b15bb 100644 (file)
@@ -34,7 +34,7 @@
 #include <ModelAPI_Tools.h>
 #include <ModelAPI_Validator.h>
 
-FeaturesPlugin_Recover::FeaturesPlugin_Recover() {}
+FeaturesPlugin_Recover::FeaturesPlugin_Recover() = default;
 
 void FeaturesPlugin_Recover::initAttributes() {
   data()->addAttribute(BASE_FEATURE(), ModelAPI_AttributeReference::typeId());
index 8985f2d874fa60939adb89dfd9d9d3d8c454a8a7..c02c899ff9234880e3773351f12058deb5a05576 100644 (file)
@@ -39,7 +39,7 @@ class GeomAlgoAPI_InfoValue {
   bool myBool;       //< type 2
 
 public:
-  GeomAlgoAPI_InfoValue() {} // invalid case
+  GeomAlgoAPI_InfoValue() = default; // invalid case
   GeomAlgoAPI_InfoValue(const char *theVal) : myType(0), myStr(theVal) {}
   GeomAlgoAPI_InfoValue(const std::string theVal) : myType(0), myStr(theVal) {}
   GeomAlgoAPI_InfoValue(const double theVal) : myType(1), myDouble(theVal) {}
index a76caa3110429061ce3028cf9a403e5ff8c9937a..bebae4be8d3de6ca1328b5abd60199f334409d06 100644 (file)
@@ -34,7 +34,7 @@
 //=======================================================================
 GEOMAlgo_Algo::GEOMAlgo_Algo()
 
-{}
+    = default;
 
 //=======================================================================
 // function: ~
index 8c42c97022748c42c0f1eb7d80110baada69b518..e83545fd1f5145cfdf29e386d85089b5369204a6 100644 (file)
@@ -56,7 +56,7 @@ protected:
   ConnectedTopologyFlag myConnect;
 
   ModelAPI_BodyBuilder *myBuilder{
-      0}; ///< provides the body processing in naming shape
+      nullptr}; ///< provides the body processing in naming shape
 
 public:
   MODELAPI_EXPORT ~ModelAPI_ResultBody() override;
index 6e581777371c336588886bbab2ffd3738f6940ed..06d7fdf35d79dbcc7b7b43606988be13336013d4 100644 (file)
@@ -27,7 +27,7 @@
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_Result.h>
 //--------------------------------------------------------------------------------------
-ModelHighAPI_RefAttr::ModelHighAPI_RefAttr() {}
+ModelHighAPI_RefAttr::ModelHighAPI_RefAttr() = default;
 
 ModelHighAPI_RefAttr::ModelHighAPI_RefAttr(
     const std::shared_ptr<ModelAPI_Attribute> &theValue)
@@ -35,12 +35,11 @@ ModelHighAPI_RefAttr::ModelHighAPI_RefAttr(
 
 ModelHighAPI_RefAttr::ModelHighAPI_RefAttr(
     const std::shared_ptr<ModelAPI_Object> &theValue)
-    : myVariantType(VT_OBJECT), myObject(theValue) {}
+    : myObject(theValue) {}
 
 ModelHighAPI_RefAttr::ModelHighAPI_RefAttr(
     const std::shared_ptr<ModelHighAPI_Interface> &theValue)
-    : myVariantType(VT_OBJECT),
-      myObject(std::shared_ptr<ModelAPI_Object>(theValue->defaultResult())) {}
+    : myObject(std::shared_ptr<ModelAPI_Object>(theValue->defaultResult())) {}
 
 ModelHighAPI_RefAttr::~ModelHighAPI_RefAttr() = default;
 
index bb6ee66d46cc112af5654e1d038235b9963cbced..7c103930f8a3cdc4b3ecd5a42c23c9797be511aa 100644 (file)
@@ -32,7 +32,7 @@
 //--------------------------------------------------------------------------------------
 
 //--------------------------------------------------------------------------------------
-ModelHighAPI_Selection::ModelHighAPI_Selection() {}
+ModelHighAPI_Selection::ModelHighAPI_Selection() = default;
 
 ModelHighAPI_Selection::ModelHighAPI_Selection(
     const std::shared_ptr<ModelAPI_Result> &theContext,
index 932ea809a6d3fe04567d0b84f0c209768c49446e..d507203c8614ef5b65ec39b227ac57bf39337850 100644 (file)
@@ -24,7 +24,7 @@
 #include "ModuleBase_ModelWidget.h"
 
 ModuleBase_IErrorMgr::ModuleBase_IErrorMgr(QObject *theParent /*= 0*/)
-    : QObject(theParent), myPropertyPanel(nullptr) {}
+    : QObject(theParent) {}
 
 ModuleBase_IErrorMgr::~ModuleBase_IErrorMgr() = default;
 
index 5f410eb95bad8216b7f483ebe6993ac5477c7063..a40daf7c5dffcc6ce13a65b0c61cbc2a53515024 100644 (file)
@@ -63,7 +63,7 @@ protected slots:
 
 protected:
   /// Access to property panel
-  ModuleBase_IPropertyPanel *myPropertyPanel;
+  ModuleBase_IPropertyPanel *myPropertyPanel{nullptr};
 };
 
 #endif // ModuleBase_IErrorMgr_H
index 5e6cb98740f76e000fb04ae81547cefcb7088c32..04b0d2857269db3f075cc1fa5c94ad7102ba60a3 100644 (file)
@@ -51,7 +51,7 @@
 
 ModuleBase_Operation::ModuleBase_Operation(const QString &theId,
                                            QObject *theParent)
-    : QObject(theParent), myPropertyPanel(nullptr) {
+    : QObject(theParent) {
   myDescription = new ModuleBase_OperationDescription(theId);
 }
 
index 90f63547e8009157e27fed183aa7112b9aea5003..373580746a2236d0a0c38a54c797aa10435b3b13 100644 (file)
@@ -218,7 +218,7 @@ private:
   QStringList myGrantedIds;
 
   /// Access to property panel
-  ModuleBase_IPropertyPanel *myPropertyPanel;
+  ModuleBase_IPropertyPanel *myPropertyPanel{nullptr};
 
   QString myHelpFileName;
 
index 46603c1b94e734292f5214e0c0575d36c3c749e4..ef0386ae47c62d98ace0e8859d3b555a013af87a 100644 (file)
@@ -113,7 +113,7 @@ private:
   QMap<std::string, WidgetCreatorPtr> myCreators;
 };
 
-typedef std::shared_ptr<ModuleBase_WidgetCreatorFactory>
-    WidgetCreatorFactoryPtr;
+using WidgetCreatorFactoryPtr =
+    std::shared_ptr<ModuleBase_WidgetCreatorFactory>;
 
 #endif /* MODULEBASE_WIDGETCREATORFACTORY_H_ */
index 85c814ddc9c3ba77347ac3f459d2871762e85401..f2b7898fdfff127b01b80fc681892b3fd79ec6dc 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <SketchPlugin_Sketch.h>
 
-PartSet_PreviewPlanes::PartSet_PreviewPlanes() {}
+PartSet_PreviewPlanes::PartSet_PreviewPlanes() = default;
 
 bool PartSet_PreviewPlanes::hasVisualizedBodies(
     ModuleBase_IWorkshop *theWorkshop) {
index e34488b025a6196a52b9d35a12cda02018dd7caf..3c0624f51f99fc76cc5c2a834fb99a21f585818f 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <BRepBndLib.hxx>
 
-PartSet_PreviewSketchPlane::PartSet_PreviewSketchPlane() {}
+PartSet_PreviewSketchPlane::PartSet_PreviewSketchPlane() = default;
 
 void PartSet_PreviewSketchPlane::eraseSketchPlane(
     ModuleBase_IWorkshop *theWorkshop, const bool isClearPlane) {
index 623384021cf3477ffd4750a6e699604085724222..0eeee11c0b6eea3e3ae801e812018c1355d3de0b 100644 (file)
@@ -233,7 +233,7 @@ private:
   PartSet_FolderNode *myConstrFolder;
   PartSet_FolderNode *myPartsFolder;
 
-  ModuleBase_IWorkshop *myWorkshop{0};
+  ModuleBase_IWorkshop *myWorkshop{nullptr};
 };
 
 /////////////////////////////////////////////////////////////////////
index 6d2e8f0e1eac7708d167cf196729985e845b03a7..cace686f0081767d6b3af5238447bc003312877a 100644 (file)
@@ -284,7 +284,7 @@ private:
   XGUI_Workshop *myWorkshop;
 
   /// OCC viewer selector instance
-  SHAPERGUI_OCCSelector *mySelector{0};
+  SHAPERGUI_OCCSelector *mySelector{nullptr};
 
   /// Proxy viewer for connection to OCC Viewer in SALOME
   SHAPERGUI_SalomeViewer *myProxyViewer;
@@ -293,19 +293,19 @@ private:
   QMap<QString, std::shared_ptr<Config_FeatureMessage>> myFeaturesInfo;
 
   /// Flag of opened document state
-  bool myIsOpened{0};
+  bool myIsOpened{false};
 
   // the next parameter should be restored after this module deactivation
   /// The application value
   bool myIsEditEnabled;
 
   /// Popup manager
-  QtxPopupMgr *myPopupMgr{0};
+  QtxPopupMgr *myPopupMgr{nullptr};
 
   QAction *myWhatIsAction;
 
   bool myIsInspectionVisible{false};
-  QDockWidget *myInspectionPanel{0};
+  QDockWidget *myInspectionPanel{nullptr};
   bool myIsFacesPanelVisible{false};
 
   /// List of registered actions
index cf805372152eb7dfe9bcda86835a15952c434f88..e0908f02ce8b39673bc09d7ffba4b4ebbc407215 100644 (file)
@@ -58,7 +58,7 @@ SketchPlugin_MacroBSpline::SketchPlugin_MacroBSpline()
     : SketchPlugin_SketchEntity() {}
 
 SketchPlugin_MacroBSpline::SketchPlugin_MacroBSpline(bool isPeriodic)
-    : SketchPlugin_SketchEntity(), myDegree(3), myIsPeriodic(isPeriodic) {}
+    : SketchPlugin_SketchEntity(), myIsPeriodic(isPeriodic) {}
 
 void SketchPlugin_MacroBSpline::initAttributes() {
   data()->addAttribute(POLES_ID(), GeomDataAPI_Point2DArray::typeId());
index 954495230388501ac9aafdb19dad6087a49f16be..df33e67f444bbb28fc2adb75cf1261fc0ad9104c 100644 (file)
@@ -48,7 +48,7 @@ static const double PI = 3.1415926535897932;
 static const double PERIOD = 360.0;
 static const double ANGLETOL = 1.e-7;
 
-SketchPlugin_MultiRotation::SketchPlugin_MultiRotation() {}
+SketchPlugin_MultiRotation::SketchPlugin_MultiRotation() = default;
 
 void SketchPlugin_MultiRotation::initAttributes() {
   data()->addAttribute(CENTER_ID(), ModelAPI_AttributeRefAttr::typeId());
index a2e6f74fdea06a3c96dfb2a9a853cfc8fd061284..8df6df3fcbe3db518b58039e4bbd4349beb9f806 100644 (file)
@@ -36,7 +36,7 @@ using EntityWrapperPtr = std::shared_ptr<PlaneGCSSolver_EntityWrapper>;
  */
 class PlaneGCSSolver_EntityWrapper {
 public:
-  PlaneGCSSolver_EntityWrapper() {}
+  PlaneGCSSolver_EntityWrapper() = default;
   virtual ~PlaneGCSSolver_EntityWrapper() = default;
 
   /// \brief Return type of current entity
index ffaa326c5598be854afc67b00d66757ac5d9458d..fbd948af4a919c2df46475e645b1f1a363a3ab9f 100644 (file)
@@ -60,6 +60,6 @@ private:
   std::vector<PointWrapperPtr> myPoints;
 };
 
-typedef std::shared_ptr<PlaneGCSSolver_PointArrayWrapper> PointArrayWrapperPtr;
+using PointArrayWrapperPtr = std::shared_ptr<PlaneGCSSolver_PointArrayWrapper>;
 
 #endif
index d864f88aa4a6b4b2f96519831eee2514ada04741..acf68f7ead967551971b951a976a0dc779913013 100644 (file)
@@ -292,10 +292,9 @@ void PlaneGCSSolver_Solver::getFreeParameters(GCS::SET_pD &theFreeParams) {
   } anEqualParams;
 
   for (auto &myConstraint : myConstraints)
-    for (auto aCIt = myConstraint.second.begin();
-         aCIt != myConstraint.second.end(); ++aCIt) {
-      if ((*aCIt)->getTypeId() == GCS::Equal)
-        anEqualParams.add((*aCIt)->params()[0], (*aCIt)->params()[1]);
+    for (auto &aCIt : myConstraint.second) {
+      if (aCIt->getTypeId() == GCS::Equal)
+        anEqualParams.add(aCIt->params()[0], aCIt->params()[1]);
     }
 
   GCS::SET_pD aFreeParamsCopy = theFreeParams;
index 41f7f0837e74a904e6781e268617012d88cfc202..15da9d552d358fdbd57fee79aff5be1e531e504c 100644 (file)
@@ -114,7 +114,7 @@ private:
 
   int myDOF{0}; ///< degrees of freedom
 
-  GCS::Constraint *myFictiveConstraint{0};
+  GCS::Constraint *myFictiveConstraint{nullptr};
 };
 
 using SolverPtr = std::shared_ptr<PlaneGCSSolver_Solver>;
index a655c9eb3af0514952139265d87ea2aa074f9be9..355c63f0f3dfb1c3be179c8342b854dd921fa3ea 100644 (file)
@@ -230,7 +230,7 @@ PlaneGCSSolver_Tools::createMovementConstraint(
 }
 
 ConstraintWrapperPtr PlaneGCSSolver_Tools::createConstraint(
-    ConstraintPtr theConstraint, const SketchSolver_ConstraintType &theType,
+    ConstraintPtr /*theConstraint*/, const SketchSolver_ConstraintType &theType,
     const EntityWrapperPtr &theValue, const EntityWrapperPtr &thePoint1,
     const EntityWrapperPtr &thePoint2, const EntityWrapperPtr &theEntity1,
     const EntityWrapperPtr &theEntity2) {
index 681dfbd76240da1b95342892bbe4378e160eb33e..b62f3fd2768e7ce9d0ff312df9aab5eb159e5621 100644 (file)
@@ -55,7 +55,7 @@
 #include <math.h>
 
 SketchSolver_Constraint::SketchSolver_Constraint(ConstraintPtr theConstraint)
-    : myBaseConstraint(theConstraint), myType(CONSTRAINT_UNKNOWN) {}
+    : myBaseConstraint(theConstraint) {}
 
 void SketchSolver_Constraint::process(StoragePtr theStorage,
                                       bool theEvensBlocked) {
index fb46030e1ce05f5e7ecd57f683af4b7b1f6d4c02..de7e6b6339444561caa0738be8c553e71ae0ae61 100644 (file)
@@ -40,7 +40,7 @@
 class SketchSolver_Constraint {
 protected:
   /// Default constructor
-  SketchSolver_Constraint() {}
+  SketchSolver_Constraint() = default;
 
 public:
   /// Constructor based on SketchPlugin constraint
index 0555c63d3f8c307b83c638d05f945a2ff32ddaaf..bc5408632982a501bf3d3fc538a8ca8c5a81303d 100644 (file)
@@ -34,8 +34,8 @@
 
 class SketchSolver_ConstraintDistance;
 class SketchSolver_ConstraintFixedArcRadius;
-typedef std::map<EntityWrapperPtr, std::set<EntityWrapperPtr>>
-    CoincidentPointsMap;
+using CoincidentPointsMap =
+    std::map<EntityWrapperPtr, std::set<EntityWrapperPtr>>;
 
 /** \class   SketchSolver_Storage
  *  \ingroup Plugins
index 64797cb94703f066ee2f23f8079730b285937409..46005ff76a7c7d62c5b6ec63b5dd2c30678b58ac 100644 (file)
@@ -207,7 +207,7 @@ static QString MyImportPartFilter(
 
 //******************************************************
 XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector *theConnector)
-    : QObject(), myModule(nullptr), mySalomeConnector(theConnector) {
+    : QObject(), mySalomeConnector(theConnector) {
   mySelector = new XGUI_SelectionMgr(this);
   myModuleConnector = new XGUI_ModuleConnector(this);
   myOperationMgr = new XGUI_OperationMgr(this, myModuleConnector);
index fe14157fbb1785bd3c71fdfb2e67a0d58ffa9296..26df5c7bee14e1d460f68b68883e205773a07c96 100644 (file)
@@ -581,16 +581,16 @@ private:
   AppElements_MainWindow *myMainWindow; ///< desktop window
 #endif
 
-  ModuleBase_IModule *myModule;            ///< current module
-  XGUI_ErrorMgr *myErrorMgr;               ///< updator of error message
-  XGUI_ObjectsBrowser *myObjectBrowser{0}; ///< data tree widget
+  ModuleBase_IModule *myModule{nullptr};         ///< current module
+  XGUI_ErrorMgr *myErrorMgr;                     ///< updator of error message
+  XGUI_ObjectsBrowser *myObjectBrowser{nullptr}; ///< data tree widget
   XGUI_PropertyPanel *myPropertyPanel{
-      0};                           ///< container of feature attributes widgets
-  XGUI_FacesPanel *myFacesPanel{0}; ///< panel for hide object faces
-  XGUI_SelectionMgr *mySelector;    ///< handler of selection processing
+      nullptr}; ///< container of feature attributes widgets
+  XGUI_FacesPanel *myFacesPanel{nullptr}; ///< panel for hide object faces
+  XGUI_SelectionMgr *mySelector;          ///< handler of selection processing
   XGUI_SelectionActivate
-      *mySelectionActivate;       /// manager of selection activating
-  XGUI_Displayer *myDisplayer{0}; ///< handler of objects display
+      *mySelectionActivate;             /// manager of selection activating
+  XGUI_Displayer *myDisplayer{nullptr}; ///< handler of objects display
   XGUI_OperationMgr
       *myOperationMgr; ///< manager to manipulate through the operations
   XGUI_ActionsMgr *myActionsMgr; ///< manager of workshop actions
@@ -611,7 +611,7 @@ private:
   QIntList myViewerSelMode; ///< selection modes set in the viewer
   Config_DataModelReader *myDataModelXMLReader; ///< XML reader of data model
   XGUI_InspectionPanel *myInspectionPanel{
-      0};                 ///< container of feature attributes widgets
+      nullptr};           ///< container of feature attributes widgets
   QTemporaryDir myTmpDir; ///< a direcory for uncompressed files
 };