PyANGKernel.GKPolygon

class GKPolygon

A Polygon class. * Defined by a closed polyline, composed as a collection of consecutive * straight line segments.

Inheritance diagram of PyANGKernel.GKPolygon

Inherited by: GKSuperNode, GKSimulationArea, GKProblemNet, GKPolygonWithHoles, GKPTZone, GKPTStation, GKGroup, GKExtrudedPolygon, GKCrosswalkArea, GKCentroid

Synopsis

Methods

Virtual methods

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 GKObjectsClassification

See classifyObjects .

__init__()
__init__(l)
Parameters:

lGKPoints

__init__(arg__1)
Parameters:

arg__1GKPolygon

classifyObjects(scenario)
Parameters:

scenarioGKGenericScenario

Return type:

.QSetGKGeoObject

Alias to classifyObjects( eAll ).

Uses the scenario id for geometry configuration settings.

classifyObjects(scenario, objsToClassify[, layer=None])
Parameters:
Return type:

.QSetGKGeoObject

Returns the objects that are inside the polygon (refer to description of “inside” below). If the objsToClassify is eAll , all the graphical objects will be taken into account. Meanwhile, if it is eOnlyNodesAndSections , only sections and nodes will be classified. If a layer is specified (different than NULL) then only the objects in that layer will be returned. The scenario defines the geometry if it’s not NULL.

A node is inside if the center line of any of its turns is totally inside the polygon. A section is inside if its entrance or exit point are inside the polygon or if any of its nodes is inside. So, it might happen that sections or nodes that are outside the polygon are considered “inside” because its turns are.

Uses the scenario id for geometry configuration settings.

Note that this behavior is different from classifyObjectsInside

classifyObjectsInside(scenario[, layer=None])
Parameters:
Return type:

.QSetGKGeoObject

Returns the objects that are inside the polygon (refer to description of “inside” below ). If a layer is specified ( different than NULL) then only the objects in that layer will be returned

Objects must be totally inside the polygon to be considered in. Note that this behavior is different from classifyObjects and classifyObjectsPartiallyInside , which will both return more objects than the ones entirely inside.

classifyObjectsPartiallyInside(scenario[, layer=None])
Parameters:
Return type:

.QSetGKGeoObject

Returns the objects that are inside the polygon (refer to description of “inside” below ). If a layer is specified ( different than NULL) then only the objects in that layer will be returned

Objects must be either partially or totally inside the polygon to be considered in. Note that this behavior is different from classifyObjects , which may return more objects, and from classifyObjectsInside which may return less objects.

Uses the scenario id for geometry configuration settings.

ensureClosed()

If the polygon is not closed, add a point equal to the first at the end

getBottomTexture()
Return type:

GKTextureApplied

Gets the bottom face’s texture name

getBrushColor()
Return type:

QColor

Gets the brush color to draw the polygon

getBrushStyle()
Return type:

BrushStyle

Gets the brush style to draw the polygon

getTopTexture()
Return type:

GKTextureApplied

Gets the top face’s texture name

isClockWise()
Return type:

bool

Returns true if the points are in clockwise order

isClosed()
Return type:

bool

Returns true if the first and last point are equal. Needs at least 3 points

isFilled()
Return type:

bool

Returns true if the polygon is filled.

isNodeInside(node)
Parameters:

nodeGKNode

Return type:

bool

Classifies a node as in OUT (do not use) or IN (use) in a polygon. A node is IN if any of its turns is totally inside the polygon.

returns true if the node is IN and false if it’s OUT

isSectionEntranceGate(section)
Parameters:

sectionGKSection

Return type:

bool

Returns true if the section is classified as IN and its origin node is NULL or classified as OUT

isSectionExitGate(section)
Parameters:

sectionGKSection

Return type:

bool

Returns true if the section is classified as IN and its destination node is NULL or classified as OUT

reverseOrder()

Reverses the order of the points. Changes order clockwise <-> counterclockwise

setBottomTexture(textureName, horizontalReps, verticalReps)
Parameters:
  • textureName – str

  • horizontalReps – int

  • verticalReps – int

Sets the bottom face’s texture name. The bottom face is the one looking at the negative z axis.

setBrushColor(color)
Parameters:

colorQColor

Sets the brush color to draw the polygon

setBrushStyle(astyle)
Parameters:

astyleBrushStyle

Sets the brush style to draw the polygon

setTopTexture(textureName, horizontalReps, verticalReps)
Parameters:
  • textureName – str

  • horizontalReps – int

  • verticalReps – int

Sets the top face’s texture name. The top face is the one looking at the positive z axis.