camera3d
Class VcView

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

public class VcView
extends VcObject

Represents a camera in the virtual world. This class encapsulates the javax.media.j3d.View and the javax.media.j3d.ViewPlatform objects.
The userData field of the ViewPlatform is set to point to this object, making it possible to retrieve an reference to the VcView object from the javax.media.j3d.View object it encapsulates, through this call sequence:
View.getViewPlatform.getUserData()

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

Field Summary
static int PARALLEL_PROJECTION
          Specifies that Java3D should generate a parallel projectioin matrix for this view.
static int PERSPECTIVE_PROJECTION
          Specifies that Java3D should generate a perspective projectioin matrix for this view.
static int PHYSICAL_WORLD
          Policy for resizing and moving windows.
static int VIRTUAL_WORLD
          Policy for resizing and moving windows.
 
Fields inherited from class camera3d.VcObject
transformationMode
 
Constructor Summary
VcView()
          Constructs a VcView with default parameters
VcView(javax.media.j3d.PhysicalBody body, javax.media.j3d.PhysicalEnvironment environment)
          Constructs a VcView with given parameters.
 
Method Summary
 void addCanvas3D(javax.media.j3d.Canvas3D canvas)
          Adds a given Canvas3D to the list of Canvas3D objects to which this VcView is rendered.
 void frameObjectInView(VcObject vcObject)
          Translates the camera so a given VcObject is made completely visible.
 double getBackClipDistance()
           
 double getFieldOfView()
          Returns the field of view used to compute the projection transform.
 double getFrontClipDistance()
           
 javax.swing.Icon getIcon()
          Returns the Icon associated with cameras.
static int getInstanceCounter()
          Returns the number of VcView objects created so far.
 boolean getNavigateEnable()
           
 int getProjectionPolicy()
           
 int getWindowMovementPolicy()
           
 int getWindowResizePolicy()
           
 void removeAllCanvas3Ds()
          Remove all Canvas3Ds to which this view is attached.
 void removeCanvas3D(javax.media.j3d.Canvas3D canvas)
          Removes a Canvas3D.
 void setBackClipDistance(double dist)
           
 void setFieldOfView(double fov)
          Sets the field of view used to compute the projection transform.
 void setFrontClipDistance(double dist)
           
 void setIcon(javax.swing.Icon cameraIcon)
          Sets the Icon associated with cameras.
 void setNavigateEnable(boolean navigating)
           
 void setProjectionPolicy(int policy)
          Sets projection policy; notifyChangeListeners is called after execution.
 void setTransform(javax.vecmath.Quat4d rotQ4d, javax.vecmath.Vector3d transVec, double scale)
          Method to be called from inside VcKeyNavigator.
 void setWindowMovementPolicy(int policy)
           
 void setWindowResizePolicy(int i)
           
 java.lang.String toString()
           
 
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, wait, wait, wait
 

Field Detail

PARALLEL_PROJECTION

public static final int PARALLEL_PROJECTION
Specifies that Java3D should generate a parallel projectioin matrix for this view.

See Also:
Constant Field Values

PERSPECTIVE_PROJECTION

public static final int PERSPECTIVE_PROJECTION
Specifies that Java3D should generate a perspective projectioin matrix for this view.

See Also:
Constant Field Values

VIRTUAL_WORLD

public static final int VIRTUAL_WORLD
Policy for resizing and moving windows.

See Also:
Constant Field Values

PHYSICAL_WORLD

public static final int PHYSICAL_WORLD
Policy for resizing and moving windows.

See Also:
Constant Field Values
Constructor Detail

VcView

public VcView(javax.media.j3d.PhysicalBody body,
              javax.media.j3d.PhysicalEnvironment environment)
Constructs a VcView with given parameters.

Parameters:
body - PhysicalBody to be used by this VcView
environment - PhysicalEnvironment to be used by this VcView

VcView

public VcView()
Constructs a VcView with default parameters

Method Detail

addCanvas3D

public void addCanvas3D(javax.media.j3d.Canvas3D canvas)
Adds a given Canvas3D to the list of Canvas3D objects to which this VcView is rendered.

Parameters:
canvas -

removeAllCanvas3Ds

public void removeAllCanvas3Ds()
Remove all Canvas3Ds to which this view is attached.


removeCanvas3D

public void removeCanvas3D(javax.media.j3d.Canvas3D canvas)
Removes a Canvas3D.

Parameters:
canvas - Canvas3D to be removed.

setTransform

public void setTransform(javax.vecmath.Quat4d rotQ4d,
                         javax.vecmath.Vector3d transVec,
                         double scale)
Method to be called from inside VcKeyNavigator. All the internal properties are updated accordingly, but notifyChangeListeners is not called.

Parameters:
rotQ4d - quaternion holding new rotation
transVec - Vector3d holding new translation
scale - new scale

toString

public java.lang.String toString()

getProjectionPolicy

public int getProjectionPolicy()

setProjectionPolicy

public void setProjectionPolicy(int policy)
Sets projection policy; notifyChangeListeners is called after execution.

Parameters:
policy - the new projection policy

getWindowMovementPolicy

public int getWindowMovementPolicy()

setWindowMovementPolicy

public void setWindowMovementPolicy(int policy)

getWindowResizePolicy

public int getWindowResizePolicy()

setWindowResizePolicy

public void setWindowResizePolicy(int i)

setNavigateEnable

public void setNavigateEnable(boolean navigating)

getNavigateEnable

public boolean getNavigateEnable()

setFieldOfView

public void setFieldOfView(double fov)
Sets the field of view used to compute the projection transform.

Parameters:
fov - value of field of view in degrees.

getFieldOfView

public double getFieldOfView()
Returns the field of view used to compute the projection transform.

Returns:
value of field of view in degrees.

getFrontClipDistance

public double getFrontClipDistance()

setFrontClipDistance

public void setFrontClipDistance(double dist)

getBackClipDistance

public double getBackClipDistance()

setBackClipDistance

public void setBackClipDistance(double dist)

frameObjectInView

public void frameObjectInView(VcObject vcObject)
Translates the camera so a given VcObject is made completely visible.


getInstanceCounter

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


getIcon

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

Specified by:
getIcon in class VcObject

setIcon

public void setIcon(javax.swing.Icon cameraIcon)
Sets the Icon associated with cameras.

Specified by:
setIcon in class VcObject


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