EASY-ROB™ Application Programming Interface  v8.008
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Static Public Member Functions | List of all members
ER_CAPI_USER_IO_3DPDF Class Reference

Method class for 3D Pdf Export. More...

#include <ER_CAPI.H>

Inheritance diagram for ER_CAPI_USER_IO_3DPDF:
ER_CAPI_USER_IO ER_CAPI

Static Public Member Functions

static ER_DllExport char * U3DPdf_ExportVer (void)
 3D PDF Export Version More...
 
static ER_DllExport int U3DPdf_ExportAPI (int pdf_flag, char *s=NULL)
 Control 3D PDF Export
To open the created 3D Pdf file, Adobe Reader up to version XI is required.
Parameter pdf_flag is one of _3DPDF_EXPORT_GET_MODE, _3DPDF_EXPORT_ACTIVATE, _3DPDF_EXPORT_DEACTIVATE, _3DPDF_EXPORT_INIT, _3DPDF_EXPORT_START, _3DPDF_EXPORT_PAUSE, _3DPDF_EXPORT_STOP, _3DPDF_EXPORT_SAVE, _3DPDF_EXPORT_EXPORT, _3DPDF_EXPORT_SHOW, _3DPDF_EXPORT_RESTART, _3DPDF_EXPORT_GET_LIC_OPTIONS, _3DPDF_EXPORT_SET_FILE, _3DPDF_EXPORT_SET_PASSWORD or _3DPDF_EXPORT_SET_LABEL _3DPDF_EXPORT_SET_KEYFRAMES_MAX _3DPDF_EXPORT_GET_KEYFRAMES _3DPDF_EXPORT_RESET_LAYOUT _3DPDF_EXPORT_LOAD_LAYOUT_FILE _3DPDF_EXPORT_SAVE_LAYOUT_FILE

Explanations
Before using the 3D Pdf Export, make sure that the "EASY-ROB PlugIn Dialog 3D-Pdf Export" is closed. This can be verified with _3DPDF_EXPORT_GET_MODE.
The return value is one of
_3DPDF_EXPORT_MODE_FREE - 3D Pdf Export currently not in use, does mean it is ready to for API usage
_3DPDF_EXPORT_MODE_ERROR - 3D Pdf Export currently on error
_3DPDF_EXPORT_MODE_DLG - PlugIn Dialog for 3D-Pdf Export is open
_3DPDF_EXPORT_MODE_API - already in API usage

Step_I
If _3DPDF_EXPORT_GET_MODE returns _3DPDF_EXPORT_MODE_FREE, you can activate and initialize the 3D Pdf Export with _3DPDF_EXPORT_ACTIVATE and _3DPDF_EXPORT_INIT.
In the next step, define all necessary callback function, see
U3DPdf_ExportAPI_SetCallbackMsg() for feedback messages
U3DPdf_ExportAPI_SetCallbackSaveStatus() for status messages when saving the 3D PDF file
U3DPdf_ExportAPI_SetCallbackProgress() for ExportU3DScene and Generate3DPdf progress messages when saving the 3D PDF file
U3DPdf_ExportAPI_SetCallbackProgressExportU3DScene() for ExportU3DScene progress messages when saving the 3D PDF file
U3DPdf_ExportAPI_SetCallbackProgressGenerate3DPdf() for Generate3DPdf progress messages when saving the 3D PDF file

Step_II
The API for 3D pdf Export is ready to use now.
To start the recording, use _3DPDF_EXPORT_START
Everytime EASY-ROB causes a grafical update, an additional key frame is recorded.
During recording you can set labels with _3DPDF_EXPORT_SET_LABEL
Use _3DPDF_EXPORT_PAUSE to pause and continue the recording.
Before you stop and save the recording you should define a file name for the created pdf file and optional also a password.
The password protecting the pdf file and allows it to open only for certain users.

Step_III
Finally use _3DPDF_EXPORT_SAVE or _3DPDF_EXPORT_STOP to create the 3D Pdf file and wait until _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE, see U3DPdf_ExportAPI_SetCallbackSaveStatus().
Use _3DPDF_EXPORT_DEACTIVATE to terminate the API usage. This sets the 3D Pdf Export back to _3DPDF_EXPORT_MODE_FREE and will free the complete used memory.
Remarks
Use _3DPDF_EXPORT_EXPORT directly after Step_I to save the 3D Scene without animation.
After Step_III you can immediately continue with Step_II , it is not necessary to activate the 3d Pdf Export API several times. More...
 
static ER_DllExport int U3DPdf_ExportAPI_SetCallbackMsg (int callback_fct_id, void(*ptr_MsgFct)(char *))
 Defines a callback function for output messages during 3D PDF file Export
Parameter callback_fct_id is 1 or 2 for two different output streams. More...
 
static ER_DllExport int U3DPdf_ExportAPI_SetCallbackSaveStatus (void(*ptr_SaveStatusFct)(int))
 Defines a callback function for status messages when saving the 3D PDF file
Parameter save_status in Callback_API_SaveStatus(int save_status) is one of _3DPDF_EXPORT_SAVE_STATUS_UNDEF, _3DPDF_EXPORT_SAVE_STATUS_RECORD, _3DPDF_EXPORT_SAVE_STATUS_SAVE_BEGIN, _3DPDF_EXPORT_SAVE_STATUS_SAVE_BEGIN_THREAD, _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE, _3DPDF_EXPORT_SAVE_STATUS_SAVE_ABORT, _3DPDF_EXPORT_SAVE_STATUS_SAVE_ERROR or _3DPDF_EXPORT_SAVE_STATUS_KEYFRAMES_MAX
Remarks
save_status _3DPDF_EXPORT_SAVE_STATUS_RECORD confirmed that the recording is started
A pdf_flag _3DPDF_EXPORT_STOP, see U3DPdf_ExportAPI() causes _3DPDF_EXPORT_SAVE_STATUS_SAVE_BEGIN or _3DPDF_EXPORT_SAVE_STATUS_SAVE_BEGIN_THREAD to confirm that the 3D Pdf Export is started directly or running in a Thread.
If the 3D Pdf file was created successfully, it will be confirmed with _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE.
In other cases the save_status is _3DPDF_EXPORT_SAVE_STATUS_SAVE_ABORT or _3DPDF_EXPORT_SAVE_STATUS_SAVE_ERROR
Make sure that 3D Pdf file is not open in the Adobe Reader. More...
 
static ER_DllExport int U3DPdf_ExportAPI_SetCallbackProgress (void(*ptr_ProgressFct)(double))
 Defines one single callback function for ExportU3DScene progress and Generate3DPdf progress messages when saving the 3D PDF file
Parameter progress in Callback_API_Progress(double progress) is between 0 and 1 for 100%
Define U3DPdf_ExportAPI_SetCallbackSaveStatus() to receive _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE when saving the 3D PDF file is completed.
Remarks
To define one callback function for ExportU3DScene progress (Save Step A) and one for Generate3DPdf progress (Save Step B),
use U3DPdf_ExportAPI_SetCallbackProgressExportU3DScene() and U3DPdf_ExportAPI_SetCallbackProgressGenerate3DPdf() More...
 
static ER_DllExport int U3DPdf_ExportAPI_SetCallbackProgressExportU3DScene (void(*ptr_ProgressFctExportU3DScene)(double))
 Defines a callback function for ExportU3DScene progress messages when saving the 3D PDF file
Parameter progress in Callback_API_ProgressExportU3DScene(double progress) is between 0 and 1 for 100%
Define U3DPdf_ExportAPI_SetCallbackSaveStatus() to receive _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE when saving the 3D PDF file is completed.
Remarks
When saving the 3D PDF file, ExportU3DScene is Save Step A.
Save Step B generates the 3DPdf file, use U3DPdf_ExportAPI_SetCallbackProgressGenerate3DPdf()
Use U3DPdf_ExportAPI_SetCallbackProgress() to define one single callback function for both Save Steps. More...
 
static ER_DllExport int U3DPdf_ExportAPI_SetCallbackProgressGenerate3DPdf (void(*ptr_ProgressFctGenerate3DPdf)(double))
 Defines a callback function for Generate3DPdf progress messages when saving the 3D PDF file
Parameter progress in Callback_API_ProgressGenerate3DPdf(double progress) is between 0 and 1 for 100%
Define U3DPdf_ExportAPI_SetCallbackSaveStatus() to receive _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE when saving the 3D PDF file is completed.
Remarks
When saving the 3D PDF file, ExportU3DScene is Save Step A and Generate3DPdf is Save Step B.
For Save Step A use U3DPdf_ExportAPI_SetCallbackProgressExportU3DScene()
Use U3DPdf_ExportAPI_SetCallbackProgress() to define one single callback function for both Save Steps. More...
 

Additional Inherited Members

- Static Public Attributes inherited from ER_CAPI_USER_IO
static ER_CAPI_USER_IO_FILE er_capi_user_io_file
 Method class to load and save work cells-, robots-, tool-files, etc. More...
 
static ER_CAPI_USER_IO_DIALOG er_capi_user_io_dialog
 Method class, supplies dialogs, i.e. to enter and show values. More...
 
static ER_CAPI_USER_IO_PICK er_capi_user_io_pick
 Method class to "pick" objects such as devices, tags, polygon, vertices, measure distances, ... More...
 
static ER_CAPI_USER_IO_CRUISE er_capi_user_io_cruise
 Method class to manipulate the 3D Scene. More...
 
static ER_CAPI_USER_IO_3DPDF er_capi_user_io_3dpdf
 Method class for 3D Pdf Export. More...
 
- Static Public Attributes inherited from ER_CAPI
static ER_CAPI_USER_IO er_capi_user_io
 Method class for interaction with EASY-ROB. More...
 
static ER_CAPI_DEVICES er_capi_devices
 Method class to create, attach, update devices, for kinematics calculations and for trajectory planning and -execution. More...
 
static ER_CAPI_SIM er_capi_sim
 Method class for simulation settings. More...
 
static ER_CAPI_TARGETS er_capi_targets
 Method class for paths and tags. More...
 
static ER_CAPI_CAD er_capi_cad
 Method class for for 3D CAD Data import and -export, changing attributes and positions. More...
 
static ER_CAPI_SYS er_capi_sys
 Method class for mathematical calculations, simulation status, units. More...
 

Detailed Description

Method class for 3D Pdf Export.

Member Function Documentation

static ER_DllExport int ER_CAPI_USER_IO_3DPDF::U3DPdf_ExportAPI ( int  pdf_flag,
char *  s = NULL 
)
static

Control 3D PDF Export
To open the created 3D Pdf file, Adobe Reader up to version XI is required.
Parameter pdf_flag is one of _3DPDF_EXPORT_GET_MODE, _3DPDF_EXPORT_ACTIVATE, _3DPDF_EXPORT_DEACTIVATE, _3DPDF_EXPORT_INIT, _3DPDF_EXPORT_START, _3DPDF_EXPORT_PAUSE, _3DPDF_EXPORT_STOP, _3DPDF_EXPORT_SAVE, _3DPDF_EXPORT_EXPORT, _3DPDF_EXPORT_SHOW, _3DPDF_EXPORT_RESTART, _3DPDF_EXPORT_GET_LIC_OPTIONS, _3DPDF_EXPORT_SET_FILE, _3DPDF_EXPORT_SET_PASSWORD or _3DPDF_EXPORT_SET_LABEL _3DPDF_EXPORT_SET_KEYFRAMES_MAX _3DPDF_EXPORT_GET_KEYFRAMES _3DPDF_EXPORT_RESET_LAYOUT _3DPDF_EXPORT_LOAD_LAYOUT_FILE _3DPDF_EXPORT_SAVE_LAYOUT_FILE

Explanations
Before using the 3D Pdf Export, make sure that the "EASY-ROB PlugIn Dialog 3D-Pdf Export" is closed. This can be verified with _3DPDF_EXPORT_GET_MODE.
The return value is one of
_3DPDF_EXPORT_MODE_FREE - 3D Pdf Export currently not in use, does mean it is ready to for API usage
_3DPDF_EXPORT_MODE_ERROR - 3D Pdf Export currently on error
_3DPDF_EXPORT_MODE_DLG - PlugIn Dialog for 3D-Pdf Export is open
_3DPDF_EXPORT_MODE_API - already in API usage

Step_I
If _3DPDF_EXPORT_GET_MODE returns _3DPDF_EXPORT_MODE_FREE, you can activate and initialize the 3D Pdf Export with _3DPDF_EXPORT_ACTIVATE and _3DPDF_EXPORT_INIT.
In the next step, define all necessary callback function, see
U3DPdf_ExportAPI_SetCallbackMsg() for feedback messages
U3DPdf_ExportAPI_SetCallbackSaveStatus() for status messages when saving the 3D PDF file
U3DPdf_ExportAPI_SetCallbackProgress() for ExportU3DScene and Generate3DPdf progress messages when saving the 3D PDF file
U3DPdf_ExportAPI_SetCallbackProgressExportU3DScene() for ExportU3DScene progress messages when saving the 3D PDF file
U3DPdf_ExportAPI_SetCallbackProgressGenerate3DPdf() for Generate3DPdf progress messages when saving the 3D PDF file

Step_II
The API for 3D pdf Export is ready to use now.
To start the recording, use _3DPDF_EXPORT_START
Everytime EASY-ROB causes a grafical update, an additional key frame is recorded.
During recording you can set labels with _3DPDF_EXPORT_SET_LABEL
Use _3DPDF_EXPORT_PAUSE to pause and continue the recording.
Before you stop and save the recording you should define a file name for the created pdf file and optional also a password.
The password protecting the pdf file and allows it to open only for certain users.

Step_III
Finally use _3DPDF_EXPORT_SAVE or _3DPDF_EXPORT_STOP to create the 3D Pdf file and wait until _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE, see U3DPdf_ExportAPI_SetCallbackSaveStatus().
Use _3DPDF_EXPORT_DEACTIVATE to terminate the API usage. This sets the 3D Pdf Export back to _3DPDF_EXPORT_MODE_FREE and will free the complete used memory.
Remarks
Use _3DPDF_EXPORT_EXPORT directly after Step_I to save the 3D Scene without animation.
After Step_III you can immediately continue with Step_II , it is not necessary to activate the 3d Pdf Export API several times.

// Example:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Declaration of callback functions
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void Callback_API_Msg_1(char *s=NULL)
{
if (s)
SetDlgItemText(IDC_STATIC_API_MSG_1,s);
}
static void Callback_API_Msg_2(char *s=NULL)
{
if (s)
SetDlgItemText(IDC_STATIC_API_MSG_2,s);
}
static void Callback_API_SaveStatus(int save_status)
{
char *s[] = {
"SAVE_STATUS_UNDEF",
"SAVE_STATUS_RECORD",
"SAVE_STATUS_BEGIN",
"SAVE_STATUS_BEGIN_THREAD",
"SAVE_STATUS_DONE",
"SAVE_STATUS_ABORT",
"SAVE_STATUS_ERROR",
"SAVE_STATUS_KEYFRAMES_MAX",
"?","?"
};
er_user_io_dialog._info_line_msg(0,"%s", save_status<=_3DPDF_EXPORT_SAVE_STATUS_LAST ? s[save_status] : "?");
}
static void Callback_API_Progress(double progress)
// Save Step A+B
{
char s[MAXSTR];
sprintf(s,"%3u%%", (unsigned int)(progress*100.0));
er_user_io_dialog._info_line_msg(0,s);
}
static void Callback_API_ProgressExportU3DScene(double progress)
// Save Step A
{
char s[MAXSTR];
sprintf(s,"%3u%%", (unsigned int)(progress*100.0));
er_user_io_dialog._info_line_msg(0,s);
}
static void Callback_API_ProgressGenerate3DPdf(double progress)
// Save Step B
{
char s[MAXSTR];
sprintf(s,"%3u%%", (unsigned int)(progress*100.0));
er_user_io_dialog._info_line_msg(0,s);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Step I ... activate, initialize, define necessary callback functions
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void _3dpdf_ActDeactivate()
// activate API Control for 3D Pdf Export
// requires _3DPDF_EXPORT_MODE_FREE
// or
// deactivate API Control for 3D Pdf Export
// requires _3DPDF_EXPORT_MODE_API
{
// 3D PDF Export Version
char *s = er_user_io_3dpdf.U3DPdf_ExportVer();
er_user_io_dialog._info_line_msg(0,"U3DPdf_ExportVer() = %s",s);
// get current status of 3D PDf Export
// it is one of _3DPDF_EXPORT_MODE_ERROR,
// _3DPDF_EXPORT_MODE_FREE ... choice to use DLG or API
// _3DPDF_EXPORT_MODE_DLG ... Dlg is enabled
// _3DPDF_EXPORT_MODE_API ... API is enabled
int u3dpdf_mode = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_GET_MODE);
switch (u3dpdf_mode) {
// fatal ERROR
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_GET_MODE is %s","ERROR");
break;
// activate API usage ... _3DPDF_EXPORT_ACTIVATE
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_GET_MODE is %s ... activate","FREE");
ret = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_ACTIVATE);
if (!ret && er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_GET_MODE) == _3DPDF_EXPORT_MODE_API)
{
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_ACTIVATE ... success");
//
// _3DPDF_EXPORT_INIT immediatly when _3DPDF_EXPORT_ACTIVATE success
//
ret = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_INIT);
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_INIT ... %s %d",!ret?"success":"failed",ret);
// Define Callback Functions for Progress and Message Output
// Use Callback_API_Progress for Save Step A+B
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackProgress(Callback_API_Progress);
// or use Callback_API_ProgressExportU3DScene for Save Step A
// and Callback_API_ProgressGenerate3DPdf for Save Step B
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackProgressExportU3DScene(Callback_API_ProgressExportU3DScene);
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackProgressGenerate3DPdf(Callback_API_ProgressGenerate3DPdf);
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackMsg(1,Callback_API_Msg_1); // Sim
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackMsg(2,Callback_API_Msg_2); // Aux
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackSaveStatus(Callback_API_SaveStatus); // SaveStatus
}
else
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_ACTIVATE ... failed %d",ret);
break;
// DLG is enabled, do nothing here
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_GET_MODE is %s ... do nothing","DLG");
AfxMessageBox(_T("3D-PDF Export currently used by Dialog"),MB_ICONSTOP);
break;
// API is enabled, ask for deactivation
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_GET_MODE is %s","API");
if (er_user_io_dialog.dialog_yes_no("Deactivate 3D PDF Export?"))
{
// Note:
// _3DPDF_EXPORT_DEACTIVATE will free the complete used memory
ret = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_DEACTIVATE);
if (!ret && er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_GET_MODE) == _3DPDF_EXPORT_MODE_FREE)
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_DEACTIVATE ... success");
else
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_DEACTIVATE ... failed %d",ret);
}
break;
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Step II ... start/pause/continue recording, label, password, pdf file
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void _3dpdf_Start()
// Start recording
// requires _3DPDF_EXPORT_ACTIVATE + _3DPDF_EXPORT_INIT
{
int u3dpdf_mode = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_GET_MODE);
if (u3dpdf_mode != _3DPDF_EXPORT_MODE_API)
{
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_GET_MODE ... Error, mode _3DPDF_EXPORT_MODE_API required");
return;
}
ret = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_START);
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_START ... %s %d",!ret?"success":"failed",ret);
return;
}
void _3dpdf_Pause()
// Pause and continue recording
// requires _3DPDF_EXPORT_START
{
int u3dpdf_mode = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_GET_MODE);
if (u3dpdf_mode != _3DPDF_EXPORT_MODE_API)
{
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_GET_MODE ... Error, mode _3DPDF_EXPORT_MODE_API required");
return;
}
ret = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_PAUSE);
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_PAUSE ... %s %d",!ret?"success":"failed",ret);
return;
}
void _3dpdf_Label()
// set 3D_Pdf label
// requires _3DPDF_EXPORT_START
{
int u3dpdf_mode = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_GET_MODE);
if (u3dpdf_mode != _3DPDF_EXPORT_MODE_API)
{
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_GET_MODE ... Error, mode _3DPDF_EXPORT_MODE_API required");
return;
}
char label[LS_MAXSTR];
sprintf(label,"Label ... t = %.2fs",*er_sim.inq_sim_time());
ret = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_SET_LABEL,label);
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_SET_LABEL ... %s Label: '%s'",!ret?"success":"failed",label);
return;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Step III ... save or export
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void _3dpdf_Save()
// Stop recording and Save to 3D_Pdf
// requires _3DPDF_EXPORT_START
{
int u3dpdf_mode = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_GET_MODE);
if (u3dpdf_mode != _3DPDF_EXPORT_MODE_API)
{
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_GET_MODE ... Error, mode _3DPDF_EXPORT_MODE_API required");
return;
}
//ret = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_SAVE,"Thread");
ret = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_SAVE);
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_SAVE ... %s %d",!ret?"success":"failed",ret);
return;
}
void _3dpdf_Export()
// EXPORT to 3D_Pdf without animation
// requires _3DPDF_EXPORT_ACTIVATE + _3DPDF_EXPORT_INIT + callback function
{
int u3dpdf_mode = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_GET_MODE);
if (u3dpdf_mode != _3DPDF_EXPORT_MODE_API)
{
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_GET_MODE ... Error, mode _3DPDF_EXPORT_MODE_API required");
return;
}
ret = er_user_io_3dpdf.U3DPdf_ExportAPI(_3DPDF_EXPORT_EXPORT,"Thread");
er_user_io_dialog._info_line_msg(0,"_3DPDF_EXPORT_EXPORT ... %s %d",!ret?"success":"failed",ret);
return;
}
Parameters
[in]pdf_flag
[in]sindividual string, depending on pdf_flag
Return values
0- _3DPDF_EXPORT_OK
1- _3DPDF_EXPORT_ERROR
-1- _3DPDF_EXPORT_VALUE, Error
static ER_DllExport int ER_CAPI_USER_IO_3DPDF::U3DPdf_ExportAPI_SetCallbackMsg ( int  callback_fct_id,
void(*)(char *)  ptr_MsgFct 
)
static

Defines a callback function for output messages during 3D PDF file Export
Parameter callback_fct_id is 1 or 2 for two different output streams.

// Example:
// Declaration of two callback functions for ouput messages
static void Callback_API_Msg_1(char *s=NULL)
{
if (s)
SetDlgItemText(IDC_STATIC_API_MSG_1,s);
}
static void Callback_API_Msg_2(char *s=NULL)
{
if (s)
SetDlgItemText(IDC_STATIC_API_MSG_2,s);
}
...
// Set callback function pointer
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackMsg(1,Callback_API_Msg_1);
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackMsg(2,Callback_API_Msg_2);
...
Parameters
[in]callback_fct_id
[in]ptr_MsgFct(char *msg) callback function pointer
Return values
0- Ok
1- Error
static ER_DllExport int ER_CAPI_USER_IO_3DPDF::U3DPdf_ExportAPI_SetCallbackProgress ( void(*)(double)  ptr_ProgressFct)
static

Defines one single callback function for ExportU3DScene progress and Generate3DPdf progress messages when saving the 3D PDF file
Parameter progress in Callback_API_Progress(double progress) is between 0 and 1 for 100%
Define U3DPdf_ExportAPI_SetCallbackSaveStatus() to receive _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE when saving the 3D PDF file is completed.
Remarks
To define one callback function for ExportU3DScene progress (Save Step A) and one for Generate3DPdf progress (Save Step B),
use U3DPdf_ExportAPI_SetCallbackProgressExportU3DScene() and U3DPdf_ExportAPI_SetCallbackProgressGenerate3DPdf()

// Example:
// Declaration of a callback functions for progress messages
static void Callback_API_Progress(double progress)
// Save Step A+B
{
char s[MAXSTR];
sprintf(s,"%3u%%", (unsigned int)(progress*100.0));
er_user_io_dialog._info_line_msg(0,s);
}
...
// Set callback function pointer
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackProgress(Callback_API_Progress);
...
Parameters
[in]ptr_ProgressFct(double) callback function pointer
Return values
0- Ok
1- Error
static ER_DllExport int ER_CAPI_USER_IO_3DPDF::U3DPdf_ExportAPI_SetCallbackProgressExportU3DScene ( void(*)(double)  ptr_ProgressFctExportU3DScene)
static

Defines a callback function for ExportU3DScene progress messages when saving the 3D PDF file
Parameter progress in Callback_API_ProgressExportU3DScene(double progress) is between 0 and 1 for 100%
Define U3DPdf_ExportAPI_SetCallbackSaveStatus() to receive _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE when saving the 3D PDF file is completed.
Remarks
When saving the 3D PDF file, ExportU3DScene is Save Step A.
Save Step B generates the 3DPdf file, use U3DPdf_ExportAPI_SetCallbackProgressGenerate3DPdf()
Use U3DPdf_ExportAPI_SetCallbackProgress() to define one single callback function for both Save Steps.

// Example:
// Declaration of a callback functions for progress messages
static void Callback_API_ProgressExportU3DScene(double progress)
// Save Step A
{
char s[MAXSTR];
sprintf(s,"%3u%%", (unsigned int)(progress*100.0));
er_user_io_dialog._info_line_msg(0,s);
}
...
// Set callback function pointer
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackProgressExportU3DScene(Callback_API_ProgressExportU3DScene);
...
Parameters
[in]ptr_ProgressFctExportU3DScene(double) callback function pointer
Return values
0- Ok
1- Error
static ER_DllExport int ER_CAPI_USER_IO_3DPDF::U3DPdf_ExportAPI_SetCallbackProgressGenerate3DPdf ( void(*)(double)  ptr_ProgressFctGenerate3DPdf)
static

Defines a callback function for Generate3DPdf progress messages when saving the 3D PDF file
Parameter progress in Callback_API_ProgressGenerate3DPdf(double progress) is between 0 and 1 for 100%
Define U3DPdf_ExportAPI_SetCallbackSaveStatus() to receive _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE when saving the 3D PDF file is completed.
Remarks
When saving the 3D PDF file, ExportU3DScene is Save Step A and Generate3DPdf is Save Step B.
For Save Step A use U3DPdf_ExportAPI_SetCallbackProgressExportU3DScene()
Use U3DPdf_ExportAPI_SetCallbackProgress() to define one single callback function for both Save Steps.

// Example:
// Declaration of a callback functions for progress messages
static void Callback_API_ProgressGenerate3DPdf(double progress)
// Save Step B
{
char s[MAXSTR];
sprintf(s,"%3u%%", (unsigned int)(progress*100.0));
er_user_io_dialog._info_line_msg(0,s);
}
...
// Set callback function pointer
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackProgressGenerate3DPdf(Callback_API_ProgressGenerate3DPdf);
...
Parameters
[in]ptr_ProgressFctGenerate3DPdf(double) callback function pointer
Return values
0- Ok
1- Error
static ER_DllExport int ER_CAPI_USER_IO_3DPDF::U3DPdf_ExportAPI_SetCallbackSaveStatus ( void(*)(int)  ptr_SaveStatusFct)
static

Defines a callback function for status messages when saving the 3D PDF file
Parameter save_status in Callback_API_SaveStatus(int save_status) is one of _3DPDF_EXPORT_SAVE_STATUS_UNDEF, _3DPDF_EXPORT_SAVE_STATUS_RECORD, _3DPDF_EXPORT_SAVE_STATUS_SAVE_BEGIN, _3DPDF_EXPORT_SAVE_STATUS_SAVE_BEGIN_THREAD, _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE, _3DPDF_EXPORT_SAVE_STATUS_SAVE_ABORT, _3DPDF_EXPORT_SAVE_STATUS_SAVE_ERROR or _3DPDF_EXPORT_SAVE_STATUS_KEYFRAMES_MAX
Remarks
save_status _3DPDF_EXPORT_SAVE_STATUS_RECORD confirmed that the recording is started
A pdf_flag _3DPDF_EXPORT_STOP, see U3DPdf_ExportAPI() causes _3DPDF_EXPORT_SAVE_STATUS_SAVE_BEGIN or _3DPDF_EXPORT_SAVE_STATUS_SAVE_BEGIN_THREAD to confirm that the 3D Pdf Export is started directly or running in a Thread.
If the 3D Pdf file was created successfully, it will be confirmed with _3DPDF_EXPORT_SAVE_STATUS_SAVE_DONE.
In other cases the save_status is _3DPDF_EXPORT_SAVE_STATUS_SAVE_ABORT or _3DPDF_EXPORT_SAVE_STATUS_SAVE_ERROR
Make sure that 3D Pdf file is not open in the Adobe Reader.

// Example:
// Declaration of a callback functions for status messages
static void Callback_API_SaveStatus(int save_status)
{
char *s[] = {
"SAVE_STATUS_UNDEF",
"SAVE_STATUS_RECORD",
"SAVE_STATUS_BEGIN",
"SAVE_STATUS_BEGIN_THREAD",
"SAVE_STATUS_DONE",
"SAVE_STATUS_ABORT",
"SAVE_STATUS_ERROR",
"SAVE_STATUS_KEYFRAMES_MAX",
"?","?"
};
er_user_io_dialog._info_line_msg(0,"%s", save_status<=_3DPDF_EXPORT_SAVE_STATUS_LAST ? s[save_status] : "?");
}
...
// Set callback function pointer
er_user_io_3dpdf.U3DPdf_ExportAPI_SetCallbackSaveStatus(Callback_API_SaveStatus);
...
Parameters
[in]ptr_SaveStatusFct(int) callback function pointer
Return values
0- Ok
1- Error
static ER_DllExport char* ER_CAPI_USER_IO_3DPDF::U3DPdf_ExportVer ( void  )
static

3D PDF Export Version

Return values
version3DPDF_Export version number

The documentation for this class was generated from the following file: