//=======================================================================
GraphicsView_ViewFrame::GraphicsView_ViewFrame( SUIT_Desktop* d, GraphicsView_Viewer* vw, QWidget* w )
: SUIT_ViewWindow( d ),
- myViewer( vw )
+ myViewer( vw ), myToolBarId( -1 )
{
QFrame* aFrame = new QFrame( this );
setCentralWidget( aFrame );
aLayout->addWidget( myViewPort );
- createActions();
- myToolBarId = createToolBar();
-
connect( myViewPort, SIGNAL( vpKeyEvent( QKeyEvent* ) ),
this, SLOT( keyEvent( QKeyEvent* ) ) );
connect( myViewPort, SIGNAL( vpMouseEvent( QGraphicsSceneMouseEvent* ) ),
false ); // disable floatable toolbar
toolMgr()->append( DumpId, tid );
- myScaleAction = new QtxMultiAction( this );
- myScaleAction->insertAction( toolMgr()->action( FitAllId ) );
- myScaleAction->insertAction( toolMgr()->action( FitRectId ) );
- myScaleAction->insertAction( toolMgr()->action( FitSelectId ) );
- myScaleAction->insertAction( toolMgr()->action( ZoomId ) );
- toolMgr()->append( myScaleAction, tid );
+ QtxMultiAction* aScaleAction = new QtxMultiAction( this );
+ aScaleAction->insertAction( toolMgr()->action( FitAllId ) );
+ aScaleAction->insertAction( toolMgr()->action( FitRectId ) );
+ aScaleAction->insertAction( toolMgr()->action( FitSelectId ) );
+ aScaleAction->insertAction( toolMgr()->action( ZoomId ) );
+ toolMgr()->append( aScaleAction, tid );
+ myScaleAction = aScaleAction;
- myPanAction = new QtxMultiAction( this );
- myPanAction->insertAction( toolMgr()->action( PanId ) );
- myPanAction->insertAction( toolMgr()->action( GlobalPanId ) );
- toolMgr()->append( myPanAction, tid );
+ QtxMultiAction* aPanAction = new QtxMultiAction( this );
+ aPanAction->insertAction( toolMgr()->action( PanId ) );
+ aPanAction->insertAction( toolMgr()->action( GlobalPanId ) );
+ toolMgr()->append( aPanAction, tid );
+ myPanAction = aPanAction;
toolMgr()->append( toolMgr()->action( ResetId ), tid );
return myViewPort->dumpView();
}
+//================================================================
+// Function : dumpViewToFormat
+// Purpose :
+//================================================================
+bool GraphicsView_ViewFrame::dumpViewToFormat( const QImage& image, const QString& fileName, const QString& format )
+{
+ bool isOK = myViewPort->dumpViewToFormat(fileName, format);
+ if( !isOK )
+ isOK = SUIT_ViewWindow::dumpViewToFormat( image, fileName, format );
+ return isOK;
+}
+
//================================================================
// Function : getVisualParameters
// Purpose :
//================================================================
void GraphicsView_ViewFrame::expandToolBarActions()
{
- QList<QtxMultiAction*> anExpandableActions;
+ QList<QAction*> anExpandableActions;
anExpandableActions.append( myScaleAction );
anExpandableActions.append( myPanAction );
- QListIterator<QtxMultiAction*> anIter( anExpandableActions );
+ QListIterator<QAction*> anIter( anExpandableActions );
while( anIter.hasNext() )
{
- if( QtxMultiAction* aMultiAction = anIter.next() )
+ QtxMultiAction* aMultiAction = dynamic_cast<QtxMultiAction*>( anIter.next() );
+ if( aMultiAction )
{
QList<QAction*> aLocalActions = aMultiAction->actions();
QListIterator<QAction*> aLocalIter( aLocalActions );
emit contextMenuRequested( anEvent );
delete anEvent;
}
+
+/*!
+ \brief Handle show event.
+
+ Emits Show() signal.
+
+ \param theEvent show event
+*/
+void GraphicsView_ViewFrame::showEvent( QShowEvent* theEvent )
+{
+ if( myToolBarId < 0 )
+ {
+ createActions();
+ myToolBarId = createToolBar();
+ }
+
+ emit Show( theEvent );
+}
+
+/*!
+ \brief Handle hide event.
+
+ Emits Hide() signal.
+
+ \param theEvent hide event
+*/
+void GraphicsView_ViewFrame::hideEvent( QHideEvent* theEvent )
+{
+ emit Hide( theEvent );
+}
+
+/*!
+ \return filters for image files
+*/
+QString GraphicsView_ViewFrame::filter() const
+{
+ QStringList filters = SUIT_ViewWindow::filter().split( ";;", QString::SkipEmptyParts );
+ filters << tr( "POSTSCRIPT_FILES" );
+ return filters.join( ";;" );
+}
class QGraphicsSceneMouseEvent;
class QGraphicsSceneWheelEvent;
-class QtxMultiAction;
+class QAction;
class SUIT_Desktop;
GraphicsView_ViewFrame( SUIT_Desktop*, GraphicsView_Viewer*, QWidget* w = NULL );
~GraphicsView_ViewFrame();
-public:
GraphicsView_Viewer* getViewer() const { return myViewer; }
GraphicsView_ViewPort* getViewPort() const { return myViewPort; }
virtual QImage dumpView();
-
+
virtual QString getVisualParameters();
virtual void setVisualParameters( const QString& theParameters );
- void expandToolBarActions();
+ virtual void expandToolBarActions();
int getToolBarId();
+public slots:
+ virtual void showEvent( QShowEvent* );
+ virtual void hideEvent( QHideEvent* );
+
protected slots:
void onViewPan();
void onViewZoom();
void sketchingFinished( QPainterPath );
-private:
- void createActions();
- int createToolBar();
+ void Show( QShowEvent* );
+ void Hide( QHideEvent* );
+
+protected:
+ virtual void createActions();
+ virtual int createToolBar();
+ virtual QString filter() const;
+ virtual bool dumpViewToFormat( const QImage&, const QString& fileName, const QString& format );
private:
GraphicsView_Viewer* myViewer;
GraphicsView_ViewPort* myViewPort;
int myToolBarId;
- QtxMultiAction* myScaleAction;
- QtxMultiAction* myPanAction;
+ QAction* myScaleAction;
+ QAction* myPanAction;
};
#endif
// Purpose : Constructor
//=======================================================================
GraphicsView_ViewManager::GraphicsView_ViewManager( SUIT_Study* theStudy,
- SUIT_Desktop* theDesktop )
-: SUIT_ViewManager( theStudy, theDesktop, new GraphicsView_Viewer( "GraphicsView" ) )
+ SUIT_Desktop* theDesktop,
+ SUIT_ViewModel* theModel )
+: SUIT_ViewManager( theStudy, theDesktop,
+ theModel ? theModel : new GraphicsView_Viewer( "GraphicsView" ) )
{
setTitle( tr( "GRAPHICS_VIEW_TITLE" ) );
}
public:
GraphicsView_ViewManager( SUIT_Study* theStudy,
- SUIT_Desktop* theDesktop );
+ SUIT_Desktop* theDesktop,
+ SUIT_ViewModel* theModel = 0 );
virtual ~GraphicsView_ViewManager();
GraphicsView_Viewer* getViewer();
#include <QRectF>
#include <QRubberBand>
#include <QScrollBar>
+#include <QPrinter>
+#include <QPainter>
#include <math.h>
myForegroundItem( 0 ),
myGridItem( 0 ),
myIsTransforming( false ),
+ myUnlimitedPanning( false ),
myHighlightedObject( 0 ),
myHighlightX( 0 ),
myHighlightY( 0 ),
myIsSketchingByPath( false ),
myIsDragging( false ),
myIsDragPositionInitialized( false ),
+ myDraggingSelectedByLeftButton( false ),
myIsPulling( false ),
myPullingObject( 0 ),
- myStoredCursor( Qt::ArrowCursor )
+ myStoredCursor( Qt::ArrowCursor ),
+ myZoomCoeff( 100 )
{
// scene
myScene = new GraphicsView_Scene( this );
QPainter::SmoothPixmapTransform |
QPainter::HighQualityAntialiasing );
+ myHBarPolicy = horizontalScrollBarPolicy();
+ myVBarPolicy = verticalScrollBarPolicy();
+
connect( myScene, SIGNAL( gsKeyEvent( QKeyEvent* ) ),
this, SLOT( onKeyEvent( QKeyEvent* ) ) );
connect( myScene, SIGNAL( gsMouseEvent( QGraphicsSceneMouseEvent* ) ),
onBoundingRectChanged();
}
+void GraphicsView_ViewPort::clearItems()
+{
+ myHighlightedObject = 0;
+ mySelectedObjects.clear();
+ myObjects.clear();
+ myScene->clear();
+ onBoundingRectChanged();
+}
+
//================================================================
// Function : getObjects
// Purpose :
return anImage;
}
+bool GraphicsView_ViewPort::dumpViewToFormat(const QString& fileName, const QString& format)
+{
+ if( format!="PS" && format!="EPS" )
+ return false;
+
+ QPrinter printer(QPrinter::ScreenResolution);
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+ printer.setOutputFormat(QPrinter::PostScriptFormat);
+#else
+ printer.setOutputFormat(QPrinter::PdfFormat);
+#endif
+ printer.setOutputFileName(fileName);
+ QPainter painter;
+ if (!painter.begin(&printer))
+ return false;
+
+ QRect view( 0, 0, printer.pageRect().width(), printer.paperRect().height() );
+ QRectF bounds = myScene->itemsBoundingRect();
+
+ if( !view.isEmpty() && !bounds.isEmpty() )
+ {
+ float SCALE = 0.5;//qMin( view.width()/bounds.width(), view.height()/bounds.height() );
+ painter.setViewport( view );
+ painter.scale( SCALE, SCALE );
+ }
+ myScene->render( &painter, QRectF( view ), bounds );
+
+ if (!painter.end())
+ return false;
+ return true;
+}
+
//================================================================
// Function : setSceneGap
// Purpose :
myViewLabel->setAcceptMoveEvents( false );
if( QScrollBar* aHBar = horizontalScrollBar() )
+ {
+ if( isUnlimitedPanning() )
+ {
+ int aNewValue = aHBar->value() - theDX;
+ if( aNewValue < aHBar->minimum() )
+ aHBar->setMinimum( aNewValue );
+ if( aNewValue > aHBar->maximum() )
+ aHBar->setMaximum( aNewValue );
+ }
aHBar->setValue( aHBar->value() - theDX );
+ }
if( QScrollBar* aVBar = verticalScrollBar() )
+ {
+ if( isUnlimitedPanning() )
+ {
+ int aNewValue = aVBar->value() + theDY;
+ if( aNewValue < aVBar->minimum() )
+ aVBar->setMinimum( aNewValue );
+ if( aNewValue > aVBar->maximum() )
+ aVBar->setMaximum( aNewValue );
+ }
aVBar->setValue( aVBar->value() + theDY );
+ }
if( myViewLabel )
myViewLabel->setAcceptMoveEvents( true );
// increasing of diagonal coefficients (>300) leads to a crash sometimes
// at the values of 100 some primitives are drawn incorrectly
- if( qMax( aM11, aM22 ) < 100 )
+ if( myZoomCoeff < 0 || qMax( aM11, aM22 ) < myZoomCoeff )
setTransform( aTransform );
myIsTransforming = false;
anObject->setViewTransform( transform() );
}
+//================================================================
+// Function : setZoomCoeff
+// Purpose :
+//================================================================
+void GraphicsView_ViewPort::setZoomCoeff( const int& theZoomCoeff )
+{
+ myZoomCoeff = theZoomCoeff;
+}
+
+//================================================================
+// Function : setUnlimitedPanning
+// Purpose :
+//================================================================
+void GraphicsView_ViewPort::setUnlimitedPanning( const bool& theValue )
+{
+ if ( myUnlimitedPanning == theValue )
+ return;
+
+ myUnlimitedPanning = theValue;
+
+ if( myUnlimitedPanning )
+ {
+ myHBarPolicy = horizontalScrollBarPolicy();
+ myVBarPolicy = verticalScrollBarPolicy();
+
+ setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
+ setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
+ }
+ else
+ {
+ setHorizontalScrollBarPolicy( myHBarPolicy );
+ setVerticalScrollBarPolicy( myVBarPolicy );
+ }
+}
+
//================================================================
// Function : currentBlock
// Purpose :
return myIsSketching;
}
+//================================================================
+// Function : setDraggingSelectedByLeftButton
+// Purpose :
+//================================================================
+void GraphicsView_ViewPort::setDraggingSelectedByLeftButton( const bool& theValue )
+{
+ myDraggingSelectedByLeftButton = theValue;
+}
+
//================================================================
// Function : dragObjects
// Purpose :
else
anObjectsToMove.append( anObject );
}
- else if( hasInteractionFlag( DraggingByMiddleButton ) &&
- nbSelected() && ( e->buttons() & Qt::MidButton ) )
+ else if( ( hasInteractionFlag( DraggingByMiddleButton ) && ( e->buttons() & Qt::MidButton ) ||
+ isDraggingSelectedByLeftButton() && ( e->buttons() & Qt::LeftButton ) ) &&
+ nbSelected() )
{
for( initSelected(); moreSelected(); nextSelected() )
if( GraphicsView_Object* aMovingObject = selectedObject() )
if( ( getHighlightedObject() &&
getHighlightedObject()->isMovable() &&
!( anAccel || e->button() != Qt::LeftButton ) ) ||
- ( hasInteractionFlag( DraggingByMiddleButton ) &&
- nbSelected() && !anAccel && e->button() == Qt::MidButton ) )
+ ( ( hasInteractionFlag( DraggingByMiddleButton ) && e->button() == Qt::MidButton ||
+ isDraggingSelectedByLeftButton() && e->button() == Qt::LeftButton ) &&
+ nbSelected() && !anAccel ) )
{
myIsDragging = true;
myStoredCursor = cursor();
void addItem( QGraphicsItem* theItem );
bool isItemAdded( QGraphicsItem* theItem );
void removeItem( QGraphicsItem* theItem );
+ void clearItems();
enum SortType { NoSorting, SelectedFirst, SortByZLevel };
GraphicsView_ObjectList getObjects( SortType theSortType = NoSorting ) const;
QImage dumpView( bool theWholeScene = false,
QSizeF theSize = QSizeF() );
+ bool dumpViewToFormat(const QString& fileName, const QString& format);
+
public:
// scene
void setSceneGap( double theSceneGap );
void applyTransform();
+ int zoomCoeff() const { return myZoomCoeff; }
+ void setZoomCoeff( const int& theZoomCoeff );
+
+ bool isUnlimitedPanning() const { return myUnlimitedPanning; }
+ void setUnlimitedPanning( const bool& theValue );
+
// block status
BlockStatus currentBlock();
// dragging
bool isDragging() { return myIsDragging; }
+ bool isDraggingSelectedByLeftButton() const { return myDraggingSelectedByLeftButton; }
+ void setDraggingSelectedByLeftButton( const bool& theValue );
+
// pulling
bool startPulling( const QPointF& );
void drawPulling( const QPointF& );
bool myIsTransforming;
QTransform myCurrentTransform;
+ bool myUnlimitedPanning;
+ Qt::ScrollBarPolicy myHBarPolicy;
+ Qt::ScrollBarPolicy myVBarPolicy;
+
// highlighting
GraphicsView_Object* myHighlightedObject;
double myHighlightX;
int myIsDragging;
QPointF myDragPosition;
bool myIsDragPositionInitialized;
+ bool myDraggingSelectedByLeftButton;
// pulling
bool myIsPulling;
// cursor
QCursor myStoredCursor;
+
+ // zoom diagonal coefficient
+ int myZoomCoeff;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( GraphicsView_ViewPort::InteractionFlags )
delete mySelector;
}
+GraphicsView_ViewFrame* GraphicsView_Viewer::createViewFrame( SUIT_Desktop* theDesktop, QWidget* theWidget )
+{
+ return new GraphicsView_ViewFrame( theDesktop, this, theWidget );
+}
+
//================================================================
// Function : createView
// Purpose :
//================================================================
SUIT_ViewWindow* GraphicsView_Viewer::createView( SUIT_Desktop* theDesktop )
{
- GraphicsView_ViewFrame* aViewFrame = new GraphicsView_ViewFrame( theDesktop, this, myWidget );
+ GraphicsView_ViewFrame* aViewFrame = createViewFrame( theDesktop, myWidget );
connect( aViewFrame, SIGNAL( keyPressed( QKeyEvent* ) ),
this, SLOT( onKeyEvent( QKeyEvent* ) ) );
}
else if( e->button() == Qt::LeftButton &&
!( aViewPort->currentBlock() & GraphicsView_ViewPort::BS_Selection ) &&
- !aViewPort->getHighlightedObject() )
+ !aViewPort->getHighlightedObject() &&
+ ( !aViewPort->isDraggingSelectedByLeftButton() ||
+ aViewPort->isDraggingSelectedByLeftButton() && aViewPort->nbSelected() == 0 ) )
{
// Start rectangular selection if pulling was not started
QPoint p = aViewPort->mapFromScene( e->scenePos() );
protected:
virtual GraphicsView_ViewTransformer* createTransformer( int );
+ virtual GraphicsView_ViewFrame* createViewFrame( SUIT_Desktop* theDesktop, QWidget* theWidget );
virtual void onTransformationStarted();
virtual void onTransformationFinished();
void onTestCropOperatorPerform( QPainterPath thePath );
*/
-private:
- void handleKeyPress( QKeyEvent* );
- void handleKeyRelease( QKeyEvent* );
- void handleMouseMove( QGraphicsSceneMouseEvent* );
- void handleMousePress( QGraphicsSceneMouseEvent* );
- void handleMouseRelease( QGraphicsSceneMouseEvent* );
- void handleWheel( QGraphicsSceneWheelEvent* );
+protected:
+ virtual void handleKeyPress( QKeyEvent* );
+ virtual void handleKeyRelease( QKeyEvent* );
+ virtual void handleMouseMove( QGraphicsSceneMouseEvent* );
+ virtual void handleMousePress( QGraphicsSceneMouseEvent* );
+ virtual void handleMouseRelease( QGraphicsSceneMouseEvent* );
+ virtual void handleWheel( QGraphicsSceneWheelEvent* );
// testing ImageViewer
enum QueueOperation { BringToFront, SendToBack, BringForward, SendBackward };
<!DOCTYPE TS><TS>
<context>
- <name>@default</name>
+ <name>GraphicsView_ViewFrame</name>
<message>
<source>ICON_GV_DUMP</source>
<translation>graphics_view_dump.png</translation>
<source>ICON_GV_GLOBALPAN</source>
<translation>graphics_view_glpan.png</translation>
</message>
- <message>
- <source>ICON_GV_CURSOR_ZOOM</source>
- <translation>graphics_view_cursor_zoom.png</translation>
- </message>
<message>
<source>ICON_GV_FITALL</source>
<translation>graphics_view_fitall.png</translation>
<translation>graphics_view_rotate.png</translation>
</message>
</context>
+<context>
+ <name>GraphicsView_ViewPort</name>
+ <message>
+ <source>ICON_GV_CURSOR_ZOOM</source>
+ <translation>graphics_view_cursor_zoom.png</translation>
+ </message>
+</context>
</TS>
<source>MNU_ZOOM_VIEW</source>
<translation>Zoom</translation>
</message>
+ <message>
+ <source>POSTSCRIPT_FILES</source>
+ <translation>PostScript files (*.ps *.eps)</translation>
+ </message>
</context>
<context>
<name>GraphicsView_Viewer</name>
<source>MNU_ZOOM_VIEW</source>
<translation>Zoom</translation>
</message>
+ <message>
+ <source>POSTSCRIPT_FILES</source>
+ <translation>Fichiers PostScript (*.ps *.eps)</translation>
+ </message>
</context>
<context>
<name>GraphicsView_Viewer</name>
<source>MNU_ZOOM_VIEW</source>
<translation>ズーム</translation>
</message>
+ <message>
+ <source>POSTSCRIPT_FILES</source>
+ <translation>PostScript files (*.ps *.eps)</translation>
+ </message>
</context>
<context>
<name>GraphicsView_Viewer</name>
myId = useNewId( getType() );
- connect( theDesktop, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
- this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
+ if( theDesktop )
+ {
+ connect( theDesktop, SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+ this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
+ }
myStudy = theStudy;
if ( myStudy )
#include "SUIT_Application.h"
#include "SUIT_ViewManager.h"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_FileDlg.h"
#include "QtxActionToolMgr.h"
#include "QtxMultiAction.h"
if ( e->type() == DUMP_EVENT )
{
bool bOk = false;
- if ( myManager && myManager->study() && myManager->study()->application() )
+ SUIT_Application* app = NULL;
+ if (myManager && myManager->study() && myManager->study()->application())
+ app = myManager->study()->application();
+ QString fileName;
+ if (app)
+ fileName = app->getFileName( false, QString(), filter(), tr( "TLT_DUMP_VIEW" ), 0 ); //old way
+ else
{
- // get file name
- SUIT_Application* app = myManager->study()->application();
- QString fileName = app->getFileName( false, QString(), filter(), tr( "TLT_DUMP_VIEW" ), 0 );
- if ( !fileName.isEmpty() )
- {
- QImage im = dumpView();
- QString fmt = SUIT_Tools::extension( fileName ).toUpper();
- Qtx::Localizer loc;
- bOk = dumpViewToFormat( im, fileName, fmt );
- }
- else
- bOk = true; // cancelled
+ QStringList fls = filter().split( ";;", QString::SkipEmptyParts );
+ fileName = SUIT_FileDlg::getFileName( NULL, QString(), fls, tr( "TLT_DUMP_VIEW" ), false, true );
}
+ if ( !fileName.isEmpty() )
+ {
+ QString fmt = SUIT_Tools::extension( fileName ).toUpper();
+ QImage im = dumpView();
+ Qtx::Localizer loc;
+ bOk = dumpViewToFormat( im, fileName, fmt );
+ }
+ else
+ bOk = true; // cancelled
+
if ( !bOk )
SUIT_MessageBox::critical( this, tr( "ERROR" ), tr( "ERR_CANT_DUMP_VIEW" ) );
<translation>All files (*)</translation>
</message>
</context>
+<context>
+ <name>SUIT_ViewWindow</name>
+ <message>
+ <source>TLT_DUMP_VIEW</source>
+ <translation>Dump view to file</translation>
+ </message>
+ <message>
+ <source>TLT_IMAGE_FILES</source>
+ <translation>Images Files (*.bmp *.png *.jpg *.jpeg)</translation>
+ </message>
+</context>
</TS>
<translation>Tous les fichiers (*)</translation>
</message>
</context>
+<context>
+ <name>SUIT_ViewWindow</name>
+ <message>
+ <source>TLT_DUMP_VIEW</source>
+ <translation>Enregistrer la vue dans le fichier</translation>
+ </message>
+ <message>
+ <source>TLT_IMAGE_FILES</source>
+ <translation>Fichiers images (*.bmp *.png *.jpg *.jpeg)</translation>
+ </message>
+</context>
</TS>
<translation>すべてのファイル (*)</translation>
</message>
</context>
+<context>
+ <name>SUIT_ViewWindow</name>
+ <message>
+ <source>TLT_DUMP_VIEW</source>
+ <translation>ビューでファイルを保存します。</translation>
+ </message>
+ <message>
+ <source>TLT_IMAGE_FILES</source>
+ <translation>イメージ (*.bmp *.png *.jpg *.jpeg) ファイル</translation>
+ </message>
+</context>
</TS>
/*!SLOT. Copy objects to study maneger from selection maneger..*/
void SalomeApp_Application::onCopy()
{
+ LightApp_Application::onCopy();
+
SALOME_ListIO list;
LightApp_SelectionMgr* mgr = selectionMgr();
mgr->selectedObjects(list);
if(it.More())
{
_PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
- try {
- studyMgr()->Copy(so);
- onSelectionChanged();
- }
- catch(...) {
+ if( so )
+ {
+ try {
+ studyMgr()->Copy(so);
+ onSelectionChanged();
+ }
+ catch(...) {
+ }
}
}
}
/*!SLOT. Paste objects to study maneger from selection manager.*/
void SalomeApp_Application::onPaste()
{
+ LightApp_Application::onPaste();
+
SALOME_ListIO list;
LightApp_SelectionMgr* mgr = selectionMgr();
mgr->selectedObjects(list);
if(it.More())
{
_PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
- try {
- studyMgr()->Paste(so);
- updateObjectBrowser( true );
- updateActions(); //SRN: BugID IPAL9377, case 3
- }
- catch(...) {
+ if( so )
+ {
+ try {
+ studyMgr()->Paste(so);
+ updateObjectBrowser( true );
+ updateActions(); //SRN: BugID IPAL9377, case 3
+ }
+ catch(...) {
+ }
}
}
}