PyANGKernel.GKGeoObject¶
- class GKGeoObject¶
Base class for all the graphical objects (objects with a representation in 2D and/or 3D Views)
Details
GKGeoObjectis the base class for all the objects with a graphical representation. They are stored in layers (GKLayer) and these layers are in theGKGeoModel.When creating a geo object with the
newObject, it will not be added to the geomodel. Until then it will not be visible. Add it using theadd.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
setMarkto 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 (
getTopObjects). These objects belong to this bottom object and are translated, rotated and deleted with it.See also
Inherited by:
GKSectionObject,GKVMS,GKPedestrianCrossing,GKMetering,GKDetector,GKDetectorStation,GKBusStop,GKRoute,GKSubPath,GKPublicLine,GKODRoute,GKPolyline,GKPolygon,GKSuperNode,GKSimulationArea,GKProblemNet,GKPolygonWithHoles,GKPTZone,GKPTStation,GKGroup,GKExtrudedPolygon,GKCrosswalkArea,GKCentroid,GKImage3D,GKExtrudedPolyline,GKBezierCurve,GKTurning,GKSuperNodeTrajectory,GKSection,GKObjectConnection,GKCenConnection,GKLayer,GKDPoint,GKText,GKNode,GKImage,GKGeoImage,GKController,GKCircleSynopsis¶
Methods¶
def
__init__()def
addTopObject()def
anyConnection()def
getConnections()def
getLayer()def
getMark()def
getMarks()def
getTopObjects()def
isLabeled()def
setLabeled()
Virtual methods¶
def
addConnection()def
addMark()def
canBeGrouped()def
getAltitude()def
getBBox()def
getCutCmd()def
isSelected()def
rotate()def
scale()def
setAltitude()def
setLayer()def
setMark()def
setSelected()def
translate()def
unmark()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- class GKGeoContainer¶
- __init__()¶
- __init__(arg__1)
- Parameters:
arg__1 –
GKGeoObject
- acceptConnection(object)¶
- Parameters:
object –
GKGeoObject- Return type:
Returns true if a connection to this object will be accepted. The current implementation will return true if no other connection to “object” exists (so no repeated connections are allowed).
- addConnection(connection)¶
- Parameters:
connection –
GKObjectConnection
Adds a connection. The connection object is adopted
- addMark(newMark)¶
- Parameters:
newMark – int
Add a new mark to the object keeping the rest.
- addTopObject(atopObject)¶
- Parameters:
atopObject –
GKGeoObject
Over objects: An object can have other objects always over it as for instance sections have always detectors over it. If an object is over another, it will be drawn immediately after the “bottom” object because the
GKGeoModel(and the associated Views) will take care of this requirement.This method will call atopObject->setBottomObject( this ) (that is, it will set the bottom object of the top object).
- anyConnection(target)¶
- Parameters:
target –
GKGeoObject- Return type:
Returns true if there are any connection between this object and target
- anyConnection(target, connectionType)
- Parameters:
target –
GKGeoObjectconnectionType –
ConnectionType
- Return type:
Returns true if there are any connection of the specified connectionType between this object and target.
Can this object be grouped? Usually true unless it is already grouped.
- changeConnectionObject(oldObject, newObject[, connectionType=GK.eConnectionUndefined])¶
- Parameters:
oldObject –
GKGeoObjectnewObject –
GKGeoObjectconnectionType –
ConnectionType
Replace “oldObject” by “newObject” in all the connections that are of the specified connectionType. * If connectionType is
eConnectionUndefined, all matching connections will be affected.- containsTopObject(atopObject)¶
- Parameters:
atopObject –
GKGeoObject- Return type:
Returns true if this objects is in the top objects list.
- doGetContainedWay(myBBox, points, bboxPoints)¶
- Parameters:
- Return type:
If this object is totally inside the polygon (points) it returns
eTotally; if this object is totally outside the polygon it returnseNothing; if this object is partially inside and partially outside it returnsePartially. The default implementation does this: * if all the corners of the object bounding box are inside points,eTotally* if any corner of the object bounding box is inside points,ePartially* if any corner of bboxPoints is inside the object bounding box,ePartially* elseeNothingGet the altitude of this object (the minimum Z among all the possible Z of the object)
Gets the bbox of this object. The default implementation returns an undefined
GKBBox.- getBottomObject()¶
- Return type:
Any “top” object has one (and only one) object that is “under” it (the bottom object)
- getConnections()¶
- Return type:
.QSetGKObjectConnection
Returns all the connections to this object
- getConnections(targetType)
- Parameters:
targetType –
GKType- Return type:
.QSetGKObjectConnection
Returns all the connections between this object and objects of the provided type
- getConnections(target)
- Parameters:
target –
GKGeoObject- Return type:
.QSetGKObjectConnection
Returns all the connections between this object and target
- getConnections(target, connectionType)
- Parameters:
target –
GKGeoObjectconnectionType –
ConnectionType
- Return type:
.QSetGKObjectConnection
Returns all the connections between this object and target with a specific connectionType between this object and target.
- getContainedWay(points, bboxPoints)¶
- Parameters:
- Return type:
Deprecated function, use
doGetContainedWay. The current implementation callsdoGetContainedWay(getBBox(), points, bboxPoints).- getCutCmd(from, to, keepConnection)¶
- Parameters:
- Return type:
Returns a command for a cut operation. Note that not all the geo objects can be cut, so they will return NULL. An object can return NULL also if it cannot be cut due to some state (is locked for example). This functions receives the segment uses to cut the object.
Get the layer in where this object is…
Is the object marked?… 0 means that the object is not marked, any value greater than 0 means that is marked.
An object marked appears in a different color Used, for example, to show what sections pertains to a route. A Mark is a integer, allowing to mark different objects with different marks and show all togethers (for example mark=1 is they are in a route, mark=0 is they are not, mark=2 is they are in two routes…)
This method returns the first (if any) mark on the object.
- getMark(pos)
- Parameters:
pos – int
- Return type:
When an objects has more than one mark, return the mark at “pos” (from 0 to N-1, where N is the number of marks). If no mark is available at that position (or at all) it will return 0.
- getMarks()¶
- Return type:
QList
Gets all the marks of the object. A NULL vector means no mark.
Returns the number of marks in the object.
- getTopObjects()¶
- Return type:
QSet
Returns all the top objects. Can be NULL, means no top objects
Is this object labeled? See
setLabeledIs the object selected?… Note that is selected by model and not by view. This means that a selected object will appear selected in all the views.
- objectConnectionType([object=None])¶
- Parameters:
object –
GKGeoObject- Return type:
Returns the connection type between this object and the specified one. If the specified object is NULL, all connections will be considered.
- removeAllConnections(deleteObjects)¶
- Parameters:
deleteObjects –
ObjectDeletionBehaviour
Removes all the connections.
- removeConnection(connection[, deleteObject=GK.eDoNotDeleteObjects])¶
- Parameters:
connection –
GKObjectConnectiondeleteObject –
ObjectDeletionBehaviour
Removes a connection. The connection object is NOT deleted
- removeTopObject(atopObject)¶
- Parameters:
atopObject –
GKGeoObject- Return type:
Removes atopobject from the list of top objects. The object is not deleted and the bottom object at atopobject is not changed (it will keep a pointer to “this”).
Returns true if the object was found and removed and false (object not found) otherwise.
Rotates the object an angle in radians around the center of rotation
Scales an object in the X, Y and Z
- setAltitude(value)¶
- Parameters:
value – float
Changes the altitude of this object setting the minimum Z to “value” (and moving the rest of the points to z = value -
getAltitude())- setLabeled(value)¶
- Parameters:
value – bool
Sets this object as labeled: a label will appear over it. By default the label contains the ID and name of the object but it can be customized using the geo model preferences. This customization is per type.
The drawer will get the specific label from the G2DDrawer::getObjectLabel method.
See also
Set the layer of this object. Note tha t this operation will NOT change the object from a layer to another. In order to do so use functions in the
GKGeoModelclass. TheGKGeoModelclass will take care of removing the object from one layer and inserting into another.- setMark(newMark)¶
- Parameters:
newMark – int
Mark an object using the first mark. See
getMarkfor details.If newMark is 0 then the object will be unmarked.
- setSelected(newState)¶
- Parameters:
newState – bool
Is the object selected?… Note that is selected by model and not by view. This means that a selected object will appear selected in all the view.
See also
Translates an object using a delta
- translateFromCS(arg__1)¶
- Parameters:
arg__1 – str
Translates an object from a Coordinate System
- unmark()¶
Removes any mark in the object