#include "HYDROGUI_RecognizeContoursDlg.h"
#include "HYDROGUI_Module.h"
#include "HYDROGUI_Shape.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
#include "HYDROGUI_UpdateFlags.h"
#include "HYDROGUI_OCCSelector.h"
-#include "HYDROGUI_ZLayers.h" //@MZN
+#include "HYDROGUI_ZLayers.h"
#include <HYDROData_Document.h>
#include <HYDROData_GeomTool.h>
#include <gp_GTrsf.hxx>
#include <QDialog>
+#include <QDir>
#include <QTemporaryFile>
/**
{
HYDROGUI_Operation::startOperation();
+ // Set preview view manager
+ if ( !getPreviewManager() ) {
+ setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>(
+ module()->getApp()->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
+ }
+
if ( !isApplyAndClose() ) {
return;
}
// Create temporary graphics file
QImage aQImage = myImage->Image();
- myTmpImageFile = new QTemporaryFile( anImageName );
+ myTmpImageFile = new QTemporaryFile( QDir::tempPath() + QDir::separator() + anImageName );
if ( !myTmpImageFile->open() ||
!aQImage.save( myTmpImageFile->fileName(), "PNG", 100 ) ) {
abort();
// update the object browser
module()->getApp()->updateObjectBrowser( true );
- // select the picture
- SUIT_DataOwnerPtrList aList( true );
- aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( aGeomPictureEntry ) ) );
- selectionMgr()->setSelected(aList );
+ // browse the published GEOM picture
+ QStringList anEntries;
+ anEntries << aGeomPictureEntry;
+ browseObjects( anEntries );
// Add GEOM picture object entry to the list of temporary geom objects
myTmpGeomObjects << aGeomPictureEntry;
if( !aPolylineObj.IsNull() ) {
aPolylineObj->SetName( aName );
- aPolylineObj->ImportShape( aShape );
+ aPolylineObj->ImportShape( aShape, false, NULL );
aPolylineObj->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
aPolylineObj->Update();
Handle(AIS_InteractiveContext) aCtx = NULL;
// Display preview
- if ( !getPreviewManager() ) {
- setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>(
- module()->getApp()->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
- }
-
OCCViewer_ViewManager* aViewManager = getPreviewManager();
if ( aViewManager ) {
if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
aTrsf.m21(), -aTrsf.m22(), aTrsf.m23(),
aTrsf.m31() + aRect.width() * 0.5, aTrsf.m32 () - aRect.height() * 0.5, aTrsf.m33() );
- /* @MZN
+ /*
QTransform aTrsf = myImage->Trsf();
gp_Mat aMat( aTrsf.m11(), aTrsf.m21(), 0,
aTrsf.m12(), -aTrsf.m22(), 0,
TopoDS_Shape aSubShape = aSubShapes.Value( i );
// Transform the sub-shape
- aPolylineObj->ImportShape( aSubShape );
+ aPolylineObj->ImportShape( aSubShape, false, NULL );
aPolylineObj->Transform( aTrsf );
/*
return;
}
- Handle(AIS_InteractiveContext) aCtx = NULL;
OCCViewer_ViewManager* aViewManager = getPreviewManager();
+ Handle(AIS_InteractiveContext) aCtx = NULL;
if ( aViewManager ) {
if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
aCtx = aViewer->getAISContext();
// update the object browser
module()->getApp()->updateObjectBrowser( true );
}
-}
\ No newline at end of file
+}