]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
patch for correct compilation (Windows)
authorasl <asl@opencascade.com>
Tue, 30 Aug 2016 12:12:26 +0000 (15:12 +0300)
committerasl <asl@opencascade.com>
Tue, 30 Aug 2016 12:12:26 +0000 (15:12 +0300)
CMakeLists.txt
src/HYDROData/HYDROData_Bathymetry.cxx
src/HYDROData/HYDROData_PolylineXY.cxx
src/HYDROData/HYDROData_QuadtreeNode.hxx
src/HYDROData/HYDROData_StreamAltitude.cxx
src/HYDROPy/CMakeLists.txt
src/HYDRO_tests/CMakeLists.txt

index 75b6f19d1fef5f0831b38b34b47778f0b4f9b9fc..54f2273145a6cff65479875f87ac6af09c065bac 100644 (file)
@@ -92,8 +92,9 @@ OPTION(SALOME_BUILD_TESTS "Build HYDRO tests" ON)
 
 # Mandatory products:
 
-FIND_PACKAGE(SalomePythonInterp REQUIRED)
-FIND_PACKAGE(SalomePythonLibs REQUIRED)
+FIND_PACKAGE(SalomePython REQUIRED)
+#FIND_PACKAGE(SalomePythonInterp REQUIRED)
+#FIND_PACKAGE(SalomePythonLibs REQUIRED)
 FIND_PACKAGE(SalomeCAS     REQUIRED)
 FIND_PACKAGE(SalomeVTK     REQUIRED)
 FIND_PACKAGE(SalomeOmniORB REQUIRED)
index 34bd4a21d2c0dff8e6a939c9bbdaf48137852717..c62352ef36f4412e359ef28151d9a45d3c4a92ea 100644 (file)
@@ -342,7 +342,7 @@ bool interpolZtriangle(const gp_XY& point, vtkPolyData* delaunay2D, vtkIdList* t
   double l2  = 1 -l0 -l1;
   //DEBTRACE("l0, l1, l2: " << l0  << " "  << l1  << " "  << l2);
 
-  if ((l0>=0) and (l0<=1) and (l1>=0) and (l1<=1) and (l2>=0) and (l2<=1))
+  if ((l0>=0) && (l0<=1) && (l1>=0) && (l1<=1) && (l2>=0) && (l2<=1))
     {
       z = l0*v[0][2] + l1*v[1][2] + l2*v[2][2];
       return true;
index 3eaa0ad90360092de7db9b7ceb2215f0d03a4776..6013e6538a56a8bb7e1e0850bbb239ed1c24e010 100644 (file)
@@ -500,7 +500,7 @@ bool convertEdgesToSections( const TopoDS_Edge&
               double d1= ProjectPointToCurve(aEndPs[1].XYZ(), adaptorOldCurve,p[1]);
               double d2= ProjectPointToCurve(midPnt.XYZ(), adaptorOldCurve, p[2]);
               DEBTRACE("d0: "<<d0<<" d1: "<<d1<<" d2: "<<d2<<" p0: "<<p[0]<<" p1: "<<p[1]<<" p2: "<<p[2]);
-              if ((d0 < 1.e-3) and (d1 < 1.e-3) and (d2 < 1.e-3)) // we got the good old curve (and the good section)
+              if ((d0 < 1.e-3) && (d1 < 1.e-3) && (d2 < 1.e-3)) // we got the good old curve (and the good section)
                 {
                   double pmin = p[0];
                   double pmax = p[1];
@@ -517,29 +517,29 @@ bool convertEdgesToSections( const TopoDS_Edge&
                     }
                   else // old section closed: check if we use first or last points...
                     {
-                      if((pmin < pmax) and((abs(pmin - pfirst)> 1.e-3) and (abs(pmax - plast) >1.e-3))) // internal points forward
+                      if((pmin < pmax) && ((abs(pmin - pfirst)> 1.e-3) && (abs(pmax - plast) >1.e-3))) // internal points forward
                         forward = true;
-                      else if ((pmin > pmax) and((abs(pmin - plast)> 1.e-3) and (abs(pmax - pfirst) >1.e-3))) // internal points reverse
+                      else if ((pmin > pmax) && ((abs(pmin - plast)> 1.e-3) && (abs(pmax - pfirst) >1.e-3))) // internal points reverse
                         {
                           pmin = p[1];
                           pmax = p[0];
                           forward = false;
                         }
-                      else if ((abs(pmin - plast) <1.e-3) and (p[2] < pmax)) // forward, replace pmin par pfirst
+                      else if ((abs(pmin - plast) <1.e-3) && (p[2] < pmax)) // forward, replace pmin par pfirst
                           pmin = pfirst;
-                      else if ((abs(pmin - plast) <1.e-3) and (p[2] > pmax)) // reverse
+                      else if ((abs(pmin - plast) <1.e-3) && (p[2] > pmax)) // reverse
                         {
                           pmin = p[1];
                           pmax = p[0];
                           forward = false;
                         }
-                      else if ((abs(pmax - pfirst) <1.e-3) and (p[2] < pmin)) // reverse
+                      else if ((abs(pmax - pfirst) <1.e-3) && (p[2] < pmin)) // reverse
                         {
                           pmin = p[1];
                           pmax = p[0];
                           forward = false;
                         }
-                      else if ((abs(pmax - pfirst) <1.e-3) and (p[2] > pmin)) // forward, replace pmax par plast
+                      else if ((abs(pmax - pfirst) <1.e-3) && (p[2] > pmin)) // forward, replace pmax par plast
                         pmax = plast;
                    }
                   DEBTRACE("forward: "<< forward << " pmin " << pmin <<  " pmax " << pmax);
@@ -566,7 +566,7 @@ bool convertEdgesToSections( const TopoDS_Edge&
                         gp_XYZ p(aPoint.X(), aPoint.Y(), 0);
                         double param =-1;
                         double d = ProjectPointToCurve(p, adaptorOldCurve, param);
-                        if ((param > pmin) and (param < pmax))
+                        if ((param > pmin) && (param < pmax))
                           {
                             DEBTRACE("param: " << param);
                             aPointsList.Append(aPoint);
@@ -579,7 +579,7 @@ bool convertEdgesToSections( const TopoDS_Edge&
                         gp_XYZ p(aPoint.X(), aPoint.Y(), 0);
                         double param =-1;
                         double d = ProjectPointToCurve(p, adaptorOldCurve, param);
-                        if ((param > pmin) and (param < pmax))
+                        if ((param > pmin) && (param < pmax))
                           {
                             DEBTRACE("param: " << param);
                             aPointsList.Append(aPoint);
index 6ec99f766b304239616becdb2999f4138eeda902..6ea6f186d7a390e99734cee3ae590b382bdd03c2 100644 (file)
@@ -106,7 +106,7 @@ public:
   bool isEmpty() const { return myChildren == 0; }
 
   inline double getPrecision() {return myPrecision; }
-  inline double setPrecision(double precision)  {myPrecision = precision; }
+  inline void setPrecision(double precision)  {myPrecision = precision; }
 
 protected:
 
index d00d47c846d2dac6ae67b3d78766f27411b9b021..7ab98d3f8a44815301806af7d96009bddded361f 100644 (file)
@@ -126,7 +126,7 @@ bool IsPointBetweenEdges2( const gp_Pnt& aFirstPnt1, const gp_Pnt& aLastPnt1,
   double z1 = x1*ya -xa*y1; // v1^va: z component
   double z2 = x2*yb -xb*y2; // v2^vb: z component
   bool isBetween = true;
-  if (((z1<0) and (z2<0)) or ((z1>=0) and (z2>=0)))
+  if (((z1<0) && (z2<0)) || ((z1>=0) && (z2>=0)))
     {
       isBetween = false;
     }
@@ -138,9 +138,9 @@ bool IsPointBetweenEdges2( const gp_Pnt& aFirstPnt1, const gp_Pnt& aLastPnt1,
       double dl1 = (aLastPnt1.X()-xg)*(aLastPnt1.X()-xg) + (aLastPnt1.Y()-yg)*(aLastPnt1.Y()-yg);
       double df2 = (aFirstPnt2.X()-xg)*(aFirstPnt2.X()-xg) + (aFirstPnt2.Y()-yg)*(aFirstPnt2.Y()-yg);
       double dl2 = (aLastPnt2.X()-xg)*(aLastPnt2.X()-xg) + (aLastPnt2.Y()-yg)*(aLastPnt2.Y()-yg);
-      double r2 = fmax(df1,dl1);
-      r2 = fmax(r2,df2);
-      r2 = fmax(r2,dl2);
+      double r2 = std::max(df1,dl1);
+      r2 = std::max(r2,df2);
+      r2 = std::max(r2,dl2);
       double d2 = (thePoint.X()-xg)*(thePoint.X()-xg) + (thePoint.Y()-yg)*(thePoint.Y()-yg);
       if (d2 > r2)
         isBetween = false;
index c15ed61c1ec8d59534416235a69205981f2be9ad..326a4acbfbf3d2784b36fccb8d336c3a3a7d2751 100644 (file)
@@ -1,5 +1,6 @@
 include(../../CMake/Common.cmake)
-include(UsePyQt4)
+include(../../CMake/UsePyQt4EXT.cmake)
+#include(UsePyQt4)
 
 # --- options ---
 
@@ -32,65 +33,63 @@ SET(_link_LIBRARIES
 # sip files / to be processed by sip
 SET(_sip_files
   HYDROData.sip
-  HYDROData_AltitudeObject.sip
-  HYDROData_Application.sip
-  HYDROData_ArtificialObject.sip
-  HYDROData_Bathymetry.sip
-  HYDROData_CalculationCase.sip
-  HYDROData_Channel.sip
-  HYDROData_Confluence.sip
-  HYDROData_Digue.sip
-  HYDROData_Document.sip
-  HYDROData_Entity.sip
-  HYDROData_IAltitudeObject.sip
-  HYDROData_IInterpolator.sip
-  HYDROData_Image.sip
-  HYDROData_ImmersibleZone.sip
-  HYDROData_IPolyline.sip
-  HYDROData_IProfilesInterpolator.sip
-  HYDROData_LandCoverMap.sip
-  HYDROData_NaturalObject.sip
-  HYDROData_Object.sip
-  HYDROData_ObstacleAltitude.sip
-  HYDROData_Obstacle.sip
-  HYDROData_Polyline3D.sip
-  HYDROData_PolylineXY.sip
-  HYDROData_Profile.sip
-  HYDROData_ProfileUZ.sip
-  HYDROData_Region.sip
-  HYDROData_River.sip
-  HYDROData_SequenceOfObjects.sip
-  HYDROData_ShapesGroup.sip
-  HYDROData_SplitShapesGroup.sip
-  HYDROData_StreamAltitude.sip
-  HYDROData_Stream.sip
-  HYDROData_StricklerTable.sip
-  HYDROData_Zone.sip
-  CAS/gp_XY.sip
-  CAS/gp_XYZ.sip
-  CAS/NCollection_Sequence.sip
-  CAS/TCollection_AsciiString.sip
 )
 
 SET(_add_SOURCES
-  sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc
-  sipHYDROPyNCollection_Sequence0100Handle_HYDROData_Entity.cc
-  sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc
-  sipHYDROPyNCollection_Sequence0100gp_XY.cc
-  sipHYDROPyNCollection_Sequence0100gp_XYZ.cc
-  sipHYDROPyNCollection_Sequence1800.cc
-  sipHYDROPyNCollection_Sequence2400.cc
-  sipHYDROPyNCollection_Sequence2600.cc
-  sipHYDROPyTCollection_AsciiString.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPycmodule.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPygp_XY.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPygp_XYZ.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_AltitudeObject.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Application.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ArtificialObject.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Bathymetry.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_CalculationCase.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Channel.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Confluence.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Digue.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Document.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Entity.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IAltitudeObject.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IInterpolator.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Image.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ImmersibleZone.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IPolyline.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_IProfilesInterpolator.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_LandCoverMap.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_NaturalObject.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Object.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ObstacleAltitude.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Polyline3D.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Profile.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ProfileUZ.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Region.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_River.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_ShapesGroup.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_SplitShapesGroup.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Stream.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_StreamAltitude.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_StricklerTable.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Zone.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XY.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XYZ.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100Handle_HYDROData_Entity.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100HYDROData_IPolylineSectionType.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100TCollection_AsciiString.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence1800.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence2400.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence2600.cc
+  ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyTCollection_AsciiString.cc
 )
 
 # --- sources ---
 
 # sources / sip wrappings
-PYQT4_WRAP_SIP(_sip_SOURCES ${_sip_files} SOURCES ${_add_SOURCES})
+PYQT4_WRAP_SIP_EXT( _sip_SOURCES ${_sip_files} )     # SOURCES ${_add_SOURCES})
 
 # sources / to compile
-SET(HYDROPy_SOURCES ${_sip_SOURCES})
+SET(HYDROPy_SOURCES ${_sip_SOURCES} ${_add_SOURCES})
 
 # --- rules ---
 
index 1e95d072c54be64b51620bf55bad8a4a2ae8a1ce..8a33dba07f25ee861e46e8afbef2d74eb3b84428 100644 (file)
@@ -53,16 +53,16 @@ set(PROJECT_SOURCES
 )
 
 add_definitions(
-  -DLIGHT_MODE -DHYDRODATA_STATIC -DHYDROGUI_STATIC
+  -DLIGHT_MODE -DHYDRODATA_STATIC -DHYDROGUI_STATIC -D__WIN32__ -D__x86__ -D_WIN64 -D_WIN32_WINNT=0x0400 -D__NT__ -D__OSVERSION__=4
 )
 
 IF( ${WIN32} )
   add_definitions( -DWNT )
 ENDIF()
 
-SET( CPPUNIT_INCLUDES $ENV{cppUNIT_ROOT}/include )
+SET( CPPUNIT_INCLUDES $ENV{CPPUNIT_ROOT_DIR}/include )
 SET( CAS_INCLUDES $ENV{CASROOT}/inc )
-SET( QT_INCLUDES $ENV{QTDIR}/include $ENV{QTDIR}/include/QtCore $ENV{QTDIR}/include/QtGui $ENV{QTDIR}/include/QtTest )
+SET( QT_INCLUDES $ENV{QT_ROOT_DIR}/include $ENV{QT_ROOT_DIR}/include/QtCore $ENV{QT_ROOT_DIR}/include/QtGui $ENV{QT_ROOT_DIR}/include/QtTest )
 SET( KERNEL_INCLUDES $ENV{KERNEL_ROOT_DIR}/include/salome )
 SET( GUI_INCLUDES $ENV{GUI_ROOT_DIR}/include/salome )
 SET( GEOM_INCLUDES $ENV{GEOM_ROOT_DIR}/include/salome )
@@ -74,14 +74,14 @@ ELSE()
 ENDIF()
 SET( CAS_LIBRARIES TKernel TKLCAF TKCAF TKCDF TKMath TKG2d TKG3d TKBRep TKGeomBase TKTopAlgo TKGeomAlgo TKBool TKShHealing TKXSBase TKOffset TKHLR TKBO TKV3d TKService TKMesh )
 
-link_directories( $ENV{QTDIR}/lib )
+link_directories( $ENV{QT_ROOT_DIR}/lib )
 IF( ${WIN32} )
   SET( QT_LIBRARIES QtCored4 QtGuid4 QtTestd4 )
 ELSE()
   SET( QT_LIBRARIES QtCore QtGui QtTest )
 ENDIF()
 
-link_directories( $ENV{cppUNIT_ROOT}/lib )
+link_directories( $ENV{CPPUNIT_ROOT_DIR}/lib )
 IF( ${WIN32} )
   SET( CPPUNIT_LIBRARIES cppunitd )
 ELSE()
@@ -109,8 +109,8 @@ source_group( "External files" FILES ${EXTERNAL_FILES} )
 add_executable( HYDROData_tests ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${EXTERNAL_FILES} ${PROJECT_MOC_HEADERS} )
 target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${GEOM_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib HYDROData)
 
-IF( ${WIN32} )
-  add_custom_command( TARGET HYDROData_tests POST_BUILD COMMAND $(TargetPath) COMMENT "Running tests" )
-ENDIF()
+#IF( ${WIN32} )
+#  add_custom_command( TARGET HYDROData_tests POST_BUILD COMMAND $(TargetPath) COMMENT "Running tests" )
+#ENDIF()
 
 INSTALL(TARGETS HYDROData_tests EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})