Back to index

salome-gui  6.5.0
Public Types | Public Member Functions | Public Attributes
TDumpViewEvent Class Reference
Inheritance diagram for TDumpViewEvent:
Inheritance graph
[legend]
Collaboration diagram for TDumpViewEvent:
Collaboration graph
[legend]

List of all members.

Public Types

typedef bool TResult

Public Member Functions

 TDumpViewEvent (const QString &filename)
virtual void Execute ()

Public Attributes

TResult myResult
QString myFileName

Detailed Description

Definition at line 1492 of file SalomePyQt.cxx.


Member Typedef Documentation

Definition at line 1495 of file SalomePyQt.cxx.


Constructor & Destructor Documentation

TDumpViewEvent::TDumpViewEvent ( const QString &  filename) [inline]

Definition at line 1498 of file SalomePyQt.cxx.

    : myResult ( false ), myFileName( filename ) {}

Member Function Documentation

virtual void TDumpViewEvent::Execute ( ) [inline, virtual]

Definition at line 1500 of file SalomePyQt.cxx.

  {
    if ( LightApp_Application* anApp = getApplication() ) {
      SUIT_ViewManager* vm = anApp->activeViewManager();
      if ( vm ) { 
        SUIT_ViewWindow* vw = vm->getActiveView();
        if ( vw ) {
          QImage im = vw->dumpView();
          if ( !im.isNull() && !myFileName.isEmpty() ) {
            QString fmt = SUIT_Tools::extension( myFileName ).toUpper();
            if ( fmt.isEmpty() ) fmt = QString( "BMP" ); // default format
            if ( fmt == "JPG" )  fmt = "JPEG";
            myResult = im.save( myFileName, fmt.toLatin1() );
          }
        }
      }
    }
  }

Here is the call graph for this function:


Member Data Documentation

Definition at line 1497 of file SalomePyQt.cxx.

Definition at line 1496 of file SalomePyQt.cxx.


The documentation for this class was generated from the following file: