]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make sources compilable under CentOS
authorSergey BELASH <belash.sergey@opencascade.com>
Mon, 27 Oct 2014 14:22:57 +0000 (17:22 +0300)
committerSergey BELASH <belash.sergey@opencascade.com>
Mon, 27 Oct 2014 14:22:57 +0000 (17:22 +0300)
src/Model/Model_AttributeSelection.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/PartSet/PartSet_OperationFeatureEditMulti.cpp
src/PartSet/PartSet_OperationFeatureEditMulti.h
src/XGUI/XGUI_Preferences.cpp

index 3d351d4132510f01df693dce50be930c92649ee6..fd363ae413821d02fcfa350b68e2a6c2fac68c7a 100644 (file)
@@ -13,6 +13,7 @@
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_Wire.h>
 #include <GeomAlgoAPI_SketchBuilder.h>
+#include <Events_Error.h>
 
 #include <TNaming_Selector.hxx>
 #include <TNaming_NamedShape.hxx>
@@ -191,10 +192,12 @@ void Model_AttributeSelection::selectBody(
     aContext = aBody->shape()->impl<TopoDS_Shape>();
   else {
     ResultConstructionPtr aConstr = boost::dynamic_pointer_cast<ModelAPI_ResultConstruction>(myRef.value());
-    if (aConstr)
+    if (aConstr) {
       aContext = aConstr->shape()->impl<TopoDS_Shape>();
-    else
-      throw std::invalid_argument("a result with shape is expected");
+    } else {
+      Events_Error::send("A result with shape is expected");
+      return;
+    }
   }
   aSel.Select(aNewShape, aContext);
 }
index 1de73631a75a822059f694ee04595d6f7d59c3e3..d7518ef6098d73f87483810815450ddebb11fba7 100644 (file)
@@ -46,8 +46,7 @@
 #include <boost/smart_ptr/shared_ptr.hpp>
 
 #include <list>
-#include <stdexcept>
-#include <xstring>
+#include <string>
 
 typedef QMap<QString, TopAbs_ShapeEnum> ShapeTypes;
 static ShapeTypes MyShapeTypes;
index 9c98058604b8920cdbbb412820ecefd43d5b126c..7be21c613875411547a41c30fd7bcded3f536c6f 100644 (file)
 
 #include <V3d_View.hxx>
 
+#include <QMouseEvent>
 #ifdef _DEBUG
 #include <QDebug>
 #endif
 
-#include <QMouseEvent>
-
-using namespace std;
+//using namespace std;
 
 PartSet_OperationFeatureEditMulti::PartSet_OperationFeatureEditMulti(const QString& theId,
                                                                      QObject* theParent,
@@ -80,17 +79,16 @@ void PartSet_OperationFeatureEditMulti::initSelection(
   //} else
   myFeatures = theSelected;
   // add highlighted elements if they are not selected
-  std::list<ModuleBase_ViewerPrs>::const_iterator anIt;
-  for (anIt = theHighlighted.cbegin(); anIt != theHighlighted.cend(); ++anIt) {
+  std::list<ModuleBase_ViewerPrs>::const_iterator anIt = theHighlighted.cbegin();
+  for ( ; anIt != theHighlighted.cend(); ++anIt) {
     if (!isContains(myFeatures, (*anIt)))
       myFeatures.push_back(*anIt);
   }
   // Remove current feature if it is in the list (it will be moved as main feature)
-  FeaturePtr aFea = feature();
-  for (anIt = myFeatures.cbegin(); anIt != myFeatures.cend(); ++anIt) {
-    FeaturePtr aF = ModelAPI_Feature::feature((*anIt).object());
-    if (ModelAPI_Feature::feature((*anIt).object()) == feature()) {
-      myFeatures.erase(anIt);
+  std::list<ModuleBase_ViewerPrs>::iterator anEraseIt = myFeatures.begin();
+  for ( ; anEraseIt != myFeatures.end(); ++anEraseIt) {
+    if (ModelAPI_Feature::feature((*anEraseIt).object()) == feature()) {
+      myFeatures.erase(anEraseIt);
       break;
     }
   }
index 44de5817bc6325261866f36df5e15fde4ab8a24f..1008f3deb34b39173b6bb64b1da76675fe8ae9ea 100644 (file)
@@ -10,6 +10,8 @@
 #include <PartSet_OperationSketchBase.h>
 #include <QObject>
 
+#include <list>
+
 class QMouseEvent;
 
 /*!
index 8f7b3059a79fadf2d4ca40cf26d94373ed49a1a1..4d91ceb34f95f03fff27d739069b10f19ec2c060 100644 (file)
@@ -270,11 +270,12 @@ void XGUI_PreferencesDlg::modified(XGUI_Prefs& theModified) const
 void XGUI_PreferencesDlg::onDefault()
 {
   // reset main resources
-  QtxResourceMgr::WorkingMode aPrev = myPreferences->resourceMgr()->setWorkingMode
-                                               (QtxResourceMgr::IgnoreUserValues);
+#ifdef WIN32
+  QtxResourceMgr::WorkingMode aPrev =
+      myPreferences->resourceMgr()->setWorkingMode(QtxResourceMgr::IgnoreUserValues);
   myPreferences->retrieve();
   myPreferences->resourceMgr()->setWorkingMode(aPrev);
-
+#endif
   // reset plugin's resources
   XGUI_Preferences::resetConfig();
   XGUI_Preferences::updateResourcesByConfig();