Example #1
0
        /**
         * Creates a new combine context with the specified globe, resolution, and the default region of interest.
         *
         * @param globe      the globe to associate with this context. Shape geometry defined relative to a globe must use
         *                   this globe to compute that geometry.
         * @param resolution the minimum resolution, in radians. Used to filter shape detail and compute geometry for
         *                   resolution independent shapes.
         *
         * @throws java.lang.ArgumentException if the globe is null.
         */
        public CombineContext(Globe globe, double resolution)
        {
            if (globe == null)
            {
                String msg = Logging.getMessage("nullValue.GlobeIsNull");
                Logging.logger().severe(msg);
                throw new ArgumentException(msg);
            }

            GLUtessellatorCallback cb   = new TessCallbackAdapter(this); // forward GLU tessellator callbacks to tess* methods
            GLUtessellator         tess = GLU.gluNewTess();

            GLU.gluTessCallback(tess, GLU.GLU_TESS_BEGIN, cb);
            GLU.gluTessCallback(tess, GLU.GLU_TESS_VERTEX, cb);
            GLU.gluTessCallback(tess, GLU.GLU_TESS_END, cb);
            GLU.gluTessCallback(tess, GLU.GLU_TESS_COMBINE, cb);
            GLU.gluTessCallback(tess, GLU.GLU_TESS_ERROR, cb);
            GLU.gluTessProperty(tess, GLU.GLU_TESS_BOUNDARY_ONLY, GL.GL_TRUE);
            GLU.gluTessNormal(tess, 0, 0, 1);

            this.globe      = globe;
            this.resolution = resolution;
            this.tess       = tess;
        }