euler::solid_t Class Reference

#include <solid.h>

List of all members.

Public Member Functions

 solid_t ()
 ~solid_t ()
void rsweep_wire (loop_t *l, int resolution=8)
 rotational sweep a wire (translational sweep only affects one surface, and is defined in euler::face_t).
void tsweep_face (face_t *f, vector_t const &disp=vector_t(0.f, 0.f, 1.f))
void rsweep_face (face_t *f, float theta1=0, float theta2=2 *pi, int resolution=10)
edge_tmev (edge_t *e1, edge_t *e2, point_t const &p)
 subdivide edge cycle (at p0=p1==p2) into p0p+[e2, e1) at p0 (change in place), and pp0+[e1, e2) at p (as cycle at new vertex).
void kev (edge_t *e)
 inverse of mev: edge cycle (at tail of e) is merged to that at head of e.
loop_tmef (edge_t *e1, edge_t *e2)
 subdivide edge loop (of l1==l2) into v1v2+[e2, e1) (change in place), and v2v1+[e1,e2) (as new edge loop of new face)
loop_tmef (edge_t *e)
 same as mef(e, e).
void kef (edge_t *e)
 inverse of mef: face is merged to that of opposite half edge.
void kfmrh (face_t *f1, face_t *f2)
void kfsmr (face_t *f1, face_t *f2)
void kffmh (face_t *f1, face_t *f2)
void print_off_file (std::ostream &os) const
solid_toperator+= (vector_t const &v)

Static Public Member Functions

static bool assert_consistent_B_rep ()
static solid_tdisk (point_t const &cntr=point_t(), float r=1.0f, int segs=8)
 actually a lamina (of two faces touch tightly to each other)
static solid_tblock (point_t const &ur=point_t(1.0f, 1.0f, 1.0f))
 make a block with lower left corner at origin, and upper right as given
static solid_tmvfs (point_t const &p)

Public Attributes

id_t id
face_tf
solid_tpre
solid_tnxt

Static Public Attributes

static solid_tsolid = 0

Private Member Functions

vertex_tnew_vertex (point_t const &p)
face_tnew_face ()
std::pair< edge_t *, edge_t * > add_edge_pair (vertex_t *v1, edge_t *nxt1, vertex_t *v2, edge_t *nxt2)
void del_vertex (vertex_t *v)
void del_face (face_t *)
void del_edge_pair (edge_t *e)
void add_face_to (face_t *f1, face_t *f2)
void _kev (edge_t *e)
edge_tmev (edge_t *e1, edge_t *e2, vertex_t *v)

Private Attributes

vertex_tvfirst
vertex_tvlast

Static Private Attributes

static id_t cur_id = 0

Friends

class loop_t


Detailed Description

Examples:

test-block.cc, test-cube-with-hole-2.cc, test-cube-with-hole.cc, test-cube.cc, test-cylinder-2.cc, test-cylinder.cc, test-sphere.cc, and test-torus.cc.

Definition at line 33 of file solid.h.


Constructor & Destructor Documentation

euler::solid_t::solid_t  )  [inline]
 

Definition at line 44 of file solid.h.

References pre, and solid.

00044 : vfirst(0), vlast(0), id(cur_id++), f(0), pre(0), nxt(solid) { if(solid) solid->pre = this; solid = this; }

euler::solid_t::~solid_t  ) 
 

Definition at line 66 of file solid.cpp.

References cur_id, f, euler::vertex_t::nxt, euler::face_t::nxt, nxt, pre, solid, and vfirst.

00067   { 
00068     if(solid == this) solid = nxt; 
00069     if(pre) pre->nxt = nxt;  
00070     if(nxt) nxt->pre = pre; 
00071 
00072     while(f)
00073     {
00074       face_t* temp = f;
00075       f = f->nxt;
00076       delete temp;
00077     }
00078     vertex_t *v = vfirst;
00079     while(v)
00080     {
00081       vertex_t* temp = v;
00082       v = v->nxt;
00083       delete temp;
00084     }
00085     if(id == cur_id-1) cur_id--; 
00086   }


Member Function Documentation

void euler::solid_t::_kev edge_t e  )  [private]
 

Definition at line 29 of file kev.cpp.

References assert_consistent_B_rep(), del_edge_pair(), del_vertex(), euler::edge_t::nxt, euler::edge_t::o, and euler::edge_t::v.

Referenced by euler::loop_t::kev(), and kev().

00030   {
00031     assert(e->o);
00032     
00033     edge_t *front = e->o->nxt, *end = e->nxt;
00034     vertex_t *v1 = end->v, *v2 = e->v;
00035 
00036     del_edge_pair(e);
00037 
00038     if(e->o->nxt != e)
00039       if(!front->o)
00040         front->v = front->nxt->v = v1;
00041       else
00042         for(; front != end; front = front->o->nxt)
00043           front->v = v1;
00044 
00045     del_vertex(v2);
00046 
00047     solid_t::assert_consistent_B_rep();
00048   }

std::pair< edge_t *, edge_t * > euler::solid_t::add_edge_pair vertex_t v1,
edge_t nxt1,
vertex_t v2,
edge_t nxt2
[private]
 

1. add half edge (start at v1) to f1 before nxt1 2. add half edge (start at v2) to f2 before nxt2. 3. identify them as a pair.

Definition at line 48 of file solid.cpp.

References euler::edge_t::nxt, and euler::edge_t::pre.

Referenced by mef(), and mev().

00050   {
00051     //    assert(nxt1->l->f == f1 && nxt2->l->f == f2);
00052     
00053     edge_t
00054       *nxt2_nxt = nxt2->nxt,
00055       *ne1 = new edge_t(v1, nxt1),
00056       *ne2 = new edge_t(v2, nxt2_nxt->pre);
00057 
00058     ne1->o = ne2;
00059     ne2->o = ne1;
00060     
00061     return std::make_pair(ne1, ne2);
00062   }

void euler::solid_t::add_face_to face_t f1,
face_t f2
[private]
 

add loops of f1 after the outer (first) loop of f2, delete f1. specific work to restore the validness of solid.

Definition at line 137 of file solid.cpp.

References del_face(), euler::face_t::l, nxt, euler::loop_t::nxt, pre, and euler::loop_t::pre.

Referenced by kef(), and kfmrh().

00138   { 
00139     assert(f1 != f2);
00140 
00141     for(loop_t* l=f1->l; l; l = l->nxt) 
00142     {
00143       l->f = f2;
00144     }
00145 
00146     loop_t* nxt = f2->l->nxt;
00147 
00148     f2->l->nxt = f1->l;
00149     f1->l->pre = f2->l;
00150 
00151     loop_t*last = f1->l;
00152     while(last->nxt) last = last->nxt;
00153     
00154     last->nxt = nxt;
00155     if(nxt) nxt->pre = last;
00156 
00157     f1->l = 0;
00158     del_face(f1);
00159   }

bool euler::solid_t::assert_consistent_B_rep  )  [static]
 

Definition at line 23 of file debug.cpp.

References f, euler::edge_t::l, euler::face_t::l, nxt, euler::edge_t::nxt, euler::loop_t::nxt, euler::face_t::nxt, and solid.

Referenced by _kev(), kef(), euler::face_t::kemr(), kfmrh(), mef(), euler::face_t::mekr(), and mev().

00024   {
00025     solid_t* s = solid;
00026     while(s)
00027     {
00028       for(face_t *f = s->f; f; f=f->nxt)
00029       {
00030         for(loop_t* l = f->l; l; l=l->nxt)
00031         {
00032           edge_t* e = l->e, *e0 = e;
00033           do
00034           {
00035             if(e->l != l) { *(int*)(0) = 0;  return false; }
00036           }
00037           while( (e=e->nxt) != e0 );
00038         }
00039       }
00040       s = s->nxt;
00041     }
00042     return true;
00043   }

solid_t * euler::solid_t::block point_t const &  ur = point_t(1.0f, 1.0f, 1.0f)  )  [static]
 

make a block with lower left corner at origin, and upper right as given

Definition at line 24 of file block.cpp.

References euler::loop_t::del_single_vertex_edge_pair(), euler::loop_t::e, euler::loop_t::f, f, euler::face_t::l, mef(), euler::loop_t::mev(), mvfs(), and tsweep_face().

00025   {
00026     solid_t* s = solid_t :: mvfs( point_t() );
00027     loop_t *l = s->f->l;
00028     edge_t *e = l->e;
00029     e = l->mev( l->mev( l->mev( e, point_t(ur[0], 0.0, 0.0) ), point_t(ur[0], ur[1], 0.0) ), point_t(0, ur[1], 0.0) ); 
00030     l->del_single_vertex_edge_pair(); 
00031     face_t *f = s->mef(e, l->e)->f;
00032 
00033     s->tsweep_face( f, vector_t(0., 0., ur[2]) );
00034 
00035     return s;
00036   }

void euler::solid_t::del_edge_pair edge_t e  )  [private]
 

Definition at line 113 of file solid.cpp.

References euler::loop_t::e, euler::edge_t::l, euler::edge_t::nxt, euler::edge_t::o, and euler::edge_t::pre.

Referenced by _kev().

00114   {
00115     edge_t* e2 = e1->o;
00116     
00117     for(edge_t *& e = e1->l->e; e == e1 || e == e2; e = e->nxt);
00118     for(edge_t *& e = e2->l->e; e == e2 || e == e2; e = e->nxt);
00119 
00120     e1->pre->nxt = e1->nxt; e1->nxt->pre = e1->pre;
00121     e2->pre->nxt = e2->nxt; e2->nxt->pre = e2->pre;
00122 
00123     delete e1; delete e2;
00124   }

void euler::solid_t::del_face face_t  )  [private]
 

Definition at line 89 of file solid.cpp.

References f, euler::face_t::nxt, and euler::face_t::pre.

Referenced by add_face_to(), and kffmh().

00090   {
00091     if(f == face) f = face->nxt; 
00092     if(face->pre) face->pre->nxt = face->nxt;  
00093     if(face->nxt) face->nxt->pre = face->pre; 
00094     delete face;
00095   }

void euler::solid_t::del_vertex vertex_t v  )  [private]
 

Definition at line 97 of file solid.cpp.

References euler::vertex_t::nxt, euler::vertex_t::pre, and vfirst.

Referenced by _kev().

00098   {
00099     if(!vtx) return;
00100     
00101     if(vtx->pre) vtx->pre->nxt = vtx->nxt;
00102     if(vtx->nxt) vtx->nxt->pre = vtx->pre;
00103     
00104     if(vfirst == vtx)
00105     {
00106       if( !(vfirst=vtx->pre) )
00107         vfirst = vtx->nxt;
00108     }
00109     delete vtx;
00110   }

solid_t * euler::solid_t::disk point_t const &  cntr = point_t(),
float  r = 1.0f,
int  segs = 8
[static]
 

actually a lamina (of two faces touch tightly to each other)

Definition at line 23 of file disk.cpp.

References euler::face_t::arc(), euler::loop_t::e, f, euler::face_t::l, mef(), mvfs(), and euler::pi.

00024   {
00025     solid_t* s = solid_t :: mvfs( point_t(cntr[0]+r, cntr[1], cntr[2]) );
00026     
00027     edge_t* e = s->f->arc( s->f->l->e, cntr, r, 0, 2*pi - 2*pi/segs, segs - 1);
00028   
00029     s->mef(e, s->f->l->e);
00030 
00031     return s;
00032   }

void euler::solid_t::kef edge_t e  ) 
 

inverse of mef: face is merged to that of opposite half edge.

Definition at line 23 of file kef.cpp.

References add_face_to(), assert_consistent_B_rep(), euler::face_t::del_loop(), euler::loop_t::e, euler::loop_t::f, euler::face_t::l, euler::edge_t::l, euler::edge_t::nxt, euler::edge_t::o, and euler::edge_t::pre.

00024   {
00025     assert( e->l->f->l == e->l );     // e has to be on the outer (first) loop of the merged face.
00026     loop_t *l1 = e->o->l, *l2 = e->l; // l2 is to be merged into l1.
00027     
00028     add_face_to(e->l->f, e->o->l->f);
00029 
00030     edge_t *temp = e;
00031     do
00032     {
00033       temp->l = l1;
00034     }
00035     while ( (temp=temp->nxt) != e );
00036 
00037     //merge l2 to l1.
00038     e->o->pre->nxt = e->nxt;
00039     e->nxt->pre = e->o->pre;
00040 
00041     e->pre->nxt = e->o->nxt;
00042     e->o->nxt->pre = e->pre;
00043 
00044     if(l1->e == e->o)
00045       l1->e = e->o->nxt;
00046 
00047     l2->e = 0;
00048     l1->f->del_loop(l2);
00049 
00050     delete e;
00051     delete e->o;
00052 
00053     solid_t::assert_consistent_B_rep();
00054   }

void euler::solid_t::kev edge_t e  ) 
 

inverse of mev: edge cycle (at tail of e) is merged to that at head of e.

Definition at line 23 of file kev.cpp.

References _kev(), euler::loop_t::f, euler::edge_t::l, and euler::edge_t::o.

00024   { 
00025     assert(e->l->f != e->o->l->f); 
00026     return _kev(e); 
00027   }            

void euler::solid_t::kffmh face_t f1,
face_t f2
 

Examples:
test-cube-with-hole-2.cc, and test-torus.cc.

Definition at line 25 of file kffmh.cpp.

References del_face(), euler::loop_t::e, euler::face_t::l, euler::loop_t::nxt, euler::edge_t::o, euler::loop_t::total_vertices(), and euler::edge_t::v.

Referenced by main().

00026   {
00027     assert( ! f1->l->nxt && ! f2->l->nxt && f1->l->total_vertices() == f2->l->total_vertices() );
00028     edge_t *e1 = f1->l->e, *e2 = f2->l->e, *e20 = e2;
00029     do
00030     {
00031       for(edge_t *e = e2->o; e != e2->nxt; e = e->pre->o)
00032       {
00033         e->v = e1->v;
00034       }
00035     }
00036     while( (e1 = e1->nxt, e2 = e2->pre) != e20 );
00037 
00038     e1 = f1->l->e, e2 = f2->l->e, e20 = e2;
00039     do
00040     {
00041       e1->o->o = e2->o;
00042       e2->o->o = e1->o;
00043     }
00044     while( (e1 = e1->nxt, e2 = e2->pre) != e20 );
00045 
00046     del_face(f1); 
00047     del_face(f2);
00048   }

void euler::solid_t::kfmrh face_t f1,
face_t f2
 

Examples:
test-cube-with-hole.cc.

Definition at line 27 of file kfmrh.cpp.

References add_face_to(), assert_consistent_B_rep(), euler::face_t::l, and euler::loop_t::nxt.

Referenced by kfsmr(), and main().

00028   {
00029     assert(! f2->l->nxt);
00030     
00031     add_face_to(f2, f1);
00032 
00033     solid_t::assert_consistent_B_rep();
00034   }

void euler::solid_t::kfsmr face_t f1,
face_t f2
[inline]
 

Definition at line 64 of file solid.h.

References kfmrh().

00064 { kfmrh(f1, f2); }

loop_t* euler::solid_t::mef edge_t e  )  [inline]
 

same as mef(e, e).

Definition at line 60 of file solid.h.

References mef().

loop_t * euler::solid_t::mef edge_t e1,
edge_t e2
 

subdivide edge loop (of l1==l2) into v1v2+[e2, e1) (change in place), and v2v1+[e1,e2) (as new edge loop of new face)

Examples:
test-cube-with-hole-2.cc, test-cube-with-hole.cc, and test-cube.cc.

Definition at line 30 of file mef.cpp.

References add_edge_pair(), assert_consistent_B_rep(), euler::loop_t::e, f, euler::edge_t::l, new_face(), euler::face_t::new_loop(), euler::edge_t::nxt, euler::edge_t::pre, and euler::edge_t::v.

Referenced by block(), disk(), main(), mef(), and tsweep_face().

00031   {
00032     pair<edge_t*, edge_t*> p = add_edge_pair(e2->v, e1,
00033                                              e1->v, e2);
00034     edge_t *&ne1 = p.first, *&ne2 = p.second;
00035 
00036     //split the edge cycle
00037     edge_t *ne2__pre = ne2->pre;
00038     ne2->pre = ne1->pre; ne1->pre->nxt = ne2;
00039     ne1->pre = ne2__pre; ne2__pre->nxt = ne1;
00040     
00041     //update hosting face and loop of new edge cycle
00042     face_t *f = new_face();
00043     
00044     loop_t *nl = f->new_loop();
00045     edge_t *e = ne1;
00046     do
00047     {
00048       e->l = nl;
00049     }
00050     while( (e = e->nxt) != ne1 );
00051 
00052     // set both half  edges as first in the cycle.
00053     ne1->l->e = ne1;
00054     ne2->l->e = ne2;
00055     
00056     solid_t::assert_consistent_B_rep();
00057     return nl;
00058   }

edge_t * euler::solid_t::mev edge_t e1,
edge_t e2,
vertex_t v
[private]
 

Definition at line 40 of file mev.cpp.

References add_edge_pair(), assert_consistent_B_rep(), and euler::edge_t::v.

00041   {
00042     pair<edge_t*, edge_t*> pr = 
00043       add_edge_pair(e1->v, e1,  
00044                     v, e2);
00045 
00046     // subdivide edge cycle by setting vertex of [e1, e2) to p.
00047     for(edge_t *&ne2 = pr.second, *e = pr.first->nxt; e != ne2; e = e->o->nxt)
00048     {
00049       e->v = ne2->v;
00050     }
00051     solid_t::assert_consistent_B_rep();
00052     return pr.second;
00053   }

edge_t * euler::solid_t::mev edge_t e1,
edge_t e2,
point_t const &  p
 

subdivide edge cycle (at p0=p1==p2) into p0p+[e2, e1) at p0 (change in place), and pp0+[e1, e2) at p (as cycle at new vertex).

subdivide edge cycle (at p0=p1==p2) into p0p+[e2, e1) at p0 (change in plance), and pp0+[e1, e2) at p (as new edge cycle of new vertex).

Definition at line 33 of file mev.cpp.

References euler::loop_t::f, euler::edge_t::l, new_vertex(), euler::face_t::s, and euler::edge_t::v.

Referenced by euler::loop_t::mev().

00034   { 
00035     assert(e1->v == e2->v); 
00036     return mev(e1, e2, e1->l->f->s->new_vertex(p)); 
00037   }

solid_t * euler::solid_t::mvfs point_t const &  p  )  [static]
 

Definition at line 26 of file mvfs.cpp.

References new_face(), euler::face_t::new_loop(), and new_vertex().

Referenced by block(), and disk().

00027   {
00028     solid_t *s =  new solid_t;
00029 
00030     s->new_face()->new_loop( s->new_vertex(p) );
00031 
00032     return s;
00033   }

face_t * euler::solid_t::new_face  )  [private]
 

Definition at line 21 of file solid.cpp.

References f, and euler::face_t::pre.

Referenced by mef(), and mvfs().

00022   {
00023     face_t* nf = new face_t(this);
00024     if(f) f->pre = nf;
00025     f = nf;
00026 
00027     return nf;
00028   }

vertex_t * euler::solid_t::new_vertex point_t const &  p  )  [private]
 

Definition at line 29 of file solid.cpp.

References euler::vertex_t::nxt, euler::vertex_t::pre, vfirst, and vlast.

Referenced by mev(), and mvfs().

00030   {
00031     vertex_t *nv = new vertex_t(p);
00032     nv->pre = vlast;
00033 
00034     if(! vfirst) vfirst = nv;
00035 
00036     if(vlast) vlast->nxt = nv;
00037     vlast = nv;
00038 
00039     return nv;
00040   }

solid_t & euler::solid_t::operator+= vector_t const &  v  ) 
 

Definition at line 163 of file solid.cpp.

References euler::vertex_t::nxt, and vfirst.

00164   {
00165     for(vertex_t *v = vfirst; v; v = v->nxt)
00166     {
00167       v->p += d;
00168     }
00169 
00170     return *this;
00171   }

void euler::solid_t::print_off_file std::ostream &  os  )  const
 

Examples:
test-block.cc, test-cube-with-hole-2.cc, test-cylinder-2.cc, test-cylinder.cc, test-sphere.cc, and test-torus.cc.

Definition at line 23 of file print_off_file.cpp.

References f, euler::vertex_t::id, euler::edge_t::nxt, euler::face_t::nxt, euler::vertex_t::nxt, euler::edge_t::v, and vfirst.

Referenced by main().

00024   {
00025     os << "4OFF\n";
00026     int nvertices = 0, nfaces = 0;
00027 
00028     for(vertex_t* vtx = vfirst; vtx; vtx=vtx->nxt) nvertices++;
00029     for(face_t* fac = f; fac; fac=fac->nxt)        nfaces++;
00030     
00031     os << nvertices << ' ' << nfaces << ' ' << 0 << endl;
00032 
00033     for(vertex_t* vtx = vfirst; vtx; vtx=vtx->nxt)
00034       os << vtx->p[0] << '\t' << vtx->p[1] << '\t' << vtx->p[2] << '\t' << vtx->p[3] << "\t #" << vtx->id << endl;
00035 
00036     os << endl << endl;
00037     
00038     for(face_t* fac = f; fac; fac=fac->nxt)
00039     {
00040       int nvertices = fac->l->total_vertices();
00041       os << nvertices << '\t';
00042       edge_t *e = fac->l->e, *e0 = e;
00043       do
00044       {
00045         os << e->v->id << ' ';
00046       }
00047       while( (e=e->nxt) != e0 );
00048       os << endl;
00049     }
00050   }

void euler::solid_t::rsweep_face face_t f,
float  theta1 = 0,
float  theta2 = 2*pi,
int  resolution = 10
 

Face (or laminal) rotational sweep (around x-axis, and original face on xy-plane). 360 rotation needs postprocessing to identify and kill the 2 end faces using kffmh. Assume a simple face is given

Examples:
test-cube-with-hole-2.cc, and test-torus.cc.

Definition at line 88 of file rotational_sweep.cpp.

References euler::loop_t::e, f, euler::face_t::l, euler::loop_t::mev(), euler::loop_t::nxt, euler::vertex_t::p, euler::edge_t::pre, euler::loop_t::total_vertices(), and euler::edge_t::v.

Referenced by main().

00089   {
00090     assert(!f->l->nxt);
00091     
00092     float step = (theta2 - theta1) / resolution;
00093     float theta = theta1;
00094     std::vector<float> r;
00095 
00096     loop_t *l = f->l; // same operation applied to l, which is changed each iteration.
00097     int vertex_total = l->total_vertices();
00098 
00099     for(int seg = 0; seg < resolution; seg++)
00100     {
00101       theta += step;
00102 
00103       edge_t *e = l->e, *e0 = e;
00104       int i = 0;
00105       do
00106       {
00107 
00108         if(r.size() < vertex_total)
00109         {
00110           r.push_back(e->v->p[1]);
00111         }
00112         
00113         float 
00114           y = r[i] * cos( theta ),  
00115           z = r[i] * sin( theta );
00116 
00117         e = l->mev(e, point_t( e->v->p[0], y, z ))->pre->pre;
00118         i++;
00119       }
00120       while( e != e0 );
00121 
00122       e0 = e = e->pre;
00123       edge_t 
00124         *nxt_e = e->nxt->nxt->nxt,
00125         *end_e = mef(e, nxt_e)->e->o;
00126       while( (e=nxt_e) != end_e )
00127       {
00128         nxt_e = e->nxt->nxt->nxt;
00129         mef(e, nxt_e);
00130       }
00131 
00132       l->set_loop_head( l->e->nxt );
00133     }
00134   }

void euler::solid_t::rsweep_wire loop_t l,
int  resolution = 8
 

rotational sweep a wire (translational sweep only affects one surface, and is defined in euler::face_t).

Rotational sweep of a *wire*

assume given loop is a wire on some face, and half edge of the first vertex is on the half edge list head. the wire, on the half plane y>0. is to be rotated around x-axis.

Examples:
test-cylinder-2.cc, and test-sphere.cc.

Definition at line 35 of file rotational_sweep.cpp.

References euler::loop_t::e, euler::loop_t::mev(), euler::edge_t::nxt, euler::vertex_t::p, euler::pi, euler::loop_t::total_vertices(), and euler::edge_t::v.

Referenced by main().

00036   {
00037     int vertex_total = l->total_vertices() / 2 + 1;
00038 
00039     edge_t *e = l->e, *e0 = e, *e00 = e0; 
00040     std::vector<float> r;
00041     
00042     float theta = 0.0;
00043     for(int seg=0; seg < resolution-1; seg++)
00044     {
00045       theta += 2 * pi / resolution;
00046       e = e0;
00047       
00048       for(int i=0; i < vertex_total; i++)
00049       {
00050         if(r.size() <= i)
00051           r.push_back(e->v->p[1]);
00052 
00053         float y = r[i] * cos( theta ),  z = r[i] * sin( theta );
00054 
00055         e = l->mev(e, point_t( e->v->p[0], y, z ) )->nxt->nxt;
00056       }
00057       e = e0->pre;
00058       
00059       for(int i=0; i < vertex_total-1; i++)
00060       {
00061         edge_t *nxt_e = e->nxt->nxt->nxt;
00062         mef(e, nxt_e);
00063         e = nxt_e;
00064       }
00065       assert_consistent_B_rep();
00066       
00067       e0 = e0->pre->pre->o;
00068     }
00069     
00070     edge_t *e1 = e00->o->nxt, *e2 = e0;
00071     
00072     for(int i=0; i < vertex_total-1; i++)
00073     {
00074       edge_t *nxt_e1 = e1->pre;
00075       mef(e1, e2);
00076       e1 = nxt_e1;
00077       e2 = e2->nxt;
00078     }
00079     mef(e2, e1);
00080   }

void euler::solid_t::tsweep_face face_t f,
vector_t const &  disp = vector_t(0.f, 0.f, 1.f)
 

Examples:
test-cylinder.cc.

Definition at line 22 of file translation_sweep.cpp.

References euler::loop_t::e, f, euler::face_t::l, mef(), euler::edge_t::nxt, euler::loop_t::nxt, euler::edge_t::o, euler::vertex_t::p, euler::edge_t::pre, and euler::edge_t::v.

Referenced by block(), and main().

00023   {
00024     for(loop_t *l = f->l; l; l=l->nxt)
00025     {
00026       edge_t *e = l->e, *e0 = e;
00027       while( (e = l->mev(e, e->v->p + disp)->pre->pre) != e0 );
00028 
00029       e0 = e = e->pre;
00030       edge_t 
00031         *nxt_e = e->nxt->nxt->nxt,
00032         *end_e = mef(e, nxt_e)->e->o;
00033       while( (e=nxt_e) != end_e )
00034       {
00035         nxt_e = e->nxt->nxt->nxt;
00036         mef(e, nxt_e);
00037       }
00038     }
00039   }


Friends And Related Function Documentation

friend class loop_t [friend]
 

Definition at line 86 of file solid.h.


Member Data Documentation

id_t euler::solid_t::cur_id = 0 [static, private]
 

Definition at line 91 of file solid.h.

Referenced by ~solid_t().

face_t* euler::solid_t::f
 

Examples:
test-cube-with-hole-2.cc, test-cube-with-hole.cc, test-cube.cc, test-cylinder-2.cc, test-cylinder.cc, test-sphere.cc, and test-torus.cc.

Definition at line 40 of file solid.h.

Referenced by assert_consistent_B_rep(), block(), del_face(), disk(), main(), mef(), new_face(), euler::operator<<(), print_off_file(), rsweep_face(), tsweep_face(), and ~solid_t().

id_t euler::solid_t::id
 

Definition at line 39 of file solid.h.

Referenced by euler::operator<<().

solid_t * euler::solid_t::nxt
 

Definition at line 41 of file solid.h.

Referenced by add_face_to(), assert_consistent_B_rep(), and ~solid_t().

solid_t* euler::solid_t::pre
 

Definition at line 41 of file solid.h.

Referenced by add_face_to(), solid_t(), and ~solid_t().

solid_t * euler::solid_t::solid = 0 [static]
 

Definition at line 37 of file solid.h.

Referenced by assert_consistent_B_rep(), solid_t(), and ~solid_t().

vertex_t* euler::solid_t::vfirst [private]
 

Definition at line 35 of file solid.h.

Referenced by del_vertex(), new_vertex(), operator+=(), print_off_file(), and ~solid_t().

vertex_t * euler::solid_t::vlast [private]
 

Definition at line 35 of file solid.h.

Referenced by new_vertex().


The documentation for this class was generated from the following files:
Generated on Wed Aug 30 16:27:59 2006 for euler by  doxygen 1.4.6