Salome HOME
projects
/
modules
/
hydro.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Corrections of examples path after install with scbi
[modules/hydro.git]
/
src
/
HYDROGUI
/
HYDROGUI_RecognizeContoursOp.cxx
diff --git
a/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx
b/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx
index a3166c19372857cd137d367de2755f49384b8678..9af735e48880f823afa5ab68a16f6f1c4cd22ce5 100644
(file)
--- a/
src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx
+++ b/
src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx
@@
-21,10
+21,10
@@
#include "HYDROGUI_RecognizeContoursDlg.h"
#include "HYDROGUI_Module.h"
#include "HYDROGUI_Shape.h"
#include "HYDROGUI_RecognizeContoursDlg.h"
#include "HYDROGUI_Module.h"
#include "HYDROGUI_Shape.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool
2
.h"
#include "HYDROGUI_UpdateFlags.h"
#include "HYDROGUI_OCCSelector.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 <HYDROData_Document.h>
#include <HYDROData_GeomTool.h>
@@
-53,6
+53,7
@@
#include <gp_GTrsf.hxx>
#include <QDialog>
#include <gp_GTrsf.hxx>
#include <QDialog>
+#include <QDir>
#include <QTemporaryFile>
/**
#include <QTemporaryFile>
/**
@@
-79,6
+80,12
@@
void HYDROGUI_RecognizeContoursOp::startOperation()
{
HYDROGUI_Operation::startOperation();
{
HYDROGUI_Operation::startOperation();
+ // Set preview view manager
+ if ( !getPreviewManager() ) {
+ setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>(
+ module()->getApp()->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
+ }
+
if ( !isApplyAndClose() ) {
return;
}
if ( !isApplyAndClose() ) {
return;
}
@@
-93,7
+100,7
@@
void HYDROGUI_RecognizeContoursOp::startOperation()
// Create temporary graphics file
QImage aQImage = myImage->Image();
// 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();
if ( !myTmpImageFile->open() ||
!aQImage.save( myTmpImageFile->fileName(), "PNG", 100 ) ) {
abort();
@@
-120,12
+127,11
@@
void HYDROGUI_RecognizeContoursOp::startOperation()
// Export the selected image to GEOM module
if ( aStudy && aViewMgr ) {
// Export the selected image to GEOM module
if ( aStudy && aViewMgr ) {
- SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy->studyDS() );
GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen();
QString aGeomPictureEntry;
GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen();
QString aGeomPictureEntry;
- HYDROData_GeomTool::createFaceInGEOM( aGeomEngine, a
DSStudy, a
QImage.width(), aQImage.height(),
+ HYDROData_GeomTool::createFaceInGEOM( aGeomEngine, aQImage.width(), aQImage.height(),
anImageName, aGeomPictureEntry );
if ( !aGeomPictureEntry.isEmpty() ) {
anImageName, aGeomPictureEntry );
if ( !aGeomPictureEntry.isEmpty() ) {
@@
-135,10
+141,10
@@
void HYDROGUI_RecognizeContoursOp::startOperation()
// update the object browser
module()->getApp()->updateObjectBrowser( true );
// update the object browser
module()->getApp()->updateObjectBrowser( true );
- //
select the
picture
-
SUIT_DataOwnerPtrList aList( true )
;
- a
List.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( aGeomPictureEntry ) ) )
;
-
selectionMgr()->setSelected(aList
);
+ //
browse the published GEOM
picture
+
QStringList anEntries
;
+ a
nEntries << aGeomPictureEntry
;
+
browseObjects( anEntries
);
// Add GEOM picture object entry to the list of temporary geom objects
myTmpGeomObjects << aGeomPictureEntry;
// Add GEOM picture object entry to the list of temporary geom objects
myTmpGeomObjects << aGeomPictureEntry;
@@
-221,7
+227,7
@@
bool HYDROGUI_RecognizeContoursOp::processApply( int& theUpdateFlags,
if( !aPolylineObj.IsNull() ) {
aPolylineObj->SetName( aName );
if( !aPolylineObj.IsNull() ) {
aPolylineObj->SetName( aName );
- aPolylineObj->ImportShape( aShape );
+ aPolylineObj->ImportShape( aShape
, false, NULL
);
aPolylineObj->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
aPolylineObj->Update();
aPolylineObj->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
aPolylineObj->Update();
@@
-334,11
+340,6
@@
void HYDROGUI_RecognizeContoursOp::updateRecognizedPolylines()
Handle(AIS_InteractiveContext) aCtx = NULL;
// Display preview
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() ) {
OCCViewer_ViewManager* aViewManager = getPreviewManager();
if ( aViewManager ) {
if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
@@
-357,7
+358,7
@@
void HYDROGUI_RecognizeContoursOp::updateRecognizedPolylines()
aTrsf.m21(), -aTrsf.m22(), aTrsf.m23(),
aTrsf.m31() + aRect.width() * 0.5, aTrsf.m32 () - aRect.height() * 0.5, aTrsf.m33() );
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,
QTransform aTrsf = myImage->Trsf();
gp_Mat aMat( aTrsf.m11(), aTrsf.m21(), 0,
aTrsf.m12(), -aTrsf.m22(), 0,
@@
-377,7
+378,7
@@
void HYDROGUI_RecognizeContoursOp::updateRecognizedPolylines()
TopoDS_Shape aSubShape = aSubShapes.Value( i );
// Transform the sub-shape
TopoDS_Shape aSubShape = aSubShapes.Value( i );
// Transform the sub-shape
- aPolylineObj->ImportShape( aSubShape );
+ aPolylineObj->ImportShape( aSubShape
, false, NULL
);
aPolylineObj->Transform( aTrsf );
/*
aPolylineObj->Transform( aTrsf );
/*
@@
-441,7
+442,7
@@
void HYDROGUI_RecognizeContoursOp::onSelectionChanged( const QStringList& theSel
if ( !aCtx.IsNull() ) {
foreach ( QString aName, myPolylineShapes.keys() ) {
Handle(AIS_InteractiveObject) anObject =
if ( !aCtx.IsNull() ) {
foreach ( QString aName, myPolylineShapes.keys() ) {
Handle(AIS_InteractiveObject) anObject =
- myPolylineShapes.value(aName)->getAISObject
()
;
+ myPolylineShapes.value(aName)->getAISObject
s()[0]
;
bool isSelected = theSelectedNames.contains( aName );
if ( ( isSelected && !aCtx->IsSelected( anObject) ) ||
bool isSelected = theSelectedNames.contains( aName );
if ( ( isSelected && !aCtx->IsSelected( anObject) ) ||
@@
-466,9
+467,9
@@
void HYDROGUI_RecognizeContoursOp::onViewerSelectionChanged()
return;
}
return;
}
- Handle(AIS_InteractiveContext) aCtx = NULL;
OCCViewer_ViewManager* aViewManager = getPreviewManager();
OCCViewer_ViewManager* aViewManager = getPreviewManager();
+ Handle(AIS_InteractiveContext) aCtx = NULL;
if ( aViewManager ) {
if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
aCtx = aViewer->getAISContext();
if ( aViewManager ) {
if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
aCtx = aViewer->getAISContext();
@@
-479,7
+480,7
@@
void HYDROGUI_RecognizeContoursOp::onViewerSelectionChanged()
QStringList aSelectedNames;
foreach ( QString aName, myPolylineShapes.keys() ) {
QStringList aSelectedNames;
foreach ( QString aName, myPolylineShapes.keys() ) {
- bool isSelected = aCtx->IsSelected( myPolylineShapes.value(aName)->getAISObject
()
);
+ bool isSelected = aCtx->IsSelected( myPolylineShapes.value(aName)->getAISObject
s()[0]
);
if ( isSelected ) {
aSelectedNames << aName;
}
if ( isSelected ) {
aSelectedNames << aName;
}
@@
-512,4
+513,4
@@
void HYDROGUI_RecognizeContoursOp::cleanup()
// update the object browser
module()->getApp()->updateObjectBrowser( true );
}
// update the object browser
module()->getApp()->updateObjectBrowser( true );
}
-}
\ No newline at end of file
+}