public class InteractiveFrame extends GenericFrame
GenericFrame
with a Profile
instance which allows Shortcut
to
Method
bindings high-level customization (see all the
*Binding*() methods). Refer to
Profile.setBinding(Shortcut, String)
and
Profile.setBinding(Object, Shortcut, String)
for the type of
actions and method signatures that may be bound.
Visual representations (PShapes or arbitrary graphics procedures) may be related to an interactive-frame in two different ways:
GenericFrame
API
class documentation).
setShape(PShape)
(retained mode) or setShape(Object, String)
(immediate mode) in papplet.setup(), and then calling
Scene.drawFrames()
in papplet.draw().
GenericFrame.pickingPrecision()
is set to PickingPrecision#EXACT
and the scene Scene.pickingBuffer()
is enabled (see
Scene.enablePickingBuffer()
). Using a picking buffer requires
the geometry to be drawn twice, one at the front-buffer and one at the picking-buffer.
If performance is a concern, use another GenericFrame.pickingPrecision()
strategy, or
differentiate the front and the picking shapes (using a simpler representation in the
later case) by calling setFrontShape(PShape)
and
setPickingShape(PShape)
, respectively. Note that setShape(PShape)
just calls setFrontShape(PShape)
and setPickingShape(PShape)
on the
same shape.
If the above conditions are met, the visual representation may be highlighted when
picking takes place (see setHighlightingMode(HighlightingMode)
).
GenericFrame
Modifier and Type | Class and Description |
---|---|
static class |
InteractiveFrame.HighlightingMode
Enumerates the highlighting modes.
|
GenericFrame.PickingPrecision
dirIsFixed, initEvent
Constructor and Description |
---|
InteractiveFrame(Eye eye)
Calls
super(eye) , add the drawEye(PGraphics) graphics handler,
creates the frame Profile and calls setDefaultMouseBindings() and
setDefaultKeyBindings() . |
InteractiveFrame(Scene scn)
Calls
super(scn . |
InteractiveFrame(Scene scn,
GenericFrame referenceFrame)
Constructs an interactive-frame as a child of reference frame.
|
InteractiveFrame(Scene scn,
GenericFrame referenceFrame,
Object obj,
String methodName)
Calls
super(scn, referenceFrame . |
InteractiveFrame(Scene scn,
GenericFrame referenceFrame,
PShape ps)
Calls
super(scn, referenceFrame) . |
InteractiveFrame(Scene scn,
GenericFrame referenceFrame,
String methodName)
Calls
super(scn, referenceFrame) . |
InteractiveFrame(Scene scn,
Object obj,
String methodName)
Calls
super(scn . |
InteractiveFrame(Scene scn,
PShape ps)
Calls
super(scn . |
InteractiveFrame(Scene scn,
String methodName)
Calls
super(scn) . |
Modifier and Type | Method and Description |
---|---|
String |
action(Shortcut shortcut)
Same as
return profile.action(key) . |
void |
applyTransformation(PGraphics pg)
Same as
((Scene) scene).applyTransformation(pg, this) . |
void |
applyWorldTransformation(PGraphics pg)
Same as
((Scene) scene).applyWorldTransformation(pg, this) . |
boolean |
checkIfGrabsInput(BogusEvent event)
Checks for the existence of the
Grabber.checkIfGrabsInput(BogusEvent) condition at the
Scene.pApplet() , having
public boolean checkIfGrabsInput(InteractiveFrame, CustomEvent) as method
prototype. |
boolean |
checkIfGrabsInput(float x,
float y)
An interactive-frame may be picked using
'ray-picking' with a
color buffer (see
Scene.pickingBuffer() ). |
boolean |
checkIfGrabsInput(KeyboardEvent event)
Same as
return profile.hasBinding(event.shortcut()) . |
void |
draw()
Same as
draw(scene.pg()) . |
boolean |
draw(PGraphics pg)
Draw the visual representation of the frame into the given PGraphics using the
current point of view (see
Scene.applyWorldTransformation(PGraphics, Frame) ). |
void |
drawEye(PGraphics pg)
Same as
scene().drawEye(pg, eye()) . |
void |
drawEyeNearPlane(PGraphics pg)
Same as
scene().drawEyeNearPlane(pg, eye()) . |
boolean |
equals(Object obj) |
InteractiveFrame |
get()
Perform a deep, non-recursive copy of this generic-frame.
|
boolean |
hasBinding(Shortcut shortcut)
Same as
return profile.hasBinding(shortcut) . |
boolean |
hasClickBinding(int id,
int count)
Same as
return hasBinding(new ClickShortcut(id, count)) . |
boolean |
hasClickBinding(int m,
int id,
int count)
Same as
return hasBinding(new ClickShortcut(m, id, count)) . |
int |
hashCode() |
boolean |
hasKeyBinding(char key)
Same as
return hasBinding(new KeyboardShortcut(key)) . |
boolean |
hasKeyBinding(int vkey)
Same as
return hasBinding(new KeyboardShortcut(vkey)) . |
boolean |
hasKeyBinding(int mask,
char key)
Same as
hasKeyBinding(mask, Scene.keyCode(key)) . |
boolean |
hasKeyBinding(int mask,
int vkey)
Same as
return hasBinding(new KeyboardShortcut(mask, vkey)) . |
boolean |
hasMotionBinding(int id)
Same as
hasBinding(new MotionShortcut(id)) . |
boolean |
hasMotionBinding(int m,
int id)
Same as
hasBinding(new MotionShortcut(m, id)) . |
InteractiveFrame.HighlightingMode |
highlightingMode()
Returns the highlighting mode.
|
String |
info()
Returns a description of all the bindings this frame holds.
|
String |
info(Class<? extends Shortcut> cls)
Same as
profile.info(cls) . |
boolean |
isActionBound(String action)
Same as
return profile.isActionBound(action) . |
boolean |
isFrontShapeReset()
Returns
true if the front-shape has not been set (or has been reset) and false otherwise. |
boolean |
isPickingShapeReset()
Returns
true if the picking-shape has not been set (or has been reset) and false otherwise. |
boolean |
isShapeReset()
Same as
return isFrontShapeReset() && isPickingShapeReset(); . |
void |
performInteraction(BogusEvent event)
Same as
profile.handle(event) . |
void |
removeBinding(Shortcut shortcut)
Same as
profile.removeBinding(shortcut) . |
void |
removeBindings()
Same as
profile.removeBindings() . |
void |
removeBindings(Class<? extends Shortcut> cls)
Same as
profile.removeBindings(cls) . |
void |
removeClickBinding(int id,
int count)
Same as
removeBinding(new ClickShortcut(id, count)) . |
void |
removeClickBinding(int m,
int id,
int count)
Same as
removeBinding(new ClickShortcut(m, id, count)) . |
void |
removeClickBindings()
Remove all click bindings.
|
void |
removeKeyBinding(char key)
Same as
removeBinding(new KeyboardShortcut(key)) . |
void |
removeKeyBinding(int vkey)
Same as
removeBinding(new KeyboardShortcut(vkey)) . |
void |
removeKeyBinding(int mask,
char key)
Same as
removeKeyBinding(mask, Scene.keyCode(key)) . |
void |
removeKeyBinding(int mask,
int vkey)
Same as
removeBinding(new KeyboardShortcut(mask, vkey)) . |
void |
removeKeyBindings()
Remove all key bindings.
|
void |
removeMotionBinding(int id)
Same as
removeBinding(new MotionShortcut(id)) . |
void |
removeMotionBinding(int m,
int id)
Same as
removeBinding(new MotionShortcut(m, id)) . |
void |
removeMotionBindings()
Remove all motion bindings.
|
void |
resetFrontShape()
Resets the front-shape which is wrapped by this interactive-frame.
|
void |
resetPickingShape()
Resets the picking-shape which is wrapped by this interactive-frame.
|
void |
resetShape()
Same as
resetFrontShape(); resetPickingShape(); . |
Scene |
scene()
Returns the scene this object belongs to.
|
void |
set(InteractiveFrame otherFrame)
Calls
Frame.setWorldMatrix(Frame) , setBindings(InteractiveFrame) , and
setShape(InteractiveFrame) on the other frame instance. |
void |
setBinding(Object object,
Shortcut shortcut,
String action)
Same as
profile.setBinding(object, shortcut, action) . |
void |
setBinding(Shortcut shortcut,
String action)
Same as
profile.setBinding(shortcut, action) . |
void |
setBindings(InteractiveFrame otherFrame)
Same as
profile.set(otherFrame.profile) . |
void |
setClickBinding(int m,
int id,
int count,
String action)
Same as
setBinding(new ClickShortcut(m, id, count), action) . |
void |
setClickBinding(int id,
int count,
String action)
Same as
setBinding(new ClickShortcut(id, count), action) . |
void |
setClickBinding(Object object,
int m,
int id,
int count,
String action)
Same as
setBinding(object, new ClickShortcut(m, id, count), action) . |
void |
setClickBinding(Object object,
int id,
int count,
String action)
Same as
setBinding(object, new ClickShortcut(id, count), action) . |
void |
setDefaultKeyBindings()
Calls
removeKeyBindings() and sets the default frame key bindings which may
be queried with info() . |
void |
setDefaultMouseBindings()
Same as
scene().mouseAgent().setDefaultBindings(this) . |
void |
setDefaultTouchBindings()
Same as
scene().droidTouchAgent().setDefaultBindings(this) . |
void |
setFrontShape(InteractiveFrame otherFrame)
Sets the frame front-shape from that of other frame.
|
void |
setFrontShape(Object object,
String methodName)
Immediate mode rendering of the front shape using a graphics procedure
(
methodName ) implemented by the object . |
void |
setFrontShape(PShape ps)
Retained mode rendering of the front shape using a PShape.
|
void |
setFrontShape(String methodName)
Immediate mode rendering of the front shape using a graphics procedure
(
methodName ). |
void |
setHighlightingMode(InteractiveFrame.HighlightingMode mode)
Enables highlighting of the frame visual representation when picking takes place
(
GenericFrame.grabsInput() returns true ) according to mode as follows: |
void |
setKeyBinding(char key,
String action)
Same as
setBinding(new KeyboardShortcut(key), action) . |
void |
setKeyBinding(int mask,
char key,
String action)
Same as
setKeyBinding(mask, Scene.keyCode(key), action) . |
void |
setKeyBinding(int mask,
int vkey,
String action)
Same as
setBinding(new KeyboardShortcut(mask, vkey), action) . |
void |
setKeyBinding(int vkey,
String action)
Same as
setBinding(new KeyboardShortcut(vkey), action) . |
void |
setKeyBinding(Object object,
char key,
String action)
Same as
setBinding(object, new KeyboardShortcut(key), action) . |
void |
setKeyBinding(Object object,
int mask,
char key,
String action)
Same as
setKeyBinding(object, mask, Scene.keyCode(key), action) . |
void |
setKeyBinding(Object object,
int mask,
int vkey,
String action)
Same as
setBinding(object, new KeyboardShortcut(mask, vkey), action) . |
void |
setKeyBinding(Object object,
int vkey,
String action)
Same as
setBinding(object, new KeyboardShortcut(vkey), action) . |
void |
setMotionBinding(int m,
int id,
String action)
Same as
setBinding(new MotionShortcut(m, id), action) . |
void |
setMotionBinding(int id,
String action)
Same as
setBinding(new MotionShortcut(id), action) . |
void |
setMotionBinding(Object object,
int m,
int id,
String action)
Same as
setBinding(object, new MotionShortcut(m, id), action) . |
void |
setMotionBinding(Object object,
int id,
String action)
Same as
setBinding(object, new MotionShortcut(id), action) . |
void |
setPickingPrecision(GenericFrame.PickingPrecision precision)
Sets the picking precision of the frame.
|
void |
setPickingShape(InteractiveFrame otherFrame)
Sets the frame picking-shape from that of other frame.
|
void |
setPickingShape(Object object,
String methodName)
Immediate mode rendering of the picking shape using a graphics procedure
(
methodName ) implemented by the object . |
void |
setPickingShape(PShape ps)
Retained mode rendering of the picking shape using a PShape.
|
void |
setPickingShape(String methodName)
Immediate mode rendering of the picking shape using a graphics procedure
(
methodName ). |
void |
setShape(InteractiveFrame otherFrame)
Same as
setFrontShape(otherFrame); setPickingShape(otherFrame); . |
void |
setShape(Object obj,
String methodName)
Same as
setFrontShape(obj, methodName); setPickingShape(obj, methodName); . |
void |
setShape(PShape ps)
Same as
setFrontShape(ps); setPickingShape(ps); . |
void |
setShape(String methodName)
Same as
setFrontShape(methodName); setPickingShape(methodName); . |
void |
shiftFrontShape(Vec shift)
Shifts the front-frame shape respect to the frame
Frame.position() . |
void |
shiftPickingShape(Vec shift)
Shifts the picking-frame shape respect to the frame
Frame.position() . |
void |
shiftShape(Vec shift)
Same as
shiftFrontShape(shift); shiftPickingShape(shift) . |
void |
visit()
Procedure called by the scene frame traversal algorithm.
|
align, anchorFromPixel, applyTransformation, applyTransformation, applyWorldTransformation, applyWorldTransformation, center, checkIfGrabsInput, checkIfGrabsInput, checkIfGrabsInput, checkIfGrabsInput, checkIfGrabsInput, checkIfGrabsInput, children, damping, deformedBallRotation, disableVisit, disableVisualHint, drive, drive, enableVisit, enableVisualHint, eye, eyeToReferenceFrame, eyeToReferenceFrame, flyDirection, flySpeed, grabsInput, grabsInput, grabsInputThreshold, hinge, hinge, isEyeFrame, isFlying, isSceneAvatar, isSpinning, isVisitEnabled, isVisualHintEnabled, keyboardSensitivity, lastUpdate, lookAround, moveBackward, moveForward, pickingPrecision, referenceFrame, rotate, rotate, rotateAroundFrame, rotateCAD, rotateCAD, rotateX, rotateX, rotateXNeg, rotateXPos, rotateXYZ, rotateY, rotateY, rotateYNeg, rotateYPos, rotateZ, rotateZ, rotateZNeg, rotateZPos, rotationSensitivity, scale, scale, scaleNeg, scalePos, scalingSensitivity, sceneUpVector, screenRotate, screenRotate, screenToEye, screenToEye, screenToQuat, screenToQuat, screenToVec, screenToVec, screenTranslate, screenTranslate, setDamping, setFlyDirection, setFlySpeed, setGrabsInputThreshold, setKeyboardSensitivity, setReferenceFrame, setReferenceFrame, setRotationSensitivity, setScalingSensitivity, setSceneUpVector, setSpinningRotation, setSpinningSensitivity, setTrackingEyeAzimuth, setTrackingEyeDistance, setTrackingEyeInclination, setTranslationSensitivity, setWheelSensitivity, spinningRotation, spinningSensitivity, startFlying, startSpinning, stopFlying, stopSpinning, sync, sync, toggleVisit, toggleVisualHint, trackingEyeAzimuth, trackingEyeDistance, trackingEyeFrame, trackingEyeInclination, translate, translate, translateRotateXYZ, translateX, translateX, translateXNeg, translateXPos, translateXYZ, translateXYZ, translateY, translateY, translateYNeg, translateYPos, translateZ, translateZ, translateZNeg, translateZPos, translationSensitivity, updateSceneUpVector, visitCallback, wheelSensitivity, zoomOnAnchor, zoomOnAnchorNeg, zoomOnAnchorPos, zoomOnPixel, zoomOnRegion, zoomOnRegion
alignWithFrame, alignWithFrame, alignWithFrame, alignWithFrame, constraint, coordinatesOf, coordinatesOfFrom, coordinatesOfIn, fromMatrix, fromMatrix, inverse, inverseCoordinatesOf, inverseTransformOf, is2D, is3D, localCoordinatesOf, localInverseCoordinatesOf, localInverseTransformOf, localTransformOf, magnitude, matrix, orientation, position, projectOnLine, rotate, rotate, rotateAroundFrame, rotateAroundPoint, rotation, scale, scaling, set, setConstraint, setMagnitude, setMatrix, setOrientation, setOrientation, setOrientationWithConstraint, setPosition, setPosition, setPosition, setPositionWithConstraint, setRotation, setRotation, setRotation, setRotationWithConstraint, setScaling, settingAsReferenceFrameWillCreateALoop, setTranslation, setTranslation, setTranslation, setTranslationWithConstraint, setWorldMatrix, setXAxis, setYAxis, setZAxis, transformOf, transformOfFrom, transformOfIn, translate, translate, translate, translation, worldInverse, worldMatrix, xAxis, xAxis, yAxis, yAxis, zAxis, zAxis
public InteractiveFrame(Eye eye)
super(eye)
, add the drawEye(PGraphics)
graphics handler,
creates the frame Profile
and calls setDefaultMouseBindings()
and
setDefaultKeyBindings()
.drawEye(PGraphics)
,
GenericFrame.GenericFrame(Eye)
public InteractiveFrame(Scene scn)
GenericFrame.GenericFrame(AbstractScene)
public InteractiveFrame(Scene scn, GenericFrame referenceFrame)
super(scn, referenceFrame
. Sets the GenericFrame.pickingPrecision()
to
PickingPrecision#EXACT
.public InteractiveFrame(Scene scn, PShape ps)
super(scn
. Calls setShape(PShape)
on the ps
. Sets the
GenericFrame.pickingPrecision()
to PickingPrecision#EXACT
.public InteractiveFrame(Scene scn, GenericFrame referenceFrame, PShape ps)
super(scn, referenceFrame)
. Calls setShape(PShape)
on the
ps
. Sets the GenericFrame.pickingPrecision()
to PickingPrecision#EXACT
.public InteractiveFrame(Scene scn, String methodName)
super(scn)
. Calls setShape(String)
on the methodName
.
Sets the GenericFrame.pickingPrecision()
to PickingPrecision#FIXED
if
methodName=="drawAxes" || methodName=="drawGrid" || methodName=="drawDottedGrid"
.
Otherwise sets it to PickingPrecision#EXACT
.GenericFrame.GenericFrame(AbstractScene)
public InteractiveFrame(Scene scn, Object obj, String methodName)
super(scn
. Calls setShape(Object, String)
. Sets the
GenericFrame.pickingPrecision()
to PickingPrecision#EXACT
.public InteractiveFrame(Scene scn, GenericFrame referenceFrame, String methodName)
super(scn, referenceFrame)
. Calls setShape(String)
on the
methodName
. Sets the GenericFrame.pickingPrecision()
to
PickingPrecision#EXACT
.public InteractiveFrame(Scene scn, GenericFrame referenceFrame, Object obj, String methodName)
super(scn, referenceFrame
. Calls setShape(Object, String)
.
Sets the GenericFrame.pickingPrecision()
to PickingPrecision#EXACT
.public void drawEye(PGraphics pg)
scene().drawEye(pg, eye())
.
This method is only meaningful when frame GenericFrame.isEyeFrame()
.
public void drawEyeNearPlane(PGraphics pg)
scene().drawEyeNearPlane(pg, eye())
.
This method is only meaningful when frame GenericFrame.isEyeFrame()
.
public InteractiveFrame get()
GenericFrame
The copied frame will keep this frame GenericFrame.referenceFrame()
, but its children
aren't copied.
get
in interface Copyable
get
in class GenericFrame
public Scene scene()
GenericFrame
Note that if this GenericFrame.isEyeFrame()
then returns eye().scene()
.
scene
in class GenericFrame
GenericFrame.eye()
,
Eye.scene()
public void performInteraction(BogusEvent event)
profile.handle(event)
.performInteraction
in interface Grabber
performInteraction
in class GenericFrame
Profile.handle(BogusEvent)
public void setBinding(Shortcut shortcut, String action)
profile.setBinding(shortcut, action)
.
Low-level profile handling routine. Call this method to set a binding for a custom bogus event, like this:
frame.setBinding(new CustomShortcut(mask, CustomAgent.CUSTOM_ID), "customBehavior")
.
Profile.setBinding(Shortcut, String)
,
BogusEvent
,
Shortcut
public void setBinding(Object object, Shortcut shortcut, String action)
profile.setBinding(object, shortcut, action)
.
Low-level profile handling routine. Call this method to set a binding for a custom bogus event, like this:
frame.setBinding(object, new CustomShortcut(mask, CustomAgent.CUSTOM_ID), "customBehavior")
.
public void setBindings(InteractiveFrame otherFrame)
profile.set(otherFrame.profile)
.Profile.set(Profile)
public boolean hasBinding(Shortcut shortcut)
return profile.hasBinding(shortcut)
.
Low-level profile handling routine. Call this method to query for a binding from a custom bogus event, like this:
frame.hasBinding(object, new CustomShortcut(mask, CustomAgent.CUSTOM_ID)
.
Profile.hasBinding(Shortcut)
,
BogusEvent
,
Shortcut
public void removeBinding(Shortcut shortcut)
profile.removeBinding(shortcut)
.
Low-level profile handling routine. Call this method to remove a binding for a custom bogus event, like this:
frame.removeBinding(new CustomShortcut(mask, CustomAgent.CUSTOM_ID)
.
Profile.removeBinding(Shortcut)
,
BogusEvent
,
Shortcut
public void removeBindings()
profile.removeBindings()
.Profile.removeBindings()
public void removeBindings(Class<? extends Shortcut> cls)
profile.removeBindings(cls)
.Profile.removeBindings(Class)
public String info(Class<? extends Shortcut> cls)
profile.info(cls)
.Profile.info(Class)
public String info()
public String action(Shortcut shortcut)
return profile.action(key)
.Profile.action(Shortcut)
public boolean isActionBound(String action)
return profile.isActionBound(action)
.Profile.isActionBound(String)
public void setDefaultMouseBindings()
scene().mouseAgent().setDefaultBindings(this)
. The default frame mouse
bindings which may be queried with info()
.public void setDefaultTouchBindings()
scene().droidTouchAgent().setDefaultBindings(this)
. The default frame droid
touch bindings which may be queried with info()
.public void setDefaultKeyBindings()
removeKeyBindings()
and sets the default frame key bindings which may
be queried with info()
.public void setMotionBinding(int id, String action)
setBinding(new MotionShortcut(id), action)
.setBinding(Shortcut, String)
public void setMotionBinding(int m, int id, String action)
setBinding(new MotionShortcut(m, id), action)
.setBinding(Shortcut, String)
public void setMotionBinding(Object object, int id, String action)
setBinding(object, new MotionShortcut(id), action)
.setBinding(Object, Shortcut, String)
public void setMotionBinding(Object object, int m, int id, String action)
setBinding(object, new MotionShortcut(m, id), action)
.setBinding(Object, Shortcut, String)
public void removeMotionBindings()
removeBindings(MotionShortcut.class)
.removeBindings(Class)
public boolean hasMotionBinding(int id)
hasBinding(new MotionShortcut(id))
.hasBinding(Shortcut)
public boolean hasMotionBinding(int m, int id)
hasBinding(new MotionShortcut(m, id))
.hasBinding(Shortcut)
public void removeMotionBinding(int id)
removeBinding(new MotionShortcut(id))
.removeBinding(Shortcut)
public void removeMotionBinding(int m, int id)
removeBinding(new MotionShortcut(m, id))
.removeBinding(Shortcut)
public void setKeyBinding(int vkey, String action)
setBinding(new KeyboardShortcut(vkey), action)
.setBinding(Shortcut, String)
public void setKeyBinding(char key, String action)
setBinding(new KeyboardShortcut(key), action)
.setBinding(Object, Shortcut, String)
public void setKeyBinding(Object object, int vkey, String action)
setBinding(object, new KeyboardShortcut(vkey), action)
.setBinding(Object, Shortcut, String)
public void setKeyBinding(Object object, char key, String action)
setBinding(object, new KeyboardShortcut(key), action)
.setBinding(Object, Shortcut, String)
public boolean hasKeyBinding(int vkey)
return hasBinding(new KeyboardShortcut(vkey))
.hasBinding(Shortcut)
public boolean hasKeyBinding(char key)
return hasBinding(new KeyboardShortcut(key))
.hasBinding(Shortcut)
public void removeKeyBinding(int vkey)
removeBinding(new KeyboardShortcut(vkey))
.removeBinding(Shortcut)
public void removeKeyBinding(char key)
removeBinding(new KeyboardShortcut(key))
.removeBinding(Shortcut)
public void setKeyBinding(int mask, int vkey, String action)
setBinding(new KeyboardShortcut(mask, vkey), action)
.setBinding(Shortcut, String)
public void setKeyBinding(Object object, int mask, int vkey, String action)
setBinding(object, new KeyboardShortcut(mask, vkey), action)
.setBinding(Object, Shortcut, String)
public boolean hasKeyBinding(int mask, int vkey)
return hasBinding(new KeyboardShortcut(mask, vkey))
.hasBinding(Shortcut)
public void removeKeyBinding(int mask, int vkey)
removeBinding(new KeyboardShortcut(mask, vkey))
.removeBinding(Shortcut)
public void setKeyBinding(int mask, char key, String action)
setKeyBinding(mask, Scene.keyCode(key), action)
.setKeyBinding(int, int, String)
public void setKeyBinding(Object object, int mask, char key, String action)
setKeyBinding(object, mask, Scene.keyCode(key), action)
.setKeyBinding(Object, int, int, String)
public boolean hasKeyBinding(int mask, char key)
hasKeyBinding(mask, Scene.keyCode(key))
.hasKeyBinding(int, int)
public void removeKeyBinding(int mask, char key)
removeKeyBinding(mask, Scene.keyCode(key))
.removeKeyBinding(int, int)
public void removeKeyBindings()
removeBindings(KeyboardShortcut.class)
.removeBindings(Class)
public void setClickBinding(int id, int count, String action)
setBinding(new ClickShortcut(id, count), action)
.setBinding(Shortcut, String)
public void setClickBinding(int m, int id, int count, String action)
setBinding(new ClickShortcut(m, id, count), action)
.setBinding(Shortcut, String)
public void setClickBinding(Object object, int id, int count, String action)
setBinding(object, new ClickShortcut(id, count), action)
.setBinding(Shortcut, String)
public void setClickBinding(Object object, int m, int id, int count, String action)
setBinding(object, new ClickShortcut(m, id, count), action)
.setBinding(Shortcut, String)
public boolean hasClickBinding(int id, int count)
return hasBinding(new ClickShortcut(id, count))
.hasBinding(Shortcut)
public boolean hasClickBinding(int m, int id, int count)
return hasBinding(new ClickShortcut(m, id, count))
.hasBinding(Shortcut)
public void removeClickBinding(int id, int count)
removeBinding(new ClickShortcut(id, count))
.removeBinding(Shortcut)
public void removeClickBinding(int m, int id, int count)
removeBinding(new ClickShortcut(m, id, count))
.removeBinding(Shortcut)
public void removeClickBindings()
removeBindings(ClickShortcut.class)
.removeBindings(Class)
public void set(InteractiveFrame otherFrame)
Frame.setWorldMatrix(Frame)
, setBindings(InteractiveFrame)
, and
setShape(InteractiveFrame)
on the other frame instance.
After calling set
a call to this.equals(otherFrame)
should return
true
.
public void applyTransformation(PGraphics pg)
((Scene) scene).applyTransformation(pg, this)
.public void applyWorldTransformation(PGraphics pg)
((Scene) scene).applyWorldTransformation(pg, this)
.public void setHighlightingMode(InteractiveFrame.HighlightingMode mode)
GenericFrame.grabsInput()
returns true
) according to mode
as follows:
InteractiveFrame.HighlightingMode.NONE
: no highlighting
takes place.InteractiveFrame.HighlightingMode.FRONT_SHAPE
: the
front-shape (see setFrontShape(PShape)
) is scaled by a 1.15
factor.InteractiveFrame.HighlightingMode.PICKING_SHAPE
: the
picking-shape (see setPickingShape(PShape)
is displayed instead of the
front-shape.InteractiveFrame.HighlightingMode.FRONT_PICKING_SHAPES
:
both, the front and the picking shapes are displayed.
Default is InteractiveFrame.HighlightingMode.FRONT_SHAPE
.
highlightingMode()
public InteractiveFrame.HighlightingMode highlightingMode()
setHighlightingMode(HighlightingMode)
public void shiftShape(Vec shift)
shiftFrontShape(shift); shiftPickingShape(shift)
.
This method is only meaningful when frame is not eyeFrame.
shiftFrontShape(Vec)
,
shiftPickingShape(Vec)
public void shiftFrontShape(Vec shift)
Frame.position()
. Default value
is zero.
This method is only meaningful when frame is not eyeFrame.
shiftShape(Vec)
,
shiftPickingShape(Vec)
public void shiftPickingShape(Vec shift)
Frame.position()
. Default
value is zero.
This method is only meaningful when frame is not eyeFrame.
shiftShape(Vec)
,
shiftFrontShape(Vec)
public void setPickingPrecision(GenericFrame.PickingPrecision precision)
GenericFrame
When GenericFrame.pickingPrecision()
is GenericFrame.PickingPrecision.FIXED
or
GenericFrame.PickingPrecision.ADAPTIVE
Picking is done by checking if the pointer lies
within a squared area around the frame GenericFrame.center()
screen projection which size
is defined by GenericFrame.setGrabsInputThreshold(float)
.
When GenericFrame.pickingPrecision()
is GenericFrame.PickingPrecision.EXACT
, picking is done
in a precise manner according to the projected pixels of the graphics related to the
frame. It is meant to be implemented by generic frame derived classes and requires
the scene to implement a so called picking buffer (see the proscene
Scene class for a possible implementation) and the frame to implement means to
attach graphics to it (see the proscene
InteractiveFrame class for a possible implementation). Default implementation of
this policy will behave like GenericFrame.PickingPrecision.FIXED
.
setPickingPrecision
in class GenericFrame
GenericFrame.pickingPrecision()
,
GenericFrame.setGrabsInputThreshold(float)
public boolean checkIfGrabsInput(BogusEvent event)
Grabber.checkIfGrabsInput(BogusEvent)
condition at the
Scene.pApplet()
, having
public boolean checkIfGrabsInput(InteractiveFrame, CustomEvent)
as method
prototype. If it doesn't find it there, looks for the condition at this instance,
with a similar method prototype, but without the InteractiveFrame parameter.
You don't need to call this. Automatically called by agents handling this frame.
Note: Call supercheckIfGrabsInput(BogusEvent)
at your
interactive-frame derived class, if you prefer to use inheritance to override the
frame picking condition on a custom-event.
checkIfGrabsInput
in interface Grabber
checkIfGrabsInput
in class GenericFrame
supercheckIfGrabsInput(BogusEvent)
public final boolean checkIfGrabsInput(float x, float y)
Scene.pickingBuffer()
). This method
compares the color of the Scene.pickingBuffer()
at
(x,y)
with id()
. Returns true if both colors are the same, and false
otherwise.
This method is only meaningful when GenericFrame.isEyeFrame()
returns false.
checkIfGrabsInput
in class GenericFrame
GenericFrame.setPickingPrecision(PickingPrecision)
,
GenericFrame.isEyeFrame()
public boolean checkIfGrabsInput(KeyboardEvent event)
return profile.hasBinding(event.shortcut())
.checkIfGrabsInput
in class GenericFrame
KeyAgent.keyEvent(processing.event.KeyEvent)
public void draw()
draw(scene.pg())
.Scene.drawFrames(PGraphics)
public boolean draw(PGraphics pg)
Scene.applyWorldTransformation(PGraphics, Frame)
).
This method is internally called by the scene to
Scene.drawFrames(PGraphics)
into the
Scene.disablePickingBuffer()
and by draw()
to draw
the frame into the scene main Scene.pg()
.
public void visit()
GenericFrame
AbstractScene.traverseTree()
public void setShape(PShape ps)
setFrontShape(ps); setPickingShape(ps);
.public void setFrontShape(PShape ps)
Replaces previous frame front-shape with ps
.
public void setPickingShape(PShape ps)
Replaces previous frame picking-shape with ps
.
public void setShape(InteractiveFrame otherFrame)
setFrontShape(otherFrame); setPickingShape(otherFrame);
.public void setFrontShape(InteractiveFrame otherFrame)
public void setPickingShape(InteractiveFrame otherFrame)
public void resetShape()
resetFrontShape(); resetPickingShape();
.public void resetFrontShape()
public void resetPickingShape()
public boolean isShapeReset()
return isFrontShapeReset() && isPickingShapeReset();
.public boolean isFrontShapeReset()
true
if the front-shape has not been set (or has been reset) and false
otherwise.public boolean isPickingShapeReset()
true
if the picking-shape has not been set (or has been reset) and false
otherwise.public void setShape(String methodName)
setFrontShape(methodName); setPickingShape(methodName);
.public void setShape(Object obj, String methodName)
setFrontShape(obj, methodName); setPickingShape(obj, methodName);
.public void setFrontShape(Object object, String methodName)
methodName
) implemented by the object
.
Attempt to set an immediate mode visual representation to the frame from the graphics
procedure methodName
implemented by the object
. The graphics
procedure may have two different prototypes:
GenericFrame.isEyeFrame()
.object
- the object defining the shape graphics-proceduremethodName
- the front-shape graphics-proceduresetShape(Object, String)
,
setFrontShape(PShape)
,
setFrontShape(String)
,
setFrontShape(InteractiveFrame)
,
resetFrontShape()
,
setPickingShape(Object, String)
,
resetShape()
,
isShapeReset()
public void setPickingShape(Object object, String methodName)
methodName
) implemented by the object
.
Attempt to set an immediate mode visual representation to the frame from the graphics
procedure methodName
implemented by the object
. The graphics
procedure may have two different prototypes:
GenericFrame.isEyeFrame()
.object
- the object defining the shape graphics-proceduremethodName
- the front-shape graphics-proceduresetShape(Object, String)
,
setFrontShape(Object, String)
,
setPickingShape(PShape)
,
setPickingShape(String)
,
setPickingShape(InteractiveFrame)
,
resetPickingShape()
,
resetShape()
,
isShapeReset()
public void setFrontShape(String methodName)
methodName
).
Attempt to set an immediate mode visual representation to the frame from the graphics
procedure defined by methodName
which may have two different prototypes:
Scene.pApplet()
, which may use both
prototypes;InteractiveFrame
instance this shape is attached
to, which may use only prototype 1, or;scene()
handling that frame
instance, which may use both prototypes.
methodName
- the front-shape graphics-proceduresetShape(String)
,
setFrontShape(PShape)
,
setFrontShape(Object, String)
,
setFrontShape(InteractiveFrame)
,
resetFrontShape()
,
setPickingShape(String)
,
resetShape()
,
isShapeReset()
public void setPickingShape(String methodName)
methodName
).
Attempt to set an immediate mode visual representation to the frame from the graphics
procedure defined by methodName
which may have two different prototypes:
Scene.pApplet()
, which may use both
prototypes;InteractiveFrame
instance this shape is attached
to, which may use only prototype 1, or;scene()
handling that frame
instance, which may use both prototypes.
methodName
- the shape graphics-proceduresetShape(String)
,
setFrontShape(String)
,
setPickingShape(PShape)
,
setPickingShape(Object, String)
,
setPickingShape(InteractiveFrame)
,
resetPickingShape()
,
resetShape()
,
isShapeReset()
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia