![]() |
Tulip
4.6.0
Better Visualization Through Research
|
00001 /* 00002 * 00003 * This file is part of Tulip (www.tulip-software.org) 00004 * 00005 * Authors: David Auber and the Tulip development Team 00006 * from LaBRI, University of Bordeaux 00007 * 00008 * Tulip is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation, either version 3 00011 * of the License, or (at your option) any later version. 00012 * 00013 * Tulip is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * See the GNU General Public License for more details. 00017 * 00018 */ 00019 ///@cond DOXYGEN_HIDDEN 00020 00021 00022 #ifndef DOXYGEN_NOTFOR_DEVEL 00023 #ifndef _TLP_PLANE_H_ 00024 #define _TLP_PLANE_H_ 00025 00026 #include <tulip/Coord.h> 00027 00028 namespace tlp { 00029 /** \brief Class used to describe a plane 00030 * 00031 * This class is used to represent a plane with it's coordinates. 00032 * it follows the basic plane equation aX + bY + cZ + d = 0 00033 * 00034 * \author Delorme Maxime 00035 * \date 23/07/2005 00036 * \version 1.0 00037 */ 00038 class TLP_SCOPE Plane { 00039 public: 00040 00041 float a, b, c, d; 00042 00043 /** 00044 * Constructs a Plane 00045 * \attention a = b = c = d = 1.0f 00046 */ 00047 Plane(); 00048 00049 /** 00050 * Constructs a plane with given coordinates 00051 */ 00052 Plane(float a, float b, float c, float d); 00053 00054 /** 00055 * Destructs a plane 00056 */ 00057 ~Plane(); 00058 00059 /** 00060 * Static function used to determine the last coordinate of a point in order to have it on the plane 00061 * It follows the equation : Z = (aX + bY + d) / c 00062 */ 00063 static float planeValue(float a, float b, float c, float d, float x, float y); 00064 00065 /** 00066 * Computes a quad from the plane 00067 */ 00068 bool computePlane(Coord &p1, Coord &p2, Coord &p3, Coord &p4); 00069 00070 /** 00071 * Given a point, this function returns aX + bY + cZ + d. 00072 * This is mainly used to determine if a point is above or under the plane. 00073 */ 00074 float planePointValue(const Coord &pos); 00075 }; 00076 00077 } 00078 #endif 00079 #endif //DOXYGEN_NOTFOR_DEVEL 00080 ///@endcond