@COMMENCE@
-SUBDIRS = CONVERTOR PIPELINE OBJECT ENGINE VVTK GUITOOLS VISU_I VISUGUI VISU_SWIG
+SUBDIRS = CONVERTOR PIPELINE OBJECT VVTK GUITOOLS VISU_I VISUGUI VISU_SWIG ENGINE
@MODULE@
"Content-Type: text/plain; charset=iso-8859-1\n"
+msgid "ICON_GAUSS_NEW_VIEWER"
+msgstr "Visu_points.png"
+
msgid "ICON_VVTK_INTERACTOR_STYLE_SWITCH"
msgstr "Visu_vvtk_switch.png"
msgid "ICON_VVTK_SELECTION_MODE_SWITCH"
msgstr "Visu_points.png"
+msgid "ICON_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Visu_PlaneSegmentation.png"
+
msgid "ICON_LOAD_TEXTURE"
msgstr "Visu_load_texture.png"
msgid "VVTK_ViewManager::VTK_VIEW_TITLE"
msgstr "VISU scene:%1 - viewer:%2"
-msgid "VVTK_ViewWindow::MNU_VVTK_INTERACTOR_STYLE_SWITCH"
+msgid "VVTK_MainWindowBase::MNU_VVTK_INTERACTOR_STYLE_SWITCH"
msgstr "Interaction Style Switch"
-msgid "VVTK_ViewWindow::DSC_VVTK_INTERACTOR_STYLE_SWITCH"
+msgid "VVTK_MainWindowBase::DSC_VVTK_INTERACTOR_STYLE_SWITCH"
msgstr "Interaction Style Switch"
-msgid "VVTK_ViewWindow::MNU_VVTK_SELECTION_MODE_SWITCH"
+msgid "VVTK_MainWindowBase::MNU_VVTK_SELECTION_MODE_SWITCH"
msgstr "Selection Mode Switch"
-msgid "VVTK_ViewWindow::DSC_VVTK_SELECTION_MODE_SWITCH"
+msgid "VVTK_MainWindowBase::DSC_VVTK_SELECTION_MODE_SWITCH"
msgstr "Selection Mode Switch"
+msgid "VVTK_MainWindow::MNU_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Plane Segmentation Switch"
+
+msgid "VVTK_MainWindow::DSC_VVTK_PLANE_SEGMENTATION_SWITCH"
+msgstr "Plane Segmentation Switch"
+
msgid "VisuGUI_GaussPointsDlg::&Cancel"
msgstr ""
{
VisuGUI::initialize( theApp );
- // create actions and add menus
- createAction( GAUSS_NEW_VIEWER, tr("MEN_GAUSS_NEW_VIEWER"), QIconSet(),
- tr("MEN_GAUSS_NEW_VIEWER"), "", 0, this, false,
- this, SLOT(onCreateViewManager()));
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+ QPixmap aPixmap;
+ aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER"));
+ createAction( GAUSS_NEW_VIEWER,
+ tr("MEN_GAUSS_NEW_VIEWER"),
+ aPixmap,
+ tr("MEN_GAUSS_NEW_VIEWER"),
+ tr("MEN_GAUSS_NEW_VIEWER"),
+ ALT+Key_S,
+ this,
+ false,
+ this,
+ SLOT(onCreateViewManager()));
int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 );
int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 );
int gaussMenu = createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 );
VVTK_ViewModel.cxx \
VVTK_InteractorStyle.cxx \
VVTK_ViewWindow.cxx \
+ VVTK_Renderer.cxx \
VVTK_View.cxx
LIB_MOC = VVTK_ViewWindow.h \
--- /dev/null
+// SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File :
+// Author :
+// Module :
+// $Header$
+
+#include "VVTK_Renderer.h"
+
+#include "VISU_GaussPtsAct.h"
+
+#include <vtkObjectFactory.h>
+#include <vtkImplicitPlaneWidget.h>
+#include <vtkProperty.h>
+
+#include <vtkRenderWindowInteractor.h>
+#include <vtkCallbackCommand.h>
+#include <vtkCommand.h>
+#include <vtkPlane.h>
+
+#include "utilities.h"
+
+#ifdef _DEBUG_
+static int MYDEBUG = 1;
+#else
+static int MYDEBUG = 0;
+#endif
+
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(VVTK_Renderer1);
+
+//----------------------------------------------------------------------------
+VVTK_Renderer1
+::VVTK_Renderer1():
+ myImplicitPlaneWidget(vtkImplicitPlaneWidget::New())
+{
+ if(MYDEBUG) INFOS("VVTK_Renderer1() - "<<this);
+
+ myImplicitPlaneWidget->SetPlaceFactor(1.0);
+ myImplicitPlaneWidget->SetOutlineTranslation(false);
+ vtkProperty* aSelectedPlaneProperty = myImplicitPlaneWidget->GetSelectedPlaneProperty();
+ vtkProperty* aPlaneProperty = myImplicitPlaneWidget->GetPlaneProperty();
+ aPlaneProperty->SetOpacity(aSelectedPlaneProperty->GetOpacity()*1.5);
+
+ myImplicitPlaneWidget->Delete();
+}
+
+VVTK_Renderer1
+::~VVTK_Renderer1()
+{
+ if(MYDEBUG) INFOS("~VVTK_Renderer1() - "<<this);
+ myImplicitPlaneWidget->SetInteractor(NULL);
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_Renderer1
+::SetInteractor(vtkRenderWindowInteractor* theInteractor)
+{
+ SVTK_Renderer::SetInteractor(theInteractor);
+ myImplicitPlaneWidget->SetInteractor(theInteractor);
+}
+
+//----------------------------------------------------------------------------
+vtkImplicitPlaneWidget*
+VVTK_Renderer1
+::GetImplicitPlaneWidget()
+{
+ return myImplicitPlaneWidget.GetPointer();
+}
+
+//----------------------------------------------------------------------------
+bool
+VVTK_Renderer1
+::OnAdjustActors()
+{
+ if(SVTK_Renderer::OnAdjustActors()){
+ myImplicitPlaneWidget->PlaceWidget(myBndBox);
+ myImplicitPlaneWidget->SetOrigin((myBndBox[1] + myBndBox[0]) / 2.0,
+ (myBndBox[3] + myBndBox[2]) / 2.0,
+ (myBndBox[5] + myBndBox[4]) / 2.0);
+ myImplicitPlaneWidget->SetHandleSize(myImplicitPlaneWidget->GetHandleSize());
+ return true;
+ }
+ return false;
+}
+
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(VVTK_Renderer2);
+
+//----------------------------------------------------------------------------
+VVTK_Renderer2
+::VVTK_Renderer2():
+ myEventCallbackCommand(vtkCallbackCommand::New()),
+ myFunction(vtkPlane::New())
+{
+ if(MYDEBUG) INFOS("VVTK_Renderer2() - "<<this);
+ myEventCallbackCommand->Delete();
+ myFunction->Delete();
+
+ myPriority = 0.0;
+ myEventCallbackCommand->SetClientData(this);
+ myEventCallbackCommand->SetCallback(VVTK_Renderer2::ProcessEvents);
+}
+
+VVTK_Renderer2
+::~VVTK_Renderer2()
+{
+ if(MYDEBUG) INFOS("~VVTK_Renderer2() - "<<this);
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_Renderer2
+::SetRenderer1(VVTK_Renderer1* theRenderer)
+{
+ myRenderer1 = theRenderer;
+ myImplicitPlaneWidget1 = myRenderer1->GetImplicitPlaneWidget();
+ myImplicitPlaneWidget1->AddObserver(vtkCommand::EndInteractionEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+
+}
+
+void
+VVTK_Renderer2
+::ProcessEvents(vtkObject* vtkNotUsed(theObject),
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
+{
+ VVTK_Renderer2* self = reinterpret_cast<VVTK_Renderer2*>(theClientData);
+
+ switch(theEvent){
+ case vtkCommand::EndInteractionEvent:
+ self->OnEndInteractionEvent();
+ break;
+ }
+}
+
+void
+VVTK_Renderer2
+::OnEndInteractionEvent()
+{
+ myImplicitPlaneWidget1->GetPlane(myFunction.GetPointer());
+ myInteractor->Render();
+}
+
+
+//----------------------------------------------------------------------------
+void
+VVTK_Renderer2
+::AddActor(VTKViewer_Actor* theActor)
+{
+ SVTK_Renderer::AddActor(theActor);
+ if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(theActor))
+ if(VISU::TActorFactory* aFactory = anActor->GetFactory())
+ aFactory->AddClippingPlane(anActor,myFunction.GetPointer());
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_Renderer2
+::RemoveActor(VTKViewer_Actor* theActor)
+{
+ SVTK_Renderer::RemoveActor(theActor);
+ if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(theActor))
+ if(VISU::TActorFactory* aFactory = anActor->GetFactory())
+ aFactory->RemoveAllClippingPlanes(anActor);
+}
--- /dev/null
+// SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File :
+// Author :
+// Module : SALOME
+// $Header$
+
+#ifndef VVTK_Renderer_h
+#define VVTK_Renderer_h
+
+#include "VVTK.h"
+
+#include "SVTK_Renderer.h"
+
+class vtkImplicitPlaneWidget;
+class vtkPlane;
+
+//----------------------------------------------------------------------------
+class VVTK_EXPORT VVTK_Renderer1 : public SVTK_Renderer
+{
+ public:
+ vtkTypeMacro(VVTK_Renderer1,SVTK_Renderer);
+ static VVTK_Renderer1* New();
+
+ virtual
+ void
+ SetInteractor(vtkRenderWindowInteractor* theInteractor);
+
+ vtkImplicitPlaneWidget*
+ GetImplicitPlaneWidget();
+
+ protected:
+ VVTK_Renderer1();
+ ~VVTK_Renderer1();
+
+ virtual
+ bool
+ OnAdjustActors();
+
+ vtkSmartPointer<vtkImplicitPlaneWidget> myImplicitPlaneWidget;
+};
+
+
+//----------------------------------------------------------------------------
+class VVTK_EXPORT VVTK_Renderer2 : public SVTK_Renderer
+{
+ public:
+ vtkTypeMacro(VVTK_Renderer2,SVTK_Renderer);
+ static VVTK_Renderer2* New();
+
+ virtual
+ void
+ AddActor(VTKViewer_Actor* theActor);
+
+ virtual
+ void
+ RemoveActor(VTKViewer_Actor* theActor);
+
+ void
+ SetRenderer1(VVTK_Renderer1* theRenderer);
+
+ void
+ OnEndInteractionEvent();
+
+ protected:
+ VVTK_Renderer2();
+ ~VVTK_Renderer2();
+
+ // Main process VTK event method
+ static
+ void
+ ProcessEvents(vtkObject* theObject,
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
+
+ // Used to process VTK events
+ vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
+
+ // Priority at which events are processed
+ float myPriority;
+
+ vtkSmartPointer<vtkImplicitPlaneWidget> myImplicitPlaneWidget1;
+ vtkSmartPointer<VVTK_Renderer1> myRenderer1;
+ vtkSmartPointer<vtkPlane> myFunction;
+};
+
+
+#endif
#include "VVTK_InteractorStyle.h"
#include "SVTK_RenderWindowInteractor.h"
-#include "SVTK_Renderer.h"
+#include "VVTK_Renderer.h"
#include "SUIT_ResourceMgr.h"
#include "QtxAction.h"
#include <qtoolbar.h>
+#include <vtkImplicitPlaneWidget.h>
//----------------------------------------------------------------------------
-VVTK_MainWindow
-::VVTK_MainWindow(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr):
+VVTK_MainWindowBase
+::VVTK_MainWindowBase(QWidget* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr):
SVTK_MainWindow(theParent,theName,theResourceMgr),
myInteractorStyle(VVTK_InteractorStyle::New())
{
this,
"VVTK/SVTK StyleSwitch",
true);
- anAction->toggle();
anAction->setToggleAction(true);
+ anAction->toggle();
anAction->setStatusTip(tr("DSC_VVTK_INTERACTOR_STYLE_SWITCH"));
- connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onInteractorStyleSwitch(bool)));
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(OnInteractorStyleSwitch(bool)));
anAction->addTo( myPtsToolBar );
aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SELECTION_MODE_SWITCH"));
true);
anAction->setToggleAction(true);
anAction->setStatusTip(tr("DSC_VVTK_SELECTION_MODE_SWITCH"));
- connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onSelectionModeSwitch(bool)));
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(OnSelectionModeSwitch(bool)));
anAction->addTo( myPtsToolBar );
}
void
-VVTK_MainWindow
-::Initialize()
+VVTK_MainWindowBase
+::Initialize(SVTK_Renderer *theRenderer)
{
- SVTK_MainWindow::Initialize();
-
- // important! : the default interactor style which is pushed is VVTK
- // see onInteractorStyleSwitch() for details
+ SVTK_MainWindow::Initialize(theRenderer);
PushInteractorStyle(myInteractorStyle.GetPointer());
}
-VVTK_MainWindow
-::~VVTK_MainWindow()
+VVTK_MainWindowBase
+::~VVTK_MainWindowBase()
{}
+//----------------------------------------------------------------------------
+void
+VVTK_MainWindowBase
+::OnInteractorStyleSwitch(bool theIsGaussStyleOn)
+{
+ if ( theIsGaussStyleOn )
+ this->PushInteractorStyle(myInteractorStyle.GetPointer());
+ else
+ this->PopInteractorStyle();
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_MainWindowBase
+::OnSelectionModeSwitch(bool theIsSelectionOn)
+{
+ SetSelectionMode(theIsSelectionOn? NodeSelection: ActorSelection);
+}
+
+
+//----------------------------------------------------------------------------
+VVTK_MainWindow1
+::VVTK_MainWindow1(QWidget* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr):
+ VVTK_MainWindowBase(theParent,theName,theResourceMgr)
+{
+ QPixmap aPixmap;
+ QtxAction* anAction;
+
+ aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH"));
+ anAction = new QtxAction(tr("MNU_VVTK_PLANE_SEGMENTATION_SWITCH"),
+ aPixmap,
+ tr( "MNU_VVTK_PLANE_SEGMENTATION_SWITCH" ),
+ 0,
+ this,
+ "VVTK/SVTK PlaneSegmentationSwitch",
+ true);
+ anAction->setToggleAction(true);
+ anAction->setStatusTip(tr("DSC_VVTK_PLANE_SEGMENTATION_SWITCH"));
+ connect(anAction, SIGNAL(toggled(bool)), this, SLOT(OnPlaneSegmentationSwitch(bool)));
+ anAction->addTo( myPtsToolBar );
+}
+
+void
+VVTK_MainWindow1
+::Initialize()
+{
+ myRenderer = VVTK_Renderer1::New();
+ VVTK_MainWindowBase::Initialize(myRenderer.GetPointer());
+ myRenderer->Delete();
+}
+
+VVTK_MainWindow1
+::~VVTK_MainWindow1()
+{}
+
+
+//----------------------------------------------------------------------------
+VVTK_Renderer1*
+VVTK_MainWindow1
+::GetRenderer1()
+{
+ return myRenderer.GetPointer();
+}
+
//----------------------------------------------------------------------------
QSize
-VVTK_MainWindow
+VVTK_MainWindow1
::sizeHint() const
{
QWidget* aParent = parentWidget();
return QSize(aWidth,aHeight);
}
-
//----------------------------------------------------------------------------
void
-VVTK_MainWindow
-::onInteractorStyleSwitch(bool theIsVVTKStyle)
+VVTK_MainWindow1
+::OnPlaneSegmentationSwitch(bool theIsPlaneSegmentationOn)
{
- // default interactor style which is pushed in this view window constructor
- // is VVTK. If it is a current interactor style -- push SVTK "above" it.
- // if SVTK is a current one - pop it (remove from stack), below it there MUST BE
- // (logically) a VVTK interactor style.
- if ( theIsVVTKStyle )
- this->PopInteractorStyle();
- else
- this->PushInteractorStyle(myInteractorStyle.GetPointer());
+ myRenderer->GetImplicitPlaneWidget()->SetEnabled(theIsPlaneSegmentationOn);
}
-//----------------------------------------------------------------------------
-void
-VVTK_MainWindow
-::onSelectionModeSwitch(bool theIsSelectionOn)
-{
- SetSelectionMode(theIsSelectionOn? NodeSelection: ActorSelection);
-}
//----------------------------------------------------------------------------
-VVTK_SMainWindow
-::VVTK_SMainWindow(QWidget* theParent,
+VVTK_MainWindow2
+::VVTK_MainWindow2(QWidget* theParent,
const char* theName,
- SUIT_ResourceMgr* theResourceMgr):
- VVTK_MainWindow(theParent,theName,theResourceMgr)
+ SUIT_ResourceMgr* theResourceMgr,
+ VVTK_MainWindow1* theMainWindow):
+ VVTK_MainWindowBase(theParent,theName,theResourceMgr),
+ myMainWindow(theMainWindow)
{}
void
-VVTK_SMainWindow
+VVTK_MainWindow2
::Initialize()
{
- SetInteractor(new SVTK_RenderWindowInteractor(this,"SVTK_RenderWindowInteractor"));
-
- SVTK_Renderer* aRenderer = SVTK_Renderer::New();
- GetInteractor()->SetRenderer(aRenderer);
- aRenderer->Delete();
+ myRenderer = VVTK_Renderer2::New();
+ VVTK_MainWindowBase::Initialize(myRenderer.GetPointer());
+ myRenderer->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());
+ myRenderer->SetRenderer1(myMainWindow->GetRenderer1());
}
-VVTK_SMainWindow
-::~VVTK_SMainWindow()
+VVTK_MainWindow2
+::~VVTK_MainWindow2()
{}
-
//----------------------------------------------------------------------------
QSize
-VVTK_SMainWindow
+VVTK_MainWindow2
::sizeHint() const
{
QWidget* aParent = parentWidget();
#include "VVTK.h"
#include "SVTK_View.h"
+class VVTK_Renderer1;
+class VVTK_Renderer2;
//----------------------------------------------------------------------------
-class VVTK_EXPORT VVTK_MainWindow: public SVTK_MainWindow
+class VVTK_EXPORT VVTK_MainWindowBase: public SVTK_MainWindow
{
Q_OBJECT;
public:
- VVTK_MainWindow(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr);
+ VVTK_MainWindowBase(QWidget* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr);
+ virtual
+ void
+ Initialize(SVTK_Renderer *theRenderer);
+
+ virtual
+ ~VVTK_MainWindowBase();
+
+ public slots:
+ void OnInteractorStyleSwitch(bool theIsGaussStyleOn);
+ void OnSelectionModeSwitch(bool theIsSelectionOn);
+
+ protected:
+ QToolBar* myPtsToolBar;
+ vtkSmartPointer<vtkInteractorStyle> myInteractorStyle;
+};
+
+
+//----------------------------------------------------------------------------
+class VVTK_EXPORT VVTK_MainWindow1: public VVTK_MainWindowBase
+{
+ Q_OBJECT;
+
+public:
+ VVTK_MainWindow1(QWidget* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr);
virtual
void
Initialize();
virtual
- ~VVTK_MainWindow();
+ ~VVTK_MainWindow1();
+
+ VVTK_Renderer1*
+ GetRenderer1();
virtual
QSize
sizeHint() const;
public slots:
- void onInteractorStyleSwitch(bool theIsVVTKStyle);
- void onSelectionModeSwitch(bool theIsSelectionOn);
+ void OnPlaneSegmentationSwitch(bool theIsPlaneSegmentationOn);
protected:
- QToolBar* myPtsToolBar;
- vtkSmartPointer<SVTK_InteractorStyle> myInteractorStyle;
+ vtkSmartPointer<VVTK_Renderer1> myRenderer;
};
//----------------------------------------------------------------------------
-class VVTK_EXPORT VVTK_SMainWindow: public VVTK_MainWindow
+class VVTK_EXPORT VVTK_MainWindow2: public VVTK_MainWindowBase
{
Q_OBJECT;
public:
- VVTK_SMainWindow(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr);
+ VVTK_MainWindow2(QWidget* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ VVTK_MainWindow1* theMainWindow);
virtual
void
Initialize();
virtual
- ~VVTK_SMainWindow();
+ ~VVTK_MainWindow2();
virtual
QSize
sizeHint() const;
+
+ protected:
+ VVTK_MainWindow1* myMainWindow;
+ vtkSmartPointer<VVTK_Renderer2> myRenderer;
};
+// SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File :
+// Author :
+// Module : SALOME
+// $Header$
+
#include "VVTK_ViewWindow.h"
#include "VVTK_ViewModel.h"
#include "VVTK_View.h"
+#include "VISU_GaussPtsAct.h"
+
#include "SUIT_Session.h"
#include <qsplitter.h>
//----------------------------------------------------------------------------
VVTK_ViewWindow
::VVTK_ViewWindow(SUIT_Desktop* theDesktop):
- SVTK_ViewWindow(theDesktop)
+ SVTK_ViewWindow(theDesktop),
+ myMainWindow1(NULL),
+ myMainWindow2(NULL),
+ myView2(NULL)
{}
//----------------------------------------------------------------------------
aLayout->setAutoAdd(true);
QSplitter* aSplitter = new QSplitter(Qt::Vertical,aWidget);
- myMainWindow = new VVTK_MainWindow(aSplitter,
- "VVTK_MainWindow",
- aResourceMgr);
+ myMainWindow1 = new VVTK_MainWindow1(aSplitter,
+ "VVTK_MainWindow",
+ aResourceMgr);
+ myMainWindow = myMainWindow1;
myMainWindow->Initialize();
-
+
myView = new SVTK_View(myMainWindow);
SVTK_ViewWindow::Initialize(myView,theModel);
- mySMainWindow = new VVTK_SMainWindow(aSplitter,
- "VVTK_SegmantationWindow",
- aResourceMgr);
- mySMainWindow->Initialize();
+ myMainWindow2 = new VVTK_MainWindow2(aSplitter,
+ "VVTK_SegmantationWindow",
+ aResourceMgr,
+ myMainWindow1);
+ myMainWindow2->Initialize();
- mySView = new SVTK_View(mySMainWindow);
+ myView2 = new SVTK_View(myMainWindow2);
}
}
VVTK_ViewWindow
::~VVTK_ViewWindow()
{}
+
+
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::AddActor(VTKViewer_Actor* theActor,
+ bool theIsUpdate)
+{
+ SVTK_ViewWindow::AddActor(theActor,theIsUpdate);
+ if(VISU_Actor* anAct = dynamic_cast<VISU_Actor*>(theActor))
+ if(VISU::TActorFactory* aFactory = anAct->GetFactory())
+ if(VISU_Actor* anActor = aFactory->CreateActor())
+ myMainWindow2->AddActor(anActor,theIsUpdate);
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::RemoveActor(VTKViewer_Actor* theActor,
+ bool theIsUpdate)
+{
+ SVTK_ViewWindow::RemoveActor(theActor,theIsUpdate);
+ myMainWindow2->RemoveActor(theActor,theIsUpdate);
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::onResetView()
+{
+ myMainWindow1->onResetView();
+ myMainWindow2->onResetView();
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::onFitAll()
+{
+ myMainWindow1->onFitAll();
+ myMainWindow2->onFitAll();
+}
#include "VVTK.h"
#include "SVTK_ViewWindow.h"
-class VVTK_SMainWindow;
-class VVTK_MainWindow;
+class VVTK_MainWindow1;
+class VVTK_MainWindow2;
class SVTK_View;
class VVTK_EXPORT VVTK_ViewWindow : public SVTK_ViewWindow
virtual
~VVTK_ViewWindow();
+ virtual
+ void
+ AddActor(VTKViewer_Actor* theActor,
+ bool theIsUpdate = false);
+
+ virtual
+ void
+ RemoveActor(VTKViewer_Actor* theActor,
+ bool theIsUpdate = false);
+
virtual
void
Initialize(SVTK_ViewModelBase* theModel);
+public slots:
+ virtual
+ void
+ onResetView();
+
+ virtual
+ void
+ onFitAll();
+
protected:
- VVTK_SMainWindow* mySMainWindow;
- SVTK_View* mySView;
+ VVTK_MainWindow1* myMainWindow1;
+ VVTK_MainWindow2* myMainWindow2;
+ SVTK_View* myView2;
};
#ifdef WIN32