Squeak Class Documentation category index | class index  
 
WonderlandCameraMorph
  category: Balloon3D-Wonderland Morphs
  superclass: WonderlandMorph
  subclasses: WonderlandStillCameraMorph

This class implements the morph that provides a view into the 3D world. Each instance has a camera assigned to it that determines the viewpoint and parameters of the view. Each instance also has the camera controls for that camera attached to it, and is responsible for showing or hiding them.

instance methods
  accessing
  getCamera
mode
mode:
outline
outline:

  change reporting
  layoutChanged

  controls
  deleteCameraControls
getCameraControls
hideCameraControls
showCameraControls

  debug
  debugDraw

  drag and drop
  acceptDroppingMorph:event:
wantsDroppedMorph:event:

  drawing
  areasRemainingToFill:
drawAcceleratedOn:
drawAcceleratedOutlineOn:
drawOn:
drawSimulatedOn:
forceToScreen
renderOn:
sketchOn:

  event handling
  containsPoint:event:
convertEvent:
doFirstPersonControl
doFirstPersonControl:
firstPersonKeystroke:
firstPersonMouseUp:
getEventFocus
handleMouseDown:
handlesKeyboard:
handlesMouseDown:
handlesMouseOver:
keyStroke:
mouseDown:
mouseEnter:
mouseLeave:
mouseMoveDefault:
mouseMoveFirstPersonControl:
mouseMovePaint:
mouseMoveStroke:
mouseUpDefault:
mouseUpFirstPersonControl:
mouseUpPaint:
mouseUpStroke:
setEventFocus:

  fog properties
  fogColor
fogColor:
fogDensity
fogDensity:
fogRangeEnd
fogRangeEnd:
fogRangeStart
fogRangeStart:
fogType
fogType:

  geometry
  containsPoint:

  halos and balloon help
  balloonHelpTextForHandle:

  hardware acceleration
  accelerationEnabled
accelerationEnabled:
accelerationSuspended
accelerationSuspended:
restoreAcceleration
suspendAcceleration

  initialization
  initialize
initializeWithCamera:
intoWorld:
okayToEnterProject
outOfWorld:

  menu
  addCustomMenuItems:hand:
attachStopGoButtons
firstPersonControlString
getAAPaintState
getAcceleratorState
loadActor
showControlsString
toggleAAPaintState
toggleAcceleratorState
toggleCameraControls
toggleFirstPersonControl

  object fileIn
 

  picking points
  pickPointInBounds:
pickPointOnBounds:

  pooh
  clearStroke
createPoohActor
drawOnTextureOf:from:to:
paintActor:
recordStroke:
regularize:
simplify:
smoothen:length:
strokeMode

  pooh-actions
  aaPaintingEnabled
aaPaintingEnabled:
clear:
ellipse:
erase:
fill:
line:
mouseDownEllipse:
mouseDownLine:
mouseDownRect:
mouseMoveEllipse:
mouseMoveLine:
mouseMoveRect:
mouseUpEllipse:
mouseUpLine:
mouseUpRect:
paint:
polygon:
prepareAction:
rect:
restoreTexture
restoreTextureFrom:
roundNibOfSize:
stamp:
star:
storeTexture

  pooh-palette
  cancel
cancelPainting:evt:
clear
clearPainting:
paletteAttached:
paletteDetached:
save
savePainting:evt:
undo
undoPainting:evt:

  primitive behaviors
 

  stepping
  step
stepTime
wantsSteps

  wrappers
  addHalo:
addHalo:from:
removeAllWrappers

class methods
  initialize-release
  initialize

  pooh stuff
  installPoohIcon
openPoohAboutWindow
poohAboutImage
poohAboutText
poohPlayTape
poohTape

  scripting
  additionsToViewerCategories

instance methods
  accessing top  
 

getCamera


 

mode


 

mode:


 

outline


 

outline:


  change reporting top  
 

layoutChanged

Process the changed layout and then change the aspect ratio of the camera to match


  controls top  
 

deleteCameraControls

Hide the camera controls for the camera rendering into this window


 

getCameraControls


 

hideCameraControls

Hide the camera controls for the camera rendering into this window


 

showCameraControls

Show the camera controls for the camera rendering into this window


  debug top  
 

debugDraw


  drag and drop top  
 

acceptDroppingMorph:event:

This message is sent when a morph is dropped onto a morph that has agreed to accept the dropped morph by responding 'true' to the wantsDroppedMorph:Event: message. This default implementation just adds the given morph to the receiver.


 

wantsDroppedMorph:event:

Return true if the receiver wishes to accept the given morph, which is being dropped by a hand in response to the given event. The default implementation returns false.
NOTE: the event is assumed to be in global (world) coordinates.


  drawing top  
 

areasRemainingToFill:

May be overridden by any subclasses with opaque regions


 

drawAcceleratedOn:


 

drawAcceleratedOutlineOn:

Draw a pooh outline on an accelerated renderer.


 

drawOn:


 

drawSimulatedOn:

Draw the receiver using the builtin software renderer


 

forceToScreen

When using hardware acceleration, this method forces the receiver to swap its buffers.


 

renderOn:

Tell our camera to draw


 

sketchOn:


  event handling top  
 

containsPoint:event:

Return true if aPoint is considered to be inside the receiver for the given event.
The default implementation treats locked children as integral part of their owners.


 

convertEvent:

Create a Wonderland event that will be dispatched later on from the given MorphicEvent.


 

doFirstPersonControl


 

doFirstPersonControl:


 

firstPersonKeystroke:

Handle a keyboard event


 

firstPersonMouseUp:


 

getEventFocus

Return the actor that all events should go to. If not explicitly specified, choose the actor under the mouse cursor. If no actor is under the mouse cursor, return nil.
ar 6/2/1999: This method is more or less obsolete. For event handling, #convertEvent: should be used.


 

handleMouseDown:

System level event handling.


 

handlesKeyboard:

Return true if the receiver wishes to handle the given keyboard event


 

handlesMouseDown:

We want to handle mouse up and down events, so return true


 

handlesMouseOver:

We want to handle mouse enter/leave events, so return true.


 

keyStroke:

Handle a keyboard event


 

mouseDown:

When the user clicks in a camera window, determine which actor the
user clicked on and have that actor respond to the event


 

mouseEnter:

When the mouse enters our window give it the keyboard focus


 

mouseLeave:

When the mouse leaves our window release the keyboard focus


 

mouseMoveDefault:


 

mouseMoveFirstPersonControl:


 

mouseMovePaint:


 

mouseMoveStroke:


 

mouseUpDefault:


 

mouseUpFirstPersonControl:


 

mouseUpPaint:


 

mouseUpStroke:


 

setEventFocus:

Set the actor that all events should go to


  fog properties top  
 

fogColor


 

fogColor:


 

fogDensity


 

fogDensity:


 

fogRangeEnd


 

fogRangeEnd:


 

fogRangeStart


 

fogRangeStart:


 

fogType


 

fogType:


  geometry top  
 

containsPoint:

Perform a full picking op if the camera does not draw the background


  halos and balloon help top  
 

balloonHelpTextForHandle:

Answer a string providing balloon help for the given halo handle


  hardware acceleration top  
 

accelerationEnabled

Return true if hardware acceleration is enabled


 

accelerationEnabled:

Enable or disable hardware acceleration


 

accelerationSuspended

Return true if hardware acceleration is temporarily suspended


 

accelerationSuspended:

Temporarily suspend hardware acceleration


 

restoreAcceleration

Restore temporarily suspend acceleration


 

suspendAcceleration

Temporarily suspend acceleration


  initialization top  
 

initialize


 

initializeWithCamera:

Initialize this instance and hand it a camera


 

intoWorld:

The receiver is showing in the given world


 

okayToEnterProject

Check if it is okay to enter the project containing the receiver


 

outOfWorld:

The receiver is leaving the given world


  menu top  
 

addCustomMenuItems:hand:

Add morph-specific items to the given menu which was invoked by the given hand. This method provides is invoked both from the halo-menu and from the control-menu regimes.


 

attachStopGoButtons


 

firstPersonControlString


 

getAAPaintState


 

getAcceleratorState


 

loadActor


 

showControlsString


 

toggleAAPaintState


 

toggleAcceleratorState


 

toggleCameraControls


 

toggleFirstPersonControl


  object fileIn top  

  picking points top  
 

pickPointInBounds:

Chooses a random point so that this morph lies within the specified bounds


 

pickPointOnBounds:

Chooses a random point so that an edge of this morph lies on the specified bounds


  pooh top  
 

clearStroke


 

createPoohActor


 

drawOnTextureOf:from:to:

texStart and texEnd are Coordinates on a Texture


 

paintActor:


 

recordStroke:


 

regularize:

Make the pointList non-intersecting, e.g., insert points at intersections and have the outline include those points


 

simplify:


 

smoothen:length:


 

strokeMode


  pooh-actions top  
 

aaPaintingEnabled


 

aaPaintingEnabled:


 

clear:


 

ellipse:


 

erase:


 

fill:


 

line:


 

mouseDownEllipse:


 

mouseDownLine:


 

mouseDownRect:


 

mouseMoveEllipse:


 

mouseMoveLine:


 

mouseMoveRect:


 

mouseUpEllipse:


 

mouseUpLine:


 

mouseUpRect:


 

paint:


 

polygon:


 

prepareAction:


 

rect:


 

restoreTexture


 

restoreTextureFrom:


 

roundNibOfSize:

Create a round nib for antialiased painting


 

stamp:


 

star:

verts _ (0 to: 350 by: 36) collect: [:angle |
(Point r: (oldR _ oldR = ext ifTrue: [ext*5//12] ifFalse: [ext]) degrees: angle + pt degrees)
+ strokeOrigin].

poly _ PolygonMorph new addHandles.
poly color: currentColor; borderWidth: currentNib extent x; borderColor: Color black.
poly privateOwner: self.
poly bounds: (strokeOrigin extent: ext).
poly setVertices: verts.
poly drawOn: formCanvas.


 

storeTexture


  pooh-palette top  
 

cancel


 

cancelPainting:evt:


 

clear


 

clearPainting:

Clear the image after user issued #clear in aPaintBoxMorph


 

paletteAttached:

A new palette has been attached to the receiver.
Don't know what to do here...


 

paletteDetached:


 

save


 

savePainting:evt:

Save the image after user issued #keep in aPaintBoxMorph


 

undo


 

undoPainting:evt:


  primitive behaviors top  

  stepping top  
 

step

*** hack ***


 

stepTime

Answer the desired time between steps in milliseconds. This default implementation requests that the 'step' method be called once every second.


 

wantsSteps

Return true if the receiver overrides the default Morph step method.


  wrappers top  
 

addHalo:

Add a halo to an object


 

addHalo:from:

Special case if the formerHaloOwner was a wrapper within the receiver


 

removeAllWrappers


class methods
  initialize-release top  
 

initialize

WonderlandCameraMorph initialize


  pooh stuff top  
 

installPoohIcon


 

openPoohAboutWindow

WonderlandCameraMorph openPoohAboutWindow


 

poohAboutImage


 

poohAboutText


 

poohPlayTape

| tape source |
tape _ FileStream fileNamed: 'pooh.tape'.
source _ 'poohTape ^''', tape contentsOfEntireFile, ''''.
(WonderlandCameraMorph class methodsFor: 'pooh stuff') scanFrom: (ReadStream on: source)


 

poohTape


  scripting top  
 

additionsToViewerCategories

Answer a list of (<categoryName> <list of category specs>) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories.