]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
patch for automatic tests for HYDROData_Bathymetry
authorasl <asl@opencascade.com>
Wed, 31 Aug 2016 11:10:30 +0000 (14:10 +0300)
committerasl <asl@opencascade.com>
Wed, 31 Aug 2016 11:10:30 +0000 (14:10 +0300)
now they can be started on Windows without SALOME
note that tests do not pass

CMakeLists.txt
src/HYDROData/HYDROData_Bathymetry.cxx
src/HYDRO_tests/CMakeLists.txt
src/HYDRO_tests/ExternalFiles.cmake

index 54f2273145a6cff65479875f87ac6af09c065bac..ceb5f5a6c1b705f73327711440cf89895597844d 100644 (file)
@@ -1,8 +1,11 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
-INCLUDE(CMakeDependentOption)
 
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
 PROJECT(SalomeHYDRO C CXX)
 
+ADD_SUBDIRECTORY (src/HYDRO_tests)
+
+INCLUDE(CMakeDependentOption)
+
 # Ensure a proper linker behavior:
 CMAKE_POLICY(SET CMP0003 NEW)
 
@@ -190,7 +193,6 @@ ADD_SUBDIRECTORY (src/HYDROData)
 ADD_SUBDIRECTORY (src/HYDROGUI)
 ADD_SUBDIRECTORY (src/HYDROPy)
 ADD_SUBDIRECTORY (src/HYDROTools)
-ADD_SUBDIRECTORY (src/HYDRO_tests)
 IF(SALOME_BUILD_DOC)
   ADD_SUBDIRECTORY(doc)
 ENDIF()
index 0a7e90ea52bdce40e024863e9c4e7e3b0e602561..db67785251b498ab336b59558fa7ecd0620a815a 100644 (file)
@@ -59,8 +59,10 @@ IMPLEMENT_STANDARD_HANDLE(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Bathymetry, HYDROData_IAltitudeObject)
 
 //HYDROData_QuadtreeNode* HYDROData_Bathymetry::myQuadtree = 0;
-#ifndef LIGHT_MODE
+
 std::map<int, HYDROData_QuadtreeNode*> HYDROData_Bathymetry::myQuadtrees;
+
+#ifndef LIGHT_MODE
 std::map<int, vtkPolyData*> HYDROData_Bathymetry::myDelaunay2D;
 #endif
 
@@ -148,7 +150,7 @@ HYDROData_Bathymetry::AltitudePoints HYDROData_Bathymetry::GetAltitudePoints(boo
 
   return aPoints;
 }
-#ifndef LIGHT_MODE
+
 HYDROData_QuadtreeNode* HYDROData_Bathymetry::GetQuadtreeNodes() const
 {
   TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false);
@@ -194,6 +196,7 @@ HYDROData_QuadtreeNode* HYDROData_Bathymetry::GetQuadtreeNodes() const
     return myQuadtrees[labkey];
 }
 
+#ifndef LIGHT_MODE
 vtkPolyData* HYDROData_Bathymetry::GetVtkDelaunay2D() const
 {
   TDF_Label aLabel = myLab.FindChild(DataTag_AltitudePoints, false);
@@ -353,6 +356,7 @@ bool interpolZtriangle(const gp_XY& point, vtkPolyData* delaunay2D, vtkIdList* t
     }
   return false;
 }
+#endif
 
 double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint, int theMethod) const
 {
@@ -391,6 +395,8 @@ double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint, int theM
   bool isBathyInterpolRequired = false;
   if (theMethod)
     isBathyInterpolRequired =true;
+
+#ifndef LIGHT_MODE
   if (isBathyInterpolRequired)
     {
       vtkPolyData* aDelaunay2D = GetVtkDelaunay2D();
@@ -416,9 +422,10 @@ double HYDROData_Bathymetry::GetAltitudeForPoint(const gp_XY& thePoint, int theM
         }
       if (!isInside) DEBTRACE("  point outside triangles, nearest z kept");
     }
+  #endif
   return aResAltitude;
 }
-#endif
+
 void HYDROData_Bathymetry::SetFilePath( const TCollection_AsciiString& theFilePath )
 {
   TDataStd_AsciiString::Set( myLab.FindChild( DataTag_FilePath ), theFilePath );
index 8a33dba07f25ee861e46e8afbef2d74eb3b84428..8ff5e1c01e884c1310ac57a611748fd37832c498 100644 (file)
@@ -90,7 +90,7 @@ ENDIF()
 
 link_directories( $ENV{KERNEL_ROOT_DIR}/lib/salome $ENV{GUI_ROOT_DIR}/lib/salome $ENV{GEOM_ROOT_DIR}/lib/salome )
 SET( GUI_LIBRARIES ImageComposer qtx suit LightApp CAM OCCViewer )
-SET( GEOM_LIBRARIES CurveCreator )
+SET( GEOM_LIBRARIES CurveCreator GeomUtils )
 
 include_directories(
   ${CAS_INCLUDES}
@@ -107,7 +107,7 @@ include_directories(
 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)
+target_link_libraries( HYDROData_tests ${GUI_LIBRARIES} ${GEOM_LIBRARIES} ${CAS_LIBRARIES} ${QT_LIBRARIES} ${CPPUNIT_LIBRARIES} shapelib )
 
 #IF( ${WIN32} )
 #  add_custom_command( TARGET HYDROData_tests POST_BUILD COMMAND $(TargetPath) COMMENT "Running tests" )
index df610ea5e60fc1914e2ae4dcc3ea981073e5981a..998b5c7d7f653ea3ec730def39799638e0961411 100644 (file)
@@ -9,6 +9,7 @@ set( EXTERNAL_FILES
   ../HYDROData/HYDROData_BSplineOperation.cxx
   ../HYDROData/HYDROData_CalculationCase.cxx
   ../HYDROData/HYDROData_Channel.cxx
+  ../HYDROData/HYDROData_ChannelAltitude.cxx
   ../HYDROData/HYDROData_Confluence.cxx
   ../HYDROData/HYDROData_Digue.cxx
   ../HYDROData/HYDROData_Document.cxx
@@ -54,6 +55,9 @@ set( EXTERNAL_FILES
   ../HYDROData/HYDROData_SinusX.cxx
   ../HYDROData/HYDROData_ShapeFile.cxx
   ../HYDROData/HYDROData_LandCoverMap.cxx
+  ../HYDROData/HYDROData_QuadTree.cxx
+  ../HYDROData/HYDROData_QuadTreeNode.cxx
+  ../HYDROData/HYDROData_LCM_FaceClassifier.cxx
 
   ../HYDROGUI/HYDROGUI_ListModel.cxx
   ../HYDROGUI/HYDROGUI_DataObject.cxx