shape_doc 0.1
/Users/mourrain/Devel/mmx/shape/include/shape/region.hpp
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * M a t h e m a g i x
00003  *****************************************************************************
00004  * Edge
00005  * 2008-03-21
00006  * Julien Wintz
00007  *****************************************************************************
00008  *               Copyright (C) 2006 INRIA Sophia-Antipolis
00009  *****************************************************************************
00010  * Comments :
00011  ****************************************************************************/
00012 
00013 # pragma once
00014 
00015 # include <realroot/Seq.hpp> 
00016 # include <shape/shape.hpp> 
00017 # include <shape/point.hpp> 
00018 # include <shape/face.hpp> 
00019 
00020 # define TMPL template<class K>
00021 //====================================================================
00022 namespace mmx {
00023 namespace shape {
00024 
00025 
00026 TMPL struct region;
00027 
00028 TMPL struct with_region {typedef region<K> Region;};
00029 
00030 TMPL struct region_def {};
00031 
00032 TMPL
00033 class region 
00034 {
00035 public:
00036   typedef typename region_def<K>::Shape  Shape;
00037   typedef typename region_def<K>::Face   Face ;
00038   //typedef typename region_def<K>::Point  Point;  
00039   typedef typename Seq<Face*>::const_iterator const_iterator;
00040 
00041   region(void) {};
00042   region(Face * f): Shape() {
00043     m_faces <<f;
00044   }; 
00045                 
00046 
00047   const_iterator begin() const {return m_faces.begin();}
00048   const_iterator end()   const {return m_faces.end();}
00049 
00050   unsigned       size()  const {return m_faces.size();}
00051   Seq<Face*>&    faces()       {return m_faces;}
00052   Face*          face(int i)   {return m_faces[i];}
00053   Face *         operator[](int i) {return m_faces[i];}
00054   void           insert     (Face * f) { m_faces<<f; } ;
00055 
00056 private:
00057   Seq<Face*> m_faces;
00058 };
00059 
00060 
00061 } ; // namespace shape
00062 } ; // namespace mmx
00063 //====================================================================
00064 # undef TMPL
00065