BRL-CAD
Loading...
Searching...
No Matches

Utility routines for manipulating libbv data structures. More...

Collaboration diagram for Utilities:

Files

file  util.h
 
file  view_sets.h
 

Macros

#define BV_AUTOVIEW_SCALE_DEFAULT   -1
 
#define BV_KNOBS_ALL   0
 
#define BV_KNOBS_RATE   1
 
#define BV_KNOBS_ABS   2
 
#define BV_IDLE   0x000
 
#define BV_ROT   0x001
 
#define BV_TRANS   0x002
 
#define BV_SCALE   0x004
 
#define BV_CENTER   0x008
 
#define BV_CON_X   0x010
 
#define BV_CON_Y   0x020
 
#define BV_CON_Z   0x040
 
#define BV_CON_GRID   0x080
 
#define BV_CON_LINES   0x100
 
#define BV_ENABLE_ENV_LOGGING   1
 

Functions

void bv_init (struct bview *v, struct bview_set *s)
 
void bv_free (struct bview *v)
 
void bv_mat_aet (struct bview *v)
 
void bv_settings_init (struct bview_settings *s)
 
void bv_autoview (struct bview *v, fastf_t scale, int all_view_objs)
 
void bv_sync (struct bview *dest, struct bview *src)
 
int bv_obj_settings_sync (struct bv_obj_settings *dest, struct bv_obj_settings *src)
 
void bv_update (struct bview *gvp)
 
int bv_update_selected (struct bview *gvp)
 
void bv_knobs_reset (struct bview_knobs *k, int category)
 
int bv_knobs_cmd_process (vect_t *rvec, int *do_rot, vect_t *tvec, int *do_tran, struct bview *v, const char *cmd, fastf_t f, char origin, int model_flag, int incr_flag)
 Process an individual libbv knob command.
 
void bv_knobs_rot (struct bview *v, vect_t *rvec, char origin, int model_flag)
 
void bv_knobs_tran (struct bview *v, vect_t *tvec, int model_flag)
 
void bv_update_rate_flags (struct bview *v)
 
int bv_differ (struct bview *v1, struct bview *v2)
 
unsigned long long bv_hash (struct bview *v)
 
unsigned long long bv_dl_hash (struct display_list *dl)
 
size_t bv_clear (struct bview *v, int flags)
 
int bv_adjust (struct bview *v, int dx, int dy, point_t keypoint, int mode, unsigned long long flags)
 
int bv_screen_to_view (struct bview *v, fastf_t *fx, fastf_t *fy, fastf_t x, fastf_t y)
 
int bv_screen_pt (point_t *p, fastf_t x, fastf_t y, struct bview *v)
 
int bv_scene_obj_bound (struct bv_scene_obj *s, struct bview *v)
 
fastf_t bv_vZ_calc (struct bv_scene_obj *s, struct bview *v, int mode)
 
void bv_obj_sync (struct bv_scene_obj *dest, struct bv_scene_obj *src)
 
void bv_obj_stale (struct bv_scene_obj *s)
 
struct bv_scene_objbv_obj_create (struct bview *v, int type)
 
struct bv_scene_objbv_obj_get (struct bview *v, int type)
 
struct bv_scene_objbv_obj_get_child (struct bv_scene_obj *s)
 
void bv_obj_reset (struct bv_scene_obj *s)
 
void bv_obj_put (struct bv_scene_obj *o)
 
struct bv_scene_objbv_find_child (struct bv_scene_obj *s, const char *vname)
 
struct bv_scene_objbv_find_obj (struct bview *v, const char *vname)
 
void bv_uniq_obj_name (struct bu_vls *oname, const char *seed, struct bview *v)
 
struct bv_scene_objbv_obj_for_view (struct bv_scene_obj *s, struct bview *v)
 
struct bv_scene_objbv_obj_get_vo (struct bv_scene_obj *s, struct bview *v)
 
int bv_obj_have_vo (struct bv_scene_obj *s, struct bview *v)
 
int bv_clear_view_obj (struct bv_scene_obj *s, struct bview *v)
 
int bv_illum_obj (struct bv_scene_obj *s, char ill_state)
 
struct bu_ptblbv_view_objs (struct bview *v, int type)
 
int bv_view_plane (plane_t *p, struct bview *v)
 
void bv_log (int level, const char *fmt,...) _BU_ATTR_PRINTF23
 
void bv_view_print (const char *title, struct bview *v, int verbosity)
 
void bv_set_init (struct bview_set *s)
 
void bv_set_free (struct bview_set *s)
 
void bv_set_add_view (struct bview_set *s, struct bview *v)
 
void bv_set_rm_view (struct bview_set *s, struct bview *v)
 
struct bu_ptblbv_set_views (struct bview_set *s)
 
struct bviewbv_set_find_view (struct bview_set *s, const char *vname)
 
struct bv_scene_objbv_set_fsos (struct bview_set *s)
 

Detailed Description

Utility routines for manipulating libbv data structures.

In applications with multiple views, those views typically share common scene objects and memory. To manage this sharing, we define view sets.

Macro Definition Documentation

◆ BV_AUTOVIEW_SCALE_DEFAULT

#define BV_AUTOVIEW_SCALE_DEFAULT   -1

Definition at line 51 of file util.h.

◆ BV_KNOBS_ALL

#define BV_KNOBS_ALL   0

Definition at line 78 of file util.h.

◆ BV_KNOBS_RATE

#define BV_KNOBS_RATE   1

Definition at line 79 of file util.h.

◆ BV_KNOBS_ABS

#define BV_KNOBS_ABS   2

Definition at line 80 of file util.h.

◆ BV_IDLE

#define BV_IDLE   0x000

Definition at line 166 of file util.h.

◆ BV_ROT

#define BV_ROT   0x001

Definition at line 167 of file util.h.

◆ BV_TRANS

#define BV_TRANS   0x002

Definition at line 168 of file util.h.

◆ BV_SCALE

#define BV_SCALE   0x004

Definition at line 169 of file util.h.

◆ BV_CENTER

#define BV_CENTER   0x008

Definition at line 170 of file util.h.

◆ BV_CON_X

#define BV_CON_X   0x010

Definition at line 171 of file util.h.

◆ BV_CON_Y

#define BV_CON_Y   0x020

Definition at line 172 of file util.h.

◆ BV_CON_Z

#define BV_CON_Z   0x040

Definition at line 173 of file util.h.

◆ BV_CON_GRID

#define BV_CON_GRID   0x080

Definition at line 174 of file util.h.

◆ BV_CON_LINES

#define BV_CON_LINES   0x100

Definition at line 175 of file util.h.

◆ BV_ENABLE_ENV_LOGGING

#define BV_ENABLE_ENV_LOGGING   1

Definition at line 313 of file util.h.

Function Documentation

◆ bv_init()

void bv_init ( struct bview v,
struct bview_set s 
)
extern

◆ bv_free()

void bv_free ( struct bview v)
extern

◆ bv_mat_aet()

void bv_mat_aet ( struct bview v)
Todo:
this routine is suspect and needs investigating. if run during view initialization, the shaders regression test fails.

◆ bv_settings_init()

void bv_settings_init ( struct bview_settings s)
extern

◆ bv_autoview()

void bv_autoview ( struct bview v,
fastf_t  scale,
int  all_view_objs 
)
extern

Automatically set up the view to make the scene objects visible

◆ bv_sync()

void bv_sync ( struct bview dest,
struct bview src 
)
extern

◆ bv_obj_settings_sync()

int bv_obj_settings_sync ( struct bv_obj_settings dest,
struct bv_obj_settings src 
)
extern

◆ bv_update()

void bv_update ( struct bview gvp)
extern

◆ bv_update_selected()

int bv_update_selected ( struct bview gvp)
extern

◆ bv_knobs_reset()

void bv_knobs_reset ( struct bview_knobs k,
int  category 
)
extern

◆ bv_knobs_cmd_process()

int bv_knobs_cmd_process ( vect_t rvec,
int *  do_rot,
vect_t tvec,
int *  do_tran,
struct bview v,
const char cmd,
fastf_t  f,
char  origin,
int  model_flag,
int  incr_flag 
)
extern

Process an individual libbv knob command.

Note that the reason rvec, do_rot, tvec and do_tran are set, rather than an immediate view update being performed, is to allow parent applications to process multiple commands before finally triggering the bv_knobs_rot or bv_knobs_tran functions to implement the accumulated instructions.

Parameters
[out]rvecPointer to rotation vector
[out]do_rotPointer to flag indicating whether the command implies a rotation op is needed
[out]tvecPointer to translation vector
[out]do_tranPointer to flag indicating whether the command implies a translation op is needed
[in]vbview structure
[in]cmdcommand string - valid entries are x, y, z, X, Y Z, ax, ay, az, aX, aY, aZ, S, aS
[in]fnumerical parameter to cmd (i.e. aX 0.1 - required for all commands)
[in]originchar indicating origin - may be 'e' (eye_pt), 'm' (model origin) or 'v' (view origin - default)
[in]model_flagManipulate view using model coordinates rather than view coordinates
[in]incr_flagTreat f parameter as an incremental change rather than an absolute setting
Returns
Returns BRLCAD_OK if command was successfully processed, BRLCAD_ERROR otherwise.

◆ bv_knobs_rot()

void bv_knobs_rot ( struct bview v,
vect_t rvec,
char  origin,
int  model_flag 
)
extern

◆ bv_knobs_tran()

void bv_knobs_tran ( struct bview v,
vect_t tvec,
int  model_flag 
)
extern

◆ bv_update_rate_flags()

void bv_update_rate_flags ( struct bview v)
extern

◆ bv_differ()

int bv_differ ( struct bview v1,
struct bview v2 
)
extern

◆ bv_hash()

unsigned long long bv_hash ( struct bview v)
extern

◆ bv_dl_hash()

unsigned long long bv_dl_hash ( struct display_list dl)
extern

◆ bv_clear()

size_t bv_clear ( struct bview v,
int  flags 
)
extern

◆ bv_adjust()

int bv_adjust ( struct bview v,
int  dx,
int  dy,
point_t  keypoint,
int  mode,
unsigned long long  flags 
)
extern

◆ bv_screen_to_view()

int bv_screen_to_view ( struct bview v,
fastf_t fx,
fastf_t fy,
fastf_t  x,
fastf_t  y 
)
extern

◆ bv_screen_pt()

int bv_screen_pt ( point_t p,
fastf_t  x,
fastf_t  y,
struct bview v 
)
extern

◆ bv_scene_obj_bound()

int bv_scene_obj_bound ( struct bv_scene_obj s,
struct bview v 
)
extern

◆ bv_vZ_calc()

fastf_t bv_vZ_calc ( struct bv_scene_obj s,
struct bview v,
int  mode 
)
extern

◆ bv_obj_sync()

void bv_obj_sync ( struct bv_scene_obj dest,
struct bv_scene_obj src 
)
extern

◆ bv_obj_stale()

void bv_obj_stale ( struct bv_scene_obj s)

◆ bv_obj_create()

struct bv_scene_obj * bv_obj_create ( struct bview v,
int  type 
)

◆ bv_obj_get()

struct bv_scene_obj * bv_obj_get ( struct bview v,
int  type 
)

◆ bv_obj_get_child()

struct bv_scene_obj * bv_obj_get_child ( struct bv_scene_obj s)

◆ bv_obj_reset()

void bv_obj_reset ( struct bv_scene_obj s)

◆ bv_obj_put()

void bv_obj_put ( struct bv_scene_obj o)

◆ bv_find_child()

struct bv_scene_obj * bv_find_child ( struct bv_scene_obj s,
const char vname 
)

◆ bv_find_obj()

struct bv_scene_obj * bv_find_obj ( struct bview v,
const char vname 
)

◆ bv_uniq_obj_name()

void bv_uniq_obj_name ( struct bu_vls oname,
const char seed,
struct bview v 
)

◆ bv_obj_for_view()

struct bv_scene_obj * bv_obj_for_view ( struct bv_scene_obj s,
struct bview v 
)

◆ bv_obj_get_vo()

struct bv_scene_obj * bv_obj_get_vo ( struct bv_scene_obj s,
struct bview v 
)

◆ bv_obj_have_vo()

int bv_obj_have_vo ( struct bv_scene_obj s,
struct bview v 
)

◆ bv_clear_view_obj()

int bv_clear_view_obj ( struct bv_scene_obj s,
struct bview v 
)

◆ bv_illum_obj()

int bv_illum_obj ( struct bv_scene_obj s,
char  ill_state 
)

◆ bv_view_objs()

struct bu_ptbl * bv_view_objs ( struct bview v,
int  type 
)

◆ bv_view_plane()

int bv_view_plane ( plane_t p,
struct bview v 
)

◆ bv_log()

void bv_log ( int  level,
const char fmt,
  ... 
)

◆ bv_view_print()

void bv_view_print ( const char title,
struct bview v,
int  verbosity 
)

◆ bv_set_init()

void bv_set_init ( struct bview_set s)

Initialize an empty view set

◆ bv_set_free()

void bv_set_free ( struct bview_set s)

Free view set

◆ bv_set_add_view()

void bv_set_add_view ( struct bview_set s,
struct bview v 
)

Add view v to set s, handling shared memory assignments.

◆ bv_set_rm_view()

void bv_set_rm_view ( struct bview_set s,
struct bview v 
)

Remove view v from set s. If v == NULL, all views are removed from the set.

◆ bv_set_views()

struct bu_ptbl * bv_set_views ( struct bview_set s)

Return a bu_ptbl holding pointers to all views in set s

◆ bv_set_find_view()

struct bview * bv_set_find_view ( struct bview_set s,
const char vname 
)

Return a pointer to the view with name vname, if it is present in s. If not found, returns NULL

◆ bv_set_fsos()

struct bv_scene_obj * bv_set_fsos ( struct bview_set s)