Mesh::Point Class Reference

The Point class contains geometry and attribute information. More...

#include <mesh.h>

List of all members.

Public Member Functions

 Point ()
 Point Class default constructor. Nothing to do.
 Point (vec3 p, vec3 n, int index)
 This constructor initializates the class variables.
 ~Point ()
 Point Class default destructor. Nothing to do.
float operator[] (int i)
 Returns position coordinate.
vec3 p ()
 Returns position vector.
vec3 n ()
 Returns normal vector.
int get_index ()
 Returns label information.
void add (vec3 v)
 Adds a vector to the position vector.
void set_normal (float nx, float ny, float nz)
 Updates the normal vector.
Hedgelookup_hedge (Point *p)
 Looks for a hedge which connects a point.
bool on_bdry ()
 Returns true if the point belongs to mesh border, else return false.
void add_vert (Vertex *v)
 Inserts a vertex pointer to the references list.
void del_vert (Vertex *v)
 Removes a vertex pointer to the references list.

Private Attributes

vec3 _p
 Position vector.
vec3 _n
 Normal vector.
list< Vertex * > _vl
 Set of vertices which reference Point.
int _index
 Label information.


Detailed Description

The Point class contains geometry and attribute information.

Definition at line 520 of file mesh.h.


Constructor & Destructor Documentation

Mesh::Point::Point  )  [inline]
 

Point Class default constructor. Nothing to do.

Definition at line 530 of file mesh.h.

References _index, _n, and _p.

00530 {_p=vec3(0, 0, 0);_index = 0;; _n=vec3(0, 0, 0);};

Mesh::Point::Point vec3  p,
vec3  n,
int  index
[inline]
 

This constructor initializates the class variables.

Definition at line 533 of file mesh.h.

References _index, _n, and _p.

00533 { _p=p; _index=index; _n=n;};

Mesh::Point::~Point  ) 
 

Point Class default destructor. Nothing to do.


Member Function Documentation

void Mesh::Point::add vec3  v  )  [inline]
 

Adds a vector to the position vector.

Parameters:
v vec3 object.

Definition at line 559 of file mesh.h.

References _p.

00559 {_p =_p+v;};

void Mesh::Point::add_vert Vertex v  )  [inline]
 

Inserts a vertex pointer to the references list.

Parameters:
v Vertex pointer.

Definition at line 591 of file mesh.h.

Referenced by Mesh::Surf::create(), Mesh::Surf::detach_handle_1(), and Mesh::Surf::detach_handle_2().

00591 {_vl.push_back(v);};

void Mesh::Point::del_vert Vertex v  )  [inline]
 

Removes a vertex pointer to the references list.

Parameters:
v Vertex pointer.

Definition at line 596 of file mesh.h.

Referenced by Mesh::Surf::attach_handle_1(), Mesh::Surf::attach_handle_2(), Mesh::Surf::attach_handle_3(), and Mesh::Surf::destroy().

00596 {_vl.remove(v);};

int Mesh::Point::get_index  )  [inline]
 

Returns label information.

Definition at line 554 of file mesh.h.

References _index.

00554 {return _index;};

Hedge* Mesh::Point::lookup_hedge Point p  )  [inline]
 

Looks for a hedge which connects a point.

Parameters:
p origin point.
Returns:
Hedge pointer if found and NULL otherwise.

Definition at line 573 of file mesh.h.

References _vl, and p().

00573                                {
00574    Hedge* he = NULL;
00575    for (list<Vertex*>::iterator viter = _vl.begin(); viter!=_vl.end();viter++)
00576      if ((*viter)->star_first()->org()->p()==p){
00577          he = (*viter)->star_first();
00578          break;
00579      }
00580     return he;
00581   };

vec3 Mesh::Point::n  )  [inline]
 

Returns normal vector.

Definition at line 551 of file mesh.h.

References _n.

00551 {return _n;};

bool Mesh::Point::on_bdry  )  [inline]
 

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

Returns:
boolean type (true or false).

Definition at line 585 of file mesh.h.

References Mesh::Hedge::edge(), and Mesh::Edge::is_bdry().

00585                  {return (_vl.size()>0)? 
00586           (*_vl.begin())->star_first()->edge()->is_bdry(): false;};

float Mesh::Point::operator[] int  i  )  [inline]
 

Returns position coordinate.

Parameters:
i=[0,1,2]. 

Definition at line 541 of file mesh.h.

References _p.

00541                             {
00542     if (i < 0 || i > 2)
00543       return 0.0;
00544     return _p[i];
00545   };

vec3 Mesh::Point::p  )  [inline]
 

Returns position vector.

Definition at line 548 of file mesh.h.

References _p.

Referenced by Mesh::Surf::lookup_hedge(), and lookup_hedge().

00548 {return _p;};

void Mesh::Point::set_normal float  nx,
float  ny,
float  nz
[inline]
 

Updates the normal vector.

Parameters:
nx first coordinate.
ny second coordinate.
nz third coordinate.

Definition at line 566 of file mesh.h.

References _n.

00566 {_n[0]=nx; _n[1]=ny; _n[2]=nz;};


Member Data Documentation

int Mesh::Point::_index [private]
 

Label information.

Definition at line 525 of file mesh.h.

Referenced by get_index(), and Point().

vec3 Mesh::Point::_n [private]
 

Normal vector.

Definition at line 523 of file mesh.h.

Referenced by n(), Point(), and set_normal().

vec3 Mesh::Point::_p [private]
 

Position vector.

Definition at line 522 of file mesh.h.

Referenced by add(), operator[](), p(), and Point().

list<Vertex*> Mesh::Point::_vl [private]
 

Set of vertices which reference Point.

Definition at line 524 of file mesh.h.

Referenced by lookup_hedge().


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