OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
CMAKE_DEPENDENT_OPTION(SALOME_GEOM_USE_OPENCV "Enable shape recognition from picture" OFF
"SALOME_BUILD_GUI" OFF)
-MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_GEOM_USE_OPENCV)
+CMAKE_DEPENDENT_OPTION(SALOME_GEOM_USE_VTK "Enable VTK-dependent functionality" ON
+ "NOT SALOME_BUILD_GUI" ON)
+MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_GEOM_USE_OPENCV SALOME_GEOM_USE_VTK)
# Prerequisites
# =============
##
FIND_PACKAGE(SalomeCAS REQUIRED)
-FIND_PACKAGE(SalomeVTK REQUIRED)
+
+IF(SALOME_GEOM_USE_VTK)
+ FIND_PACKAGE(SalomeVTK REQUIRED)
+ ADD_DEFINITIONS(-DWITH_VTK)
+ENDIF(SALOME_GEOM_USE_VTK)
# OpenCV
IF(SALOME_GEOM_USE_OPENCV)
SET(_${PROJECT_NAME}_exposed_targets
GEOMArchimede BlockFix GEOMbasic GEOMAlgo GEOMClient GEOMImpl
GEOMUtils GEOMEngine GEOM_SupervEngine GEOMSketcher
- SalomeIDLGEOM SalomeIDLGEOMSuperv SalomeIDLAdvancedGEOM ShHealOper XAO AdvancedEngine OCC2VTK
- SalomeIDLSTLPlugin SalomeIDLBREPPlugin SalomeIDLSTEPPlugin SalomeIDLIGESPlugin SalomeIDLXAOPlugin SalomeIDLVTKPlugin
- STLPluginEngine BREPPluginEngine STEPPluginEngine IGESPluginEngine XAOPluginEngine VTKPluginEngine
+ SalomeIDLGEOM SalomeIDLGEOMSuperv SalomeIDLAdvancedGEOM ShHealOper XAO AdvancedEngine
+ SalomeIDLSTLPlugin SalomeIDLBREPPlugin SalomeIDLSTEPPlugin SalomeIDLIGESPlugin SalomeIDLXAOPlugin
+ STLPluginEngine BREPPluginEngine STEPPluginEngine IGESPluginEngine XAOPluginEngine
)
IF(SALOME_BUILD_GUI)
LIST(APPEND _${PROJECT_NAME}_exposed_targets
ENDIF(SALOME_USE_GRAPHICSVIEW)
ENDIF(SALOME_BUILD_GUI)
+IF(SALOME_GEOM_USE_VTK)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets
+ OCC2VTK
+ VTKPluginEngine
+ SalomeIDLVTKPlugin
+ )
+ENDIF(SALOME_GEOM_USE_VTK)
+
IF(SALOME_GEOM_USE_OPENCV)
LIST(APPEND _${PROJECT_NAME}_exposed_targets
GEOMShapeRec
# Advanced options
SET(SALOME_GEOM_BUILD_GUI @SALOME_BUILD_GUI@)
SET(SALOME_GEOM_USE_OPENCV @SALOME_GEOM_USE_OPENCV@)
+SET(SALOME_GEOM_USE_VTK @SALOME_GEOM_USE_VTK@)
# Level 1 prerequisites:
SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@")
SET_AND_CHECK(CAS_ROOT_DIR_EXP "@PACKAGE_CAS_ROOT_DIR@")
-SET_AND_CHECK(VTK_ROOT_DIR_EXP "@PACKAGE_VTK_ROOT_DIR@")
# Optional level 1 prerequisites:
IF(SALOME_GEOM_BUILD_GUI)
SET_AND_CHECK(OPENCV_ROOT_DIR_EXP "@PACKAGE_OPENCV_ROOT_DIR@")
LIST(APPEND GEOM_DEFINITIONS "-DWITH_OPENCV")
ENDIF()
+IF(SALOME_GEOM_USE_VTK)
+ SET_AND_CHECK(VTK_ROOT_DIR_EXP "@PACKAGE_VTK_ROOT_DIR@")
+ LIST(APPEND GEOM_DEFINITIONS "-DWITH_VTK")
+ENDIF()
# For all prerequisites, load the corresponding targets if the package was used
# in CONFIG mode. This ensures dependent projects link correctly
# Generate a temporary python file, needed for the genaration of the documentation
# of the built-in Geometry plugins.
-SET(DOC_GEOM_PluginsList AdvancedGEOM STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin)
+SET(DOC_GEOM_PluginsList AdvancedGEOM STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin)
+IF(SALOME_GEOM_USE_VTK)
+ SET(DOC_GEOM_PluginsList ${DOC_GEOM_PluginsList} VTKPlugin)
+ENDIF()
SALOME_ACCUMULATE_ENVIRONMENT(GEOM_PluginsList NOCHECK ${DOC_GEOM_PluginsList})
SET(geom_file "${CMAKE_CURRENT_SOURCE_DIR}/collect_geom_methods.py")
SET(plugins_cmd_options ${geom_file} -o tmp1/geomBuilder.py ${DOC_GEOM_PluginsList})
OMNIORB_ADD_MODULE(SalomeIDLXAOPlugin "${SalomeIDLXAOPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
INSTALL(TARGETS SalomeIDLXAOPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-OMNIORB_ADD_MODULE(SalomeIDLVTKPlugin "${SalomeIDLVTKPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
-INSTALL(TARGETS SalomeIDLVTKPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+IF(SALOME_GEOM_USE_VTK)
+ OMNIORB_ADD_MODULE(SalomeIDLVTKPlugin "${SalomeIDLVTKPlugin_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_PLUGIN_FLAGS}")
+ INSTALL(TARGETS SalomeIDLVTKPlugin EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+ENDIF(SALOME_GEOM_USE_VTK)
OMNIORB_ADD_MODULE(SalomeIDLGEOMSuperv "${SalomeIDLGEOMSuperv_IDLSOURCES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_SUPERV_FLAGS}")
INSTALL(TARGETS SalomeIDLGEOMSuperv EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
STEPPlugin.xml
IGESPlugin.xml
XAOPlugin.xml
- VTKPlugin.xml
GEOM_en.xml
GEOM_fr.xml
GEOM.config
exportxao.png importxao.png
##@@ insert new functions before this line @@ do not remove this line @@##
)
+IF(SALOME_GEOM_USE_VTK)
+ SET(_res_files
+ VTKPlugin.xml
+ ${_res_files}
+ )
+ENDIF(SALOME_GEOM_USE_VTK)
+
INSTALL(FILES ${_res_files} DESTINATION ${SALOME_GEOM_INSTALL_RES_DATA})
SET( _texture_files
SET(SUBDIRS_COMMON
ARCHIMEDE BlockFix GEOMAlgo SKETCHER GEOM ShHealOper GEOMUtils XAO XAO_Swig
GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY
- AdvancedEngine OCC2VTK
- STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin VTKPlugin Tools
+ AdvancedEngine
+ STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin Tools
)
##
)
ENDIF()
+##
+# VTK
+##
+IF(SALOME_GEOM_USE_VTK)
+ SET(SUBDIRS_VTK
+ OCC2VTK
+ VTKPlugin
+ )
+ENDIF()
+
##
# GUI
##
SET(SUBDIRS
${SUBDIRS_COMMON}
${SUBDIRS_OPENCV}
+ ${SUBDIRS_VTK}
${SUBDIRS_CC}
${SUBDIRS_GUI}
)
SalomeIDLIGESPlugin
SalomeIDLSTEPPlugin
SalomeIDLSTLPlugin
- SalomeIDLVTKPlugin
SalomeIDLXAOPlugin
${KERNEL_SALOMELocalTrace}
${KERNEL_SalomeDSClient}
${KERNEL_SalomeNS}
)
+IF(SALOME_GEOM_USE_VTK)
+ SET(_link_LIBRARIES ${_link_LIBRARIES}
+ SalomeIDLVTKPlugin)
+ENDIF(SALOME_GEOM_USE_VTK)
# --- headers ---
SET(GEOM_SupervEngine_HEADERS
#include "GEOM_Superv_i.hh"
#include "SALOME_LifeCycleCORBA.hxx"
+#include "Utils_CorbaException.hxx"
#include CORBA_SERVER_HEADER(SALOME_Session)
#include "SALOMEDSClient_ClientFactory.hxx"
}
}
+#ifdef WITH_VTK
//=============================================================================
// getVTKPluginOp:
//=============================================================================
myVTKOp = GEOM::IVTKOperations::_narrow(myGeomEngine->GetPluginOperations(myStudyID, "VTKPluginEngine"));
}
}
+#endif
//=============================================================================
// GetServant:
return false;
}
+
//=============================================================================
// Export VTK
//=============================================================================
const char* theFileName,
CORBA::Double theDeflection )
{
+ #ifdef WITH_VTK
beginService( " GEOM_Superv_i::ExportVTK" );
MESSAGE("GEOM_Superv_i::ExportVTK");
getVTKPluginOp();
myVTKOp->ExportVTK( theObject, theFileName, theDeflection );
endService( " GEOM_Superv_i::ExportVTK" );
+#else
+ std::string message("GEOM_Superv_i::ExportVTK functionality is unavailable");
+ THROW_SALOME_CORBA_EXCEPTION(message.c_str(), SALOME::INTERNAL_ERROR);
+#endif
}
//=============================== Advanced Operations =============================
#include CORBA_CLIENT_HEADER(STEPPlugin)
#include CORBA_CLIENT_HEADER(IGESPlugin)
#include CORBA_CLIENT_HEADER(XAOPlugin)
+#ifdef WITH_VTK
#include CORBA_CLIENT_HEADER(VTKPlugin)
+#endif
#include CORBA_SERVER_HEADER(GEOM_Superv)
#include "SALOME_Component_i.hxx"
void getSTEPPluginOp();
void getIGESPluginOp();
void getXAOPluginOp();
+#ifdef WITH_VTK
void getVTKPluginOp();
-
+#endif
PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject,
PortableServer::POA_ptr thePOA);
GEOM::ISTEPOperations_var mySTEPOp;
GEOM::IIGESOperations_var myIGESOp;
GEOM::IXAOOperations_var myXAOOp;
+#ifdef WITH_VTK
GEOM::IVTKOperations_var myVTKOp;
+#endif
};
#endif
SALOME_INSTALL_SCRIPTS("${_python_STEP_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/STEPPlugin DEF_PERMS)
SALOME_INSTALL_SCRIPTS("${_python_IGES_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/IGESPlugin DEF_PERMS)
SALOME_INSTALL_SCRIPTS("${_python_XAO_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/XAOPlugin DEF_PERMS)
-SALOME_INSTALL_SCRIPTS("${_python_VTK_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/VTKPlugin DEF_PERMS)
+IF(SALOME_GEOM_USE_VTK)
+ SALOME_INSTALL_SCRIPTS("${_python_VTK_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/VTKPlugin DEF_PERMS)
+ENDIF(SALOME_GEOM_USE_VTK)