Cinder

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

src/libtess2/tess.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 TESS_H
00033 #define TESS_H
00034 
00035 #include <setjmp.h>
00036 #include "bucketalloc.h"
00037 #include "mesh.h"
00038 #include "dict.h"
00039 #include "priorityq.h"
00040 #include "tesselator.h"
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 //typedef struct TESStesselator TESStesselator;
00047 
00048 struct TESStesselator {
00049 
00050     /*** state needed for collecting the input data ***/
00051     TESSmesh    *mesh;      /* stores the input contours, and eventually
00052                         the tessellation itself */
00053     int outOfMemory;
00054 
00055     /*** state needed for projecting onto the sweep plane ***/
00056 
00057     TESSreal normal[3]; /* user-specified normal (if provided) */
00058     TESSreal sUnit[3];  /* unit vector in s-direction (debugging) */
00059     TESSreal tUnit[3];  /* unit vector in t-direction (debugging) */
00060 
00061     TESSreal bmin[2];
00062     TESSreal bmax[2];
00063 
00064     /*** state needed for the line sweep ***/
00065     int windingRule;    /* rule for determining polygon interior */
00066 
00067     Dict *dict;     /* edge dictionary for sweep line */
00068     PriorityQ *pq;      /* priority queue of vertex events */
00069     TESSvertex *event;      /* current sweep event being processed */
00070 
00071     struct BucketAlloc* regionPool;
00072 
00073     void (*callCombine)( TESSreal coords[3], TESSreal weight[4] );
00074 
00075     TESSreal *vertices;
00076     int vertexCount;
00077     TESSindex *elements;
00078     int elementCount;
00079 
00080     TESSalloc alloc;
00081     
00082     jmp_buf env;            /* place to jump to when memAllocs fail */
00083 };
00084 
00085 #ifdef __cplusplus
00086 };
00087 #endif
00088 
00089 #endif