#include "VVTK_View.h"
#include "VVTK_InteractorStyle.h"
+#include "SVTK_RenderWindowInteractor.h"
+#include "SVTK_Renderer.h"
+
#include "SUIT_ResourceMgr.h"
#include "QtxAction.h"
VVTK_MainWindow
::VVTK_MainWindow(QWidget* theParent,
const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- bool theIsBase):
+ SUIT_ResourceMgr* theResourceMgr):
SVTK_MainWindow(theParent,theName,theResourceMgr),
- myInteractorStyle(VVTK_InteractorStyle::New()),
- myIsBase(theIsBase)
+ myInteractorStyle(VVTK_InteractorStyle::New())
{
myInteractorStyle->Delete();
this->moveDockWindow(myToolBar,Qt::DockLeft);
- myToolBar2 = new QToolBar(this);
- myToolBar2->setCloseMode(QDockWindow::Undocked);
- myToolBar2->setLabel(tr("LBL_TOOLBAR_LABEL"));
- this->moveDockWindow(myToolBar2,Qt::DockLeft);
+ myPtsToolBar = new QToolBar(this);
+ myPtsToolBar->setCloseMode(QDockWindow::Undocked);
+ myPtsToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+ this->moveDockWindow(myPtsToolBar,Qt::DockLeft);
QPixmap aPixmap;
QtxAction* anAction;
anAction->setToggleAction(true);
anAction->setStatusTip(tr("DSC_VVTK_INTERACTOR_STYLE_SWITCH"));
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onInteractorStyleSwitch(bool)));
- anAction->addTo( myToolBar2 );
+ anAction->addTo( myPtsToolBar );
aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SELECTION_MODE_SWITCH"));
anAction = new QtxAction(tr("MNU_VVTK_SELECTION_MODE_SWITCH"),
anAction->setToggleAction(true);
anAction->setStatusTip(tr("DSC_VVTK_SELECTION_MODE_SWITCH"));
connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSelectionModeSwitch(bool)));
- anAction->addTo( myToolBar2 );
+ anAction->addTo( myPtsToolBar );
}
void
::sizeHint() const
{
QWidget* aParent = parentWidget();
- float aCoeff = 2.0/3.0;
- if(!myIsBase)
- aCoeff = 1.0/3.0;
-
+ static float aCoeff = 2.0/3.0;
int aWidth = int(aCoeff*aParent->width());
int aHeight = int(aCoeff*aParent->height());
+
return QSize(aWidth,aHeight);
}
{
SetSelectionMode(theIsSelectionOn? NodeSelection: ActorSelection);
}
+
+
+//----------------------------------------------------------------------------
+VVTK_SMainWindow
+::VVTK_SMainWindow(QWidget* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr):
+ VVTK_MainWindow(theParent,theName,theResourceMgr)
+{}
+
+void
+VVTK_SMainWindow
+::Initialize()
+{
+ SetInteractor(new SVTK_RenderWindowInteractor(this,"SVTK_RenderWindowInteractor"));
+
+ SVTK_Renderer* aRenderer = SVTK_Renderer::New();
+ GetInteractor()->SetRenderer(aRenderer);
+ aRenderer->Delete();
+
+ SVTK_InteractorStyle* aStyle = SVTK_InteractorStyle::New();
+ GetInteractor()->PushInteractorStyle(aStyle);
+ aStyle->Delete();
+
+ // important! : the default interactor style which is pushed is VVTK
+ // see onInteractorStyleSwitch() for details
+ PushInteractorStyle(myInteractorStyle.GetPointer());
+}
+
+VVTK_SMainWindow
+::~VVTK_SMainWindow()
+{}
+
+
+//----------------------------------------------------------------------------
+QSize
+VVTK_SMainWindow
+::sizeHint() const
+{
+ QWidget* aParent = parentWidget();
+ static float aCoeff = 1.0/3.0;
+ int aWidth = int(aCoeff*aParent->width());
+ int aHeight = int(aCoeff*aParent->height());
+
+ return QSize(aWidth,aHeight);
+}
aLayout->setAutoAdd(true);
QSplitter* aSplitter = new QSplitter(Qt::Vertical,aWidget);
- myVMainWindow[0] = new VVTK_MainWindow(aSplitter,
- "SVTK_MainWindow",
- aResourceMgr,
- true);
- myVMainWindow[0]->Initialize();
+ myMainWindow = new VVTK_MainWindow(aSplitter,
+ "VVTK_MainWindow",
+ aResourceMgr);
+ myMainWindow->Initialize();
- myVView[0] = new SVTK_View(myVMainWindow[0]);
-
- myVMainWindow[1] = new VVTK_MainWindow(aSplitter,
- "SVTK_MainWindow",
- aResourceMgr,
- false);
- myVMainWindow[1]->Initialize();
+ myView = new SVTK_View(myMainWindow);
+ SVTK_ViewWindow::Initialize(myView,theModel);
- myVView[1] = new SVTK_View(myVMainWindow[0]);
+ mySMainWindow = new VVTK_SMainWindow(aSplitter,
+ "VVTK_SegmantationWindow",
+ aResourceMgr);
+ mySMainWindow->Initialize();
- myView = myVView[0];
- myMainWindow = myVMainWindow[0];
- SVTK_ViewWindow::Initialize(myView,theModel);
+ mySView = new SVTK_View(mySMainWindow);
}
}