#include <QToolButton>
#include <QCheckBox>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
HYDROGUI_ImportImageDlg::HYDROGUI_ImportImageDlg( HYDROGUI_Module* theModule, const QString& theTitle )
: HYDROGUI_InputPanel( theModule, theTitle ),
myIsInitialized( false )
const bool theIsOnlyInput,
const bool theIsRefImage )
{
+ DEBTRACE("setTransformationDataMap " << theIsOnlyInput << " " << theIsRefImage);
blockSignalsGeodesic( true );
blockSignalsCartesian( true );
for( int aPointType = HYDROGUI_PrsImage::PointA;
QtxIntSpinBox* aPointY = theIsRefImage ? myRefPointYMap[ aPointType ] : myPointYMap[ aPointType ];
aPointX->setValue( aData.ImagePoint.x() );
aPointY->setValue( aData.ImagePoint.y() );
+ DEBTRACE("aPointX " << aData.ImagePoint.x() << " aPointY " << aData.ImagePoint.y());
if( !theIsOnlyInput && !theIsRefImage )
{
// must be done after all checks and before calling SetVisible() method below
if ( isApplyAndClose() )
{
- DEBTRACE("closePreview");
+ //DEBTRACE("closePreview");
closePreview();
}
{
if( GraphicsView_ViewPort* aViewPort = aViewer->getActiveViewPort() )
{
+ DEBTRACE("myPreviewViewManager exists");
+// QTransform transform;
+// transform.scale(1.0, -1.0);
+// aViewPort->setTransform(transform, false);
aViewPort->onBoundingRectChanged();
aViewPort->fitAll();
}
dynamic_cast<GraphicsView_ViewManager*>( anApp->createViewManager( GraphicsView_Viewer::Type() ) );
if( myPreviewViewManager )
{
+ DEBTRACE("myPreviewViewManager created " << myPreviewViewManager);
connect( myPreviewViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
this, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
{
if( GraphicsView_ViewPort* aViewPort = aViewer->getActiveViewPort() )
{
+ DEBTRACE("aViewPort " << aViewPort);
//aViewPort->setMousePositionEnabled( true ); //ouv: temporarily commented
+ QTransform transform;
+ transform.scale(1.0, -1.0);
+ aViewPort->setTransform(transform, false);
aViewPort->addItem( myPreviewPrs );
aViewPort->fitAll();
void HYDROGUI_ImportImageOp::onModeActivated( int theMode )
{
- DEBTRACE("onModeActivated");
+ DEBTRACE("onModeActivated " << theMode);
HYDROGUI_ImportImageDlg* aPanel = (HYDROGUI_ImportImageDlg*)inputPanel();
QString aRefImageName;
if( myRefViewManager )
{
closeView( myRefViewManager );
+ myRefViewManager = 0;
}
}
}
void HYDROGUI_ImportImageOp::onRefImageActivated( const QString& theName )
{
- DEBTRACE("onRefImageActivated");
+ DEBTRACE("onRefImageActivated " << theName.toStdString());
if( theName.isEmpty() ) {
if( myRefViewManager )
closeView( myRefViewManager );
+ myRefViewManager = 0;
return;
}
dynamic_cast<GraphicsView_ViewManager*>( anApp->createViewManager( GraphicsView_Viewer::Type() ) );
if( myRefViewManager )
{
+ DEBTRACE("myRefViewManager created " << myRefViewManager);
connect( myRefViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
this, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) );
if( !aViewPort )
return;
+ QTransform transform;
+ transform.scale(1.0, -1.0);
+ aViewPort->setTransform(transform, false);
size_t aViewId = (size_t)myRefViewManager->getViewer();
void HYDROGUI_ImportImageOp::onPointSelected( bool theIsRefImage )
{
- DEBTRACE("onPointSelected");
+ DEBTRACE("onPointSelected " << theIsRefImage);
HYDROGUI_PrsImage* aPrs = theIsRefImage ? myRefPreviewPrs : myPreviewPrs;
if( !aPrs )
return;
{
DEBTRACE("closePreview");
closeView( myPreviewViewManager );
+ myPreviewViewManager = 0;
closeView( myRefViewManager );
+ myRefViewManager = 0;
if( myActiveViewManager )
HYDROGUI_Tool::SetActiveViewManager( module(), myActiveViewManager );
void HYDROGUI_ImportImageOp::closeView( GraphicsView_ViewManager* &aViewMgr )
{
- DEBTRACE("closeView");
+ DEBTRACE("closeView " << aViewMgr);
if( aViewMgr )
{
GraphicsView_ViewPort* aViewPort = 0;
switch ( module()->getViewManagerRole( aViewMgr ) )
{
case HYDROGUI_Module::VMR_ReferenceImage:
+ DEBTRACE(" myRefPreviewPrs = 0");
aPrs = myRefPreviewPrs;
myRefPreviewPrs = 0;
break;
case HYDROGUI_Module::VMR_TransformImage:
+ DEBTRACE(" myPreviewPrs = 0");
aPrs = myPreviewPrs;
myPreviewPrs = 0;
}
const bool theIsY,
const int theValue )
{
+ DEBTRACE("updateTransformationPoint " << thePointType << " theIsY " << theIsY << " theValue " << theValue);
if( myTransformationPointMap.find( thePointType ) != myTransformationPointMap.end() )
{
TransformationPoint& aTransformationPoint = myTransformationPointMap[ thePointType ];
//================================================================
void HYDROGUI_PrsImage::compute()
{
+ DEBTRACE("compute");
if( !myPixmapItem )
{
myPixmapItem = new QGraphicsPixmapItem( this );
myCaptionItem->setPos( 0, -30 );
myCaptionItem->setVisible( false );
+// QTransform transform;
+// transform.scale(1.0, -1.0);
+// this->setTransform(transform, false);
+// //this->setViewTransform(transform);
+
myPrsImageFrame->compute();
}
aGroupItem->addToGroup( aPointItem );
aGroupItem->addToGroup( aCaptionItem );
aGroupItem->setVisible( false );
+// QTransform transform;
+// transform.scale(1.0, -1.0); // retourne le point et sa lettre
+// aGroupItem->setTransform(transform, true);
aGroupItem->setFlag( QGraphicsItem::ItemIgnoresTransformations );
return aGroupItem;
#include <QPainter>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
#define FRAME_Z_VALUE 1000
#define ANCHOR_RADIUS 3
#define EPSILON 1e-6
//================================================================
void HYDROGUI_PrsImageFrame::compute()
{
+ DEBTRACE("compute");
if( myAnchorMap.isEmpty() )
{
for( int aType = TopLeft; aType <= BottomRight; aType++ )
setZValue( FRAME_Z_VALUE );
computeAnchorItems();
+// QTransform transform;
+// transform.scale(-0.5, 1.0);
+// this->setTransform(transform, false);
updateVisibility();
}
//================================================================
void HYDROGUI_PrsImageFrame::updateVisibility()
{
+ if (myPrsImage)
+ DEBTRACE("updateVisibility " << myPrsImage->isSelected());
setVisible( myPrsImage && myPrsImage->isSelected() );
}