MathWorx

Class SceneButton

Object
   |
   +--SceneButton

class SceneButton


This class defines various buttons (images with javascript actions) to change/rotate the Scene3D and re-draw it.
The icons used are Sanscons from Some Random Dude. See: http://somerandomdude.net/srd-projects/sanscons
You must have a CSS file (our default is SceneButton.css) and include it in your HTML document with a tag. The default class used for buttons is "button", but you may define your own as you see fit and specify them as a parameter in your function calls.
Because this class is interested in re-drawing the SVG canvas, it requires jQuery SVG and so the necessary files must be included on the top of the page.
For more info, see the static method documentation below. An example call of a specific button:

SceneButton.rotateZp(document.getElementById("button"), 'svg', 'scene', Math.PI/8, "[{stroke: 'black', 'stroke-width': .25}, {stroke: 'red', 'stroke-width': .125}, {stroke: 'green', 'stroke-width': .125}, {stroke: 'blue', 'stroke-width': .125}]", true);
To change the images displayed for each button, edit SceneButton.js with the according images (pathToButtons variable is set in easyload.js). The "button" class is defined in SceneButton.css, bt you can define your own classes however you desire; for usage of the default button set here, see Sancsons

For a working demo (with jQuery and jQuery SVG), see: http://cis.jhu.edu/~shanest/js/mathworx/3D/testbutton.html


Defined in SceneButton.js


Constructor Summary
SceneButton(parent, scene, continuous, img, func, class)
            The constructor function for a new SceneButton.
 
Method Summary
<static> void makeAll(parent, svg, scene, <Number> zStep, <Number> rStep, settings, continuous, class)
           Makes all the buttons and appends them to the parent DOM node.
<static> SceneButton rotate(parent, svg, scene, step, <String> xySign, <String> zSign, settings, continuous, class)
           For specification of most parameters, see rotateNW(), rotateNE(), rotateSW() or rotateSE().
<static> SceneButton rotateNE(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)
           Creates a button responsible for "North-east" (positive around Z and XY) rotation.
<static> SceneButton rotateNW(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)
           Creates a button responsible for "North-west" (positive around Z, negative around XY) rotation.
<static> SceneButton rotateSE(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)
           Creates a button responsible for "South-east" (negative around Z, positive around XY) rotation.
<static> SceneButton rotateSW(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)
           Creates a button responsible for "South-west" (negative around Z and XY) rotation.
<static> SceneButton rotateXY(parent, svg, scene, step, <String> sign, settings, continuous, class)
           For specification of most parameters, see rotateXYp() or rotateXYn().
<static> SceneButton rotateXYn(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)
           Creates a button responsible for negative rotation about the XY-plane.
<static> SceneButton rotateXYp(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)
           Creates a button responsible for positive rotation about the XY-plane.
<static> SceneButton rotateZ(parent, svg, scene, step, <String> sign, settings, continuous, class)
           For specification of most parameters, see rotateZp() or rotateZn().
<static> SceneButton rotateZn(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)
           Creates a button responsible for negative rotation about the Z-axis.
<static> SceneButton rotateZp(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)
           Creates a button responsible for positive rotation about the Z-axis.
<static> void toggle(<String> func)
           Toggles animation of the scene.
<static> SceneButton zoom(parent, svg, scene, step, <String> sign, settings, continuous, class)
           For specification of most parameters, see zoomIn() or zoomOut().
<static> SceneButton zoomIn(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)
           Zooms in on the objects in the Scene3D.
<static> SceneButton zoomOut(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)
           Zooms out on the objects in the Scene3D.

Constructor Detail

SceneButton

SceneButton(parent, scene, continuous, img, func, class)

Method Detail

makeAll

<static> void makeAll(parent, svg, scene, <Number> zStep, <Number> rStep, settings, continuous, class)

rotate

<static> SceneButton rotate(parent, svg, scene, step, <String> xySign, <String> zSign, settings, continuous, class)

rotateNE

<static> SceneButton rotateNE(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)

rotateNW

<static> SceneButton rotateNW(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)

rotateSE

<static> SceneButton rotateSE(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)

rotateSW

<static> SceneButton rotateSW(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)

rotateXY

<static> SceneButton rotateXY(parent, svg, scene, step, <String> sign, settings, continuous, class)

rotateXYn

<static> SceneButton rotateXYn(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)

rotateXYp

<static> SceneButton rotateXYp(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)

rotateZ

<static> SceneButton rotateZ(parent, svg, scene, step, <String> sign, settings, continuous, class)

rotateZn

<static> SceneButton rotateZn(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)

rotateZp

<static> SceneButton rotateZp(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)

toggle

<static> void toggle(<String> func)

zoom

<static> SceneButton zoom(parent, svg, scene, step, <String> sign, settings, continuous, class)

zoomIn

<static> SceneButton zoomIn(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)

zoomOut

<static> SceneButton zoomOut(<Object> parent, <String> svg, <String> scene, <Number> step, <String> settings, <Boolean> continuous, <String> class)

MathWorx

Documentation generated by JSDoc on Mon Aug 11 13:58:31 2008