X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Document.cxx;h=6a8f7376402874535a0698799b981a0a1c76ccc6;hb=58bb6b7459bebeeb089c9ed486c4683a8bae7288;hp=653ddb8e2dd0686962afd0c40b8858d3f85cd8e1;hpb=51f1f5efbfb19a6e9b39baccdb76a89b04663fbb;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Document.cxx b/src/HYDROData/HYDROData_Document.cxx index 653ddb8e..6a8f7376 100644 --- a/src/HYDROData/HYDROData_Document.cxx +++ b/src/HYDROData/HYDROData_Document.cxx @@ -37,7 +37,6 @@ #include #include -IMPLEMENT_STANDARD_HANDLE(HYDROData_Document,MMgt_TShared) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Document,MMgt_TShared) #define PYTHON_DOC_NAME "hydro_doc" @@ -54,8 +53,8 @@ static const gp_Pnt2d DEFAULT_LOCAL_CS( 0, 0 ); using namespace std; -typedef QMap MapOfOrdered; -typedef QMap MapOfUnordered; +typedef QMap MapOfOrdered; +typedef QMap MapOfUnordered; Handle(HYDROData_Document) HYDROData_Document::Document(const int theStudyID) { @@ -237,7 +236,7 @@ bool HYDROData_Document::DumpToPython( const QString& thePyScriptPath, { // Try to open the file QFile aFile( thePyScriptPath ); - if ( !aFile.open( QIODevice::WriteOnly ) ) + if ( !aFile.open( QIODevice::WriteOnly | QFile::Text ) ) return false; MapOfTreatedObjects aTreatedObjects; @@ -253,7 +252,7 @@ bool HYDROData_Document::DumpToPython( const QString& thePyScriptPath, // Dump the local CS data to Python UpdateLCSFields(); - QString aLCS = QString( "%1.SetLocalCS( %2, %3 )" ).arg( GetDocPyName() ).arg( myLX ).arg( myLY ); + QString aLCS = QString( "%1.SetLocalCS( %2, %3 )" ).arg( GetDocPyName() ).arg( myLX, 0, 'f', 3 ).arg( myLY, 0, 'f', 3 ); if( theIsMultiFile ) aLCS.prepend( " " ); HYDROData_Tool::WriteStringsToFile( aFile, QStringList() << aLCS ); @@ -322,12 +321,12 @@ QStringList HYDROData_Document::DumpToPython( const QString& thePyScriptPath, aResScript << QString( "import salome" ); aResScript << QString( "" ); aResScript << QString( "def RebuildData( theStudy ):" ); - aResScript << QString( " %1 = HYDROData_Document.Document( theStudy._get_StudyId() );" ).arg( aDocName ); + aResScript << QString( " %1 = HYDROData_Document.Document( theStudy._get_StudyId() )" ).arg( aDocName ); } else { aResScript << QString( "" ); - aResScript << QString( "%1 = HYDROData_Document.Document( theStudy._get_StudyId() );" ).arg( aDocName ); + aResScript << QString( "%1 = HYDROData_Document.Document( theStudy._get_StudyId() )" ).arg( aDocName ); } return aResScript; @@ -483,7 +482,7 @@ void HYDROData_Document::SetObjectsLayerOrder( const HYDROData_SequenceOfObjects } } -void HYDROData_Document::Show( const Handle_HYDROData_Entity& theObject ) +void HYDROData_Document::Show( const Handle(HYDROData_Entity)& theObject ) { HYDROData_SequenceOfObjects anOrder; anOrder.Append( theObject ); @@ -831,6 +830,11 @@ void HYDROData_Document::Transform( gp_XYZ& thePnt, bool IsToLocalCS ) const thePnt = gp_XYZ( X, Y, Z ); } +void HYDROData_Document::Transform( double& X, double& Y, double& Z, bool IsToLocalCS ) const +{ + Transform( X, Y, IsToLocalCS ); +} + void HYDROData_Document::Transform( gp_XY& thePnt, bool IsToLocalCS ) const { double X = thePnt.X();