polygon.h

00001 
00002 /*---------------------------------------------------------------------------
00003                                     E.S.O.
00004  ----------------------------------------------------------------------------
00005    File name    :   polygon.h
00006    Author       :   N.Devillard
00007    Created on   :   February 2000
00008    Language     :   ANSI C
00009                     Part of ECLIPSE library for Adonis
00010    Description  :   Polygon handling routines
00011  *--------------------------------------------------------------------------*/
00012 
00013 /*
00014 
00015     $Id: polygon.h,v 1.1 2003/09/03 12:50:47 amodigli Exp $
00016     $Author: amodigli $
00017     $Date: 2003/09/03 12:50:47 $
00018     $Revision: 1.1 $
00019 
00020 */
00021 
00022 #ifndef _POLYGON_H_
00023 #define _POLYGON_H_
00024 
00025 /*---------------------------------------------------------------------------
00026                             Includes    
00027  ---------------------------------------------------------------------------*/
00028 
00029 #include "local_types.h"
00030 
00031 
00032 /*---------------------------------------------------------------------------
00033                         Function ANSI C prototypes
00034  ---------------------------------------------------------------------------*/
00035 
00036 
00037 
00038 /*---------------------------------------------------------------------------
00039    Function :   polygon_contains_point()
00040    In       :   polygon as a list of dpoints, the dpoint to check
00041    Out      :   1 if point is inside polygon, 0 if not
00042    Job      :   find out if a point is inside a polygon
00043    Notice   :
00044  ---------------------------------------------------------------------------*/
00045 
00046 
00047 int polygon_contains_point(
00048     dpoint  *   poly,
00049     int         np,
00050     dpoint  *   pt
00051 );
00052 
00053 /*---------------------------------------------------------------------------
00054    Function :   polygon_load_from_file()
00055    In       :   FILE *
00056    Out      :   newly allocated list of dpoints, number of points read
00057    Job      :   read *one* polygon definition from an ASCII file
00058    Notice   :   returns NULL in case of error
00059 
00060    A polygon definition file contains potentially several polygons, like:
00061 
00062 #
00063 # Polygon definition file
00064 #
00065 
00066 10 20 11 23 43 128 78 29
00067 11 98 76 56 12 27
00068 
00069     Blank lines and lines starting with '#' are ignored.
00070     Polygons are defined by couples of floating-point values, giving
00071     the vertices in the correct order.
00072 
00073     This routine expects an opened file pointer, pointing to the
00074     beginning of the next line to read. It returns a list of dpoints
00075     corresponding to the next valid line, or NULL if none can be
00076     found.
00077  ---------------------------------------------------------------------------*/
00078 
00079 dpoint *
00080 polygon_load_from_file(
00081     FILE    *   polygon_file,
00082     int     *   np
00083 ) ;
00084 
00085 
00086 #endif

Generated on Wed Oct 26 13:08:54 2005 for SINFONI Pipeline Reference Manual by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001