Add LCOV remarkers to increase line coverage rate
[platform/core/api/maps-service.git] / src / view / poly_shape_hit_test.h
1 /* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
2  *
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
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15
16 #ifndef __MAPS_VIEW_POLY_SHAPE_HIT_TEST_H__
17 #define __MAPS_VIEW_POLY_SHAPE_HIT_TEST_H__
18
19
20 #include <maps_util.h>
21
22
23 //LCOV_EXCL_START
24 namespace view
25 {
26         class poly_shape_hit_test {
27         private:
28                 vector<float> __x;
29                 vector<float> __y;
30                 float accuracy;
31         public:
32                 poly_shape_hit_test() : accuracy(10.) {}
33         public:
34                 void add_point(const float x, const float y);
35                 bool hit_test(const float x, const float y, const bool polygon, const int w = 0) const;
36         protected:
37                 bool hit_test_bounding_box(const float x, const float y) const;
38                 bool hit_test_polyline(const float x, const float y, const bool polygon, const int w) const;
39                 bool hit_test_segment(const float x1, const float y1, const float x2, const float y2,
40                         const float x, const float y, const int w = 0) const;
41                 bool hit_test_vertices(const float x, const float y) const;
42                 bool pnpoly(const float x, const float y) const;
43         };
44 };
45 //LCOV_EXCL_STOP
46
47 #endif                          /* __MAPS_VIEW_POLY_SHAPE_HIT_TEST_H__ */