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_CAD_IO Class Reference

Method class for access to geometry parameter: Location, polygons, vertices, attributes, etc. More...

#include <ER_CAPI.H>

Inheritance diagram for ER_CAPI_CAD_IO:
ER_CAPI_CAD ER_CAPI

Static Public Member Functions

static ER_DllExport void * inq_body_group_handle_current (void)
 Get current group handle
Depending on cDevice and the current selected geometry. More...
 
static ER_DllExport int inq_body_group_type_current (void)
 Return current group type of current selected geometry
grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP. More...
 
static ER_DllExport int set_body_group_type (int grp_type)
 Set group type for internal temporary geometry template
Parameter grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP. More...
 
static ER_DllExport void * inq_body_group_handle (int grp_type)
 Return group handle of current Device
Parameter grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP. More...
 
static ER_DllExport void * inq_body_handle_current (void *grp_handle=0)
 Return body handle
If parameter grp_handle is 0, the body handle of the current group is returned. More...
 
static ER_DllExport void * inq_body_handle_byname (void *grp_handle, char *name)
 Return body handle by body name
Parameter grp_handle must be valid and not 0
Parameter name is a valid body name in the body group. More...
 
static ER_DllExport void * inq_body_handle_byidx (void *grp_handle, int body_idx)
 Return body handle by body idx
Parameter grp_handle must be valid and not 0
Parameter body_idx is in [1..number of bodies[. More...
 
static ER_DllExport int inq_body_number (void *grp_handle)
 Get number of geometries in the group
Parameter grp_handle must be valid and not 0. More...
 
static ER_DllExport int set_body_handle_current (void *body_handle)
 Set a body as current selected body
Parameter body_handle must be valid and not 0. More...
 
static ER_DllExport int inq_body_cad_type (void *body_handle)
 Return cad_type of a body givin by a handle
Parameter body_handle must be valid and not 0
The cad_type is one of UNDEF_CAD_TYPE, CUBE_CAD_TYPE, PYRAMID_CAD_TYPE, WEDGE_CAD_TYPE, CYLINDER_CAD_TYPE
CONE_CAD_TYPE, SPHERE_CAD_TYPE, VRML_CAD_TYPE , IGP_CAD_TYPE, STL_CAD_TYPE, _3DS_CAD_TYPE. More...
 
static ER_DllExport char * inq_body_name (void *body_handle)
 Return name of a body givin by a handle
Parameter body_handle must be valid and not 0
. More...
 
static ER_DllExport frameinq_body_ref_pos (void *body_handle)
 Return reference position T_ref of a body givin by a handle
Parameter body_handle must be valid and not 0
Remarks
The resulted position of the body w.r.t. it coorsys is
T_ref_off = T_ref * T_off
See inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update() More...
 
static ER_DllExport frameinq_body_off_pos (void *body_handle)
 Return offset position T_off of a body givin by a handle
Parameter body_handle must be valid and not 0
Remarks
The resulted position of the body w.r.t. it coorsys is
T_ref_off = T_ref * T_off
See inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update() More...
 
static ER_DllExport frameinq_body_ref_off_pos (void *body_handle)
 Return resulted position T_ref_off of a body givin by a handle
Parameter body_handle must be valid and not 0
Remarks
The resulted position of the body w.r.t. it coorsys is
T_ref_off = T_ref * T_off
See inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update() More...
 
static ER_DllExport void body_update (void *body_handle)
 Update a body givin by a handle
Parameter body_handle must be valid and not 0
Remarks
This method must be called to calculate resulted position T_ref_off , in case the reference- T_ref and/or offset position T_off was changed
The resulted position of the body w.r.t. it coorsys is
T_ref_off = T_ref * T_off
See inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update() More...
 
static ER_DllExport int body_renewing (void *body_handle, int cad_mem_model, int renew_param)
 Renews a body after modifying its vertices xyz values via API
Parameter body_handle must be valid and not 0
Param cad_mem_model determine the cad memory model and is one of ER_CAD_MEM_VBO, ER_CAD_MEM_GRAHICS, ER_CAD_MEM_NATIVE_CPU
Param renew_param allows to control the renewing procedure
It is a bitwise inclusive OR operator (|) of ER_CAD_RENEW_GEOMETRY, ER_CAD_RENEW_COLLISION, ER_CAD_RENEW_DEL_COLLISION
Remarks
Setting the body to cad memory model = ER_CAD_MEM_NATIVE_CPU allows to modify its vertices and visualize it immediatly in the 3D Scene. More...
 
static ER_DllExport int body_save_position (void *body_handle, int grp_type)
 Saves body position as start condition
Parameter grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP
Only grp_type equals BODY_GRP is relevant, see inq_body_group_type_current()
See body_reset_position(), inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update() More...
 
static ER_DllExport int body_reset_position (void *body_handle, int grp_type)
 Resets body position to start condition
Parameter grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP Only grp_type equals BODY_GRP is relevant, see inq_body_group_type_current()
Remarks
The reference- T_ref and the offset position T_off are set to start condition
The resulted position of the body w.r.t. it coorsys is
T_ref_off = T_ref * T_off
See body_save_position(), inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update() More...
 
static ER_DllExport int body_merge (void *body_handle, char *igp_fln, int merge_attributes)
 merges body and save to ascii or binary igp file
Parameter merge_attributes is a bitwise inclusive OR operator (|) of
MERGE_ATTIB_UNDEF - No attributes sets, MERGE_ATTIB_PPO_LIMIT_100 is internally set per default
MERGE_ATTIB_CONFIRM_IF_FILE_EXIST - User is prompted to confirm if the igp file name already exist
MERGE_ATTIB_SAVE_BINARY_IGP - Save binary igp
MERGE_ATTIB_SKIP_LINES - Skip lines for all objects if exist
MERGE_ATTIB_NO_PPO_LIMIT - The number of Polygons per object 'PpO' is NOT limited
MERGE_ATTIB_PPO_LIMIT_100 - The number of Polygons per object 'PpO' is limited by MERGE_MAX_NUMBER_OF_PPO_100
MERGE_ATTIB_PPO_LIMIT_200 - The number of Polygons per object 'PpO' is limited by MERGE_MAX_NUMBER_OF_PPO_200
MERGE_ATTIB_DEFAULT - equals MERGE_ATTIB_SKIP_LINES | MERGE_ATTIB_PPO_LIMIT_100
Remarks
It is only possible to merge igp files
See inq_body_cad_type(), inq_body_n_obj(), inq_body_n_poly_total(), inq_body_obj_handle(), inq_body_obj_color_idx() More...
 
static ER_DllExport frameinq_body_Tref_pos (void *body_handle, int grp_type, frame *Tref)
 Reference position w.r.t. to inertia coorsys of body givin by a handle
The reference position Tref is the position where the body is attached to.
Remarks
This could be the robot base or an active or passive robot joint in case the grp_type is ROBOT_GRP
In case of grp_type equals TOOL_GRP the body is attached to the robots tip
In case of grp_type equals BODY_GRP the body is attached to the inertia coorsys or to the robots tip if the body was grabbed
Parameter grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP
See inq_body_world_pos()
See also inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update() More...
 
static ER_DllExport frameinq_body_world_pos (void *body_handle, int grp_type, frame *Tworld)
 World position w.r.t. to inertia coorsys of body givin by a handle
The world position Tworld is the resulted position of the body w.r.t. inertia coorsys
Remarks
The resulted position of the body w.r.t. it coorsys is T_ref_off = T_ref * T_off
Tworld = Tref * T_ref_off
To calculate Tref, use inq_body_Tref_pos()
See also inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update() More...
 
static ER_DllExport int inq_body_idx (void *body_handle)
 Idx of body givin by a handle
The returned list idx is zero based [0.. number of bodies-1]
see inq_body_number() More...
 
static ER_DllExport int * inq_body_joint_attach_idx (void *body_handle)
 Robot joint attach idx
In case the body belongs to a ROBOT_GRP, the joint attach idx is
zero - body attached to robot base
[1 to KIN_DOFS] - body attached to an active robot joint
[KIN_DOFS+1 to KIN_DOFS+KIN_PASSIV_JNTS] - body attached to an passive robot joint
Remarks
If the body belongs to the TOOL_GRP or BODY_GRP, the joint attach idx is always 0. More...
 
static ER_DllExport char * inq_body_file_name (void *body_handle)
 File name of body givin by a handle. More...
 
static ER_DllExport int inq_body_n_obj (void *body_handle)
 Number of object within body givin by a handle
A body contains a number of objects
Each object consists of: one object color, number of points, polygon indices and lines indices
In case the number of polygons and lines are zero, the object represents a point cloud. More...
 
static ER_DllExport int inq_body_n_point_total (void *body_handle)
 Number of total points/vertices within body givin by a handle
A body contains a number of objects. Each object consists of a number of points. More...
 
static ER_DllExport int inq_body_n_line_total (void *body_handle)
 Number of total lines within body givin by a handle
A body contains a number of objects. Each object consists of a number of lines. More...
 
static ER_DllExport int inq_body_n_poly_total (void *body_handle)
 Number of total polygons within body givin by a handle
A body contains a number of objects. Each object consists of a number of polygons. More...
 
static ER_DllExport int inq_body_n_coorsys_total (void *body_handle)
 Number of coorsys within body givin by a handle. More...
 
static ER_DllExport float * inq_body_scale (void *body_handle)
 XYZ scaling vector of body givin by a handle
The scaling vector has positive values >0 and scales the original geometry point data in yxz direction
see inq_body_size() More...
 
static ER_DllExport float * inq_body_size (void *body_handle)
 XYZ size vector of body givin by a handle
The size vector values are a result of the original geometry point data scaled by the scaling vector in yxz direction
see inq_body_scale() More...
 
static ER_DllExport int * inq_body_color_idx (void *body_handle)
 Color idx of body givin by a handle
The color idx is a positive value
see set_body_rgba_color() More...
 
static ER_DllExport int * inq_body_color_sub_idx (void *body_handle)
 Color sub idx of body givin by a handle
The color sub idx is a positive value
see inq_body_color_idx()
Remarks
This method has currently no effect! More...
 
static ER_DllExport int set_body_rgba_color (void *body_handle, float *rgba_color, int color_use=COLOR_USE_USER, int color_idx2change=0)
 Set the RGB color of body givin by a handle
Furthermore the object color can be exchanged
Parameter color_use is one of
COLOR_USE_USER - USER color are saved with .cel, .rob or .ras file
COLOR_USE_FIX - Note: FIX color are only temporarly
COLOR_USE_FIX_IDX - Changes all objects with FIX color and with 'color_idx2change' to rgba_color
Parameter color_idx2change allows to exchange a specific color for all objects with exactly this color idx color_idx2change, if set >0.
see inq_body_color_idx() More...
 
static ER_DllExport int * inq_body_render (void *body_handle)
 Get the render type of body givin by a handle
The render type and is one of
FLAT=6, WIRE=1, BBFLAT=2, BBWIRE=3, INVISIBLE=4, POINT_RENDER=5, SMOOTH_RENDER=0. More...
 
static ER_DllExport int inq_body_cad_mem_model (void *body_handle)
 Get the cad memory model of body givin by a handle
The cad memory model and is one of ER_CAD_MEM_VBO, ER_CAD_MEM_GRAHICS, ER_CAD_MEM_NATIVE_CPU
Remarks
Call body_renewing() to change and renew the cad memory model. More...
 
static ER_DllExport int inq_body_n_obj_vbo (void *body_handle)
 Get the number of objects loaded into the grafics board
Remarks
Each body consists of several objects. More...
 
static ER_DllExport float * inq_body_transparency (void *body_handle)
 Transparency (alfa) value of body givin by a handle
The transparency value is between 0 and 1. 1 means fully opaque , 0 means fully transparent
see inq_body_show_transparent() More...
 
static ER_DllExport float * inq_body_collision_tolerance (void *body_handle)
 Collision tolerance value of body givin by a handle
The collision tolerance in [mm] defines a 'skin' of thickness around the body. More...
 
static ER_DllExport int * inq_body_poly_invert (void *body_handle)
 Polygon invert flag of body givin by a handle
If the polygon invert flag is set, all polygons of body are inverted for visualization. More...
 
static ER_DllExport int * inq_body_collision (void *body_handle)
 Collision flag of body givin by a handle
The collision flag is one of 0-Off, 1-Concave, 2-Convex, 3-Bbox, 4-Disabled
If the collision flag is marked as. More...
 
static ER_DllExport char * inq_body_coll_exl_list (void *body_handle)
 Collision exclude list of same group used for robot itself collision
The string contains indices of bodies excluded from collision
'same group' the bodies belong either to ROBOT_GRP or TOOL_GRP
Example
coll_exl_list = "1 3 9" -> Bodies with these indices are excluded from itself collision
see inq_body_coll_exl_list_mix(), inq_body_idx() More...
 
static ER_DllExport char * inq_body_coll_exl_list_mix (void *body_handle)
 Collision exclude list of mixed group used for robot itself collision
The string contains indices of bodies excluded from collision
'mixed group' the bodies belong to ROBOT_GRP vs. TOOL_GRP
Example
coll_exl_list_mix = "1 3 9" -> If this list belongs to ROBOT_GRP, all bodies from TOOL_GRP with these indices are excluded from itself collision
see inq_body_coll_exl_list(), inq_body_idx() More...
 
static ER_DllExport ER_UID * inq_body_grab (void *body_handle)
 Grab status of body givin by a handle
Obsolete: Only if the body belongs to BODY_GRP, it could be grabbed by the robot. More...
 
static ER_DllExport int * inq_body_show_name (void *body_handle)
 Show the name of body givin by a handle
Allows to dis- or enable visualizazion of body name. More...
 
static ER_DllExport int * inq_body_bface_culling (void *body_handle)
 Enable/disable backface culling of body givin by a handle. More...
 
static ER_DllExport int * inq_body_show_normals (void *body_handle)
 Show normals of body givin by a handle
Allows to dis- or enable visualizazion of body normals. More...
 
static ER_DllExport int * inq_body_show_edges (void *body_handle)
 Show body edges
Allows to dis- or enable visualizazion of body edges. More...
 
static ER_DllExport int * inq_body_show_mesh (void *body_handle)
 Show body meshes
Allows to dis- or enable visualizazion of body meshes. More...
 
static ER_DllExport int * inq_body_is_pickable (void *body_handle)
 Enable/disable pickability of body givin by a handle. More...
 
static ER_DllExport int * inq_body_show_transparent (void *body_handle)
 Show body transparency
Allows to dis- or enable body transparency
see inq_body_transparency() More...
 
static ER_DllExport void * inq_body_obj_handle (void *body_handle, int i_obj)
 Handle to object within a body
Use inq_body_n_obj() to retreive the number of objects within a body. More...
 
static ER_DllExport void * inq_body_obj_attributes_handle (void *body_handle, int i_obj)
 Handle to object attributes within a body
Use inq_body_n_obj() to retreive the number of objects belonging to a body. More...
 
static ER_DllExport int * inq_body_obj_n_point (void *obj_handle)
 Number of points within an object. More...
 
static ER_DllExport int * inq_body_obj_n_line (void *obj_handle)
 Number of lines within an object. More...
 
static ER_DllExport int * inq_body_obj_n_poly (void *obj_handle)
 Number of polygons within an object. More...
 
static ER_DllExport int * inq_body_obj_n_coorsys (void *obj_handle)
 Number of coorsys within an object. More...
 
static ER_DllExport int * inq_body_obj_is_collided (void *obj_handle_attributes)
 Collision flag of an object
see inq_body_obj_attributes_handle() to retrieve the object attribute handle. More...
 
static ER_DllExport int * inq_body_obj_max_point_in_poly (void *obj_handle)
 Maximum number of points in a polygon within an object. More...
 
static ER_DllExport float * inq_body_obj_color_rgba (void *obj_handle_attributes)
 RGBA Color of an object. More...
 
static ER_DllExport int * inq_body_obj_color_idx (void *obj_handle)
 Color idx for an object. More...
 
static ER_DllExport int * inq_body_obj_color_den_idx (void *obj_handle)
 Den_Color Idx an object. More...
 
static ER_DllExport int * inq_body_obj_ptrcolor (void *obj_handle_attributes)
 Color pointer Idx of an object
see inq_body_obj_attributes_handle() to retrieve the object attribute handle. More...
 
static ER_DllExport float * inq_body_obj_points (void *obj_handle, int idx)
 XYZ Vertex of an object
Use er_cad_io.inq_body_obj_n_point() to get the number of point of an object. More...
 
static ER_DllExport int * inq_body_obj_lines (void *obj_handle, int idx)
 Line segment indexes of an object
Use er_cad_io.inq_body_obj_n_line() to get the number of lines of an object. More...
 
static ER_DllExport int * inq_body_obj_polys (void *obj_handle, int idx)
 Polygon indexes of an object
Use er_cad_io.inq_body_obj_n_poly() to get the number of polygons of an object. More...
 
static ER_DllExport float * inq_body_obj_normals (void *obj_handle, int idx)
 Normal vector of polygon of an object
Use er_cad_io.inq_body_obj_n_poly() to get the number of polygons of an object. More...
 
static ER_DllExport frameinq_body_obj_coorsys (void *obj_handle, int idx)
 Coorsys of an object
Use er_cad_io.inq_body_obj_n_coorsys() to get the number of coorsys of an object. More...
 
static ER_DllExport int get_body_para (void *body_handle, float *para, int *num_para)
 Body parameter
The content of the parameter vector para depends of the "cad_type", see inq_body_cad_type()
which is one of: More...
 
static ER_DllExport int set_body_para (void *body_handle, float *para)
 Set or modify body parameter The content of the parameter vector para depends of the "cad_type"
see inq_body_cad_type(), get_body_para() More...
 
static ER_DllExport int body_update_cad_file (void *body_handle=0, int use_vbo=0)
 Updates a body
Unloads and reloads a body from file
Parameter /p use_vbo determines if VBO (vertex buffer object - loading the geometry into the grafics board) is used. More...
 
static ER_DllExport int body_clear (void *grp_handle, void *body_handle)
 Unload a body. More...
 
- Static Public Member Functions inherited from ER_CAPI_CAD
static ER_DllExport int Unload_cCAD (int confirm=1)
 Unload current selected CAD geometry. More...
 
static ER_DllExport int Unload_allCAD (int confirm=1)
 Unload all CAD Geometries in current selected grp. More...
 

Additional Inherited Members

- Static Public Attributes inherited from ER_CAPI_CAD
static ER_CAPI_CAD_IO er_capi_cad_io
 Method class for access to geometry parameter: Location, polygons, vertices, attributes, etc. More...
 
static ER_CAPI_CAD_CREATE er_capi_cad_create
 Method class for creating primitive geometries such as cubes, cylinder, spheres, etc. More...
 
static ER_CAPI_CAD_IMPORT er_capi_cad_import
 Method class for importing existing 3D geometries (IGP, STL, 3DS) More...
 
static ER_CAPI_CAD_CONVERT er_capi_cad_convert
 Method class for converting external neutral and native CAD formats (STEP, IGES, JT-Open, CATIA, Pro/E, and so on) into the internal IGP Part File Format. 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 access to geometry parameter: Location, polygons, vertices, attributes, etc.

Member Function Documentation

static ER_DllExport int ER_CAPI_CAD_IO::body_clear ( void *  grp_handle,
void *  body_handle 
)
static

Unload a body.

Parameters
[in]grp_handle- handle to gruop
[in]body_handle- handle to body
Return values
0- OK
1- Error
static ER_DllExport int ER_CAPI_CAD_IO::body_merge ( void *  body_handle,
char *  igp_fln,
int  merge_attributes 
)
static

merges body and save to ascii or binary igp file
Parameter merge_attributes is a bitwise inclusive OR operator (|) of
MERGE_ATTIB_UNDEF - No attributes sets, MERGE_ATTIB_PPO_LIMIT_100 is internally set per default
MERGE_ATTIB_CONFIRM_IF_FILE_EXIST - User is prompted to confirm if the igp file name already exist
MERGE_ATTIB_SAVE_BINARY_IGP - Save binary igp
MERGE_ATTIB_SKIP_LINES - Skip lines for all objects if exist
MERGE_ATTIB_NO_PPO_LIMIT - The number of Polygons per object 'PpO' is NOT limited
MERGE_ATTIB_PPO_LIMIT_100 - The number of Polygons per object 'PpO' is limited by MERGE_MAX_NUMBER_OF_PPO_100
MERGE_ATTIB_PPO_LIMIT_200 - The number of Polygons per object 'PpO' is limited by MERGE_MAX_NUMBER_OF_PPO_200
MERGE_ATTIB_DEFAULT - equals MERGE_ATTIB_SKIP_LINES | MERGE_ATTIB_PPO_LIMIT_100
Remarks
It is only possible to merge igp files
See inq_body_cad_type(), inq_body_n_obj(), inq_body_n_poly_total(), inq_body_obj_handle(), inq_body_obj_color_idx()

// Example:
#include <vector>
typedef std::vector<int> ColorIdxList;
void *grp_hnd = er_cad_io.inq_body_group_handle_current();
if (!grp_hnd)
return;
void *body_hnd = er_cad_io.inq_body_handle_current(grp_hnd);
if (!body_hnd)
return;
int cad_type = er_cad_io.inq_body_cad_type(body_hnd);
if (cad_type!=IGP_CAD_TYPE)
return;
char fln[HS_MAXSTR];
strcpy(fln, er_cad_io.er_capi_cad_io.inq_body_file_name(body_hnd));
int len = strlen(fln);
fln[len - 4] = '\0';
strcat(fln, "_api_merge.igp");
// check geometry condition
int n_obj = er_cad_io.inq_body_n_obj(body_hnd);
int n_poly_total = er_cad_io.inq_body_n_poly_total(body_hnd);
er_user_io_dialog._info_line_msg(0, "body_merge() n_obj = %d, n_poly_total = %d poly per object = %d", n_obj, n_poly_total, n_obj ? 1+n_poly_total/n_obj : 0);
ColorIdxList cil; // contains all different colors indizes of body
cil.clear();
for (int i = 0; i < n_obj; ++i)
{
void *obj_hnd = er_cad_io.inq_body_obj_handle(body_hnd, i);
void *obj_handle_attributes = er_cad_io.inq_body_obj_attributes_handle(body_hnd, i);
if (!obj_hnd || !obj_handle_attributes)
continue; // ? Error
int col_idx = *er_cad_io.inq_body_obj_color_idx(obj_hnd);
// Add col_idx, if not in the list of ColorIdxList
bool found = false;
for (ColorIdxList::iterator it = cil.begin() ; !found && it != cil.end(); ++it)
{
if (col_idx == *it)
found = true;
}
if (!found)
cil.push_back(col_idx);
}
int n_diff_color_idx = cil.size();
er_user_io_dialog._info_line_msg(0, "body_merge() number of different colors = %d", n_diff_color_idx);
// if (n_obj > n_diff_color_idx) -> try to merge
// Consider also the relation of n_poly_total/n_obj
// Note:
// For improved performance, the number of polygons per object will be limited by MERGE_MAX_NUMBER_OF_PPO_100 or MERGE_MAX_NUMBER_OF_PPO_200
// This causes for huge models that the number of objects is greater than the number of colors of a geometry in most cases.
//----------------------------
// Start to merge igp file
//----------------------------
int merge_attributes = MERGE_ATTIB_UNDEF;
merge_attributes |= MERGE_ATTIB_SKIP_LINES;
merge_attributes |= MERGE_ATTIB_SAVE_BINARY_IGP;
merge_attributes |= MERGE_ATTIB_PPO_LIMIT_100;
int ret = er_cad_io.body_merge(body_hnd,fln, merge_attributes);
er_user_io_dialog._info_line_msg(0, "body_merge() ret '%s'", ret ? "ERROR" : "OK");
if (!ret)
er_user_io_dialog._info_line_msg(0, "body_merge() merged igp file '%s' created", fln);
...
Parameters
[in]body_handle- handle to body
[in]igp_fln- name of created igp file
[in]merge_attributes- merge attributes
Return values
0- Ok
1- Error
static ER_DllExport int ER_CAPI_CAD_IO::body_renewing ( void *  body_handle,
int  cad_mem_model,
int  renew_param 
)
static

Renews a body after modifying its vertices xyz values via API
Parameter body_handle must be valid and not 0
Param cad_mem_model determine the cad memory model and is one of ER_CAD_MEM_VBO, ER_CAD_MEM_GRAHICS, ER_CAD_MEM_NATIVE_CPU
Param renew_param allows to control the renewing procedure
It is a bitwise inclusive OR operator (|) of ER_CAD_RENEW_GEOMETRY, ER_CAD_RENEW_COLLISION, ER_CAD_RENEW_DEL_COLLISION
Remarks
Setting the body to cad memory model = ER_CAD_MEM_NATIVE_CPU allows to modify its vertices and visualize it immediatly in the 3D Scene.

// Example:
void *body_hnd = er_cad_io.inq_body_handle_current(); // get body handle of current group
int n_obj = er_cad_io.inq_body_n_obj(body_hnd); // get number of objects within body
er_user_io_dialog_info_line_msg(0,"cBody with n_obj = %d",n_obj);
int z_sign=-1;
z_sign = -z_sign;
for (int i_obj=0;i_obj<n_obj;++i_obj) // go for all objects
{
void *obj_hnd = er_cad_io.inq_body_obj_handle(body_hnd,i_obj); // get object handle
int n_pnt = *er_cad_io.inq_body_obj_n_point(obj_hnd); // get number of vertices of object
for (int i_pnt=0;i_pnt<n_pnt;++i_pnt) // go for all vertices
{
float *p = er_cad_io.inq_body_obj_points(obj_hnd,i_pnt);
p[2] *= z_sign>0 ? 2.0f : 0.5f; // change z-value, just double or halve
}
}
// Renew to see the effect, refresh complete geometry and the collision model as well
int cad_mem_model = er_cad_io.inq_body_cad_mem_model(body_hnd); // get current cad memory model
cad_mem_model = ER_CAD_MEM_NATIVE_CPU; // change cad memory model to ER_CAD_MEM_NATIVE_CPU
int res = er_cad_io.body_renewing(body_hnd,cad_mem_model,renew_param);
if (res)
_info_line_msg(0,"ERROR: body_renewing() failed");
// Visualize here
er_sys_view.grf_update_export();
...
Parameters
[in]body_handle- handle to body
[in]cad_mem_model- bodies memory model
[in]renew_param- parameter to control renewing procedure
Return values
0- Ok
1- Error, renewing failed
static ER_DllExport int ER_CAPI_CAD_IO::body_reset_position ( void *  body_handle,
int  grp_type 
)
static

Resets body position to start condition
Parameter grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP Only grp_type equals BODY_GRP is relevant, see inq_body_group_type_current()
Remarks
The reference- T_ref and the offset position T_off are set to start condition
The resulted position of the body w.r.t. it coorsys is
T_ref_off = T_ref * T_off
See body_save_position(), inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update()

Parameters
[in]body_handle- handle to body
[in]grp_type- group type
Return values
0- Ok
1- Error
static ER_DllExport int ER_CAPI_CAD_IO::body_save_position ( void *  body_handle,
int  grp_type 
)
static

Saves body position as start condition
Parameter grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP
Only grp_type equals BODY_GRP is relevant, see inq_body_group_type_current()
See body_reset_position(), inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update()

Parameters
[in]body_handle- handle to body
[in]grp_type- group type
Return values
0- Ok
1- Error
static ER_DllExport void ER_CAPI_CAD_IO::body_update ( void *  body_handle)
static

Update a body givin by a handle
Parameter body_handle must be valid and not 0
Remarks
This method must be called to calculate resulted position T_ref_off , in case the reference- T_ref and/or offset position T_off was changed
The resulted position of the body w.r.t. it coorsys is
T_ref_off = T_ref * T_off
See inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update()

Parameters
[in]body_handle- handle to body
static ER_DllExport int ER_CAPI_CAD_IO::body_update_cad_file ( void *  body_handle = 0,
int  use_vbo = 0 
)
static

Updates a body
Unloads and reloads a body from file
Parameter /p use_vbo determines if VBO (vertex buffer object - loading the geometry into the grafics board) is used.

Parameters
[in]body_handle- handle to body
[in]use_vbo- 1 use VBO, 0 do not use VBO
Return values
0- OK
1- Error, maybe Thread running
static ER_DllExport int ER_CAPI_CAD_IO::get_body_para ( void *  body_handle,
float *  para,
int *  num_para 
)
static

Body parameter
The content of the parameter vector para depends of the "cad_type", see inq_body_cad_type()
which is one of:

see set_body_para() to modify body parameter
Remarks
In case of cad type is equals to VRML_CAD_TYPE, IGP_CAD_TYPE, STL_CAD_TYPE or _3DS_CAD_TYPE
para points to the scaling vector, see inq_body_scale()

// Example:
...
void *body_hnd = er_cad_io.inq_body_handle_current();
int num_para=0;
float para[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
er_cad_io.get_body_para(body_hnd,para,&num_para); // In case of IGP or STL, *para is pointing to *scale, see er_vad_inq_body_scale(...)
int cad_type = er_cad_io.inq_body_cad_type(body_hnd);
er_user_io_dialog._info_line_msg(0," cBody cad_type = %d",cad_type);
er_user_io_dialog._info_line_msg_v(0," cBody Para",para,num_para,1);
float *body_size = er_cad_io.inq_body_size(body_hnd);
er_user_io_dialog._info_line_msg_v(0," cBody Size",body_size,DIM,1);
float *body_scale = er_cad_io.inq_body_scale(body_hnd);
er_user_io_dialog._info_line_msg_v(0," cBody Scale",body_scale,DIM,1);
...
Parameters
[in]body_handle- handle to body
[in]para- vector containing the parameter of body
[out]num_para- length of para vector
Return values
0- OK
1- Error
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_bface_culling ( void *  body_handle)
static

Enable/disable backface culling of body givin by a handle.

Parameters
[in]body_handle- handle to body
Return values
pointerto backface culling flag
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_cad_mem_model ( void *  body_handle)
static

Get the cad memory model of body givin by a handle
The cad memory model and is one of ER_CAD_MEM_VBO, ER_CAD_MEM_GRAHICS, ER_CAD_MEM_NATIVE_CPU
Remarks
Call body_renewing() to change and renew the cad memory model.

Parameters
[in]body_handle- handle to body
Return values
currentcad memory model
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_cad_type ( void *  body_handle)
static

Return cad_type of a body givin by a handle
Parameter body_handle must be valid and not 0
The cad_type is one of UNDEF_CAD_TYPE, CUBE_CAD_TYPE, PYRAMID_CAD_TYPE, WEDGE_CAD_TYPE, CYLINDER_CAD_TYPE
CONE_CAD_TYPE, SPHERE_CAD_TYPE, VRML_CAD_TYPE , IGP_CAD_TYPE, STL_CAD_TYPE, _3DS_CAD_TYPE.

// Example:
char *s_body_type[] = {"?","Cube","Pyramid","Wedge","Cylinder",
"Cone","Sphere","Floor","Vrml","IGP","Geo","STL","3DS","?","?","?"};
void *body_hnd = er_cad_io.inq_body_handle_current();
int cad_type = er_cad_io.inq_body_cad_type(body_hnd);
char *cad_type_name = s_body_type[cad_type];
er_user_io_dialog._info_line_msg(0,"cBody cad_type %d %s",cad_type,cad_type_name);
...
Parameters
[in]body_handle- handle to body
Return values
0- Ok
1- Error
static ER_DllExport char* ER_CAPI_CAD_IO::inq_body_coll_exl_list ( void *  body_handle)
static

Collision exclude list of same group used for robot itself collision
The string contains indices of bodies excluded from collision
'same group' the bodies belong either to ROBOT_GRP or TOOL_GRP
Example
coll_exl_list = "1 3 9" -> Bodies with these indices are excluded from itself collision
see inq_body_coll_exl_list_mix(), inq_body_idx()

Parameters
[in]body_handle- handle to body
Return values
pointerto collision exclude list of same group
static ER_DllExport char* ER_CAPI_CAD_IO::inq_body_coll_exl_list_mix ( void *  body_handle)
static

Collision exclude list of mixed group used for robot itself collision
The string contains indices of bodies excluded from collision
'mixed group' the bodies belong to ROBOT_GRP vs. TOOL_GRP
Example
coll_exl_list_mix = "1 3 9" -> If this list belongs to ROBOT_GRP, all bodies from TOOL_GRP with these indices are excluded from itself collision
see inq_body_coll_exl_list(), inq_body_idx()

Parameters
[in]body_handle- handle to body
Return values
pointerto collision exclude list of mixed group
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_collision ( void *  body_handle)
static

Collision flag of body givin by a handle
The collision flag is one of 0-Off, 1-Concave, 2-Convex, 3-Bbox, 4-Disabled
If the collision flag is marked as.

  • 0-Off, the body is excluded from collision checking, but is loaded to the collision detection algorithm
  • 1-Concave, the body is prepared to performe concave collision checking
  • 2-Convex, the body is prepared to performe convex collision checking
  • 3-Bbox, the body is prepared to performe bounding box collision checking
  • 4-Disabled, the body is not loaded to the collision detection algorithm, this will save loading time

see inq_body_collision_tolerance()

Parameters
[in]body_handle- handle to body
Return values
pointercollision flag
static ER_DllExport float* ER_CAPI_CAD_IO::inq_body_collision_tolerance ( void *  body_handle)
static

Collision tolerance value of body givin by a handle
The collision tolerance in [mm] defines a 'skin' of thickness around the body.

Parameters
[in]body_handle- handle to body
Return values
pointercollision tolerance
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_color_idx ( void *  body_handle)
static

Color idx of body givin by a handle
The color idx is a positive value
see set_body_rgba_color()

Parameters
[in]body_handle- handle to body
Return values
coloridx
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_color_sub_idx ( void *  body_handle)
static

Color sub idx of body givin by a handle
The color sub idx is a positive value
see inq_body_color_idx()
Remarks
This method has currently no effect!

Parameters
[in]body_handle- handle to body
Return values
colorsub idx
static ER_DllExport char* ER_CAPI_CAD_IO::inq_body_file_name ( void *  body_handle)
static

File name of body givin by a handle.

Parameters
[in]body_handle- handle to body
Return values
file_name
static ER_DllExport ER_UID* ER_CAPI_CAD_IO::inq_body_grab ( void *  body_handle)
static

Grab status of body givin by a handle
Obsolete: Only if the body belongs to BODY_GRP, it could be grabbed by the robot.

Parameters
[in]body_handle- handle to body
Return values
pointerto grab status
static ER_DllExport void* ER_CAPI_CAD_IO::inq_body_group_handle ( int  grp_type)
static

Return group handle of current Device
Parameter grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP.

// Example:
int grp_type = ROBOT_GRP;
void *grp_hnd = er_cad_io.inq_body_group_handle(grp_type);
...
Parameters
[in]grp_type
Return values
handleof current group, NULL if not valid
static ER_DllExport void* ER_CAPI_CAD_IO::inq_body_group_handle_current ( void  )
static

Get current group handle
Depending on cDevice and the current selected geometry.

// Example:
void *grp_hnd = er_cad_io.inq_body_group_handle_current();
...
Return values
handleof current group, NULL if not valid
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_group_type_current ( void  )
static

Return current group type of current selected geometry
grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP.

// Example:
char *grp_s[] = {"Robot-Grp","Tool-Grp","Body-Grp","?"};
int grp_type = er_cad_io.inq_body_group_type_current();
_info_line_msg(0," cGrp Type %d '%s'",grp_type,grp_s[grp_type]);
...
Return values
grp_type
static ER_DllExport void* ER_CAPI_CAD_IO::inq_body_handle_byidx ( void *  grp_handle,
int  body_idx 
)
static

Return body handle by body idx
Parameter grp_handle must be valid and not 0
Parameter body_idx is in [1..number of bodies[.

Parameters
[in]grp_handle- group handle
[in]body_idxidx of body [0...
Return values
handleof body, NULL if not valid
static ER_DllExport void* ER_CAPI_CAD_IO::inq_body_handle_byname ( void *  grp_handle,
char *  name 
)
static

Return body handle by body name
Parameter grp_handle must be valid and not 0
Parameter name is a valid body name in the body group.

// Example:
void *grp_hnd = er_cad_io.inq_body_group_handle(ROBOT_GRP);
if (!grp_hnd)
return;
int n_geo = er_cad_io.inq_body_number(grp_hnd); // number of bodies in the group
char *geo_name[] = {"body_1", "body_2", "body_3", "body_4" }; // These body names should exist in the current group of current device
int n = sizeof(geo_name)/sizeof(geo_name[0]);
for (int i=0;grp_hnd && i<n;i++)
{
char *gn = geo_name[i];
void *geo_hnd = er_cad_io.inq_body_handle_byname(grp_hnd,gn); // body handle
if (geo_hnd)
{
int type = er_cad_io.inq_body_cad_type(geo_hnd); // get the cad type, i.e. IGP_CAD_TYPE
char *name = er_cad_io.inq_body_name(geo_hnd); // get the name, should be the requested one
frame *Top = er_cad_io.inq_body_ref_off_pos(geo_hnd); // get resulted location w.r.t reference coorsys
er_user_io_dialog._info_line_msg(0,"%s Type %d",name,type);
er_user_io_dialog._info_line_msg_T_vec(0," Top",Top);
}
else
er_user_io_dialog._info_line_msg(0,"%s invalid",gn); // the requested geometry name does not exist
}
...
Parameters
[in]grp_handle- group handle
[in]nameof body
Return values
handleof body, NULL if not valid
static ER_DllExport void* ER_CAPI_CAD_IO::inq_body_handle_current ( void *  grp_handle = 0)
static

Return body handle
If parameter grp_handle is 0, the body handle of the current group is returned.

// Example:
void *grp_hnd = er_cad_io.inq_body_group_handle_current();
void *body_hnd = er_cad_io.inq_body_handle_current(grp_hnd);
if (!body_hnd)
return;
...
Parameters
[in]grp_handlegroup handle
Return values
handleof body, NULL if not valid
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_idx ( void *  body_handle)
static

Idx of body givin by a handle
The returned list idx is zero based [0.. number of bodies-1]
see inq_body_number()

Parameters
[in]body_handle- handle to body
Return values
Idx- zero based index
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_is_pickable ( void *  body_handle)
static

Enable/disable pickability of body givin by a handle.

Parameters
[in]body_handle- handle to body
Return values
pointerto is_pickable flag
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_joint_attach_idx ( void *  body_handle)
static

Robot joint attach idx
In case the body belongs to a ROBOT_GRP, the joint attach idx is
zero - body attached to robot base
[1 to KIN_DOFS] - body attached to an active robot joint
[KIN_DOFS+1 to KIN_DOFS+KIN_PASSIV_JNTS] - body attached to an passive robot joint
Remarks
If the body belongs to the TOOL_GRP or BODY_GRP, the joint attach idx is always 0.

Parameters
[in]body_handle- handle to body
Return values
jointattach idx
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_n_coorsys_total ( void *  body_handle)
static

Number of coorsys within body givin by a handle.

Parameters
[in]body_handle- handle to body
Return values
Numberof coorsys
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_n_line_total ( void *  body_handle)
static

Number of total lines within body givin by a handle
A body contains a number of objects. Each object consists of a number of lines.

Parameters
[in]body_handle- handle to body
Return values
Numberof total lines
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_n_obj ( void *  body_handle)
static

Number of object within body givin by a handle
A body contains a number of objects
Each object consists of: one object color, number of points, polygon indices and lines indices
In case the number of polygons and lines are zero, the object represents a point cloud.

Parameters
[in]body_handle- handle to body
Return values
numberof objects
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_n_obj_vbo ( void *  body_handle)
static

Get the number of objects loaded into the grafics board
Remarks
Each body consists of several objects.

Parameters
[in]body_handle- handle to body
Return values
numberof objects loaded into the grafics board
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_n_point_total ( void *  body_handle)
static

Number of total points/vertices within body givin by a handle
A body contains a number of objects. Each object consists of a number of points.

Parameters
[in]body_handle- handle to body
Return values
Numberof total points/vertices
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_n_poly_total ( void *  body_handle)
static

Number of total polygons within body givin by a handle
A body contains a number of objects. Each object consists of a number of polygons.

Parameters
[in]body_handle- handle to body
Return values
Numberof total polygons
static ER_DllExport char* ER_CAPI_CAD_IO::inq_body_name ( void *  body_handle)
static

Return name of a body givin by a handle
Parameter body_handle must be valid and not 0
.

// Example:
void *body_hnd = er_cad_io.inq_body_handle_current();
char *cad_name = er_cad_io.inq_body_name(body_hnd);
...
Parameters
[in]body_handle- handle to body
Return values
pointerto char - name of body
NULL- Error
static ER_DllExport int ER_CAPI_CAD_IO::inq_body_number ( void *  grp_handle)
static

Get number of geometries in the group
Parameter grp_handle must be valid and not 0.

Parameters
[in]grp_handle- group handle
Return values
Numberof geometries
static ER_DllExport void* ER_CAPI_CAD_IO::inq_body_obj_attributes_handle ( void *  body_handle,
int  i_obj 
)
static

Handle to object attributes within a body
Use inq_body_n_obj() to retreive the number of objects belonging to a body.

Parameters
[in]body_handle- handle to body
[in]i_obj- idx of object within a body [0..n_obj-1]
Return values
obj_handle_attributes- handle to object attibutes, NULL if not valid
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_color_den_idx ( void *  obj_handle)
static

Den_Color Idx an object.

Parameters
[in]obj_handle- handle to object
Return values
pointerto den_color idx
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_color_idx ( void *  obj_handle)
static

Color idx for an object.

Parameters
[in]obj_handle- handle to object
Return values
pointerto color idx
static ER_DllExport float* ER_CAPI_CAD_IO::inq_body_obj_color_rgba ( void *  obj_handle_attributes)
static

RGBA Color of an object.

Parameters
[in]obj_handle_attributes- handle to object attibutes
Return values
pointerto rgba color
static ER_DllExport frame* ER_CAPI_CAD_IO::inq_body_obj_coorsys ( void *  obj_handle,
int  idx 
)
static

Coorsys of an object
Use er_cad_io.inq_body_obj_n_coorsys() to get the number of coorsys of an object.

Parameters
[in]obj_handle- handle to object
[in]idx- coorsys index [0.. number of coorsys-1]
Return values
framepointer to coorsys frame with idx
static ER_DllExport void* ER_CAPI_CAD_IO::inq_body_obj_handle ( void *  body_handle,
int  i_obj 
)
static

Handle to object within a body
Use inq_body_n_obj() to retreive the number of objects within a body.

Parameters
[in]body_handle- handle to body
[in]i_obj- idx of object within a body [0..n_obj-1]
Return values
obj_handle- handle to object, NULL if not valid
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_is_collided ( void *  obj_handle_attributes)
static

Collision flag of an object
see inq_body_obj_attributes_handle() to retrieve the object attribute handle.

Parameters
[in]obj_handle_attributes- handle to object attibutes
Return values
objectcollision flag
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_lines ( void *  obj_handle,
int  idx 
)
static

Line segment indexes of an object
Use er_cad_io.inq_body_obj_n_line() to get the number of lines of an object.

Parameters
[in]obj_handle- handle to object
[in]idx- line index [0.. number of lines-1]
Return values
pointerto line segment idx
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_max_point_in_poly ( void *  obj_handle)
static

Maximum number of points in a polygon within an object.

Parameters
[in]obj_handle- handle to object
Return values
maximumnumber of points in a polygon
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_n_coorsys ( void *  obj_handle)
static

Number of coorsys within an object.

Parameters
[in]obj_handle- handle to object
Return values
numberof coorsys
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_n_line ( void *  obj_handle)
static

Number of lines within an object.

Parameters
[in]obj_handle- handle to object
Return values
numberof lines
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_n_point ( void *  obj_handle)
static

Number of points within an object.

Parameters
[in]obj_handle- handle to object
Return values
numberof points
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_n_poly ( void *  obj_handle)
static

Number of polygons within an object.

Parameters
[in]obj_handle- handle to object
Return values
numberof polygons
static ER_DllExport float* ER_CAPI_CAD_IO::inq_body_obj_normals ( void *  obj_handle,
int  idx 
)
static

Normal vector of polygon of an object
Use er_cad_io.inq_body_obj_n_poly() to get the number of polygons of an object.

Parameters
[in]obj_handle- handle to object
[in]idx- polygon index [0.. number of polygons-1]
Return values
pointerto normal vector
static ER_DllExport float* ER_CAPI_CAD_IO::inq_body_obj_points ( void *  obj_handle,
int  idx 
)
static

XYZ Vertex of an object
Use er_cad_io.inq_body_obj_n_point() to get the number of point of an object.

Parameters
[in]obj_handle- handle to object
[in]idx- point index [0.. number of points-1]
Return values
pointerto xyz vertex
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_polys ( void *  obj_handle,
int  idx 
)
static

Polygon indexes of an object
Use er_cad_io.inq_body_obj_n_poly() to get the number of polygons of an object.

Parameters
[in]obj_handle- handle to object
[in]idx- polygon index [0.. number of polygons-1]
Return values
pointerto polygons idx
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_obj_ptrcolor ( void *  obj_handle_attributes)
static

Color pointer Idx of an object
see inq_body_obj_attributes_handle() to retrieve the object attribute handle.

Parameters
[in]obj_handle_attributes- handle to object attibutes
Return values
colorpointer
static ER_DllExport frame* ER_CAPI_CAD_IO::inq_body_off_pos ( void *  body_handle)
static

Return offset position T_off of a body givin by a handle
Parameter body_handle must be valid and not 0
Remarks
The resulted position of the body w.r.t. it coorsys is
T_ref_off = T_ref * T_off
See inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update()

// Example:
void *body_hnd = er_cad_io.inq_body_handle_current();
frame *T_off = er_cad_io.inq_body_off_pos(body_hnd);
...
Parameters
[in]body_handle- handle to body
Return values
pointerto frame
NULL- Error
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_poly_invert ( void *  body_handle)
static

Polygon invert flag of body givin by a handle
If the polygon invert flag is set, all polygons of body are inverted for visualization.

Parameters
[in]body_handle- handle to body
Return values
pointerinvert flag
static ER_DllExport frame* ER_CAPI_CAD_IO::inq_body_ref_off_pos ( void *  body_handle)
static

Return resulted position T_ref_off of a body givin by a handle
Parameter body_handle must be valid and not 0
Remarks
The resulted position of the body w.r.t. it coorsys is
T_ref_off = T_ref * T_off
See inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update()

// Example:
void *body_hnd = er_cad_io.inq_body_handle_current();
frame *T_ref = er_cad_io.inq_body_ref_pos(body_hnd);
frame *T_off = er_cad_io.inq_body_off_pos(body_hnd);
// change T_ref or T_off here
// Update resulted location
er_cad_io.body_update(body_hnd);
frame *T_ref_off = er_cad_io.inq_body_Tref_pos(body_hnd); // resulted bodies location w.r.t reference corrsys
frame *Tworld = er_cad_io.inq_body_world_pos(body_hnd); // bodies location w.r.t world coorsys
...
Parameters
[in]body_handle- handle to body
Return values
pointerto frame
NULL- Error
static ER_DllExport frame* ER_CAPI_CAD_IO::inq_body_ref_pos ( void *  body_handle)
static

Return reference position T_ref of a body givin by a handle
Parameter body_handle must be valid and not 0
Remarks
The resulted position of the body w.r.t. it coorsys is
T_ref_off = T_ref * T_off
See inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update()

// Example:
void *body_hnd = er_cad_io.inq_body_handle_current();
frame *T_ref = er_cad_io.inq_body_ref_pos(body_hnd);
...
Parameters
[in]body_handle- handle to body
Return values
pointerto frame
NULL- Error
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_render ( void *  body_handle)
static

Get the render type of body givin by a handle
The render type and is one of
FLAT=6, WIRE=1, BBFLAT=2, BBWIRE=3, INVISIBLE=4, POINT_RENDER=5, SMOOTH_RENDER=0.

Parameters
[in]body_handle- handle to body
Return values
Pointerto render type
static ER_DllExport float* ER_CAPI_CAD_IO::inq_body_scale ( void *  body_handle)
static

XYZ scaling vector of body givin by a handle
The scaling vector has positive values >0 and scales the original geometry point data in yxz direction
see inq_body_size()

Parameters
[in]body_handle- handle to body
Return values
scalingvector, size DIM
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_show_edges ( void *  body_handle)
static

Show body edges
Allows to dis- or enable visualizazion of body edges.

Parameters
[in]body_handle- handle to body
Return values
pointerto show_edges flag
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_show_mesh ( void *  body_handle)
static

Show body meshes
Allows to dis- or enable visualizazion of body meshes.

Parameters
[in]body_handle- handle to body
Return values
pointerto show_mesh flag
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_show_name ( void *  body_handle)
static

Show the name of body givin by a handle
Allows to dis- or enable visualizazion of body name.

Parameters
[in]body_handle- handle to body
Return values
pointerto show_name flag
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_show_normals ( void *  body_handle)
static

Show normals of body givin by a handle
Allows to dis- or enable visualizazion of body normals.

Parameters
[in]body_handle- handle to body
Return values
pointerto show_normals flag
static ER_DllExport int* ER_CAPI_CAD_IO::inq_body_show_transparent ( void *  body_handle)
static

Show body transparency
Allows to dis- or enable body transparency
see inq_body_transparency()

Parameters
[in]body_handle- handle to body
Return values
pointerto show_transparent flag
static ER_DllExport float* ER_CAPI_CAD_IO::inq_body_size ( void *  body_handle)
static

XYZ size vector of body givin by a handle
The size vector values are a result of the original geometry point data scaled by the scaling vector in yxz direction
see inq_body_scale()

Parameters
[in]body_handle- handle to body
Return values
sizevector, size of vector DIM
static ER_DllExport float* ER_CAPI_CAD_IO::inq_body_transparency ( void *  body_handle)
static

Transparency (alfa) value of body givin by a handle
The transparency value is between 0 and 1. 1 means fully opaque , 0 means fully transparent
see inq_body_show_transparent()

Parameters
[in]body_handle- handle to body
Return values
pointertransparency value
static ER_DllExport frame* ER_CAPI_CAD_IO::inq_body_Tref_pos ( void *  body_handle,
int  grp_type,
frame Tref 
)
static

Reference position w.r.t. to inertia coorsys of body givin by a handle
The reference position Tref is the position where the body is attached to.
Remarks
This could be the robot base or an active or passive robot joint in case the grp_type is ROBOT_GRP
In case of grp_type equals TOOL_GRP the body is attached to the robots tip
In case of grp_type equals BODY_GRP the body is attached to the inertia coorsys or to the robots tip if the body was grabbed
Parameter grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP
See inq_body_world_pos()
See also inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update()

Parameters
[in]body_handle- handle to body
[in]grp_type- group type
[in]Tref- reference position w.r.t. inertia coorsys
Return values
Pointerto frame of Tref
static ER_DllExport frame* ER_CAPI_CAD_IO::inq_body_world_pos ( void *  body_handle,
int  grp_type,
frame Tworld 
)
static

World position w.r.t. to inertia coorsys of body givin by a handle
The world position Tworld is the resulted position of the body w.r.t. inertia coorsys
Remarks
The resulted position of the body w.r.t. it coorsys is T_ref_off = T_ref * T_off
Tworld = Tref * T_ref_off
To calculate Tref, use inq_body_Tref_pos()
See also inq_body_ref_pos(), inq_body_off_pos(), inq_body_ref_off_pos(), body_update()

Parameters
[in]body_handle- handle to body
[in]grp_type- group type
[in]Tworld- reference position w.r.t. inertia coorsys
Return values
Pointerframe of Tworld
static ER_DllExport int ER_CAPI_CAD_IO::set_body_group_type ( int  grp_type)
static

Set group type for internal temporary geometry template
Parameter grp_type is one of ROBOT_GRP, TOOL_GRP or BODY_GRP.

Parameters
[in]grp_type
Return values
0- Ok
1- Error
static ER_DllExport int ER_CAPI_CAD_IO::set_body_handle_current ( void *  body_handle)
static

Set a body as current selected body
Parameter body_handle must be valid and not 0.

Parameters
[in]body_handle- handle to body
Return values
0- Ok
1- Error
static ER_DllExport int ER_CAPI_CAD_IO::set_body_para ( void *  body_handle,
float *  para 
)
static

Set or modify body parameter The content of the parameter vector para depends of the "cad_type"
see inq_body_cad_type(), get_body_para()

// Example:
...
float *scale_parameter = NULL;
float parameter_cube[] = { 0.3f, 0.4f, 0.5f, 0,0,0, 0,0,0}; // X, Y, Height
float parameter_pyramid[] = { 0.3f, 0.4f, 0.5f, 0.0f, 0.0f, 0 , 0,0,0}; // X, Y, Height, dx, dy
float parameter_wedge[] = { 0.2f, 0.2f, 0.5f, 0.2f, 0.2f, 0.0f, 0.0f, 0,0 }; // X, Y, Height X top, Y top, dx dy
float parameter_cylinder[] = { 0.2f, 0.5f, 1.0f, 0.2f, 0.5f, 1.0f, 0.0f, 0.0f, 360.0f}; // Radius, Height 1, y Scale, Radius top, Height 2, y Scale top, dx, dy, Angle
float parameter_cone[] = { 0.2f, 0.5f, 1.0f, 0.0f, 0.0f, 360.0f, 0,0,0}; // Radius, Height 1, y Scale, dx, dy, Angle
float parameter_sphere[] = { 0.5f, 1.0f, 360.0f, 90.0f, -90.0f, 0, 0,0,0}; // Radius, y Scale, Angle, beta 1, beta 2
float scale_ipg_stl[DIM] = { 2.0f, 2.0f, 2.0f }; // X, Y, Z scale
// get current selected CAD geometry
void *body_hnd = er_cad_io.inq_body_handle_current();
int cad_type = er_vad_inq_body_cad_type(body_hnd);
scale_parameter =
cad_type==CUBE_CAD_TYPE ? parameter_cube :
cad_type==PYRAMID_CAD_TYPE ? parameter_pyramid :
cad_type==WEDGE_CAD_TYPE ? parameter_wedge :
cad_type==CYLINDER_CAD_TYPE ? parameter_cylinder :
cad_type==CONE_CAD_TYPE ? parameter_cone :
cad_type==SPHERE_CAD_TYPE ? parameter_sphere :
cad_type==VRML_CAD_TYPE ? scale_ipg_stl :
cad_type==IGP_CAD_TYPE ? scale_ipg_stl :
cad_type==STL_CAD_TYPE ? scale_ipg_stl :
cad_type==_3DS_CAD_TYPE ? scale_ipg_stl :
NULL;
//
// modify current selected body
//
if (scale_parameter)
er_cad_io.set_body_para(body_hnd,scale_parameter);
er_sys_view.grf_update_export();
...
Parameters
[in]body_handle- handle to body
[in]para- vector containing the parameter of body
Return values
0- OK
1- Error
static ER_DllExport int ER_CAPI_CAD_IO::set_body_rgba_color ( void *  body_handle,
float *  rgba_color,
int  color_use = COLOR_USE_USER,
int  color_idx2change = 0 
)
static

Set the RGB color of body givin by a handle
Furthermore the object color can be exchanged
Parameter color_use is one of
COLOR_USE_USER - USER color are saved with .cel, .rob or .ras file
COLOR_USE_FIX - Note: FIX color are only temporarly
COLOR_USE_FIX_IDX - Changes all objects with FIX color and with 'color_idx2change' to rgba_color
Parameter color_idx2change allows to exchange a specific color for all objects with exactly this color idx color_idx2change, if set >0.
see inq_body_color_idx()

Parameters
[in]body_handle- handle to body
[in]rgba_color- RGB color with Alfa value for transparency
[in]color_use
[in]color_idx2change
Return values
0- OK
1- Error

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