harmonic.mz.entries
Class PointEntry

java.lang.Object
  |
  +--HWPanel
        |
        +--harmonic.mz.gui.ValueEntry
              |
              +--harmonic.mz.entries.PointEntry
All Implemented Interfaces:
java.awt.event.ComponentListener, Documentable, java.util.EventListener, NodeListener, harmonic.viewer3D.Task, harmonic.viewer3D.event.ViewportListener, harmonic.viewer3D.event.ViewportMouseListener

public class PointEntry
extends ValueEntry
implements NodeListener, harmonic.viewer3D.event.ViewportListener, harmonic.viewer3D.event.ViewportMouseListener

GUI widget for entering point values. Most of the brains of this are concerned with processing mouse input from the viewport, which picks point of the UCS picking plane.

Ortho: Points tend to come in sequences, and thats when this applies. Points i=1,n will be such that they are on a line of the same x or same y as the point i-1. A variable 'bFirstPoint' is keeped to indicate when ortho is not in effect. The sequence is restarted when PointEntry.reset() is called. Note that ortho only takes effect when the point is picked with the mouse.

Component Sequence: Pick x, y, z in sequence. This is a sequence in a larger sequence, possibly, but not nessesary. If it is the first point in the larger sequence the read out will show the complete point under the cross hair as the mouse is moved (tentativly). When the button is pressed, compSeqBasePoint is set to the current point. Then as the mouse is moved only y and z will update, and x will be fixed (by reading from compSeqBasePoint). The button is pressed and compSeqBasePoint is set to the current point again. Only z will update as the mouse is moved. The button is pressed and the point is finaly sent to the client. Maybe the point will be sent as a tentative through out the x, y, z sequence, maybe not. For subseqent points in the larger sequence it would be possible to use compSeqBasePoint from the previous point, or the complete point as in the first. I say make it just like the first.

See Also:
Serialized Form

Field Summary
static PointEntry activePointEntry
           
static BooleanField bCompSeq
           
static BooleanField bDrawBlips
           
static BooleanField bGridSnap
           
static BooleanField bOrtho
           
static BooleanField bReferencedSnaps
           
 PointField field
           
static int FILTER_X
           
static int FILTER_XY
           
static int FILTER_XYZ
           
static int FILTER_Y
           
static int FILTER_YZ
           
static int FILTER_Z
           
static int FILTER_ZX
           
static int NEW_POINT
           
static int SNAP
           
static BooleanField x_comp
           
static BooleanField xy_comp
           
static BooleanField y_comp
           
static BooleanField yz_comp
           
static BooleanField z_comp
           
static BooleanField zx_comp
           
 
Constructor Summary
PointEntry()
           
PointEntry(java.lang.String label, java.lang.Object listener, java.lang.String callback)
          Constructs a PointEntry
PointEntry(java.lang.String label, java.lang.Object listener, java.lang.String callback, harmonic.meshGeom.math.Pnt3f point)
          Constructs a PointEntry
PointEntry(java.lang.String label, java.lang.Object listener, java.lang.String callback, harmonic.meshGeom.math.Pnt3f point, boolean bMulti)
          Constructs a PointEntry
PointEntry(java.lang.String label, harmonic.meshGeom.math.Pnt3f point)
          Constructs a PointEntry
 
Method Summary
static void addSnapSearcher(harmonic.mz.snap.PointSnapSearcher pss)
          Add snap searcher
static void appInit()
           
 void assignFromPointText(java.lang.String pointText)
           
 void assignFromReadout()
          Override to assign value from readout.
 void beginEntry(harmonic.viewer3D.Task parentTask)
          Begin picking points off viewport
 void cancelEntry()
          Called when entry or thing owning entry is canceled, as the elements of the task tree are canceled.
 void changeCoordRep(int x)
           
 void cleanTask()
           
 void contract()
          Shrink to small size.
 void expand()
          Expand to full size.
 void fin_comp()
           
 void fin()
           
 void finishEntry()
          Called when entry is properly finished.
 void format(int w, int h)
           
static void gcsToDevice(harmonic.meshGeom.math.Pnt3f pnt)
           
static void gcsToUcs(harmonic.meshGeom.math.Pnt3f pnt)
           
static void gcsToView(harmonic.meshGeom.math.Pnt3f pnt)
           
 java.awt.Dimension getEntrySize()
          Override to return the size of the specialized value entry controls.
 harmonic.meshGeom.math.Pnt3f getOldPoint()
           
static harmonic.meshGeom.math.Pnt3f getPickingPoint()
           
 int getPickingPoint(harmonic.meshGeom.math.Pnt3f ret, int x, int y)
           
 harmonic.meshGeom.math.Pnt3f getPoint()
          Return the point value.
 void initReadout()
          Override to assign readout from value.
 java.lang.String makePointString(harmonic.meshGeom.math.Pnt3f _p)
           
 void makeValueUI()
           
 void monologFinished()
          This is called by Monolog when it is finished.
 void mouseClicked(harmonic.viewer3D.event.ViewportMouseEvent e)
           
 void mouseDragged(harmonic.viewer3D.event.ViewportMouseEvent e)
           
 void mouseEntered(harmonic.viewer3D.event.ViewportMouseEvent e)
           
 void mouseExited(harmonic.viewer3D.event.ViewportMouseEvent e)
           
 void mouseMoved(harmonic.viewer3D.event.ViewportMouseEvent e)
           
 void mousePressed(harmonic.viewer3D.event.ViewportMouseEvent e)
           
 void mouseReleased(harmonic.viewer3D.event.ViewportMouseEvent e)
           
 void nodeChanged(ModelNode f)
           
static void onPickingPlane(java.awt.event.ItemEvent e)
           
static void onPickSequencial(java.awt.event.ItemEvent e)
           
 void onPointTextEntered(java.awt.event.TextEvent e)
           
static void onReadOut()
           
 void onSettingsButton(java.awt.event.ItemEvent e)
           
 harmonic.meshGeom.math.Pnt3f parsePoint(java.lang.String _pointText)
           
static void pickComponents(int x)
           
 void pointOnPlane(harmonic.meshGeom.math.Pnt3f ret, int x, int y)
           
static void pointOnPlane(harmonic.meshGeom.math.Pnt3f ret, int x, int y, harmonic.viewer3D.Viewport view, harmonic.meshGeom.math.TMat globalPerPlane)
          Utility for calculating point on picking plane
static void removeSnapSearcher(harmonic.mz.snap.PointSnapSearcher pss)
          Remove snap searcher
static void reset()
           
 void setBasePoint(harmonic.meshGeom.math.Pnt3f p)
           
 void setField(ModelNode f)
          Sets the effected data node.
 void setPickingPlane(int x)
          Set the picking plane coordinate system to one of the contant values declared in this class.
 void setPoint(harmonic.meshGeom.math.Tuple3f p)
          Sets the point value.
 void setReadOut(int x)
          Set the readout coordinate system to one of the contant values declared in this class.
 void setUpMouse()
           
 void snapToRTGrid(harmonic.meshGeom.math.Pnt3f _point)
           
 void snapToXYGrid(harmonic.meshGeom.math.Pnt3f point)
           
static void transformUCSFromLocal(harmonic.meshGeom.math.Pnt3f p, PointField field)
           
static void transformUCSToLocal(harmonic.meshGeom.math.Pnt3f p, PointField field)
           
static void ucsToGcs(harmonic.meshGeom.math.Pnt3f pnt)
           
static void ucsToView(harmonic.meshGeom.math.Pnt3f pnt)
           
 void updateCrossHair(int r)
           
 void updateField()
          This is called by notifyListeners we have a EntryEvent.VALUE_CHANGED.
 void updateMousePosition(int x, int y)
           
 void updatePointText(harmonic.meshGeom.math.Pnt3f p)
           
 void viewportChanged(harmonic.viewer3D.event.ViewportEvent e)
           
 void waitForApproach(harmonic.meshGeom.math.Pnt3f approachValue)
          Mouse input will be ignored unill approachValue is neared with the mouse.
 
Methods inherited from class harmonic.mz.gui.ValueEntry
_notifyListeners_, add, addEntryListener, aquireInput, beginTask, cancelTask, componentHidden, componentMoved, componentResized, componentShown, contractIcon, echoFieldChange, expandCheck, expandIcon, finishTask, getField, getInstanceURL, getPreferredSize, getTaskName, getTypeURL, highlight, init, innerChange, isActive, isDoingTask, isExpanded, mousePressed, nodeChanged, notifyListeners_ValueChanged, notifyListeners, removeEntryListener, savePrev, setDocURL, setInnerChange, setValue, transferListener, unlinkField, validateUISettings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface harmonic.mz.event.NodeListener
nodeChanged
 

Field Detail

bReferencedSnaps

public static BooleanField bReferencedSnaps

bGridSnap

public static BooleanField bGridSnap

bCompSeq

public static BooleanField bCompSeq

bOrtho

public static BooleanField bOrtho

bDrawBlips

public static BooleanField bDrawBlips

x_comp

public static BooleanField x_comp

y_comp

public static BooleanField y_comp

z_comp

public static BooleanField z_comp

xy_comp

public static BooleanField xy_comp

yz_comp

public static BooleanField yz_comp

zx_comp

public static BooleanField zx_comp

activePointEntry

public static PointEntry activePointEntry

FILTER_XYZ

public static final int FILTER_XYZ
See Also:
Constant Field Values

FILTER_XY

public static final int FILTER_XY
See Also:
Constant Field Values

FILTER_YZ

public static final int FILTER_YZ
See Also:
Constant Field Values

FILTER_ZX

public static final int FILTER_ZX
See Also:
Constant Field Values

FILTER_X

public static final int FILTER_X
See Also:
Constant Field Values

FILTER_Y

public static final int FILTER_Y
See Also:
Constant Field Values

FILTER_Z

public static final int FILTER_Z
See Also:
Constant Field Values

SNAP

public static final int SNAP
See Also:
Constant Field Values

NEW_POINT

public static final int NEW_POINT
See Also:
Constant Field Values

field

public PointField field
Constructor Detail

PointEntry

public PointEntry()

PointEntry

public PointEntry(java.lang.String label,
                  harmonic.meshGeom.math.Pnt3f point)
Constructs a PointEntry


PointEntry

public PointEntry(java.lang.String label,
                  java.lang.Object listener,
                  java.lang.String callback)
Constructs a PointEntry


PointEntry

public PointEntry(java.lang.String label,
                  java.lang.Object listener,
                  java.lang.String callback,
                  harmonic.meshGeom.math.Pnt3f point)
Constructs a PointEntry


PointEntry

public PointEntry(java.lang.String label,
                  java.lang.Object listener,
                  java.lang.String callback,
                  harmonic.meshGeom.math.Pnt3f point,
                  boolean bMulti)
Constructs a PointEntry

Method Detail

appInit

public static void appInit()

setField

public void setField(ModelNode f)
Sets the effected data node.

Overrides:
setField in class ValueEntry

makeValueUI

public void makeValueUI()

nodeChanged

public void nodeChanged(ModelNode f)

onSettingsButton

public void onSettingsButton(java.awt.event.ItemEvent e)
Overrides:
onSettingsButton in class ValueEntry

addSnapSearcher

public static void addSnapSearcher(harmonic.mz.snap.PointSnapSearcher pss)
Add snap searcher


removeSnapSearcher

public static void removeSnapSearcher(harmonic.mz.snap.PointSnapSearcher pss)
Remove snap searcher


format

public void format(int w,
                   int h)

getEntrySize

public java.awt.Dimension getEntrySize()
Description copied from class: ValueEntry
Override to return the size of the specialized value entry controls.

Overrides:
getEntrySize in class ValueEntry

expand

public void expand()
Description copied from class: ValueEntry
Expand to full size. Default does nothing. There are no assumptions built into how the expand is accomplished, but a general pattern would be to add child components, calling reformat() when finished. These functions (expand() and contract()) provide users of ValueEntries to handle these ideas generally.

Overrides:
expand in class ValueEntry

contract

public void contract()
Description copied from class: ValueEntry
Shrink to small size.

Overrides:
contract in class ValueEntry

setUpMouse

public void setUpMouse()

beginEntry

public void beginEntry(harmonic.viewer3D.Task parentTask)
Begin picking points off viewport

Overrides:
beginEntry in class ValueEntry

finishEntry

public void finishEntry()
Description copied from class: ValueEntry
Called when entry is properly finished. Do listener deregistration and remove any objects from viewport.

Overrides:
finishEntry in class ValueEntry

cancelEntry

public void cancelEntry()
Description copied from class: ValueEntry
Called when entry or thing owning entry is canceled, as the elements of the task tree are canceled. Do listener deregistration and remove any objects from viewport.

Overrides:
cancelEntry in class ValueEntry

cleanTask

public void cleanTask()
Specified by:
cleanTask in interface harmonic.viewer3D.Task

waitForApproach

public void waitForApproach(harmonic.meshGeom.math.Pnt3f approachValue)
Mouse input will be ignored unill approachValue is neared with the mouse.


setReadOut

public void setReadOut(int x)
Set the readout coordinate system to one of the contant values declared in this class.


setPickingPlane

public void setPickingPlane(int x)
Set the picking plane coordinate system to one of the contant values declared in this class. The default, and the best tested, is the UCS plane.


setPoint

public void setPoint(harmonic.meshGeom.math.Tuple3f p)
Sets the point value.


getPoint

public harmonic.meshGeom.math.Pnt3f getPoint()
Return the point value.


getOldPoint

public harmonic.meshGeom.math.Pnt3f getOldPoint()

getPickingPoint

public static harmonic.meshGeom.math.Pnt3f getPickingPoint()

getPickingPoint

public int getPickingPoint(harmonic.meshGeom.math.Pnt3f ret,
                           int x,
                           int y)

pointOnPlane

public static void pointOnPlane(harmonic.meshGeom.math.Pnt3f ret,
                                int x,
                                int y,
                                harmonic.viewer3D.Viewport view,
                                harmonic.meshGeom.math.TMat globalPerPlane)
Utility for calculating point on picking plane


pointOnPlane

public void pointOnPlane(harmonic.meshGeom.math.Pnt3f ret,
                         int x,
                         int y)

gcsToUcs

public static void gcsToUcs(harmonic.meshGeom.math.Pnt3f pnt)

ucsToGcs

public static void ucsToGcs(harmonic.meshGeom.math.Pnt3f pnt)

gcsToView

public static void gcsToView(harmonic.meshGeom.math.Pnt3f pnt)

gcsToDevice

public static void gcsToDevice(harmonic.meshGeom.math.Pnt3f pnt)

ucsToView

public static void ucsToView(harmonic.meshGeom.math.Pnt3f pnt)

transformUCSToLocal

public static void transformUCSToLocal(harmonic.meshGeom.math.Pnt3f p,
                                       PointField field)

transformUCSFromLocal

public static void transformUCSFromLocal(harmonic.meshGeom.math.Pnt3f p,
                                         PointField field)

snapToXYGrid

public void snapToXYGrid(harmonic.meshGeom.math.Pnt3f point)

snapToRTGrid

public void snapToRTGrid(harmonic.meshGeom.math.Pnt3f _point)

updateMousePosition

public void updateMousePosition(int x,
                                int y)

updateField

public void updateField()
Description copied from class: ValueEntry
This is called by notifyListeners we have a EntryEvent.VALUE_CHANGED. It is a good place to insert code that updates a data nodes value from this. The policy is to update the field if it is known, rather than expecting a field to update it self by adding itself as a EntryListener. The caller of this changes the transientness of the field to match the EntryEvent.FINAL/INCREMENTAL flag.

Overrides:
updateField in class ValueEntry

viewportChanged

public void viewportChanged(harmonic.viewer3D.event.ViewportEvent e)
Specified by:
viewportChanged in interface harmonic.viewer3D.event.ViewportListener

updateCrossHair

public void updateCrossHair(int r)

changeCoordRep

public void changeCoordRep(int x)

makePointString

public java.lang.String makePointString(harmonic.meshGeom.math.Pnt3f _p)

pickComponents

public static void pickComponents(int x)

initReadout

public void initReadout()
Description copied from class: ValueEntry
Override to assign readout from value.

Overrides:
initReadout in class ValueEntry

updatePointText

public void updatePointText(harmonic.meshGeom.math.Pnt3f p)

mouseMoved

public void mouseMoved(harmonic.viewer3D.event.ViewportMouseEvent e)
Specified by:
mouseMoved in interface harmonic.viewer3D.event.ViewportMouseListener

mouseDragged

public void mouseDragged(harmonic.viewer3D.event.ViewportMouseEvent e)
Specified by:
mouseDragged in interface harmonic.viewer3D.event.ViewportMouseListener

mousePressed

public void mousePressed(harmonic.viewer3D.event.ViewportMouseEvent e)
Specified by:
mousePressed in interface harmonic.viewer3D.event.ViewportMouseListener

mouseReleased

public void mouseReleased(harmonic.viewer3D.event.ViewportMouseEvent e)
Specified by:
mouseReleased in interface harmonic.viewer3D.event.ViewportMouseListener

mouseExited

public void mouseExited(harmonic.viewer3D.event.ViewportMouseEvent e)
Specified by:
mouseExited in interface harmonic.viewer3D.event.ViewportMouseListener

mouseEntered

public void mouseEntered(harmonic.viewer3D.event.ViewportMouseEvent e)
Specified by:
mouseEntered in interface harmonic.viewer3D.event.ViewportMouseListener

mouseClicked

public void mouseClicked(harmonic.viewer3D.event.ViewportMouseEvent e)
Specified by:
mouseClicked in interface harmonic.viewer3D.event.ViewportMouseListener

parsePoint

public harmonic.meshGeom.math.Pnt3f parsePoint(java.lang.String _pointText)

setBasePoint

public void setBasePoint(harmonic.meshGeom.math.Pnt3f p)

assignFromReadout

public void assignFromReadout()
Description copied from class: ValueEntry
Override to assign value from readout. Called by InputEntrySequence when next value is requested.

Overrides:
assignFromReadout in class ValueEntry

monologFinished

public void monologFinished()
Description copied from class: ValueEntry
This is called by Monolog when it is finished. (ok'ed) By default this calles assignFromReadout(), to make is so user doent have to hit enter in the text boxes. Override this to change this behavour This system has proven better then calling assignFromReadout() when a value entry looses keyboard focus.

Overrides:
monologFinished in class ValueEntry

onPointTextEntered

public void onPointTextEntered(java.awt.event.TextEvent e)

assignFromPointText

public void assignFromPointText(java.lang.String pointText)

fin_comp

public void fin_comp()

fin

public void fin()

reset

public static void reset()

onReadOut

public static void onReadOut()

onPickingPlane

public static void onPickingPlane(java.awt.event.ItemEvent e)

onPickSequencial

public static void onPickSequencial(java.awt.event.ItemEvent e)