WIP: first part of region refactoring.

This commit is contained in:
Matthias Koefferlein 2018-11-04 22:56:08 +01:00
parent 17f53cf54e
commit 54945105ef
3 changed files with 4148 additions and 324 deletions

View File

@ -41,6 +41,18 @@ namespace db {
class Edges;
/**
* @brief A base class for polygon filters
*/
class DB_PUBLIC EdgeFilterBase
{
public:
EdgeFilterBase () { }
virtual ~EdgeFilterBase () { }
virtual bool selected (const db::Edge &edge) const = 0;
};
/**
* @brief An edge length filter for use with Edges::filter or Edges::filtered
*
@ -51,6 +63,7 @@ class Edges;
*/
struct DB_PUBLIC EdgeLengthFilter
: public EdgeFilterBase
{
typedef db::Edge::distance_type length_type;
@ -70,7 +83,7 @@ struct DB_PUBLIC EdgeLengthFilter
/**
* @brief Returns true if the edge length matches the criterion
*/
bool operator() (const db::Edge &edge) const
bool selected (const db::Edge &edge) const
{
length_type l = edge.length ();
if (! m_inverse) {
@ -96,6 +109,7 @@ private:
*/
struct DB_PUBLIC EdgeOrientationFilter
: public EdgeFilterBase
{
/**
* @brief Constructor
@ -132,7 +146,7 @@ struct DB_PUBLIC EdgeOrientationFilter
/**
* @brief Returns true if the edge orientation matches the criterion
*/
bool operator() (const db::Edge &edge) const
bool selected (const db::Edge &edge) const
{
int smin = db::vprod_sign (m_emin, db::DVector (edge.d ()));
if (m_exact) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff