From: Sergey BELASH Date: Fri, 11 Apr 2014 16:11:45 +0000 (+0400) Subject: Merge branch 'master' of newgeom:newgeom.git into BR_PORTING_CENTOS_6_3 X-Git-Tag: V_0.1~8^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1b6e67870beeeb667864eaff5b1bb9c1570b7259;p=modules%2Fshaper.git Merge branch 'master' of newgeom:newgeom.git into BR_PORTING_CENTOS_6_3 Conflicts: CMakeCommon/FindPython.cmake CMakeCommon/XMLProcessing.cmake --- 1b6e67870beeeb667864eaff5b1bb9c1570b7259 diff --cc CMakeCommon/XMLProcessing.cmake index f54729b86,5e38c02ec..a1dbefe0a --- a/CMakeCommon/XMLProcessing.cmake +++ b/CMakeCommon/XMLProcessing.cmake @@@ -1,21 -1,33 +1,27 @@@ - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.10) -SET(LIBXMLDIR $ENV{LIBXML2_ROOT_DIR}) - SET(LIBXMLDIR $ENV{LIBXML2_ROOT_DIR}) + IF(WIN32) + INCLUDE_DIRECTORIES(${LIBXMLDIR}/include) + ELSE() + INCLUDE_DIRECTORIES(${LIBXMLDIR}/include/libxml2) + ENDIF(WIN32) + + LINK_DIRECTORIES (${LIBXMLDIR}/lib) ++ IF(WIN32) SET(LIBXML2_LIBRARIES ${LIBXMLDIR}/lib/libxml2.lib) + INCLUDE_DIRECTORIES(${LIBXMLDIR}/include/libxml2) ELSE() SET(LIBXML2_LIBRARIES ${LIBXMLDIR}/lib/libxml2.so) + SET(LIBXML2_INCLUDE_DIR ${LIBXMLDIR}/include/libxml2) + FIND_PACKAGE(LibXml2 REQUIRED) + if(LIBXML2_FOUND) + message(STATUS "Found libxml2 ver. " ${LIBXML2_VERSION_STRING}) + message(STATUS "LIBXML2_LIBRARIES " ${LIBXML2_LIBRARIES}) + message(STATUS "LIBXML2_INCLUDE_DIR " ${LIBXML2_INCLUDE_DIR}) + endif(LIBXML2_FOUND) + + INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) ENDIF() +LINK_DIRECTORIES (${LIBXMLDIR}/lib) - -#set(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} ${LIBXMLDIR}/lib/libxml2.lib) - -#FILE(TO_CMAKE_PATH $ENV{PC_LIBXML_INCLUDEDIR} PC_LIBXML_INCLUDEDIR) -#FILE(TO_CMAKE_PATH $ENV{PC_LIBXML_INCLUDEDIR} PC_LIBXML_INCLUDEDIR) -#FILE(TO_CMAKE_PATH $ENV{PC_LIBXML_LIBDIR} PC_LIBXML_LIBDIR) -#message(STATUS "PC_LIBXML_INCLUDEDIR " ${PC_LIBXML_INCLUDEDIR}) -#message(STATUS "PC_LIBXML_LIBDIR " ${PC_LIBXML_LIBDIR}) - -#FIND_PACKAGE(LibXml2 REQUIRED) -#if(LIBXML2_FOUND) -# message(STATUS "Found libxml2 ver. " ${LIBXML2_VERSION_STRING}) -# message(STATUS "LIBXML2_LIBRARIES " ${LIBXML2_LIBRARIES}) -# message(STATUS "LIBXML2_INCLUDE_DIR " ${LIBXML2_INCLUDE_DIR}) -#endif(LIBXML2_FOUND) - -#INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) -#ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) diff --cc linux_env.sh index 000000000,889f5e402..a84ae8b7c mode 000000,100644..100644 --- a/linux_env.sh +++ b/linux_env.sh @@@ -1,0 -1,85 +1,87 @@@ + #------ Setting products installation directory ------ + export INST_ROOT=/misc/dn21/hdfeditor/sbh/NewGeom/products + + #------ Python ------ + export PYTHON_ROOT_DIR=${INST_ROOT}/Python-2.7.3 + export PYTHONHOME=${PYTHON_ROOT_DIR} + export PYTHON_INCLUDE=${PYTHON_ROOT_DIR}/include/python2.7 + export PYTHON_VERSION=2.7 + export PATH=${PYTHON_ROOT_DIR}/bin:${PATH} + export LD_LIBRARY_PATH=${PYTHON_ROOT_DIR}/lib:${LD_LIBRARY_PATH} + export PYTHONPATH=${PYTHON_ROOT_DIR}/lib/python2.7 + #For cmake + export PYTHON_LIB_DIR=${PYTHON_ROOT_DIR}/lib + export PYTHON_INC_DIR=${PYTHON_INCLUDE} + ## + #------ Qt ------ + export QT4_ROOT_DIR=${INST_ROOT}/qt-4.8.4 + export QT_PLUGIN_PATH=${QT4_ROOT_DIR}/plugins + export PATH=${QT4_ROOT_DIR}/bin:${PATH} + export LD_LIBRARY_PATH=${QT4_ROOT_DIR}/lib:${LD_LIBRARY_PATH} + ## + #------ boost ------ + #export BOOST_ROOT_DIR=${INST_ROOT}/boost-1.52.0 + #export LD_LIBRARY_PATH ${BOOST_ROOT_DIR}/lib + ## + #------ swig ------ + export SWIG_ROOT_DIR=${INST_ROOT}/swig-2.0.8 + export SWIG_LIB=${SWIG_ROOT_DIR}/share/swig/2.0.8 + export PATH=${SWIG_ROOT_DIR}/bin:${PATH} + ## + #------ cmake ------ + export CMAKE_ROOT_DIR=${INST_ROOT}/cmake-2.8.10.2 + export PATH=${CMAKE_ROOT_DIR}/bin:${PATH} + ## + #------ freetype ------ + export FREETYPE_ROOT_DIR=${INST_ROOT}/freetype-2.4.11 + export LD_LIBRARY_PATH=${FREETYPE_ROOT_DIR}/lib:${LD_LIBRARY_PATH} + ## + #------ freeimage ------ + export FREEIMAGE_ROOT_DIR=${INST_ROOT}/freeimage-3.15.4 + export PATH=${FREEIMAGE_ROOT_DIR}/bin:${PATH} + export LD_LIBRARY_PATH=${FREEIMAGE_ROOT_DIR}/lib:${LD_LIBRARY_PATH} + ## + #------ gl2ps ------ + export GL2PS_ROOT_DIR=${INST_ROOT}/gl2ps-1.3.8 + export PATH=${GL2PS_ROOT_DIR}/bin:${PATH} + export LD_LIBRARY_PATH=${GL2PS_ROOT_DIR}/lib:${LD_LIBRARY_PATH} + ## + #------ tbb ------ + export TBB_ROOT_DIR=${INST_ROOT}/tbb-30_018oss + export PATH=${TBB_ROOT_DIR}/bin/intel64/cc4.1.0_libc2.4_kernel2.6.16.21:${PATH} + export LD_LIBRARY_PATH=${TBB_ROOT_DIR}/lib/intel64/cc4.1.0_libc2.4_kernel2.6.16.21:${LD_LIBRARY_PATH} + ## + #------ libxml2 ------ + export LIBXML2_ROOT_DIR=${INST_ROOT}/libxml2-2.9.0 + export PATH=${LIBXML2_ROOT_DIR}/bin:${PATH} + export LD_LIBRARY_PATH=${LIBXML2_ROOT_DIR}/lib:${LD_LIBRARY_PATH} + # DO NOT rename following 3 variables, + # they are required by CMake "find(Libxml2)" procedure + export LIBXML2_INCLUDE_DIR=${LIBXML2_ROOT_DIR}/include/libxml2 + export LIBXML2_LIB_DIR=${LIBXML2_ROOT_DIR}/lib + export LIBXML2_BIN_DIR=${LIBXML2_ROOT_DIR}/bin + ## + #------ OCCT ------ + export CAS_ROOT_DIR=${INST_ROOT}/OCCT-6.7.0 + + export PATH=${CAS_ROOT_DIR}:${CAS_ROOT_DIR}/bin:${PATH} + export LD_LIBRARY_PATH=${CAS_ROOT_DIR}:${CAS_ROOT_DIR}/lib:${LD_LIBRARY_PATH} ++export CSF_GraphicShr=${CAS_ROOT_DIR}/lib/libTKOpenGl.so + # Variable for Foundation Classes : + export CSF_UnitsLexicon=${CAS_ROOT_DIR}/src/UnitsAPI/Lexi_Expr.dat + export CSF_UnitsDefinition=${CAS_ROOT_DIR}/src/UnitsAPI/Units.dat + # Variable for DataExchange : + export CSF_SHMessage=${CAS_ROOT_DIR}/src/SHMessage + export CSF_XSMessage=${CAS_ROOT_DIR}/src/XSMessage + # Variable for Font : + export CSF_MDTVFontDirectory=${CAS_ROOT_DIR}/src/FontMFT + export CSF_MDTVTexturesDirectory=${CAS_ROOT_DIR}/src/Textures + # Activation of OCCT Kernel multithreading : + export MMGT_REENTRANT=1 + # this variable only needed for DRAWEXE + export CASROOT=${CAS_ROOT_DIR} + ## + export LIB=${LD_LIBRARY_PATH} + - ++export PATH=${INST_ROOT}/../install/bin:${PATH} ++export LD_LIBRARY_PATH=${INST_ROOT}/../install/bin:${INST_ROOT}/../install/swig:${LD_LIBRARY_PATH} diff --cc src/XGUI/XGUI_PartDataModel.cpp index 1e79322ca,f0e1d9f4b..40f4671db --- a/src/XGUI/XGUI_PartDataModel.cpp +++ b/src/XGUI/XGUI_PartDataModel.cpp @@@ -292,5 -318,31 +318,31 @@@ FeaturePtr XGUI_PartDataModel::feature( case ConstructObject: return featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row()); } - return 0; + return FeaturePtr(); } + + bool XGUI_PartDataModel::hasDocument(const std::shared_ptr& theDoc) const + { + return (featureDocument() == theDoc); + } + + + QModelIndex XGUI_PartDataModel::findParent(const std::shared_ptr& theFeature) const + { + QString aGroup(theFeature->getGroup().c_str()); + + if (theFeature->getGroup().compare(PARAMETERS_GROUP) == 0) + return createIndex(0, 0, (quintptr) ParamsFolder); + if (theFeature->getGroup().compare(CONSTRUCTIONS_GROUP) == 0) + return createIndex(1, 0, (quintptr) ConstructFolder); + return QModelIndex(); + } + + QModelIndex XGUI_PartDataModel::findGroup(const std::string& theGroup) const + { + if (theGroup.compare(PARAMETERS_GROUP) == 0) + return createIndex(0, 0, (quintptr) ParamsFolder); + if (theGroup.compare(CONSTRUCTIONS_GROUP) == 0) + return createIndex(1, 0, (quintptr) ConstructFolder); + return QModelIndex(); -} ++} diff --cc src/XGUI/XGUI_Workshop.cpp index 1a1f7382d,0aac474da..02a02ec86 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@@ -340,3 -373,38 +373,38 @@@ bool XGUI_Workshop::activateModule( myPartSetModule->createFeatures(); return true; } + + //****************************************************** + void XGUI_Workshop::updateCommandStatus() + { + XGUI_MainMenu* aMenuBar = myMainWindow->menuObject(); + + QList aCommands = aMenuBar->features(); + QList::const_iterator aIt; + + std::shared_ptr aMgr = ModelAPI_PluginManager::get(); + if (aMgr->hasRootDocument()) { + XGUI_Command* aUndoCmd; + XGUI_Command* aRedoCmd; + for (aIt = aCommands.constBegin(); aIt != aCommands.constEnd(); ++aIt) { + if ((*aIt)->id() == "UNDO_CMD") + aUndoCmd = (*aIt); + else if ((*aIt)->id() == "REDO_CMD") + aRedoCmd = (*aIt); + else // Enable all commands + (*aIt)->enable(); + } + std::shared_ptr aDoc = aMgr->rootDocument(); + aUndoCmd->setEnabled(aDoc->canUndo()); + aRedoCmd->setEnabled(aDoc->canRedo()); + } else { + for (aIt = aCommands.constBegin(); aIt != aCommands.constEnd(); ++aIt) { + if ((*aIt)->id() == "NEW_CMD") + (*aIt)->enable(); + else if ((*aIt)->id() == "EXIT_CMD") + (*aIt)->enable(); + else + (*aIt)->disable(); + } + } -} ++}