-#ifdef VINSPECTOR
- else if (theId == "VINSPECTOR_VIEW") {
- if (VInspector_FirstCall) {
- VInspectorAPI_Communicator* aCommunicator = VInspectorAPI_PluginMgr::activateVInspector(
- "VInspector.dll", viewer()->AISContext());
- displayer()->setCallBack(aCommunicator->getCallBack());
- #ifndef HAVE_SALOME
- AppElements_Viewer* aViewer = mainWindow()->viewer();
- if (aViewer)
- aViewer->setCallBack(aCommunicator->getCallBack());
- #endif
- VInspector_FirstCall = false;
- }
- }
-#endif
-#ifdef DFBROWSER
- else if (theId == "DFBROWSER_VIEW") {
- if (DFBrowser_FirstCall) {
- Handle(CDF_Application) anApplication = CDF_Session::CurrentSession()->CurrentApplication();
-
- DFBrowserAPI_Communicator* aCommunicator =
- DFBrowserAPI_Communicator::loadPluginLibrary("DFBrowser.dll");
- aCommunicator->setApplication(anApplication);
- DFBrowser_FirstCall = false;
+#ifdef TINSPECTOR
+ else if (theId == "TINSPECTOR_VIEW") {
+ Handle(CDF_Application) anApplication = CDF_Session::CurrentSession()->CurrentApplication();
+ if (!anApplication.IsNull())
+ {
+ if (!MyTCommunicator)
+ {
+ MyTCommunicator = new TInspector_Communicator();
+
+ NCollection_List<Handle(Standard_Transient)> aParameters;
+ aParameters.Append(anApplication);
+ Handle(AIS_InteractiveContext) aContext = viewer()->AISContext();
+ if (!aContext.IsNull())
+ aParameters.Append(aContext);
+
+ MyVCallBack = new VInspector_CallBack();
+ myDisplayer->setCallBack(MyVCallBack);
+ #ifndef HAVE_SALOME
+ AppElements_Viewer* aViewer = mainWindow()->viewer();
+ if (aViewer)
+ aViewer->setCallBack(MyVCallBack);
+ #endif
+ aParameters.Append(MyVCallBack);
+
+ MyTCommunicator->RegisterPlugin("SMBrowser"); // custom plugin to view ModelAPI
+
+ MyTCommunicator->Init(aParameters);
+ MyTCommunicator->Activate("SMBrowser"); // to have button in TInspector
+ MyTCommunicator->Activate("TKVInspector"); // to have filled callback by model
+ MyTCommunicator->Activate("TKDFBrowser");
+ }
+ MyTCommunicator->SetVisible(true);