dojox/gfx3d/_base.Viewport (version 1.10)

Usage

var foo = new _base.Viewport();
dojox/gfx3d/object

See the dojox/gfx3d/_base.Viewport reference documentation for more information.

Property Summary

Method Summary

  • _applyTransform() physically sets a matrix
  • _getRealMatrix() returns the cumulative ('real') transformation matrix by combining the shape's matrix with its parent's matrix
  • _init()
  • _moveChildToBack(shape) moves a shape to back of the list of shapes
  • _moveChildToFront(shape) moves a shape to front of the list of shapes
  • _moveToBack() renderer-specific hook, see dojox/gfx/shape.Shape.moveToFront()
  • _moveToFront() renderer-specific hook, see dojox/gfx/shape.Shape.moveToFront()
  • _setParent(parent,matrix) sets a parent
  • _updateParentMatrix(matrix) updates the parent matrix with new matrix
  • abandon(obj,silently) removes a shape from the list
  • add(shape) adds a shape to the list
  • addLights(lights) add new light/lights to the viewport.
  • addTodo(newObject)
  • adopt(obj) adds a shape to the list
  • applyCameraLeftTransform(matrix) multiplies the existing matrix with an argument on left side (matrix * this.matrix)
  • applyCameraRightTransform(matrix) multiplies the existing matrix with an argument on right side (this.matrix * matrix)
  • applyCameraTransform(matrix) a shortcut for dojox.gfx3d.Object.applyRightTransform
  • applyLeftTransform(matrix) multiplies the existing matrix with an argument on left side (matrix * this.matrix)
  • applyRightTransform(matrix) multiplies the existing matrix with an argument on right side (this.matrix * matrix)
  • applyTransform(matrix) a shortcut for dojox/gfx/shape.Shape.applyRightTransform
  • clear(destroy) removes all shapes from a group/surface.
  • closeBatch() submits the current batch, append all pending child shapes to DOM
  • connect(name,object,method) connects a handler to an event on this shape
  • create3DObject(objectType,rawObject,style) creates an instance of the passed objectType class
  • createCircle(circle) creates a circle shape
  • createCube(cube) creates an cube object
  • createCylinder(cylinder) creates an cylinder object
  • createEdges(edges,style) creates an edge object
  • createEllipse(ellipse) creates an ellipse shape
  • createGroup() creates a group shape
  • createImage(image) creates a image shape
  • createLine(line) creates a line shape
  • createObject(shapeType,rawShape) creates an instance of the passed shapeType class
  • createOrbit(orbit) creates an Orbit object
  • createPath(path) creates a path shape
  • createPath3d(path) creates an 3d path object
  • createPolygon(points) creates an polygon object
  • createPolyline(points) creates a polyline/polygon shape
  • createQuads(quads,style) creates an quads object
  • createRect(rect) creates a rectangle shape
  • createScene() creates a scene object
  • createShape(shape) creates a shape object based on its type; it is meant to be used by group-like objects
  • createText(text) creates a text shape
  • createTextPath(text) creates a text shape
  • createTriangles(tris,style) creates an triangle object
  • destroy() Releases all internal resources owned by this shape.
  • disconnect(token) connects a handler by token from an event on this shape
  • getBoundingBox() Returns the bounding box Rectangle for this shape.
  • getClip()
  • getEventSource() returns a Node, which is used as a source of events for this shape
  • getFill() Returns the current fill object or null (see dojox/gfx.defaultLinearGradient, dojox/gfx.defaultRadialGradient, dojox/gfx.defaultPattern, or dojo/Color)
  • getNode() Different graphics rendering subsystems implement shapes in different ways.
  • getParent() Returns the parent Shape, Group or null if this Shape is unparented. (see dojox/gfx/shape.Surface, or dojox/gfx.Group)
  • getShape() returns the current Shape object or null (see dojox/gfx.defaultPath, dojox/gfx.defaultPolyline, dojox/gfx.defaultRect, dojox/gfx.defaultEllipse, dojox/gfx.defaultCircle, dojox/gfx.defaultLine, or dojox/gfx.defaultImage)
  • getStroke() Returns the current stroke object or null (see dojox/gfx.defaultStroke)
  • getTransform() Returns the current transformation matrix applied to this Shape or null
  • getTransformedBoundingBox() returns an array of four points or null four points represent four corners of the untransformed bounding box
  • invalidate()
  • moveToBack() moves a shape to back of its parent's list of shapes
  • moveToFront() moves a shape to front of its parent's list of shapes
  • on(type,listener) Connects an event to this shape.
  • openBatch() starts a new batch, subsequent new child shapes will be held in the batch instead of appending to the container directly.
  • remove(shape,silently) removes a shape from the list
  • removeShape(silently) removes the shape from its parent's list of shapes
  • render() iterate all children and call their render callback function.
  • setCameraTransform(matrix) sets a transformation matrix
  • setClip(clip) sets the clipping area of this shape.
  • setDimensions(dim)
  • setDrawer(drawer)
  • setFill(fill) sets a fill object (the default implementation simply ignores it)
  • setLights(lights,ambient,specular) set the lights
  • setScheduler(scheduler)
  • setShape(shape) sets a shape object (the default implementation simply ignores it)
  • setStroke(stroke) sets a stroke object (the default implementation simply ignores it)
  • setTransform(matrix) sets a transformation matrix

Properties

nodeType
Defined by: dojox/gfx3d/object

Methods

_applyTransform()
Defined by dojox/gfx/shape

physically sets a matrix

Returns:function

physically sets a matrix

_getRealMatrix()
Defined by dojox/gfx/shape

returns the cumulative ('real') transformation matrix by combining the shape's matrix with its parent's matrix

Returns:undefined
_init()
Defined by dojox/gfx/shape
_moveChildToBack(shape)
Defined by dojox/gfx/shape

moves a shape to back of the list of shapes

Parameter Type Description
shape dojox/gfx/shape.Shape

one of the child shapes to move to the front

Returns:function

moves a shape to back of the list of shapes

_moveChildToFront(shape)
Defined by dojox/gfx/shape

moves a shape to front of the list of shapes

Parameter Type Description
shape dojox/gfx/shape.Shape

one of the child shapes to move to the front

Returns:function

moves a shape to front of the list of shapes

_moveToBack()
Defined by dojox/gfx/shape

renderer-specific hook, see dojox/gfx/shape.Shape.moveToFront()

_moveToFront()
Defined by dojox/gfx/shape

renderer-specific hook, see dojox/gfx/shape.Shape.moveToFront()

_setParent(parent,matrix)
Defined by dojox/gfx/shape

sets a parent

Parameter Type Description
parent Object

a parent or null (see dojox/gfx/shape.Surface, or dojox/gfx.Group)

matrix dojox/gfx/matrix.Matrix2D

a 2D matrix or a matrix-like object

Returns:undefined
_updateParentMatrix(matrix)
Defined by dojox/gfx/shape

updates the parent matrix with new matrix

Parameter Type Description
matrix dojox/gfx/Matrix2D

a 2D matrix or a matrix-like object

Returns:undefined
abandon(obj,silently)
Defined by dojox/gfx3d/object

removes a shape from the list

Parameter Type Description
obj undefined
silently Boolean
Optional

if true, do not redraw a picture yet

Returns:function

removes a shape from the list

add(shape)
Defined by dojox/gfx/shape

adds a shape to the list

Parameter Type Description
shape dojox/gfx/shape.Shape

the shape to add to the list

Returns:undefined
addLights(lights)
Defined by dojox/gfx3d/object

add new light/lights to the viewport.

Parameter Type Description
lights Array | Object

light object(s)

Returns:undefined
addTodo(newObject)
Defined by dojox/gfx3d/object
Parameter Type Description
newObject undefined
adopt(obj)
Defined by dojox/gfx3d/object

adds a shape to the list

Parameter Type Description
obj undefined
Returns:function

adds a shape to the list

applyCameraLeftTransform(matrix)
Defined by dojox/gfx3d/object

multiplies the existing matrix with an argument on left side (matrix * this.matrix)

Parameter Type Description
matrix dojox.gfx3d.matrix.Matrix

a matrix or a matrix-like object (see an argument of dojox.gfx3d.matrix.Matrix constructor for a list of acceptable arguments)

Returns:function

multiplies the existing matrix with an argument on left side (matrix * this.matrix)

applyCameraRightTransform(matrix)
Defined by dojox/gfx3d/object

multiplies the existing matrix with an argument on right side (this.matrix * matrix)

Parameter Type Description
matrix dojox.gfx3d.matrix.Matrix

a matrix or a matrix-like object (see an argument of dojox.gfx3d.matrix.Matrix constructor for a list of acceptable arguments)

Returns:function

multiplies the existing matrix with an argument on right side (this.matrix * matrix)

applyCameraTransform(matrix)
Defined by dojox/gfx3d/object

a shortcut for dojox.gfx3d.Object.applyRightTransform

Parameter Type Description
matrix dojox.gfx3d.matrix.Matrix

a matrix or a matrix-like object (see an argument of dojox.gfx3d.matrix.Matrix constructor for a list of acceptable arguments)

Returns:undefined
applyLeftTransform(matrix)
Defined by dojox/gfx/shape

multiplies the existing matrix with an argument on left side (matrix * this.matrix)

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a matrix or a matrix-like object (see an argument of dojox/gfx/matrix.Matrix2D constructor for a list of acceptable arguments)

Returns:function

multiplies the existing matrix with an argument on left side (matrix * this.matrix)

applyRightTransform(matrix)
Defined by dojox/gfx/shape

multiplies the existing matrix with an argument on right side (this.matrix * matrix)

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a matrix or a matrix-like object (see an argument of dojox/gfx/matrix.Matrix2D constructor for a list of acceptable arguments)

Returns:function

multiplies the existing matrix with an argument on right side (this.matrix * matrix)

applyTransform(matrix)
Defined by dojox/gfx/shape

a shortcut for dojox/gfx/shape.Shape.applyRightTransform

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a matrix or a matrix-like object (see an argument of dojox/gfx/matrix.Matrix2D constructor for a list of acceptable arguments)

Returns:function

a shortcut for dojox/gfx/shape.Shape.applyRightTransform

clear(destroy)
Defined by dojox/gfx/shape

removes all shapes from a group/surface.

Parameter Type Description
destroy Boolean
Optional

Indicates whether the children should be destroyed. Optional.

Returns:function

removes all shapes from a group/surface.

closeBatch()
Defined by dojox/gfx/shape

submits the current batch, append all pending child shapes to DOM

On canvas, this method flushes the pending redraws queue.

Returns:function

submits the current batch, append all pending child shapes to DOM

connect(name,object,method)
Defined by dojox/gfx/shape

connects a handler to an event on this shape

Parameter Type Description
name undefined
object undefined
method undefined
Returns:undefined
create3DObject(objectType,rawObject,style)
Defined by dojox/gfx3d/object

creates an instance of the passed objectType class

Parameter Type Description
objectType Function

a class constructor to create an instance of

rawObject Object

properties to be passed in to the classes "setShape" method

style undefined
Returns:instance
createCircle(circle)
Defined by dojox/gfx/shape

creates a circle shape

Parameter Type Description
circle Object

a circle object (see dojox/gfx.defaultCircle)

Returns:undefined
createCube(cube)
Defined by dojox/gfx3d/object

creates an cube object

Parameter Type Description
cube undefined
Returns:undefined
createCylinder(cylinder)
Defined by dojox/gfx3d/object

creates an cylinder object

Parameter Type Description
cylinder undefined
Returns:undefined
createEdges(edges,style)
Defined by dojox/gfx3d/object

creates an edge object

Parameter Type Description
edges undefined
style undefined
Returns:undefined
createEllipse(ellipse)
Defined by dojox/gfx/shape

creates an ellipse shape

Parameter Type Description
ellipse Object

an ellipse object (see dojox/gfx.defaultEllipse)

Returns:undefined
createGroup()
Defined by dojox/gfx/shape

creates a group shape

Returns:undefined
createImage(image)
Defined by dojox/gfx/shape

creates a image shape

Parameter Type Description
image Object

an image object (see dojox/gfx.defaultImage)

Returns:undefined
createLine(line)
Defined by dojox/gfx/shape

creates a line shape

Parameter Type Description
line Object

a line object (see dojox/gfx.defaultLine)

Returns:undefined
createObject(shapeType,rawShape)
Defined by dojox/gfx/shape

creates an instance of the passed shapeType class

Parameter Type Description
shapeType Function

a class constructor to create an instance of

rawShape Object

properties to be passed in to the classes 'setShape' method

Returns:null
createOrbit(orbit)
Defined by dojox/gfx3d/object

creates an Orbit object

Parameter Type Description
orbit undefined
Returns:undefined
createPath(path)
Defined by dojox/gfx/shape

creates a path shape

Parameter Type Description
path Object

a path object (see dojox/gfx.defaultPath)

Returns:undefined
createPath3d(path)
Defined by dojox/gfx3d/object

creates an 3d path object

Parameter Type Description
path undefined
Returns:undefined
createPolygon(points)
Defined by dojox/gfx3d/object

creates an polygon object

Parameter Type Description
points Points[] | Object
Returns:undefined
createPolyline(points)
Defined by dojox/gfx/shape

creates a polyline/polygon shape

Parameter Type Description
points Object

a points object (see dojox/gfx.defaultPolyline) or an Array of points

Returns:undefined
createQuads(quads,style)
Defined by dojox/gfx3d/object

creates an quads object

Parameter Type Description
quads undefined
style undefined
Returns:undefined
createRect(rect)
Defined by dojox/gfx/shape

creates a rectangle shape

Parameter Type Description
rect Object

a path object (see dojox/gfx.defaultRect)

Returns:undefined
createScene()
Defined by dojox/gfx3d/object

creates a scene object

Returns:undefined
createShape(shape)
Defined by dojox/gfx/shape

creates a shape object based on its type; it is meant to be used by group-like objects

Parameter Type Description
shape Object

a shape descriptor object

Returns:any | undefined | null

dojox/gfx/shape.Shape | Null a fully instantiated surface-specific Shape object

createText(text)
Defined by dojox/gfx/shape

creates a text shape

Parameter Type Description
text Object

a text object (see dojox/gfx.defaultText)

Returns:undefined
createTextPath(text)
Defined by dojox/gfx/shape

creates a text shape

Parameter Type Description
text Object

a textpath object (see dojox/gfx.defaultTextPath)

Returns:undefined
createTriangles(tris,style)
Defined by dojox/gfx3d/object

creates an triangle object

Parameter Type Description
tris undefined
style undefined
Returns:undefined
destroy()
Defined by dojox/gfx/shape

Releases all internal resources owned by this shape. Once this method has been called, the instance is considered destroyed and should not be used anymore.

disconnect(token)
Defined by dojox/gfx/shape

connects a handler by token from an event on this shape

Parameter Type Description
token undefined
Returns:undefined
getBoundingBox()
Defined by dojox/gfx/shape

Returns the bounding box Rectangle for this shape.

Returns:null
getClip()
Defined by dojox/gfx/shape
Returns:undefined
getEventSource()
Defined by dojox/gfx/shape

returns a Node, which is used as a source of events for this shape

Returns:undefined
getFill()
Defined by dojox/gfx/shape

Returns the current fill object or null (see dojox/gfx.defaultLinearGradient, dojox/gfx.defaultRadialGradient, dojox/gfx.defaultPattern, or dojo/Color)

Returns:undefined
getNode()
Defined by dojox/gfx/shape

Different graphics rendering subsystems implement shapes in different ways. This method provides access to the underlying graphics subsystem object. Clients calling this method and using the return value must be careful not to try sharing or using the underlying node in a general way across renderer implementation. Returns the underlying graphics Node, or null if no underlying graphics node is used by this shape.

Returns:undefined
getParent()
Defined by dojox/gfx/shape

Returns the parent Shape, Group or null if this Shape is unparented. (see dojox/gfx/shape.Surface, or dojox/gfx.Group)

Returns:undefined
getShape()
Defined by dojox/gfx/shape

returns the current Shape object or null (see dojox/gfx.defaultPath, dojox/gfx.defaultPolyline, dojox/gfx.defaultRect, dojox/gfx.defaultEllipse, dojox/gfx.defaultCircle, dojox/gfx.defaultLine, or dojox/gfx.defaultImage)

Returns:undefined
getStroke()
Defined by dojox/gfx/shape

Returns the current stroke object or null (see dojox/gfx.defaultStroke)

Returns:undefined
getTransform()
Defined by dojox/gfx/shape

Returns the current transformation matrix applied to this Shape or null

Returns:undefined
getTransformedBoundingBox()
Defined by dojox/gfx/shape

returns an array of four points or null four points represent four corners of the untransformed bounding box

Returns:null | Array
invalidate()
Defined by dojox/gfx3d/object
moveToBack()
Defined by dojox/gfx/shape

moves a shape to back of its parent's list of shapes

Returns:function

moves a shape to back of its parent's list of shapes

moveToFront()
Defined by dojox/gfx/shape

moves a shape to front of its parent's list of shapes

Returns:function

moves a shape to front of its parent's list of shapes

on(type,listener)
Defined by dojox/gfx/shape

Connects an event to this shape.

Parameter Type Description
type undefined
listener undefined
Returns:undefined
openBatch()
Defined by dojox/gfx/shape

starts a new batch, subsequent new child shapes will be held in the batch instead of appending to the container directly.

Because the canvas renderer has no DOM hierarchy, the canvas implementation differs such that it suspends the repaint requests for this container until the current batch is closed by a call to closeBatch().

Returns:function

starts a new batch, subsequent new child shapes will be held in the batch instead of appending to the container directly.

remove(shape,silently)
Defined by dojox/gfx/shape

removes a shape from the list

Parameter Type Description
shape dojox/gfx/shape.Shape

the shape to remove

silently Boolean

if true, do not redraw a picture yet

Returns:function

removes a shape from the list

removeShape(silently)
Defined by dojox/gfx/shape

removes the shape from its parent's list of shapes

Parameter Type Description
silently Boolean

if true, do not redraw a picture yet

Returns:function

removes the shape from its parent's list of shapes

render()
Defined by dojox/gfx3d/object

iterate all children and call their render callback function.

setCameraTransform(matrix)
Defined by dojox/gfx3d/object

sets a transformation matrix

Parameter Type Description
matrix dojox.gfx3d.matrix.Matrix

a matrix or a matrix-like object (see an argument of dojox.gfx.matrix.Matrix constructor for a list of acceptable arguments)

Returns:function

sets a transformation matrix

setClip(clip)
Defined by dojox/gfx/shape

sets the clipping area of this shape.

The clipping area defines the shape area that will be effectively visible. Everything that would be drawn outside of the clipping area will not be rendered. The possible clipping area types are rectangle, ellipse, polyline and path, but all are not supported by all the renderers. vml only supports rectangle clipping, while the gfx silverlight renderer does not support path clipping. The clip parameter defines the clipping area geometry, and should be an object with the following properties:

  • {x:Number, y:Number, width:Number, height:Number} for rectangular clip
  • {cx:Number, cy:Number, rx:Number, ry:Number} for ellipse clip
  • {points:Array} for polyline clip
  • {d:String} for a path clip.

The clip geometry coordinates are expressed in the coordinate system used to draw the shape. In other words, the clipping area is defined in the shape parent coordinate system and the shape transform is automatically applied.

Parameter Type Description
clip undefined

Examples

Example 1

The following example shows how to clip a gfx image with all the possible clip geometry: a rectangle, an ellipse, a circle (using the ellipse geometry), a polyline and a path:

surface.createImage({src:img, width:200,height:200}).setClip({x:10,y:10,width:50,height:50});
surface.createImage({src:img, x:100,y:50,width:200,height:200}).setClip({cx:200,cy:100,rx:20,ry:30});
surface.createImage({src:img, x:0,y:350,width:200,height:200}).setClip({cx:100,cy:425,rx:60,ry:60});
surface.createImage({src:img, x:300,y:0,width:200,height:200}).setClip({points:[350,0,450,50,380,130,300,110]});
surface.createImage({src:img, x:300,y:350,width:200,height:200}).setClip({d:"M 350,350 C314,414 317,557 373,450.0000 z"});
setDimensions(dim)
Defined by dojox/gfx3d/object
Parameter Type Description
dim undefined
setDrawer(drawer)
Defined by dojox/gfx3d/object
Parameter Type Description
drawer undefined
setFill(fill)
Defined by dojox/gfx/shape

sets a fill object (the default implementation simply ignores it)

Parameter Type Description
fill Object

a fill object (see dojox/gfx.defaultLinearGradient, dojox/gfx.defaultRadialGradient, dojox/gfx.defaultPattern, or dojo/_base/Color)

Returns:function

sets a fill object (the default implementation simply ignores it)

setLights(lights,ambient,specular)
Defined by dojox/gfx3d/object

set the lights

Parameter Type Description
lights Array

an array of light object or lights object

ambient Color
Optional

an ambient object

specular Color
Optional

an specular object

Returns:function

set the lights

setScheduler(scheduler)
Defined by dojox/gfx3d/object
Parameter Type Description
scheduler undefined
setShape(shape)
Defined by dojox/gfx/shape

sets a shape object (the default implementation simply ignores it)

Parameter Type Description
shape Object

a shape object (see dojox/gfx.defaultPath, dojox/gfx.defaultPolyline, dojox/gfx.defaultRect, dojox/gfx.defaultEllipse, dojox/gfx.defaultCircle, dojox/gfx.defaultLine, or dojox/gfx.defaultImage)

Returns:function

sets a shape object (the default implementation simply ignores it)

setStroke(stroke)
Defined by dojox/gfx/shape

sets a stroke object (the default implementation simply ignores it)

Parameter Type Description
stroke Object

a stroke object (see dojox/gfx.defaultStroke)

Returns:function

sets a stroke object (the default implementation simply ignores it)

setTransform(matrix)
Defined by dojox/gfx/shape

sets a transformation matrix

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a matrix or a matrix-like object (see an argument of dojox/gfx/matrix.Matrix2D constructor for a list of acceptable arguments)

Returns:undefined
Error in the documentation? Can’t find what you are looking for? Let us know!