#include <sttool.h>


Public Types | |
| enum | a2dWiringMode { a2d_BasedOnClassStartPin, a2d_BasedOnWireClassRequired, a2d_BasedOnObjectClassRequired, a2d_BasedOnClassEndPin } |
| the way a new wire is created More... | |
Public Member Functions | |
| a2dDrawWirePolylineLTool (a2dStToolContr *controller) | |
| a2dPin * | FindPin (a2dCanvasObject *root, double x, double y, bool ForStartPin) |
| Helper function to find a pin in a DIRECT child object of the given root object. | |
Static Public Attributes | |
| static const a2dCommandId | COMID_PushTool_DrawWirePolylineL |
| push this tool on the tools stack | |
Protected Member Functions | |
| virtual bool | EnterBusyMode () |
| starts a new action (e.g drawing something ) in a tool that is already pushed. | |
| virtual void | FinishBusyMode (bool closeCommandGroup=true) |
| Called when the user finishes editing a distinct object */. | |
| virtual void | AbortBusyMode () |
| Called when the user aborts editing a distinct object */. | |
| void | AdjustRenderOptions () |
| Adjust the rendering options to the needs of this tool. | |
| void | OnMouseEvent (wxMouseEvent &event) |
| called on mouse events | |
| void | SetActive (bool active) |
| set the tool active or inactive. | |
| virtual wxString | GetCommandGroupName () |
| return the command group name for commands of a derived class | |
Protected Attributes | |
| a2dWiringMode | m_wiringMode |
| a2dPinClass * | m_pinClassStartWire |
| required pin class at start of wire | |
| a2dPinClass * | m_pinClassEndWire |
| required pin class at start of wire | |
This tool is used to draw wires in between a2dCanvasObject's which have a2dPin's. a2dPin's are used to connect objects with eachother. A wire is a special kind of a2dCanvasObject since it is designed to keep other objects connected when moving them around. Rerouting algorithms take care of this.
This tool here first waits for a pin that is clicked. It uses a a2dConnectionGenerator::GetPinClassForTask() to get a connection a2dPinClass for the pin which was clicked. From that the pin clicked, a suitable wire is found via a2dConnectionGenerator::CreateConnectObject() The wire returned has a pin which matches the pin clicked at the start, and an end pin is generated by a2dConnectionGenerator itself. The end pin must eventually fits a pin which will be clicked to end the wire.
If you want this tool to start only on specific pins, for a specific wire type and/or pin class, you must set a a2dConnectionGenerator that does only returns that type of pin in its GetPinClassForTask(). When more start pin classes are allowed, and pins overlap the first one found is returned. That might be not be the one you want.
For usage of those features, think here of graphs of a2dCanvasObjects with more then one flow.
Space bar or Double click to end drawing.
Cursor keys to shift object.
Cursor keys + control to shift point.
Right Click to zoom.
Definition at line 1765 of file sttool.h.
the way a new wire is created
| a2dPin * a2dDrawWirePolylineLTool::FindPin | ( | a2dCanvasObject * | root, | |
| double | x, | |||
| double | y, | |||
| bool | ForStartPin | |||
| ) |
Helper function to find a pin in a DIRECT child object of the given root object.
if a pin is found, return the m_connectionGenerator is used to find the pin which can connect to the pin found.
Definition at line 4262 of file sttool.cpp.
| bool a2dDrawWirePolylineLTool::EnterBusyMode | ( | ) | [protected, virtual] |
starts a new action (e.g drawing something ) in a tool that is already pushed.
Opens a new a2dCommandGroup, which will be closed at the end of an action. This is normally in FinishBusyMode(), but might be delayed when other tools are pushed, like the edit tool to further edit the drawn figure. This should become part of the same command group.
Reimplemented from a2dStDrawTool.
Definition at line 4358 of file sttool.cpp.
| void a2dDrawWirePolylineLTool::FinishBusyMode | ( | bool | closeCommandGroup = true |
) | [protected, virtual] |
Called when the user finishes editing a distinct object */.
GetActive You should call the base class (this) version at the END of your function
Reimplemented from a2dStDrawTool.
Definition at line 4363 of file sttool.cpp.
| void a2dDrawWirePolylineLTool::AbortBusyMode | ( | ) | [protected, virtual] |
Called when the user aborts editing a distinct object */.
Reimplemented from a2dStDrawTool.
Definition at line 4373 of file sttool.cpp.
| void a2dDrawWirePolylineLTool::SetActive | ( | bool | active | ) | [protected, virtual] |
set the tool active or inactive.
If the tool needs initializing after it was inactive for a while, override this function to re-initialize the tool. This function can be used to distribute its settings for style etc. to the documents
Reimplemented from a2dStTool.
Definition at line 4659 of file sttool.cpp.
| virtual wxString a2dDrawWirePolylineLTool::GetCommandGroupName | ( | ) | [inline, protected, virtual] |
return the command group name for commands of a derived class
this defaults to the class name
Reimplemented from a2dDrawPolygonLTool.