Mesh::Edge Class Reference

The Edge class represents the edge topological entity of the surface. More...

#include <mesh.h>

Collaboration diagram for Mesh::Edge:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Edge (Vertex *p0, Vertex *p1)
 ~Edge ()
 The Edge class destructor.
Hedgehedge (int i)
Vertexorg ()
 Returns the origin vertex.
Vertexdst ()
 Returns the end vertex.
bool is_bdry ()
 Returns true if the edge belongs to mesh border, else return false.
void set_bdry (Edge *b)
 Updates the boundary pointer if it belongs another boundary of the surface.

Private Attributes

Hedge h_ [2]
 Two half-edges. One for each face use.

Detailed Description

The Edge class represents the edge topological entity of the surface.

Definition at line 440 of file mesh.h.


Constructor & Destructor Documentation

Edge::Edge Vertex p0,
Vertex p1
 

Updates the vertices of the adge. Also updates the half-edge fields.

Parameters:
p0 Pointer to origin vertex.
p1 Pointer to end vertex.

Definition at line 16 of file edge.cpp.

References h_, Mesh::Hedge::set_edge(), Mesh::Hedge::set_face(), Mesh::Hedge::set_next(), and Mesh::Hedge::set_org().

00017 {
00018   h_[0].set_org(p0); h_[1].set_org(p1);
00019   h_[0].set_face(NULL); h_[1].set_face(NULL);;
00020   h_[0].set_next(NULL); h_[1].set_next(NULL);
00021   h_[0].set_edge(this); h_[1].set_edge(this);
00022 }

Mesh::Edge::~Edge  )  [inline]
 

The Edge class destructor.

Definition at line 449 of file mesh.h.

00449 {};


Member Function Documentation

Vertex* Mesh::Edge::dst  )  [inline]
 

Returns the end vertex.

Definition at line 458 of file mesh.h.

References h_, and Mesh::Hedge::org().

00458 { return h_[1].org(); };

Hedge * Edge::hedge int  i  ) 
 

Returns a half-edge specified by the index i. i=0 half-edge of the origin vertex. i=1 half-edge if the end vertex.

Parameters:
i Index of the half-edge.
Returns:
half-edge of the edge.

Definition at line 31 of file edge.cpp.

References h_.

Referenced by Mesh::Surf::add_new_edge(), Mesh::Surf::create(), Mesh::Surf::detach_handle_1(), Mesh::Surf::detach_handle_2(), Mesh::Surf::detach_handle_4(), and Mesh::Hedge::mate().

00032 {
00033   switch (i) {
00034   case 0: return &h_[0];
00035   case 1: return &h_[1];
00036   }
00037   throw Error("edge n");
00038 }

bool Mesh::Edge::is_bdry  )  [inline]
 

Returns true if the edge belongs to mesh border, else return false.

Returns:
boolean type (true or false).

Definition at line 462 of file mesh.h.

References h_.

Referenced by Mesh::Surf::attach_handle_0(), Mesh::Surf::attach_handle_1(), Mesh::Surf::attach_handle_2(), Mesh::Surf::attach_handle_3(), Mesh::Surf::bisect(), Mesh::Surf::detach_handle_1(), Mesh::Surf::detach_handle_2(), Mesh::Vertex::is_bdry(), and Mesh::Point::on_bdry().

00462 { return (h_[0].face() == NULL || h_[1].face() == NULL); };

Vertex* Mesh::Edge::org  )  [inline]
 

Returns the origin vertex.

Definition at line 455 of file mesh.h.

References h_, and Mesh::Hedge::org().

00455 { return h_[0].org(); };

void Mesh::Edge::set_bdry Edge b  )  [inline]
 

Updates the boundary pointer if it belongs another boundary of the surface.

Parameters:
b edge pointer.

Definition at line 468 of file mesh.h.

References h_, and Mesh::Hedge::set_edge().

Referenced by Mesh::Surf::attach_handle_0(), Mesh::Surf::attach_handle_1(), Mesh::Surf::attach_handle_2(), Mesh::Surf::attach_handle_3(), Mesh::Surf::create(), Mesh::Surf::detach_handle_1(), Mesh::Surf::detach_handle_2(), and Mesh::Surf::detach_handle_4().

00468                          { 
00469     if (h_[0].face() != NULL) h_[1].set_edge(b);
00470     else if (h_[1].face() != NULL) h_[0].set_edge(b);
00471   };


Member Data Documentation

Hedge Mesh::Edge::h_[2] [private]
 

Two half-edges. One for each face use.

Definition at line 442 of file mesh.h.

Referenced by dst(), Edge(), hedge(), is_bdry(), org(), and set_bdry().


The documentation for this class was generated from the following files:
Generated on Fri Feb 24 12:23:25 2006 for TOPs by  doxygen 1.4.6-NO