MimmoCGUtils.hpp
1 /*---------------------------------------------------------------------------*\
2  *
3  * mimmo
4  *
5  * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6  *
7  * -------------------------------------------------------------------------
8  * License
9  * This file is part of mimmo.
10  *
11  * mimmo is free software: you can redistribute it and/or modify it
12  * under the terms of the GNU Lesser General Public License v3 (LGPL)
13  * as published by the Free Software Foundation.
14  *
15  * mimmo is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with mimmo. If not, see <http://www.gnu.org/licenses/>.
22  *
23 \*---------------------------------------------------------------------------*/
24 # ifndef __MIMMOCGUTILS_HPP__
25 # define __MIMMOCGUTILS_HPP__
26 
27 # include "mimmoTypeDef.hpp"
28 
29 namespace mimmo{
30 
31 
36 namespace mimmoCGUtils{
37 
38  double distancePointPolygon(const darray3E & point, const dvecarr3E & vertCoords);
39  bool isPointInsideSegment(const darray3E & point, const darray3E & V0, const darray3E & V1, double tol = 1.E-12);
40  bool isPointInsideTriangle(const darray3E & point, const darray3E & V0, const darray3E & V1, const darray3E & V2, double tol = 1.E-12);
41  bool isPointInsidePolygon(const darray3E & point, const dvecarr3E & vertCoords, double tol = 1.E-12);
42 
43 }; //end namespace mimmoCGUtils
44 
45 } //end namespace mimmo
46 
47 #endif
std::vector< darray3E > dvecarr3E
double distancePointPolygon(const darray3E &p, const dvecarr3E &vertCoords)
bool isPointInsideSegment(const darray3E &p, const darray3E &V0, const darray3E &V1, double tol)
bool isPointInsidePolygon(const darray3E &p, const dvecarr3E &vertCoords, double tol)
std::array< double, 3 > darray3E
bool isPointInsideTriangle(const darray3E &p, const darray3E &V0, const darray3E &V1, const darray3E &V2, double tol)