${CAS_SHAPE}
${CAS_TKBO}
)
-
-
-
-ADD_DEFINITIONS(-DMODEL_EXPORTS ${CAS_DEFINITIONS})
-ADD_LIBRARY(Model SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
-TARGET_LINK_LIBRARIES(Model ${PROJECT_LIBRARIES})
-
-INCLUDE_DIRECTORIES(
+SET(PROJECT_INCLUDES
../ModelAPI
../Events
../Config
${CAS_INCLUDE_DIRS}
)
+
+IF(EXISTS ${OCAFBROWSER_ROOT_DIR})
+ SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} ${DFBrowserAPI})
+ SET(PROJECT_INCLUDES ${PROJECT_INCLUDES} ${OCAFBROWSER_INCLUDE_DIR})
+
+ ADD_DEFINITIONS(-DOCAFBROWSER)
+ENDIF()
+
+ADD_DEFINITIONS(-DMODEL_EXPORTS ${CAS_DEFINITIONS})
+ADD_LIBRARY(Model SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
+TARGET_LINK_LIBRARIES(Model ${PROJECT_LIBRARIES})
+
+INCLUDE_DIRECTORIES(${PROJECT_INCLUDES})
+
INSTALL(TARGETS Model DESTINATION ${SHAPER_INSTALL_BIN})
#include <ModelAPI_Events.h>
+#ifdef OCAFBROWSER
+#include <DFBrowserAPI_PluginMgr.h>
+#include <DFBrowserAPI_Communicator.h>
+
+static bool FirstCall = true;
+#endif
+
IMPLEMENT_STANDARD_HANDLE(Model_Application, TDocStd_Application)
IMPLEMENT_STANDARD_RTTIEXT(Model_Application, TDocStd_Application)
//=======================================================================
Handle(Model_Application) Model_Application::getApplication()
{
+#ifdef OCAFBROWSER
+ if (FirstCall) {
+ DFBrowserAPI_PluginMgr::activateBrowser("OCAFBrowser.dll", TheApplication);
+ FirstCall = false;
+ }
+#endif
return TheApplication;
}
#include <OSD_File.hxx>
#include <OSD_Path.hxx>
+#include <CDF_Session.hxx>
+#include <CDF_Directory.hxx>
#include <climits>
#ifndef WIN32
: myID(theID), myKind(theKind), myIsActive(false),
myDoc(new TDocStd_Document("BinOcaf")) // binary OCAF format
{
+#ifdef OCAFBROWSER
+ CDF_Session::CurrentSession()->Directory()->Add(myDoc);
+#endif
myObjs = new Model_Objects(myDoc->Main());
myDoc->SetUndoLimit(UNDO_LIMIT);
myTransactionSave = 0;