BRL-CAD
sh_stxt.c File Reference
#include "common.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "vmath.h"
#include "raytrace.h"
#include "optical.h"
Include dependency graph for sh_stxt.c:

Go to the source code of this file.

Data Structures

struct  stxt_specific
 

Macros

#define STX_NAME_LEN   128
 
#define STXT_MAGIC   0xfeedbaad
 
#define SOL_NULL   ((struct stxt_specific *)0)
 
#define SOL_O(m)   bu_offsetof(struct stxt_specific, m)
 

Functions

HIDDEN int stxt_setup (register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
 
HIDDEN int brick_render (struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 
HIDDEN int mbound_render (struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 
HIDDEN int rbound_render (struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
 
HIDDEN void stxt_print (register struct region *rp, void *dp)
 
HIDDEN void stxt_free (void *cp)
 
HIDDEN void stxt_transp_hook (const struct bu_structparse *, const char *, void *, const char *, void *)
 
HIDDEN int stxt_read (register struct stxt_specific *stp)
 

Variables

struct bu_structparse stxt_parse []
 
struct mfuncs stxt_mfuncs []
 

Detailed Description

Routines to implement solid (i.e., 3-D) texture maps.

XXX Solid texturing is still preliminary.

Definition in file sh_stxt.c.

Macro Definition Documentation

#define STX_NAME_LEN   128

Definition at line 50 of file sh_stxt.c.

#define STXT_MAGIC   0xfeedbaad

Definition at line 64 of file sh_stxt.c.

Referenced by brick_render(), mbound_render(), rbound_render(), stxt_free(), and stxt_setup().

#define SOL_NULL   ((struct stxt_specific *)0)

Definition at line 65 of file sh_stxt.c.

#define SOL_O (   m)    bu_offsetof(struct stxt_specific, m)

Definition at line 66 of file sh_stxt.c.

Function Documentation

HIDDEN int stxt_setup ( register struct region rp,
struct bu_vls matparm,
void **  dpp,
const struct mfuncs *  mfp,
struct rt_i rtip 
)

Set up defaults

Get input values

Defaults to an orthogonal projection??

Read in texture file/s

Definition at line 165 of file sh_stxt.c.

References BU_GET, BU_PUT, bu_struct_parse(), region::reg_transmit, region::reg_treetop, rt_bound_tree(), stxt_specific::stx_d, stxt_specific::stx_file, stxt_specific::stx_fw, stxt_specific::stx_magic, stxt_specific::stx_max, stxt_specific::stx_min, stxt_specific::stx_n, stxt_specific::stx_pixels, stxt_specific::stx_w, STXT_MAGIC, stxt_read(), and stxt_specific::trans_valid.

Here is the call graph for this function:

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

Local Coordinate Axis

Definition at line 225 of file sh_stxt.c.

References bu_log(), if(), stxt_specific::stx_d, stxt_specific::stx_file, stxt_specific::stx_magic, stxt_specific::stx_n, stxt_specific::stx_pixels, stxt_specific::stx_w, STXT_MAGIC, stxt_read(), and VSET.

Here is the call graph for this function:

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

Definition at line 387 of file sh_stxt.c.

References application::a_rt_i, bu_log(), rt_i::mdl_max, rt_i::mdl_min, stxt_specific::stx_d, stxt_specific::stx_file, stxt_specific::stx_magic, stxt_specific::stx_n, stxt_specific::stx_pixels, stxt_specific::stx_w, STXT_MAGIC, stxt_read(), and VSET.

Here is the call graph for this function:

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

Definition at line 318 of file sh_stxt.c.

References bu_log(), stxt_specific::stx_d, stxt_specific::stx_file, stxt_specific::stx_magic, stxt_specific::stx_max, stxt_specific::stx_min, stxt_specific::stx_n, stxt_specific::stx_pixels, stxt_specific::stx_w, STXT_MAGIC, stxt_read(), and VSET.

Here is the call graph for this function:

HIDDEN void stxt_print ( register struct region rp,
void *  dp 
)

Definition at line 218 of file sh_stxt.c.

References bu_struct_print(), and region::reg_name.

Here is the call graph for this function:

HIDDEN void stxt_free ( void *  cp)

Definition at line 204 of file sh_stxt.c.

References bu_free(), bu_log(), BU_PUT, stxt_specific::stx_magic, stxt_specific::stx_pixels, and STXT_MAGIC.

Here is the call graph for this function:

HIDDEN void stxt_transp_hook ( const struct bu_structparse ptab,
const char *  name,
void *  cp,
const char *  value,
void *  data 
)

Definition at line 92 of file sh_stxt.c.

References bu_log(), BU_STR_EQUAL, stxt_parse, and stxt_specific::trans_valid.

Here is the call graph for this function:

HIDDEN int stxt_read ( register struct stxt_specific stp)

Definition at line 115 of file sh_stxt.c.

References bu_free(), bu_log(), bu_malloc(), stxt_specific::stx_d, stxt_specific::stx_file, stxt_specific::stx_fw, stxt_specific::stx_n, stxt_specific::stx_pixels, and stxt_specific::stx_w.

Referenced by brick_render(), mbound_render(), rbound_render(), and stxt_setup().

Here is the call graph for this function:

Variable Documentation

struct bu_structparse stxt_parse[]
Initial value:
= {
{"%d", 1, "transp", SOL_O(stx_transp), stxt_transp_hook, NULL, NULL },
{"%s", STX_NAME_LEN, "file", SOL_O(stx_file), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "w", SOL_O(stx_w), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "n", SOL_O(stx_n), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "d", SOL_O(stx_d), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "fw", SOL_O(stx_fw), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "trans_valid", SOL_O(trans_valid), BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"", 0, (char *)0, 0, BU_STRUCTPARSE_FUNC_NULL, NULL, NULL }
}
#define SOL_O(m)
Definition: sh_stxt.c:66
HIDDEN void stxt_transp_hook(const struct bu_structparse *, const char *, void *, const char *, void *)
Definition: sh_stxt.c:92
#define BU_STRUCTPARSE_FUNC_NULL
Definition: parse.h:153
#define STX_NAME_LEN
Definition: sh_stxt.c:50

Definition at line 68 of file sh_stxt.c.

Referenced by stxt_transp_hook().

struct mfuncs stxt_mfuncs[]
Initial value:
= {
{MF_MAGIC, "brick", 0, MFI_HIT, 0, stxt_setup, brick_render, stxt_print, stxt_free },
{MF_MAGIC, "mbound", 0, MFI_HIT, 0, stxt_setup, mbound_render, stxt_print, stxt_free },
{MF_MAGIC, "rbound", 0, MFI_HIT, 0, stxt_setup, rbound_render, stxt_print, stxt_free },
{0, (char *)0, 0, 0, 0, 0, 0, 0, 0 }
}
HIDDEN int rbound_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
Definition: sh_stxt.c:318
#define MF_MAGIC
Definition: magic.h:205
HIDDEN int brick_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
Definition: sh_stxt.c:225
HIDDEN void stxt_free(void *cp)
Definition: sh_stxt.c:204
HIDDEN int mbound_render(struct application *ap, const struct partition *pp, struct shadework *swp, void *dp)
Definition: sh_stxt.c:387
HIDDEN void stxt_print(register struct region *rp, void *dp)
Definition: sh_stxt.c:218
HIDDEN int stxt_setup(register struct region *rp, struct bu_vls *matparm, void **dpp, const struct mfuncs *mfp, struct rt_i *rtip)
Definition: sh_stxt.c:165

Definition at line 80 of file sh_stxt.c.

Referenced by optical_shader_init().