Class: MajorMinorRule

MajorMinorRule()

new MajorMinorRule()

A flexible geometry object which can draw grids or rulers

Source:

Extends

Methods

_rebuildLists()

Rebuild lists for this drawable and notify any parent drawable to do so as well. This ensures each drawable contains an updated, flat list of all the drawables beneath them. This way we save performance by not recursing through each child during draw time, and instead, drawing from the flat list at the level we care about.

Inherited From:
Source:

add(children)

Add a child drawable to this instance

Parameters:
Name Type Description
children Array.<Drawable> | Drawable

child drawables to add

Inherited From:
Source:

addVertices(coords)

Add vertices to this geometry object

Parameters:
Name Type Description
coords Array.<Float>

Packed array of floating point coordinats. (e.g. [x1,y1,z1,x2,y2,z2,...xn,yn,zn])

Inherited From:
Source:

draw()

Base draw method, which should always be called by subclasses. This method will perform any updates to dirty geometry buffers, but does not actually perform any drawing itself.

Inherited From:
Source:

drawCircular()

Draws the circular buffer as a line strip,

Inherited From:
Source:

remove(children)

Remove a child drawable from this instance

Parameters:
Name Type Description
children Array.<Drawable> | Drawable

child drawables to remove

Inherited From:
Source:

setShaderPosition(gl, shader)

Set up a vertex shader's modelView and projection matrixes, and assign the position of the vertex buffer for this geometry.

Parameters:
Name Type Description
gl WebGl

Webgl context

shader Shader

Shader instance

Inherited From:
Source:

Type Definitions

Options

These are the options specific to this class. Other options provided by Geometry.Options can also be passed to create a PlotBody.

Properties:
Name Type Description
majorDivs Array.<Integer>

A two element array of integers describing the number of major divisions in the PlotBody grid [horizontal, vertical].

minorDivs Array.<Integer>

A two element array of integers describing the number of minor divisions between major divisions in the PlotBody grid [horizontal, vertical].

majorFraction Array.<Float>

A two element array of floats describing the fraction of the geometry which major grid lines should span. [horizontal, vertical]

minorFraction Array.<Float>

A two element array of floats describing the fraction of the geometry which major grid lines should span.

majorGridColor Array.<Float>

A four element array ([r,g,b,a]) of floating point values, 0 to 1 describing the color of major grid lines

minorGridColor Array.<Float>

A four element array ([r,g,b,a]) of floating point values, 0 to 1 describing the color of minor grid lines

Source: