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
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. currentmodule:: wx.lib.ogl.diagram
.. highlight:: python
.. _wx.lib.ogl.diagram.Diagram:
==========================================================================================================================================
|phoenix_title| **wx.lib.ogl.diagram.Diagram**
==========================================================================================================================================
The :class:`Diagram` encapsulates an entire diagram, with methods for
drawing. A diagram has an associated :class:`ShapeCanvas`.
|
|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>Diagram</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.diagram.Diagram_inheritance.png" alt="Inheritance diagram of Diagram" usemap="#dummy" class="inheritance"/></center>
</div>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.ogl.diagram.Diagram.html" title="wx.lib.ogl.diagram.Diagram" alt="" coords="5,5,200,35"/> </map>
</p>
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.ogl.diagram.Diagram.__init__` Default class constructor.
:meth:`~wx.lib.ogl.diagram.Diagram.AddShape` Add a shape to the diagram. If addAfter is not None, the shape
:meth:`~wx.lib.ogl.diagram.Diagram.Clear` Clear the specified device context.
:meth:`~wx.lib.ogl.diagram.Diagram.DeleteAllShapes` Remove and delete all shapes in the diagram.
:meth:`~wx.lib.ogl.diagram.Diagram.DrawOutline` Draw an outline rectangle on the current device context.
:meth:`~wx.lib.ogl.diagram.Diagram.FindShape` Return the shape for the given identifier.
:meth:`~wx.lib.ogl.diagram.Diagram.GetCanvas` Return the shape canvas associated with this diagram.
:meth:`~wx.lib.ogl.diagram.Diagram.GetCount` Return the number of shapes in the diagram.
:meth:`~wx.lib.ogl.diagram.Diagram.GetGridSpacing` Return the grid spacing.
:meth:`~wx.lib.ogl.diagram.Diagram.GetMouseTolerance` Return the tolerance within which a mouse move is ignored.
:meth:`~wx.lib.ogl.diagram.Diagram.GetQuickEditMode` Return quick edit mode.
:meth:`~wx.lib.ogl.diagram.Diagram.GetShapeList` Return the internal shape list.
:meth:`~wx.lib.ogl.diagram.Diagram.GetSnapToGrid` Return snap-to-grid mode.
:meth:`~wx.lib.ogl.diagram.Diagram.InsertShape` Insert a shape at the front of the shape list.
:meth:`~wx.lib.ogl.diagram.Diagram.RecentreAll` Recentre all the text that should be centred.
:meth:`~wx.lib.ogl.diagram.Diagram.Redraw` Redraw the shapes in the diagram on the specified device context.
:meth:`~wx.lib.ogl.diagram.Diagram.RemoveAllShapes` Remove all shapes from the diagram but do not delete the shapes.
:meth:`~wx.lib.ogl.diagram.Diagram.RemoveShape` Remove the shape from the diagram (non-recursively) but do not
:meth:`~wx.lib.ogl.diagram.Diagram.SetCanvas` Set the canvas associated with this diagram.
:meth:`~wx.lib.ogl.diagram.Diagram.SetGridSpacing` Sets grid spacing.
:meth:`~wx.lib.ogl.diagram.Diagram.SetMouseTolerance` Set the tolerance within which a mouse move is ignored.
:meth:`~wx.lib.ogl.diagram.Diagram.SetQuickEditMode` Set quick-edit-mode on of off.
:meth:`~wx.lib.ogl.diagram.Diagram.SetSnapToGrid` Sets snap-to-grid mode.
:meth:`~wx.lib.ogl.diagram.Diagram.ShowAll` Call Show for each shape in the diagram.
:meth:`~wx.lib.ogl.diagram.Diagram.Snap` 'Snaps' the coordinate to the nearest grid position, if
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: Diagram(object)
The :class:`Diagram` encapsulates an entire diagram, with methods for
drawing. A diagram has an associated :class:`ShapeCanvas`.
.. method:: __init__(self)
Default class constructor.
.. method:: AddShape(self, object, addAfter = None)
Add a shape to the diagram. If addAfter is not None, the shape
will be added after addAfter.
:param `object`: an instance of :class:`~lib.ogl.Shape`
:param `addAfter`: an instance of :class:`~lib.ogl.Shape`
.. method:: Clear(self, dc)
Clear the specified device context.
.. method:: DeleteAllShapes(self)
Remove and delete all shapes in the diagram.
.. method:: DrawOutline(self, dc, x1, y1, x2, y2)
Draw an outline rectangle on the current device context.
:param `dc`: the :class:`wx.MemoryDC` device context
:param `x1`: the x1 position
:param `y2`: the y2 position
:param `x1`: the x1 position
:param `y2`: the y2 position
.. method:: FindShape(self, id)
Return the shape for the given identifier.
:param `id`: the shape id to find
.. method:: GetCanvas(self)
Return the shape canvas associated with this diagram.
.. method:: GetCount(self)
Return the number of shapes in the diagram.
.. method:: GetGridSpacing(self)
Return the grid spacing.
.. method:: GetMouseTolerance(self)
Return the tolerance within which a mouse move is ignored.
.. method:: GetQuickEditMode(self)
Return quick edit mode.
.. method:: GetShapeList(self)
Return the internal shape list.
.. method:: GetSnapToGrid(self)
Return snap-to-grid mode.
.. method:: InsertShape(self, object)
Insert a shape at the front of the shape list.
:param `object`: an instance of :class:`~lib.ogl.Shape`
.. method:: RecentreAll(self, dc)
Recentre all the text that should be centred.
:param `dc`: the :class:`wx.MemoryDC` device context
.. method:: Redraw(self, dc)
Redraw the shapes in the diagram on the specified device context.
.. method:: RemoveAllShapes(self)
Remove all shapes from the diagram but do not delete the shapes.
.. method:: RemoveShape(self, object)
Remove the shape from the diagram (non-recursively) but do not
delete it.
:param `object`: an instance of :class:`~lib.ogl.Shape`
.. method:: SetCanvas(self, canvas)
Set the canvas associated with this diagram.
:param `canvas`: an instance of :class:`~lib.ogl.Canvas`
.. method:: SetGridSpacing(self, spacing)
Sets grid spacing.
:param `spacing`: the spacing
.. method:: SetMouseTolerance(self, tolerance)
Set the tolerance within which a mouse move is ignored.
The default is 3 pixels.
:param `tolerance`: the tolerance level
.. method:: SetQuickEditMode(self, mode)
Set quick-edit-mode on of off.
In this mode, refreshes are minimized, but the diagram may need
manual refreshing occasionally.
:param `mode`: `True` to quick edit or `False` for normal edit
.. method:: SetSnapToGrid(self, snap)
Sets snap-to-grid mode.
:param `snap`: `True` to snap to grid or `False` not to snap
.. method:: ShowAll(self, show)
Call Show for each shape in the diagram.
:param `show`: ``True`` or False
.. method:: Snap(self, x, y)
'Snaps' the coordinate to the nearest grid position, if
snap-to-grid is on.
:param `x`: the x position
:param `y`: the y position
|