]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Flexible behavior of Dump feature configured in CMake
authorazv <azv@opencascade.com>
Tue, 4 Feb 2020 12:17:31 +0000 (15:17 +0300)
committerazv <azv@opencascade.com>
Tue, 4 Feb 2020 12:32:54 +0000 (15:32 +0300)
src/ExchangePlugin/CMakeLists.txt
src/ExchangePlugin/ExchangePlugin_Dump.cpp

index 3c6692e59eb3a8ab31d25c336d76c6f069337ae7..83a6dd5702c79a2945df917a20c5df4736633365 100644 (file)
@@ -77,7 +77,21 @@ SET(PROJECT_LIBRARIES
 )
 SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES})
 
+# default dump approaches (will be set if not initialized)
+SET(PYTHONDUMP_NAMING ON  CACHE BOOL "Dump named references to shapes")
+SET(PYTHONDUMP_GEO    ON  CACHE BOOL "Dump references to shapes by the geometric properties")
+SET(PYTHONDUMP_WEAK   OFF CACHE BOOL "Dump weak named references to shapes")
+
 ADD_DEFINITIONS(-DEXCHANGEPLUGIN_EXPORTS)
+IF(${PYTHONDUMP_NAMING})
+  ADD_DEFINITIONS(-DEXCHANGEPLUGIN_DUMP_NAMING)
+ENDIF()
+IF(${PYTHONDUMP_GEO})
+  ADD_DEFINITIONS(-DEXCHANGEPLUGIN_DUMP_GEO)
+ENDIF()
+IF(${PYTHONDUMP_WEAK})
+  ADD_DEFINITIONS(-DEXCHANGEPLUGIN_DUMP_WEAK)
+ENDIF()
 ADD_LIBRARY(ExchangePlugin MODULE ${PROJECT_SOURCES} ${PROJECT_HEADERS} ${XML_RESOURCES} ${TEXT_RESOURCES})
 
 TARGET_LINK_LIBRARIES(ExchangePlugin ${PROJECT_LIBRARIES})
index cf78b9b8c10a0ee53f1abd0eeaf80e8180b1e274..097042a286c29427aa9dd52a64d2d1b56ed4b8f9 100644 (file)
 
 #include <Config_ModuleReader.h>
 
+#ifdef EXCHANGEPLUGIN_DUMP_NAMING
+static const bool THE_DUMP_NAMING = true;
+#else
+static const bool THE_DUMP_NAMING = false;
+#endif
+
+#ifdef EXCHANGEPLUGIN_DUMP_GEO
+static const bool THE_DUMP_GEO = true;
+#else
+static const bool THE_DUMP_GEO = false;
+#endif
+
+#ifdef EXCHANGEPLUGIN_DUMP_WEAK
+static const bool THE_DUMP_WEAK = true;
+#else
+static const bool THE_DUMP_WEAK = false;
+#endif
+
 
 ExchangePlugin_Dump::ExchangePlugin_Dump()
 {
@@ -48,9 +66,9 @@ void ExchangePlugin_Dump::initAttributes()
   data()->addAttribute(WEAK_NAMING_DUMP_ID(), ModelAPI_AttributeBoolean::typeId());
 
   // default values
-  boolean(TOPOLOGICAL_NAMING_DUMP_ID())->setValue(true);
-  boolean(GEOMETRIC_DUMP_ID())->setValue(true);
-  boolean(WEAK_NAMING_DUMP_ID())->setValue(false);
+  boolean(TOPOLOGICAL_NAMING_DUMP_ID())->setValue(THE_DUMP_NAMING);
+  boolean(GEOMETRIC_DUMP_ID())->setValue(THE_DUMP_GEO);
+  boolean(WEAK_NAMING_DUMP_ID())->setValue(THE_DUMP_WEAK);
 }
 
 void ExchangePlugin_Dump::execute()