예제 #1
0
        //    #define MAX_FAST_ALLOC	(MAX(sizeof(EdgePair), \
        //                 MAX(sizeof(GLUvertex),sizeof(GLUface))))

        private GLUtessellatorImpl()
        {
            state = TessState.T_DORMANT;

            normal[0] = 0;
            normal[1] = 0;
            normal[2] = 0;

            relTolerance = GLU_TESS_DEFAULT_TOLERANCE;
            windingRule  = GLU.GLU_TESS_WINDING_ODD;
            flagBoundary = false;
            boundaryOnly = false;

            callBegin    = NULL_CB;
            callEdgeFlag = NULL_CB;
            callVertex   = NULL_CB;
            callEnd      = NULL_CB;
            callError    = NULL_CB;
            callCombine  = NULL_CB;
            //        callMesh = NULL_CB;

            callBeginData    = NULL_CB;
            callEdgeFlagData = NULL_CB;
            callVertexData   = NULL_CB;
            callEndData      = NULL_CB;
            callErrorData    = NULL_CB;
            callCombineData  = NULL_CB;

            polygonData = null;

            for (int i = 0; i < cache.Length; i++)
            {
                cache[i] = new CachedVertex();
            }
        }
예제 #2
0
        private void  cacheVertex(double[] coords, System.Object vertexData)
        {
            if (cache[cacheCount] == null)
            {
                cache[cacheCount] = new CachedVertex();
            }

            CachedVertex v = cache[cacheCount];

            v.data      = vertexData;
            v.coords[0] = coords[0];
            v.coords[1] = coords[1];
            v.coords[2] = coords[2];
            ++cacheCount;
        }
예제 #3
0
        private bool flushCache()
        {
            CachedVertex[] v = cache;

            mesh = Mesh.__gl_meshNewMesh();
            if (mesh == null)
            {
                return(false);
            }

            for (int i = 0; i < cacheCount; i++)
            {
                CachedVertex vertex = v[i];
                if (!addVertex(vertex.coords, vertex.data))
                {
                    return(false);
                }
            }
            cacheCount             = 0;
            flushCacheOnNextVertex = false;

            return(true);
        }
        private void cacheVertex(double[] coords, System.Object vertexData)
        {
            if (cache[cacheCount] == null)
            {
                cache[cacheCount] = new CachedVertex();
            }

            CachedVertex v = cache[cacheCount];

            v.data = vertexData;
            v.coords[0] = coords[0];
            v.coords[1] = coords[1];
            v.coords[2] = coords[2];
            ++cacheCount;
        }
        private int state; /* what begin/end calls have we seen? */

        #endregion Fields

        #region Constructors

        //    #define MAX_FAST_ALLOC	(MAX(sizeof(EdgePair), \
        //                 MAX(sizeof(GLUvertex),sizeof(GLUface))))
        private GLUtessellatorImpl()
        {
            state = TessState.T_DORMANT;

            normal[0] = 0;
            normal[1] = 0;
            normal[2] = 0;

            relTolerance = GLU_TESS_DEFAULT_TOLERANCE;
            windingRule = GLU.GLU_TESS_WINDING_ODD;
            flagBoundary = false;
            boundaryOnly = false;

            callBegin = NULL_CB;
            callEdgeFlag = NULL_CB;
            callVertex = NULL_CB;
            callEnd = NULL_CB;
            callError = NULL_CB;
            callCombine = NULL_CB;
            //        callMesh = NULL_CB;

            callBeginData = NULL_CB;
            callEdgeFlagData = NULL_CB;
            callVertexData = NULL_CB;
            callEndData = NULL_CB;
            callErrorData = NULL_CB;
            callCombineData = NULL_CB;

            polygonData = null;

            for (int i = 0; i < cache.Length; i++)
            {
                cache[i] = new CachedVertex();
            }
        }