Graphics.UsingTheDougCmdTclCommand - lordmundi/wikidoctest GitHub Wiki
« Using the doug dynamic plugin loading commands | EDGE User’s Guide | Limit Parameters Of A Node »
EDGE provides an extensive tcl scripting ability to DSP.
The doug.cmd command can be used to command the flow control of the renderer and main application, such as forcing an update.
The doug.cmd commands are best explained via examples. The following example commands should illustrate most of the usage:
doug.cmd getenv_path
doug.cmd pick
doug.cmd redraw
doug.cmd update
doug.cmd scrsave
doug.cmd exit
doug.cmd version
doug.cmd getnode
doug.cmd plugin_info
doug.cmd get_version
doug.cmd get_load
doug.cmd get_display
doug.cmd get_group
doug.cmd get_input
doug.cmd get_scene
doug.cmd get_mode
doug.cmd get_base_package
doug.cmd get_package
doug.cmd get_seconds
doug.cmd get_fps
doug.cmd get_mode
doug.cmd get_plugins
doug.cmd get_precision
doug.cmd tcldebug <on/off>
If the above examples are not enough info, or you need more information about a particular option, the source code implementing the doug.cmd command is below:
[Show DOUG_CMD_cmd source code][4]
int
DOUG_CMD_cmd( ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] )
{
#if 0
doug.cmd getenv_path
doug.cmd pick
doug.cmd redraw
doug.cmd update
doug.cmd scrsave
doug.cmd exit
doug.cmd version
doug.cmd getnode
doug.cmd plugin_info
doug.cmd get_version
doug.cmd get_load
doug.cmd get_display
doug.cmd get_group
doug.cmd get_input
doug.cmd get_scene
doug.cmd get_mode
doug.cmd get_base_package
doug.cmd get_package
#endif
void DOUG_update_elements();
Tcl_ResetResult( interp );
if( !DSF_strcmpi( Tcl_GetString(objv[1]), "getenv_path" ) )
{
char buff[300];
char *pc;
int i;
if( pc = DSF_GetEnv( Tcl_GetString( objv[2] ) ) )
{
strcpy( buff, DSF_GetEnv( Tcl_GetString( objv[2] ) ) );
for( i = 0; buff[i]; i++ )
if( buff[i] == '\\' )
buff[i] = '/';
Tcl_AppendResult( interp, buff, NULL );
}
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "plugin_info" ) )
{
char buff[1000];
int i;
/* SHOW PLUGIN-INFO DIALOG */
plugin(interp);
for( i = 0; i < DOUG_plugin_cnt; i++ )
{
if( DOUG_plugin_status[i] )
{
sprintf( buff, ".plugdlg.fr2.lbox itemconfigure %d -foreground #00ff00"
" -selectforeground #000000 -background #000000 -selectbackground #00ff00", i );
}
else
{
sprintf( buff, ".plugdlg.fr2.lbox itemconfigure %d -foreground #ff0000"
" -selectforeground #000000 -background #000000 -selectbackground #ff0000", i );
}
Tcl_EvalEx( interp, buff, -1, TCL_EVAL_GLOBAL );
}
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "get_load" ) )
{
Tcl_AppendResult( interp, DSV_features.load, NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "get_display" ) )
{
Tcl_AppendResult( interp, DSV_features.display, NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "get_group" ) )
{
Tcl_AppendResult( interp, DSV_features.group, NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "get_input" ) )
{
Tcl_AppendResult( interp, DSV_features.input, NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "get_scene" ) )
{
Tcl_AppendResult( interp, DSV_features.scene, NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "get_mode" ) )
{
Tcl_AppendResult( interp, DSV_features.mode, NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "get_base_package" ) )
{
Tcl_AppendResult( interp, DSV_features.base_package, NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "get_package" ) )
{
Tcl_AppendResult( interp, DSV_features.package, NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "get_version" ) )
{
Tcl_AppendResult( interp, DOUG_VERSION, NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "version" ) )
{
Tcl_AppendResult( interp, DOUG_VERSION, NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "pick" ) )
{
DSS_NODE *pn;
if( pn = DSF_PickModelFast( DSV_doug->pixel_info.px, DSV_doug->pixel_info.py ) )
Tcl_SetResult( interp, pn->name, TCL_VOLATILE );
else
Tcl_SetResult( interp, "", TCL_STATIC );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "getnode" ) )
{
if( DOUG_picked_node )
Tcl_AppendResult( interp, DOUG_picked_node->name, NULL );
else
Tcl_AppendResult( interp, "", NULL );
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "update" ) )
{
static int lev = 0;
if( !lev )
{
lev += 1;
if( !DSV_proc_id )
DOUG_update_elements();
DOUG_execute_callbacks( DOUG_update_list );
if( DOUG_execute_callbacks( DOUG_timer_list ) )
DOUG_remove_expired_timers();
#if 0
if( DSV_scene->changed_id != DSV_doug->changed_id )
{
if( !DOUG_features.no_visual )
{
DOUG_execute_callbacks( DOUG_redraw_list );
DOUG_execute_callbacks( DOUG_refresh_list );
}
else
DOUG_execute_callbacks( DOUG_refresh_list );
}
#endif
DSV_doug->changed_id = DSV_scene->changed_id;
DSF_UpdateScene();
/* IF ANOTHER PROCESS IS MANAGING THE TRANSFORMS, THEN WAIT UNTIL IT HAS PERFORMED ITS DUTY */
if( DSV_run_mode & DSD_CLIENT )
{
int updated_id;
updated_id = DSV_scene->updated_id;
DSF_BgnModifyScene( DSV_scene );
DSF_EndModifyScene( DSV_scene );
while( updated_id == DSV_scene->updated_id )
DSF_Nap(1);
}
lev -= 1;
}
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "redraw" ) )
{
if( !DOUG_features.no_visual )
DSF_UpdateDisplay();
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "exit" ) )
{
DSF_ProgramShutdown();
exit(0);
}
else if( !DSF_strcmpi( Tcl_GetString(objv[1]), "scrsave" ) )
{
/* NOT DONE */
}
else
{
Tcl_AppendResult( interp, "doug.cmd (unknown command \"", Tcl_GetString(objv[1]), "\")", NULL );
return TCL_ERROR;
}
return TCL_OK;
}
« Using the doug dynamic plugin loading commands | EDGE User’s Guide | Limit Parameters Of A Node »
[4]: javascript:toggleObj('togglecode_id0','hide','Show DOUG_CMD_cmd source code','Show DOUG_CMD_cmd source code','')