[191] | 1 | .. _api-zoo-geometry-point: |
---|
| 2 | |
---|
| 3 | ZOO.Geometry.Point |
---|
| 4 | ================== |
---|
| 5 | |
---|
| 6 | Point geometry class. |
---|
| 7 | |
---|
| 8 | Properties |
---|
| 9 | ---------- |
---|
| 10 | |
---|
| 11 | .. list-table:: |
---|
| 12 | :widths: 12 50 |
---|
| 13 | :header-rows: 1 |
---|
| 14 | |
---|
| 15 | * - NAME |
---|
| 16 | - DESCRIPTION |
---|
| 17 | * - :ref:`x <x>` |
---|
| 18 | - {float} |
---|
| 19 | * - :ref:`y <y>` |
---|
| 20 | - {float} |
---|
| 21 | |
---|
| 22 | Functions |
---|
| 23 | --------- |
---|
| 24 | |
---|
| 25 | .. list-table:: |
---|
| 26 | :widths: 15 50 |
---|
| 27 | :header-rows: 1 |
---|
| 28 | |
---|
| 29 | * - NAME |
---|
| 30 | - DESCRIPTION |
---|
| 31 | * - :ref:`ZOO.Geometry.Point <ZOO.Geometry.Point>` |
---|
| 32 | - Construct a point geometry. |
---|
| 33 | * - :ref:`clone <clone>` |
---|
| 34 | - {ZOO.Geometry.Point} An exact clone of this ZOO.Geometry.Point |
---|
| 35 | * - :ref:`calculateBounds <calculateBounds>` |
---|
| 36 | - Create a new Bounds based on the x/y |
---|
| 37 | * - :ref:`equals <equals>` |
---|
| 38 | - Determine whether another geometry is equivalent to this one. |
---|
| 39 | * - :ref:`toShortString <toShortString>` |
---|
| 40 | - {String} Shortened String representation of Point object. |
---|
| 41 | * - :ref:`move <move>` |
---|
| 42 | - Moves a geometry by the given displacement along positive x and y axes. |
---|
| 43 | * - :ref:`rotate <rotate>` |
---|
| 44 | - Rotate a point around another. |
---|
| 45 | * - :ref:`getCentroid <getCentroid>` |
---|
| 46 | - {ZOO.Geometry.Point} The centroid of the collection |
---|
| 47 | * - :ref:`resize <resize>` |
---|
| 48 | - Resize a point relative to some origin. |
---|
| 49 | * - :ref:`intersects <intersects>` |
---|
| 50 | - Determine if the input geometry intersects this one. |
---|
| 51 | * - :ref:`transform <transform>` |
---|
| 52 | - Translate the x,y properties of the point from source to dest. |
---|
| 53 | * - :ref:`getVertices <getVertices>` |
---|
| 54 | - Return a list of all points in this geometry. |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | **Properties** |
---|
| 58 | |
---|
| 59 | .. _x: |
---|
| 60 | |
---|
| 61 | x |
---|
| 62 | ``{float}`` |
---|
| 63 | |
---|
| 64 | .. _y: |
---|
| 65 | |
---|
| 66 | y |
---|
| 67 | ``{float}`` |
---|
| 68 | |
---|
| 69 | **Functions** |
---|
| 70 | |
---|
| 71 | .. _ZOO.Geometry.Point: |
---|
| 72 | |
---|
| 73 | ZOO.Geometry.Point |
---|
| 74 | Construct a point geometry. |
---|
| 75 | |
---|
| 76 | *Parameters* |
---|
| 77 | |
---|
| 78 | | ``x {float}`` |
---|
| 79 | | ``y {float}`` |
---|
| 80 | |
---|
| 81 | .. _clone: |
---|
| 82 | |
---|
| 83 | clone |
---|
| 84 | :: |
---|
| 85 | |
---|
| 86 | clone: function(obj) |
---|
| 87 | |
---|
| 88 | *Returns* |
---|
| 89 | |
---|
| 90 | :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` An exact clone of this ZOO.Geometry.Point |
---|
| 91 | |
---|
| 92 | .. _calculateBounds: |
---|
| 93 | |
---|
| 94 | calculateBounds |
---|
| 95 | :: |
---|
| 96 | |
---|
| 97 | calculateBounds: function () |
---|
| 98 | |
---|
| 99 | Create a new Bounds based on the x/y |
---|
| 100 | |
---|
| 101 | .. _equals: |
---|
| 102 | |
---|
| 103 | equals |
---|
| 104 | :: |
---|
| 105 | |
---|
| 106 | equals: function(geom) |
---|
| 107 | |
---|
| 108 | Determine whether another geometry is equivalent to this one. Geometries are considered |
---|
| 109 | equivalent if all components have the same coordinates. |
---|
| 110 | |
---|
| 111 | *Parameters* |
---|
| 112 | |
---|
| 113 | ``geom`` :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` The geometry to test. |
---|
| 114 | |
---|
| 115 | *Returns* |
---|
| 116 | |
---|
| 117 | ``{Boolean}`` The supplied geometry is equivalent to this geometry. |
---|
| 118 | |
---|
| 119 | .. _toShortString: |
---|
| 120 | |
---|
| 121 | toShortString |
---|
| 122 | :: |
---|
| 123 | |
---|
| 124 | toShortString: function() |
---|
| 125 | |
---|
| 126 | *Returns* |
---|
| 127 | |
---|
| 128 | ``{String}`` Shortened String representation of Point object. (ex. <i>"5, 42"</i>) |
---|
| 129 | |
---|
| 130 | .. _move: |
---|
| 131 | |
---|
| 132 | move |
---|
| 133 | :: |
---|
| 134 | |
---|
| 135 | move: function(x,y) |
---|
| 136 | |
---|
| 137 | Moves a geometry by the given displacement along positive x and y axes. This modifies |
---|
| 138 | the position of the geometry and clears the cached bounds. |
---|
| 139 | |
---|
| 140 | *Parameters* |
---|
| 141 | |
---|
| 142 | | ``x {Float}`` Distance to move geometry in positive x direction. |
---|
| 143 | | ``y {Float}`` Distance to move geometry in positive y direction. |
---|
| 144 | |
---|
| 145 | .. _rotate: |
---|
| 146 | |
---|
| 147 | rotate |
---|
| 148 | :: |
---|
| 149 | |
---|
| 150 | rotate: function(angle,origin) |
---|
| 151 | |
---|
| 152 | Rotate a point around another. |
---|
| 153 | |
---|
| 154 | *Parameters* |
---|
| 155 | |
---|
| 156 | | ``angle {Float}`` Rotation angle in degrees (measured counterclockwise from the positive x-axis) |
---|
| 157 | | ``origin`` :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` Center point for the rotation |
---|
| 158 | |
---|
| 159 | .. _getCentroid: |
---|
| 160 | |
---|
| 161 | getCentroid |
---|
| 162 | :: |
---|
| 163 | |
---|
| 164 | getCentroid: function() |
---|
| 165 | |
---|
| 166 | *Returns* |
---|
| 167 | |
---|
| 168 | :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` The centroid of the collection |
---|
| 169 | |
---|
| 170 | .. _resize: |
---|
| 171 | |
---|
| 172 | resize |
---|
| 173 | :: |
---|
| 174 | |
---|
| 175 | resize: function(scale,origin,ratio) |
---|
| 176 | |
---|
| 177 | Resize a point relative to some origin. For points, this has the effect of scaling a |
---|
| 178 | vector (from the origin to the point). This method is more useful on geometry collection |
---|
| 179 | subclasses. |
---|
| 180 | |
---|
| 181 | *Parameters* |
---|
| 182 | |
---|
| 183 | | ``scale {Float}`` Ratio of the new distance from the origin to the old distance from the origin. A scale of 2 doubles the distance between the point and origin. |
---|
| 184 | | ``origin`` :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` Point of origin for resizing |
---|
| 185 | | ``ratio {Float}`` Optional x:y ratio for resizing. Default ratio is 1. |
---|
| 186 | |
---|
| 187 | *Returns* |
---|
| 188 | |
---|
| 189 | :ref:`{ZOO.Geometry} <api-zoo-geometry>` The current geometry. |
---|
| 190 | |
---|
| 191 | .. _intersects: |
---|
| 192 | |
---|
| 193 | intersects |
---|
| 194 | :: |
---|
| 195 | |
---|
| 196 | intersects: function(geometry) |
---|
| 197 | |
---|
| 198 | Determine if the input geometry intersects this one. |
---|
| 199 | |
---|
| 200 | *Parameters* |
---|
| 201 | |
---|
| 202 | ``geometry`` :ref:`{ZOO.Geometry} <api-zoo-geometry>` Any type of geometry. |
---|
| 203 | |
---|
| 204 | *Returns* |
---|
| 205 | |
---|
| 206 | ``{Boolean}`` The input geometry intersects this one. |
---|
| 207 | |
---|
| 208 | .. _transform: |
---|
| 209 | |
---|
| 210 | transform |
---|
| 211 | :: |
---|
| 212 | |
---|
| 213 | transform: function(source,dest) |
---|
| 214 | |
---|
| 215 | Translate the x,y properties of the point from source to dest. |
---|
| 216 | |
---|
| 217 | *Parameters* |
---|
| 218 | |
---|
| 219 | | ``source`` :ref:`{ZOO.Projection} <api-zoo-projection>` |
---|
| 220 | | ``dest`` :ref:`{ZOO.Projection} <api-zoo-projection>` |
---|
| 221 | |
---|
| 222 | *Returns* |
---|
| 223 | |
---|
| 224 | :ref:`{ZOO.Geometry} <api-zoo-geometry>` |
---|
| 225 | |
---|
| 226 | .. _getVertices: |
---|
| 227 | |
---|
| 228 | getVertices |
---|
| 229 | :: |
---|
| 230 | |
---|
| 231 | getVertices: function(nodes) |
---|
| 232 | |
---|
| 233 | Return a list of all points in this geometry. |
---|
| 234 | |
---|
| 235 | *Parameters* |
---|
| 236 | |
---|
| 237 | ``nodes {Boolean}`` For lines, only return vertices that are endpoints. If false, for lines, |
---|
| 238 | only vertices that are not endpoints will be returned. If not provided, all vertices will be returned. |
---|
| 239 | |
---|
| 240 | *Returns* |
---|
| 241 | |
---|
| 242 | ``{Array}`` A list of all vertices in the geometry. |
---|