JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
Glyph04FreeSans_0.java
Go to the documentation of this file.
1/**
2 * Copyright 2023 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28package com.jogamp.opengl.demos.graph.ui.testshapes;
29
30import com.jogamp.graph.curve.OutlineShape;
31import com.jogamp.graph.ui.GraphShape;
32import com.jogamp.opengl.GL2ES2;
33import com.jogamp.opengl.GLProfile;
34
35/**
36 * GPU based resolution independent test object
37 * - FreeSans, '0'
38 * - TTF Shape for Glyph 19
39 */
40public class Glyph04FreeSans_0 extends GraphShape {
41
42 public Glyph04FreeSans_0(final int renderModes) {
43 super(renderModes);
44 }
45
46 @Override
47 protected void addShapeToRegion(final GLProfile glp, final GL2ES2 gl) {
48 final OutlineShape shape = new OutlineShape();
49
50 // Start TTF Shape for Glyph 19
51 // 000: B0a: move-to p0
52 // Shape.MoveTo:
53 shape.closeLastOutline(false);
54 shape.addEmptyOutline();
55 shape.addVertex(0, 0.043000f, 0.343000f, true);
56 // 000: B4: quad-to p0-p1-p2h **** MID
57 // Shape.QuadTo:
58 shape.addVertex(0, 0.043000f, 0.432000f, false);
59 shape.addVertex(0, 0.058000f, 0.500000f, true);
60 // 002: B5: quad-to pMh-p0-p1h ***** MID
61 // Shape.QuadTo:
62 shape.addVertex(0, 0.073000f, 0.568000f, false);
63 shape.addVertex(0, 0.096000f, 0.606000f, true);
64 // 003: B5: quad-to pMh-p0-p1h ***** MID
65 // Shape.QuadTo:
66 shape.addVertex(0, 0.119000f, 0.645000f, false);
67 shape.addVertex(0, 0.151000f, 0.669000f, true);
68 // 004: B5: quad-to pMh-p0-p1h ***** MID
69 // Shape.QuadTo:
70 shape.addVertex(0, 0.183000f, 0.693000f, false);
71 shape.addVertex(0, 0.212000f, 0.701000f, true);
72 // 005: B6: quad-to pMh-p0-p1
73 // Shape.QuadTo:
74 shape.addVertex(0, 0.242000f, 0.709000f, false);
75 shape.addVertex(0, 0.275000f, 0.709000f, true);
76 // 006: B2: quad-to p0-p1-p2
77 // Shape.QuadTo:
78 shape.addVertex(0, 0.507000f, 0.709000f, false);
79 shape.addVertex(0, 0.507000f, 0.337000f, true);
80 // 008: B4: quad-to p0-p1-p2h **** MID
81 // Shape.QuadTo:
82 shape.addVertex(0, 0.507000f, 0.162000f, false);
83 shape.addVertex(0, 0.448000f, 0.070000f, true);
84 // 010: B6: quad-to pMh-p0-p1
85 // Shape.QuadTo:
86 shape.addVertex(0, 0.388000f, -0.023000f, false);
87 shape.addVertex(0, 0.275000f, -0.023000f, true);
88 // 011: B4: quad-to p0-p1-p2h **** MID
89 // Shape.QuadTo:
90 shape.addVertex(0, 0.161000f, -0.023000f, false);
91 shape.addVertex(0, 0.102000f, 0.070000f, true);
92 // 013: B6: quad-to pMh-p0-p1
93 // Shape.QuadTo:
94 shape.addVertex(0, 0.043000f, 0.164000f, false);
95 shape.addVertex(0, 0.043000f, 0.343000f, true);
96 System.err.println("Glyph04FreeSans_0.shape01a.winding_area: "+shape.getWindingOfLastOutline());
97 shape.closeLastOutline(false);
98
99 // 021: B0b: move-to pM
100 // Shape.MoveTo:
101 shape.closeLastOutline(false);
102 shape.addEmptyOutline();
103 shape.addVertex(0, 0.417000f, 0.345000f, true);
104 // 021: B4: quad-to p0-p1-p2h **** MID
105 // Shape.QuadTo:
106 shape.addVertex(0, 0.417000f, 0.631000f, false);
107 shape.addVertex(0, 0.275000f, 0.631000f, true);
108 // 015: B6: quad-to pMh-p0-p1
109 // Shape.QuadTo:
110 shape.addVertex(0, 0.133000f, 0.631000f, false);
111 shape.addVertex(0, 0.133000f, 0.342000f, true);
112 // 016: B2: quad-to p0-p1-p2
113 // Shape.QuadTo:
114 shape.addVertex(0, 0.133000f, 0.050000f, false);
115 shape.addVertex(0, 0.273000f, 0.050000f, true);
116 // 018: B4: quad-to p0-p1-p2h **** MID
117 // Shape.QuadTo:
118 shape.addVertex(0, 0.347000f, 0.050000f, false);
119 shape.addVertex(0, 0.382000f, 0.122000f, true);
120 // 020: B6: quad-to pMh-p0-p1
121 // Shape.QuadTo:
122 shape.addVertex(0, 0.417000f, 0.194000f, false);
123 shape.addVertex(0, 0.417000f, 0.345000f, true);
124 System.err.println("Glyph04FreeSans_0.shape02a.winding_area: "+shape.getWindingOfLastOutline());
125 shape.closeLastOutline(false);
126
127 // End Shape for Glyph 19
128
129 shape.setIsQuadraticNurbs();
131
132 resetGLRegion(glp, gl, null, shape);
133 region.addOutlineShape(shape, null, rgbaColor);
134 box.resize(shape.getBounds());
136 }
137
138 @Override
139 public String getSubString() {
140 return super.getSubString();
141 }
142}
A Generic shape objects which is defined by a list of Outlines.
final Winding getWindingOfLastOutline()
Compute the Winding of the getLastOutline() using the VectorUtil#area(ArrayList) function over all of...
final void addVertex(final Vertex v)
Adds a vertex to the last open outline to the shape's tail.
final void setIsQuadraticNurbs()
Claim this outline's vertices are all OutlineShape.VerticesState#QUADRATIC_NURBS, hence no cubic tran...
final void setSharpness(final float s)
Sets sharpness, defaults to DEFAULT_SHARPNESS.
final void closeLastOutline(final boolean closeTail)
Closes the last outline in the shape.
final void addEmptyOutline()
Add a new empty Outline to the end of this shape's outline list.
final void addOutlineShape(final OutlineShape shape, final AffineTransform t, final Vec4f rgbaColor)
Add the given OutlineShape to this region with the given optional AffineTransform.
Definition: Region.java:616
Graph based GLRegion Shape.
Definition: GraphShape.java:55
final void resetGLRegion(final GLProfile glp, final GL2ES2 gl, final TextureSequence colorTexSeq, int vertexCount, int indexCount)
Reset the GLRegion and reserving its buffers to have a free capacity for vertexCount and indexCount e...
final Vec4f rgbaColor
Default base-color w/o color channel, will be modulated w/ pressed- and toggle color.
Definition: Shape.java:261
final Shape setRotationPivot(final float px, final float py, final float pz)
Set unscaled rotation origin, aka pivot.
Definition: Shape.java:620
final AABBox resize(final AABBox newBox)
Resize the AABBox to encapsulate another AABox.
Definition: AABBox.java:274
final Vec3f getCenter()
Returns computed center of this AABBox of getLow() and getHigh().
Definition: AABBox.java:737
Specifies the the OpenGL profile.
Definition: GLProfile.java:77
void addShapeToRegion(final GLProfile glp, final GL2ES2 gl)