pointset_math.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2016 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Emanuel Griesen
27 ** Harry Storbacka
28 */
29 
30 #pragma once
31 
32 #include <vector>
33 #include "point.h"
34 #include "circle.h"
35 #include "rect.h"
36 
37 namespace clan
38 {
41 
44  {
45  public:
50  const std::vector<Pointf> &points);
51 
55  static std::vector<Pointf> convex_hull_from_polygon(std::vector<Pointf> &points);
56 
57  static Rect bounding_box(const std::vector<Pointf> &points);
58 
60  Circlef &smalldisc,
61  const std::vector<Pointf> &points,
62  int start,
63  int end);
64 
65  static void minimum_disc_with_1point(
66  Circlef &smalldisc,
67  const std::vector<Pointf> &points,
68  int start,
69  unsigned int i);
70 
71  static void minimum_disc_with_2points(
72  Circlef &smalldisc,
73  const std::vector<Pointf> &points,
74  int start,
75  unsigned int i,
76  unsigned int j);
77 
78  static void minimum_disc_with_3points(
79  Circlef &smalldisc,
80  const std::vector<Pointf> &points,
81  unsigned int i,
82  unsigned int j,
83  unsigned int k);
84 
85  };
86 
88 }
Definition: clanapp.h:35
static Rect bounding_box(const std::vector< Pointf > &points)
static void calculate_minimum_enclosing_disc(Circlef &smalldisc, const std::vector< Pointf > &points, int start, int end)
static void minimum_disc_with_3points(Circlef &smalldisc, const std::vector< Pointf > &points, unsigned int i, unsigned int j, unsigned int k)
static void minimum_disc_with_1point(Circlef &smalldisc, const std::vector< Pointf > &points, int start, unsigned int i)
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:488
static Circlef minimum_enclosing_disc(const std::vector< Pointf > &points)
Find minimum spanning circle for the set of points.
static std::vector< Pointf > convex_hull_from_polygon(std::vector< Pointf > &points)
Return the convex hull of the given set of points.
Circle - Float.
Definition: circle.h:75
static void minimum_disc_with_2points(Circlef &smalldisc, const std::vector< Pointf > &points, int start, unsigned int i, unsigned int j)
Math operations related to point sets.
Definition: pointset_math.h:43