myDesktop = theDesktop;
myModel = theModel;
setViewManager(myModel->getViewManager());
- myPVMgr = qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
+ /*myPVMgr = qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
if (myPVMgr) {
SUIT_Application* app = SUIT_Session::session()->activeApplication();
if ( app )
myPVMgr->show();
setCentralWidget( myPVMgr );
} else
- qDebug("No multiViewManager defined");
+ qDebug("No multiViewManager defined");*/
}
/*!
#include <pqServerResource.h>
#include <pqView.h>
#include <pqPVApplicationCore.h>
+#include <pqParaViewBehaviors.h>
#include <QVBoxLayout>
#include <QApplication>
{
DBG_FUN();
setTitle( PV3DViewer_ViewManager::tr( "PARAVIEW3D_VIEW_TITLE" ) );
- int argc = 1;
- char *argv[2];
- argv[0] = strdup("salome");
- argv[1] = nullptr;
+ /*QStringList args = QCoreApplication::arguments();
+ int argc = args.length();
+ char **argv = new char *[argc+1];
+ for(auto i = 0 ; i < argc ; ++i)
+ argv[i] = strdup(args[i].toStdString().c_str());
+ argv[argc] = nullptr;
pqPVApplicationCore appPV(argc,argv);
QApplication::instance()->installEventFilter(&appPV);
+ new pqParaViewBehaviors(theDesktop,theDesktop);
pqObjectBuilder *builder(pqApplicationCore::instance()->getObjectBuilder());
pqServer *serv(pqApplicationCore::instance()->getServerManagerModel()->findServer(pqServerResource("builtin:")));
pqView *view=builder->createView(QString("RenderView"),serv);
- static_cast<SPV3D_ViewModel *>(this->getViewModel())->setView(view);
+ static_cast<SPV3D_ViewModel *>(this->getViewModel())->setView(view);*/
//QVBoxLayout *lay(new QVBoxLayout(theDesktop));
//lay->addWidget( view->widget() );
- view->widget()->setParent( theDesktop);
+ //view->widget()->setParent( theDesktop);
// Initialize minimal paraview stuff (if not already done)
//PVViewer_InitSingleton::Init(theDesktop);
#include "QtxActionToolMgr.h"
#include "QtxBackgroundTool.h"
+#include <pqObjectBuilder.h>
+#include <pqApplicationCore.h>
+#include <pqServerManagerModel.h>
+#include <pqServerResource.h>
+#include <pqView.h>
+#include <pqPVApplicationCore.h>
+#include <pqParaViewBehaviors.h>
+
+#include <QApplication>
+
// VSR: Uncomment below line to allow texture background support in PV3D viewer
#define PV3D_ENABLE_TEXTURED_BACKGROUND
void SPV3D_ViewModel::initialize()
{
DBG_FUN();
-
- const auto* builder = pqApplicationCore::instance()->getObjectBuilder();
- QObject::connect(builder, &pqObjectBuilder::sourceCreated, this, &SPV3D_ViewModel::onSourceCreated);
}
SPV3D_ViewWindow* aViewWindow = new SPV3D_ViewWindow(theDesktop, this);
aViewWindow->SetSelectionEnabled( isSelectionEnabled() );
+
+ QStringList args = QCoreApplication::arguments();
+ int argc = args.length();
+ char **argv = new char *[argc+1];
+ for(auto i = 0 ; i < argc ; ++i)
+ argv[i] = strdup(args[i].toStdString().c_str());
+ argv[argc] = nullptr;
+ pqPVApplicationCore appPV(argc,argv);
+ QApplication::instance()->installEventFilter(&appPV);
+ new pqParaViewBehaviors(aViewWindow,aViewWindow);
+ pqObjectBuilder *builder(pqApplicationCore::instance()->getObjectBuilder());
+ QObject::connect(builder, &pqObjectBuilder::sourceCreated, this, &SPV3D_ViewModel::onSourceCreated);
+ pqServer *serv(pqApplicationCore::instance()->getServerManagerModel()->findServer(pqServerResource("builtin:")));
+ pqView *view=builder->createView(QString("RenderView"),serv);
+ setView(view);
+
+ aViewWindow->init();
return aViewWindow;
}
#include <QXmlStreamReader>
#include <QXmlStreamAttributes>
+#include <pqView.h>
+
#include "QtxAction.h"
#include "SUIT_Session.h"
*/
SPV3D_ViewWindow::SPV3D_ViewWindow(SUIT_Desktop* theDesktop, SPV3D_ViewModel* theModel):
PV3DViewer_ViewWindow(theDesktop, theModel),
- myModel(theModel),
- myView(NULL)
+ myModel(theModel)
{
DBG_FUN();
}
+void SPV3D_ViewWindow::init()
+{
+ QWidget *wid = myModel->getView()->widget();
+ wid->setParent( this );
+ setCentralWidget( myModel->getView()->widget() );
+}
+
/*!
Destructor
*/
//! To construct #SPV3D_ViewWindow instance
SPV3D_ViewWindow(SUIT_Desktop* theDesktop, SPV3D_ViewModel* theModel);
+ void init();
+
virtual ~SPV3D_ViewWindow();
/* display */
void onMouseMoving(QMouseEvent* event);
protected:
- SPV3D_View* myView;
SPV3D_ViewModel* myModel;
};