public class SectorWidget extends JOGLEdgedFacetedWidget
A circular sector.
The face geometry is tessellated into radial wedges, with defined normals. The edge geometry is composed of the two perimeter circular arcs plus the two encap segments.
The radius, radial width, start angle, and angular span are mutable, and
the sector 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 and/or the radial width to track Widget.widgetLength
*trackInnerRadiusFactor
corresp. Widget.widgetLength
*trackWidthFactor
.
The start angle is measured CCW from the positive X axis, and the angular span is measured CCW from the start angle.
Face vertex array is one tri strip in ccw order from (ir, sa).
Edge vertex array is four strips
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 |
---|---|
protected float |
angle
current angular span
|
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
|
protected float |
sectorAngle
angle span of each sector
|
protected float |
startAngle
current start angle
|
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 |
---|
SectorWidget()
Covers
SectorWidget(float, float, float, float int) , uses
DEF_NUM_SECTORS , innerRadius = 0.25f, width =
0.25f, startAngle = 0.0f, angle = 2*pi. |
SectorWidget(float innerRadius,
float width,
float startAngle,
float angle)
Covers
SectorWidget(float, float, float, float int) , uses
DEF_NUM_SECTORS . |
SectorWidget(float innerRadius,
float width,
float startAngle,
float angle,
int numSectors)
Creates a new AnnulusWidget with given radius, radial
width, and
ns . |
SectorWidget(int numSectors)
Covers
SectorWidget(float, float, float, float int) , uses
innerRadius = 0.25f, width = 0.25f, startAngle =
0.0f, angle = 2*pi. |
Modifier and Type | Method and Description |
---|---|
void |
enableArcEdges(boolean enable)
enable/disable arc edges
|
void |
enableEndEdges(boolean enable)
enable/disable end edges
|
boolean |
setAngle(float angle)
Covers
setLengthsAndAngles(float, float, float, float) , only
changes angle span. |
boolean |
setAngles(float startAngle,
float angle)
Covers
setLengthsAndAngles(float, float, float, float) , only
changes angle span and start angle. |
boolean |
setInnerRadius(float innerRadius)
Covers
setLengthsAndAngles(float, float, float, float) , only
changes inner radius. |
boolean |
setLengths(float innerRadius,
float width)
Covers
setLengthsAndAngles(float, float, float, float) , only
changes radius and radial width. |
boolean |
setLengthsAndAngles(float innerRadius,
float width,
float startAngle,
float angle)
Set the inner radius, radial width, start angle, and angle span.
|
boolean |
setStartAngle(float startAngle)
Covers
setLengthsAndAngles(float, float, float, float) , only
changes start angle. |
boolean |
setWidth(float width)
Covers
setLengthsAndAngles(float, float, 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
protected float sectorAngle
protected float innerRadius
protected float width
protected float startAngle
protected float angle
protected float trackInnerRadiusFactor
Widget.widgetLength
to radius, NaN if noneprotected float trackWidthFactor
Widget.widgetLength
to radial width, NaN if nonepublic SectorWidget(float innerRadius, float width, float startAngle, float angle, int numSectors)
Creates a new AnnulusWidget with given radius, radial
width, and ns
.
innerRadius
- the non-negative inner radiuswidth
- the non-negative radial widthstartAngle
- the start angleangle
- the angular span, in the closed interval [0, 2pi]numSectors
- the number of sectors, must be positivepublic SectorWidget(float innerRadius, float width, float startAngle, float angle)
Covers SectorWidget(float, float, float, float int)
, uses
DEF_NUM_SECTORS
.
public SectorWidget(int numSectors)
Covers SectorWidget(float, float, float, float int)
, uses
innerRadius = 0.25f, width = 0.25f, startAngle =
0.0f, angle = 2*pi.
public SectorWidget()
Covers SectorWidget(float, float, float, float int)
, uses
DEF_NUM_SECTORS
, innerRadius = 0.25f, width =
0.25f, startAngle = 0.0f, angle = 2*pi.
public void enableEndEdges(boolean enable)
public void enableArcEdges(boolean enable)
public boolean setLengthsAndAngles(float innerRadius, float width, float startAngle, float angle)
Set the inner radius, radial width, start angle, and angle span.
innerRadius
- the new inner radius, ignored if NaN, otherwise must be
non-negativewidth
- the new radial width, ignored if NaN, otherwise must be
non-negativestartAngle
- the start angle, ignored if NaNangle
- the angular span, ignored if NaN, otherwise must be in the
closed interval [0, 2pi]public boolean setInnerRadius(float innerRadius)
Covers setLengthsAndAngles(float, float, float, float)
, only
changes inner radius.
public boolean setWidth(float width)
Covers setLengthsAndAngles(float, float, float, float)
, only
changes radial width.
public boolean setLengths(float innerRadius, float width)
Covers setLengthsAndAngles(float, float, float, float)
, only
changes radius and radial width.
public boolean setStartAngle(float startAngle)
Covers setLengthsAndAngles(float, float, float, float)
, only
changes start angle.
public boolean setAngle(float angle)
Covers setLengthsAndAngles(float, float, float, float)
, only
changes angle span.
public boolean setAngles(float startAngle, float angle)
Covers setLengthsAndAngles(float, float, float, float)
, only
changes angle span and start angle.
public 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