InterOp:Migration Guide/ACIS/ACIS to VDA-FS Reader-Writer
From DocR23
The following table provides mapping between the Legacy APIs and Connect options:
| API in Legacy Translator | Corresponding Option in Connect |
|---|---|
| api_initialize_xvda | No option; functionality handled internally |
|
api_terminate_xvda | No option; functionality handled internally |
|
api_xvda_set_attribute_transfer api_xvda_get_attribute_transfer | TranslateAttributes |
|
api_xvda_set_convert_points api_xvda_get_convert_points | TranslateFreePoints |
| api_xvda_set_convert_PsetToPolyline
api_xvda_get_convert_PsetToPolyline | PsetToPolyline |
| api_xvda_set_convert_free_curves
api_xvda_get_convert_free_curves | TranslateFreeCurves |
| api_xvda_set_convert_trimmed_faces
api_xvda_get_convert_trimmed_faces | TranslateSheetBodies |
| api_xvda_set_convert_free_surfaces
api_xvda_get_convert_free_surfaces | TranslateFreeSurfaces |
| api_xvda_set_convert_top_element
api_xvda_get_convert_top_element | VDA.Brep.TranslateTopEntities |
| api_xvda_set_spline_resurface_option
api_xvda_get_spline_resurface_option | DoSplineResurface |
| api_xvda_set_transfer_layers
api_xvda_get_transfer_layers | TranslateLayersAndFilters |
| api_xvda_set_3dCurve_MakeG1_option
api_xvda_get_3dCurve_MakeG1_option | CheckAndFixG1ThreeDCrv |
| api_xvda_define_header | No single equivalent Connect option or method. You can use the Add method of SPAIOptions class to set the individual options. |
| api_xvda_reset_header | No single equivalent Connect option or method. You can use the Add method of SPAIOptions class to set the individual options. |
| api_xvda_set_abort | SetProgressCallback method of SPAIConverter class |
The following table provides mapping between the Legacy APIs and Connect code:
| API in Legacy Translator | Corresponding Code for Connect |
|---|---|
| api_xvda_read | ENTITY_LIST* pAcisEntities=NULL; SPAIDocument src(InputPart.vda); SPAIAcisDocument dst; converter.Convert(src, dst); dst.GetEntities(pAcisEntities); dst.DetachEntities(); |
| api_xvda_read (using FILE ptr) |
ENTITY_LIST* pAcisEntities=NULL; SPAIFile InPutFile(const FILE* ipFile, const char* InputPart.vda); SPAIDocument src(InPutFile); SPAIAcisDocument dst; converter.Convert(src, dst); dst.GetEntities(pAcisEntities); dst.DetachEntities(); |
| api_xvda_write |
SPAIAcisDocument src(const ENTITY_LIST* ipEntities); SPAIDocument dst(OutputPart.vda); converter.Convert(src, dst); |
| api_xvda_write (using file ptr) |
SPAIFile OutputFile(const FILE* opFile, const char* OutputPart.vda); SPAIAcisDocument src(const ENTITY_LIST* ipEntities); SPAIDocument dst(OutputFile); converter.Convert(src, dst); |
| api_xvda_read_header
api_xvda_get_header |
SPAIDocument src(pszInputFile); SPAIDocumentHeaderInfo info; src.GetHeaderInfo(info); SPAIValue version; iInfo.GetVersion(version); const char* pszVal = (const char*)version; |
The following table provides mapping for the Callback mechanism between the Legacy translator and Connect:
| Callback Mechanism in Legacy Translator | Corresponding Code for Connect |
|---|---|
| api_xvda_set_abort | SetProgressCallback method of SPAIConverter class. Example:
void myProgressCallbackFunction(double iProgress, SPAXBoolean& oAbort) { printf("\rTranslation Progress : %.10f %%", iProgress*100.0); oAbort = 0; // setting oAbort to 1 will abort translation if(iProgress>0.1) oAbort = 1; } int main(int argc, char *argv) { SPAIDocument src(pszInputFile); if( strlen(pszInputFormat) > 0 ) src.SetType(pszInputFormat); SPAIDocument dst(pszOutputFile); converter.SetProgressCallback((SPAIProgressCallback)myProgressCallbackFunction); converter.Convert(src, dst); } |