ConvexHull2D.hpp
Go to the documentation of this file.
1 // ========================================================================================
2 // ApproxMVBB
3 // Copyright (C) 2014 by Gabriel Nützi <nuetzig (at) imes (d0t) mavt (d0t) ethz (døt) ch>
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 // ========================================================================================
9 
10 #ifndef ApproxMVBB_ConvexHull2D_hpp
11 #define ApproxMVBB_ConvexHull2D_hpp
12 
13 #include <vector>
14 
16 
17 #include ApproxMVBB_TypeDefs_INCLUDE_FILE
19 #include ApproxMVBB_AssertionDebug_INCLUDE_FILE
20 
23 
24 namespace ApproxMVBB{
30  public:
31  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
34 
38  template<typename Derived>
39  ConvexHull2D(const MatrixBase<Derived> & points) :m_p(points) {
40  EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Derived,2, Eigen::Dynamic)
41  ApproxMVBB_ASSERTMSG( m_p.data() == points.derived().data() ," You store a temporary in a Ref<> which works here, but do you really want this?")
42  }
43 
44  void compute();
45 
46  void computeMonotonChain();
47 
48 
49  bool verifyHull();
50 
51  inline std::vector<unsigned int> & getIndices() {
52  return m_indicesCH;
53  }
54 
55 
56 
57  private:
58 
59  void chainHull();
60 
61  std::vector<unsigned int> m_indicesCH;
62  const MatrixRef< const Matrix2Dyn > m_p;
63  };
64 }
65 #endif
#define ApproxMVBB_ASSERTMSG(condition, message)
An Assert Macro to use within C++ code.
std::vector< unsigned int > m_indicesCH
These are some container definitions.
#define APPROXMVBB_EXPORT
Definition: Platform.hpp:60
const MatrixRef< const Matrix2Dyn > m_p
#define ApproxMVBB_DEFINE_POINTS_CONFIG_TYPES
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ApproxMVBB_DEFINE_MATRIX_TYPES ApproxMVBB_DEFINE_POINTS_CONFIG_TYPES ConvexHull2D(const MatrixBase< Derived > &points)
std::vector< unsigned int > & getIndices()
#define ApproxMVBB_DEFINE_MATRIX_TYPES
Definition: TypeDefs.hpp:26


asr_approx_mvbb
Author(s): Gassner Nikolai
autogenerated on Mon Jun 10 2019 12:38:08