Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
PhysicalObject Class Reference

An object in the Physical Workspace. More...

Public Member Functions

QString getName ()
 Returns the name of this physical object. More...
 
PhysicalObjectType getType ()
 Returns the type of physical object. INTER_CITY = 0, CITY = 1, BUILDING = 2, WIRING_CLOSET = 3, RACK = 4, TABLE = 5, DEVICE = 6 MULTIUSER = 7, GENERIC_CONTAINER = 8,
More...
 
int getX ()
 Returns X coordinate. More...
 
int getY ()
 Returns Y coordinate. More...
 
int getCenterX ()
 Returns center X coordinate. More...
 
int getCenterY ()
 Returns center Y coordinate. More...
 
double getGlobalX ()
 Returns global X coordinate. More...
 
double getGlobalY ()
 Returns global Y coordinate. More...
 
Device getDevice ()
 Returns the device if the type is DEVICE. More...
 
PhysicalObject getParent ()
 Returns the parent that contains the physical object. More...
 
bool moveOutOfCurrentObject ()
 Moves the physical object out of the current parent object and returns whether it was successful. More...
 
bool moveIntoObject (QString)
 Moves the physical object into an object in the same level with the specified name and returns whether it was successful. More...
 
int getChildCount ()
 Returns the number of children the physical object has. More...
 
PhysicalObject getChildAt (int)
 Returns the child at the given index in the physical object. More...
 
PhysicalObject getChild (QString)
 Returns the child with the specified name in the physical object. More...
 
PhysicalObject getChildByPath (QString)
 Returns the child recursively with the specified path separated by comma (,) in the physical object. More...
 
void setBackground (QString, bool)
 Sets the background image path to use when inside the physical object. More...
 
QString getBackground ()
 Sets the background image path to use when inside the physical object. More...
 
Environment getEnvironment ()
 Gets the environment for the physical object. More...
 
void deviceMoved (Device, PhysicalObject, PhysicalObject)
 IPC event. More...
 
void setX (int)
 
void setY (int)
 Sets the y-coordinate of the component item. More...
 
void moveBy (int, int)
 Moves the component item by the specified x and y values. More...
 
void moveTo (int, int)
 Moves the component item to the specified coordinates. More...
 
double getXScale ()
 
double getYScale ()
 
double getWidth ()
 
double getHeight ()
 
void setXVelocity (double)
 Sets the x-axis velocity of the component item. More...
 
void setYVelocity (double)
 Sets the y-axis velocity of the component item. More...
 
void setVelocity (double, double)
 Sets the x-axis and y-axis velocity of the component item. More...
 
double xVelocity ()
 Returns the x-axis velocity of the component item. More...
 
double yVelocity ()
 Returns the y-axis velocity of the component item. More...
 
QString getPathUuid ()
 Returns the UUID of the physical object. More...
 
QString nameToUuidPath (QString)
 Returns the comma-separated UUID path of the physical object from the given comma-separated physical location name path. More...
 
QString uuidToNamePath (QString)
 Returns the comma-separated name path of the physical object from the given comma-separated physical location UUID path. More...
 

Detailed Description

An object in the Physical Workspace.

Member Function Documentation

◆ deviceMoved()

void PhysicalObject::deviceMoved ( Device  ,
PhysicalObject  ,
PhysicalObject   
)

IPC event.

This event is emitted when the device is moved from one physical object to another.

  • dev, the device
  • from, from container.
  • to, to container.

◆ getBackground()

QString PhysicalObject::getBackground ( )

Sets the background image path to use when inside the physical object.

Returns
QString, the background image path.

◆ getCenterX()

int PhysicalObject::getCenterX ( )

Returns center X coordinate.

Returns
int, center x coordinate.

◆ getCenterY()

int PhysicalObject::getCenterY ( )

Returns center Y coordinate.

Returns
int, center Y coordinate.

◆ getChild()

PhysicalObject PhysicalObject::getChild ( QString  )

Returns the child with the specified name in the physical object.

Parameters
name,nameof the child.
Returns
PhysicalObject, the child with the specified name, if any.

◆ getChildAt()

PhysicalObject PhysicalObject::getChildAt ( int  )

Returns the child at the given index in the physical object.

Parameters
index,indexto get a child from.
Returns
PhysicalObject, the child at the given index, if any.

◆ getChildByPath()

PhysicalObject PhysicalObject::getChildByPath ( QString  )

Returns the child recursively with the specified path separated by comma (,) in the physical object.

Parameters
path,pathof the child separated by comma (,).
Returns
PhysicalObject, the child with the specified path, if any.

◆ getChildCount()

int PhysicalObject::getChildCount ( )

Returns the number of children the physical object has.

Returns
int, the number of children the physical object has.

◆ getDevice()

Device PhysicalObject::getDevice ( )

Returns the device if the type is DEVICE.

Returns
Device, the device in the object type is DEVICE.

◆ getEnvironment()

Environment PhysicalObject::getEnvironment ( )

Gets the environment for the physical object.

Returns
Environment, the environment for the physical object.

◆ getGlobalX()

double PhysicalObject::getGlobalX ( )

Returns global X coordinate.

Returns
double, global x coordinate.

◆ getGlobalY()

double PhysicalObject::getGlobalY ( )

Returns global Y coordinate.

Returns
double, global Y coordinate.

◆ getHeight()

double PhysicalObject::getHeight ( )

◆ getName()

QString PhysicalObject::getName ( )

Returns the name of this physical object.

Returns
QString, name of the object.

◆ getParent()

PhysicalObject PhysicalObject::getParent ( )

Returns the parent that contains the physical object.

Returns
PhysicalObject, the parent that contains the physical object.

◆ getPathUuid()

QString PhysicalObject::getPathUuid ( )

Returns the UUID of the physical object.

Returns
QString, the UUID of the physical object

◆ getType()

PhysicalObjectType PhysicalObject::getType ( )

Returns the type of physical object. INTER_CITY = 0, CITY = 1, BUILDING = 2, WIRING_CLOSET = 3, RACK = 4, TABLE = 5, DEVICE = 6 MULTIUSER = 7, GENERIC_CONTAINER = 8,

Returns
PhysicalObjectType

◆ getWidth()

double PhysicalObject::getWidth ( )

◆ getX()

int PhysicalObject::getX ( )

Returns X coordinate.

Returns
int, x coordinate.

◆ getXScale()

double PhysicalObject::getXScale ( )

◆ getY()

int PhysicalObject::getY ( )

Returns Y coordinate.

Returns
int, y coordinate.

◆ getYScale()

double PhysicalObject::getYScale ( )

◆ moveBy()

void PhysicalObject::moveBy ( int  ,
int   
)

Moves the component item by the specified x and y values.

Parameters
x,thevalue to move the component item by on the x-axis.
y,thevalue to move the component item by on the y-axis.

◆ moveIntoObject()

bool PhysicalObject::moveIntoObject ( QString  )

Moves the physical object into an object in the same level with the specified name and returns whether it was successful.

Parameters
name,thename of the object in the same level
Returns
boolean, whether the move was successful.

◆ moveOutOfCurrentObject()

bool PhysicalObject::moveOutOfCurrentObject ( )

Moves the physical object out of the current parent object and returns whether it was successful.

Returns
boolean, whether the move was successful.

◆ moveTo()

void PhysicalObject::moveTo ( int  ,
int   
)

Moves the component item to the specified coordinates.

Parameters
x,thevalue to move the component item to on the x-axis.
y,thevalue to move the component item to on the y-axis.

◆ nameToUuidPath()

QString PhysicalObject::nameToUuidPath ( QString  )

Returns the comma-separated UUID path of the physical object from the given comma-separated physical location name path.

Returns
QString, the comma-separated UUID path of the physical object from the given comma-separated physical location name path

◆ setBackground()

void PhysicalObject::setBackground ( QString  ,
bool   
)

Sets the background image path to use when inside the physical object.

Parameters
path,pathto the image to use.
tiled,trueto tile the background false to just show one image.

◆ setVelocity()

void PhysicalObject::setVelocity ( double  ,
double   
)

Sets the x-axis and y-axis velocity of the component item.

Parameters
xv,thex-axis velocity of the component item.
yv,they-axis velocity of the component item.

◆ setX()

void PhysicalObject::setX ( int  )

◆ setXVelocity()

void PhysicalObject::setXVelocity ( double  )

Sets the x-axis velocity of the component item.

Parameters
xv,thex-axis velocity of the component item.

◆ setY()

void PhysicalObject::setY ( int  )

Sets the y-coordinate of the component item.

Parameters
y,they-coordinate of the component item.

◆ setYVelocity()

void PhysicalObject::setYVelocity ( double  )

Sets the y-axis velocity of the component item.

Parameters
yv,they-axis velocity of the component item.

◆ uuidToNamePath()

QString PhysicalObject::uuidToNamePath ( QString  )

Returns the comma-separated name path of the physical object from the given comma-separated physical location UUID path.

Returns
QString, the comma-separated name path of the physical object from the given comma-separated physical location UUID path

◆ xVelocity()

double PhysicalObject::xVelocity ( )

Returns the x-axis velocity of the component item.

Returns
double, the x-axis velocity of the component item.

◆ yVelocity()

double PhysicalObject::yVelocity ( )

Returns the y-axis velocity of the component item.

Returns
double, the y-axis velocity of the component item.

The documentation for this class was generated from the following file: