1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. currentmodule:: wx.lib.ogl.basic
.. highlight:: python
.. _wx.lib.ogl.basic.PolygonShape:
==========================================================================================================================================
|phoenix_title| **wx.lib.ogl.basic.PolygonShape**
==========================================================================================================================================
The :class:`PolygonShape` class shape is defined by a number of points
passed to the object's constructor. It can be used to create new shapes
such as diamonds and triangles.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
<div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
<img id="toggleBlock-trigger" src="_static/images/closed.png"/>
Inheritance diagram for class <strong>PolygonShape</strong>:
</div>
<div id="toggleBlock-summary" style="display:block;"></div>
<div id="toggleBlock-content" style="display:none;">
<p class="graphviz">
<center><img src="_static/images/inheritance/wx.lib.ogl.basic.PolygonShape_inheritance.png" alt="Inheritance diagram of PolygonShape" usemap="#dummy" class="inheritance"/></center>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.ogl.basic.PolygonShape.html" title="wx.lib.ogl.basic.PolygonShape" alt="" coords="15,160,234,189"/> <area shape="rect" id="node2" href="wx.lib.ogl.basic.Shape.html" title="wx.lib.ogl.basic.Shape" alt="" coords="41,83,208,112"/> <area shape="rect" id="node3" href="wx.lib.ogl.basic.ShapeEvtHandler.html" title="wx.lib.ogl.basic.ShapeEvtHandler" alt="" coords="5,5,244,35"/> </map>
</p>
</div>
|
|super_classes| Known Superclasses
==================================
:class:`wx.lib.ogl.basic.Shape`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.ogl.basic.PolygonShape.__init__` Default class constructor
:meth:`~wx.lib.ogl.basic.PolygonShape.AddPolygonPoint` Add a control point after the given point.
:meth:`~wx.lib.ogl.basic.PolygonShape.AttachmentIsValid` Is attachment valid?
:meth:`~wx.lib.ogl.basic.PolygonShape.CalculateBoundingBox` Calculate the bounding box.
:meth:`~wx.lib.ogl.basic.PolygonShape.CalculatePolygonCentre` Recalculates the centre of the polygon, and
:meth:`~wx.lib.ogl.basic.PolygonShape.ClearPoints` Clear the points.
:meth:`~wx.lib.ogl.basic.PolygonShape.Create` Takes a list of :class:`wx.Points` or tuples; each point is an offset
:meth:`~wx.lib.ogl.basic.PolygonShape.DeletePolygonPoint` Delete the given control point.
:meth:`~wx.lib.ogl.basic.PolygonShape.GetAttachmentPosition` Get attachment position.
:meth:`~wx.lib.ogl.basic.PolygonShape.GetBoundingBoxMin` Get minimum bounding box.
:meth:`~wx.lib.ogl.basic.PolygonShape.GetNumberOfAttachments` Get number of attachments.
:meth:`~wx.lib.ogl.basic.PolygonShape.GetOriginalHeight` Get the original height.
:meth:`~wx.lib.ogl.basic.PolygonShape.GetOriginalPoints` Get the original points.
:meth:`~wx.lib.ogl.basic.PolygonShape.GetOriginalWidth` Get the original width.
:meth:`~wx.lib.ogl.basic.PolygonShape.GetPerimeterPoint` Get the perimeter point.
:meth:`~wx.lib.ogl.basic.PolygonShape.GetPoints` Return the internal list of polygon vertices.
:meth:`~wx.lib.ogl.basic.PolygonShape.HitTest` Hit text
:meth:`~wx.lib.ogl.basic.PolygonShape.MakeControlPoints` Make control points.
:meth:`~wx.lib.ogl.basic.PolygonShape.OnDraw` The draw handler.
:meth:`~wx.lib.ogl.basic.PolygonShape.OnDrawOutline` The draw outline handler.
:meth:`~wx.lib.ogl.basic.PolygonShape.OnSizingBeginDragLeft` The sizing begin drag left handler.
:meth:`~wx.lib.ogl.basic.PolygonShape.OnSizingDragLeft` The sizing drag left handler.
:meth:`~wx.lib.ogl.basic.PolygonShape.OnSizingEndDragLeft` The sizing end drag left handler.
:meth:`~wx.lib.ogl.basic.PolygonShape.ResetControlPoints` Reset control points.
:meth:`~wx.lib.ogl.basic.PolygonShape.Rotate` Rotate about the given axis by the given amount in radians.
:meth:`~wx.lib.ogl.basic.PolygonShape.SetOriginalHeight` Set the original height.
:meth:`~wx.lib.ogl.basic.PolygonShape.SetOriginalWidth` Set the original width.
:meth:`~wx.lib.ogl.basic.PolygonShape.SetSize` Set the size
:meth:`~wx.lib.ogl.basic.PolygonShape.UpdateOriginalPoints` If we've changed the shape, must make the original points match the
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: PolygonShape(Shape)
The :class:`PolygonShape` class shape is defined by a number of points
passed to the object's constructor. It can be used to create new shapes
such as diamonds and triangles.
.. method:: __init__(self)
Default class constructor
Does not follow above statement, should it? or is Create called
automagically?
.. method:: AddPolygonPoint(self, pos)
Add a control point after the given point.
:param `pos`: position of point
.. method:: AttachmentIsValid(self, attachment)
Is attachment valid?
:param `attachment`: ???
.. method:: CalculateBoundingBox(self)
Calculate the bounding box.
.. method:: CalculatePolygonCentre(self)
Recalculates the centre of the polygon, and
readjusts the point offsets accordingly.
Necessary since the centre of the polygon
is expected to be the real centre of the bounding
box.
.. method:: ClearPoints(self)
Clear the points.
.. method:: Create(self, the_points = None)
Takes a list of :class:`wx.Points` or tuples; each point is an offset
from the centre.
.. method:: DeletePolygonPoint(self, pos)
Delete the given control point.
:param `pos`: position of point
.. method:: GetAttachmentPosition(self, attachment, nth = 0, no_arcs = 1, line = None)
Get attachment position.
:param `attachment`: the attachment ???
:param `nth`: get nth attachment ???
:param `no_arcs`: ???
:param `line`: ???
.. method:: GetBoundingBoxMin(self)
Get minimum bounding box.
.. method:: GetNumberOfAttachments(self)
Get number of attachments.
.. method:: GetOriginalHeight(self)
Get the original height.
.. method:: GetOriginalPoints(self)
Get the original points.
.. method:: GetOriginalWidth(self)
Get the original width.
.. method:: GetPerimeterPoint(self, x1, y1, x2, y2)
Get the perimeter point.
:param `x1`: the x1 position
:param `y1`: the y1 position
:param `x2`: the x2 position
:param `y2`: the y2 position
.. method:: GetPoints(self)
Return the internal list of polygon vertices.
.. method:: HitTest(self, x, y)
Hit text
:param `x`: the x position
:param `y`: the y position
.. method:: MakeControlPoints(self)
Make control points.
.. method:: OnDraw(self, dc)
The draw handler.
.. method:: OnDrawOutline(self, dc, x, y, w, h)
The draw outline handler.
.. method:: OnSizingBeginDragLeft(self, pt, x, y, keys = 0, attachment = 0)
The sizing begin drag left handler.
.. method:: OnSizingDragLeft(self, pt, draw, x, y, keys = 0, attachment = 0)
The sizing drag left handler.
.. method:: OnSizingEndDragLeft(self, pt, x, y, keys = 0, attachment = 0)
The sizing end drag left handler.
.. method:: ResetControlPoints(self)
Reset control points.
.. method:: Rotate(self, x, y, theta)
Rotate about the given axis by the given amount in radians.
:param `x`: the x position
:param `y`: the y position
:param `theta`: the theta
.. method:: SetOriginalHeight(self, h)
Set the original height.
:param `w`: the height
.. method:: SetOriginalWidth(self, w)
Set the original width.
:param `w`: the width
.. method:: SetSize(self, new_width, new_height, recursive = True)
Set the size
:param `new_width`: the width
:param `new_height`: the height
:param `recursive`: not used
.. method:: UpdateOriginalPoints(self)
If we've changed the shape, must make the original points match the
working points with this function.
|