wxArt2D
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
a2dPinClass Class Reference

This is a class/type description for a2dPin's. More...

#include <canpin.h>

Collaboration diagram for a2dPinClass:
Collaboration graph
[legend]

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
 
a2dPinClassCanConnectTo (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
 
a2dPinGetPin ()
 get default pin for graph like structure
 
void SetPinCanConnect (a2dPin *newpin)
 
a2dPinGetPinCanConnect ()
 represents the pin styles for pins that can connect right now More...
 
void SetPinCannotConnect (a2dPin *newpin)
 
a2dPinGetPinCannotConnect ()
 represents the pin styles for pins that cannot connect right now More...
 
void SetParPin (a2dParPin *newpin)
 
a2dParPinGetParPin ()
 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.
 
a2dConnectionGeneratorGetConnectionGenerator () const
 Get class for generating new connection objects between object and pins.
 
a2dPinClassGetPinClassForTask (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 a2dPinClassGetClassByName (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 a2dPinClassAny = NULL
 used to ask for a new default pin on an object. More...
 
static a2dPinClassStandard = 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< a2dParPinm_defParPin
 
a2dConnectionGeneratorPtr m_connectionGenerator
 Use this connection generator for wires and pins.
 

Detailed Description

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.

Definition at line 628 of file canpin.h.

Member Enumeration Documentation

Enumerator
PC_angle 

output

PC_ALLSET 

For Xor ing and all set

Definition at line 632 of file canpin.h.

Constructor & Destructor Documentation

a2dPinClass::a2dPinClass ( const wxString &  name)

constructor

Parameters
namename of the pinclass, can be used e.g. for XML saving

Definition at line 455 of file canpin.cpp.

Member Function Documentation

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.

Parameters
otherpin to test connection
flagstype 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)
See Also
GetParPin()

Definition at line 571 of file canpin.cpp.

void a2dPinClass::SetPinCanConnect ( a2dPin newpin)
See Also
GetPinCanConnect()

Definition at line 555 of file canpin.cpp.

void a2dPinClass::SetPinCannotConnect ( a2dPin newpin)
See Also
GetPinCannotConnect()

Definition at line 539 of file canpin.cpp.

Member Data Documentation

a2dPinClass * a2dPinClass::Any = NULL
static

used to ask for a new default pin on an object.

m_connectionGenerator decides what is returned when asking a connection task given this pin class.

Definition at line 763 of file canpin.h.

std::list< a2dPinClass* > a2dPinClass::m_canConnectTo
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.

Definition at line 738 of file canpin.h.


The documentation for this class was generated from the following files:
a2dPinClass Class Reference -- Sun Oct 12 2014 17:04:45 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation