SyFi
0.3
|
00001 // Copyright (C) 2006-2009 Kent-Andre Mardal and Simula Research Laboratory 00002 // 00003 // This file is part of SyFi. 00004 // 00005 // SyFi is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 2 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // SyFi is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with SyFi. If not, see <http://www.gnu.org/licenses/>. 00017 00018 #ifndef PTV_TOOLS_IS_INCLUDED 00019 #define PTV_TOOLS_IS_INCLUDED 00020 00021 #include "Ptv.h" 00022 #include <vector> 00023 00024 using namespace std; 00025 00026 namespace SyFi 00027 { 00028 00029 void sort_vector(vector<Ptv>& a); 00030 00031 void set_tolerance(double tolerance); 00032 00033 double mul(const Ptv&a, const Ptv& b); 00034 00035 double norm(const Ptv& a); 00036 00037 void normalize(Ptv& a); 00038 00039 void add(const Ptv&a, const Ptv& b, Ptv& c); 00040 00041 void sub(const Ptv&a, const Ptv& b, Ptv& c); 00042 00043 void cross(const Ptv& a, const Ptv& b, Ptv& c); 00044 00045 bool is_equal(Ptv& a, Ptv& b); 00046 00047 bool line_contains(Ptv& e0, Ptv& e1, Ptv& p); 00048 00049 bool is_inside_triangle(Ptv& e0, Ptv& e1, Ptv& e2, Ptv& p); 00050 00051 bool contains2D(Ptv& e0, Ptv& e1, Ptv& p); 00052 00053 bool contains3D(Ptv& e0, Ptv& e1, Ptv& e2, Ptv& p); 00054 00055 } // namespace SyFi 00056 #endif