BRL-CAD
color.c File Reference
#include "common.h"
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "bu/getopt.h"
#include "ged.h"
#include "db.h"
#include "mater.h"
#include "./ged_private.h"
Include dependency graph for color.c:

Go to the source code of this file.

Functions

void color_putrec (struct ged *gedp, struct mater *mp)
 
void color_zaprec (struct ged *gedp, struct mater *mp)
 
int ged_edcolor (struct ged *gedp, int argc, const char *argv[])
 
int ged_color (struct ged *gedp, int argc, const char *argv[])
 

Detailed Description

The color command.

Definition in file color.c.

Function Documentation

void color_putrec ( struct ged gedp,
struct mater *  mp 
)

Used to create a database record and get it written out to a granule. In some cases, storage will need to be allocated.

Definition at line 45 of file color.c.

References bu_vls_printf(), directory::d_flags, directory::d_len, directory::d_magic, db_alloc(), db_put(), rt_wdb::dbip, ged::ged_result_str, ged::ged_wdbp, RT_DIR_MAGIC, and RT_DIR_SET_NAMEP.

Referenced by ged_color().

Here is the call graph for this function:

void color_zaprec ( struct ged gedp,
struct mater *  mp 
)

Used to release database resources occupied by a material record.

Definition at line 87 of file color.c.

References bu_vls_printf(), directory::d_flags, directory::d_len, directory::d_magic, db_delete(), rt_wdb::dbip, ged::ged_result_str, ged::ged_wdbp, RT_DIR_MAGIC, and RT_DIR_SET_NAMEP.

Referenced by ged_color().

Here is the call graph for this function:

int ged_edcolor ( struct ged gedp,
int  argc,
const char *  argv[] 
)

Text edit the color table

Definition at line 248 of file color.c.

References bu_vls_printf(), bu_vls_trunc(), GED_CHECK_ARGC_GT_0, GED_CHECK_DATABASE_OPEN, GED_CHECK_READ_ONLY, GED_ERROR, and ged::ged_result_str.

Here is the call graph for this function:

int ged_color ( struct ged gedp,
int  argc,
const char *  argv[] 
)

Make color entry.

Definition at line 267 of file color.c.

References BU_ALLOC, bu_vls_addr(), bu_vls_free(), BU_VLS_INIT_ZERO, bu_vls_printf(), bu_vls_trunc(), color_putrec(), color_zaprec(), db5_update_attribute(), db_version(), rt_wdb::dbip, GED_CHECK_ARGC_GT_0, GED_CHECK_DATABASE_OPEN, GED_CHECK_READ_ONLY, GED_ERROR, GED_HELP, GED_OK, ged::ged_result_str, ged::ged_wdbp, rt_insert_color(), rt_material_head(), rt_vls_color_map(), and usage().

Here is the call graph for this function: