28package com.jogamp.graph.ui.shapes;
30import com.jogamp.graph.curve.OutlineShape;
31import com.jogamp.graph.curve.Region;
32import com.jogamp.graph.curve.opengl.GLRegion;
33import com.jogamp.graph.ui.GraphShape;
34import com.jogamp.graph.ui.Shape;
35import com.jogamp.math.FloatUtil;
36import com.jogamp.math.geom.AABBox;
37import com.jogamp.opengl.GL2ES2;
38import com.jogamp.opengl.GLProfile;
39import com.jogamp.opengl.util.texture.TextureSequence;
48 private float minX, minY, zPos;
51 private float lineWidth;
64 public Rectangle(
final int renderModes,
final float minX,
final float minY,
final float width,
final float height,
final float lineWidth,
final float zPos) {
71 this.lineWidth = lineWidth;
95 public Rectangle(
final int renderModes,
final float minX,
final float minY,
final float width,
final float height,
final float lineWidth) {
96 this(
renderModes, minX, minY, width, height, lineWidth, 0);
108 this(
renderModes, 0, 0, width, height, lineWidth, 0);
111 public final float getX() {
return minX; }
112 public final float getY() {
return minY; }
113 public final float getZ() {
return zPos; }
118 public void setPosition(
final float minX,
final float minY,
final float zPos) {
124 public void setDimension(
final float width,
final float height,
final float lineWidth) {
125 if( this.width != width || this.height != height || this.lineWidth != lineWidth ) {
127 this.height = height;
128 this.lineWidth = lineWidth;
140 final float x1 = minX;
141 final float y1 = minY;
144 final float z = zPos;
158 final float dxy = lineWidth;
159 shape.
moveTo(x1+dxy, y1+dxy, z);
160 shape.
lineTo(x1+dxy, y2-dxy, z);
161 shape.
lineTo(x2-dxy, y2-dxy, z);
162 shape.
lineTo(x2-dxy, y1+dxy, z);
163 shape.
lineTo(x1+dxy, y1+dxy, z);
A Generic shape objects which is defined by a list of Outlines.
final void setIsQuadraticNurbs()
Claim this outline's vertices are all OutlineShape.VerticesState#QUADRATIC_NURBS, hence no cubic tran...
final void moveTo(final float x, final float y, final float z)
Start a new position for the next line segment at given point x/y (P1).
final void lineTo(final float x, final float y, final float z)
Add a line segment, intersecting the last point and the given point x/y (P1).
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.
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 void markShapeDirty()
Marks the shape dirty, causing next draw() to recreate the Graph shape and reset the region.
final Vec4f rgbaColor
Default base-color w/o color channel, will be modulated w/ pressed- and toggle color.
final Shape setRotationPivot(final float px, final float py, final float pz)
Set unscaled rotation origin, aka pivot.
A GraphUI rectangle GraphShape.
Rectangle(final int renderModes, final float minX, final float minY, final float width, final float height, final float lineWidth)
Create a rectangular Graph based GLRegion UI Shape.
final float getLineWidth()
void addShapeToRegion(final GLProfile glp, final GL2ES2 gl)
Rectangle(final int renderModes, final float minX, final float minY, final float width, final float height, final float lineWidth, final float zPos)
Create a rectangular Graph based GLRegion UI Shape.
Rectangle(final int renderModes, final float width, final float height, final float lineWidth)
Create a rectangular Graph based GLRegion UI Shape.
void setBounds(final AABBox abox, final float lineWidth)
void setDimension(final float width, final float height, final float lineWidth)
void setPosition(final float minX, final float minY, final float zPos)
Rectangle(final int renderModes, final AABBox abox, final float lineWidth)
Create a rectangular Graph based GLRegion UI Shape.
Basic Float math utility functions.
static boolean isZero(final float a, final float epsilon)
Returns true if value is zero, i.e.
Axis Aligned Bounding Box.
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.