28package com.jogamp.graph.ui.shapes;
32import com.jogamp.graph.curve.OutlineShape;
33import com.jogamp.graph.curve.Region;
34import com.jogamp.graph.curve.opengl.GLRegion;
35import com.jogamp.graph.font.Font;
36import com.jogamp.graph.font.Font.Glyph;
37import com.jogamp.graph.ui.GraphShape;
38import com.jogamp.math.Vec3f;
39import com.jogamp.math.geom.AABBox;
40import com.jogamp.math.geom.plane.AffineTransform;
41import com.jogamp.opengl.GL2ES2;
42import com.jogamp.opengl.GLProfile;
43import com.jogamp.opengl.util.texture.TextureSequence;
54 private final Glyph glyph;
55 private final int regionVertCount;
56 private final int regionIdxCount;
57 private final Vec3f origPos;
70 this.origPos =
new Vec3f(x, y, 0f);
75 regionVertCount = vertIndexCount[0];
76 regionIdxCount = vertIndexCount[1];
145 final Font font,
final CharSequence text)
162 if(
null != shape ) {
170 resetGLRegion(glp, gl,
null, regionVertCount, regionIdxCount);
176 resetGLRegion(glp, gl,
null, regionVertCount, regionIdxCount);
182 return super.getSubString()+
", origPos " + origPos.x() +
" / " + origPos.y() +
", cp 0x" + Integer.toHexString(glyph.
getCodepoint());
A Generic shape objects which is defined by a list of Outlines.
final void setSharpness(final float s)
Sets sharpness, defaults to DEFAULT_SHARPNESS.
Abstract Outline shape representation define the method an OutlineShape(s) is bound and rendered.
final void addOutlineShape(final OutlineShape shape, final AffineTransform t, final Vec4f rgbaColor)
Add the given OutlineShape to this region with the given optional AffineTransform.
static final int[] countOutlineShape(final OutlineShape shape, final int[] vertIndexCount)
Count required number of vertices and indices adding to given int[2] vertIndexCount array.
Graph based GLRegion Shape.
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.
final Shape setVisible(final boolean v)
Enable (default) or disable this shape's visibility.
final Shape setRotationPivot(final float px, final float py, final float pz)
Set unscaled rotation origin, aka pivot.
Representing a single Font.Glyph as a GraphShape.
Font getFont()
Returns the Font used to render the text.
float getLineHeight()
Returns Font#getLineHeight().
Vec3f getOrigPos()
Returns the unscaled original position of this glyph, e.g.
static final AABBox processString(final List< GlyphShape > res, final int renderModes, final Font font, final CharSequence text)
Process the given text resulting in a list of GlyphShapes with stored original position getOrigX() an...
GlyphShape(final int renderModes, final Glyph glyph, final Vec3f pos)
Creates a new GlyphShape.
GlyphShape(final int renderModes, final Font font, final char codepoint, final float x, final float y)
Creates a new GlyphShape.
Glyph getGlyph()
Returns the Font.Glyph to be rendered.
GlyphShape(final GlyphShape orig)
GlyphShape copy-ctor.
GlyphShape(final int renderModes, final Glyph glyph, final float x, final float y)
Creates a new GlyphShape.
void addShapeToRegion(final GLProfile glp, final GL2ES2 gl)
3D Vector based upon three float components.
Axis Aligned Bounding Box.
final AABBox reset()
Resets this box to the inverse low/high, allowing the next resize(float, float, float) command to hit...
final AABBox resize(final AABBox newBox)
Resize the AABBox to encapsulate another AABox.
final Vec3f getCenter()
Returns computed center of this AABBox of getLow() and getHigh().
Specifies the the OpenGL profile.
General purpose Font.Glyph visitor.
boolean isNonContour()
Returns true if isWhitespace() or isUndefined().
Font getFont()
Returns the Font owning this Glyph.
char getCodepoint()
Returns this glyph's mapped (unicode) codepoint symbol.
AABBox getBounds(final AABBox dest)
Returns the AABBox in font em-size [0..1], copying into given dest.
Interface wrapper for font implementation.
Glyph getGlyph(final String name)
Returns the Glyph mapped to given name.
float getLineHeight()
Returns line height, baseline-to-baseline in em-size [0..1], composed from ‘hhea’ table entries.
AABBox processString(final Font.GlyphVisitor visitor, final AffineTransform transform, final CharSequence string)
Try using processString(GlyphVisitor, AffineTransform, CharSequence, AffineTransform,...