#include "VVTK_PickingDlg.h"
#include "VVTK_SegmentationCursorDlg.h"
+#include "SUIT_Application.h"
+#include "SUIT_Session.h"
+#include "SUIT_Tools.h"
+#include "SUIT_ViewWindow.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_ToolButton.h"
#include "SUIT_Accel.h"
#include "QtxAction.h"
+#include <qimage.h>
#include <qtoolbar.h>
#include <qsplitter.h>
#include <qfiledialog.h>
+#include <qapplication.h>
//----------------------------------------------------------------------------
VVTK_MainWindow
myRecorder->SetUseSkippedFrames(true);
myRecorder->SetRenderWindow(theInteractor->getRenderWindow());
+ disconnect( myActionsMap[ DumpId ], SIGNAL( activated() ),
+ myViewWindow, SLOT( onDumpView() ) );
+
+ connect( myActionsMap[ DumpId ], SIGNAL( activated() ),
+ this, SLOT( onDumpView() ) );
+
SVTK_MainWindow::Initialize(theInteractor);
}
myRecorder->Delete();
}
+//----------------------------------------------------------------------------
+void VVTK_MainWindow::onDumpView()
+{
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ QString fileName = app->getFileName( false, QString::null,
+ tr( "TLT_IMAGE_FILES" ),
+ tr( "TLT_DUMP_VIEW" ), 0 );
+ if( fileName.isEmpty() )
+ return;
+
+ QImage img = dumpView();
+ if( img.isNull() )
+ return;
+
+ QString fmt = SUIT_Tools::extension( fileName ).upper();
+ if( fmt.isEmpty() )
+ fmt = QString( "BMP" ); // default format
+ else if( fmt == "JPG" )
+ fmt = "JPEG";
+
+ QApplication::setOverrideCursor( Qt::waitCursor );
+ bool res = img.save( fileName, fmt.latin1() );
+ QApplication::restoreOverrideCursor();
+}
//----------------------------------------------------------------------------
void
#include <qsplitter.h>
#include <qlayout.h>
+#include <qimage.h>
//----------------------------------------------------------------------------
VVTK_ViewWindow
if(myMainWindow2->hasFocus())
myMainWindow2->action(accelAction);
}
+
+//----------------------------------------------------------------------------
+QImage
+VVTK_ViewWindow
+::dumpView()
+{
+ if( myMainWindow1->GetInteractor()->hasFocus() )
+ return myMainWindow1->dumpView();
+
+ if( myMainWindow2->GetInteractor()->hasFocus() )
+ return myMainWindow2->dumpView();
+
+ return QImage();
+}
+
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::setBackgroundColor( const QColor& theColor )
+{
+ if( myMainWindow1->GetInteractor()->hasFocus() )
+ myMainWindow1->SetBackgroundColor( theColor );
+ else if( myMainWindow2->GetInteractor()->hasFocus() )
+ myMainWindow2->SetBackgroundColor( theColor );
+ else
+ myMainWindow->SetBackgroundColor( theColor );
+}
+
void
unHighlightAll();
+ //! Redefine SVTK_ViewWindow::setBackgroundColor method
+ virtual
+ void
+ setBackgroundColor( const QColor& );
+
//----------------------------------------------------------------------------
public slots:
//! Redefine SVTK_ViewWindow::onSelectionChanged method
void
action( const int );
+ virtual QImage dumpView();
+
VVTK_MainWindow1* myMainWindow1; //!< The manage base view
SVTK_View* myView1; //!< The manage base view