From 28c8e9fe42aecec565a46fe489967cad4f705a26 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 16 Jul 2015 20:45:48 +0300 Subject: [PATCH] IPAL52828: No Creation Info available for a GEOM object imported from XAO file --- resources/CMakeLists.txt | 1 + resources/import.png | Bin 0 -> 1125 bytes src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx | 5 ++++- src/GEOMGUI/GEOM_images.ts | 4 ++++ src/XAOPlugin/XAOPlugin_Driver.cxx | 21 +++++++++++++++++++-- src/XAOPlugin/XAOPlugin_Driver.hxx | 14 +++++++++----- src/XAOPlugin/XAOPlugin_IOperations.cxx | 2 ++ 7 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 resources/import.png 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 0000000000000000000000000000000000000000..71690c91278061869208d982bdf33e554c83000d GIT binary patch literal 1125 zcmV-r1e*JaP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2j2$} z5i2ro#_D?j00ZSoL_t(I%Z-#xh?Z3thOg(mKl7_K<_KX7qsa6_1=%7^h8EGHMPRxp zgxVBV7)(Ua!bQt+BeWRkXHlR*EsTh=G;on=Xr+dxmZgG@GdeThH#6_|e(%rud0Kqa zP!QI=JUrazy6?kz1mNB6tG3_!$hMvRx2{Sx1Vsdq2$1N~`QvBze6(-Jz7zZb)PQmm z#Q-A@ZQkP*uf#qG+c@+@E81k9R z;qb9DSN9%uB@kkO{*`M@wQvosTM(s)iNVBJTBQ9k+g^C%srl*4PfC=ihyVg&5EGlK zTyS|Y{>kQIKUBjYfks zO?Yw3!@E{4J9lFy3uj^gj37}8>JgJLHQQo*{}qNG8^e0A&f~liR0#@Y?aAxFuit;k z>95AwwCUxMynH_gqIjvzC`AbTboMF-e(PfOhNo%GH?W#gEgGsSAt+Ud_~FyHaosEF zUporGYg>o!uB(NgJBDH~Q5T1fo#TT~4$wQemJ6r8Bg-fyahOsYCh~Wz8(XZD5AEGZ0-i-fMT7{vXEP-)L=u5qM#6I1PHz^@U}vO z2cWEN_nGq-wPR=!S_=&pY&WU_?;V7I!4pd$iaT@&n8?%Hosf#fNJVcd04y}8nV6bc zy-1kSYF=k*w#D*w23uKbuUNV|g@_=s_;|kN+YfiJtm^`)afGcK(dk3$fpcTqHg!5w zRTP-K(PWtl)&`sl|N6CdZ8*s-3BfH)82`6(AA*Od6S>IeNKFsT`HY^}^3s}v+}_<> z8dlXMQgvO}+DcipLsjJj>xhyx_z=8_(~ee*(BKgxcyCb+1ZVMCqcbl8A>g&5 z3|=Q@>w2;cr_@mZ}hh0KTfVElTc#ejNj} z=O%|}HgT;92%(cvg#VI=*np|BcDUwg+!VZlWN@xPUb0a%&ND zWqDt8Wc>4sg#c#bI`huPdsaN_G>L--L_lw{mt!Lu8POz`Ac9WJ+B?5EJ~P#5>3sr3 rz-_Ff_RT#jgcd#r00000NkvXXu0mjf?`R5i literal 0 HcmV?d00001 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) {