X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FEntityGUI%2FEntityGUI_PictureImportDlg.cxx;h=e93a97dfa9576473c4978541bf842159f46fb31b;hb=4df93cfed754f9751ea7d13e3f728cc445c7ad01;hp=3feaf26adbcd73fc023822feb571df9ae610c1e7;hpb=5b3622aa2363853841fd5b4205c78a715bfee4a4;p=modules%2Fgeom.git diff --git a/src/EntityGUI/EntityGUI_PictureImportDlg.cxx b/src/EntityGUI/EntityGUI_PictureImportDlg.cxx index 3feaf26ad..e93a97dfa 100644 --- a/src/EntityGUI/EntityGUI_PictureImportDlg.cxx +++ b/src/EntityGUI/EntityGUI_PictureImportDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -34,6 +34,7 @@ #include #include #include +#include "utilities.h" #include #include @@ -162,7 +163,7 @@ bool EntityGUI_PictureImportDlg::ClickOnApply() //================================================================================= GEOM::GEOM_IOperations_ptr EntityGUI_PictureImportDlg::createOperation() { - return myGeomGUI->GetGeomGen()->GetIBlocksOperations( getStudyId() ); + return myGeomGUI->GetGeomGen()->GetIBlocksOperations(); } //================================================================================= @@ -174,7 +175,7 @@ bool EntityGUI_PictureImportDlg::execute( ObjectList& objects ) bool res = false; GEOM::GEOM_Object_var anObj; - GEOM::GEOM_IBasicOperations_var aBasicOperations = myGeomGUI->GetGeomGen()->GetIBasicOperations( getStudyId() ); + GEOM::GEOM_IBasicOperations_var aBasicOperations = myGeomGUI->GetGeomGen()->GetIBasicOperations(); GEOM::GEOM_IBlocksOperations_var aBlocksOperations = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() ); QString theImgFileName = myLineEdit->text(); if ( theImgFileName.isEmpty() ) @@ -184,13 +185,17 @@ bool EntityGUI_PictureImportDlg::execute( ObjectList& objects ) int height = pixmap->height(); int width = pixmap->width(); + delete pixmap; + GEOM::GEOM_Object_var P1 = aBasicOperations->MakePointXYZ( -0.5*width, -0.5*height, 0 ); - GEOM::GEOM_Object_var P2 = aBasicOperations->MakePointXYZ( -0.5*width, 0.5*height, 0 ); + GEOM::GEOM_Object_var P2 = aBasicOperations->MakePointXYZ( 0.5*width, -0.5*height, 0 ); GEOM::GEOM_Object_var P3 = aBasicOperations->MakePointXYZ( 0.5*width, 0.5*height, 0 ); - GEOM::GEOM_Object_var P4 = aBasicOperations->MakePointXYZ( 0.5*width, -0.5*height, 0 ); + GEOM::GEOM_Object_var P4 = aBasicOperations->MakePointXYZ( -0.5*width, 0.5*height, 0 ); GEOM::GEOM_Object_var aFace = aBlocksOperations->MakeQuad4Vertices(P1,P2,P3,P4); - getDisplayer()->SetTexture(theImgFileName.toStdString()); + getDisplayer()->SetDisplayMode(3); + const QByteArray asc = theImgFileName.toUtf8(); + getDisplayer()->SetTexture( std::string( asc.constData(), asc.length() ) ); if ( !aFace->_is_nil() ) { @@ -198,8 +203,7 @@ bool EntityGUI_PictureImportDlg::execute( ObjectList& objects ) } res=true; - - + return res; }