camera3d
Class GeometryBag

java.lang.Object
  extended bycamera3d.VcObject
      extended bycamera3d.GeometryBag
All Implemented Interfaces:
RotatableObject, ScalableObject, TranslatableObject

public class GeometryBag
extends VcObject

This class allows the easy creation of many kinds of geometry. Its main intended use is helping with the debugging of programs and fast prototyping of applications. The types of geometry currently supported include cube, line, plane and sphere.

Version:
1.0
Author:
Fábio de Miranda, Carlos da Silva dos Santos

Field Summary
 
Fields inherited from class camera3d.VcObject
transformationMode
 
Constructor Summary
GeometryBag()
           
 
Method Summary
 void addCube(javax.vecmath.Point3d lowCorner, javax.vecmath.Point3d upCorner)
           
 void addLine(javax.vecmath.Point3d p1, javax.vecmath.Point3d p2)
           
 void addLine(javax.vecmath.Point3d p1, javax.vecmath.Vector3d direction)
           
 void addLineSegment(javax.vecmath.Point3d p1, javax.vecmath.Point3d p2)
           
 void addPlane(javax.vecmath.Point3d p1, javax.vecmath.Point3d p2, javax.vecmath.Point3d p3)
           
 void addPlane(javax.vecmath.Point3d point, javax.vecmath.Vector3d normal)
           
 void addPlane(javax.vecmath.Vector4d plane4d)
           
 void addPlane(javax.vecmath.Vector4d plane4d, javax.vecmath.Color3b color)
           
 void addPoint(javax.vecmath.Point3d point)
           
 void addSphere(javax.vecmath.Point3d center, double radius)
           
 void clearAll()
          Erases all geometry contained in this object
 void clearCubes()
          Erases all cubes contained in this object
 void clearLines()
          Erases all lines contained in this object
 void clearPlanes()
           
 void clearPoints()
          Erases all points contained in this object
 void finishLineArray()
           
 javax.swing.Icon getIcon()
          Returns the Icon associated with GeometryBag.
static int getInstanceCounter()
          Returns the number of objects instatiated so far.
 boolean isColorRotating()
           
 boolean isUsingDefaultColors()
          Lines, points and planes usually have a default color associated with them.
static void main(java.lang.String[] args)
           
 void popColor()
          Pops a color from aforementioned stack
 void pushColor(byte r, byte g, byte b)
          Pushes a color onto a stack.
 void setColor(byte r, byte g, byte b)
           
 void setColorRotatingEnable(boolean enable)
           
 void setIcon(javax.swing.Icon bagIcon)
          Sets the Icon associated with GeometryBag.
 void setPlaneWidth(double planeWidth)
           
 void setPointWidth(double width)
          I know, I know, points are not supposed to have a dimension.
 void setUsingDefaultColors(boolean b)
          Lines, points and planes usually have a default color associated with them.
 void startLineArray()
           
 
Methods inherited from class camera3d.VcObject
addChangeListener, addNode, addVcChild, detach, getBoundingBox, getBoundingBoxInVWorld, getBranchGroup, getChildrenList, getInfo, getLabel, getLocalToVworld, getParentRotScaleTG, getParentTransTG, getTooltipText, getTransforms, getTranslation, getXAngleDeg, getXAngleRad, getXScale, getXTranslation, getYAngleDeg, getYAngleRad, getYScale, getYTranslation, getZAngleDeg, getZAngleRad, getZScale, getZTranslation, hideBoundingBox, isInvalidData, isLive, isSelected, printTransform, removeAllChangeListeners, removeAllNodes, removeBoundingBox, removeChangeListener, removeNode, removeVcChild, removeVcChild, rotateAbsolute, rotateEuler, rotateEulerLocal, rotateEulerLocalX, rotateEulerLocalY, rotateEulerLocalZ, rotateEulerX, rotateEulerY, rotateEulerZ, rotateLocal, scaleRelative, scaleX, scaleXRelative, scaleY, scaleYRelative, scaleZ, scaleZRelative, select, setAbsoluteScale, setGlobalAxisVisible, setLabel, setLocalAxisVisible, setOngoingTransformation, setOngoingTransformationMode, setRelativeScale, setTooltipText, setTransform, setTransformsToIdentity, showBoundingBox, translate, translate, translateLocal, underOngoingTransformation, unselect, updateData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryBag

public GeometryBag()
Method Detail

getInstanceCounter

public static int getInstanceCounter()
Returns the number of objects instatiated so far.


addLine

public void addLine(javax.vecmath.Point3d p1,
                    javax.vecmath.Point3d p2)

startLineArray

public void startLineArray()

addLineSegment

public void addLineSegment(javax.vecmath.Point3d p1,
                           javax.vecmath.Point3d p2)

finishLineArray

public void finishLineArray()

addLine

public void addLine(javax.vecmath.Point3d p1,
                    javax.vecmath.Vector3d direction)

addPoint

public void addPoint(javax.vecmath.Point3d point)

addPlane

public void addPlane(javax.vecmath.Point3d p1,
                     javax.vecmath.Point3d p2,
                     javax.vecmath.Point3d p3)

addPlane

public void addPlane(javax.vecmath.Point3d point,
                     javax.vecmath.Vector3d normal)

addPlane

public void addPlane(javax.vecmath.Vector4d plane4d)

addPlane

public void addPlane(javax.vecmath.Vector4d plane4d,
                     javax.vecmath.Color3b color)

addSphere

public void addSphere(javax.vecmath.Point3d center,
                      double radius)

addCube

public void addCube(javax.vecmath.Point3d lowCorner,
                    javax.vecmath.Point3d upCorner)

setColor

public void setColor(byte r,
                     byte g,
                     byte b)

pushColor

public void pushColor(byte r,
                      byte g,
                      byte b)
Pushes a color onto a stack. This way, the color that was previously beeing used can be later restored with popColor()


popColor

public void popColor()
Pops a color from aforementioned stack


clearAll

public void clearAll()
Erases all geometry contained in this object


clearLines

public void clearLines()
Erases all lines contained in this object


clearPoints

public void clearPoints()
Erases all points contained in this object


clearCubes

public void clearCubes()
Erases all cubes contained in this object


clearPlanes

public void clearPlanes()

setPlaneWidth

public void setPlaneWidth(double planeWidth)

setPointWidth

public void setPointWidth(double width)
I know, I know, points are not supposed to have a dimension. But the gizmo used to display a point does have a dimension, and its width is controlled by this method.


setUsingDefaultColors

public void setUsingDefaultColors(boolean b)
Lines, points and planes usually have a default color associated with them. That color will be used, instead of rotating or user-supplied colors if this flag is set


isUsingDefaultColors

public boolean isUsingDefaultColors()
Lines, points and planes usually have a default color associated with them. That color will be used, instead of rotating or user-supplied colors if this flag is set


getIcon

public javax.swing.Icon getIcon()
Returns the Icon associated with GeometryBag.

Specified by:
getIcon in class VcObject

setIcon

public void setIcon(javax.swing.Icon bagIcon)
Sets the Icon associated with GeometryBag.

Specified by:
setIcon in class VcObject

setColorRotatingEnable

public void setColorRotatingEnable(boolean enable)

isColorRotating

public boolean isColorRotating()

main

public static void main(java.lang.String[] args)


Copyright © 2001-2003 F.R. Miranda, C.S. Santos, J.E. Kogler Jr.. All Rights Reserved.