public class IsoscelesWidget extends JOGLEdgedFacetedWidget
An isosceles triangle.
The face has defined normals. The edge geometry is composed of the three perimeter edges.
The width and height are is mutable, and the triangle base 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 width and/or height to track Widget.widgetLength*trackWidthFactor corresp. trackWidgetLength(float...)*trackHeightFactor.
Face vertex array is one tri in ccw order from (-width/2, 0, 0).
Edge vertex array is one strip in ccw order from (-width/2, 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 |
protected float |
height
the current height
|
protected float |
trackHeightFactor
mapping from
Widget.widgetLength to height, NaN if none |
protected float |
trackWidthFactor
mapping from
Widget.widgetLength to width, NaN if none |
protected float |
width2
the current half-width
|
edgeGeometry, edgeVertices, faceGeometry, faceVertices, X, Y, ZDASHED_PATTERN, DEF_EDGE_COLOR, DEF_OFFSET_BIAS, DEF_OFFSET_FACTOR, DOTTED_PATTERN, edgeAppearance, edgeColoringAttributes, edgeLineAttributes, EDGES, edgeTransparencyAttributes, facePolygonAttributes, SOLID_PATTERNfaceAppearance, faceMaterial, FACES, faceTransparencyAttributesalpha, 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 |
|---|
IsoscelesWidget()
Covers
IsoscelesWidget(float, float), uses width =
1.0f, height = 0.5f. |
IsoscelesWidget(float width,
float height)
Creates a new IsoscelesWidget with the given width and
height.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
setHeight(float height)
covers
setLengths(float, float), only changes height |
boolean |
setLengths(float width,
float height)
Set the width and height.
|
boolean |
setWidth(float width)
covers
setLengths(float, float), only changes width |
void |
trackWidgetLength(float... trackFactor)
Set
trackWidthFactor 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, sfvcenableEdges, getEdgeAppearance, getEdgeGeometry, setAlpha, setColor, setColor, setEdgeAlpha, setEdgeColor, setEdgeColor, setEdgePattern, setEdgePattern, setEdgeWidth, setFaceOffset, setFaceOffsetBias, setFaceOffsetFactorenableFaces, getFaceAppearance, getFaceGeometry, setFaceAlpha, setFaceColor, setFaceColorcons, 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, updateExistingDBGSpheresprivate static final java.lang.String cvsid
protected float width2
protected float height
protected float trackWidthFactor
Widget.widgetLength to width, NaN if noneprotected float trackHeightFactor
Widget.widgetLength to height, NaN if nonepublic IsoscelesWidget(float width,
float height)
Creates a new IsoscelesWidget with the given width and height.
width - the non-negative widthheight - the non-negative heightpublic IsoscelesWidget()
Covers IsoscelesWidget(float, float), uses width =
1.0f, height = 0.5f.
public boolean setLengths(float width,
float height)
Set the width and height.
width - the new width, ignored if NaN, otherwise must be
non-negativeheight - the new height, ignored if NaN, otherwise must be
non-negativepublic boolean setWidth(float width)
setLengths(float, float), only changes widthpublic boolean setHeight(float height)
setLengths(float, float), only changes heightpublic void trackWidgetLength(float... trackFactor)
Set trackWidthFactor and trackHeightFactor, see
class header doc.
trackWidgetLength in class Widgetprotected void widgetLengthChanged()
Widget.widgetLength tracking, see class header docwidgetLengthChanged in class Widget