Salome HOME
Merge branch 'BR_coding_rules'
authorazv <azv@opencascade.com>
Thu, 1 Dec 2016 07:12:00 +0000 (10:12 +0300)
committerazv <azv@opencascade.com>
Thu, 1 Dec 2016 07:12:00 +0000 (10:12 +0300)
29 files changed:
.gitattributes [new file with mode: 0644]
CMakeLists.txt
CPPLINT.cfg [new file with mode: 0644]
GitHooks/pre-commit.in [new file with mode: 0644]
checkCodingStyle.sh [new file with mode: 0755]
cpplint.cfg [deleted file]
env_linux.sh
findEndLines.sh
src/CollectionPlugin/CollectionPlugin_Group.cpp
src/CollectionPlugin/CollectionPlugin_WidgetCreator.cpp
src/CollectionPlugin/CollectionPlugin_WidgetField.cpp
src/CollectionPlugin/CollectionPlugin_WidgetField.h
src/Events/Events_Loop.cpp
src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/FeaturesPlugin/FeaturesPlugin_Placement.cpp
src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp
src/InitializationPlugin/InitializationPlugin_PyInterp.cpp
src/Model/Model_AttributeSelection.cpp
src/Model/Model_AttributeStringArray.cpp
src/Model/Model_AttributeTables.cpp
src/Model/Model_AttributeTables.h
src/Model/Model_ResultField.cpp
src/Model/Model_SelectionNaming.cpp
src/ModelAPI/ModelAPI_AttributeTables.h
src/ModelAPI/ModelAPI_Events.cpp
src/ModelHighAPI/ModelHighAPI_Tools.cpp
src/ModelHighAPI/ModelHighAPI_Tools.h
src/ParametersPlugin/ParametersPlugin_EvalListener.cpp
src/PartSet/PartSet_MenuMgr.cpp

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..daafb86
--- /dev/null
@@ -0,0 +1,46 @@
+.gitattributes eol=lf
+.gitignore  eol=lf
+*.txt       eol=lf
+*.in        eol=lf
+*.h         eol=lf
+*.c         eol=lf
+*.inl       eol=lf
+*.cpp       eol=lf
+*.cxx       eol=lf
+*.hxx       eol=lf
+*.cls       eol=lf
+*.sty       eol=lf
+*.tex       eol=lf
+*.m         eol=lf
+*.sh        eol=lf
+*.csh       eol=lf
+*.workspace eol=lf
+*.cbp       eol=lf
+*.svg       eol=lf
+*.dia       eol=lf
+*.xib       eol=lf
+*.plist     eol=lf
+*.java      eol=lf
+*.ts        eol=lf
+*.qml       eol=lf
+*.qrc       eol=lf
+*.bat       eol=crlf
+*.cmd       eol=crlf
+*.dll       binary
+*.so        binary
+*.dylib     binary
+*.7z        binary
+*.pdf       binary
+*.png       binary
+*.jpg       binary
+*.bmp       binary
+*.gif       binary
+*.xwd       binary
+*.ico       binary
+*.icns      binary
+*.std       binary
+*.gz        binary
+*.doc       binary
+*.rgb       binary
+*.mft       binary
+*.stl       binary
index 561697239a975485863f04c2e8cd79cb191a7411..3cd0e3bf0baa92985e4e8444bbf7662aea0a652c 100644 (file)
@@ -115,3 +115,9 @@ configure_file("${CMAKE_SOURCE_DIR}/CMakeCommon/cmake_uninstall.cmake.in"
 add_custom_target(uninstall
                   COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
 endif (CMAKE_GENERATOR MATCHES "NMake Makefiles")
+
+# Add special Git hooks
+if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
+  configure_file("${CMAKE_SOURCE_DIR}/GitHooks/pre-commit.in"
+                 "${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit")
+endif()
diff --git a/CPPLINT.cfg b/CPPLINT.cfg
new file mode 100644 (file)
index 0000000..4eaf071
--- /dev/null
@@ -0,0 +1,9 @@
+set noparent
+linelength=100
+filter=-,+whitespace/line_length,+whitespace/end_of_line
+root=src
+
+# whitespace/line_length
+# whitespace/end_of_line
+# whitespace/empty_loop_body
+# readability/multiline_string
diff --git a/GitHooks/pre-commit.in b/GitHooks/pre-commit.in
new file mode 100644 (file)
index 0000000..52e778f
--- /dev/null
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+function isDOSFile
+{
+  local FILENAME="$1"
+  file "$FILENAME" | grep -q "CRLF line terminators"
+}
+
+if git rev-parse --verify HEAD >/dev/null 2>&1
+then
+  against=HEAD
+else
+  # Initial commit: diff against an empty tree object
+  against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+fi
+
+# If you want to allow non-ASCII filenames set this variable to true.
+allownonascii=$(git config hooks.allownonascii)
+
+# Redirect output to stderr.
+exec 1>&2
+
+# Cross platform projects tend to avoid non-ASCII filenames; prevent
+# them from being added to the repository. We exploit the fact that the
+# printable range starts at the space character and ends with tilde.
+if [ "$allownonascii" != "true" ] &&
+  # Note that the use of brackets around a tr range is ok here, (it's
+  # even required, for portability to Solaris 10's /usr/bin/tr), since
+  # the square bracket bytes happen to fall in the designated range.
+  test $(git diff --cached --name-only --diff-filter=A -z $against |
+    LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
+then
+  cat <<\EOF
+Error: Attempt to add a non-ASCII file name.
+
+This can cause problems if you want to work with people on other platforms.
+
+To be portable it is advisable to rename the file.
+
+If you know what you are doing you can disable this check using:
+
+  git config hooks.allownonascii true
+EOF
+  exit 1
+fi
+
+FOUND=0
+# If there are whitespace errors, print the offending file names and fail.
+if [ "$(exec git diff-index --check --cached $against -- )" != "" ]
+then
+  FOUND=1
+fi
+
+# Find files with DOS line endings
+for FILE in $(exec git diff --name-only --cached $against -- | sed '/^[+-]/d' | sed -r 's/:[0-9]+:.*//' | uniq) ; do
+  isDOSFile "$FILE"
+  if (( $? == 0 ))
+  then
+    echo "ERROR: \"$FILE\" has DOS line endings" >&2
+    FOUND=1
+  fi
+done
+
+exit $FOUND
diff --git a/checkCodingStyle.sh b/checkCodingStyle.sh
new file mode 100755 (executable)
index 0000000..3bd0a41
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+source env.sh
+
+CPPLINT_ARGS=""
+CPPLINT_ARGS="${CPPLINT_ARGS} --verbose=0"
+CPPLINT_ARGS="${CPPLINT_ARGS} --recursive"
+CPPLINT_ARGS="${CPPLINT_ARGS} --counting=detailed"
+CPPLINT_ARGS="${CPPLINT_ARGS} --extensions=h,cpp"
+CPPLINT_ARGS="${CPPLINT_ARGS} --exclude=src/XAO/* --exclude=src/XAO/tests/*"
+CPPLINT_ARGS="${CPPLINT_ARGS} --output=vs7"
+
+! cpplint.py ${CPPLINT_ARGS} . 2>&1 | grep -v Done
diff --git a/cpplint.cfg b/cpplint.cfg
deleted file mode 100644 (file)
index 30f95d8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-linelength=100
-filter=-,+whitespace/line_length
-root=src
-
-# whitespace/line_length
-# whitespace/end_of_line
-# whitespace/empty_loop_body
-# readability/multiline_string
index 8148a14623f91950419ba7f343308a66afabe0a7..e75fec9c530f14e3a3b15c3aa4d550bc3cc173b0 100644 (file)
@@ -2,7 +2,7 @@
 
 # This script uses:
 #
-# SHAPER_PDIR - path of PRODUCTS for SHAPER (SolveSpace, lcov)
+# SHAPER_PDIR - path of PRODUCTS for SHAPER (SolveSpace, lcov, cpplint)
 # SHAPER_ROOT_DIR - path of SHAPER installation
 
 for path in SHAPER_PDIR SHAPER_ROOT_DIR; do
@@ -36,6 +36,11 @@ export LCOV_ROOT_DIR=${SHAPER_PDIR}/lcov-1.11
 export PATH=${LCOV_ROOT_DIR}/bin:${PATH}
 ##
 
+#------ cpplint ------
+export CPPLINT_ROOT_DIR=${SHAPER_PDIR}/cpplint-1.3.0
+export PATH=${CPPLINT_ROOT_DIR}:${PATH}
+##
+
 #------ OCCT ------
 # Defaults
 export CSF_PluginDefaults=${CAS_ROOT_DIR}/src/StdResource
index b6e51e28224ecdcdbc71f9b70f11073a6ad45b26..eb3c0cc70b06ba0d3859f675a6d0dbc04af9f94f 100755 (executable)
@@ -1,7 +1,33 @@
 #!/bin/bash
 
+FIX_LINE_ENDINGS=0
+while [[ $# > 0 ]]; do
+  key="$1"
+  
+  case $key in
+    fix)
+      FIX_LINE_ENDINGS=1
+      shift
+      ;;
+    *)
+      shift
+      ;;
+  esac
+done
+
+source env.sh
+
 find . \( -name "*.h" -o -name "*.cpp" \) -exec cpplint.py --filter=-,+whitespace/end_of_line  --verbose=0 --counting=detailed {} \+ 2>&1 | grep -v Done | tee ./tofix
 
-python correction_auto_2.py --cpplint_output_file ./tofix
+WRONG=0
+if [ -s ./tofix ]; then
+  if [[ ${FIX_LINE_ENDINGS} == 1 ]]; then
+    python correction_auto_2.py --cpplint_output_file ./tofix
+    echo "NOTE: Line endings are fixed"
+  else
+    WRONG=1
+  fi
+fi
 
-rm ./tofix
\ No newline at end of file
+rm ./tofix
+exit $WRONG
index ede838a3e4829039c78ffb4c84355df3d422df97..dd6e1d302f0c56be4c735c0465e9d204f5506049 100644 (file)
@@ -19,7 +19,7 @@ CollectionPlugin_Group::CollectionPlugin_Group()
 
 void CollectionPlugin_Group::initAttributes()
 {
-  data()->addAttribute(CollectionPlugin_Group::LIST_ID(), 
+  data()->addAttribute(CollectionPlugin_Group::LIST_ID(),
                        ModelAPI_AttributeSelectionList::typeId());
 }
 
index a369cf36e4132313dbdf253d894d4c72b917f639..7b8154b1c773426a3a84845eee52ae0b11ddf905 100644 (file)
@@ -30,7 +30,7 @@ ModuleBase_ModelWidget* CollectionPlugin_WidgetCreator::createWidgetByType(
   if (myPanelTypes.find(theType) == myPanelTypes.end())
     return aWidget;
 
-  if (theType == "field-panel") {     
+  if (theType == "field-panel") {
     aWidget = new CollectionPlugin_WidgetField(theParent, theWorkshop, theWidgetApi);
   }
 
index 7a39b5f7e271fd161bb0bdf35534bac202bb640b..b0113c677a20baf9a6aea55fa84b7f1b51e61139 100644 (file)
@@ -46,17 +46,17 @@ const char* MYFalse = "False";
 class DataTableItemDelegate : public QStyledItemDelegate
 {
 public:
-  DataTableItemDelegate(ModelAPI_AttributeTables::ValueType theType) : 
+  DataTableItemDelegate(ModelAPI_AttributeTables::ValueType theType) :
       QStyledItemDelegate() { myType = theType; }
 
-  virtual QWidget* createEditor(QWidget* theParent, 
-                                const QStyleOptionViewItem & theOption, 
+  virtual QWidget* createEditor(QWidget* theParent,
+                                const QStyleOptionViewItem & theOption,
                                 const QModelIndex& theIndex) const;
 
   ModelAPI_AttributeTables::ValueType dataType() const { return myType; }
 
   void setDataType(ModelAPI_AttributeTables::ValueType theType) { myType = theType; }
-   
+
 signals:
   void startEditing();
 
@@ -64,8 +64,8 @@ private:
   ModelAPI_AttributeTables::ValueType myType;
 };
 
-QWidget* DataTableItemDelegate::createEditor(QWidget* theParent, 
-                                             const QStyleOptionViewItem & theOption, 
+QWidget* DataTableItemDelegate::createEditor(QWidget* theParent,
+                                             const QStyleOptionViewItem & theOption,
                                              const QModelIndex& theIndex ) const
 {
   if ((theIndex.column() == 0) && (theIndex.row() > 0)) {
@@ -77,8 +77,8 @@ QWidget* DataTableItemDelegate::createEditor(QWidget* theParent,
     QLineEdit* aLineEdt = 0;
     switch (myType) {
     case ModelAPI_AttributeTables::DOUBLE:
-      aLineEdt = dynamic_cast<QLineEdit*>(QStyledItemDelegate::createEditor(theParent, 
-                                                                            theOption, 
+      aLineEdt = dynamic_cast<QLineEdit*>(QStyledItemDelegate::createEditor(theParent,
+                                                                            theOption,
                                                                             theIndex));
       if (aLineEdt) {
         aLineEdt->setValidator(new QDoubleValidator(aLineEdt));
@@ -86,15 +86,15 @@ QWidget* DataTableItemDelegate::createEditor(QWidget* theParent,
       }
       break;
     case ModelAPI_AttributeTables::INTEGER:
-      aLineEdt = dynamic_cast<QLineEdit*>(QStyledItemDelegate::createEditor(theParent, 
-                                                                            theOption, 
+      aLineEdt = dynamic_cast<QLineEdit*>(QStyledItemDelegate::createEditor(theParent,
+                                                                            theOption,
                                                                             theIndex));
       if (aLineEdt) {
         aLineEdt->setValidator(new QIntValidator(aLineEdt));
         return aLineEdt;
       }
       break;
-    case ModelAPI_AttributeTables::BOOLEAN: 
+    case ModelAPI_AttributeTables::BOOLEAN:
       {
         QComboBox* aBox = new QComboBox(theParent);
         aBox->addItem(MYFalse);
@@ -112,8 +112,8 @@ QWidget* DataTableItemDelegate::createEditor(QWidget* theParent,
 //**********************************************************************************
 //**********************************************************************************
 CollectionPlugin_WidgetField::
-  CollectionPlugin_WidgetField(QWidget* theParent, 
-                               ModuleBase_IWorkshop* theWorkshop, 
+  CollectionPlugin_WidgetField(QWidget* theParent,
+                               ModuleBase_IWorkshop* theWorkshop,
                                const Config_WidgetAPI* theData):
 ModuleBase_WidgetSelector(theParent, theWorkshop, theData), myHeaderEditor(0),
   myIsEditing(false), myActivation(false)
@@ -129,7 +129,7 @@ ModuleBase_WidgetSelector(theParent, theWorkshop, theData), myHeaderEditor(0),
   // Type of shapes
   myShapeTypeCombo = new QComboBox(aTypesWgt);
   QStringList aShapeTypes;
-  aShapeTypes << tr("Vertices") << tr("Edges") << tr("Faces") 
+  aShapeTypes << tr("Vertices") << tr("Edges") << tr("Faces")
     << tr("Solids") << tr("Objects") << tr("Parts");
   myShapeTypeCombo->addItems(aShapeTypes);
   aTypesLayout->addRow(tr("Type of shapes"), myShapeTypeCombo);
@@ -137,7 +137,7 @@ ModuleBase_WidgetSelector(theParent, theWorkshop, theData), myHeaderEditor(0),
   // Type of field
   myFieldTypeCombo = new QComboBox(aTypesWgt);
   QStringList aFieldTypes;
-  aFieldTypes << tr("Boolean") << tr("Integer") << tr("Double") 
+  aFieldTypes << tr("Boolean") << tr("Integer") << tr("Double")
     << tr("String");
   myFieldTypeCombo->addItems(aFieldTypes);
   myFieldTypeCombo->setCurrentIndex(2);
@@ -320,7 +320,7 @@ bool CollectionPlugin_WidgetField::eventFilter(QObject* theObject, QEvent* theEv
       }
     }
   } else if ((theObject == myHeaderEditor) && (theEvent->type() == QEvent::FocusOut)) {
-    //QHeaderView* aHeader = 
+    //QHeaderView* aHeader =
     //  static_cast<QHeaderView*>(myHeaderEditor->parentWidget()->parentWidget());
     QString aNewTitle = myHeaderEditor->text();
     //save item text
@@ -358,7 +358,7 @@ QTableWidgetItem* CollectionPlugin_WidgetField::createDefaultItem() const
   case ModelAPI_AttributeTables::INTEGER:
     aItem->setText("0");
     break;
-  case ModelAPI_AttributeTables::BOOLEAN: 
+  case ModelAPI_AttributeTables::BOOLEAN:
     aItem->setText(MYFalse);
     break;
   }
@@ -377,10 +377,10 @@ QTableWidgetItem* CollectionPlugin_WidgetField::
   case ModelAPI_AttributeTables::INTEGER:
     aItem->setText(QString::number(theVal.myInt));
     break;
-  case ModelAPI_AttributeTables::BOOLEAN: 
+  case ModelAPI_AttributeTables::BOOLEAN:
     aItem->setText(theVal.myBool? MYTrue : MYFalse);
     break;
-  case ModelAPI_AttributeTables::STRING: 
+  case ModelAPI_AttributeTables::STRING:
     aItem->setText(theVal.myStr.c_str());
   }
   return aItem;
@@ -443,7 +443,7 @@ bool CollectionPlugin_WidgetField::storeValueCustom()
   QTableWidget* aTable = myDataTblList.first();
   int aRows = aTable->rowCount();
   // first column contains selected names which should not be stored
-  int aColumns = aTable->columnCount() - 1; 
+  int aColumns = aTable->columnCount() - 1;
 
   aTablesAttr->setSize(aRows, aColumns, aNbSteps);
   aTablesAttr->setType((ModelAPI_AttributeTables::ValueType)aFldType);
@@ -676,7 +676,7 @@ void CollectionPlugin_WidgetField::onAddStep()
   aTablesAttr->setSize(aTablesAttr->rows(), aTablesAttr->columns(), myDataTblList.size());
 
 
-  AttributeSelectionListPtr aSelList = 
+  AttributeSelectionListPtr aSelList =
     myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID());
   if (!aSelList->isInitialized())
     return;
@@ -755,10 +755,10 @@ void CollectionPlugin_WidgetField::onSelectionChanged()
   if (myShapeTypeCombo->currentIndex() == 5)
     return;
 
-  QList<ModuleBase_ViewerPrsPtr> aSelected = 
+  QList<ModuleBase_ViewerPrsPtr> aSelected =
     myWorkshop->selection()->getSelected(ModuleBase_ISelection::AllControls);
 
-  AttributeSelectionListPtr aSelList = 
+  AttributeSelectionListPtr aSelList =
     myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID());
   aSelList->setSelectionType(getSelectionType(myShapeTypeCombo->currentIndex()));
   aSelList->clear();
@@ -785,7 +785,7 @@ void CollectionPlugin_WidgetField::onSelectionChanged()
   QTableWidgetItem* aItem = 0;
   foreach(QTableWidget* aTable, myDataTblList) {
     aTable->setRowCount(aNewRows);
-    if (aNewRows > aRows) { 
+    if (aNewRows > aRows) {
       // Add new data
       for(int i = 0; i < aColumns; i++) {
         if (i == 0) {
@@ -839,7 +839,7 @@ void CollectionPlugin_WidgetField::onFieldTypeChanged(int theIdx)
                     aTable->item(j, i)->setText("0");
               }
               break;
-            case ModelAPI_AttributeTables::BOOLEAN: 
+            case ModelAPI_AttributeTables::BOOLEAN:
               aTable->item(j, i)->setText(MYFalse);
               break;
             }
@@ -877,7 +877,7 @@ void CollectionPlugin_WidgetField::onShapeTypeChanged(int theType)
 {
   activateSelectionAndFilters(theType == 5? false:true);
 
-  AttributeSelectionListPtr aSelList = 
+  AttributeSelectionListPtr aSelList =
     myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID());
 
   std::string aTypeName = getSelectionType(theType);
index 8466877d84c09a6d20f9d3e070242f20fee2ba3d..14c25fb4b577cf871aec9c246efbb65ebb6f10d2 100644 (file)
@@ -38,8 +38,8 @@ class CollectionPlugin_WidgetField : public ModuleBase_WidgetSelector
 {
  Q_OBJECT
 public:
-  CollectionPlugin_WidgetField(QWidget* theParent, 
-                               ModuleBase_IWorkshop* theWorkshop, 
+  CollectionPlugin_WidgetField(QWidget* theParent,
+                               ModuleBase_IWorkshop* theWorkshop,
                                const Config_WidgetAPI* theData);
 
   virtual ~CollectionPlugin_WidgetField() {}
index cd2e65f92608a33f7c370116a1efd20e88f3dcec..013e0a02d6e9e0952e76a42db5da0c165b2046f9 100644 (file)
@@ -74,7 +74,7 @@ void Events_Loop::send(const std::shared_ptr<Events_Message>& theMessage, bool i
     }
   }
   // send
-  std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID = 
+  std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID =
     myListeners.find(theMessage->eventID().eventText());
   if (aFindID != myListeners.end()) {
     std::map<void*, std::list<Events_Listener*> >::iterator aFindSender = aFindID->second.find(
@@ -98,14 +98,14 @@ void Events_Loop::registerListener(Events_Listener* theListener, const Events_ID
     myImmediateListeners[theID.eventText()] = theListener;
     return;
   }
-  std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID = 
+  std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID =
     myListeners.find(theID.eventText());
   if (aFindID == myListeners.end()) {  // create container associated with ID
     myListeners[theID.eventText()] = std::map<void*, std::list<Events_Listener*> >();
     aFindID = myListeners.find(theID.eventText());
   }
 
-  std::map<void*, std::list<Events_Listener*> >::iterator aFindSender = 
+  std::map<void*, std::list<Events_Listener*> >::iterator aFindSender =
     aFindID->second.find(theSender);
   if (aFindSender == aFindID->second.end()) {  // create container associated with sender
     aFindID->second[theSender] = std::list<Events_Listener*>();
@@ -191,7 +191,7 @@ void Events_Loop::flush(const Events_ID& theID)
       }
     }
     // send accumulated messages to "groupListeners"
-    std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID = 
+    std::map<char*, std::map<void*, std::list<Events_Listener*> > >::iterator aFindID =
       myListeners.find(theID.eventText());
     if (aFindID != myListeners.end()) {
       std::map<void*, std::list<Events_Listener*> >::iterator aFindSender =
index e2bbfa0e5147dacd3e0f9f55fc6ed7d288b0556e..95b47c8699e313513191cda0c552e0669dc217ce 100644 (file)
@@ -229,7 +229,7 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName)
 
     // conversion of dimension
     std::string aSelectionType = aSelectionList->selectionType();
-    std::string aDimensionString = 
+    std::string aDimensionString =
       ExchangePlugin_Tools::selectionType2xaoDimension(aSelectionType);
     XAO::Dimension aGroupDimension = XAO::XaoUtils::stringToDimension(aDimensionString);
 
@@ -263,7 +263,7 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName)
 
     // conversion of dimension
     std::string aSelectionType = aSelectionList->selectionType();
-    std::string aDimensionString = 
+    std::string aDimensionString =
       ExchangePlugin_Tools::selectionType2xaoDimension(aSelectionType);
     XAO::Dimension aFieldDimension = XAO::XaoUtils::stringToDimension(aDimensionString);
     bool isWholePart = aSelectionType == "part";
index 0ffb26ed7a9f3777f2a2ec7266c6e36c498cd83e..c28d769d0e073a8c88b33b3e2d09bb9e427e4c55 100644 (file)
@@ -197,7 +197,7 @@ void FeaturesPlugin_Placement::loadNamingDS(GeomAlgoAPI_Transform& theTransformA
   std::string aPlacedName = "Placed";
   std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theTransformAlgo.mapOfSubShapes();
 
-  FeaturesPlugin_Tools::storeModifiedShapes(theTransformAlgo, theResultBody, 
-                                            theBaseShape, aPlacedTag, aPlacedName, 
+  FeaturesPlugin_Tools::storeModifiedShapes(theTransformAlgo, theResultBody,
+                                            theBaseShape, aPlacedTag, aPlacedName,
                                             *aSubShapes.get());
 }
index 614264603a7f9eb0defbe0a3b4c3f839d090213d..9ba830b83b603144021b4cbe62eee553cd8b3cc6 100755 (executable)
@@ -132,7 +132,7 @@ void FeaturesPlugin_Rotation::loadNamingDS(GeomAlgoAPI_Rotation& theRotaionAlgo,
   std::string aRotatedName = "Rotated";
   std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theRotaionAlgo.mapOfSubShapes();
 
-  FeaturesPlugin_Tools::storeModifiedShapes(theRotaionAlgo, theResultBody, 
-                                            theBaseShape, aRotatedTag, aRotatedName, 
+  FeaturesPlugin_Tools::storeModifiedShapes(theRotaionAlgo, theResultBody,
+                                            theBaseShape, aRotatedTag, aRotatedName,
                                             *aSubShapes.get());
 }
index ac32047ac0d834d2bde0db14016f2caabaef151f..f7f4d9d9b053c162c427a5e0fd928501f269a1da 100644 (file)
@@ -128,7 +128,8 @@ void InitializationPlugin_PyInterp::clearLocalContext()
   PyDict_Clear(_local_context);
 }
 
-double InitializationPlugin_PyInterp::evaluate(const std::string& theExpression, std::string& theError)
+double InitializationPlugin_PyInterp::evaluate(const std::string& theExpression,
+                                               std::string& theError)
 {
   PyLockWrapper lck; // Acquire GIL until the end of the method
   PyCompilerFlags aFlags = {CO_FUTURE_DIVISION};
index e065c1e81f4bdad5c3cf20f7daad244d23fd7e8f..2b3fe9b7850e20c4e765f16612469fe012c8e48a 100644 (file)
@@ -711,7 +711,7 @@ void Model_AttributeSelection::selectBody(
         aFeatureOwner->removeResults(0, false);
     }
     aSel.Select(aNewSub, aNewContext);
+
     if (aEraseResults) { // flash after Select : in Groups it makes selection with shift working
       static Events_Loop* aLoop = Events_Loop::loop();
       static const Events_ID kDeletedEvent = aLoop->eventByName(EVENT_OBJECT_DELETED);
index 82f35c5113be724263ebe4530b5ce006408af5ac..fa997a64dcc74231d1c78eb41c0f820f5c6d9c90 100644 (file)
@@ -17,7 +17,7 @@ int Model_AttributeStringArray::size()
   if (myArray.IsNull() || !myArray->IsValid()) {
     // this could be on undo and then redo creation of the attribute
     // in result creation it may be uninitialized
-    myIsInitialized = 
+    myIsInitialized =
       myLab.FindAttribute(TDataStd_ExtStringArray::GetID(), myArray) == Standard_True;
   }
   // checking the validity because attribute (as a field) may be presented,
index 77930e5a2c6876ae23c3cbfd14c6719dcc50b16b..6bfe82d0709be39714b94ae2e7751edaedb78f05 100644 (file)
@@ -64,10 +64,10 @@ void Model_AttributeTables::setSize(const int theRows, const int theColumns, con
         (myType == ModelAPI_AttributeTables::BOOLEAN) ?
         new TColStd_HArray1OfByte(0, aNewSize - 1) : Handle(TColStd_HArray1OfByte)();
       Handle(TColStd_HArray1OfInteger) anOldInt, aNewInt =
-        (myType == ModelAPI_AttributeTables::INTEGER) ? 
+        (myType == ModelAPI_AttributeTables::INTEGER) ?
         new TColStd_HArray1OfInteger(0, aNewSize - 1) : Handle(TColStd_HArray1OfInteger)();
       Handle(TColStd_HArray1OfExtendedString) anOldStr, aNewStr =
-        (myType == ModelAPI_AttributeTables::STRING) ? 
+        (myType == ModelAPI_AttributeTables::STRING) ?
         new TColStd_HArray1OfExtendedString(0, aNewSize - 1) :
         Handle(TColStd_HArray1OfExtendedString)();
       if (aSize != 0) { // copy the previous values into new positions, otherwise default values
@@ -154,7 +154,7 @@ void Model_AttributeTables::setType(ModelAPI_AttributeTables::ValueType theType)
       myLab.ForgetAttribute(MY_ARRAY_ID(theType));
       myType = theType;
       int aTables = myTables;
-      myTables = 0; // to let setSize know that there is no old array 
+      myTables = 0; // to let setSize know that there is no old array
       setSize(myRows, myCols, aTables);
     } else {
       myType = theType;
index 8752ffa72848a65cfc5ba2675ec22de04466021b..62ac72254dd5e04b16aed60b708a2f77b1332de1 100644 (file)
@@ -22,7 +22,7 @@
 ///
 /// The type of values can be changed. But all the values in the tables must have the same one
 /// type. The currently allowed types now are: Boolean, Integer, Double, String.
-/// By default there is only one table, but it may be increased/decreased by adding/removing 
+/// By default there is only one table, but it may be increased/decreased by adding/removing
 /// tables one by one.
 /// The number of rows and columns are equal in all tables. If table, row or column is added,
 /// the previous values are kept unchanged. New cells are filled by zero, false or empty strings.
index f10fe16af5149947712cb3342fee565672f09768..0c295fd43b264cfb1e5ef17bc6cf95e05d6e1d13 100644 (file)
@@ -45,7 +45,7 @@ std::shared_ptr<GeomAPI_Shape> Model_ResultField::shape()
         for(int a = 0; a < aResults; a++) {
           ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(
             document()->object(ModelAPI_ResultBody::group(), a));
-          if (!aBody.get()) 
+          if (!aBody.get())
             continue;
           // check that only results that were created before this field are used
           FeaturePtr aResultFeature = document()->feature(aBody);
index 47b530460a584018355ca25f5ef3d370cde66884..abaad4b2f1ddd77d6f111c261aad04c044917ef5 100644 (file)
@@ -75,7 +75,7 @@ std::string Model_SelectionNaming::getShapeName(
           TNaming_Iterator anItL(aNS);
           for(int i = 1; anItL.More(); anItL.Next(), i++) {
             // in #1766 IsEqual produced no index of the face
-            if(anItL.NewShape().IsSame(theShape)) { 
+            if(anItL.NewShape().IsSame(theShape)) {
               aName += aPostFix;
               aName += TCollection_AsciiString (i).ToCString();
               break;
index 2534897851eb4e02eacdf67379071a8dd21797ed..072dc2fd0ef5a3018e04a58e812ce971f0e2ff45 100644 (file)
@@ -18,7 +18,7 @@
 ///
 /// The type of values can be changed. But all the values in the tables must have the same one
 /// type. The currently allowed types now are: Boolean, Integer, Double, String.
-/// By default there is only one table, but it may be increased/decreased by adding/removing 
+/// By default there is only one table, but it may be increased/decreased by adding/removing
 /// tables one by one.
 /// The number of rows and columns are equal in all tables. If table, row or column is added,
 /// the previous values are kept unchanged. New cells are filled by zero, false or empty strings.
index 9284b18af686d2fd0833ee1dffd5d7402cf7b5b9..00c74c8df695aa05d9cb04e7f66b4b5712134135 100644 (file)
@@ -166,8 +166,8 @@ bool ModelAPI_ParameterEvalMessage::isProcessed()
   return myIsProcessed;
 }
 
-const std::list<std::shared_ptr<ModelAPI_ResultParameter> >& 
-  ModelAPI_ParameterEvalMessage::params() const 
+const std::list<std::shared_ptr<ModelAPI_ResultParameter> >&
+  ModelAPI_ParameterEvalMessage::params() const
 {
   return myParamsList;
 }
index 119a0a1ebe7419fde56a05551a71a9065197b255..c431fc9b65055b457a9b32e887fed528a742182b 100644 (file)
@@ -211,7 +211,7 @@ void fillAttribute(const std::list<std::string> & theValue,
 
   int anIndex = 0;
   for (auto it = theValue.begin(); it != theValue.end(); ++it, ++anIndex)
-    theAttribute->setValue(anIndex, *it); 
+    theAttribute->setValue(anIndex, *it);
 }
 
 //--------------------------------------------------------------------------------------
index fc59e5edc71d8ae0fb1bac9ae00b8a5e2b4bb4b3..7b58282d5538e7392dc5988c32f60ca72e215697 100644 (file)
@@ -140,10 +140,10 @@ GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr);
 MODELHIGHAPI_EXPORT
 GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection);
 
-MODELHIGHAPI_EXPORT 
+MODELHIGHAPI_EXPORT
 ModelAPI_AttributeTables::ValueType valueTypeByStr(const std::string& theValueTypeStr);
 
-MODELHIGHAPI_EXPORT 
+MODELHIGHAPI_EXPORT
 std::string strByValueType(const ModelAPI_AttributeTables::ValueType theType);
 
 /// Performs the high level API dump, then closes all and executes the script:
index f028edefc8da58e71a7a40f8b35a1ab4aa33d497..0d61bec9ff3aa2e3e0d1a7671bb9c6cbe69b5b89 100644 (file)
@@ -94,7 +94,7 @@ std::string ParametersPlugin_EvalListener::renameInPythonExpression(
   std::string anExpressionString = theExpression;
 
   // ask interpreter to compute the positions in the expression
-  std::shared_ptr<ModelAPI_ComputePositionsMessage> aMsg = 
+  std::shared_ptr<ModelAPI_ComputePositionsMessage> aMsg =
     ModelAPI_ComputePositionsMessage::send(theExpression, theOldName, this);
   const std::list<std::pair<int, int> >& aPositions = aMsg->positions();
 
index 54ada4890bdad4daf3994ef2eb1f2c7aaa13a493..24953f5a600d23f01f8a94773b53016988133b67 100644 (file)
@@ -490,7 +490,7 @@ void PartSet_MenuMgr::activatePartSet() const
   SessionPtr aMgr = ModelAPI_Session::get();
   bool isNewTransaction = !aMgr->isOperation();
   // activation may cause changes in current features in document, so it must be in transaction
-  if (isNewTransaction) 
+  if (isNewTransaction)
     aMgr->startOperation("Activation");
   aMgr->setActiveDocument(aMgr->moduleDocument());
   if (isNewTransaction) aMgr->finishOperation();