Skip to content

Commit

Permalink
added find verts function stub with nmg traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Eric Hollister committed Aug 21, 2015
1 parent d058369 commit ff9ea31
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions src/libged/nmg_make_f.c
Expand Up @@ -32,8 +32,8 @@

#include "./ged_private.h"

#if 0
void remove_vertex(const struct model* m, point_t rv)
void
find_vertices_in_nmg(const struct model* m, long int* UNUSED(v_ids), struct vertex** UNUSED(vt[]))
{
struct nmgregion *r;
struct shell *s;
Expand Down Expand Up @@ -99,6 +99,7 @@ void remove_vertex(const struct model* m, point_t rv)
v = vu->v_p;
NMG_CK_VERTEX(v);

#if 0
if (v->vg_p) {
NMG_CK_VERTEX_G(v->vg_p);

Expand All @@ -107,7 +108,7 @@ void remove_vertex(const struct model* m, point_t rv)
nmg_klu(lu);
}
}

#endif
continue;
}

Expand All @@ -132,16 +133,17 @@ void remove_vertex(const struct model* m, point_t rv)
v = vu->v_p;
NMG_CK_VERTEX(v);

#if 0
if (v->vg_p) {
NMG_CK_VERTEX_G(v->vg_p);

if ( VNEAR_EQUAL(v->vg_p->coord,
rv, BN_TOL_DIST) ) {
nmg_kvu(vu);
nmg_keu(eu);
nmg_klu(lu);
}
}
#endif
}
}
}
Expand All @@ -163,13 +165,16 @@ void remove_vertex(const struct model* m, point_t rv)
NMG_CK_VERTEXUSE(vu);
v = vu->v_p;
NMG_CK_VERTEX(v);

#if 0
if (v->vg_p) {
NMG_CK_VERTEX_G(v->vg_p);
if ( VNEAR_EQUAL(v->vg_p->coord, rv, BN_TOL_DIST) ) {
nmg_kvu(vu);
nmg_klu(lu);
}
}
#endif
continue;
}

Expand All @@ -190,7 +195,7 @@ void remove_vertex(const struct model* m, point_t rv)
NMG_CK_VERTEXUSE(vu);
v = vu->v_p;
NMG_CK_VERTEX(v);

#if 0
if (v->vg_p) {
NMG_CK_VERTEX_G(v->vg_p);
if ( VNEAR_EQUAL(v->vg_p->coord, rv, BN_TOL_DIST) ) {
Expand All @@ -199,6 +204,7 @@ void remove_vertex(const struct model* m, point_t rv)
nmg_klu(lu);
}
}
#endif
}
}

Expand All @@ -224,6 +230,7 @@ void remove_vertex(const struct model* m, point_t rv)
v = vu->v_p;
NMG_CK_VERTEX(v);

#if 0
if (v->vg_p) {
NMG_CK_VERTEX_G(v->vg_p);

Expand All @@ -232,6 +239,7 @@ void remove_vertex(const struct model* m, point_t rv)
nmg_keu(eu);
}
}
#endif
}

/* Lone vertex in shell */
Expand All @@ -242,31 +250,29 @@ void remove_vertex(const struct model* m, point_t rv)
NMG_CK_VERTEXUSE(vu);
v = vu->v_p;
NMG_CK_VERTEX(v);

#if 0
if (v->vg_p) {
NMG_CK_VERTEX_G(v->vg_p);

if ( VNEAR_EQUAL(v->vg_p->coord, rv, BN_TOL_DIST) ) {
nmg_kvu(vu);
}
}
#endif
}
}
}
}
#endif

int
ged_nmg_make_f(struct ged* UNUSED(gedp), int UNUSED(argc), const char* UNUSED(argv[]))
ged_nmg_make_f(struct ged* gedp, int argc, const char* argv[])
{
#if 0
struct rt_db_internal internal;
struct directory *dp;
struct model* m;
const char* name;
point_t vt;

static const char *usage = "kill V x y z";
static const char *usage = "make F v0 v1 ... vn";

GED_CHECK_DATABASE_OPEN(gedp, GED_ERROR);
GED_CHECK_DRAWABLE(gedp, GED_ERROR);
Expand Down Expand Up @@ -303,12 +309,11 @@ ged_nmg_make_f(struct ged* UNUSED(gedp), int UNUSED(argc), const char* UNUSED(ar
return GED_ERROR;
}

vt[0] = atof(argv[3]); vt[1] = atof(argv[4]); vt[2] = atof(argv[5]);

m = (struct model *)internal.idb_ptr;
NMG_CK_MODEL(m);

remove_vertex(m, vt);
find_vertices_in_nmg(m, NULL, NULL);


if ( wdb_put_internal(gedp->ged_wdbp, name, &internal, 1.0) < 0 ) {
bu_vls_printf(gedp->ged_result_str, "wdb_put_internal(%s)", argv[1]);
Expand All @@ -317,7 +322,6 @@ ged_nmg_make_f(struct ged* UNUSED(gedp), int UNUSED(argc), const char* UNUSED(ar
}

rt_db_free_internal(&internal);
#endif

return GED_OK;
}
Expand Down

0 comments on commit ff9ea31

Please sign in to comment.