public class CircleWidget extends JOGLEdgedFacetedWidget
A circle.
The face geometry is tessellated into azimuth wedges, with defined normals. The edge geometry is composed of the perimeter circle.
The radius is mutable, and the circle 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 radius length to track Widget.widgetLength
*trackRadiusFactor
.
Face vertex array is one fan in ccw order from (r, 0, 0).
Edge vertex array is one line strip in ccw order from (r, 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 |
int |
ns
number of azimuth and elevation sectors
|
protected float |
radius
current radius
|
float |
sectorAngle
angle span of each sector
|
protected float |
trackRadiusFactor
mapping from
Widget.widgetLength to radius, NaN if none |
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 |
---|
CircleWidget()
Covers
CircleWidget(float, int) , uses DEF_NUM_SECTORS
and radius = 0.5f. |
CircleWidget(float radius)
Covers
CircleWidget(float, int) , uses DEF_NUM_SECTORS . |
CircleWidget(float radius,
int numSectors)
Creates a new CircleWidget with given radius and
ns . |
Modifier and Type | Method and Description |
---|---|
boolean |
setRadius(float radius)
Set the radius.
|
void |
trackWidgetLength(float... trackFactor)
set
trackRadiusFactor , 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 radius
protected float trackRadiusFactor
Widget.widgetLength
to radius, NaN if nonepublic CircleWidget(float radius, int numSectors)
Creates a new CircleWidget with given radius and ns
.
radius
- the non-negative radiusnumSectors
- the number of sectors, must be positivepublic CircleWidget(float radius)
Covers CircleWidget(float, int)
, uses DEF_NUM_SECTORS
.
public CircleWidget()
Covers CircleWidget(float, int)
, uses DEF_NUM_SECTORS
and radius = 0.5f.
public boolean setRadius(float radius)
Set the radius.
radius
- the new radius, ignored if NaN, otherwise must be
non-negativepublic void trackWidgetLength(float... trackFactor)
trackRadiusFactor
, see class header doctrackWidgetLength
in class Widget
protected void widgetLengthChanged()
Widget.widgetLength
tracking, see class header docwidgetLengthChanged
in class Widget