16 using namespace PointFunctions;
17 using namespace ContainerFunctions;
33 using PointData = std::pair<unsigned int, bool>;
34 std::vector< PointData > indices; indices.reserve(
m_p.cols());
37 indices.emplace_back(position,
false);
39 for(
unsigned int i = 0; i<
m_p.cols(); ++i) {
41 indices.emplace_back(i,
false);
46 if(indices.size() <= 2 ) {
47 for(
auto & pa : indices){
m_indicesCH.emplace_back(pa.first);}
return;
51 unsigned int deletedPoints = 0;
52 CompareByAngle comp(
m_p,base,position,deletedPoints);
53 std::sort( indices.begin()+1, indices.end(), comp );
55 std::vector<unsigned int> indicesT(indices.size()-deletedPoints);
57 for(
auto & p: indices){
if(!p.second){indicesT[k++]=p.first;} }
62 auto ifFunc = [&](
const unsigned int & p1,
const unsigned int & p2){
67 indicesT.resize( std::distance(indicesT.begin(),d2) );
70 if(indicesT.size() <= 2 ) {
71 for(
auto & pa : indicesT){
m_indicesCH.emplace_back(pa);}
return;
78 unsigned int nPoints = indicesT.size();
80 unsigned int lastIdx = indicesT[0];
81 unsigned int firstIdx = indicesT[1];
85 unsigned int lPtIdx = lastIdx;
86 unsigned int mPtIdx = firstIdx;
87 unsigned int currIdx ;
95 currIdx = indicesT[i];
117 for (++i ; i < nPoints; ++i )
119 currIdx = indicesT[i];
135 lPtIdx = *(++revIter);
153 using namespace PointFunctions;
#define ApproxMVBB_ASSERTMSG(condition, message)
An Assert Macro to use within C++ code.
std::vector< unsigned int > m_indicesCH
unsigned int minPointYX(const MatrixBase< Derived > &points)
These are some container definitions.
bool almostEqualUlp(const VecT1 &a, const VecT2 &b)
Iterator moveConsecutiveToFrontIf(Iterator b, Iterator e, Comp c)
REAL orient2d(REAL *pa, REAL *pb, REAL *pc)
const MatrixRef< const Matrix2Dyn > m_p
bool leftTurn(const VecT1 &a, const VecT2 &b, const VecT3 &c)
Eigen::Matrix< Scalar, 2, 1 > Vector2