#include <OSD_Protection.hxx>
#ifdef TINSPECTOR
-#include <CDF_Session.hxx>
#include <CDF_Directory.hxx>
#endif
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);
#include <Events_Listener.h>
#include <map>
+#ifdef TINSPECTOR
+#include "Model_Application.h"
+#endif
+
class Model_Document;
/**\class Model_Session
/// 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();
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})
${PROJECT_SOURCE_DIR}/src/GeomAPI
${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
${PROJECT_SOURCE_DIR}/src/Locale
+ ${OpenCASCADE_INCLUDE_DIR}
)
#include <list>
#include <memory>
+#ifdef TINSPECTOR
+#include <Standard_Handle.hxx>
+#include <TDocStd_Application.hxx>
+#endif
+
class ModelAPI_Feature;
class ModelAPI_Plugin;
class ModelAPI_Document;
/// 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);
#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
}
#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)