BRL-CAD
anim.h File Reference
#include "common.h"
#include <stdio.h>
#include "vmath.h"
#include "bu/vls.h"
#include "bu/file.h"
#include "rt/defines.h"
#include "rt/mater.h"
#include "rt/db_fullpath.h"
Include dependency graph for anim.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  anim_mat
 
struct  rt_anim_property
 
struct  rt_anim_color
 
struct  animate
 
union  animate::animate_specific
 

Macros

#define ANM_RSTACK   1
 Replace stacked matrix. More...
 
#define ANM_RARC   2
 Replace arc matrix. More...
 
#define ANM_LMUL   3
 Left (root side) mul. More...
 
#define ANM_RMUL   4
 Right (leaf side) mul. More...
 
#define ANM_RBOTH   5
 Replace stack, arc=Idn. More...
 
#define RT_ANP_REPLACE   1
 Replace shader string. More...
 
#define RT_ANP_APPEND   2
 Append to shader string. More...
 
#define RT_CK_ANP(_p)   BU_CKMAG((_p), RT_ANP_MAGIC, "rt_anim_property")
 
#define RT_AN_MATRIX   1
 Matrix animation. More...
 
#define RT_AN_MATERIAL   2
 Material property anim. More...
 
#define RT_AN_COLOR   3
 Material color anim. More...
 
#define RT_AN_SOLID   4
 Solid parameter anim. More...
 
#define RT_AN_TEMPERATURE   5
 Region temperature. More...
 
#define ANIM_NULL   ((struct animate *)0)
 
#define RT_CK_ANIMATE(_p)   BU_CKMAG((_p), ANIMATE_MAGIC, "animate")
 

Functions

struct animatedb_parse_1anim (struct db_i *dbip, int argc, const char **argv)
 
int db_parse_anim (struct db_i *dbip, int argc, const char **argv)
 
int db_add_anim (struct db_i *dbip, struct animate *anp, int root)
 
int db_do_anim (struct animate *anp, mat_t stack, mat_t arc, struct mater_info *materp)
 
void db_free_anim (struct db_i *dbip)
 
void db_write_anim (FILE *fop, struct animate *anp)
 
void db_free_1anim (struct animate *anp)
 
void db_apply_anims (struct db_full_path *pathp, struct directory *dp, mat_t stck, mat_t arc, struct mater_info *materp)
 

Macro Definition Documentation

◆ ANM_RSTACK

#define ANM_RSTACK   1

Replace stacked matrix.

Definition at line 56 of file anim.h.

◆ ANM_RARC

#define ANM_RARC   2

Replace arc matrix.

Definition at line 57 of file anim.h.

◆ ANM_LMUL

#define ANM_LMUL   3

Left (root side) mul.

Definition at line 58 of file anim.h.

◆ ANM_RMUL

#define ANM_RMUL   4

Right (leaf side) mul.

Definition at line 59 of file anim.h.

◆ ANM_RBOTH

#define ANM_RBOTH   5

Replace stack, arc=Idn.

Definition at line 60 of file anim.h.

◆ RT_ANP_REPLACE

#define RT_ANP_REPLACE   1

Replace shader string.

Definition at line 67 of file anim.h.

◆ RT_ANP_APPEND

#define RT_ANP_APPEND   2

Append to shader string.

Definition at line 68 of file anim.h.

◆ RT_CK_ANP

#define RT_CK_ANP (   _p)    BU_CKMAG((_p), RT_ANP_MAGIC, "rt_anim_property")

Definition at line 69 of file anim.h.

◆ RT_AN_MATRIX

#define RT_AN_MATRIX   1

Matrix animation.

Definition at line 88 of file anim.h.

◆ RT_AN_MATERIAL

#define RT_AN_MATERIAL   2

Material property anim.

Definition at line 89 of file anim.h.

◆ RT_AN_COLOR

#define RT_AN_COLOR   3

Material color anim.

Definition at line 90 of file anim.h.

◆ RT_AN_SOLID

#define RT_AN_SOLID   4

Solid parameter anim.

Definition at line 91 of file anim.h.

◆ RT_AN_TEMPERATURE

#define RT_AN_TEMPERATURE   5

Region temperature.

Definition at line 92 of file anim.h.

◆ ANIM_NULL

#define ANIM_NULL   ((struct animate *)0)

Definition at line 94 of file anim.h.

◆ RT_CK_ANIMATE

#define RT_CK_ANIMATE (   _p)    BU_CKMAG((_p), ANIMATE_MAGIC, "animate")

Definition at line 95 of file anim.h.

Function Documentation

◆ db_parse_1anim()

struct animate * db_parse_1anim ( struct db_i dbip,
int  argc,
const char **  argv 
)

Parse one "anim" type command into an "animate" structure.

argv[1] must be the "a/b" path spec, argv[2] indicates what is to be animated on that arc.

◆ db_parse_anim()

int db_parse_anim ( struct db_i dbip,
int  argc,
const char **  argv 
)

A common parser for mged and rt. Experimental. Not the best name for this.

◆ db_add_anim()

int db_add_anim ( struct db_i dbip,
struct animate anp,
int  root 
)

Add a user-supplied animate structure to the end of the chain of such structures hanging from the directory structure of the last node of the path specifier. When 'root' is non-zero, this matrix is located at the root of the tree itself, rather than an arc, and is stored differently.

In the future, might want to check to make sure that callers directory references are in the right database (dbip).

◆ db_do_anim()

int db_do_anim ( struct animate anp,
mat_t  stack,
mat_t  arc,
struct mater_info materp 
)

Perform the one animation operation. Leave results in form that additional operations can be cascaded.

Note that 'materp' may be a null pointer, signifying that the region has already been finalized above this point in the tree.

◆ db_free_anim()

void db_free_anim ( struct db_i dbip)

Release chain of animation structures

An unfortunate choice of name.

◆ db_write_anim()

void db_write_anim ( FILE *  fop,
struct animate anp 
)

Writes 'count' bytes into at file offset 'offset' from buffer at 'addr'. A wrapper for the UNIX write() sys-call that takes into account syscall semaphores, stdio-only machines, and in-memory buffering.

Returns - 0 OK -1 FAILURE

◆ db_free_1anim()

void db_free_1anim ( struct animate anp)

Free one animation structure

◆ db_apply_anims()

void db_apply_anims ( struct db_full_path pathp,
struct directory dp,
mat_t  stck,
mat_t  arc,
struct mater_info materp 
)

'arc' may be a null pointer, signifying an identity matrix. 'materp' may be a null pointer, signifying that the region has already been finalized above this point in the tree.