MeshKit  1.0
AF2FreeZone.hpp
Go to the documentation of this file.
00001 /*
00002  * AF2FreeZone.hpp
00003  *
00004  * A region of 2-dimensional space, supposed to be convex, defined by
00005  * the points of which the region is supposed to be the convex hull,
00006  * listed in a counter-clockwise order around the region.  This region
00007  * can be checked (1) to verify that the points defining it are, indeed,
00008  * all on the convex hull of the region, (2) to see whether it contains 
00009  * other points, and (3) to see whether it intersects an edge defined
00010  * by its two endpoints.
00011  *
00012  * Within an advancing front algorithm, a free zone may be used to
00013  * determine whether insertion of vertices and edges can be accomplished
00014  * without forcing inverted or poor quality elements to appear in the mesh.
00015  */
00016 #ifndef AF2FREEZONE_HPP
00017 #define AF2FREEZONE_HPP
00018 
00019 // C++
00020 #include <list>
00021 
00022 // MeshKit
00023 #include "meshkit/AF2Point2D.hpp"
00024 
00025 class AF2FreeZone
00026 {
00027   private:
00028 
00029     // the vertices on the convex hull of the free zone,
00030     // in counterclockwise order
00031     std::list<AF2Point2D> vertices;
00032 
00033     // the bounding box of the free zone
00034     double minX;
00035     double maxX;
00036     double minY;
00037     double maxY;
00038 
00039     // approximate scale of the coordinates that define the free zone
00040     double scale;
00041 
00051     bool nearEqual(AF2Point2D const & pointAlpha,
00052         AF2Point2D const & pointBravo) const;
00053 
00054   public:
00055 
00059     AF2FreeZone(std::list<AF2Point2D> const& bndryPoints);
00060 
00072     bool nearContains(AF2Point2D const & testPnt,
00073         bool const & containsBndry = false) const;
00074 
00096     bool nearIntersects(AF2Point2D const & startPoint,
00097         AF2Point2D const & endPoint, bool const & containsBndry = false) const;
00098 
00109     bool isConvex() const;
00110 };
00111 
00112 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines