From: eap Date: Thu, 16 Jul 2015 17:45:48 +0000 (+0300) Subject: IPAL52828: No Creation Info available for a GEOM object imported from XAO file X-Git-Tag: V7_7_0a1~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=28c8e9fe42aecec565a46fe489967cad4f705a26;p=modules%2Fgeom.git IPAL52828: No Creation Info available for a GEOM object imported from XAO file --- diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 44d86e7bc..3d47d93ed 100755 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -114,6 +114,7 @@ SET( _res_files fuse_collinear_edges.png geometry.png import_picture.png + import.png limit_tolerance.png line.png line2points.png diff --git a/resources/import.png b/resources/import.png new file mode 100644 index 000000000..71690c912 Binary files /dev/null and b/resources/import.png differ diff --git a/src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx b/src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx index 5c3681e28..35a59ccfb 100644 --- a/src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx +++ b/src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx @@ -124,7 +124,10 @@ void GEOMGUI_CreationInfoWdg::setInfo( GEOM::CreationInformationSeq& info ) } // get icon QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name; - icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false ); + if ( name.startsWith( "Import")) + icon = resMgr->loadPixmap( "GEOM", tr("ICO_IMPORT_SHAPE"), true ); + else + icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false ); // translate operation name operationName = tr( ("MEN_"+name).toLatin1().constData() ); diff --git a/src/GEOMGUI/GEOM_images.ts b/src/GEOMGUI/GEOM_images.ts index 1e906fe81..cfcccd313 100644 --- a/src/GEOMGUI/GEOM_images.ts +++ b/src/GEOMGUI/GEOM_images.ts @@ -1387,6 +1387,10 @@ ICO_TRANSFER_DATA transfer_data.png + + ICO_IMPORT_SHAPE + import.png + ICON_DLG_POINT_FACE pointonface.png diff --git a/src/XAOPlugin/XAOPlugin_Driver.cxx b/src/XAOPlugin/XAOPlugin_Driver.cxx index 01803c136..607c7b3df 100644 --- a/src/XAOPlugin/XAOPlugin_Driver.cxx +++ b/src/XAOPlugin/XAOPlugin_Driver.cxx @@ -100,6 +100,23 @@ Standard_Integer XAOPlugin_Driver::Execute(TFunction_Logbook& log) const return 1; } -IMPLEMENT_STANDARD_HANDLE (XAOPlugin_Driver, TFunction_Driver); -IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, TFunction_Driver); +//======================================================================= +//function : GetCreationInformation +//purpose : Returns a name of creation operation and names and values of +// creation parameters +//======================================================================= + +bool XAOPlugin_Driver::GetCreationInformation(std::string& theOperationName, + std::vector& theParams) +{ + if (Label().IsNull()) return false; + Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label()); + + theOperationName = "ImportXAO"; + AddParam( theParams, "File name", function->GetString( GetFileNameTag() )); + return true; +} + +IMPLEMENT_STANDARD_HANDLE (XAOPlugin_Driver, GEOM_BaseDriver); +IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, GEOM_BaseDriver); diff --git a/src/XAOPlugin/XAOPlugin_Driver.hxx b/src/XAOPlugin/XAOPlugin_Driver.hxx index 1d36b839b..9a8885e96 100644 --- a/src/XAOPlugin/XAOPlugin_Driver.hxx +++ b/src/XAOPlugin/XAOPlugin_Driver.hxx @@ -23,12 +23,11 @@ #ifndef _XAOPlugin_Driver_HXX #define _XAOPlugin_Driver_HXX -// OCCT includes -#include +#include "GEOM_BaseDriver.hxx" -DEFINE_STANDARD_HANDLE(XAOPlugin_Driver, TFunction_Driver); +DEFINE_STANDARD_HANDLE(XAOPlugin_Driver, GEOM_BaseDriver); -class XAOPlugin_Driver: public TFunction_Driver +class XAOPlugin_Driver: public GEOM_BaseDriver { public: XAOPlugin_Driver(); @@ -39,7 +38,12 @@ public: Standard_Boolean MustExecute(const TFunction_Logbook&) const; virtual void Validate(TFunction_Logbook&) const {} -DEFINE_STANDARD_RTTI(XAOPlugin_Driver) + virtual bool GetCreationInformation(std::string& theOperationName, + std::vector& theParams); + + static int GetFileNameTag() { return 1; } // where to store file name in GEOM_Function + + DEFINE_STANDARD_RTTI(XAOPlugin_Driver) }; #endif // _XAOPlugin_Driver_HXX diff --git a/src/XAOPlugin/XAOPlugin_IOperations.cxx b/src/XAOPlugin/XAOPlugin_IOperations.cxx index d491cad2b..d8c886274 100644 --- a/src/XAOPlugin/XAOPlugin_IOperations.cxx +++ b/src/XAOPlugin/XAOPlugin_IOperations.cxx @@ -470,6 +470,8 @@ bool XAOPlugin_IOperations::ImportXAO( const char* fileName, if (function.IsNull()) return false; if (function->GetDriverGUID() != XAOPlugin_Driver::GetID()) return false; + function->SetString( XAOPlugin_Driver::GetFileNameTag(), fileName ); + // set the geometry if (xaoGeometry->getFormat() == XAO::BREP) {