BRL-CAD
sh_billboard.c File Reference
#include "common.h"
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "bu/sort.h"
#include "vmath.h"
#include "raytrace.h"
#include "rtgeom.h"
#include "optical.h"
#include "plot3.h"
Include dependency graph for sh_billboard.c:

Go to the source code of this file.

Data Structures

struct  bbd_img
 
struct  bbd_specific
 
struct  imgdist
 

Macros

#define bbd_MAGIC   0x62626400 /* "bbd" */
 
#define CK_bbd_SP(_p)   BU_CKMAG(_p, bbd_MAGIC, "bbd_specific")
 
#define MAX_IMAGES   64
 
#define SHDR_NULL   ((struct bbd_specific *)0)
 
#define SHDR_O(m)   bu_offsetof(struct bbd_specific, m)
 

Functions

void new_image (const struct bu_structparse *, const char *, void *, const char *, void *)
 
HIDDEN int bbd_setup (struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN void bbd_print (struct region *rp, void *dp)
 
HIDDEN void bbd_free (void *cp)
 
int imgdist_compare (const void *a, const void *b, void *arg)
 
int bbd_render (struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 

Variables

struct bu_structparse bbd_print_tab []
 
struct bu_structparse bbd_parse_tab []
 
struct mfuncs bbd_mfuncs []
 

Detailed Description

A billboard shader for use with RCC geometry

6) Edit shaders.tcl and comb.tcl in the ../tclscripts/mged directory to add a new gui for this shader.

Definition in file sh_billboard.c.

Macro Definition Documentation

#define bbd_MAGIC   0x62626400 /* "bbd" */

Definition at line 44 of file sh_billboard.c.

#define CK_bbd_SP (   _p)    BU_CKMAG(_p, bbd_MAGIC, "bbd_specific")

Definition at line 45 of file sh_billboard.c.

Referenced by bbd_render().

#define MAX_IMAGES   64

Definition at line 82 of file sh_billboard.c.

Referenced by bbd_setup().

#define SHDR_NULL   ((struct bbd_specific *)0)

Definition at line 100 of file sh_billboard.c.

#define SHDR_O (   m)    bu_offsetof(struct bbd_specific, m)

Definition at line 101 of file sh_billboard.c.

Function Documentation

void new_image ( const struct bu_structparse sdp,
const char *  name,
void *  base,
const char *  value,
void *  data 
)

Definition at line 126 of file sh_billboard.c.

References BU_ALLOC, bu_bomb(), BU_CK_MAPPED_FILE, BU_LIST_APPEND, bu_log(), bu_open_mapped_file_with_path(), bu_vls_addr(), db_i::dbi_filepath, bbd_specific::img_count, bbd_specific::img_filename, bbd_specific::img_height, bbd_img::img_mf, bbd_img::img_width, bbd_specific::img_width, bbd_specific::imgs, bbd_img::l, rt_i::rti_dbip, and bbd_specific::rtip.

Here is the call graph for this function:

HIDDEN void bbd_print ( struct region rp,
void *  dp 
)

Definition at line 294 of file sh_billboard.c.

References bu_struct_print(), and region::reg_name.

Here is the call graph for this function:

HIDDEN void bbd_free ( void *  cp)

Definition at line 301 of file sh_billboard.c.

References BU_PUT.

int imgdist_compare ( const void *  a,
const void *  b,
void *  arg 
)

Definition at line 495 of file sh_billboard.c.

Referenced by bbd_render().

int bbd_render ( struct application ap,
const struct partition pp,
struct shadework *  swp,
void *  dp 
)

Variable Documentation

struct bu_structparse bbd_print_tab[]
Initial value:
= {
{"%ld", 1, "w", SHDR_O(img_width), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%ld", 1, "n", SHDR_O(img_height), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "t", SHDR_O(img_threshold), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%g", 1, "h", SHDR_O(img_scale), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%V", 1, "f", SHDR_O(img_filename), new_image, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
#define SHDR_O(m)
Definition: sh_billboard.c:101
void new_image(const struct bu_structparse *, const char *, void *, const char *, void *)
Definition: sh_billboard.c:126

Definition at line 111 of file sh_billboard.c.

struct bu_structparse bbd_parse_tab[]
Initial value:
= {
{"%p", 1, "bbd_print_tab", bu_byteoffset(bbd_print_tab[0]), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
struct bu_structparse bbd_print_tab[]
Definition: sh_billboard.c:111
#define bu_byteoffset(_i)
Definition: parse.h:81
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153

Definition at line 119 of file sh_billboard.c.

struct mfuncs bbd_mfuncs[]
Initial value:
= {
{MF_MAGIC, "bbd", 0, MFI_NORMAL|MFI_HIT|MFI_UV, 0,
{0, (char *)0, 0, 0, 0,
0, 0, 0, 0 }
}
#define MF_MAGIC
Definition: magic.h:205
HIDDEN void bbd_free(void *cp)
Definition: sh_billboard.c:301
HIDDEN int bbd_setup(struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
Definition: sh_billboard.c:169
int bbd_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
Definition: sh_billboard.c:509
HIDDEN void bbd_print(struct region *rp, void *dp)
Definition: sh_billboard.c:294

Definition at line 585 of file sh_billboard.c.

Referenced by optical_shader_init().