polygon.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_2d_polygon_hh
#define mia_2d_polygon_hh
#include <vector>
#include <mia/2d/vector.hh>
#include <mia/2d/defines2d.hh>
NS_MIA_BEGIN
class EXPORT_2D C2DPolygon
{
public:
bool is_inside_closed_set(const C2DFVector& point) const;
bool is_inside_open_set(const C2DFVector& point) const;
void append(const C2DFVector& point);
size_t size() const;
float get_mimimum_distance(const C2DFVector& point)const ;
float get_hausdorff_distance(const C2DPolygon& other)const ;
private:
bool is_on_line(const C2DFVector& p, const C2DFVector& a, const C2DFVector& b) const;
std::vector<C2DFVector> m_points;
};
typedef std::shared_ptr<C2DPolygon > P2DPolygon;
NS_MIA_END
#endif
vector.hh
C2DFVector
T2DVector< float > C2DFVector
float valued 2D vector
Definition 2d/vector.hh:534
C2DPolygon
A simple 2D polygon class.
Definition polygon.hh:40
C2DPolygon::get_mimimum_distance
float get_mimimum_distance(const C2DFVector &point) const
C2DPolygon::is_inside_open_set
bool is_inside_open_set(const C2DFVector &point) const
C2DPolygon::get_hausdorff_distance
float get_hausdorff_distance(const C2DPolygon &other) const
C2DPolygon::is_inside_closed_set
bool is_inside_closed_set(const C2DFVector &point) const
C2DPolygon::append
void append(const C2DFVector &point)
C2DPolygon::size
size_t size() const
defines2d.hh
EXPORT_2D
#define EXPORT_2D
Definition defines2d.hh:37
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
P2DPolygon
std::shared_ptr< C2DPolygon > P2DPolygon
Pointer type for 2D polygons.
Definition polygon.hh:92