a2dDrawWirePolylineLTool Class Reference
[Objects used for interactive manipulation.]

Interactive drawing of a polyline wire. More...

#include <sttool.h>

Inheritance diagram for a2dDrawWirePolylineLTool:

Inheritance graph
[legend]
Collaboration diagram for a2dDrawWirePolylineLTool:

Collaboration graph
[legend]

List of all members.

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)
a2dPinFindPin (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
a2dPinClassm_pinClassStartWire
 required pin class at start of wire
a2dPinClassm_pinClassEndWire
 required pin class at start of wire


Detailed Description

Interactive drawing of a polyline 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.

Remarks:
Left Click to add points.

Space bar or Double click to end drawing.

Cursor keys to shift object.

Cursor keys + control to shift point.

Right Click to zoom.

See also:
a2dStToolContr

Definition at line 1765 of file sttool.h.


Member Enumeration Documentation

the way a new wire is created

Enumerator:
a2d_BasedOnClassStartPin  the pin which is clicked as start pin for the wire, its pinclass is used to find a connecting pinclass in the wire beginpin. Only usefull if there is only one type of wire possible for that pinclass.
a2d_BasedOnWireClassRequired  the tool provides a starting wire pinclass, only pins which can connect to his wirepin its pinclass, will be clickable. Use this to only draw specific wires from this tool.
a2d_BasedOnClassEndPin  the wire will be decided when the end pin for the wire is hit, based on the start pin and endpin. use this if more then on type of wire can start from a certain pinclass, and it depends on the end pin what type of wire it will be.

Definition at line 1779 of file sttool.h.


Member Function Documentation

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 */.

See also:
EnterBusyMode,

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 */.

See also:
EnterBusyMode This is supposed to undo aeverything the tool did since entering busy mode

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

See also:
a2dCanvasDocument::GetCanvasCommandProcessor(). The default implementation sets fill, stroke to the commandprocessor, but only when m_doSetStyleToCommandProc is true. If you need more complicated behaviour just override.

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.

Definition at line 1822 of file sttool.h.


The documentation for this class was generated from the following files:
a2dDrawWirePolylineLTool Class Reference -- Tue Aug 31 18:25:58 2010 -- 31 Aug 2010 -- 1.5.5 -- wxArt2D -- . -- Main Page Reference Documentation