public class ConeWidget extends JOGLEdgedFacetedWidget
A cone.
The face geometry is tessellated into radial wedges, with defined normals. The edge geometry is composed of the endcap circle plus four axial lines where the cone intersects the coordinate planes.
The radius and height are is mutable. The cone base is centered at the
origin of the local coordinate frame and is symmetric about the Z axis, with
apex extending in the positive Z direction. 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 height to track Widget.widgetLength
*trackRadiusFactor
corresp. Widget.widgetLength
*trackHeightFactor
.
Face vertex array is 1+ns
fans:
Edge vertex array is five line 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 |
---|---|
private static java.lang.String |
cvsid |
static int |
DEF_NUM_SECTORS
default
ns |
protected float |
height
current height
|
int |
ns
number of radial sectors
|
protected float |
radius
current radius
|
float |
sectorAngle
angle span of each sector
|
protected float |
trackHeightFactor
mapping from
Widget.widgetLength to height, NaN if none |
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 |
---|
ConeWidget()
Covers
ConeWidget(float, float, int) , uses DEF_NUM_SECTORS , radius = 0.5f, height = 0.5f. |
ConeWidget(float radius,
float height)
Covers
ConeWidget(float, float, int) , uses DEF_NUM_SECTORS . |
ConeWidget(float radius,
float height,
int numSectors)
Creates a new ConeWidget with given radius, height, and
ns . |
Modifier and Type | Method and Description |
---|---|
void |
enableAxialEdges(boolean enable)
enable/disable the four axial edges
|
void |
enableRadialEdges(boolean enable)
enable/disable the endcap edges
|
boolean |
setHeight(float height)
covers
setLengths(float, float) , only changes height |
boolean |
setLengths(float radius,
float height)
Set the radius and height.
|
boolean |
setRadius(float radius)
covers
setLengths(float, float) , only changes radius |
void |
trackWidgetLength(float... trackFactor)
Set
trackRadiusFactor and trackHeightFactor , 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 height
protected float trackRadiusFactor
Widget.widgetLength
to radius, NaN if noneprotected float trackHeightFactor
Widget.widgetLength
to height, NaN if nonepublic ConeWidget(float radius, float height, int numSectors)
Creates a new ConeWidget with given radius, height, and
ns
.
radius
- the non-negative radiusheight
- the non-negative heightnumSectors
- the number of sectors, must be positivepublic ConeWidget(float radius, float height)
Covers ConeWidget(float, float, int)
, uses DEF_NUM_SECTORS
.
public ConeWidget()
Covers ConeWidget(float, float, int)
, uses DEF_NUM_SECTORS
, radius = 0.5f, height = 0.5f.
public void enableAxialEdges(boolean enable)
public void enableRadialEdges(boolean enable)
public boolean setLengths(float radius, float height)
Set the radius and height.
radius
- the new radius, ignored if NaN, otherwise must be
non-negativeheight
- the new height, ignored if NaN, otherwise must be
non-negativepublic boolean setRadius(float radius)
setLengths(float, float)
, only changes radiuspublic boolean setHeight(float height)
setLengths(float, float)
, only changes heightpublic void trackWidgetLength(float... trackFactor)
Set trackRadiusFactor
and trackHeightFactor
, see
class header doc.
trackWidgetLength
in class Widget
protected void widgetLengthChanged()
Widget.widgetLength
tracking, see class header docwidgetLengthChanged
in class Widget