Cinder

  • Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

src/libtess2/sweep.h

Go to the documentation of this file.
00001 /*
00002 ** SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 
00003 ** Copyright (C) [dates of first publication] Silicon Graphics, Inc.
00004 ** All Rights Reserved.
00005 **
00006 ** Permission is hereby granted, free of charge, to any person obtaining a copy
00007 ** of this software and associated documentation files (the "Software"), to deal
00008 ** in the Software without restriction, including without limitation the rights
00009 ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
00010 ** of the Software, and to permit persons to whom the Software is furnished to do so,
00011 ** subject to the following conditions:
00012 ** 
00013 ** The above copyright notice including the dates of first publication and either this
00014 ** permission notice or a reference to http://oss.sgi.com/projects/FreeB/ shall be
00015 ** included in all copies or substantial portions of the Software. 
00016 **
00017 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
00018 ** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
00019 ** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SILICON GRAPHICS, INC.
00020 ** BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00021 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
00022 ** OR OTHER DEALINGS IN THE SOFTWARE.
00023 ** 
00024 ** Except as contained in this notice, the name of Silicon Graphics, Inc. shall not
00025 ** be used in advertising or otherwise to promote the sale, use or other dealings in
00026 ** this Software without prior written authorization from Silicon Graphics, Inc.
00027 */
00028 /*
00029 ** Author: Eric Veach, July 1994.
00030 */
00031 
00032 #ifndef SWEEP_H
00033 #define SWEEP_H
00034 
00035 #include "mesh.h"
00036 
00037 /* tessComputeInterior( tess ) computes the planar arrangement specified
00038 * by the given contours, and further subdivides this arrangement
00039 * into regions.  Each region is marked "inside" if it belongs
00040 * to the polygon, according to the rule given by tess->windingRule.
00041 * Each interior region is guaranteed be monotone.
00042 */
00043 int tessComputeInterior( TESStesselator *tess );
00044 
00045 
00046 /* The following is here *only* for access by debugging routines */
00047 
00048 #include "dict.h"
00049 
00050 /* For each pair of adjacent edges crossing the sweep line, there is
00051 * an ActiveRegion to represent the region between them.  The active
00052 * regions are kept in sorted order in a dynamic dictionary.  As the
00053 * sweep line crosses each vertex, we update the affected regions.
00054 */
00055 
00056 struct ActiveRegion {
00057     TESShalfEdge *eUp;      /* upper edge, directed right to left */
00058     DictNode *nodeUp;   /* dictionary node corresponding to eUp */
00059     int windingNumber;  /* used to determine which regions are
00060                             * inside the polygon */
00061     int inside;     /* is this region inside the polygon? */
00062     int sentinel;   /* marks fake edges at t = +/-infinity */
00063     int dirty;      /* marks regions where the upper or lower
00064                     * edge has changed, but we haven't checked
00065                     * whether they intersect yet */
00066     int fixUpperEdge;   /* marks temporary edges introduced when
00067                         * we process a "right vertex" (one without
00068                         * any edges leaving to the right) */
00069 };
00070 
00071 #define RegionBelow(r) ((ActiveRegion *) dictKey(dictPred((r)->nodeUp)))
00072 #define RegionAbove(r) ((ActiveRegion *) dictKey(dictSucc((r)->nodeUp)))
00073 
00074 #endif