Point geometry class.
Inherits from
NAME | DESCRIPTION |
---|---|
ZOO.Geometry.Point | Construct a point geometry. |
clone | {ZOO.Geometry.Point} An exact clone of this ZOO.Geometry.Point |
calculateBounds | Create a new Bounds based on the x/y |
equals | Determine whether another geometry is equivalent to this one. |
toShortString | {String} Shortened String representation of Point object. |
move | Moves a geometry by the given displacement along positive x and y axes. |
rotate | Rotate a point around another. |
getCentroid | {ZOO.Geometry.Point} The centroid of the collection |
resize | Resize a point relative to some origin. |
intersects | Determine if the input geometry intersects this one. |
transform | Translate the x,y properties of the point from source to dest. |
getVertices | Return a list of all points in this geometry. |
Properties
Functions
Construct a point geometry.
Parameters
clone: function(obj)
Returns
{ZOO.Geometry.Point} An exact clone of this ZOO.Geometry.Point
calculateBounds: function ()
Create a new Bounds based on the x/y
equals: function(geom)
Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.
Parameters
geom {ZOO.Geometry.Point} The geometry to test.
Returns
{Boolean} The supplied geometry is equivalent to this geometry.
toShortString: function()
Returns
{String} Shortened String representation of Point object. (ex. <i>”5, 42”</i>)
move: function(x,y)
Moves a geometry by the given displacement along positive x and y axes. This modifies the position of the geometry and clears the cached bounds.
Parameters
rotate: function(angle,origin)
Rotate a point around another.
Parameters
getCentroid: function()
Returns
{ZOO.Geometry.Point} The centroid of the collection
resize: function(scale,origin,ratio)
Resize a point relative to some origin. For points, this has the effect of scaling a vector (from the origin to the point). This method is more useful on geometry collection subclasses.
Parameters
Returns
{ZOO.Geometry} The current geometry.
intersects: function(geometry)
Determine if the input geometry intersects this one.
Parameters
geometry {ZOO.Geometry} Any type of geometry.
Returns
{Boolean} The input geometry intersects this one.
transform: function(source,dest)
Translate the x,y properties of the point from source to dest.
Parameters
Returns
getVertices: function(nodes)
Return a list of all points in this geometry.
Parameters
nodes {Boolean} For lines, only return vertices that are endpoints. If false, for lines, only vertices that are not endpoints will be returned. If not provided, all vertices will be returned.
Returns
{Array} A list of all vertices in the geometry.