ui.panels package

Submodules

ui.panels.diagram module

Diagram file

class ui.panels.diagram.Diagram(parent=None)

Bases: QGraphicsScene

GeoMop Layer Editor design area

Y coordinetes is negative for right map orientation. For displaying or setting is need set opposite value.

pyqtSignals:

blink interval in ms

add_graphical_object(obj)

Add the object to the graphics scene and emit appropriate update signals

blink object

Finish blink window

Start blink window

Blink timer

cursorChanged

Signal is sent when cursor position has changed.

Parameters
  • line (float) – new x coordinate

  • column (float) – new y coordinate

delete_selected()

delete selected

focusInEvent(event)

Standart focus event

grid

Surface mash

hide_grid()

hide mash

init_area

Initialization area

keyPressEvent(event)

Standart key press event

mouseMoveEvent(event)

Standart mouse event

mousePressEvent(event)

Standart mouse event

mouseReleaseEvent(self, QGraphicsSceneMouseEvent)
possChanged

Signal is sent, when zoom has changed or vissible part of scene is move. New coordinates is set in _data variable and parent view should connect to signal and change visualisation.

refresh_shp_backgrounds()

refresh updated shape files on background

regionsUpdateRequired

Shape was clicked and all regions in current topology update in region panel is required

release_data(old_diagram)

release all shapes data

release_views()

release all diagram views

remove_graphical_object(obj)

Remove the object from the graphics scene and emit appropriate update signals

select_all()

select all items

selection

selection operations

set_data()

set new shapes data

show_grid(quad, u_knots, v_knots)

Show grid of actual surface from surface panel.

show_init_area(state)

Show initialization area

update_changes(added_points, removed_points, moved_points, added_lines, removed_lines)
update_geometry()

Update geometry of shapes according to actual zoom

update_views()

update all diagram views

wheelEvent(event)

wheel event for zooming

ui.panels.layers module

CanvasWidget file

class ui.panels.layers.Layers(parent=None)

Bases: QWidget

GeoMop Layer editor layers panel

pyqtSignals:

All regions function contains history operation without label and must be placed after first history operation with label.

add_fracture(i)

Add fracture to interface

add_interface(i)

Split layer by new interface

add_layer_to_shadow(idx)

Prepend layer to the start

append_layer()

Append layer to the end

change_edited(i, type)

Change edited interface

change_interface_type(i, type)

Change interface type

change_size()

Call this function after resize layers panel. This function send signal to scroll

change_viewed(i, type)

Change viewed interface

clearDiagramSelection

Signal is sent when selection needs to be cleared to prevent topology switch issues.

editInterfaceChanged

Signal is sent when edited interface is changed.

Parameters
  • idx_old (int) – old edited diagram index

  • idx_new (int) – new edited diagram index

mouseMoveEvent(event)

standart mouse move widget event

mousePressEvent(self, QMouseEvent)
paintEvent(event=None)

Overloadet QWidget paint function

prepend_layer()

Prepend layer to the start

refreshArea

Signal is sent when arrea shoud be refreshed.

reload_layers(cfg)

Call if data file changed

remove_block(i)

Remove all block

remove_fracture(i)

Remove fracture from interface

remove_interface(i)

Remove interface

remove_layer(i)

Remove layer and add shadow block instead

rename_fracture(i)

Rename fracture

rename_layer(i)

Rename layer

set_interface_surface(i)

Set interface elevation

sizeHint()

Overloadet QWidget sizeHint function

topologyChanged

Signal is sent when current selected topology or some topology structure is changed.

viewInterfacesChanged

Signal is sent when one or more interfaces is set or unset as viwed.

Parameters

idx (int) – changed diagram index

ui.panels.regions module

class ui.panels.regions.LayerHeads(layers_geometry)

Bases: QObject

Adaptor to access layer names and to store currently selected regions and layers. TODO: refactor to the class for supplement GUI states.

add_region(name, dim, color)

Add new region according to the provided data from the current tab and select it.

property current_layer_id

Layer ID for current teb in Region Panel.

property current_topology_id
property layer_names

Return list of :return: [ (layer_id, layer_name), .. ]

property max_selected_dim

Maximal object dimension within the current selection. TODO: better check for the fracture layer.

region_changed
region_list_changed
property region_names

List of unique region names.

property regions

Regions object.

reinit_regions_map()

Update _selected_regions according to the layers.

remove_region(reg_id)

Remove the region.

select_layer(layer_id)

Select actual layer tab.

select_regions(region_dict)

Update dictionary assigning selected region id to the layer id. :param region_dict: :return:

selected_layer_changed
property selected_region

Current region of the current layer.

property selected_region_id

Region ID of the current region of the current layer.

property selected_regions

Return list of selected region IDs. :return: [ (layer_id, region_id), … ]

class ui.panels.regions.RegionLayerTab(layer_heads, i_tab, parent)

Bases: QWidget

Single Tab of the Region panel. One tab for every layer in the current topology block.

make_combo_label(region)

Region label for the combo box.

property region

Current region.

property region_color

QColor of current region. TODO: make this a property of the Region. (with optional parameter object_dim for the None region)

property region_id

Current region id.

reinit(layer_id, layer_name)
class ui.panels.regions.Regions(layer_heads, parent=None)

Bases: QToolBox

GeoMop regions panel.

Panel provides access to two sort of data: 1. Data about individual regions shared by whole geometry. 2. Data about currently selected regions and layer names for individual layers.

RegionPanel react to external changes: - selected region - current block/topology - change in available regions to select

RegionPanel initiated changes: - set regions of selection - region color -> repaint shapes

pyqtSignals:
  • regionChanged()

add_region()

Add new region to all combo and select it in current tab. Handle combo changed signal in current tab.

color_changed
property current_tab

Current Tab widget.

property regions

Regions data object.

remove_region()

Remove region if it is not assigned to any no shapes

update_tabs()

Update tabs and its contents according to layer heads adaptor. :return:

ui.panels.regions.nosignal(qt_obj)

Context manager for blocking signals inside some signal handlers. TODO: move to some common module

ui.panels.shpfiles module

Tree widget panel

class ui.panels.shpfiles.ShpFiles(data, parent=None)

Bases: QTableWidget

Widget displays the config file structure in table.

pyqtSignals:
attr_set(file_idx, attr_combo)

Shapefile dislayed attribute is changed, refresh diagram

background_changed

Signal is sent whenbackground settings was changes.

color_set(file_idx, color_button)

Shapefile color is changed, refresh diagram

context_menu(pos, file_idx, label)

Call context menu above clicked label

highlight_set(file_idx, shp_idx)

Some highlighted attribute value is changed, refresh diagram

item_removed

Signal is sent when item is deleted from background settings

reload()

Start of reload data from config.

remove(file_idx)

remove shape file context from panel

show_set(file_idx, shp_idx)

Some dislayed attribute value is changed, refresh diagram

ui.panels.surfaces module

class ui.panels.surfaces.SurfFormData

Bases: Surface

All data operations are performed here. TODO: distinguish changes that can be applied faster:

  • name - no need to recompute

  • xy_transform - just transformation of existing approximation

  • nuv, regularizace - recompute approx

compute_approximation()
get_actual_quad()
static get_unique_name(init_name, names)

# TODO: make this a general function to provide unique default name. have general machanism to this in common. Given a list of names # and given a name prefix return a first unique name. # usage: get_unique_name(name, [surf.name for surf in surfaces.surfaces])

Parameters
  • init_name

  • names

Returns

init_from_file(file)
classmethod init_from_surface(surf, idx)
save_to_layers(layers)
set_name(name)
set_name_from_file(names)
set_nuv(nuv)
set_xy_transform(xy_transform)
update_from_z_surf()
class ui.panels.surfaces.Surfaces(layers, home_dir, parent=None)

Bases: QWidget

GeoMop Layer editor surfaces panel

pyqtSignals:
  • :py:attr:`show_grid

All regions function contains history operation without label and must be placed after first history operation with label.

add_surface_from_file()

Handle wg_add_button. Open a file and add new unsaved surface into combo and current panel content.

apply()

Save changes to file and compute new elevation and error

change_surface(new_idx=None)

Event for changed surface in combo box. Called also when new item is added.

empty_forms()

Check to prevent loose of changes stored in actual in self.data.

classmethod float_convert(le_obj)
get_curr_quad()

Return quad, u_knots, v_knots for grid plot in mainwindow._show_grid.

get_surface_id()

Used to save actual surface idx. :return:

classmethod int_convert(le_obj)
nuv_changed()
refresh(layers)

Refresh after open or new file. :param layers: Layers data object :return:

reload()
rm_surface()
set_delimiter()
classmethod set_le_status(le_obj, val)
set_skip_lines()
set_tolerance()
show_grid

Signal is sent when mash shoud be show o repaint. :param bool force: if force not set, don’t call mash if already exist

xy_scale_changed()
class ui.panels.surfaces.SurfacesComboBox(parent: QWidget = None)

Bases: QComboBox

set_items(surfaces, new_idx=0, name='')
class ui.panels.surfaces.WgShowButton(tooltip, parent)

Bases: QPushButton

Toggle visibility button. signal: toggled use setChecked to set visibility use blockSignals to fix the state

nextCheckState(self)
set_icon()

Module contents