PyANGGui.G2DView

class G2DView

A view for 2D objects.

Details

A view for 2D objects that can be integrated (but is not mandatory) in a G2DViewWindow .

Inheritance diagram of PyANGGui.G2DView

Synopsis

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 eDPIToUse

Which DPI to use for world to device transformations

PyANGGui.G2DView.gcSimpleDrawZoomFactor
__init__(agui, amodel, parent[, caption=""])
Parameters:
areDynamicLabelsVisible()
Return type:

bool

Returns true if the dynamic labels are displayed by this view

centerLayer(layer)
Parameters:

layerGKLayer

Pan the view to the center of this layer

centerWorld()

Centers the world (pan) in the current view

copySnapshot([width=-1[, height=-1]])
Parameters:
  • width – int

  • height – int

Return type:

bool

findClosestObject(p[, type=NULL[, maxDistance=100[, objDistance=NULL]]])
Parameters:
  • pGKPoint

  • typeGKType

  • maxDistance – float

  • objDistancedouble

Return type:

GKGeoObject

Returns the closest object to a point. If a type is specified, only objects of that type will be considered. You can set a maximum distance (in meters) to scan and a variable to get the distance to the returned object

findLayer(modelLayer[, recursive=true])
Parameters:
  • modelLayerGKLayer

  • recursive – bool

Return type:

G2DViewLayer

Find a layer using its GKLayer (its model).

getClippingViewArea()
Return type:

GKBBox

Current clipping world area visible in the window (in m) takes in count if a rotation is pressent

getScreenHeight()
Return type:

int

Returns the screen height in pixels (from QPaintDeviceMetrics::height )

getScreenWidth()
Return type:

int

Returns the screen width in pixels (from QPaintDeviceMetrics::width )

getViewArea()
Return type:

GKBBox

Current world area visible in the window (in m)

getWorld()
Return type:

GKBBox

World coordinates, from and to (in m)

getZoom()
Return type:

float

Current zoom factor (in m) 1:XX

isGrayMode()
Return type:

bool

isMapMode()
Return type:

bool

isMasterClock()
Return type:

bool

Returns whether Clocks are Synchronized with the master view

isMasterView()
Return type:

bool

Returns whether it is a master view?

minBBox()
Return type:

GKBBox

Minimum BBox for this view…

moveSelectionToLocation(point)
Parameters:

pointGKPoint

Translates the current selection making the center of the selection BBOX coincide with the input location.

moveSelectionToViewCenter()

Translates the current selection making the center of the selection BBOX the same as the center of the current view area.

pan(point[, invalidateView=true])
Parameters:
  • pointGKPoint

  • invalidateView – bool

Makes point the center of the visible area

pixel2Unit(pixel_size[, direction=G2DView.eDPIToUse.eHorizontalDPI])
Parameters:
  • pixel_size – float

  • directioneDPIToUse

Return type:

float

Converts a size from device coordinates to world coordinates

saveSnapshot(fileName, format, area[, width=-1[, height=-1[, includeLogos=true]]])
Parameters:
  • fileName – str

  • format – str

  • areaGKBBox

  • width – int

  • height – int

  • includeLogos – bool

Return type:

bool

setAttributeForDynamicLabel(object, newAttribute)
Parameters:

Modifies the attribute of a dynamic label of an object. Requirements: A dynamic label must already exist for the object. It is recommended that only one dynamic label exists as all the existing one will change to new attribute.

setDynamicLabelsVisible([set=true])
Parameters:

set – bool

Toggles dynamic labels visibility status

setGrayMode(value)
Parameters:

value – bool

setMapMode(value)
Parameters:

value – bool

setMasterClock(value)
Parameters:

value – bool

Sets the clock to be Synchronized with the master view

See also

isMasterClock()

setMasterView(value)
Parameters:

value – bool

Sets the view as a master view?

See also

isMasterView()

setWorld(worldRect)
Parameters:

worldRectGKBBox

Set the maximum and minimum coordinates for this view. Done by view when creating the drawers from the geo model. It is also called by the slot G2DView::worldResized when the world is resized because a new object has been add.

unit2Pixel(unit_size[, direction=G2DView.eDPIToUse.eHorizontalDPI])
Parameters:
  • unit_size – float

  • directioneDPIToUse

Return type:

float

Converts a size from world coordinates to device coordinates

wholeArea(area)
Parameters:

areaGKBBox

Centers the area in the view and changes the zoom to ensure its complete visibility.

wholeWorld()

Centers the world in the view and changes the zoom to ensure its complete visibility.

wholeWorldFiltered()

Centers the filtered area in the view and changes the zoom to ensure its complete visibility.

zoom(area)
Parameters:

areaGKBBox

Changes the current drawing scale and pan so that the center of “area” is the center of the view and “area” is totally visible and, if possible, the current view shows only the “area”.

zoom(newZoom[, invalidateView=true])
Parameters:
  • newZoom – float

  • invalidateView – bool

Changes the current drawing scale. The point in the center of the visible area will remain the center after the operation.

zoom(newZoom, panPoint[, invalidateView=true])
Parameters:
  • newZoom – float

  • panPointGKPoint

  • invalidateView – bool

Changes the current drawing scale. The point panPoint will keep its XY coordinates in device space (that is, it will be in the same relative location)