Exemple #1
0
int
Cho_Init(Tcl_Interp *interp)
{
    memset(&HeadCmdHistObj, 0, sizeof(struct bu_cmdhist_obj));
    BU_LIST_INIT(&HeadCmdHistObj.l);
    BU_VLS_INIT(&HeadCmdHistObj.cho_name);
    /* cho_head already zero'd */
    HeadCmdHistObj.cho_curr = NULL;

    (void)Tcl_CreateCommand(interp, "ch_open", (Tcl_CmdProc *)cho_open_tcl,
			    (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);

    return TCL_OK;
}
Exemple #2
0
/**
 * Routine to make a new REVOLVE solid. The only purpose of this routine
 * is to initialize the internal to legal values (e.g., vls)
 */
void
rt_revolve_make(const struct rt_functab *ftp, struct rt_db_internal *intern)
{
    struct rt_revolve_internal *rev;

    intern->idb_major_type = DB5_MAJORTYPE_BRLCAD;
    intern->idb_type = ID_REVOLVE;
    BU_ASSERT(&OBJ[intern->idb_type] == ftp);

    intern->idb_meth = ftp;
    BU_ALLOC(rev, struct rt_revolve_internal);

    intern->idb_ptr = (void *)rev;
    rev->magic = RT_REVOLVE_INTERNAL_MAGIC;

    BU_VLS_INIT(&rev->sketch_name);
    rev->skt = NULL;
}