camera3d
Class DistanceMeasurer

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

public class DistanceMeasurer
extends VcHelper

Object used to measure distances in the virtual world. A DistanceMeasurer is composed of two main parts: the origin point and the target.

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

Field Summary
 
Fields inherited from class camera3d.VcObject
transformationMode
 
Constructor Summary
DistanceMeasurer()
          Constructor for the DistanceMeasurer object
 
Method Summary
 double getDistance()
          Gets the distance attribute of the DistanceMeasurer object
 javax.swing.Icon getIcon()
          Returns the Icon associated with DistanceMeasurer.
static int getInstanceCounter()
          Returns the number of objects instatiated so far.
 camera3d.VcHelperPoint getTarget()
          Gets the target attribute of the DistanceMeasurer object
 boolean isBound()
          Returns a flag indicating whether the target movement is bound to the origin object.
static void main(java.lang.String[] args)
          The main program for the DistanceMeasurer class
 void measureDistance()
          Makes the measurement.
 void setBound(boolean bound)
          Sets whether the target object should move in companion to the origin point.
 void setBranchGroup(javax.media.j3d.BranchGroup bg)
          Sets BranchGroup which determines the scope of picking.
 void setDirection(javax.vecmath.Vector3d direction)
          Sets the direction for measurement.
 void setIcon(javax.swing.Icon measurerIcon)
          Sets the Icon associated with DistanceMeasurer.
 void setJ3DBase(J3DBase base)
          Sets the j3DBase attribute of the DistanceMeasurer object
 void setMode(int direction, TransformScope axis)
          Sets measurement mode.
 void setNegativeX()
          Sets the negativeX attribute of the DistanceMeasurer object
 void setNegativeY()
          Sets the negativeY attribute of the DistanceMeasurer object
 void setNegativeZ()
          Sets the negativeZ attribute of the DistanceMeasurer object
protected  void setOrigin()
          O ponto de origem (em coordenadas de VWorld) é obtido Simplesmente convertendo as coordenadas do ponto (0,0,0), que está no mesmo referencial que o gizmo que indica a origem do medidor para coordenadas de VWorld
 void setPositiveX()
          Sets the positiveX attribute of the DistanceMeasurer object
 void setPositiveY()
          Sets the positiveY attribute of the DistanceMeasurer object
 void setPositiveZ()
          Sets the positiveZ attribute of the DistanceMeasurer object
protected  void setTargetPosition(javax.vecmath.Point3d point)
          Sets the targetPosition attribute of the DistanceMeasurer object
protected  void setTargetPositionRelative(javax.vecmath.Point3d point)
          Sets the targetPositionRelative attribute of the DistanceMeasurer object
 void setToTarget()
          Sets the direction for measurement so it corresponds to the current position of the target object.
protected  void showPicked(javax.vecmath.Point3d point)
          Coloca um gizmo no ponto especificado (que deve ser onde o raio de picking bateu)
 
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

DistanceMeasurer

public DistanceMeasurer()
Constructor for the DistanceMeasurer object

Method Detail

getInstanceCounter

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

Returns:
The instanceCounter value

main

public static void main(java.lang.String[] args)
The main program for the DistanceMeasurer class

Parameters:
args - The command line arguments

setJ3DBase

public final void setJ3DBase(J3DBase base)
Sets the j3DBase attribute of the DistanceMeasurer object

Parameters:
base - The new j3DBase value

setBranchGroup

public void setBranchGroup(javax.media.j3d.BranchGroup bg)
Sets BranchGroup which determines the scope of picking. Only objects that are under bg can be picked during the measurement process.

Parameters:
bg - The new branchGroup value

setDirection

public void setDirection(javax.vecmath.Vector3d direction)
Sets the direction for measurement.

Parameters:
direction - The new direction value

setToTarget

public void setToTarget()
Sets the direction for measurement so it corresponds to the current position of the target object.


setNegativeZ

public void setNegativeZ()
Sets the negativeZ attribute of the DistanceMeasurer object


setPositiveZ

public void setPositiveZ()
Sets the positiveZ attribute of the DistanceMeasurer object


setPositiveX

public void setPositiveX()
Sets the positiveX attribute of the DistanceMeasurer object


setNegativeX

public void setNegativeX()
Sets the negativeX attribute of the DistanceMeasurer object


setPositiveY

public void setPositiveY()
Sets the positiveY attribute of the DistanceMeasurer object


setNegativeY

public void setNegativeY()
Sets the negativeY attribute of the DistanceMeasurer object


setOrigin

protected void setOrigin()
O ponto de origem (em coordenadas de VWorld) é obtido Simplesmente convertendo as coordenadas do ponto (0,0,0), que está no mesmo referencial que o gizmo que indica a origem do medidor para coordenadas de VWorld


setBound

public void setBound(boolean bound)
Sets whether the target object should move in companion to the origin point.

Parameters:
bound - The new bound value

setTargetPosition

protected void setTargetPosition(javax.vecmath.Point3d point)
Sets the targetPosition attribute of the DistanceMeasurer object

Parameters:
point - The new targetPosition value

setTargetPositionRelative

protected void setTargetPositionRelative(javax.vecmath.Point3d point)
Sets the targetPositionRelative attribute of the DistanceMeasurer object

Parameters:
point - The new targetPositionRelative value

setMode

public void setMode(int direction,
                    TransformScope axis)
Sets measurement mode.

Parameters:
direction - If positive, measurement will be performed in positive direction of axis. If negative, measurement will be performed in negative direction of axis.
axis - Axis that defines direction of measurement.
Throws:
java.lang.IllegalArgumentException - if axis is not really an axis (X,Y or Z).

setIcon

public void setIcon(javax.swing.Icon measurerIcon)
Sets the Icon associated with DistanceMeasurer.

Specified by:
setIcon in class VcObject
Parameters:
measurerIcon - The new icon value

getTarget

public camera3d.VcHelperPoint getTarget()
Gets the target attribute of the DistanceMeasurer object

Returns:
The target value

getDistance

public double getDistance()
Gets the distance attribute of the DistanceMeasurer object

Returns:
The distance value

isBound

public boolean isBound()
Returns a flag indicating whether the target movement is bound to the origin object.

Returns:
The bound value

getIcon

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

Specified by:
getIcon in class VcObject
Returns:
The icon value

measureDistance

public void measureDistance()
Makes the measurement. The target object is placed on the hitting place. The value of the distance can then be retrieved by calling getDistance.


showPicked

protected void showPicked(javax.vecmath.Point3d point)
Coloca um gizmo no ponto especificado (que deve ser onde o raio de picking bateu)

Parameters:
point - Description of the Parameter


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