]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update to use the latest version of TInspector (OCCT 7.5.3)
authorArtem Zhidkov <Artem.Zhidkov@gmail.com>
Sun, 18 Apr 2021 19:50:31 +0000 (22:50 +0300)
committerazv <azv@opencascade.com>
Mon, 4 Oct 2021 10:38:28 +0000 (13:38 +0300)
src/Model/Model_Document.cpp
src/Model/Model_Session.h
src/ModelAPI/CMakeLists.txt
src/ModelAPI/ModelAPI_Session.h
src/XGUI/XGUI_Workshop.cpp

index 94903c205b044a660676fc5b2cc9ae43219adca8..505b77f3647d91ff9dab7230d1fbf16bd047766f 100644 (file)
@@ -75,7 +75,6 @@
 #include <OSD_Protection.hxx>
 
 #ifdef TINSPECTOR
-#include <CDF_Session.hxx>
 #include <CDF_Directory.hxx>
 #endif
 
@@ -117,7 +116,7 @@ Model_Document::Model_Document(const int theID, const std::string theKind)
       myIsSetCurrentFeature(false)
 {
 #ifdef TINSPECTOR
-  CDF_Session::CurrentSession()->Directory()->Add(myDoc);
+  ModelAPI_Session::get()->application()->NewDocument("BinOcaf", myDoc);
 #endif
   myObjs = new Model_Objects(myDoc->Main());
   myDoc->SetUndoLimit(UNDO_LIMIT);
index af47051239a97eb6bb5ffe347717bdf849e7b2af..218659d5a887dc4c5734fa32ad4eaf9435df82e3 100644 (file)
 #include <Events_Listener.h>
 #include <map>
 
+#ifdef TINSPECTOR
+#include "Model_Application.h"
+#endif
+
 class Model_Document;
 
 /**\class Model_Session
@@ -155,6 +159,12 @@ class Model_Session : public ModelAPI_Session, public Events_Listener
   /// Set state of the auto-update of features result in the application
   MODEL_EXPORT virtual void blockAutoUpdate(const bool theBlock);
 
+#ifdef TINSPECTOR
+  MODEL_EXPORT virtual Handle(TDocStd_Application) application() {
+    return Model_Application::getApplication();
+  }
+#endif
+
  protected:
   /// Loads (if not done yet) the information about the features and plugins
   void LoadPluginsInfo();
index c6a298461b7dcd1b40c05f563a50ef25f1c8ec99..d2d565eee5fcf6aede037889cb2cbc3906c8c5de 100644 (file)
@@ -122,6 +122,10 @@ SET(PROJECT_LIBRARIES
 SET(CMAKE_SWIG_FLAGS -threads -w325,321,362,383,302,403,451,473)
 ADD_DEFINITIONS(-DMODELAPI_EXPORTS)
 
+IF(TKTInspector)
+    ADD_DEFINITIONS(-DTINSPECTOR)
+ENDIF()
+
 ADD_LIBRARY(ModelAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
 SET_TARGET_PROPERTIES(ModelAPI PROPERTIES LINKER_LANGUAGE CXX)
 TARGET_LINK_LIBRARIES(ModelAPI ${PROJECT_LIBRARIES})
@@ -131,6 +135,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Config
                     ${PROJECT_SOURCE_DIR}/src/GeomAPI
                     ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
                     ${PROJECT_SOURCE_DIR}/src/Locale
+                    ${OpenCASCADE_INCLUDE_DIR}
 )
 
 
index e5db16f7588b7e511549161dd7ac2a33ae5f8dad..339263fb0f0ceccd48008f63fdf2829226396c6f 100644 (file)
 #include <list>
 #include <memory>
 
+#ifdef TINSPECTOR
+#include <Standard_Handle.hxx>
+#include <TDocStd_Application.hxx>
+#endif
+
 class ModelAPI_Feature;
 class ModelAPI_Plugin;
 class ModelAPI_Document;
@@ -138,6 +143,10 @@ class MODELAPI_EXPORT ModelAPI_Session
   /// Set state of the auto-update of features result in the application
   virtual void blockAutoUpdate(const bool theBlock) = 0;
 
+#ifdef TINSPECTOR
+  virtual Handle(TDocStd_Application) application() = 0;
+#endif
+
  protected:
   /// Sets the session interface implementation (once per application launch)
   static void setSession(std::shared_ptr<ModelAPI_Session> theManager);
index e68c986e624687d2bcf603741e49c11e82a4b511..14756f93490871bfffff23a4189df4ca556d3f5f 100644 (file)
 #include <iterator>
 
 #ifdef TINSPECTOR
-#include <CDF_Session.hxx>
-#include <CDF_Application.hxx>
+#include <TDocStd_Application.hxx>
 #include <inspector/TInspector_Communicator.hxx>
 #include <inspector/VInspector_CallBack.hxx>
 static TInspector_Communicator* MyTCommunicator;
 static Handle(VInspector_CallBack) MyVCallBack;
-
 #endif
 
 #ifdef _DEBUG
@@ -1824,7 +1822,7 @@ void XGUI_Workshop::onContextMenuCommand(const QString& theId, bool isChecked)
   }
 #ifdef TINSPECTOR
   else if (theId == "TINSPECTOR_VIEW") {
-    Handle(CDF_Application) anApplication = CDF_Session::CurrentSession()->CurrentApplication();
+    Handle(TDocStd_Application) anApplication = ModelAPI_Session::get()->application();
     if (!anApplication.IsNull())
     {
       if (!MyTCommunicator)