]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix obvious warnings
authorArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Tue, 12 May 2020 06:06:12 +0000 (09:06 +0300)
committerArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Tue, 12 May 2020 06:06:12 +0000 (09:06 +0300)
27 files changed:
src/CollectionPlugin/CollectionPlugin_Group.cpp
src/Config/Config_XMLReader.cpp
src/FeaturesAPI/FeaturesAPI_MultiRotation.cpp
src/GeomAlgoAPI/GeomAlgoAPI.i
src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h
src/GeomAlgoAPI/GeomAlgoAPI_swig.h
src/ModelAPI/ModelAPI.i
src/ModuleBase/ModuleBase_ResultPrs.cpp
src/PartSet/PartSet_FieldStepPrs.cpp
src/SketcherPrs/SketcherPrs_SensitivePoint.cpp
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp
src/XAO/XAO_BooleanStep.cxx
src/XAO/XAO_DoubleStep.cxx
src/XAO/XAO_DoubleStep.hxx
src/XAO/XAO_Exception.hxx
src/XAO/XAO_Field.hxx
src/XAO/XAO_Group.hxx
src/XAO/XAO_IntegerStep.cxx
src/XAO/XAO_StringStep.cxx
src/XAO/XAO_Xao.cxx
src/XAO/XAO_XaoExporter.cxx
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_MenuGroup.h
src/XGUI/XGUI_MenuWorkbench.h
src/XGUI/XGUI_Selection.cpp
src/XGUI/XGUI_SelectionActivate.cpp
src/XGUI/XGUI_SelectionMgr.cpp

index 4252a1f808f903ce5b8f0ec07391c4d298be02b2..2a083360ea5270ebf1b52a2b4591e70f49068dca 100644 (file)
@@ -137,7 +137,7 @@ bool CollectionPlugin_Group::customAction(const std::string& theActionId)
           }
           aFathers[anAttr->contextObject()] = anObj;
           if (aFatherGroup.find(anObj) == aFatherGroup.end()) {
-            int aSize = aFatherGroup.size();
+            int aSize = (int)aFatherGroup.size();
             aFatherGroup[anObj] = aSize; // the first is zero
           }
         }
index d6691f9981bf5e57f19585fa59c111dcdbda1dee..8f15e0f255eeccec4d11ac16e1b29045ad75932b 100644 (file)
@@ -161,7 +161,7 @@ std::string Config_XMLReader::findConfigFile(const std::string theFileName, cons
 void Config_XMLReader::readAll()
 {
   if (isFromMemory) {
-    myXmlDoc = xmlParseMemory(myRootFileName.c_str(), myRootFileName.length());
+    myXmlDoc = xmlParseMemory(myRootFileName.c_str(), (int)myRootFileName.length());
     xmlNodePtr aRoot = xmlDocGetRootElement(myXmlDoc);
     readRecursively(aRoot);
     return;
index 2263fda4a4af01cca67a5fc57ce8a7e0a17e9775..86558686c73f02f3f6aec8e8222918b8df10b604 100644 (file)
@@ -161,7 +161,7 @@ MultiRotationPtr addMultiRotation(const std::shared_ptr<ModelAPI_Document>& theP
     aStepValAsStr << aStepVal;
 
     ModelHighAPI_Integer aNumber = aStepStr == aStepValAsStr.str()
-                                 ? ModelHighAPI_Integer(aStepVal)
+                                 ? ModelHighAPI_Integer((int)aStepVal)
                                  : ModelHighAPI_Integer(aStepStr);
     aResult.reset(new FeaturesAPI_MultiRotation(aFeature, theMainObjects, theAxis, aNumber));
   }
index fc09e5669a5ad15326da447e216b0ce86e6681b8..04a925704af825305adc8c64cf1f9b27751cdb0f 100644 (file)
@@ -71,6 +71,7 @@
 %include "GeomAlgoAPI_MakeShapeCustom.h"
 %include "GeomAlgoAPI_MakeShapeList.h"
 %include "GeomAlgoAPI_MakeSweep.h"
+%include "GeomAlgoAPI_Transform.h"
 %include "GeomAlgoAPI_Translation.h"
 %include "GeomAlgoAPI_Placement.h"
 %include "GeomAlgoAPI_PointBuilder.h"
@@ -86,7 +87,6 @@
 %include "GeomAlgoAPI_IGESImport.h"
 %include "GeomAlgoAPI_STEPImport.h"
 %include "GeomAlgoAPI_Tools.h"
-%include "GeomAlgoAPI_Transform.h"
 %include "GeomAlgoAPI_PaveFiller.h"
 %include "GeomAlgoAPI_Intersection.h"
 %include "GeomAlgoAPI_Pipe.h"
index 5b4d9edff852dce00a215ded8ed8ee75b8e05b88..145abb5d6fa8dce212113d117abbeafcb7eb2a53 100644 (file)
 
 #include <GeomAlgoAPI_Exception.h>
 
+#ifdef WIN32
+#pragma warning(disable : 4290)
+#endif
+
 namespace GeomAlgoAPI_ShapeAPI
 {
 /**\class GeomAlgoAPI_ShapeAPI
index c40d9211f661a2ce5b89a63d807892ef01e5ece5..f35a402f0f16b8f6c8b1c974a6550deeb5a9cb32 100644 (file)
@@ -34,6 +34,7 @@
   #include "GeomAlgoAPI_MakeShapeCustom.h"
   #include "GeomAlgoAPI_MakeShapeList.h"
   #include "GeomAlgoAPI_MakeSweep.h"
+  #include "GeomAlgoAPI_Transform.h"
   #include "GeomAlgoAPI_Translation.h"
   #include "GeomAlgoAPI_Placement.h"
   #include "GeomAlgoAPI_PointBuilder.h"
@@ -49,7 +50,6 @@
   #include "GeomAlgoAPI_IGESImport.h"
   #include "GeomAlgoAPI_STEPImport.h"
   #include "GeomAlgoAPI_Tools.h"
-  #include "GeomAlgoAPI_Transform.h"
   #include "GeomAlgoAPI_PaveFiller.h"
   #include "GeomAlgoAPI_Intersection.h"
   #include "GeomAlgoAPI_Pipe.h"
index ca786a2a6fb0a7cac7ad45aff0c66110c33ec894..de2ef30856697eaf683c4af0debd4adac0c134d2 100644 (file)
@@ -97,7 +97,6 @@
 %shared_ptr(ModelAPI_ResultField)
 %shared_ptr(ModelAPI_ResultParameter)
 %shared_ptr(ModelAPI_ResultCompSolid)
-%shared_ptr(ModelAPI_ObjectUpdatedMessage)
 
 %typecheck(SWIG_TYPECHECK_POINTER) const ModelAPI_AttributeTables::Value {
   $1 = (PyFloat_Check($input) || PyLong_Check($input) || PyUnicode_Check($input) || PyBool_Check($input)) ? 1 : 0;
index d6ad4c336b50ed778d69649601f916393bf9db51..7d15974a3dcfdc17bd2827b8c26dd9a364952eff 100644 (file)
@@ -413,7 +413,7 @@ void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& a
       Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value();
       Handle(SelectBasics_EntityOwner) aBasicsOwner = anEntity->BaseSensitive()->OwnerId();
       if (!aBasicsOwner.IsNull())
-        aBasicsOwner->Set(aBasicsOwner->Priority() + myAdditionalSelectionPriority);
+        aBasicsOwner->SetPriority(aBasicsOwner->Priority() + myAdditionalSelectionPriority);
     }
   }
 }
@@ -441,10 +441,8 @@ bool ModuleBase_ResultPrs::appendVertexSelection(const Handle(SelectMgr_Selectio
         anIt.More();
         anIt.Next()) {
       Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value();
-      Handle(SelectMgr_EntityOwner) anOwner =
-        Handle(SelectMgr_EntityOwner)
-        ::DownCast(anEntity->BaseSensitive()->OwnerId());
-      anOwner->Set(this);
+      Handle(SelectMgr_EntityOwner) anOwner = anEntity->BaseSensitive()->OwnerId();
+      anOwner->SetSelectable(this);
     }
 
     return true;
index eb28e287299fb1f5b60241286b71437cd5b42fdf..4d3ed48eec3c18b4388068c6b7571c0883fdaa4a 100644 (file)
@@ -38,6 +38,7 @@
 #include <TopoDS_Vertex.hxx>
 #include <TopExp_Explorer.hxx>
 #include <Prs3d_Root.hxx>
+#include <Graphic3d_Text.hxx>
 
 
 IMPLEMENT_STANDARD_RTTIEXT(PartSet_FieldStepPrs, ViewerData_AISShape);
@@ -221,8 +222,6 @@ void PartSet_FieldStepPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t
       TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
       gp_Pnt aCenter;
       if (computeMassCenter(aShape, aCenter)) {
-        Graphic3d_Vertex aVertex(aCenter.X(), aCenter.Y(), aCenter.Z());
-
         Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d();
         anAspectText3d->SetStyle(Aspect_TOST_ANNOTATION);
         anAspectText3d->SetColor(aLabelColor);
@@ -230,7 +229,10 @@ void PartSet_FieldStepPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t
 
         int aT = aResMgr->integerValue("Viewer", "scalar_bar_text_height", 14);
         QString aString = aValues.at(i);
-        aGroup->Text(aString.toUtf8().constData(), aVertex, aT);
+        Handle(Graphic3d_Text) aText = new Graphic3d_Text(aT);
+        aText->SetText(aString.toUtf8().constData());
+        aText->SetPosition(aCenter);
+        aGroup->AddText(aText);
       }
     }
   }
index 2d8f18c9c2bed1ca7bbfd533c8038a7e2ba3290d..1d19616fb486242a2b9450c086ca5eb3a76ad0cd 100644 (file)
@@ -60,8 +60,7 @@ Standard_Boolean SketcherPrs_SensitivePoint::Matches(SelectBasics_SelectingVolum
 
 gp_Pnt SketcherPrs_SensitivePoint::Point() const
 {
-  const Handle(SelectMgr_EntityOwner)& anOwner =
-    Handle(SelectMgr_EntityOwner)::DownCast(OwnerId());
+  const Handle(SelectMgr_EntityOwner)& anOwner = OwnerId();
   const Handle(SketcherPrs_SymbolPrs)& aSymbPrs =
     Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable());
   return aSymbPrs->pointsArray()->Vertice(myId);
@@ -76,8 +75,7 @@ Handle(Select3D_SensitiveEntity) SketcherPrs_SensitivePoint::GetConnected()
 gp_Pnt SketcherPrs_SensitivePoint::CenterOfGeometry() const
 {
 #ifdef DEBUG_SENSITIVE_TO_BE_CORRECTED
-  const Handle(SelectMgr_EntityOwner)& anOwner =
-    Handle(SelectMgr_EntityOwner)::DownCast(OwnerId());
+  const Handle(SelectMgr_EntityOwner)& anOwner = OwnerId();
   const Handle(SketcherPrs_SymbolPrs)& aSymbPrs =
     Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable());
   if (aSymbPrs->pointsArray()->VertexNumber() < myId)
@@ -89,8 +87,7 @@ gp_Pnt SketcherPrs_SensitivePoint::CenterOfGeometry() const
 Select3D_BndBox3d SketcherPrs_SensitivePoint::BoundingBox()
 {
 #ifdef DEBUG_SENSITIVE_TO_BE_CORRECTED
-  const Handle(SelectMgr_EntityOwner)& anOwner =
-    Handle(SelectMgr_EntityOwner)::DownCast(OwnerId());
+  const Handle(SelectMgr_EntityOwner)& anOwner = OwnerId();
   const Handle(SketcherPrs_SymbolPrs)& aSymbPrs =
     Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable());
   if (aSymbPrs->pointsArray()->VertexNumber() < myId)
index b35b7acfafd2b60cbce9dd8655c6e9753e1d5a4d..465633f921b5155e0db5e53fc4918f32386863c5 100644 (file)
@@ -185,7 +185,8 @@ Handle(Image_AlienPixMap) SketcherPrs_SymbolPrs::icon()
       aSizedMap->InitTrash(aPixMap->Format(), aWidth, aHeigh);
       for (Standard_Size i = 0; i < aWidth; i++) {
         for (Standard_Size j = 0; j < aHeigh; j++) {
-          aSizedMap->SetPixelColor(int(i), int(j), aPixMap->PixelColor(i / aRatio, j / aRatio));
+          aSizedMap->SetPixelColor(int(i), int(j),
+              aPixMap->PixelColor(int(i / aRatio), int(j / aRatio)));
         }
       }
       aPixMap = aSizedMap;
index d32680ec148e926ccddc23ece24c868b5540585b..46b75ae69a5c7b99eafeebfab8ec1fc6f912b040 100644 (file)
@@ -116,7 +116,7 @@ void BooleanStep::setElement(const int& element, const std::vector<bool>& elemen
 throw (XAO_Exception)
 {
     checkElementIndex(element);
-    checkNbComponents(elements.size());
+    checkNbComponents((int)elements.size());
 
     for (int i = 0; i < m_nbComponents; ++i)
         m_values[element][i] = elements[i];
@@ -126,7 +126,7 @@ void BooleanStep::setComponent(const int& component, const std::vector<bool>& co
 throw (XAO_Exception)
 {
     checkComponentIndex(component);
-    checkNbElements(components.size());
+    checkNbElements((int)components.size());
 
     for (int i = 0; i < m_nbElements; ++i)
         m_values[i][component] = components[i];
index d3205efba75ee4e3bb1c962ef7999228ef0b5f05..78715532048f29fe7f73aebe894584cfea042f21 100644 (file)
@@ -101,7 +101,7 @@ throw (XAO_Exception)
 void DoubleStep::setValues(const std::vector<double>& values)
 throw (XAO_Exception)
 {
-    checkNbValues(values.size());
+    checkNbValues((int)values.size());
 
     for (int i = 0; i < m_nbElements; ++i)
     {
@@ -116,7 +116,7 @@ void DoubleStep::setElement(const int& element, const std::vector<double>& eleme
 throw (XAO_Exception)
 {
     checkElementIndex(element);
-    checkNbComponents(elements.size());
+    checkNbComponents((int)elements.size());
 
     for (int i = 0; i < m_nbComponents; ++i)
         m_values[element][i] = elements[i];
@@ -126,7 +126,7 @@ void DoubleStep::setComponent(const int& component, const std::vector<double>& c
 throw (XAO_Exception)
 {
     checkElementIndex(component);
-    checkNbElements(components.size());
+    checkNbElements((int)components.size());
 
     for (int i = 0; i < m_nbElements; ++i)
         m_values[i][component] = components[i];
index a193598a1ab97ba3c285b42be6d3df78dc04a584..18cb9c07307bbb5a40081dcc8715be54cf3c31a0 100644 (file)
@@ -28,6 +28,7 @@
 #include "XAO_Step.hxx"
 
 #ifdef WIN32
+#pragma warning(disable:4251) // std::vector needs dll-interface
 #pragma warning(disable:4290) // Warning Exception ...
 #endif
 
index f926660fe2b007748685e8a3c6e600cba58ddde0..3c99bb7a5f6b84bc26ec552d13fddbe8d9ae144d 100644 (file)
 #include "XAO.hxx"
 #include <exception>
 
+#ifdef WIN32
+#pragma warning(disable : 4275) // for std::exception
+#endif
+
 namespace XAO
 {
     /**
index 0446d56941e5e8c3e1b6ad272a367c47f419e46c..22cd0ae09188367c5bae9eb71056ab87a3ca526e 100644 (file)
@@ -139,7 +139,7 @@ namespace XAO
          * Gets the number of the steps.
          * @return the number of steps.
          */
-        const int countSteps() const { return m_steps.size(); }
+        const int countSteps() const { return (int)m_steps.size(); }
 
         /**
          * Gets the name of a component.
index 92ca7596b426e0c4ec4555017699d737bec89936..c0279d2d69b8f84c8caad0ea525551b1fb9e5a90 100644 (file)
@@ -93,7 +93,7 @@ namespace XAO
          */
         const int count() const
         {
-            return m_elements.size();
+            return (int)m_elements.size();
         }
 
         /**
index 81e2ed53d3ce5435c41aa89a0f3b32d54eea9d16..67a377034d011eae257507c6694fba64d2d5efae 100644 (file)
@@ -101,7 +101,7 @@ throw (XAO_Exception)
 void IntegerStep::setValues(const std::vector<int>& values)
 throw (XAO_Exception)
 {
-    checkNbValues(values.size());
+    checkNbValues((int)values.size());
 
     for (int i = 0; i < m_nbElements; ++i)
     {
@@ -116,7 +116,7 @@ void IntegerStep::setElement(const int& element, const std::vector<int>& element
 throw (XAO_Exception)
 {
     checkElementIndex(element);
-    checkNbComponents(elements.size());
+    checkNbComponents((int)elements.size());
 
     for (int i = 0; i < m_nbComponents; ++i)
         m_values[element][i] = elements[i];
@@ -126,7 +126,7 @@ void IntegerStep::setComponent(const int& component, const std::vector<int>& com
 throw (XAO_Exception)
 {
     checkElementIndex(component);
-    checkNbElements(components.size());
+    checkNbElements((int)components.size());
 
     for (int i = 0; i < m_nbElements; ++i)
         m_values[i][component] = components[i];
index 545f493ce0d59decc24b8e1ac42c04d597dd3bb1..e1a5915ce56aa29acdca456632578faa7ca4e5c3 100644 (file)
@@ -100,7 +100,7 @@ throw (XAO_Exception)
 void StringStep::setValues(const std::vector<std::string>& values)
 throw (XAO_Exception)
 {
-    checkNbValues(values.size());
+    checkNbValues((int)values.size());
 
     for (int i = 0; i < m_nbElements; ++i)
     {
@@ -115,7 +115,7 @@ void StringStep::setElement(const int& element, const std::vector<std::string>&
 throw (XAO_Exception)
 {
     checkElementIndex(element);
-    checkNbComponents(elements.size());
+    checkNbComponents((int)elements.size());
 
     for (int i = 0; i < m_nbComponents; ++i)
         m_values[element][i] = elements[i];
@@ -125,7 +125,7 @@ void StringStep::setComponent(const int& component, const std::vector<std::strin
 throw (XAO_Exception)
 {
     checkElementIndex(component);
-    checkNbElements(components.size());
+    checkNbElements((int)components.size());
 
     for (int i = 0; i < m_nbElements; ++i)
         m_values[i][component] = components[i];
index 5d5dad8c82f85cb208f478b03314c72c34fc660a..3fb767f06c12c92e07a5d4770f8c1983a2277929 100644 (file)
@@ -71,7 +71,7 @@ Xao::~Xao()
 
 const int Xao::countGroups() const
 {
-    return m_groups.size();
+    return (int)m_groups.size();
 }
 
 Group* Xao::getGroup(const int& index)
@@ -117,7 +117,7 @@ bool Xao::removeGroup(Group* group)
 
 const int Xao::countFields() const
 {
-    return m_fields.size();
+    return (int)m_fields.size();
 }
 
 const XAO::Type Xao::getFieldType(const int& index)
index 6aa80408f6fef059d303b58a2e988fc529f62c9c..cf06cc22637e0dd014480f772aa9560c09eb5524 100644 (file)
@@ -222,7 +222,7 @@ namespace {
     {
         // export the shape in the XAO file
         std::string txtShape = xaoGeometry->getShapeString();
-        xmlNodePtr cdata = xmlNewCDataBlock(doc, BAD_CAST txtShape.c_str(), txtShape.size());
+        xmlNodePtr cdata = xmlNewCDataBlock(doc, BAD_CAST txtShape.c_str(), (int)txtShape.size());
         xmlAddChild(shape, cdata);
     }
     else
index 052bdcdf94b5b96e12db72c23036c8d3eebbbea7..30a297eebe95eb2b7bcc75b302aa3503b2c5136f 100644 (file)
@@ -1099,7 +1099,7 @@ void XGUI_Displayer::AddOrRemoveSelectedShapes(Handle(AIS_InteractiveContext) th
   /// OCCT: to write about the problem that active owners method returns one owner several times
   QList<size_t> aSelectedIds; // Remember of selected address in order to avoid duplicates
   for (; anOwnersIt.More(); anOwnersIt.Next()) {
-    anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value());
+    anOwner = anOwnersIt.Value();
     if (aSelectedIds.contains((size_t)anOwner.get()))
       continue;
     aSelectedIds.append((size_t)anOwner.get());
index 47459b1896e1127813324ecf0361701bcdc681e2..b498a4cca4dfa36532ab502b973102ea715dec09 100644 (file)
 #include <list>
 #include <memory>
 
+#ifdef WIN32
+#pragma warning(disable : 4251) // std::string needs dll-interface
+#endif
+
 class Config_FeatureMessage;
 
 /**
index 1ed20741b526d38c9cd975f723df98033687cfa9..fdb902398caa5fcdbcb95fdd14a9bef707bd2c82 100644 (file)
 #include <list>
 #include <memory>
 
+#ifdef WIN32
+#pragma warning(disable : 4251) // std::string needs dll-interface
+#endif
+
 class XGUI_MenuGroup;
 
 /**
index 800140a528f9834f3499f05e542dc7c5fdc8737a..6f86809b230ae794d6855641c488a5aa5d25485b 100644 (file)
@@ -453,8 +453,7 @@ void XGUI_Selection::entityOwners(const Handle(AIS_InteractiveObject)& theObject
       Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value();
       if (anEntity.IsNull())
         continue;
-       Handle(SelectMgr_EntityOwner) anOwner =
-        Handle(SelectMgr_EntityOwner)::DownCast(anEntity->BaseSensitive()->OwnerId());
+       Handle(SelectMgr_EntityOwner) anOwner = anEntity->BaseSensitive()->OwnerId();
       if (!anOwner.IsNull())
         theOwners.Add(anOwner);
     }
index 111656625cbba500c0203ccfbcb4619086e1f7e3..6b3547f8dc997c4a7e711747be510e2005b82354 100644 (file)
@@ -446,7 +446,7 @@ bool XGUI_SelectionActivate::activate(const Handle(AIS_InteractiveObject)& theIO
 
   // loading the interactive object allowing the decomposition
   if (aTColModes.IsEmpty() || !aHasValidMode) {
-    aContext->Load(theIO, -1, true);
+    aContext->Load(theIO);
     Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(theIO);
     if (!aTrihedron.IsNull()) {
       // Workaround for Trihedron. It should be loaded using the next Load method to
index d7bebf7280d58750df5f264b48b4b475af9a6f08..d10d87c0fa6f1613f84d77e32b8a916ffb7c988d 100644 (file)
@@ -173,7 +173,7 @@ void XGUI_SelectionMgr::deselectPresentation(const Handle(AIS_InteractiveObject)
   NCollection_List<Handle(SelectBasics_EntityOwner)>::Iterator anOwnersIt (aResultOwners);
   Handle(SelectMgr_EntityOwner) anOwner;
   for (; anOwnersIt.More(); anOwnersIt.Next()) {
-    anOwner = Handle(SelectMgr_EntityOwner)::DownCast(anOwnersIt.Value());
+    anOwner = anOwnersIt.Value();
     if (!anOwner.IsNull())
       aContext->AddOrRemoveSelected(anOwner, false);
   }