Aimsun Next Scripting  24.0
Public Member Functions | List of all members
GKNodeNewCmd Class Reference
Inheritance diagram for GKNodeNewCmd:
GKCommand

Public Member Functions

 GKNodeNewCmd ()
 
 ~GKNodeNewCmd ()
 
void setData (const GKPoint &center, QVector< GKSection * > selectedSections, GKNode *existingNode)
 
void setPosition (const GKPoint &p)
 
GKObjectcreatedObject () const
 
void doit ()
 
void undoit ()
 
- Public Member Functions inherited from GKCommand
 if (base)
 
Py_END_ALLOW_THREADS End GKCommand ()
 
void setName (const QString &)
 
const QString & getName () const
 
void setModel (GKModel *)
 
GKModelgetModel () const
 
virtual GKCommandReportinit (GKModel *)
 
virtual bool isEqual (GKCommand *) const
 
virtual void merge (GKCommand *)
 
virtual void doit ()=0
 
virtual void undoit ()=0
 
void setUndoable (bool)
 
bool isUndoable () const
 
bool isDone () const
 
virtual void setDone (bool)
 
virtual void commandToBeDone ()
 
virtual void commandDone ()
 
virtual void commandToBeUndone ()
 
virtual void commandUndone ()
 
virtual GKObjectcreatedObject () const
 
virtual bool createdObjectRequiresEdition () const
 
virtual QVector< int > getTargets () const
 

Additional Inherited Members

- Public Attributes inherited from GKCommand
ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS GKCommandbase = (GKCommand*)sipCpp
 
 sipType = 0
 

Detailed Description

GKCommand * createNewCmd( GKType * type ) const;
Base class for all the commands (except Delete commands, see GKObjectDelCmd, or Cut commands see GKOb...
Definition: GKCommand.sip:93
Type information for an object.
Definition: GKType.sip:194

from the GKModel class.

See also
GKModel::createNewCmd

Once created, and in order to do it use the function:

GKCommandReport * addCommand( GKCommand * aCommand );
An error during a command execution.
Definition: GKCommand.sip:30

from the GKCommander class.

See also
GKCommander::addCommand

A sample code for creating a new node would look like:

cmd = model.createNewCmd( model.getType( "GKNode" ))
model.getCommander().addCommand( cmd )
res = cmd.createdObject()

Constructor & Destructor Documentation

◆ GKNodeNewCmd()

GKNodeNewCmd::GKNodeNewCmd ( )

◆ ~GKNodeNewCmd()

GKNodeNewCmd::~GKNodeNewCmd ( )

Member Function Documentation

◆ createdObject()

GKObject * GKNodeNewCmd::createdObject ( ) const
virtual

Created master node (once the command has been added to the GKCommander via the addCommand function).

Reimplemented from GKCommand.

◆ doit()

void GKNodeNewCmd::doit ( )
virtual

Do not use this function. Available just for compatibility issues.

Implements GKCommand.

◆ setData()

void GKNodeNewCmd::setData ( const GKPoint center,
QVector< GKSection * >  selectedSections,
GKNode existingNode 
)

Specify the center of the node, the list of sections to create the node among them and if any of the entrance sections are already connected to a destination node or any of the exit sections are already connected to an origin node, the node (that needs to be the same for all of them). The existing node can be null if all of them are unconnected.

◆ setPosition()

void GKNodeNewCmd::setPosition ( const GKPoint p)

When an empty node is created this function can be called instead of the setData one to sets the new node position.

◆ undoit()

void GKNodeNewCmd::undoit ( )
virtual

Do not use this function. Available just for compatibility issues.

Implements GKCommand.

© Aimsun SLU
Aimsun ®