63 struct gmi_ent* (*next)(
struct gmi_model* m,
struct gmi_iter* i);
78 double const p[2],
double x[3]);
81 double const from_p[2],
struct gmi_ent* to,
double to_p[2]);
89 double const from[3],
double to[3],
double to_p[2]);
92 double const p[2],
double n[3]);
95 double const p[2],
double t0[3],
double t1[3]);
101 double bmin[3],
double bmax[3]);
120 typedef struct gmi_model* (*gmi_creator)(
const char* filename);
161 double const p[2],
double x[3]);
170 double const from_p[2],
struct gmi_ent* to,
double to_p[2]);
178 double const from[3],
double to[3],
double to_p[2]);
181 double const p[2],
double n[3]);
184 double const p[2],
double t0[3],
double t1[3]);
193 double bmin[3],
double bmax[3]);
228 void gmi_fail(
const char* why) __attribute__((noreturn));
235 void gmi_fscanf(FILE* f,
int n,
const char* format, ...);
237 int gmi_getline(
char** line,
size_t* cap, FILE* f);
238 int gmi_has_ext(
const char* filename,
const char* ext);
int gmi_dim(struct gmi_model *m, struct gmi_ent *e)
get the dimension of a model entity
void gmi_end(struct gmi_model *m, struct gmi_iter *i)
free an iterator
int(* is_in_closure_of)(struct gmi_model *m, struct gmi_ent *e, struct gmi_ent *et)
implement gmi_is_in_closure_of
void(* destroy)(struct gmi_model *m)
implement gmi_destroy
void gmi_fail(const char *why) __attribute__((noreturn))
print the message as a gmi failure and abort
int gmi_is_in_closure_of(struct gmi_model *m, struct gmi_ent *e, struct gmi_ent *et)
check if e is in the closure of et
int(* is_point_in_region)(struct gmi_model *m, struct gmi_ent *e, double p[3])
implement gmi_is_point_in_region
int gmi_tag(struct gmi_model *m, struct gmi_ent *e)
get the tag of a model entity
void(* closest_point)(struct gmi_model *m, struct gmi_ent *e, double const from[3], double to[3], double to_p[2])
implement gmi_closest_point
struct gmi_model_ops const * ops
pointer to interface definition
void gmi_destroy(struct gmi_model *m)
destroy a geometric model
int gmi_has_normal(struct gmi_model *m)
check whether the model implements gmi_normal
struct gmi_ent * e[1]
array of model entity pointers
int(* is_discrete_ent)(struct gmi_model *m, struct gmi_ent *e)
implement gmi_is_discrete_ent
void gmi_bbox(struct gmi_model *m, struct gmi_ent *e, double bmin[3], double bmax[3])
get the bounding box of model entity e
void gmi_register(gmi_creator f, const char *ext)
register a new geometric modeler
int gmi_can_get_closest_point(struct gmi_model *m)
check whether the model gmi_closest_point
void(* range)(struct gmi_model *m, struct gmi_ent *e, int dim, double r[2])
implement gmi_range
the basic structure for all GMI models
struct gmi_ent * gmi_next(struct gmi_model *m, struct gmi_iter *i)
dereference and then increment an interator
int gmi_is_discrete_ent(struct gmi_model *m, struct gmi_ent *e)
check if e is a discrete entity
void gmi_range(struct gmi_model *m, struct gmi_ent *e, int dim, double r[2])
return the range of parametric coordinates along this dimension
int(* tag)(struct gmi_model *m, struct gmi_ent *e)
implement gmi_tag
void gmi_first_derivative(struct gmi_model *m, struct gmi_ent *e, double const p[2], double t0[3], double t1[3])
return first derivative
struct gmi_model * gmi_load(const char *filename)
load a geometric model file
model interface definition
void(* end)(struct gmi_model *m, struct gmi_iter *i)
implement gmi_end
void(* normal)(struct gmi_model *m, struct gmi_ent *e, double const p[2], double n[3])
implement gmi_normal
int gmi_can_eval(struct gmi_model *m)
check whether the model implements gmi_eval
int n
number of model entities
int gmi_periodic(struct gmi_model *m, struct gmi_ent *e, int dim)
return true iff the model entity is periodic around this dimension
void gmi_normal(struct gmi_model *m, struct gmi_ent *e, double const p[2], double n[3])
return normal vector at a parameter
void(* bbox)(struct gmi_model *m, struct gmi_ent *e, double bmin[3], double bmax[3])
implement gmi_bbox
struct gmi_iter * gmi_begin(struct gmi_model *m, int dim)
begin an iterator over model entities of one dimension
void gmi_write_dmg(struct gmi_model *m, const char *filename)
write a dmg (meshmodel) file
void gmi_reparam(struct gmi_model *m, struct gmi_ent *from, double const from_p[2], struct gmi_ent *to, double to_p[2])
re-parameterize from one model entity to another
void(* reparam)(struct gmi_model *m, struct gmi_ent *from, double const from_p[2], struct gmi_ent *to, double to_p[2])
implement gmi_reparam
int n[4]
number of model entities per dimension
int(* dim)(struct gmi_model *m, struct gmi_ent *e)
implement gmi_dim
void gmi_free_set(struct gmi_set *s)
free a gmi_set
struct gmi_set * gmi_adjacent(struct gmi_model *m, struct gmi_ent *e, int dim)
query model entity adjacencies
void(* first_derivative)(struct gmi_model *m, struct gmi_ent *e, double const p[2], double t0[3], double t1[3])
implement gmi_first_derivative
void gmi_eval(struct gmi_model *m, struct gmi_ent *e, double const p[2], double x[3])
evaluate the parametric definition of a model boundary entity
struct gmi_ent * gmi_find(struct gmi_model *m, int dim, int tag)
lookup a model entity by dimension and tag
struct gmi_model *(* gmi_creator)(const char *filename)
model from file constructor, give to gmi_register
void(* eval)(struct gmi_model *m, struct gmi_ent *e, double const p[2], double x[3])
implement gmi_eval
struct gmi_set * gmi_make_set(int n)
allocate a gmi_set with (n) elements
void gmi_fscanf(FILE *f, int n, const char *format,...)
fscanf wrapper that checks return values
void gmi_closest_point(struct gmi_model *m, struct gmi_ent *e, double const from[3], double to[3], double to_p[2])
return closest point and its parameter
int(* periodic)(struct gmi_model *m, struct gmi_ent *e, int dim)
implement gmi_periodic
int gmi_is_point_in_region(struct gmi_model *m, struct gmi_ent *e, double point[3])
check if point is in region