camera3d
Class GUIControl

java.lang.Object
  extended bycamera3d.GUIControl
All Implemented Interfaces:
SelectionChangeListener

public class GUIControl
extends java.lang.Object
implements SelectionChangeListener

Object which receives requests from graphical components and generates actions for an ActionExecutor.

Version:
1.0
Author:
Fábio Roberto de Miranda

Field Summary
static boolean debugflag
           
static boolean viewportsInJInternalFrames
           
 
Constructor Summary
GUIControl(J3DBase base, ActionQueue queue)
          Constructor that initializes the J3DBase and ActionQueue objects.
 
Method Summary
 void addDistanceMeasurer()
           
 void addLight(int type, java.lang.String name)
           
 void addLight(java.lang.String type, java.lang.String name)
           
 void addLine(javax.vecmath.Point3d p1, javax.vecmath.Point3d p2)
           
 void addLine(javax.vecmath.Point3d origin, 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 plane)
           
 void addPoint(javax.vecmath.Point3d point)
           
 void addView(java.lang.String s)
          Adds a view to the scene graph
 void addViewport()
          Adds a viewport showing the default view
 void addViewport(java.lang.String viewName)
           
 void addViewport(VcView v)
          Creates action to add a viewport window tothe application and pushes it into queue.
 void addViewportInGUI(VcView v)
          Adds a viewport window that will show the view determined by the input VcView parameter.
 void changeLaserArrayColor(VcLaserArray array, double red, double green, double blue)
           
 void changeLaserSpotSize(VcLaserArray array, double size)
           
 void changeLightColor(java.lang.String light, int red, int green, int blue)
           
 void changeLightColor(VcLight light, int red, int green, int blue)
           
 void changeLightState(java.lang.String lightName, int onOff)
           
 void changeLightState(VcLight light, boolean b)
           
 void changeMovementPolicy(java.lang.String strView, java.lang.String strPolicy)
           
 void changeMovementPolicy(VcView vcView, int projectionPolicy)
           
 void changePointLightAttenuation(VcPointLight point, double constant, double linear, double quadratic)
           
 void changeProjectionPolicy(java.lang.String strView, java.lang.String strPolicy)
           
 void changeProjectionPolicy(VcView vcView, int projectionPolicy)
           
 void changeResizePolicy(java.lang.String strView, java.lang.String strPolicy)
           
 void changeResizePolicy(VcView vcView, int projectionPolicy)
           
 void changeSpotConcentration(java.lang.String spotLightName, double concentration)
           
 void changeSpotConcentration(VcSpotLight spot, double concentration)
           
 void changeSpotSpreadAngle(java.lang.String spotName, double angle)
           
 void changeSpotSpreadAngle(VcSpotLight spot, double angle)
           
 void changeViewInViewport(java.lang.String viewportName, java.lang.String viewName)
           
 void changeViewInViewport(Viewport viewport, VcView view)
           
 void clearBagGizmos(int clearRange)
           
 void disableMessageInViewports()
           
 void dumpContentEdgesToFile()
           
 void enableMessageInViewports(java.lang.String s)
           
 void finishLineArray()
           
 void frameObjectInView(VcView v, VcObject obj)
           
 void frameObjectsInView(java.lang.String label)
           
 void frameObjectsInView(VcView v)
           
 boolean getDebugFlag()
           
 J3DBase getJ3DBase()
          Returns the J3DBase object used by this object.
 double getMeasuredDistance(java.lang.String measurerName)
           
 ViewportWindowManager getViewportManager()
           
 XMLConverter getXMLConverter()
           
 void importFile(java.lang.String filename)
          Loads a content file (currently, only VRML2.0 format is supported).
 void loadFile(java.lang.String filename)
          Loads a file describing an environment configuration
 void lookAt(java.lang.String view, java.lang.String vcObject)
           
 void lookAt(VcView view, VcObject vcObj)
           
 void measureDistance(DistanceMeasurer measurer)
           
 void removeFromScene(java.lang.String objectName)
           
 void removeFromScene(VcObject vcObject)
           
 void renameVcObject(java.lang.String oldName, java.lang.String newName)
          Changes the label of the VcObject called oldName to newName.
 void renameVcObject(VcObject vcObj, java.lang.String newName)
          Sets the label of VcObject vcObj to a given String
 void rotateX(java.lang.String modeName, java.lang.String objectName, double value)
           
 void rotateX(TransformMode mode, VcObject vcObj, double value)
           
 void rotateY(java.lang.String modeName, java.lang.String objectName, double value)
           
 void rotateY(TransformMode mode, VcObject vcObj, double value)
           
 void rotateZ(java.lang.String modeName, java.lang.String objectName, double value)
           
 void rotateZ(TransformMode mode, VcObject vcObj, double value)
           
 void saveFile(java.lang.String filename)
          Saves a file describing an environment configuration.
 void saveJPGFile(java.lang.String filename)
           
 void saveJPGFile(java.lang.String viewportName, java.lang.String filename)
           
 void saveJPGFile(Viewport viewport, java.lang.String filename)
           
 void saveJPGFile(Viewport viewport, java.lang.String filename, int w, int h)
           
 void saveJPGFileSync(java.lang.String filename)
          Saves a snapshot from Default View in a JPEG file This method enforces synchronous execution, i.e. the method will not return untill the action is completed
 void saveJPGFileSync(java.lang.String viewportName, java.lang.String filename)
          Saves a snapshot from a given view in a JPEG file This method enforces synchronous execution, i.e. the method will not return untill the action is completed
 void saveJPGFileSync(Viewport viewport, java.lang.String filename)
          Saves a snapshot from a given viewport in a JPEG file This method enforces synchronous execution, i.e. the method will not return untill the action is completed
 void saveTXTFile(java.lang.String filename)
           
 void scale(java.lang.String modeName, java.lang.String objectName, double value)
           
 void scale(TransformMode mode, VcObject vcObj, double value)
           
 void scaleX(java.lang.String modeName, java.lang.String objectName, double value)
           
 void scaleX(TransformMode mode, VcObject vcObj, double value)
           
 void scaleY(java.lang.String modeName, java.lang.String objectName, double value)
           
 void scaleY(TransformMode mode, VcObject vcObj, double value)
           
 void scaleZ(java.lang.String modeName, java.lang.String objectName, double value)
           
 void scaleZ(TransformMode mode, VcObject vcObj, double value)
           
 void selectionChanged(SelectionChangedEvent event)
          Implements SelectionChangeListener.
 void setActionExecutor(ActionExecutor executor)
           
 void setColorAlternation(boolean b)
           
 void setDebugFlag(boolean b)
           
 void setEditionPane(FrameSwitcherPane editionSwitcherPane)
           
 void setFieldOfView(java.lang.String strView, double d)
           
 void setFieldOfView(VcView view, double d)
           
 void setGizmoColor(byte r, byte g, byte b)
           
 void setLaserArrayGrid(VcLaserArray array, int nx, int ny, double dx, double dy)
           
 void setLineLength(double length)
           
 void setMeasurerDirection(java.lang.String measurerName, int direction, java.lang.String axisName)
           
 void setMeasurerDirection(java.lang.String measurerName, int direction, TransformScope axis)
           
 void setPlaneWidth(double length)
           
 void setPointWidth(double length)
           
 void setSelectionPane(FrameSwitcherPane selectionSwitcherPane)
           
 void setViewInViewport(int viewportIndex, VcView view)
          Sets a viewport to show a given view
 void setViewportLocation(int viewportIndex, boolean internal, int x, int y, int width, int height)
          Sets the location in screen of a given viewport
 void setViewportManager(ViewportWindowManager manager)
          Sets the viewport window manager to be used by VirtualCamera
 void startLineArray()
           
 void toggleHelpingGrid()
          Toggles presence of the helping grid in the virtual world.
 void translate(VcObject obj, TransformMode mode, javax.vecmath.Point3d destination)
           
 void translateX(java.lang.String modeName, java.lang.String objectName, double value)
           
 void translateX(TransformMode mode, VcObject vcObj, double value)
           
 void translateY(java.lang.String modeName, java.lang.String objectName, double value)
           
 void translateY(TransformMode mode, VcObject vcObj, double value)
           
 void translateZ(java.lang.String modeName, java.lang.String objectName, double value)
           
 void translateZ(TransformMode mode, VcObject vcObj, double value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugflag

public static boolean debugflag

viewportsInJInternalFrames

public static boolean viewportsInJInternalFrames
Constructor Detail

GUIControl

public GUIControl(J3DBase base,
                  ActionQueue queue)
Constructor that initializes the J3DBase and ActionQueue objects.

Method Detail

loadFile

public void loadFile(java.lang.String filename)
Loads a file describing an environment configuration

Parameters:
filename - complete location of the file to be loaded

importFile

public void importFile(java.lang.String filename)
Loads a content file (currently, only VRML2.0 format is supported).

Parameters:
filename - complete location of the file to be loaded

saveFile

public void saveFile(java.lang.String filename)
Saves a file describing an environment configuration.

Parameters:
filename - complete location of the file to be saved

setViewportManager

public void setViewportManager(ViewportWindowManager manager)
Sets the viewport window manager to be used by VirtualCamera

Parameters:
manager - the window manager

setViewInViewport

public void setViewInViewport(int viewportIndex,
                              VcView view)
Sets a viewport to show a given view

Parameters:
viewportIndex - index of viewport whose view will be changed
view - new VcView to be shown by the viewport

setViewportLocation

public void setViewportLocation(int viewportIndex,
                                boolean internal,
                                int x,
                                int y,
                                int width,
                                int height)
Sets the location in screen of a given viewport

Parameters:
viewportIndex - index of viewport whose location will be changed
internal - true if viewport should be shown internal to main window, false otherwise
x - X location of viewport in screen
y - Y location of viewport in screen
width - new width of viewport window
height - new height of viewport window

setSelectionPane

public void setSelectionPane(FrameSwitcherPane selectionSwitcherPane)

setEditionPane

public void setEditionPane(FrameSwitcherPane editionSwitcherPane)

getJ3DBase

public J3DBase getJ3DBase()
Returns the J3DBase object used by this object.


getXMLConverter

public XMLConverter getXMLConverter()

addViewport

public void addViewport()
Adds a viewport showing the default view


addView

public void addView(java.lang.String s)
Adds a view to the scene graph

Parameters:
s - name of the view to be added

getViewportManager

public ViewportWindowManager getViewportManager()

changeViewInViewport

public void changeViewInViewport(java.lang.String viewportName,
                                 java.lang.String viewName)

changeViewInViewport

public void changeViewInViewport(Viewport viewport,
                                 VcView view)

addViewport

public void addViewport(VcView v)
Creates action to add a viewport window tothe application and pushes it into queue. The newly created viewport will show the view determined by the input VcView parameter. In case that parameter is null, the Viewport created will show the default view.

Parameters:
v - VcView that will be shown by the new viewport.

addViewport

public void addViewport(java.lang.String viewName)

addViewportInGUI

public void addViewportInGUI(VcView v)
Adds a viewport window that will show the view determined by the input VcView parameter. This method should not be called directly, but from an VcAction object.

Parameters:
v - VcView shown by new viewport window. Must be non null.

renameVcObject

public void renameVcObject(VcObject vcObj,
                           java.lang.String newName)
Sets the label of VcObject vcObj to a given String


renameVcObject

public void renameVcObject(java.lang.String oldName,
                           java.lang.String newName)
Changes the label of the VcObject called oldName to newName.


toggleHelpingGrid

public void toggleHelpingGrid()
Toggles presence of the helping grid in the virtual world.


translate

public void translate(VcObject obj,
                      TransformMode mode,
                      javax.vecmath.Point3d destination)

translateX

public void translateX(java.lang.String modeName,
                       java.lang.String objectName,
                       double value)

translateX

public void translateX(TransformMode mode,
                       VcObject vcObj,
                       double value)

translateY

public void translateY(java.lang.String modeName,
                       java.lang.String objectName,
                       double value)

translateY

public void translateY(TransformMode mode,
                       VcObject vcObj,
                       double value)

translateZ

public void translateZ(java.lang.String modeName,
                       java.lang.String objectName,
                       double value)

translateZ

public void translateZ(TransformMode mode,
                       VcObject vcObj,
                       double value)

rotateX

public void rotateX(java.lang.String modeName,
                    java.lang.String objectName,
                    double value)

rotateX

public void rotateX(TransformMode mode,
                    VcObject vcObj,
                    double value)

rotateY

public void rotateY(java.lang.String modeName,
                    java.lang.String objectName,
                    double value)

rotateY

public void rotateY(TransformMode mode,
                    VcObject vcObj,
                    double value)

rotateZ

public void rotateZ(java.lang.String modeName,
                    java.lang.String objectName,
                    double value)

rotateZ

public void rotateZ(TransformMode mode,
                    VcObject vcObj,
                    double value)

scaleX

public void scaleX(java.lang.String modeName,
                   java.lang.String objectName,
                   double value)

scaleX

public void scaleX(TransformMode mode,
                   VcObject vcObj,
                   double value)

scaleY

public void scaleY(java.lang.String modeName,
                   java.lang.String objectName,
                   double value)

scaleY

public void scaleY(TransformMode mode,
                   VcObject vcObj,
                   double value)

scaleZ

public void scaleZ(java.lang.String modeName,
                   java.lang.String objectName,
                   double value)

scaleZ

public void scaleZ(TransformMode mode,
                   VcObject vcObj,
                   double value)

scale

public void scale(java.lang.String modeName,
                  java.lang.String objectName,
                  double value)

scale

public void scale(TransformMode mode,
                  VcObject vcObj,
                  double value)

changeProjectionPolicy

public void changeProjectionPolicy(VcView vcView,
                                   int projectionPolicy)

changeProjectionPolicy

public void changeProjectionPolicy(java.lang.String strView,
                                   java.lang.String strPolicy)

changeMovementPolicy

public void changeMovementPolicy(VcView vcView,
                                 int projectionPolicy)

changeMovementPolicy

public void changeMovementPolicy(java.lang.String strView,
                                 java.lang.String strPolicy)

changeResizePolicy

public void changeResizePolicy(VcView vcView,
                               int projectionPolicy)

changeResizePolicy

public void changeResizePolicy(java.lang.String strView,
                               java.lang.String strPolicy)

setFieldOfView

public void setFieldOfView(java.lang.String strView,
                           double d)

setFieldOfView

public void setFieldOfView(VcView view,
                           double d)

setActionExecutor

public void setActionExecutor(ActionExecutor executor)

setLaserArrayGrid

public void setLaserArrayGrid(VcLaserArray array,
                              int nx,
                              int ny,
                              double dx,
                              double dy)

changeLaserArrayColor

public void changeLaserArrayColor(VcLaserArray array,
                                  double red,
                                  double green,
                                  double blue)

changeLaserSpotSize

public void changeLaserSpotSize(VcLaserArray array,
                                double size)

addLight

public void addLight(int type,
                     java.lang.String name)

addLight

public void addLight(java.lang.String type,
                     java.lang.String name)

changeLightColor

public void changeLightColor(VcLight light,
                             int red,
                             int green,
                             int blue)

changeLightColor

public void changeLightColor(java.lang.String light,
                             int red,
                             int green,
                             int blue)

changeLightState

public void changeLightState(VcLight light,
                             boolean b)

changeLightState

public void changeLightState(java.lang.String lightName,
                             int onOff)

changePointLightAttenuation

public void changePointLightAttenuation(VcPointLight point,
                                        double constant,
                                        double linear,
                                        double quadratic)

changeSpotSpreadAngle

public void changeSpotSpreadAngle(VcSpotLight spot,
                                  double angle)

changeSpotSpreadAngle

public void changeSpotSpreadAngle(java.lang.String spotName,
                                  double angle)

changeSpotConcentration

public void changeSpotConcentration(VcSpotLight spot,
                                    double concentration)

changeSpotConcentration

public void changeSpotConcentration(java.lang.String spotLightName,
                                    double concentration)

removeFromScene

public void removeFromScene(java.lang.String objectName)

removeFromScene

public void removeFromScene(VcObject vcObject)

saveJPGFile

public void saveJPGFile(Viewport viewport,
                        java.lang.String filename)

saveJPGFileSync

public void saveJPGFileSync(Viewport viewport,
                            java.lang.String filename)
Saves a snapshot from a given viewport in a JPEG file This method enforces synchronous execution, i.e. the method will not return untill the action is completed

Parameters:
viewport - viewport from which generate the snapshot
filename - Name of the output file

saveJPGFile

public void saveJPGFile(Viewport viewport,
                        java.lang.String filename,
                        int w,
                        int h)

saveTXTFile

public void saveTXTFile(java.lang.String filename)

saveJPGFile

public void saveJPGFile(java.lang.String viewportName,
                        java.lang.String filename)

saveJPGFileSync

public void saveJPGFileSync(java.lang.String viewportName,
                            java.lang.String filename)
Saves a snapshot from a given view in a JPEG file This method enforces synchronous execution, i.e. the method will not return untill the action is completed

Parameters:
viewportName - Name of the view from which generate the snapshot
filename - Name of the output file

saveJPGFile

public void saveJPGFile(java.lang.String filename)

saveJPGFileSync

public void saveJPGFileSync(java.lang.String filename)
Saves a snapshot from Default View in a JPEG file This method enforces synchronous execution, i.e. the method will not return untill the action is completed

Parameters:
filename - Name of the output file

enableMessageInViewports

public void enableMessageInViewports(java.lang.String s)

disableMessageInViewports

public void disableMessageInViewports()

getDebugFlag

public boolean getDebugFlag()

setDebugFlag

public void setDebugFlag(boolean b)

frameObjectInView

public void frameObjectInView(VcView v,
                              VcObject obj)

frameObjectsInView

public void frameObjectsInView(VcView v)

frameObjectsInView

public void frameObjectsInView(java.lang.String label)

lookAt

public void lookAt(VcView view,
                   VcObject vcObj)

lookAt

public void lookAt(java.lang.String view,
                   java.lang.String vcObject)

addDistanceMeasurer

public void addDistanceMeasurer()

setMeasurerDirection

public void setMeasurerDirection(java.lang.String measurerName,
                                 int direction,
                                 java.lang.String axisName)

setMeasurerDirection

public void setMeasurerDirection(java.lang.String measurerName,
                                 int direction,
                                 TransformScope axis)

getMeasuredDistance

public double getMeasuredDistance(java.lang.String measurerName)

measureDistance

public void measureDistance(DistanceMeasurer measurer)

addLine

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

setGizmoColor

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

setColorAlternation

public void setColorAlternation(boolean b)

addLine

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

startLineArray

public void startLineArray()

addLineSegment

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

finishLineArray

public void finishLineArray()

setLineLength

public void setLineLength(double length)

setPointWidth

public void setPointWidth(double length)

setPlaneWidth

public void setPlaneWidth(double length)

addPlane

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

addPlane

public void addPlane(javax.vecmath.Vector4d plane)

addPlane

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

addPoint

public void addPoint(javax.vecmath.Point3d point)

clearBagGizmos

public void clearBagGizmos(int clearRange)

selectionChanged

public void selectionChanged(SelectionChangedEvent event)
Implements SelectionChangeListener. This way a GUIControl can always know of Selections at a particular SelectionList

Specified by:
selectionChanged in interface SelectionChangeListener
Parameters:
event - Contains information about the change in selection.

dumpContentEdgesToFile

public void dumpContentEdgesToFile()


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