syn3d.ui.xith3d
Class Frame3DXith3D

java.lang.Object
  extended by syn3d.ui.Transformator
      extended by syn3d.ui.Frame3DBase
          extended by syn3d.ui.xith3d.Frame3DXith3D
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener

public class Frame3DXith3D
extends Frame3DBase

Class description ...

Author:
Claude CAZENAVE

Nested Class Summary
 class Frame3DXith3D.AutoRepaintFrame
           
 
Field Summary
protected  Canvas3D canvas
           
protected  CanvasPeer canvasPeer
           
protected  int lastMouseX
           
protected  int lastMouseY
           
protected  java.util.ArrayList lastPickSelection
           
protected  RenderPeer peer
           
protected  SceneNodeXith3D scene
           
protected  Matrix4f sceneMatrix
           
protected  Transform3D sceneTransform
           
protected  Transform3D tempTransform
           
protected  Transform3D transform
           
protected  View view
           
 
Fields inherited from class syn3d.ui.Frame3DBase
height, peerComponent, peerWindow, pluginManager, popup, screenSize, title, width, x, y
 
Fields inherited from class syn3d.ui.Transformator
drotX, drotY, eyeDistance, perspective, pos2DX, pos2DY, rot, scaleFactor, trans, transFactorX, transFactorY, vtrans, wsize, zoom, zoomFactor
 
Constructor Summary
Frame3DXith3D(SceneNodeXith3D scene, java.lang.Object owner, java.lang.String t, int x, int y, int width, int height, PluginManager pm)
           
 
Method Summary
 void applyTransform()
          Hook for subclasses, to apply the current transformation to a relevant object This method is called internally when a change occurs.
protected  void createPeer(java.lang.Object owner)
           
 SceneNode getScene()
           
protected  float getSceneSize()
          Used for auto-zooming to englobe the scene
 View getView()
           
protected  void internalMakePeer(java.lang.Object owner)
           
static void main(java.lang.String[] args)
          Main function to test navigation
 ActiveNode pick(int posX, int posY)
          Selects a single pick at the given position.
 void rotate2D(int newX, int newY)
          Does a rotation of the scene according to moves in a 2D coordinate system.
 void setPerspective(boolean p)
           
 java.util.ArrayList toggleAllPicks(int posX, int posY)
          Adds or removes all picks between the given position and the last position, to the selected objects.
 java.util.ArrayList toggleSinglePick(int posX, int posY)
          Adds or removes a single pick at the given position to the selected objects.
 
Methods inherited from class syn3d.ui.Frame3DBase
autoZoom, getPeerWindow, getPopup, getTitle, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, setPopup, setTitle
 
Methods inherited from class syn3d.ui.Transformator
changeProjection, getEyeDistance, getPos2DX, getPos2DY, getRot, getScaleFactor, getTrans, getTransFactorX, getTranslationFactorY, getWSize, getZoom, getZoomFactor, init2DPosition, isPerspective, reset, rotate2D, setEyeDistance, setPos2DX, setPos2DY, setRot, setScaleFactor, setTrans, setTransFactorX, setTranslationFactorY, setWSize, setZoom, setZoomFactor, translate2D, updateTranslateMatrix, updateZoomMatrix, zoom, zoom2D
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

peer

protected RenderPeer peer

canvasPeer

protected CanvasPeer canvasPeer

canvas

protected Canvas3D canvas

view

protected View view

sceneTransform

protected Transform3D sceneTransform

sceneMatrix

protected Matrix4f sceneMatrix

transform

protected Transform3D transform

tempTransform

protected Transform3D tempTransform

lastPickSelection

protected java.util.ArrayList lastPickSelection

lastMouseX

protected int lastMouseX

lastMouseY

protected int lastMouseY

scene

protected SceneNodeXith3D scene
Constructor Detail

Frame3DXith3D

public Frame3DXith3D(SceneNodeXith3D scene,
                     java.lang.Object owner,
                     java.lang.String t,
                     int x,
                     int y,
                     int width,
                     int height,
                     PluginManager pm)
Parameters:
owner -
x -
y -
width -
height -
Method Detail

getScene

public SceneNode getScene()
Specified by:
getScene in class Frame3DBase

getView

public View getView()
Returns:
Returns the view.

internalMakePeer

protected void internalMakePeer(java.lang.Object owner)

createPeer

protected void createPeer(java.lang.Object owner)
Specified by:
createPeer in class Frame3DBase

setPerspective

public void setPerspective(boolean p)
Overrides:
setPerspective in class Transformator

rotate2D

public void rotate2D(int newX,
                     int newY)
Description copied from class: Transformator
Does a rotation of the scene according to moves in a 2D coordinate system. Use init2DPosition to position an origin, then do as many rotate2D as required. Note that WSize should be set to the same value referential as the positions. This is typically a window dimension.

Overrides:
rotate2D in class Transformator
Parameters:
newX - The new X position in 2D, typically a mouse position
newY - The new Y position in 2D, typically a mouse position

applyTransform

public void applyTransform()
Description copied from class: Transformator
Hook for subclasses, to apply the current transformation to a relevant object This method is called internally when a change occurs. It has been set public so it is possible to call it explicitely, but this should not be necessary. It does nothing by default, let subclasses do what they want.

Overrides:
applyTransform in class Transformator

getSceneSize

protected float getSceneSize()
Description copied from class: Frame3DBase
Used for auto-zooming to englobe the scene

Overrides:
getSceneSize in class Frame3DBase
Returns:
<=0 if not supported, or the max distance from the origin for any point in the scene otherwise

toggleSinglePick

public java.util.ArrayList toggleSinglePick(int posX,
                                            int posY)
Adds or removes a single pick at the given position to the selected objects.

Parameters:
posX - the 2D X position where to do the picking
posY - the 2D Y position where to do the picking
Returns:
Returns the current selection, possibly an empy array
See Also:
ActiveNode.higlight(boolean,Object)

toggleAllPicks

public java.util.ArrayList toggleAllPicks(int posX,
                                          int posY)
Adds or removes all picks between the given position and the last position, to the selected objects.

Parameters:
posX - the 2D X position defining a region with the last position. All objects in this region should be picked.
posX - the 2D Y position defining a region with the last position. All objects in this region should be picked.
Returns:
Returns the current selection, possibly an empy array
See Also:
ActiveNode.higlight(boolean,Object)

pick

public ActiveNode pick(int posX,
                       int posY)
Selects a single pick at the given position.

Parameters:
posX - the 2D X position where to do the picking
posY - the 2D Y position where to do the picking
Returns:
Returns the picked node or possibly a null object if there was nothing to pick at this position
See Also:
ActiveNode.higlight(boolean,Object)

main

public static void main(java.lang.String[] args)
Main function to test navigation

Parameters:
args -