Rectangular Node

Nodes and paths are space markup elements that define the locations of agents in the space:

Nodes can be connected with paths. Altogether they compose a network. In the network, node defines a place where agents may reside, while paths define the routes that agents may take when moving from one node to another. 

Rectangular node defines a node of a rectangular form. 

There are nodes of two other shapes at your hands:

Point node. Use it to draw a transit transportation node.

Polygonal node. Use it to draw an area of complex form.

You can define particular waiting points inside the node using attractors.

 To add a rectangular node

  1. Drag the Rectangular node element from the  Space Markup palette to the graphical diagram.
  2. You can resize the shape now and change its location or properties.

Properties

General

Name – The name of the node. The name is used to identify and access the node from code.

Ignore – If selected, the node is excluded from the model.

Visible on upper level – If selected, the node is also visible on the upper level where this agent lives.

Lock – If selected, the node shape is locked. Locked shapes do not react to mouse clicks - it is impossible to select them in the graphical editor until you unlock them. 

Visible – Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.

Locations layout – Here you can choose the layout inside the node: Random or Arranged.

Attractors... – Click this button to create attractors inside the area. Attractors are the places where the pedestrians will tend to get.

Appearance

Fill color – Shape's fill color. Choose No Fill, if you do not want shape to be filled.

Line color – Outline color. Choose No Color, if you do not want outline to be drawn.

Line width – Outline width.

Line style – [Enabled only if the Show in: 3D only checkbox is not selected] Outline style. Choose from the drop-down list, whether you want solid, dashed, or dotted outline to be drawn. 

Position and size

X – X-coordinate of the area's start point.

Y – Y-coordinate of the area's start point.

Z – [Enabled if Show in: 3D only option is selected] Z-coordinate of the area, in meters. The value is relative to the Z-coordinate of the area's ground.

Rotation Rotation angle of the node in the XY plane.

WidthWidth of the node (in pixels).

HeightHeight of the node (in pixels).

Advanced

Show in - Here you can choose whether you want the shape to be shown both In 2D and 3D animation, or in 2D only, or in 3D only.

Show name – If selected, the shape's name is displayed on the graphical diagram.

Functions

You can dynamically modify shape properties at model runtime using the following API.
Position

Function

Description

double getX()

Returns the X coordinate of the node (namely, the coordinate of its upper left corner).

double getY()

Returns the Y coordinate of the node (namely, the coordinate of its upper left corner).

double getZ()

Returns the Z coordinate of the node (namely, the coordinate of its upper left corner).

double getZ(double x, double y)

Returns the Z coordinate of the given point.

Parameters:
x - the X coordinate of the point.
y - the Y coordinate of the point.

void setPos(double x, double y, double z)

Sets new coordinates for the node. 

Parameters:
x - the new value of the X coordinate.
y - the new value of the Y coordinate.
z - the new value of the Z coordinate.

Point getCenter()

Returns the coordinates of the node center.

Size

Function

Description

double getWidth()

Returns the width of the node (in pixels).

double getHeight()

Returns the height of the node (in pixels).

void setSize
(double width, double height)

Sets the width and height of the node.

Parameters:
width - the new width of the node (in pixels).
height - the new height of the node (in pixels).

Rotation

Function

Description

double getRotation()

Returns the rotation of the node in radians (in the clockwise direction).

void setRotation(double rotation)

Sets the rotation of the node.

Parameter: rotation - the new value of rotation in radians (in the clockwise direction).

Visibility

Function

Description

boolean isVisible()

Returns true if the node is visible; returns false otherwise.

void setVisible(boolean v)

Sets the visibility of the node.

Parameter: v - visibility. If v is true - the node is set to be visible, if it is false - not visible.

Fill color

Function

Description

Color getFillColor()

Returns the fill color of the node, or null if the node has no fill color or has textured fill (in this case use getTexture() to get the node's texture).

Texture getFillTexture()

Returns the fill texture of the node or null if the node has no fill texture or has color fill (in this case use getFillColor() to get the node's fill color).

void setFillColor
(Color fillColor)

Sets the fill color of the node.

Parameter: fillColor - the new fill color, if null, the node is not filled.

void setFillColor
(Paint fillColor)

Sets the fill color (or Texture) of the node.

Parameter: fillColor - the new fill color, if null, the node is not filled.

Outline

Function

Description

Color getLineColor()

Returns the line color of the node, or null if node has no line color or has textured line (in this case use getLineTexture() to get the line's texture).

Texture getLineTexture()

Returns the outline texture of the node or null if node has no outline texture or has colored line (in this case use getLineColor() to get the line's color).

void setLineColor(Color lineColor)

Sets the line color of the node.

Parameter: lineColor - the new line color, if null, the node line is not drawn.

void setLineColor(Object lineColor)

Sets the line color (or Texture) of the node.

Parameter: lineColor - the new line color, if null, the node line is not drawn.

double getLineWidth()

Returns the width of the node outline. 

void setLineWidth
(double width)

Sets the width of the node outline; 0 means the thinnest possible outline.

Parameter: width - the new width of the node outline.

int getLineStyle()

Returns the style of the node outline: 

LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED 

void setLineStyle
(int style)

Sets the style of the node outline:
LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED

Line style not applied in 3D animation; the only supported line style in 3D is solid.

Parameter: style - the new style of the node outline.

Attractors

Function

Description

List<Attractor> getAttractors()

Returns a collection of attractors inside the node.

void addAttractor
(Attractor attractor)

Adds an attractor to the node.

Parameter: attractor - the attractor to be added inside the node.

Network

Function

Description

Network getNetwork()

Returns the network this markup element belongs to or null if this element is not a part of a network.

int getConnectionsCount()

Returns the number of the node's connections with other nodes.

Path getConnection(int index)

Returns the connection between this node and another node by the provided index.

Parameter: index - the index of required connection in range (0, this.getConnectionsCount() - 1).

Advanced

Function

Description

boolean contains
(double px, double py)

Returns true if the node contains the point with the given coordinates; returns false otherwise.

Parameters:
px - the x coordinate of the point relative to this node's container.
py - the y coordinate of the point relative to this node's container.

double getNearestPoint
(double px, double py, Point output)

Calculates the point in this node nearest to the given (X, Y) point and writes the result into the the output object.

Returns the square of distance to the point (in the XY-projection). All calculations are performed in the horizontal projection (z-coordinates are not used, as if all of the Z coordinates were zero).

Parameters:
px - the X coordinate of the point.
py - the Y coordinate of the point.
output - the output point to write result to. Note that output.z is left unchanged.

double getNearestPoint
(double px, double py, double pz, Point output)

Calculates the point in this node nearest to the given (X, Y, Z) point and writes the result into the the output object.

Returns the square of distance to the point.

Parameters:
px - the X coordinate of the point.
py - the Y coordinate of the point.
pz - the Z coordinate of the point.
output - the output point to write result to. Note that output.z is left unchanged.