Aimsun Next Scripting
22
|
GKGeoObject is the base class for all the objects with a graphical representation. They are stored in layers (GKLayer) and these layers are in the GKGeoModel.
When creating a geo object with its new command, the graphical object will be automatically added to the geo model. When creating a geo object with GKSystem::newObject, it will not be added to the geomodel automatically. It will not be visible util it is added. Add it using the GKGeoModel::add.
Objects are selected by model, what means that a selected object is selected in all the views in where it appears (2D and/or 3D).
An object can have a mark (or more than one) using GKGeoObject::setMark to mark it with a special color and/or shape (depending of the object).
An object can be grouped with other ones in a group (GKGeoObjectGroup). In this case the group and not the individual objects will be manipulated.
An object can have object on top of it (GKGeoObject::getTopObjects). These objects bellows to this bottom object and are translated, rotated and deleted with it.
GKGeoModel::GKGeoModel | ( | GKModel & | ) |
GKGeoModel::~GKGeoModel | ( | ) |
void GKGeoModel::add | ( | GKLayer * | layer, |
GKGeoObject * | obj, | ||
bool | lookForObjectsAlreadyInlayers = true |
||
) |
Adds an object to the geo model in a specific layer (the layer cannot be None).
void GKGeoModel::addBookmark | ( | GKViewBookmark * | abookmark | ) |
Add a bookmark to the geo model, the pointer is adopted.
void GKGeoModel::addMode | ( | GKViewMode * | ) |
Add a new mode: the mode is adopted.
void GKGeoModel::addStyle | ( | GKViewModeStyle * | ) |
Adds a new style: the style is adopted.
bool GKGeoModel::anyStyleUsesThisColumn | ( | const GKColumn * | ) | const |
A style using this column is present ?
void GKGeoModel::changeLayer | ( | GKLayer * | , |
GKLayer * | , | ||
GKGeoObject * | |||
) |
Changes the layer of an object.
void GKGeoModel::deleteBookmarks | ( | ) |
Removes and deletes all the bookmarks from the model.
void GKGeoModel::expandWorld | ( | const GKBBox & | , |
const GKPoint & | = GKPoint::zero |
||
) |
Expand the world.
void GKGeoModel::expandWorld | ( | const GKPoint & | , |
const GKPoint & | = GKPoint::zero |
||
) |
Expand the world.
GKGeoObject * GKGeoModel::findClosestObject | ( | const GKPoint & | p, |
GKType * | type = nullptr , |
||
double | distance = -1.0 |
||
) |
Returns the closest object to a point. If a type is specified, only objects of that type will be considered.
QVector< GKGeoObject * > GKGeoModel::findClosestObjects | ( | const GKPoint & | p, |
double | maxDistance, | ||
GKType * | type = nullptr |
||
) | const |
Returns the closest objects to a point within the maxDistance range. Maximum Distance must be >= 0. If a type is specified, only objects of that type will be considered.
GKLayer * GKGeoModel::findLayer | ( | const QString & | ) |
find a layer using its internal name (that is unique)
GKViewMode * GKGeoModel::findMode | ( | const QString & | iname, |
bool | automatic | ||
) |
Find a mode by its internal name. If automatic is true only looks for automatic modes, if false for user-defined modes.
GKViewModeStyle * GKGeoModel::findStyle | ( | const QString & | ) |
Finds a style by its internal name.
GKLayer * GKGeoModel::getActiveLayer | ( | bool | getAnything = false | ) |
Return the current active layer (the layer that has the focus in the GGui) or None if no layer is active. If getAnything is true it will return a layer (any) when no layer is active.
GKBBox GKGeoModel::getBBox | ( | ) | const |
Returns the bbox (slow: the bbox is calculated)
const QVector< GKViewBookmark * > & GKGeoModel::getBookmarks | ( | ) | const |
Returns all the bookmarks.
GKCoordinateTranslator & GKGeoModel::getCoordinateTranslator | ( | ) |
Coordinate translation from/to degrees and meters.
QString GKGeoModel::getDefaultCS | ( | ) | const |
The coordinate system for this model. The default value is EPSG:32601 that corresponds to WGS 84 / UTM zone 1N.
const QSet< GKLayer * > & GKGeoModel::getLayers | ( | ) | const |
Returns all the layers in this geomodel
QPair< uint, uint > GKGeoModel::getNetworkNodesInfo | ( | ) | const |
Returns the total number of nodes in the network. The first part of the pair is the number of nodes, the second part is the number of nodes that are evaluated as intersections.
QPair< double, double > GKGeoModel::getSectionsLength | ( | GKPolygon * | polygon = nullptr | ) | const |
Returns the sum of lengths for all sections in the whole network (in m) or for the sections located inside the polygon. The first part of the pair has the sum of lengths (in 3D) by section, the second part of the pair has the sum of lengths by lane including side lanes (in 2D).
GKGeoSelection & GKGeoModel::getSelection | ( | ) |
A list of selected objects (common for all the views)
double GKGeoModel::getTotalNetworkLength | ( | ) | const |
Returns the total network length (in m). It is the sum of all sections and all turns.
const GKBBox & GKGeoModel::getWorld | ( | ) | const |
Returns the current world size (min and max coordinates)
void GKGeoModel::inverseSelection | ( | ) |
Inverse the selection.
uint GKGeoModel::nbObjects | ( | ) | const |
Returns the number of graphical objects in the geo model.
void GKGeoModel::recalculateWorld | ( | const GKPoint & | = GKPoint::zero | ) |
Recalculates the world size based in the current Geo-Model contents.
bool GKGeoModel::remove | ( | GKLayer * | , |
GKGeoObject * | |||
) |
Removes an object from the layer (and the geo model). The object is not deleted, just removed from the drawing list. Returns true if the object was in the geo model (and, thus, removed from it).
void GKGeoModel::removeAllObjects | ( | GKType * | ) |
Remove all objects from a type for this geomodel. The object is still alive in the model (not deleted, just removed from the drawing list).
void GKGeoModel::removeBookmark | ( | GKViewBookmark * | abookmark | ) |
Removes the bookmark from the model. Does not delete it.
void GKGeoModel::removeMode | ( | GKViewMode * | ) |
Removes a mode. The object is NOT deleted.
void GKGeoModel::removeStyle | ( | GKViewModeStyle * | ) |
Removes a style. The object is NOT deleted.
void GKGeoModel::selectAll | ( | ) |
Select all the objects in this geomodel.
void GKGeoModel::setActiveLayer | ( | GKLayer * | alayer | ) |
Sets the active layer, the previous active layer will be deactivated.
void GKGeoModel::setDefaultCS | ( | QString | cs | ) |
The coordinate system for this model. The default value is EPSG:32601 that corresponds to WGS 84 / UTM zone 1N.
void GKGeoModel::setExpandOnly | ( | bool | ) |
If true the world will be expanded when an object is inserted. If false (the default) the world will be set with the first object insertion and expanded afterwards.
void GKGeoModel::setLayerLevel | ( | GKLayer * | , |
int | |||
) |
Change the layer level. The drawing order will be modified.
void GKGeoModel::setWorld | ( | const GKBBox & | ) |
Set the world extends...