shape_doc 0.1
face< C, V, POINT > Class Template Reference

#include <face.hpp>

Inheritance diagram for face< C, V, POINT >:
Shape

List of all members.

Public Types

Public Member Functions


Detailed Description

template<class C, class V = default_env, class POINT = point<C,V>>
class mmx::shape::face< C, V, POINT >

Definition at line 53 of file face.hpp.


Member Typedef Documentation

Definition at line 60 of file face.hpp.

typedef edge<C,V,POINT> Edge

Definition at line 58 of file face.hpp.

typedef POINT Point

Definition at line 57 of file face.hpp.

typedef use<shape_def,V>::Shape Shape

Definition at line 56 of file face.hpp.


Constructor & Destructor Documentation

face ( void  ) [inline]

Definition at line 62 of file face.hpp.

: m_index(0) { };
face ( Point p1,
Point p2,
Point p3 
) [inline]

Definition at line 63 of file face.hpp.

                                          : Shape() {
    m_points<<p1;
    m_points<<p2;
    m_points<<p3;
    m_index=0;
  }; 

Member Function Documentation

const_iterator begin ( ) const [inline]

Definition at line 70 of file face.hpp.

{return m_points.begin();}
const_iterator end ( ) const [inline]

Definition at line 71 of file face.hpp.

{return m_points.end();}
int get_index ( ) [inline]

Definition at line 81 of file face.hpp.

{ return m_index; } ;
void insert ( Point p) [inline]
bool is_ccw ( )

Definition at line 187 of file face.hpp.

{
   double z(0);
   int    n=this->size();
   
   if (n < 3)
       return(0);
   n--;
   for (int i=0;i<n;i++) 
   {
       z+= m_points[i  ]->x() * m_points[i+1]->y() -
           m_points[i+1]->x() * m_points[i  ]->y() ;
   }
   z+= m_points[n]->x() * m_points[0]->y() -
       m_points[0]->x() * m_points[n]->y() ;

   return (z>0);
}
Point* not_on ( Edge a) [inline]

Refine face.

Definition at line 91 of file face.hpp.

References edge< C, V, POINT >::destination(), and edge< C, V, POINT >::source().

    {
  foreach( Point * p, m_points)
    if ( !equal( a->destination(), p ) &&
         !equal( a->source()     , p ) )
      return p;
  std::cout<<" ! not_on(Edge) not found"<<std::endl;
  return NULL;};
Point* operator[] ( int  i) [inline]

Definition at line 76 of file face.hpp.

{return m_points[i];}
Seq<Point*>& points ( ) [inline]

Definition at line 74 of file face.hpp.

Referenced by use< tpl3d_def >::as_graphic(), and use< tpl3d_def >::print_as_graphic().

{return m_points;}
Point* points ( int  i) [inline]

Definition at line 75 of file face.hpp.

{return m_points[i];}
void push_vertex ( Point p) [inline]

Definition at line 78 of file face.hpp.

{ m_points<<p; } ;
void reverse ( ) [inline]

Reverse face.

Definition at line 86 of file face.hpp.

{ m_points.reverse(); } ;
void set_index ( const int &  i) [inline]

Definition at line 80 of file face.hpp.

Referenced by voronoi2d< C, V >::run().

{ m_index=i; } ;
unsigned size ( void  ) const [inline]

The documentation for this class was generated from the following file: