|
| void | db_mater_color_region (struct db_i *dbip, struct region *regp) |
| |
| void | db_mater_add (struct db_i *dbip, int low, int hi, int r, int g, int b, b_off_t addr) |
| |
| void | db_mater_insert (struct db_i *dbip, struct mater *newp) |
| |
| void | db_mater_to_vls (struct bu_vls *str, struct db_i *dbip) |
| |
| struct mater * | db_mater_head (struct db_i *dbip) |
| |
| void | db_mater_set_head (struct db_i *dbip, struct mater *newmat) |
| |
| struct mater * | db_mater_dup (struct db_i *dbip) |
| |
| void | db_mater_free (struct db_i *dbip) |
| |
|
The following functions operated on a single process-wide (global) material table and are retained for backward compatibility only. New code must use the per-database db_mater_*() functions above.
- Deprecated:
- since 7.42 - use db_mater_head(), db_mater_set_head(), db_mater_dup(), db_mater_free(), db_mater_insert(), db_mater_add(), db_mater_to_vls(), and db_mater_color_region() instead.
|
| DEPRECATED struct mater * | rt_material_head (void) |
| |
| DEPRECATED void | rt_new_material_head (struct mater *newmat) |
| |
| DEPRECATED struct mater * | rt_dup_material_head (void) |
| |
| DEPRECATED void | rt_color_free (void) |
| |
| DEPRECATED void | rt_insert_color (struct mater *newp) |
| |
| DEPRECATED void | rt_color_addrec (int low, int hi, int r, int g, int b, b_off_t addr) |
| |
| DEPRECATED void | rt_vls_color_map (struct bu_vls *str) |
| |
| DEPRECATED void | rt_region_color_map (struct region *regp) |
| |
Region-ID-based material/color table management for BRL-CAD databases.
BRL-CAD supports a region-ID color table: a sorted, non-overlapping list of struct mater entries that map integer region-ID ranges to RGB colors. This table is stored per-database (in db_i) and is used by the ray tracer and display logic to assign colors to regions based on their region ID when no explicit color attribute is present on the object itself.
The table is populated when the database is opened (from _GLOBAL attributes for v5 databases, or from ID_COLORTAB records for v4 databases) and is freed when the database is closed.
Typical usage pattern:
- At database load time,
db_mater_add() is called for each stored color record, which calls db_mater_insert() to build the sorted in-memory list.
- At ray-trace / display time,
db_mater_color_region() walks the table to apply an override color to a region whose ID falls within a mapped range.
- To inspect or serialize the current table, use
db_mater_head() to obtain the list head and iterate via mt_forw, or call db_mater_to_vls() for a string representation suitable for storing in a _GLOBAL attribute.
db_mater_free() releases all in-memory table entries (called by db_close()).
Definition in file mater.h.