]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Debug information to check selection with SHIFT: group, selection of edges on created...
authornds <nds@opencascade.com>
Mon, 28 Nov 2016 12:00:00 +0000 (15:00 +0300)
committernds <nds@opencascade.com>
Mon, 28 Nov 2016 12:00:00 +0000 (15:00 +0300)
CMakeCommon/FindDFBrowser.cmake [new file with mode: 0644]
CMakeCommon/FindVInspector.cmake [new file with mode: 0644]
CMakeLists.txt
src/Model/CMakeLists.txt
src/Model/Model_Application.cpp
src/Model/Model_Document.cpp
src/XGUI/CMakeLists.txt
src/XGUI/XGUI_ViewerProxy.cpp

diff --git a/CMakeCommon/FindDFBrowser.cmake b/CMakeCommon/FindDFBrowser.cmake
new file mode 100644 (file)
index 0000000..2cf5e9a
--- /dev/null
@@ -0,0 +1,27 @@
+# - Try to  find DFBrowser
+# Once done this will define
+#
+#  DBROWSER_FOUND - system has DFBrowser
+#  DFBROWSER_INCLUDE_DIRS - the DFBrowser include directory
+#  DFBROWSER_LIBRARIES - Link these to use DFBrowser
+
+#=============================================================================
+## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+#=============================================================================
+
+IF(NOT DFBROWSER_FIND_QUIETLY)
+  MESSAGE(STATUS "Try to find DFBrowser at $ENV{DFBROWSER_ROOT_DIR}...")
+ENDIF()
+
+SET(DFBROWSER_ROOT_DIR $ENV{DFBROWSER_ROOT_DIR} CACHE PATH "Path to the DFBrowser directory")
+IF(EXISTS ${DFBROWSER_ROOT_DIR})
+  SET(DFBROWSER_INCLUDE_DIR "${DFBROWSER_ROOT_DIR}/include")
+  SET(DFBROWSER_LIB_DIR "${DFBROWSER_ROOT_DIR}/lib")
+
+  FIND_LIBRARY(DFBrowserAPI DFBrowserAPI "${DFBROWSER_LIB_DIR}")
+  SET(DFBrowserAPI ${DFBrowserAPI})
+
+  MESSAGE(STATUS "DFBrowser found at ${DFBROWSER_ROOT_DIR}")
+  MESSAGE(STATUS "DFBrowser include dir at ${DFBROWSER_INCLUDE_DIR}")
+  MESSAGE(STATUS "DFBrowser lib dir at ${DFBROWSER_LIB_DIR}")
+ENDIF(EXISTS ${DFBROWSER_ROOT_DIR})
diff --git a/CMakeCommon/FindVInspector.cmake b/CMakeCommon/FindVInspector.cmake
new file mode 100644 (file)
index 0000000..f88ff79
--- /dev/null
@@ -0,0 +1,27 @@
+# - Try to  find VInspector
+# Once done this will define
+#
+#  VINSPECTOR_FOUND - system has VInspector
+#  VINSPECTOR_INCLUDE_DIRS - the VInspector include directory
+#  VINSPECTOR_LIBRARIES - Link these to use VInspector
+
+#=============================================================================
+## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+#=============================================================================
+
+IF(NOT VINSPECTOR_FIND_QUIETLY)
+  MESSAGE(STATUS "Try to find VInspector at $ENV{VINSPECTOR_ROOT_DIR}...")
+ENDIF()
+
+SET(VINSPECTOR_ROOT_DIR $ENV{VINSPECTOR_ROOT_DIR} CACHE PATH "Path to the VInspector directory")
+IF(EXISTS ${VINSPECTOR_ROOT_DIR})
+  SET(VINSPECTOR_INCLUDE_DIR "${VINSPECTOR_ROOT_DIR}/include")
+  SET(VINSPECTOR_LIB_DIR "${VINSPECTOR_ROOT_DIR}/lib")
+
+  FIND_LIBRARY(VInspectorAPI VInspectorAPI "${VINSPECTOR_LIB_DIR}")
+  SET(VInspectorAPI ${VInspectorAPI})
+
+  MESSAGE(STATUS "VInspector found at ${VINSPECTOR_ROOT_DIR}")
+  MESSAGE(STATUS "VInspector include dir at ${VINSPECTOR_INCLUDE_DIR}")
+  MESSAGE(STATUS "VInspector lib dir at ${VINSPECTOR_LIB_DIR}")
+ENDIF(EXISTS ${VINSPECTOR_ROOT_DIR})
index 7a2007df6ca4a1d75586ddd62baa9c0d6d8a47e9..561697239a975485863f04c2e8cd79cb191a7411 100644 (file)
@@ -12,6 +12,8 @@ INCLUDE(FindPython)
 INCLUDE(FindSalome)
 INCLUDE(FindCAS)
 INCLUDE(FindSUIT)
+INCLUDE(FindDFBrowser)
+INCLUDE(FindVInspector)
 
 # Find LibXml2
 IF(DEFINED ENV{LIBXML2_ROOT_DIR})
index fe49abf6a00dd04a657cccf592fa07e78ac9dd2e..f4649c67c19c8f046ba0682f4c03d4e8edf0e6e6 100644 (file)
@@ -103,11 +103,11 @@ SET(PROJECT_INCLUDES
 )
 
 
-IF(EXISTS ${OCAFBROWSER_ROOT_DIR})
+IF(EXISTS ${DFBROWSER_ROOT_DIR})
     SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} ${DFBrowserAPI})
-    SET(PROJECT_INCLUDES ${PROJECT_INCLUDES} ${OCAFBROWSER_INCLUDE_DIR})
+    SET(PROJECT_INCLUDES ${PROJECT_INCLUDES} ${DFBROWSER_INCLUDE_DIR})
 
-    ADD_DEFINITIONS(-DOCAFBROWSER)
+    ADD_DEFINITIONS(-DDFBROWSER)
 ENDIF()
 
 ADD_DEFINITIONS(-DMODEL_EXPORTS ${CAS_DEFINITIONS})
index 2879897154ad7f740725afb1aaa6849cb2679054..ac84508a241bf10e3f4f52c3ae65ac8efbbed2d6 100644 (file)
@@ -9,9 +9,8 @@
 
 #include <ModelAPI_Events.h>
 
-#ifdef OCAFBROWSER
-#include <DFBrowserAPI_PluginMgr.h>
-#include <DFBrowserAPI_Communicator.h>
+#ifdef DFBROWSER
+#include <DFBrowserAPI_Communicator.hxx>
 
 static bool FirstCall = true;
 #endif
@@ -24,11 +23,13 @@ static Handle_Model_Application TheApplication = new Model_Application;
 //=======================================================================
 Handle(Model_Application) Model_Application::getApplication()
 {
-#ifdef OCAFBROWSER
-    if (FirstCall) {
-      DFBrowserAPI_PluginMgr::activateBrowser("OCAFBrowser.dll", TheApplication);
-      FirstCall = false;
-    }
+#ifdef DFBROWSER
+  if (FirstCall) {
+    DFBrowserAPI_Communicator* aCommunicator =
+                   DFBrowserAPI_Communicator::loadPluginLibrary("DFBrowser.dll");
+    aCommunicator->setApplication(TheApplication);
+    FirstCall = false;
+  }
 #endif
   return TheApplication;
 }
index 79febfc4e347d82f36b6e9efe05f492e68d9728a..d47d1ec0b41f7b6b8d7c2e2ddd243e7d6e7241f3 100755 (executable)
@@ -76,7 +76,7 @@ Model_Document::Model_Document(const int theID, const std::string theKind)
     : myID(theID), myKind(theKind), myIsActive(false),
       myDoc(new TDocStd_Document("BinOcaf"))  // binary OCAF format
 {
-#ifdef OCAFBROWSER
+#ifdef DFBROWSER
   CDF_Session::CurrentSession()->Directory()->Add(myDoc);
 #endif
   myObjs = new Model_Objects(myDoc->Main());
index 222f5d2aa3e0293295624f7900b90f6a052cb8e4..ca942c29ca06c9a5da44e23f577ace33b24fd797 100644 (file)
@@ -129,6 +129,13 @@ SET(PROJECT_INCLUDES
     ${CAS_INCLUDE_DIRS}
     ${SUIT_INCLUDE})
 
+IF(EXISTS ${VINSPECTOR_ROOT_DIR})
+    SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} ${VInspectorAPI})
+    SET(PROJECT_INCLUDES ${PROJECT_INCLUDES} ${VINSPECTOR_INCLUDE_DIR})
+
+    ADD_DEFINITIONS(-DVINSPECTOR)
+ENDIF()
+
 IF(NOT ${HAVE_SALOME})
     SET(PROJECT_INCLUDES ${PROJECT_INCLUDES} ${APPELEMENTS_INCLUDE_DIR})
 ENDIF(NOT ${HAVE_SALOME})
index aad07467f392ca64b492c1f251358eac385fb22c..a504708cf4fb4363b8e8ed45866cce1a245b2d16 100644 (file)
   #include <AppElements_Viewer.h>
 #endif
 
+#ifdef VINSPECTOR\r
+#include <VInspectorAPI_PluginMgr.h>\r
+#include <VInspectorAPI_Communicator.h>\r
+
+static bool FirstCall = true;\r
+
+#endif
+
 #include <ModuleBase_IViewWindow.h>
 
 #include <QEvent>
@@ -35,11 +43,22 @@ void XGUI_ViewerProxy::connectViewProxy()
 
 Handle(AIS_InteractiveContext) XGUI_ViewerProxy::AISContext() const
 {
+  Handle(AIS_InteractiveContext) aContext;
 #ifdef HAVE_SALOME
-  return myWorkshop->salomeConnector()->viewer()->AISContext();
+  aContext = myWorkshop->salomeConnector()->viewer()->AISContext();
 #else
-  return myWorkshop->mainWindow()->viewer()->AISContext();
+  aContext = myWorkshop->mainWindow()->viewer()->AISContext();
 #endif
+
+#ifdef VINSPECTOR\r
+  if (FirstCall) {\r
+    VInspectorAPI_PluginMgr::activateVInspector("VInspector.dll", aContext);
+    FirstCall = false;
+  }
+#endif
+
+
+  return aContext;
 }
 
 Handle(AIS_Trihedron) XGUI_ViewerProxy::trihedron() const