当前位置: 首页>>代码示例>>Java>>正文


Java Vertex类代码示例

本文整理汇总了Java中com.jogamp.graph.geom.Vertex的典型用法代码示例。如果您正苦于以下问题:Java Vertex类的具体用法?Java Vertex怎么用?Java Vertex使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Vertex类属于com.jogamp.graph.geom包,在下文中一共展示了Vertex类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOutlineShapes

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
public static List<OutlineShape> getOutlineShapes(TypecastFont font, CharSequence string, float pixelSize,
        AffineTransform transform, Factory<? extends Vertex> vertexFactory) {
    Path2D[] paths = new Path2D[string.length()];
    getPaths(font, string, pixelSize, transform, paths);

    ArrayList<OutlineShape> shapes = new ArrayList<OutlineShape>();
    final int numGlyps = paths.length;
    for (int index = 0; index < numGlyps; index++) {
        if (paths[index] == null) {
            continue;
        }
        OutlineShape shape = new OutlineShape(vertexFactory);
        shapes.add(shape);
        PathIterator iterator = paths[index].iterator(transform);
        if (null != iterator) {
            while (!iterator.isDone()) {
                float[] coords = new float[6];
                int segmentType = iterator.currentSegment(coords);
                addPathVertexToOutline(shape, vertexFactory, coords, segmentType);
                iterator.next();
            }
        }
    }
    return shapes;
}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:26,代码来源:TypecastRenderer.java

示例2: GLEventListenerButton

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
public GLEventListenerButton(final Factory<? extends Vertex> factory, final int renderModes,
                             final float width, final float height, final int textureUnit,
                             final GLEventListener glel, final boolean useAlpha, final int fboWidth, final int fboHeight) {
    super(factory, renderModes, width, height, new ImageSequence(textureUnit, true));
    this.glel = glel;
    this.useAlpha = useAlpha;

    setColor(0.95f, 0.95f, 0.95f, 1.0f);
    setPressedColorMod(1f, 1f, 1f, 0.9f);
    setToggleOffColorMod(0.8f, 0.8f, 0.8f, 1.0f);
    setToggleOnColorMod(1.0f, 1.0f, 1.0f, 1.0f);

    this.fboWidth = fboWidth;
    this.fboHeight = fboHeight;
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:16,代码来源:GLEventListenerButton.java

示例3: MediaPlayerButton

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
/**
 * @param factory
 * @param renderModes
 * @param width
 * @param height
 * @param mPlayer
 * @param mPlayerListener
 */
public MediaPlayerButton(final Factory<? extends Vertex> factory, final int renderModes,
                         final float width, final float height,
                         final GLMediaPlayer mPlayer) {
    super(factory, renderModes, width, height, mPlayer);
    setColor(0.8f, 0.8f, 0.8f, 1.0f);
    setPressedColorMod(1.1f, 1.1f, 1.1f, 0.7f);
    setToggleOffColorMod(0.8f, 0.8f, 0.8f, 1.0f);
    setToggleOnColorMod(1.0f, 1.0f, 1.0f, 1.0f);
    setEnabled(false); // data and shader n/a yet
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:19,代码来源:MediaPlayerButton.java

示例4: LabelButton

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
public LabelButton(final Factory<? extends Vertex> factory, final int renderModes,
                   final Font labelFont, final String labelText,
                   final float width, final float height) {
    super(factory, renderModes | Region.COLORCHANNEL_RENDERING_BIT, width, height);
    this.label = new Label0(labelFont, labelText, new float[] { 1.33f, 1.33f, 1.33f, 1.0f }); // 0.75 * 1.33 = 1.0
    setColor(0.75f, 0.75f, 0.75f, 1.0f);
    setPressedColorMod(0.9f, 0.9f, 0.9f, 0.7f);
    setToggleOffColorMod(0.65f, 0.65f, 0.65f, 1.0f);
    setToggleOnColorMod(0.85f, 0.85f, 0.85f, 1.0f);
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:11,代码来源:LabelButton.java

示例5: ImageSeqButton

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
public ImageSeqButton(final Factory<? extends Vertex> factory, final int renderModes,
                     final float width, final float height, final ImageSequence texSeq) {
    super(factory, renderModes, width, height, texSeq);
    setColor(0.95f, 0.95f, 0.95f, 1.0f);
    setPressedColorMod(1f, 1f, 1f, 0.9f);
    setToggleOffColorMod(0.8f, 0.8f, 0.8f, 1.0f);
    setToggleOnColorMod(1.0f, 1.0f, 1.0f, 1.0f);
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:9,代码来源:ImageSeqButton.java

示例6: OutlineShape

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
/**
 * Create a new Outline based Shape
 */
public OutlineShape(Vertex.Factory<? extends Vertex> factory) {
    this.vertexFactory = factory;
    this.outlines = new ArrayList<Outline>(3);
    this.outlines.add(new Outline());
    this.outlineState = VerticesState.UNDEFINED;
    this.bbox = new AABBox();
    this.dirtyBits = 0;
}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:12,代码来源:OutlineShape.java

示例7: addVertex

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
/**
 * Adds a vertex to the last open outline in the shape.
 * 
 * @param v
 *            the vertex to be added to the OutlineShape
 */
public final void addVertex(Vertex v) {
    final Outline lo = getLastOutline();
    lo.addVertex(v);
    if (0 == (dirtyBits & DIRTY_BOUNDS)) {
        bbox.resize(lo.getBounds());
    }
}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:14,代码来源:OutlineShape.java

示例8: subdivideTriangle

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
private void subdivideTriangle(final Outline outline, Vertex a, Vertex b, Vertex c, int index) {
    float[] v1 = VectorUtil.mid(a.getCoord(), b.getCoord());
    float[] v3 = VectorUtil.mid(b.getCoord(), c.getCoord());
    float[] v2 = VectorUtil.mid(v1, v3);

    // drop off-curve vertex to image on the curve
    b.setCoord(v2, 0, 3);
    b.setOnCurve(true);

    outline.addVertex(index, vertexFactory.create(v1, 0, 3, false));
    outline.addVertex(index + 2, vertexFactory.create(v3, 0, 3, false));
}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:13,代码来源:OutlineShape.java

示例9: checkTriOverlaps

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
private Vertex checkTriOverlaps(Vertex a, Vertex b, Vertex c) {
    int count = getOutlineNumber();
    for (int cc = 0; cc < count; cc++) {
        final Outline outline = getOutline(cc);
        int vertexCount = outline.getVertexCount();
        for (int i = 0; i < vertexCount; i++) {
            final Vertex current = outline.getVertex(i);
            if (current.isOnCurve() || current.equals(a) || current.equals(b) || current.equals(c)) {
                continue;
            }
            final Vertex nextV = outline.getVertex((i + 1) % vertexCount);
            final Vertex prevV = outline.getVertex((i + vertexCount - 1) % vertexCount);

            // skip neighboring triangles
            if (prevV.equals(c) || nextV.equals(a)) {
                continue;
            }

            if (VectorUtil.vertexInTriangle(a.getCoord(), b.getCoord(), c.getCoord(), current.getCoord())
                    || VectorUtil.vertexInTriangle(a.getCoord(), b.getCoord(), c.getCoord(), nextV.getCoord())
                    || VectorUtil.vertexInTriangle(a.getCoord(), b.getCoord(), c.getCoord(), prevV.getCoord())) {

                return current;
            }
            if (VectorUtil.tri2SegIntersection(a, b, c, prevV, current)
                    || VectorUtil.tri2SegIntersection(a, b, c, current, nextV)
                    || VectorUtil.tri2SegIntersection(a, b, c, prevV, nextV)) {
                return current;
            }
        }
    }
    return null;
}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:34,代码来源:OutlineShape.java

示例10: transformOutlines2Quadratic

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
private void transformOutlines2Quadratic() {
    int count = getOutlineNumber();
    for (int cc = 0; cc < count; cc++) {
        final Outline outline = getOutline(cc);
        int vertexCount = outline.getVertexCount();

        for (int i = 0; i < vertexCount; i++) {
            final Vertex currentVertex = outline.getVertex(i);
            final Vertex nextVertex = outline.getVertex((i + 1) % vertexCount);
            if (!currentVertex.isOnCurve() && !nextVertex.isOnCurve()) {
                final float[] newCoords = VectorUtil.mid(currentVertex.getCoord(), nextVertex.getCoord());
                final Vertex v = vertexFactory.create(newCoords, 0, 3, true);
                i++;
                vertexCount++;
                outline.addVertex(i, v);
            }
        }
        if (vertexCount <= 0) {
            outlines.remove(outline);
            cc--;
            count--;
            continue;
        }

        if (vertexCount > 0) {
            if (VectorUtil.checkEquality(outline.getVertex(0).getCoord(), outline.getLastVertex().getCoord())) {
                outline.removeVertex(vertexCount - 1);
            }
        }
    }
    outlineState = VerticesState.QUADRATIC_NURBS;
}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:33,代码来源:OutlineShape.java

示例11: generateVertexIds

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
private void generateVertexIds() {
    int maxVertexId = 0;
    for (int i = 0; i < outlines.size(); i++) {
        final ArrayList<Vertex> vertices = outlines.get(i).getVertices();
        for (int pos = 0; pos < vertices.size(); pos++) {
            Vertex vert = vertices.get(pos);
            vert.setId(maxVertexId);
            maxVertexId++;
        }
    }
}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:12,代码来源:OutlineShape.java

示例12: getVertices

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
/**
 * @return the list of concatenated vertices associated with all
 *         {@code Outline}s of this object
 */
public List<Vertex> getVertices() {
    ArrayList<Vertex> vertices = new ArrayList<Vertex>();
    for (int i = 0; i < outlines.size(); i++) {
        vertices.addAll(outlines.get(i).getVertices());
    }
    return vertices;
}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:12,代码来源:OutlineShape.java

示例13: addPathVertexToOutline

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
private static void addPathVertexToOutline(OutlineShape shape, Factory<? extends Vertex> vertexFactory,
        float[] coords, int segmentType) {
    switch (segmentType) {
    case PathIterator.SEG_MOVETO:
        shape.closeLastOutline();
        shape.addEmptyOutline();
        shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));
        break;
    case PathIterator.SEG_LINETO:
        shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));
        break;
    case PathIterator.SEG_QUADTO:
        shape.addVertex(0, vertexFactory.create(coords, 0, 2, false));
        shape.addVertex(0, vertexFactory.create(coords, 2, 2, true));
        break;
    case PathIterator.SEG_CUBICTO:
        shape.addVertex(0, vertexFactory.create(coords, 0, 2, false));
        shape.addVertex(0, vertexFactory.create(coords, 2, 2, false));
        shape.addVertex(0, vertexFactory.create(coords, 4, 2, true));
        break;
    case PathIterator.SEG_CLOSE:
        shape.closeLastOutline();
        break;
    default:
        throw new IllegalArgumentException("Unhandled Segment Type: " + segmentType);
    }
}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:28,代码来源:TypecastRenderer.java

示例14: RoundButton

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
protected RoundButton(final Factory<? extends Vertex> factory, final int renderModes, final float width, final float height) {
    super(factory, renderModes);
    this.width = width;
    this.height = height;
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:6,代码来源:RoundButton.java

示例15: UIShape

import com.jogamp.graph.geom.Vertex; //导入依赖的package包/类
public UIShape(final Factory<? extends Vertex> factory, final int renderModes) {
    this.vertexFactory = factory;
    this.renderModes = renderModes;
    this.box = new AABBox();
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:6,代码来源:UIShape.java


注:本文中的com.jogamp.graph.geom.Vertex类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。