1 /* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef __MAPS_VIEW_POLY_SHAPE_HIT_TEST_H__
17 #define __MAPS_VIEW_POLY_SHAPE_HIT_TEST_H__
20 #include <maps_util.h>
25 class poly_shape_hit_test {
31 poly_shape_hit_test() : accuracy(10.) {}
33 void add_point(const float x, const float y);
34 bool hit_test(const float x, const float y, const bool polygon, const int w = 0) const;
36 bool hit_test_bounding_box(const float x, const float y) const;
37 bool hit_test_polyline(const float x, const float y, const bool polygon, const int w) const;
38 bool hit_test_segment(const float x1, const float y1, const float x2, const float y2,
39 const float x, const float y, const int w = 0) const;
40 bool hit_test_vertices(const float x, const float y) const;
41 bool pnpoly(const float x, const float y) const;
45 #endif /* __MAPS_VIEW_POLY_SHAPE_HIT_TEST_H__ */