BRL-CAD
fastgen4_read.c File Reference
#include "common.h"
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include "bio.h"
#include "bu/debug.h"
#include "bu/getopt.h"
#include "db.h"
#include "vmath.h"
#include "nmg.h"
#include "rtgeom.h"
#include "raytrace.h"
#include "wdb.h"
#include "plot3.h"
#include "../../plugin.h"
Include dependency graph for fastgen4_read.c:

Go to the source code of this file.

Data Structures

struct  fast4_color
 
struct  cline
 
struct  name_tree
 
struct  compsplt
 
struct  hole_list
 
struct  holes
 

Macros

#define MK_REGION(fp, headp, name, r_id, rgb)
 
#define PUSH(ptr)   bu_ptbl_ins(&stack, (long *)ptr)
 
#define POP(structure, ptr)
 
#define PUSH2(ptr)   bu_ptbl_ins(&stack2, (long *)ptr)
 
#define POP2(structure, ptr)
 
#define NAME_TREE_MAGIC   0x55555555
 
#define CK_TREE_MAGIC(ptr)
 
#define PLATE_MODE   1
 
#define VOLUME_MODE   2
 
#define POS_CENTER   1 /* face positions for facets */
 
#define POS_FRONT   2
 
#define END_OPEN   1 /* End closure codes for cones */
 
#define END_CLOSED   2
 
#define GRID_BLOCK   256 /* allocate space for grid points in blocks of 256 points */
 
#define CLINE   'l'
 
#define CHEX1   'p'
 
#define CHEX2   'b'
 
#define CTRI   't'
 
#define CQUAD   'q'
 
#define CCONE1   'c'
 
#define CCONE2   'd'
 
#define CCONE3   'e'
 
#define CSPHERE   's'
 
#define NMG   'n'
 
#define BOT   't'
 
#define COMPSPLT   'h'
 
#define HOLE   1
 
#define WALL   2
 
#define INT_LIST_BLOCK   256 /* Number of int_list array slots to allocate */
 
#define MAX_LINE_SIZE   128 /* Length of char array for input line */
 
#define REGION_LIST_BLOCK   256 /* initial length of array of region ids to process */
 
#define COLOR_LINE_LEN   256
 

Functions

int gcv_fastgen4_read (const char *path, struct rt_wdb *wdbp, const struct gcv_opts *options)
 

Variables

struct clinecline_root
 
struct name_treename_root
 
struct compspltcompsplt_root
 
struct holeshole_root
 
const struct gcv_plugin_info gcv_plugin_conv_fastgen4_read = {converters}
 

Macro Definition Documentation

#define MK_REGION (   fp,
  headp,
  name,
  r_id,
  rgb 
)
Value:
{\
if (mode == 1) {\
if (!quiet)\
bu_log("Making region: %s (PLATE)\n", name); \
mk_comb(fp, name, &((headp)->l), 'P', (char *)NULL, (char *)NULL, rgb, r_id, 0, 1, 100, 0, 0, 0); \
} else if (mode == 2) {\
if (!quiet) \
bu_log("Making region: %s (VOLUME)\n", name); \
mk_comb(fp, name, &((headp)->l), 'V', (char *)NULL, (char *)NULL, rgb, r_id, 0, 1, 100, 0, 0, 0); \
} else {\
bu_log("Illegal mode (%d), while trying to make region (%s)\n", mode, name);\
bu_log("\tRegion not made!\n");\
}\
}
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
Definition: clone.c:90
if(share_geom)
Definition: nmg_mod.c:3829
int mk_comb(struct rt_wdb *wdbp, const char *combname, struct bu_list *headp, int region_kind, const char *shadername, const char *shaderargs, const unsigned char *rgb, int id, int air, int material, int los, int inherit, int append_ok, int gift_semantics)
Definition: reg.c:230

Definition at line 51 of file fastgen4_read.c.

#define PUSH (   ptr)    bu_ptbl_ins(&stack, (long *)ptr)

Definition at line 67 of file fastgen4_read.c.

Referenced by KeyHandler::handle().

#define POP (   structure,
  ptr 
)
Value:
{ \
if (BU_PTBL_END(&stack) == 0) \
ptr = (struct structure *)NULL; \
else { \
ptr = (struct structure *)BU_PTBL_GET(&stack, BU_PTBL_END(&stack)-1); \
bu_ptbl_rm(&stack, (long *)ptr); \
} \
}
int bu_ptbl_rm(struct bu_ptbl *b, const long *p)
if(share_geom)
Definition: nmg_mod.c:3829
#define BU_PTBL_GET(ptbl, i)
Definition: ptbl.h:108
#define BU_PTBL_END(ptbl)
Definition: ptbl.h:106
else
Definition: nmg_mod.c:3872

Definition at line 68 of file fastgen4_read.c.

#define PUSH2 (   ptr)    bu_ptbl_ins(&stack2, (long *)ptr)

Definition at line 76 of file fastgen4_read.c.

#define POP2 (   structure,
  ptr 
)
Value:
{ \
if (BU_PTBL_END(&stack2) == 0) \
ptr = (struct structure *)NULL; \
else { \
ptr = (struct structure *)BU_PTBL_GET(&stack2, BU_PTBL_END(&stack2)-1); \
bu_ptbl_rm(&stack2, (long *)ptr); \
} \
}
int bu_ptbl_rm(struct bu_ptbl *b, const long *p)
if(share_geom)
Definition: nmg_mod.c:3829
#define BU_PTBL_GET(ptbl, i)
Definition: ptbl.h:108
#define BU_PTBL_END(ptbl)
Definition: ptbl.h:106
else
Definition: nmg_mod.c:3872

Definition at line 77 of file fastgen4_read.c.

#define NAME_TREE_MAGIC   0x55555555

Definition at line 87 of file fastgen4_read.c.

#define CK_TREE_MAGIC (   ptr)
Value:
{\
if (!ptr)\
bu_log("ERROR: Null name_tree pointer, file=%s, line=%d\n", __FILE__, __LINE__);\
else if (ptr->magic != NAME_TREE_MAGIC)\
bu_log("ERROR: bad name_tree pointer (%p), file=%s, line=%d\n", (void *)ptr, __FILE__, __LINE__);\
}
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
if(share_geom)
Definition: nmg_mod.c:3829
else
Definition: nmg_mod.c:3872
#define NAME_TREE_MAGIC
Definition: fastgen4_read.c:87

Definition at line 88 of file fastgen4_read.c.

#define PLATE_MODE   1

Definition at line 96 of file fastgen4_read.c.

#define VOLUME_MODE   2

Definition at line 97 of file fastgen4_read.c.

#define POS_CENTER   1 /* face positions for facets */

Definition at line 99 of file fastgen4_read.c.

#define POS_FRONT   2

Definition at line 100 of file fastgen4_read.c.

#define END_OPEN   1 /* End closure codes for cones */

Definition at line 102 of file fastgen4_read.c.

#define END_CLOSED   2

Definition at line 103 of file fastgen4_read.c.

#define GRID_BLOCK   256 /* allocate space for grid points in blocks of 256 points */

Definition at line 105 of file fastgen4_read.c.

Referenced by gcv_fastgen4_read().

#define CLINE   'l'

Definition at line 107 of file fastgen4_read.c.

#define CHEX1   'p'

Definition at line 108 of file fastgen4_read.c.

#define CHEX2   'b'

Definition at line 109 of file fastgen4_read.c.

#define CTRI   't'

Definition at line 110 of file fastgen4_read.c.

#define CQUAD   'q'

Definition at line 111 of file fastgen4_read.c.

#define CCONE1   'c'

Definition at line 112 of file fastgen4_read.c.

#define CCONE2   'd'

Definition at line 113 of file fastgen4_read.c.

#define CCONE3   'e'

Definition at line 114 of file fastgen4_read.c.

#define CSPHERE   's'

Definition at line 115 of file fastgen4_read.c.

#define NMG   'n'

Definition at line 116 of file fastgen4_read.c.

#define BOT   't'

Definition at line 117 of file fastgen4_read.c.

#define COMPSPLT   'h'

Definition at line 118 of file fastgen4_read.c.

#define HOLE   1

Definition at line 120 of file fastgen4_read.c.

#define WALL   2

Definition at line 121 of file fastgen4_read.c.

#define INT_LIST_BLOCK   256 /* Number of int_list array slots to allocate */

Definition at line 122 of file fastgen4_read.c.

#define MAX_LINE_SIZE   128 /* Length of char array for input line */

Definition at line 123 of file fastgen4_read.c.

#define REGION_LIST_BLOCK   256 /* initial length of array of region ids to process */

Definition at line 124 of file fastgen4_read.c.

#define COLOR_LINE_LEN   256

Definition at line 2677 of file fastgen4_read.c.

Function Documentation

int gcv_fastgen4_read ( const char *  path,
struct rt_wdb wdbp,
const struct gcv_opts options 
)

Definition at line 2720 of file fastgen4_read.c.

References bu_debug, bu_free(), BU_LIST_INIT, bu_log(), bu_malloc(), bu_printb(), bu_ptbl_init(), cline_root, compsplt_root, DEBUG_FORMAT, GRID_BLOCK, hole_root, wmember::l, fast4_color::l, mk_id_units(), name_root, rt_g::NMG_debug, RTG, and SQRT_SMALL_FASTF.

Here is the call graph for this function:

Variable Documentation

struct cline * cline_root

Referenced by gcv_fastgen4_read().

struct name_tree * name_root

Referenced by gcv_fastgen4_read().

struct compsplt * compsplt_root

Referenced by gcv_fastgen4_read().

struct holes * hole_root

Referenced by gcv_fastgen4_read().

const struct gcv_plugin_info gcv_plugin_conv_fastgen4_read = {converters}

Definition at line 2827 of file fastgen4_read.c.