IPAL52828: No Creation Info available for a GEOM object imported from XAO file

This commit is contained in:
eap 2015-07-16 20:45:48 +03:00
parent 73a0114391
commit 28c8e9fe42
7 changed files with 39 additions and 8 deletions

View File

@ -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

BIN
resources/import.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -124,6 +124,9 @@ void GEOMGUI_CreationInfoWdg::setInfo( GEOM::CreationInformationSeq& info )
}
// get icon
QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name;
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

View File

@ -1387,6 +1387,10 @@
<source>ICO_TRANSFER_DATA</source>
<translation>transfer_data.png</translation>
</message>
<message>
<source>ICO_IMPORT_SHAPE</source>
<translation>import.png</translation>
</message>
<message>
<source>ICON_DLG_POINT_FACE</source>
<translation>pointonface.png</translation>

View File

@ -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<GEOM_Param>& 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);

View File

@ -23,12 +23,11 @@
#ifndef _XAOPlugin_Driver_HXX
#define _XAOPlugin_Driver_HXX
// OCCT includes
#include <TFunction_Driver.hxx>
#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<GEOM_Param>& theParams);
static int GetFileNameTag() { return 1; } // where to store file name in GEOM_Function
DEFINE_STANDARD_RTTI(XAOPlugin_Driver)
};
#endif // _XAOPlugin_Driver_HXX

View File

@ -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)
{