wxArt2D
|
This is a class/type description for a2dPin's. More...
#include <canpin.h>
Public Types | |
enum | a2dPinClassFlags { PC_angle = 0x0001, PC_ALLSET = 0xFFFFFFFF } |
Public Member Functions | |
a2dPinClass (const wxString &name) | |
constructor More... | |
~a2dPinClass () | |
destructor | |
void | AddConnect (a2dPinClass *pinClass) |
add a connection pinclass, to which this pin can connect | |
void | RemoveConnect (a2dPinClass *pinClass) |
remove a connection pinclass | |
const wxString & | GetName () const |
bool | HasAngleLine () const |
is there an angle line on the pin | |
void | SetAngleLine (bool value) |
is there an angle line on the pin | |
wxUint32 | GetFlags () |
get all flags | |
a2dPinClass * | CanConnectTo (a2dPinClass *other=NULL) const |
searches in the connection list for a given pin class More... | |
std::list< a2dPinClass * > & | GetConnectList () |
return list of connectable pin class objects. | |
void | SetPin (a2dPin *newpin) |
set default pin for graph like structure | |
a2dPin * | GetPin () |
get default pin for graph like structure | |
void | SetPinCanConnect (a2dPin *newpin) |
a2dPin * | GetPinCanConnect () |
represents the pin styles for pins that can connect right now More... | |
void | SetPinCannotConnect (a2dPin *newpin) |
a2dPin * | GetPinCannotConnect () |
represents the pin styles for pins that cannot connect right now More... | |
void | SetParPin (a2dParPin *newpin) |
a2dParPin * | GetParPin () |
Pin to use in a2dCameleonInst when creating a2dParPin from an a2dPort. | |
void | SetConnectionGenerator (a2dConnectionGenerator *connectionGenerator) |
Set class for generating new connection objects between object and pins. | |
a2dConnectionGenerator * | GetConnectionGenerator () const |
Get class for generating new connection objects between object and pins. | |
a2dPinClass * | GetPinClassForTask (a2dConnectTask task, a2dCanvasObject *obj=NULL, a2dPinClass *pinClassTo=NULL, a2dPin *pinFrom=NULL) const |
Static Public Member Functions | |
static void | InitializeStockPinClasses () |
called to initialize static stockobjects | |
static void | DeleteStockPinClasses () |
called to delete all pin class objects | |
static a2dPinClass * | GetClassByName (const wxString &name) |
return the name of this pinclass. | |
Static Public Attributes | |
static std::list< a2dPinClass * > | m_allPinClasses |
a linked lists of all a2dPinClass'es, so that one can get a class by name | |
static a2dPinClass * | Any = NULL |
used to ask for a new default pin on an object. More... | |
static a2dPinClass * | Standard = NULL |
Pins of this class can only connect to pins of the same class. | |
Protected Attributes | |
wxString | m_name |
name of pin class | |
std::list< a2dPinClass * > | m_canConnectTo |
wxUint32 | m_flags |
pinclass specific flags | |
a2dPinPtr | m_defPin |
a2dPinPtr | m_defCanConnectPin |
a2dPinPtr | m_defCannotConnectPin |
a2dSmrtPtr< a2dParPin > | m_defParPin |
a2dConnectionGeneratorPtr | m_connectionGenerator |
Use this connection generator for wires and pins. | |
This is a class/type description for a2dPin's.
a2dPin's have a pin class which can be used by a2dConnectionGenerator to define to which other pin classes ( of other pins ) it can connect and how. E.g. One class might be input and one class might be output and it is only possible to connect an input to an output, but not two inputs or two outputs. This class mainly has a name and an array of pin classes it is allowed to connect to. How and when a pinclass is connected to another pinclass ( one to one, or with a wire and what type of wire ), is decided by the a2dConnectionGenerator.
As an example: You want pin object on certain layers to only connect to pins on some other layers. For that you give a pin on a layerA a a2dPinClass called PC_layerA. And for pins on layers B C D you do the same. Now to be able to connect a PC_layerA to PC_layerB PC_layerC and NOT PC_layerD. You add to PC_layerA its m_canConnectTo, the pin classes: PC_layerA, PC_layerB, PC_layerC. And to PC_layerB, PC_layerC you add at least PC_layerA. You could also define a pin class called PC_layersABC with in its m_canConnectTo he same PC_layersABC, next you use for pins one layers A,B,C this class. So all pins on those ayesr can connect with each other. As you see what layer a pin is on, is of no importance, it is the pin class which allows pins to connect or not.
Both the class and the m_canConnectTo array are created statically. If not, it is your responsibility to remove the canConnectTo array. The m_canConnectTo array is terminated with a zero pointer. The default class is a2dPinClass::Standard, which can only connect to itself.
a2dPinClass::a2dPinClass | ( | const wxString & | name | ) |
constructor
name | name of the pinclass, can be used e.g. for XML saving |
Definition at line 455 of file canpin.cpp.
a2dPinClass * a2dPinClass::CanConnectTo | ( | a2dPinClass * | other = NULL | ) | const |
searches in the connection list for a given pin class
If the given pin class is found, this means that the pin having that pinclass can connect to the pin having this pinclass.
other | pin to test connection |
flags | type of pin needed |
Definition at line 499 of file canpin.cpp.
a2dPin * a2dPinClass::GetPinCanConnect | ( | ) |
represents the pin styles for pins that can connect right now
This pin is usually bigger than the default pin and green
Definition at line 560 of file canpin.cpp.
a2dPin * a2dPinClass::GetPinCannotConnect | ( | ) |
represents the pin styles for pins that cannot connect right now
This pin is usually smaller than the default pin and red
Definition at line 544 of file canpin.cpp.
void a2dPinClass::SetParPin | ( | a2dParPin * | newpin | ) |
Definition at line 571 of file canpin.cpp.
void a2dPinClass::SetPinCanConnect | ( | a2dPin * | newpin | ) |
Definition at line 555 of file canpin.cpp.
void a2dPinClass::SetPinCannotConnect | ( | a2dPin * | newpin | ) |
Definition at line 539 of file canpin.cpp.
|
static |
|
protected |
list of a2dPinClass objects, to which this a2dPinClass object can connect. Each Pin has a a2dPinClass which defines to which that pin can connect to other pins. This is approved based on those other Pins having a a2dPinClass in this array here. Of course another pin which wants to connect, should check the availibility of this pin its pinclass in its own connection list.