00001 /*---------------------------------------------------------------------+ 00002 | Library QgarLib, graphics analysis and recognition | 00003 | Copyright (C) 2002 Qgar Project, LORIA | 00004 | | 00005 | This library is free software; you can redistribute it and/or | 00006 | modify it under the terms of the GNU Lesser General Public | 00007 | License version 2.1, as published by the Free Software Foundation. | 00008 | | 00009 | This library is distributed in the hope that it will be useful, | 00010 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00011 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 00012 | See the GNU Lesser General Public License for more details. | 00013 | | 00014 | The GNU Lesser General Public License is included in the file | 00015 | LICENSE.LGPL, in the root directory of the Qgar packaging. See | 00016 | http://www.gnu.org/licenses/lgpl.html for the terms of the licence. | 00017 | To receive a paper copy, write to the Free Software Foundation, | 00018 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | 00019 | | 00020 | Contact Project Qgar for any information: | 00021 | LORIA - équipe Qgar | 00022 | B.P. 239, 54506 Vandoeuvre-lès-Nancy Cedex, France | 00023 | email: qgar-contact@loria.fr | 00024 | http://www.qgar.org/ | 00025 *---------------------------------------------------------------------*/ 00026 00027 00028 #ifndef ___QGAR_SEGMENT_H_INCLUDED__ 00029 #define ___QGAR_SEGMENT_H_INCLUDED__ 00030 00031 00032 /** 00033 * @file _QGAR_segment.H 00034 * @brief Global functions which compute segments. 00035 * 00036 * @warning <b>Not to be used as include file!</b> 00037 * <br>When working with primitives, use header file primitives.H. 00038 * 00039 * @author <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Gérald Masini">Gérald Masini</a> 00040 * @date February 03 2005, 19:19 00041 * @since Qgar 2.2 00042 */ 00043 00044 00045 // For RCS/CVS use: Do not delete 00046 /* $Id: _QGAR_segment.H,v 1.2 2005/09/14 10:53:19 masini Exp $ */ 00047 00048 00049 00050 namespace qgar 00051 { 00052 00053 00054 /** 00055 * @name Global functions which compute segments 00056 */ 00057 //@{ 00058 00059 00060 // ------------------------------------------------------------------- 00061 // P E R P E N D I C U L A R 00062 // ------------------------------------------------------------------- 00063 00064 00065 /** 00066 * @ingroup GLOB_PRIM_SEG 00067 * 00068 * @brief Return a segment perpendicular to the given segment. 00069 * 00070 * Its source is the given point, its target is the orthogonal 00071 * projection of the given point onto the line supporting 00072 * the given segment. 00073 * 00074 * @param aPt a point 00075 * @param aSeg a segment 00076 * 00077 * @warning The resulting segment has <b>double</b> coordinates. 00078 */ 00079 template <class T> 00080 inline GenSegment<double> 00081 qgPerpendicular(const GenPoint<T>& aPt, const GenSegment<T>& aSeg); 00082 00083 00084 /** 00085 * @ingroup GLOB_PRIM_SEG 00086 * 00087 * @brief Return a Qgar segment perpendicular to the given Qgar segment. 00088 * 00089 * Its source is the given point, its target is the orthogonal 00090 * projection of the given point onto the line supporting 00091 * the given segment. 00092 * Its color, thickness and outline are those of the given segment. 00093 * 00094 * @param aPt a point 00095 * @param aQSeg a Qgar segment 00096 * 00097 * @warning The resulting Qgar segment has <b>double</b> coordinates. 00098 */ 00099 template <class T> 00100 inline GenQgarSegment<double> 00101 qgPerpendicular(const GenPoint<T>& aPt, const GenQgarSegment<T>& aQSeg); 00102 00103 00104 // ------------------------------------------------------------------- 00105 00106 00107 //@} 00108 00109 00110 } // namespace qgar 00111 00112 00113 #endif /* ___QGAR_SEGMENT_H_INCLUDED__ */