public class PrismWidget extends JOGLEdgedFacetedWidget
A rectangular prism.
The face geometry has defined normals. The edge geometry is composed of all 12 face creases.
The min and max extents in each dimension are mutable, and the prism
faces are always axis-aligned. It may be further positioned e.g. by
manipulating Widget.rx
.
trackWidgetLength(float...)
may be called to enable Widget.widgetLength
tracking, which causes the X and/or Y and/or Z widths to track Widget.widgetLength
*trackXFactor
corresp. Widget.widgetLength
*trackYFactor
corresp. Widget.widgetLength
*trackZFactor
.
Face vertex array is 6 quads first by coord then by direction.
Edge vertex array is back and front edge loops, then back-to-front verticals in ccw order.
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 |
protected static float[] |
DUMMY_CENTER
used in some apis if an explicit center is not passed
|
protected float[][] |
extent
extent indexed by [coord][direction]
|
protected float |
trackXFactor
mapping from
Widget.widgetLength to X width, NaN if none |
protected float |
trackYFactor
mapping from
Widget.widgetLength to Y width, NaN if none |
protected float |
trackZFactor
mapping from
Widget.widgetLength to Z width, 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 |
---|
PrismWidget()
Covers
PrismWidget(float, float, float, float, float, float) ,
centers a width 1.0f cube on the origin. |
PrismWidget(float[] min,
float[] max)
|
PrismWidget(float xLength,
float yLength,
float zLength)
Covers
PrismWidget(float, float, float, float...) , makes a
prism of the given widths around the origin. |
PrismWidget(float xLength,
float yLength,
float zLength,
float[] center)
Covers
PrismWidget(float, float, float, float, float, float) ,
makes a prism of the given widths around the given center. |
PrismWidget(float xMin,
float yMin,
float zMin,
float xMax,
float yMax,
float zMax)
Creates a new PrismWidget with the given extents.
|
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
|
protected static float[] |
ensureCenter(float[] center)
returns center if usable, else
DUMMY_CENTER |
boolean |
setExtents(float[] min,
float[] max)
|
boolean |
setExtents(float xMin,
float yMin,
float zMin,
float xMax,
float yMax,
float zMax)
Set the prism extents.
|
boolean |
setLengths(float xLength,
float yLength,
float zLength)
covers
setSymmetricExtents(float, float, float, float...) , uses current center |
boolean |
setSymmetricExtents(float xLength,
float yLength,
float zLength,
float... center)
Covers
setExtents(float, float, float, float, float, float) ,
sets symmetric extents wrt center. |
boolean |
setXExtents(float min,
float max)
Covers
setExtents(float, float, float, float, float, float) ,
only sets x extents. |
boolean |
setXLength(float length)
covers
setLengths(float, float, float) , only sets x length |
boolean |
setYExtents(float min,
float max)
Covers
setExtents(float, float, float, float, float, float) ,
only sets y extents. |
boolean |
setYLength(float length)
covers
setLengths(float, float, float) , only sets y length |
boolean |
setZExtents(float min,
float max)
Covers
setExtents(float, float, float, float, float, float) ,
only sets z extents. |
boolean |
setZLength(float length)
covers
setLengths(float, float, float) , only sets z length |
void |
trackWidgetLength(float... trackFactor)
|
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
protected static final float[] DUMMY_CENTER
protected float[][] extent
protected float trackXFactor
Widget.widgetLength
to X width, NaN if noneprotected float trackYFactor
Widget.widgetLength
to Y width, NaN if noneprotected float trackZFactor
Widget.widgetLength
to Z width, NaN if nonepublic PrismWidget(float xMin, float yMin, float zMin, float xMax, float yMax, float zMax)
Creates a new PrismWidget with the given extents.
The min extent in each dimension must be less than or equal to the max extent in that dimension.
public PrismWidget(float[] min, float[] max)
public PrismWidget()
Covers PrismWidget(float, float, float, float, float, float)
,
centers a width 1.0f cube on the origin.
public PrismWidget(float xLength, float yLength, float zLength, float[] center)
Covers PrismWidget(float, float, float, float, float, float)
,
makes a prism of the given widths around the given center.
center
- the center for the prism or null or empty to use the originpublic PrismWidget(float xLength, float yLength, float zLength)
Covers PrismWidget(float, float, float, float...)
, makes a
prism of the given widths around the origin.
protected static float[] ensureCenter(float[] center)
DUMMY_CENTER
public void enableAxialEdges(boolean enable)
public void enableRadialEdges(boolean enable)
public boolean setExtents(float xMin, float yMin, float zMin, float xMax, float yMax, float zMax)
Set the prism extents.
Any parameter passed as NaN will be ignored (the curent value of that extent will be retained). Each non-NaN parameter must be correctly ordered with respect to the other (new) extent in that dimension.
public boolean setExtents(float[] min, float[] max)
public boolean setSymmetricExtents(float xLength, float yLength, float zLength, float... center)
Covers setExtents(float, float, float, float, float, float)
,
sets symmetric extents wrt center.
Any length parameter passed as NaN will be ignored (the curent value of that extent will be retained). Each non-NaN parameter must be non-negative.
center
- the center for the prism or null or empty to use the current
centerpublic boolean setLengths(float xLength, float yLength, float zLength)
setSymmetricExtents(float, float, float, float...)
, uses current centerpublic boolean setXLength(float length)
setLengths(float, float, float)
, only sets x lengthpublic boolean setYLength(float length)
setLengths(float, float, float)
, only sets y lengthpublic boolean setZLength(float length)
setLengths(float, float, float)
, only sets z lengthpublic boolean setXExtents(float min, float max)
Covers setExtents(float, float, float, float, float, float)
,
only sets x extents.
public boolean setYExtents(float min, float max)
Covers setExtents(float, float, float, float, float, float)
,
only sets y extents.
public boolean setZExtents(float min, float max)
Covers setExtents(float, float, float, float, float, float)
,
only sets z extents.
public void trackWidgetLength(float... trackFactor)
Set trackXFactor
, trackYFactor
, and trackZFactor
, see class header doc.
trackWidgetLength
in class Widget
protected void widgetLengthChanged()
Widget.widgetLength
tracking, see class header docwidgetLengthChanged
in class Widget