public class AnnulusWidget extends JOGLEdgedFacetedWidget
A circular annulus.
The face geometry is tessellated into radial wedges, with defined normals. The edge geometry is composed of the two perimeter circles.
The radius and radial width are mutable, and the annulus is centered at
the origin of the local coordinate frame, with outward normal along the
positive Z axis. It may be further positioned e.g. by manipulating Widget.rx
.
trackWidgetLength(float...)
may be called to enable Widget.widgetLength
tracking, which causes the inner radius and/or the radial width to track
Widget.widgetLength
*trackInnerRadiusFactor
corresp. Widget.widgetLength
*trackWidthFactor
.
Face vertex array is one tri strip in ccw order from (ir, 0, 0).
Edge vertex array is two line strips in ccw order from (ir, 0, 0) and (ir+w, 0, 0).
Copyright (C) 2008 Marsette A. Vona, III
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
cvsid |
static int |
DEF_NUM_SECTORS
default
ns |
protected float |
innerRadius
current inner radius
|
int |
ns
number of azimuth and elevation sectors
|
float |
sectorAngle
angle span of each sector
|
protected float |
trackInnerRadiusFactor
mapping from
Widget.widgetLength to radius, NaN if none |
protected float |
trackWidthFactor
mapping from
Widget.widgetLength to radial width, NaN if none |
protected float |
width
current radial width
|
edgeGeometry, edgeVertices, faceGeometry, faceVertices, X, Y, Z
DASHED_PATTERN, DEF_EDGE_COLOR, DEF_OFFSET_BIAS, DEF_OFFSET_FACTOR, DOTTED_PATTERN, edgeAppearance, edgeColoringAttributes, edgeLineAttributes, EDGES, edgeTransparencyAttributes, facePolygonAttributes, SOLID_PATTERN
faceAppearance, faceMaterial, FACES, faceTransparencyAttributes
alpha, appearance, autoSetBoundingSpheres, boundingSphereCenter, boundingSphereCenterInView, boundingSphereRadius, boundingSphereRadiusInView, dbgEnabled, dbgNormalsGeometry, dbgNormalsVertices, dbgSpheresGeometry, dbgSpheresVertices, DEF_DBG_NORMAL_LENGTH, DEF_WIDGET_LENGTH, enabled, geometry, numGeometries, primitiveIterator, propertyMap, rx, vertexAccessor, widgetLength
Constructor and Description |
---|
AnnulusWidget()
Covers
AnnulusWidget(float, float, int) , uses DEF_NUM_SECTORS , innerRadius = 0.25f and width =
0.25f. |
AnnulusWidget(float innerRadius,
float width)
Covers
AnnulusWidget(float, float, int) , uses DEF_NUM_SECTORS . |
AnnulusWidget(float innerRadius,
float width,
int numSectors)
Creates a new AnnulusWidget with given radius, radial
width, and
ns . |
Modifier and Type | Method and Description |
---|---|
boolean |
setInnerRadius(float innerRadius)
covers
setLengths(float, float) , only changes inner radius |
boolean |
setLengths(float innerRadius,
float width)
Set the inner radius and radial width.
|
boolean |
setWidth(float width)
covers
setLengths(float, float) , only changes radial width |
void |
trackWidgetLength(float... trackFactor)
Set
trackInnerRadiusFactor and trackWidthFactor , see
class header doc. |
protected void |
widgetLengthChanged()
implements
Widget.widgetLength tracking, see class header doc |
gevc, gfnc, gfvc, sev, sevc, sfn, sfnc, sfv, sfvc
enableEdges, getEdgeAppearance, getEdgeGeometry, setAlpha, setColor, setColor, setEdgeAlpha, setEdgeColor, setEdgeColor, setEdgePattern, setEdgePattern, setEdgeWidth, setFaceOffset, setFaceOffsetBias, setFaceOffsetFactor
enableFaces, getFaceAppearance, getFaceGeometry, setFaceAlpha, setFaceColor, setFaceColor
cons, countGeometryArrays, disableBoundingSphere, disableBoundingSpheres, dump, dump, enableDBGGeometry, enableGeometry, ensureBoundingSpheresInView, getAppearance, getBoundingSphereCenter, getBoundingSphereRadius, getGeometry, getProperty, getWidget, getWidgetAlpha, hasBoundingSphere, hasBoundingSphereInView, hasProperty, indexOf, populateFrom, recomputeBoundingSphere, recomputeBoundingSpheres, removeDBGNormals, removeDBGSpheres, removeGeometry, removeGeometry, removeProperty, replaceAppearanceWithClone, replaceGeometryWithClone, scaleWidget, setAppearance, setBoundingSphereCenter, setBoundingSphereRadius, setGeometry, setGeometryAlpha, setGeometryAlpha, setGeometryAndAppearance, setProperty, setProperty, setWidgetAlpha, setWidgetLength, updateAllDBGNormals, updateAllDBGNormals, updateAllDBGSpheres, updateDBGNormals, updateDBGNormals, updateDBGSpheres, updateExistingDBGNormals, updateExistingDBGSpheres
private static final java.lang.String cvsid
public static final int DEF_NUM_SECTORS
ns
public final int ns
public final float sectorAngle
protected float innerRadius
protected float width
protected float trackInnerRadiusFactor
Widget.widgetLength
to radius, NaN if noneprotected float trackWidthFactor
Widget.widgetLength
to radial width, NaN if nonepublic AnnulusWidget(float innerRadius, float width, int numSectors)
Creates a new AnnulusWidget with given radius, radial
width, and ns
.
innerRadius
- the non-negative inner radiuswidth
- the non-negative radial widthnumSectors
- the number of sectors, must be positivepublic AnnulusWidget(float innerRadius, float width)
Covers AnnulusWidget(float, float, int)
, uses DEF_NUM_SECTORS
.
public AnnulusWidget()
Covers AnnulusWidget(float, float, int)
, uses DEF_NUM_SECTORS
, innerRadius = 0.25f and width =
0.25f.
public boolean setLengths(float innerRadius, float width)
Set the inner radius and radial width.
innerRadius
- the new inner radius, ignored if NaN, otherwise must be
non-negativewidth
- the new radial width, ignored if NaN, otherwise must be
non-negativepublic boolean setInnerRadius(float innerRadius)
setLengths(float, float)
, only changes inner radiuspublic boolean setWidth(float width)
setLengths(float, float)
, only changes radial widthpublic void trackWidgetLength(float... trackFactor)
Set trackInnerRadiusFactor
and trackWidthFactor
, see
class header doc.
trackWidgetLength
in class Widget
protected void widgetLengthChanged()
Widget.widgetLength
tracking, see class header docwidgetLengthChanged
in class Widget