mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0029747: Samples - Inspector tool - start DFBrowser inside FuncDemo qt sample
new Model->DFBrowser action to start Inspector tool with active DFBrowser plugin filled by the sample OCAF application. To update content of the DFBrowser, use <F5> shortcut.
This commit is contained in:
parent
2e93433ee5
commit
ed667b9069
@ -3,3 +3,7 @@ project(FuncDemo)
|
|||||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_sample)
|
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_sample)
|
||||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
|
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
|
||||||
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_sample)
|
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit_prepare_sample)
|
||||||
|
|
||||||
|
if (BUILD_Inspector)
|
||||||
|
target_link_libraries (FuncDemo TKTInspector)
|
||||||
|
endif()
|
||||||
|
@ -84,6 +84,11 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_Inspector
|
||||||
|
#include <inspector/TInspector_Communicator.hxx>
|
||||||
|
static TInspector_Communicator* MyTCommunicator;
|
||||||
|
#endif
|
||||||
|
|
||||||
MainWindow::MainWindow()
|
MainWindow::MainWindow()
|
||||||
{
|
{
|
||||||
graph = new GraphWidget(this);
|
graph = new GraphWidget(this);
|
||||||
@ -224,6 +229,30 @@ void MainWindow::nbThreads()
|
|||||||
graph->setNbThreads(nb);
|
graph->setNbThreads(nb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_Inspector
|
||||||
|
void MainWindow::startDFBrowser()
|
||||||
|
{
|
||||||
|
Handle(AppStd_Application) anApplication = getApplication();
|
||||||
|
if (!anApplication.IsNull())
|
||||||
|
{
|
||||||
|
if (!MyTCommunicator)
|
||||||
|
{
|
||||||
|
MyTCommunicator = new TInspector_Communicator();
|
||||||
|
|
||||||
|
NCollection_List<Handle(Standard_Transient)> aParameters;
|
||||||
|
aParameters.Append(anApplication);
|
||||||
|
|
||||||
|
MyTCommunicator->RegisterPlugin("TKDFBrowser");
|
||||||
|
|
||||||
|
MyTCommunicator->Init(aParameters);
|
||||||
|
MyTCommunicator->Activate("TKDFBrowser");
|
||||||
|
|
||||||
|
}
|
||||||
|
MyTCommunicator->SetVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void MainWindow::about()
|
void MainWindow::about()
|
||||||
{
|
{
|
||||||
QMessageBox::about(this, tr("Test-application of the advanced Function Mechanism"),
|
QMessageBox::about(this, tr("Test-application of the advanced Function Mechanism"),
|
||||||
@ -250,6 +279,12 @@ void MainWindow::createActions()
|
|||||||
nbThreadsAct->setStatusTip(tr("Number of threads"));
|
nbThreadsAct->setStatusTip(tr("Number of threads"));
|
||||||
connect(nbThreadsAct, SIGNAL(triggered()), this, SLOT(nbThreads()));
|
connect(nbThreadsAct, SIGNAL(triggered()), this, SLOT(nbThreads()));
|
||||||
|
|
||||||
|
#ifdef HAVE_Inspector
|
||||||
|
dfBrowserAct = new QAction(tr("DFBrowser"), this);
|
||||||
|
dfBrowserAct->setStatusTip(tr("OCAF structure presentation"));
|
||||||
|
connect(dfBrowserAct, SIGNAL(triggered()), this, SLOT(startDFBrowser()));
|
||||||
|
#endif
|
||||||
|
|
||||||
exitAct = new QAction(tr("E&xit"), this);
|
exitAct = new QAction(tr("E&xit"), this);
|
||||||
exitAct->setShortcut(tr("Ctrl+Q"));
|
exitAct->setShortcut(tr("Ctrl+Q"));
|
||||||
exitAct->setStatusTip(tr("Exit the application"));
|
exitAct->setStatusTip(tr("Exit the application"));
|
||||||
@ -269,6 +304,10 @@ void MainWindow::createMenus()
|
|||||||
computeMenu->addAction(computeAct);
|
computeMenu->addAction(computeAct);
|
||||||
computeMenu->addAction(nbThreadsAct);
|
computeMenu->addAction(nbThreadsAct);
|
||||||
computeMenu->addSeparator();
|
computeMenu->addSeparator();
|
||||||
|
#ifdef HAVE_Inspector
|
||||||
|
computeMenu->addAction(dfBrowserAct);
|
||||||
|
computeMenu->addSeparator();
|
||||||
|
#endif
|
||||||
computeMenu->addAction(exitAct);
|
computeMenu->addAction(exitAct);
|
||||||
|
|
||||||
menuBar()->addSeparator();
|
menuBar()->addSeparator();
|
||||||
|
@ -70,6 +70,9 @@ private slots:
|
|||||||
void model2();
|
void model2();
|
||||||
void compute();
|
void compute();
|
||||||
void nbThreads();
|
void nbThreads();
|
||||||
|
#ifdef HAVE_Inspector
|
||||||
|
void startDFBrowser();
|
||||||
|
#endif
|
||||||
void about();
|
void about();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -87,6 +90,9 @@ private:
|
|||||||
QAction *model2Act;
|
QAction *model2Act;
|
||||||
QAction *computeAct;
|
QAction *computeAct;
|
||||||
QAction *nbThreadsAct;
|
QAction *nbThreadsAct;
|
||||||
|
#ifdef HAVE_Inspector
|
||||||
|
QAction *dfBrowserAct;
|
||||||
|
#endif
|
||||||
QAction *exitAct;
|
QAction *exitAct;
|
||||||
QAction *aboutAct;
|
QAction *aboutAct;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user