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.Synopsis¶
Methods¶
def
__init__()def
centerLayer()def
centerWorld()def
copySnapshot()def
findLayer()def
getScreenWidth()def
getViewArea()def
getWorld()def
getZoom()def
isGrayMode()def
isMapMode()def
isMasterClock()def
isMasterView()def
minBBox()def
pan()def
pixel2Unit()def
saveSnapshot()def
setGrayMode()def
setMapMode()def
setMasterClock()def
setMasterView()def
setWorld()def
unit2Pixel()def
wholeArea()def
wholeWorld()def
zoom()
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=""])¶
Returns true if the dynamic labels are displayed by this view
- centerLayer(layer)¶
- Parameters:
layer –
GKLayer
Pan the view to the center of this layer
- centerWorld()¶
Centers the world (pan) in the current view
- findClosestObject(p[, type=NULL[, maxDistance=100[, objDistance=NULL]]])¶
- Parameters:
- Return type:
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:
modelLayer –
GKLayerrecursive – bool
- Return type:
Find a layer using its
GKLayer(its model).Current clipping world area visible in the window (in m) takes in count if a rotation is pressent
Returns the screen height in pixels (from QPaintDeviceMetrics::height )
Returns the screen width in pixels (from QPaintDeviceMetrics::width )
Current world area visible in the window (in m)
World coordinates, from and to (in m)
Current zoom factor (in m) 1:XX
Returns whether Clocks are Synchronized with the master view
Returns whether it is a master view?
Minimum BBox for this view…
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.
Makes point the center of the visible area
- pixel2Unit(pixel_size[, direction=G2DView.eDPIToUse.eHorizontalDPI])¶
Converts a size from device coordinates to world coordinates
- saveSnapshot(fileName, format, area[, width=-1[, height=-1[, includeLogos=true]]])¶
- setAttributeForDynamicLabel(object, newAttribute)¶
- Parameters:
object –
GKGeoObjectnewAttribute –
GKColumn
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
- setMasterView(value)¶
- Parameters:
value – bool
Sets the view as a master view?
See also
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])¶
Converts a size from world coordinates to device coordinates
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.
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
panPoint –
GKPointinvalidateView – 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)