Aimsun Next Scripting: GKGeoModel Class Reference
Aimsun Next Scripting  22
Public Member Functions | List of all members
GKGeoModel Class Reference

Public Member Functions

 GKGeoModel (GKModel &)
 
 ~GKGeoModel ()
 
GKGeoSelectiongetSelection ()
 
void selectAll ()
 
void inverseSelection ()
 
GKLayergetActiveLayer (bool getAnything=false)
 
void setActiveLayer (GKLayer *alayer)
 
void setDefaultCS (QString cs)
 
QString getDefaultCS () const
 
void addStyle (GKViewModeStyle *)
 
void removeStyle (GKViewModeStyle *)
 
bool anyStyleUsesThisColumn (const GKColumn *) const
 
GKViewModeStylefindStyle (const QString &)
 
void addMode (GKViewMode *)
 
void removeMode (GKViewMode *)
 
GKViewModefindMode (const QString &iname, bool automatic)
 
const QSet< GKLayer * > & getLayers () const
 
void setWorld (const GKBBox &)
 
void expandWorld (const GKBBox &, const GKPoint &=GKPoint::zero)
 
void expandWorld (const GKPoint &, const GKPoint &=GKPoint::zero)
 
void recalculateWorld (const GKPoint &=GKPoint::zero)
 
void setExpandOnly (bool)
 
const GKBBoxgetWorld () const
 
GKBBox getBBox () const
 
GKLayerfindLayer (const QString &)
 
uint nbObjects () const
 
void add (GKLayer *layer, GKGeoObject *obj, bool lookForObjectsAlreadyInlayers=true)
 
bool remove (GKLayer *, GKGeoObject *)
 
void changeLayer (GKLayer *, GKLayer *, GKGeoObject *)
 
void removeAllObjects (GKType *)
 
void setLayerLevel (GKLayer *, int)
 
void addBookmark (GKViewBookmark *abookmark)
 
void removeBookmark (GKViewBookmark *abookmark)
 
const QVector< GKViewBookmark * > & getBookmarks () const
 
void deleteBookmarks ()
 
GKGeoObjectfindClosestObject (const GKPoint &p, GKType *type=nullptr, double distance=-1.0)
 
QVector< GKGeoObject * > findClosestObjects (const GKPoint &p, double maxDistance, GKType *type=nullptr) const
 
QPair< double, double > getSectionsLength (GKPolygon *polygon=nullptr) const
 
double getTotalNetworkLength () const
 
QPair< uint, uint > getNetworkNodesInfo () const
 
GKCoordinateTranslatorgetCoordinateTranslator ()
 

Detailed Description

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.

See also
GKGeoModel, GKLayer

Constructor & Destructor Documentation

◆ GKGeoModel()

GKGeoModel::GKGeoModel ( GKModel )

◆ ~GKGeoModel()

GKGeoModel::~GKGeoModel ( )

Member Function Documentation

◆ add()

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).

◆ addBookmark()

void GKGeoModel::addBookmark ( GKViewBookmark abookmark)

Add a bookmark to the geo model, the pointer is adopted.

◆ addMode()

void GKGeoModel::addMode ( GKViewMode )

Add a new mode: the mode is adopted.

◆ addStyle()

void GKGeoModel::addStyle ( GKViewModeStyle )

Adds a new style: the style is adopted.

◆ anyStyleUsesThisColumn()

bool GKGeoModel::anyStyleUsesThisColumn ( const GKColumn ) const

A style using this column is present ?

◆ changeLayer()

void GKGeoModel::changeLayer ( GKLayer ,
GKLayer ,
GKGeoObject  
)

Changes the layer of an object.

◆ deleteBookmarks()

void GKGeoModel::deleteBookmarks ( )

Removes and deletes all the bookmarks from the model.

◆ expandWorld() [1/2]

void GKGeoModel::expandWorld ( const GKBBox ,
const GKPoint = GKPoint::zero 
)

Expand the world.

◆ expandWorld() [2/2]

void GKGeoModel::expandWorld ( const GKPoint ,
const GKPoint = GKPoint::zero 
)

Expand the world.

◆ findClosestObject()

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.

◆ findClosestObjects()

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.

◆ findLayer()

GKLayer * GKGeoModel::findLayer ( const QString &  )

find a layer using its internal name (that is unique)

◆ findMode()

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.

◆ findStyle()

GKViewModeStyle * GKGeoModel::findStyle ( const QString &  )

Finds a style by its internal name.

◆ getActiveLayer()

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.

◆ getBBox()

GKBBox GKGeoModel::getBBox ( ) const

Returns the bbox (slow: the bbox is calculated)

◆ getBookmarks()

const QVector< GKViewBookmark * > & GKGeoModel::getBookmarks ( ) const

Returns all the bookmarks.

◆ getCoordinateTranslator()

GKCoordinateTranslator & GKGeoModel::getCoordinateTranslator ( )

Coordinate translation from/to degrees and meters.

◆ getDefaultCS()

QString GKGeoModel::getDefaultCS ( ) const

The coordinate system for this model. The default value is EPSG:32601 that corresponds to WGS 84 / UTM zone 1N.

◆ getLayers()

const QSet< GKLayer * > & GKGeoModel::getLayers ( ) const

Returns all the layers in this geomodel

◆ getNetworkNodesInfo()

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.

◆ getSectionsLength()

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).

◆ getSelection()

GKGeoSelection & GKGeoModel::getSelection ( )

A list of selected objects (common for all the views)

◆ getTotalNetworkLength()

double GKGeoModel::getTotalNetworkLength ( ) const

Returns the total network length (in m). It is the sum of all sections and all turns.

◆ getWorld()

const GKBBox & GKGeoModel::getWorld ( ) const

Returns the current world size (min and max coordinates)

◆ inverseSelection()

void GKGeoModel::inverseSelection ( )

Inverse the selection.

◆ nbObjects()

uint GKGeoModel::nbObjects ( ) const

Returns the number of graphical objects in the geo model.

◆ recalculateWorld()

void GKGeoModel::recalculateWorld ( const GKPoint = GKPoint::zero)

Recalculates the world size based in the current Geo-Model contents.

◆ remove()

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).

◆ removeAllObjects()

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).

◆ removeBookmark()

void GKGeoModel::removeBookmark ( GKViewBookmark abookmark)

Removes the bookmark from the model. Does not delete it.

◆ removeMode()

void GKGeoModel::removeMode ( GKViewMode )

Removes a mode. The object is NOT deleted.

◆ removeStyle()

void GKGeoModel::removeStyle ( GKViewModeStyle )

Removes a style. The object is NOT deleted.

◆ selectAll()

void GKGeoModel::selectAll ( )

Select all the objects in this geomodel.

◆ setActiveLayer()

void GKGeoModel::setActiveLayer ( GKLayer alayer)

Sets the active layer, the previous active layer will be deactivated.

◆ setDefaultCS()

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.

◆ setExpandOnly()

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.

◆ setLayerLevel()

void GKGeoModel::setLayerLevel ( GKLayer ,
int   
)

Change the layer level. The drawing order will be modified.

◆ setWorld()

void GKGeoModel::setWorld ( const GKBBox )

Set the world extends...

© Aimsun SLU
Aimsun ®