Pārlūkot izejas kodu

delete obsolete func based on: https://github.com/libigl/libigl/issues/1783#issuecomment-845248820 (#1810)

X.ZhaoMa 4 gadi atpakaļ
vecāks
revīzija
7342dbe1f8
2 mainītis faili ar 0 papildinājumiem un 87 dzēšanām
  1. 0 51
      include/igl/point_in_poly.cpp
  2. 0 36
      include/igl/point_in_poly.h

+ 0 - 51
include/igl/point_in_poly.cpp

@@ -1,51 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#include "point_in_poly.h"
-
-bool IGL_INLINE igl::point_in_poly( const std::vector<std::vector<unsigned int > >&poly, 
-            const unsigned int xt, 
-            const unsigned int yt)
-{
-  int npoints= poly.size();
-  unsigned int xnew,ynew;
-  unsigned int xold,yold;
-  unsigned int x1,y1;
-  unsigned int x2,y2;
-  int i;
-  int inside=0;
-  
-  if (npoints < 3) {
-    return(0);
-  }
-  xold=poly[npoints-1][0];
-  yold=poly[npoints-1][1];
-  for (i=0 ; i < npoints ; i++) {
-    xnew=poly[i][0];
-    ynew=poly[i][1];
-    if (xnew > xold) {
-      x1=xold;
-      x2=xnew;
-      y1=yold;
-      y2=ynew;
-    }
-    else {
-      x1=xnew;
-      x2=xold;
-      y1=ynew;
-      y2=yold;
-    }
-    if ((xnew < xt) == (xt <= xold)          /* edge "open" at one end */
-        && ((long)yt-(long)y1)*(long)(x2-x1)
-        < ((long)y2-(long)y1)*(long)(xt-x1)) {
-      inside=!inside;
-    }
-    xold=xnew;
-    yold=ynew;
-  }
-  return (inside != 0);
-}

+ 0 - 36
include/igl/point_in_poly.h

@@ -1,36 +0,0 @@
-// This file is part of libigl, a simple c++ geometry processing library.
-// 
-// Copyright (C) 2013 Alec Jacobson <[email protected]>
-// 
-// This Source Code Form is subject to the terms of the Mozilla Public License 
-// v. 2.0. If a copy of the MPL was not distributed with this file, You can 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_POINT_IN_POLY_H
-#define IGL_POINT_IN_POLY_H
-#include "igl_inline.h"
-
-#include <vector>
-
-namespace igl
-{
-  // Determine if 2d point is inside a 2D polygon
-  // Inputs:
-  //   poly  vector of polygon points, [0]=x, [1]=y. 
-  //         Polyline need not be closed (i.e. first point != last point), 
-  //         the line segment between last and first selected points is constructed 
-  //         within this function.
-  //   x     x-coordinate of query point
-  //   y     y-coordinate of query point
-  // Returns true if query point is in polygon, false otherwise
-  // from http://www.visibone.com/inpoly/
-bool IGL_INLINE point_in_poly( const std::vector<std::vector<unsigned int > >&poly, 
-            const unsigned int xt, 
-            const unsigned int yt);
-
-}
-
-#ifndef IGL_STATIC_LIBRARY
-#  include "point_in_poly.cpp"
-#endif
-
-#endif