Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

A48::Face Class Reference

The class Face implements the face topological entity of the mesh 4-8. More...

#include <face.h>

Collaboration diagram for A48::Face:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Face (Hedge *e0, Hedge *e1, Hedge *e2)
 The constructor creates a triangular face.

Hedgehedge (int k)
 Returns the half-edge of index k.

Vertexvertex (int k)
 Returns the vertex of index k.

int level ()
 Returns face level.

bool is_inbase ()
 Returns true if the face belongs to the level 0, else return false.

Hedgesubd_edge ()
 Returns the face's subdivision edge.

Vertexweld_vertex ()
 Returns the face vertex that can be used for simplification.


Private Member Functions

void set_hedge (int k, Hedge *h)
 Updates the half-edge of index k.

void set_vertex (int k, Vertex *v)
 Updates the vertex of index k.

void link_star_verts ()
 Links the vertices to the half-edges.

Facereuse (Hedge *e0, Hedge *e1, Hedge *e2)
 Redefines a face by specifing replacement half-edges.


Private Attributes

Hedgee_
 Points to the first half-egde of face's loop.


Detailed Description

The class Face implements the face topological entity of the mesh 4-8.

Definition at line 17 of file face.h.


Constructor & Destructor Documentation

A48::Face::Face Hedge e0,
Hedge e1,
Hedge e2
[inline]
 

The constructor creates a triangular face.

Parameters:
e0 First half-edge.
e1 Second half-edge.
e2 Third half-edge.

Definition at line 27 of file face.h.

References reuse().

00027 { reuse(e0, e1, e2); };


Member Function Documentation

Hedge * Face::hedge int  k  ) 
 

Returns the half-edge of index k.

Returns:
half-edge pointer.

Definition at line 39 of file face.cpp.

References e_, and A48::Hedge::next().

Referenced by link_star_verts(), set_hedge(), set_vertex(), A48::Mesh::split(), and vertex().

00040 { 00041 switch (k) { 00042 case 0: return e_; 00043 case 1: return e_->next(); 00044 case 2: return e_->next()->next(); 00045 } 00046 throw Error("hedge index"); 00047 }

bool Face::is_inbase  ) 
 

Returns true if the face belongs to the level 0, else return false.

Returns true if the face belongs to level 0, else return false.

Returns:
boolean type (true or false).

Definition at line 107 of file face.cpp.

References A48::Vertex::level(), and vertex().

00108 { 00109 return (vertex(0)->level() == 0 00110 && vertex(1)->level() == 0 00111 && vertex(2)->level() == 0); 00112 }

int Face::level  ) 
 

Returns face level.

Returns the face level. This level is determined by the highest resolution level of face vertices.

Returns:
face's resolution level.

Definition at line 98 of file face.cpp.

References vertex().

Referenced by A48::Mesh::split().

00099 { 00100 return max(vertex(0)->level(), max(vertex(1)->level(),vertex(2)->level())); 00101 }

void Face::link_star_verts  )  [private]
 

Links the vertices to the half-edges.

Links vertices to half-edges. Builds canonical vertex indexing to work with stelar mesh.

Definition at line 77 of file face.cpp.

References hedge(), A48::Vertex::set_star(), and vertex().

00078 { 00079 for (int k = 0; k < 3; k++) 00080 vertex(k)->set_star(hedge(NEXT3(k))); 00081 }

Face * Face::reuse Hedge e0,
Hedge e1,
Hedge e2
[private]
 

Redefines a face by specifing replacement half-edges.

Updates the half-edges of the face. Make half-edge links to build a face loop. Links half-edges to face.

Parameters:
e0 First half-edge.
e1 Second half-edge.
e2 Third half-edge.
Returns:
face pointer.

Definition at line 27 of file face.cpp.

References e_, A48::Hedge::set_face(), and A48::Hedge::set_next().

Referenced by A48::Mesh::bisect(), Face(), A48::Mesh::flip(), A48::Mesh::split(), and A48::Mesh::weld().

00028 { 00029 e_ = e0; 00030 e0->set_next(e1); e1->set_next(e2); e2->set_next(e0); 00031 e0->set_face(this); e1->set_face(this); e2->set_face(this); 00032 return this; 00033 }

void Face::set_hedge int  k,
Hedge h
[private]
 

Updates the half-edge of index k.

Updates the half-edge of index k.

Parameters:
k half-edge index, Valid values of k=[0,1,2].
h Specify a new half-edge.

Definition at line 64 of file face.cpp.

References e_, hedge(), and A48::Hedge::set_next().

00065 { 00066 Hedge *n = hedge(NEXT3(k)); 00067 Hedge *p = hedge(PREV3(k)); 00068 h->set_next(n); 00069 p->set_next(h); 00070 if (k == 0) e_ = h; 00071 }

void Face::set_vertex int  k,
Vertex v
[private]
 

Updates the vertex of index k.

Updates the opposite vertex of half-edge specified by the index k.

Parameters:
k índex of half-edge. Valid values of k=[0,1,2].
v Specifies the new vertex.

Definition at line 88 of file face.cpp.

References hedge(), and A48::Hedge::set_org().

00089 { 00090 hedge(PREV3(k))->set_org(v); 00091 }

Hedge* A48::Face::subd_edge  )  [inline]
 

Returns the face's subdivision edge.

Returns:
half-edge pointer.

Definition at line 45 of file face.h.

Referenced by A48::Hedge::is_subdiv_itself(), A48::Mesh::is_triquad(), and A48::Mesh::refine().

00045 { return hedge(0); };

Vertex * Face::vertex int  k  ) 
 

Returns the vertex of index k.

Returns:
vertex pointer.

Definition at line 54 of file face.cpp.

References hedge(), and A48::Hedge::org().

Referenced by is_inbase(), level(), link_star_verts(), and A48::Mesh::split().

00055 { 00056 return hedge(PREV3(k))->org(); 00057 }


The documentation for this class was generated from the following files:
Generated on Mon Oct 11 19:32:37 2004 for A48 by doxygen 1.3.7