BRL-CAD
joint.c File Reference
#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "bu/getopt.h"
#include "raytrace.h"
#include "./joint.h"
#include "./ged_private.h"
Include dependency graph for joint.c:

Go to the source code of this file.

Data Structures

struct  artic_grips
 
struct  artic_joints
 
struct  solve_stack
 

Macros

#define DEBUG_J_MESH   0x00000001
 
#define DEBUG_J_LOAD   0x00000002
 
#define DEBUG_J_MOVE   0x00000004
 
#define DEBUG_J_SOLVE   0x00000008
 
#define DEBUG_J_EVAL   0x00000010
 
#define DEBUG_J_SYSTEM   0x00000020
 
#define DEBUG_J_PARSE   0x00000040
 
#define DEBUG_J_LEX   0x00000080
 
#define J_DEBUG_FORMAT   "\020\10LEX\7PARSE\6SYSTEM\5EVAL\4SOLVE\3MOVE\2LOAD\1MESH"
 
#define MAX_OBJ_NAME   255
 
#define MAGIC_A_GRIP   0x414752aa
 
#define MAGIC_A_JOINT   0x414A4F55
 
#define HOLD_POINT_TO_STRING_LEN   1024
 
#define KEY_JOINT   1
 
#define KEY_CON   2
 
#define KEY_ARC   3
 
#define KEY_LOC   4
 
#define KEY_TRANS   5
 
#define KEY_ROT   6
 
#define KEY_LIMIT   7
 
#define KEY_UP   8
 
#define KEY_LOW   9
 
#define KEY_CUR   10
 
#define KEY_ACC   11
 
#define KEY_DIR   12
 
#define KEY_UNITS   13
 
#define KEY_JOINTS   14
 
#define KEY_START   15
 
#define KEY_PATH   16
 
#define KEY_WEIGHT   17
 
#define KEY_PRI   18
 
#define KEY_EFF   19
 
#define KEY_POINT   20
 
#define KEY_EXCEPT   21
 
#define KEY_INF   22
 
#define KEY_VERTEX   23
 
#define UNIT_INCH   1
 
#define UNIT_METER   2
 
#define UNIT_FEET   3
 
#define UNIT_CM   4
 
#define UNIT_MM   5
 
#define ID_FIXED   -1
 
#define SYM_OP_GROUP   1
 
#define SYM_CL_GROUP   2
 
#define SYM_OP_PT   3
 
#define SYM_CL_PT   4
 
#define SYM_EQ   5
 
#define SYM_ARC   6
 
#define SYM_END   7
 
#define SYM_COMMA   8
 
#define SYM_MINUS   9
 
#define SYM_PLUS   10
 
#define ANIM_MAT   (anp->an_u.anu_m.anm_mat)
 
#define SOLVE_STACK_MAGIC   0x76766767
 
#define EPSI   1e-6
 
#define R   0.61803399
 
#define C   (1.0-R)
 
#define SOLVE_MAX_PRIORITY   100
 

Functions

struct jointfindjoint (struct ged *gedp, const struct db_full_path *pathp)
 
HIDDEN union treemesh_leaf (struct db_tree_state *tsp, const struct db_full_path *pathp, struct rt_db_internal *ip, void *client_data)
 
HIDDEN union treemesh_end_region (struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data)
 
HIDDEN int helpcomm (struct ged *gedp, int argc, const char *argv[], struct funtab *functions)
 
int get_token (struct ged *gedp, union bu_lex_token *token, FILE *fip, struct bu_vls *str, struct bu_lex_key *keys, struct bu_lex_key *syms)
 
int ged_joint (struct ged *gedp, int argc, const char *argv[])
 

Variables

struct funtab joint_tab []
 
struct bu_list artic_head
 
struct bu_list joint_head
 
struct bu_list hold_head
 
struct bu_list solve_head
 

Detailed Description

Process all animation edit commands.

Definition in file joint.c.

Macro Definition Documentation

#define DEBUG_J_MESH   0x00000001

Definition at line 42 of file joint.c.

Referenced by findjoint().

#define DEBUG_J_LOAD   0x00000002

Definition at line 43 of file joint.c.

#define DEBUG_J_MOVE   0x00000004

Definition at line 44 of file joint.c.

#define DEBUG_J_SOLVE   0x00000008

Definition at line 45 of file joint.c.

#define DEBUG_J_EVAL   0x00000010

Definition at line 46 of file joint.c.

#define DEBUG_J_SYSTEM   0x00000020

Definition at line 47 of file joint.c.

#define DEBUG_J_PARSE   0x00000040

Definition at line 48 of file joint.c.

#define DEBUG_J_LEX   0x00000080

Definition at line 49 of file joint.c.

Referenced by get_token().

#define J_DEBUG_FORMAT   "\020\10LEX\7PARSE\6SYSTEM\5EVAL\4SOLVE\3MOVE\2LOAD\1MESH"

Definition at line 50 of file joint.c.

#define MAX_OBJ_NAME   255

Definition at line 54 of file joint.c.

#define MAGIC_A_GRIP   0x414752aa

Definition at line 64 of file joint.c.

Referenced by mesh_leaf().

#define MAGIC_A_JOINT   0x414A4F55

Definition at line 70 of file joint.c.

Referenced by mesh_leaf().

#define HOLD_POINT_TO_STRING_LEN   1024
#define KEY_JOINT   1

Definition at line 695 of file joint.c.

#define KEY_CON   2

Definition at line 696 of file joint.c.

#define KEY_ARC   3

Definition at line 697 of file joint.c.

#define KEY_LOC   4

Definition at line 698 of file joint.c.

#define KEY_TRANS   5

Definition at line 699 of file joint.c.

#define KEY_ROT   6

Definition at line 700 of file joint.c.

#define KEY_LIMIT   7

Definition at line 701 of file joint.c.

#define KEY_UP   8

Definition at line 702 of file joint.c.

#define KEY_LOW   9

Definition at line 703 of file joint.c.

#define KEY_CUR   10

Definition at line 704 of file joint.c.

#define KEY_ACC   11

Definition at line 705 of file joint.c.

#define KEY_DIR   12

Definition at line 706 of file joint.c.

#define KEY_UNITS   13

Definition at line 707 of file joint.c.

#define KEY_JOINTS   14

Definition at line 708 of file joint.c.

#define KEY_START   15

Definition at line 709 of file joint.c.

#define KEY_PATH   16

Definition at line 710 of file joint.c.

#define KEY_WEIGHT   17

Definition at line 711 of file joint.c.

#define KEY_PRI   18

Definition at line 712 of file joint.c.

#define KEY_EFF   19

Definition at line 713 of file joint.c.

#define KEY_POINT   20

Definition at line 714 of file joint.c.

#define KEY_EXCEPT   21

Definition at line 715 of file joint.c.

#define KEY_INF   22

Definition at line 716 of file joint.c.

#define KEY_VERTEX   23

Definition at line 717 of file joint.c.

#define UNIT_INCH   1

Definition at line 745 of file joint.c.

#define UNIT_METER   2

Definition at line 746 of file joint.c.

#define UNIT_FEET   3

Definition at line 747 of file joint.c.

#define UNIT_CM   4

Definition at line 748 of file joint.c.

#define UNIT_MM   5

Definition at line 749 of file joint.c.

#define ID_FIXED   -1

Definition at line 762 of file joint.c.

#define SYM_OP_GROUP   1

Definition at line 770 of file joint.c.

#define SYM_CL_GROUP   2

Definition at line 771 of file joint.c.

#define SYM_OP_PT   3

Definition at line 772 of file joint.c.

#define SYM_CL_PT   4

Definition at line 773 of file joint.c.

#define SYM_EQ   5

Definition at line 774 of file joint.c.

#define SYM_ARC   6

Definition at line 775 of file joint.c.

#define SYM_END   7

Definition at line 776 of file joint.c.

#define SYM_COMMA   8

Definition at line 777 of file joint.c.

#define SYM_MINUS   9

Definition at line 778 of file joint.c.

#define SYM_PLUS   10

Definition at line 779 of file joint.c.

#define ANIM_MAT   (anp->an_u.anu_m.anm_mat)
#define SOLVE_STACK_MAGIC   0x76766767

Definition at line 2594 of file joint.c.

#define EPSI   1e-6
#define R   0.61803399
#define C   (1.0-R)
#define SOLVE_MAX_PRIORITY   100

Function Documentation

struct joint* findjoint ( struct ged gedp,
const struct db_full_path pathp 
)

Definition at line 91 of file joint.c.

References arc::arc, arc::arc_last, bu_free(), BU_LIST_FOR, BU_STR_EQUAL, bu_vls_printf(), DB_FULL_PATH_GET, db_path_to_string(), DEBUG_J_MESH, db_full_path::fp_len, ged::ged_result_str, joint::name, and joint::path.

Referenced by mesh_leaf().

Here is the call graph for this function:

HIDDEN union tree* mesh_leaf ( struct db_tree_state tsp,
const struct db_full_path pathp,
struct rt_db_internal ip,
void *  client_data 
)

Definition at line 141 of file joint.c.

References BU_ALLOC, BU_LIST_APPEND, BU_LIST_FOR, BU_LIST_INIT, DB_FULL_PATH_CUR_DIR, artic_grips::dir, findjoint(), artic_joints::head, ID_GRIP, rt_db_internal::idb_ptr, artic_joints::joint, artic_joints::l, artic_grips::l, bu_list::magic, MAGIC_A_GRIP, MAGIC_A_JOINT, OP_NOP, OP_SOLID, RT_CK_DB_INTERNAL, RT_CK_FULL_PATH, RT_TREE_INIT, TREE_NULL, and artic_grips::vert.

Here is the call graph for this function:

HIDDEN union tree* mesh_end_region ( struct db_tree_state tsp,
const struct db_full_path pathp,
union tree curtree,
void *  client_data 
)

Definition at line 197 of file joint.c.

HIDDEN int helpcomm ( struct ged gedp,
int  argc,
const char *  argv[],
struct funtab functions 
)

Common code for help commands

Definition at line 333 of file joint.c.

References BU_STR_EQUAL, bu_vls_printf(), funtab::ft_comment, funtab::ft_name, funtab::ft_parms, GED_ERROR, GED_OK, and ged::ged_result_str.

Here is the call graph for this function:

int get_token ( struct ged gedp,
union bu_lex_token token,
FILE *  fip,
struct bu_vls str,
struct bu_lex_key keys,
struct bu_lex_key syms 
)
int ged_joint ( struct ged gedp,
int  argc,
const char *  argv[] 
)

Joint command ported to the libged library.

Definition at line 3520 of file joint.c.

References bu_vls_trunc(), GED_CHECK_ARGC_GT_0, GED_CHECK_DATABASE_OPEN, GED_ERROR, GED_OK, ged::ged_result_str, and joint_tab.

Here is the call graph for this function:

Variable Documentation

struct funtab joint_tab

Definition at line 3543 of file joint.c.

Referenced by ged_joint().

struct bu_list artic_head
Initial value:
= {
&artic_head, &artic_head
}
struct bu_list artic_head
Definition: joint.c:72
#define BU_LIST_HEAD_MAGIC
Definition: magic.h:56

Definition at line 72 of file joint.c.

struct bu_list joint_head
Initial value:
= {
&joint_head, &joint_head
}
struct bu_list joint_head
Definition: joint.c:78
#define BU_LIST_HEAD_MAGIC
Definition: magic.h:56

Definition at line 78 of file joint.c.

struct bu_list hold_head
Initial value:
= {
&hold_head, &hold_head
}
struct bu_list hold_head
Definition: joint.c:84
#define BU_LIST_HEAD_MAGIC
Definition: magic.h:56

Definition at line 84 of file joint.c.

struct bu_list solve_head
Initial value:
= {
&solve_head
}
struct bu_list solve_head
Definition: joint.c:2595
#define BU_LIST_HEAD_MAGIC
Definition: magic.h:56

Definition at line 2595 of file joint.c.