Home
Reply
Contributor
PaulS
Posts: 16

New InputFormat->ACIS->Parasolid translation flow - are SPAIConverter objects reusable?

I am reworking my translation in the light of the introduction of the InputFormat->ACIS->Parasolid translation flow.

 

I have two versions of the new code, but each has problems.

 

Version 1 uses two SPAIConverter objects:

 

SPAIDocument  ACISFile( strTempFile ); // ACISFile is a temp file with extension .sab

SPAIConverter ConverterToACIS;

ConverterToACIS.SetProgressCallback( InterOp_ProgressCallback );

 

ConverterToACIS.StartLog( ACISLogFile );

Result = ConverterToACIS.Convert ( SourceFile, ACISFile );

ConverterToACIS.StopLog( ACISLogFile );

 

SPAIGenericDocument ParasolidFile;

SPAIConverter ConverterToParasolid;

ConverterToParasolid.SetProgressCallback( InterOp_ProgressCallback );

 

ConverterToParasolid.StartLog( ParasolidLogFile );

Result = ConverterToParasolid.Convert ( ACISFile, ParasolidFile );

ConverterToParasolid.StopLog( ParasolidLogFile );

 

This works, but I now have two log files and this is not desired.

 

So, version 2 uses a single SPAIConverter:

 

SPAIConverter Converter;

Converter.SetProgressCallback( InterOp_ProgressCallback );

 

Converter.StartLog( ACISLogFile );

Result = Converter.Convert ( SourceFile, ACISFile ); // ACISFile is a temp file with extension .sab

 

SPAIGenericDocument ParasolidFile;

 

Result = Converter.Convert ( ACISFile, ParasolidFile );

Converter.StopLog( ParasolidLogFile );

 

This also works and I have a single logfile for the two-stage translation.  However, the callback to InterOp_ProgressCallback is not made for the second conversion, so I cannot determine progress.  This is not desired.

 

This second problem – the lack of callbacks during translation – makes me wonder whether it is a good idea to reuse a convertor.  What other state might be persisted by an instance of a SPAIConverter, making suspect the second and subsequent conversions it performs?

Paul Scully
Senior Software Engineer
Renishaw PLC

T +44 (0)1453 524764
F +44 (0)1453 523201
E paul.scully@renishaw.com
www.renishaw.com
Spatial Moderator
ybiyani
Posts: 223

Re: New InputFormat->ACIS->Parasolid translation flow - are SPAIConverter objects reusable?

Hello Paul,

 

We test one translation at a time -So this is an unknown. If you would like to reuse the objects and encounter issue please log them as support incidents so that we can review this further.

 

Regards,

Yogesh

Contributor
PaulS
Posts: 16

Re: New InputFormat->ACIS->Parasolid translation flow - are SPAIConverter objects reusable?

Thanks, Yogesh.

 

I will log a report.  It seems I must live with two log files for now, which involves changing more code to accommodate the new workflow.

 

It's never quite (quote) "a fairly simple change in your code" - yes the changes are simple, but the ramifications of behavioural changes are not =)

Paul Scully
Senior Software Engineer
Renishaw PLC

T +44 (0)1453 524764
F +44 (0)1453 523201
E paul.scully@renishaw.com
www.renishaw.com