ui.data package¶
Submodules¶
ui.data.diagram_structures module¶
- class ui.data.diagram_structures.Area¶
Bases:
object
Initialization area
- deserialize(points)¶
Set inicialization arrea from polygon coordinates
- gtpolygon¶
displaing polygon
- serialize(points)¶
Return inicialization arrea in polygon coordinates
- set_area(points)¶
Set rectangular arrea containing given points.
- ymax¶
boundary rect
- class ui.data.diagram_structures.Diagram(topology_idx, global_history)¶
Bases:
object
Layer diagram
Use only class functions for adding new shapes. This function ensure folloving requirements. New class function must ensure this requirements too. requirements:
All points are unique
All points contains used lines
Point is griater if is right or x coordinate is equal and point is below
Line.p1<line.p2
- add_file(file)¶
Add new shapefile
- add_line(p, x, y, label='Add line', no_history=False)¶
Add line from point p to [x,y]
- add_new_point_to_line(line, x, y, label='Add new point to line')¶
Add new point to line and split it
- add_point(x, y, label='Add point', id=None, not_history=False)¶
Add point to canvas
- add_point_id(x, y, input_id)¶
Add point to canvas and return index
- add_point_to_line(line, point, label='Add point to line')¶
Add point to line and split it. Return new line and array of lines that should be removed. This lines is released from data, but object is existed, and should be relesed after discarding graphic object.
- add_polygon(lines, label=None, not_history=True, copy=None)¶
Add polygon to list
- classmethod add_region(color, name, reg_id, dim, step, boundary=False, not_used=False)¶
Add region
- classmethod add_shapes_to_region(is_fracture, layer_id, layer_name, topology_idx, regions)¶
Add shape to region
- area = <ui.data.diagram_structures.Area object>¶
diagram area
- property bpen¶
Zoom class intermediary
- property brush¶
Zoom class intermediary
- property brush_selected¶
Zoom class intermediary
- dcopy()¶
My deep copy implementation
- del_polygon(polygon, label=None, not_history=True)¶
Remove polygon from list
- delete_line(l, label='Delete line', not_history=False)¶
remove set line from lines end points
- delete_point(p, label='Delete point', not_history=False)¶
- deleted_polygons¶
list of polygons that should be remove from graphic object
- find_line(p1_id, p2_id)¶
Find line according to points index
- find_polygon(line_idxs)¶
Try find polygon accoding to lines indexes
- first_shp_object()¶
return if is only one shp object in diagram
- classmethod fix_topologies(diagrams)¶
check and fix topologies ordering
- get_area_poly(layers, diagram_id)¶
Return init area as squads intersection
- get_area_rect(layers, diagram_id)¶
- get_diagram_all_rect(rect, layers, diagram_id)¶
Return init area as squads intersection
- get_line_by_id(id)¶
return line or None if not exist
- classmethod get_owner_diagram(layer_id)¶
Find owner diagram for set layer
- get_point_by_de_id(id)¶
return point or None if not exist
- get_point_by_id(id)¶
return point or None if not exist
- static get_point_on_line(line, px, py)¶
Compute point on line
- get_polygon_by_id(id)¶
return line or None if not exist
- get_polygon_lines(id)¶
Return polygon lines ndexes
- classmethod get_shapes_from_region(is_fracture, layer_id)¶
Get shapes from region
- import_decomposition(decomposition)¶
Save decomposition and reload lines and polygons
- join()¶
Add diagram to topologies
- join_line(p1, p2, label=None, id=None, not_history=False, copy=None)¶
Add line from point p1 to p2
- join_line_import(p1_id, p2_id, segment)¶
Import line from point p1 to p2
- join_line_intersection(p1, p2, label=None)¶
As Join line, but try add lines created by intersection return added_points, moved_points, added_lines
- lines¶
list of lines
- static make_tmp_line(p1x, p1y, p2x, p2y)¶
Make temporrary line
- map_id = {}¶
uid, id map
- merge_point(point, atached_point, label='Merge Points')¶
Merge two points. Atached_point will be remove from data and shoud be released after discarding graphic object. Return array of lines that should be removed. This lines is released from data, but object is existed, and should be relesed after discarding graphic object.
- classmethod move_diagram_topologies(id, diagrams)¶
Increase topology index from id, and fix topologies dictionary
- move_point(p, x, y, label='Move point', not_history=False)¶
Add point to canvas
- move_point_after(p, x_old, y_old, label='Move point')¶
Call if point is moved by another way and need save history and update polygons
- new_polygons¶
list of polygons that has not still graphic object
- property no_pen¶
Zoom class intermediary
- property pen¶
Zoom class intermediary
- property pen_changed¶
Zoom class intermediary
- po¶
Help variable for polygons structures
- points¶
list of points
- polygons¶
list of polygons
- position_set()¶
Zoom class intermediary
- recount_canvas()¶
recount canvas size
- property recount_zoom¶
Zoom class intermediary
- property rect¶
- region_color_changed()¶
Layer color is changed, refresh all region colors
- regions = None¶
List of regions
- classmethod reinit(layer_heads, history)¶
Discard all links
- release()¶
Discard this object from global links
- shp = <ui.data.shp_structures.ShpFiles object>¶
Displayed shape files
- topologies = {}¶
List of all diagrams, divided by topologies
- topology_idx¶
Topology index
- topology_owner¶
First diagram in topology is topology owner, and is responsible for its saving
- try_delete_point(p, label='Delete point')¶
Try remove set point, and return it if point is in some line return False
- uid¶
Unique diagram id
- update_moving_points(points)¶
Update moving point for polygon operations
- views = []¶
Not edited diagrams
- views_object = {}¶
Object of not edited diagrams
- property x¶
Get static x-coordinate of left top corner
- property y¶
Get static y-coordinate of left top corner
- property zoom¶
Get static zoom variable
- zooming = <ui.data.diagram_structures.Zoom object>¶
zoom variable
- class ui.data.diagram_structures.Line(p1, p2, id=None)¶
Bases:
object
Class for graphic presentation of line
- add_polygon(polygon)¶
Add polygon, that is use this line
- count_polygons()¶
Delete polygon, that was use this line
- del_polygon(polygon)¶
Add polygon, that is use this line
- dim = 1¶
- get_color()¶
Return line color
- get_region()¶
Return polygon regions
- get_regions()¶
Return polygon regions
- get_tmp_line(p1, p2)¶
- id¶
Line history id
- object¶
Graphic object
- p1¶
First point
- p2¶
Second point
- polygon1¶
This line instance is use for these polygon
- polygon2¶
This line instance is use for these polygon
- qlinef()¶
return QLineF object
- second_point(p)¶
return second line point
- segment¶
This line instance is in these polygon
- set_default_region()¶
Set line region to default region
- set_region(region, layer_id=None)¶
Set polygon region to current region
- class ui.data.diagram_structures.Point(x, y, id=None)¶
Bases:
object
Class for graphic presentation of point
- de_id¶
Decomposition id
- dim = 0¶
- get_color()¶
Return line color
- get_region()¶
Return polygon regions
- get_regions()¶
Return polygon regions
- id¶
Point history id
- lines¶
This point instance is use for these lines
- object¶
Graphic object
- qpointf()¶
return QPointF coordinates
- set_default_region()¶
Set point region to default region
- set_region(region, layer_id=None)¶
Set point region to current region
- x¶
x coordinate
- y¶
y coordinate
- class ui.data.diagram_structures.Polygon(lines, id=None)¶
Bases:
object
Class for graphic presentation of polygon
- dim = 2¶
- drawpath¶
Qt path to be drawn (allows complex shapes as holes in polygons)
- get_color()¶
Return region color
- get_region()¶
Return polygon regions
- get_regions()¶
Return polygon regions
- helpid¶
Id in polygon from decomposition
- id¶
Polygon history id
- lines¶
Lines
- object¶
Graphic object
- qtpolygon¶
Qt polygon for point localization
- set_default_region()¶
Set polygon region to default region
- set_region(region, layer_id=None)¶
Set polygon region to current region
- set_regions(diagram, regions, label, not_history)¶
Set diagram regions in polygon topology
- class ui.data.diagram_structures.Zoom¶
Bases:
object
Zooming class
- bpen¶
pen for highlighted object paintings
- brush¶
brush for object paintings
- brush_selected¶
brush for selected object paintings
- deserialize(zoom)¶
Get zoom persistent variable from dictionary
- no_pen¶
pen for object grabbing
- pen¶
pen for object paintings
- pen_changed¶
pen need be changed
- position_set¶
If possition is set
- property recount_zoom¶
- serialize(zoom)¶
Set zoom persistent variable to dictionary
- x¶
x vew possition
- y¶
y viw possition
- property zoom¶
ui.data.history module¶
- class ui.data.history.DiagramHistory(diagram, global_history)¶
Bases:
History
Diagram history
Basic diagram operation for history purpose
- add_line(id, p1_id, p2_id, label=None)¶
Add add line to history operation.
Calling function must ensure, that both points exist. Return invert operation
- add_point(id, x, y, label=None)¶
Add add point to history operation.
- delete_line(id, label=None)¶
Add delete line to history operation.
If outer points contain this line, is removed from list. Return invert operation
- delete_point(id, label=None)¶
Add delete point to history operation.
Calling function must ensure, that any line using this poin is not exist . Return invert operation
- move_point(id, x, y, label=None)¶
Add move point to history operation.
Return invert operation
- release()¶
Set or lins to none
- return_op()¶
return changes maked after last history operation calling and remove old
- class ui.data.history.EventLocation(value)¶
Bases:
IntEnum
Location where event happen
- diagram = 0¶
- layer = 1¶
- region = 2¶
- surfaces = 3¶
- class ui.data.history.GlobalHistory(cfg)¶
Bases:
object
This static class save history of all histories and display view for displaying this local histories. For undo is displayed changis in this views
- add_history(history)¶
Add history to histories variable, end return its id
- add_label(history_id, label)¶
Add label to global history
- cfg¶
dara structures
- get_redo_view()¶
If current view is different from view that is need for next redo opperation return it, else return None
- get_undo_view()¶
If current view is different from view that is need for next undo opperation return it, else return None
- histories¶
List of local histories
- is_changes()¶
Return if changes is made after saving
- labels¶
List of local labels
- last_save_labels¶
Len of steps list during saving undo operation
- last_undo_labels¶
Len of steps list during last undo operation
- remove_all()¶
Releas all histories
- removed_diagrams¶
Diagram that is removed from history
- return_op()¶
Return changes maked after last history operation calling and remove old. This changes is for refresh display operation and depends to class implementation.
- saved()¶
Save point, where is data saved
- try_redo_to_label()¶
Make all redo opperations, that was done in current view, if is label operation done, return True and ops list. If not, new current view is set and return False
- try_undo_to_label()¶
Make all undo opperations, that was done in current view, if is label operation done, return True and ops list. If not, new current view is set and return False
- undo_labels¶
List of local undo labels
- class ui.data.history.History(global_history)¶
Bases:
object
- global_history¶
Link to global history
- id¶
Id for global history opperations
- multi¶
Step is small-grained history operation, multi is use for broad structuring of history steps. Milti ids dictionary of step label:id
- redo()¶
make one redo operation
- release()¶
Set or lins to none
- return_op()¶
Return changes maked after last history operation calling and remove old. This changes is for refresh display operation and depends to class implementation.
- steps¶
history steps
- undo()¶
undo make one undo operation
- undo_steps¶
Returned history steps
- class ui.data.history.HistoryStep(operation, params=[], label=None)¶
Bases:
object
- process()¶
process history step restoring
- class ui.data.history.LayersHistory(global_history)¶
Bases:
History
Layer history
Basic layer operation for history purpose
- add_fracture(fracture, id, position, label=None)¶
Add add fracture to history operation.
- change_fracture_name(name, id, label=None)¶
Add change fracture name to history operation.
- change_group(layers, interfaces, id, old_count, label=None)¶
Add switching two groups to history
Calling function must ensure that diagram sequence related to new group.
- change_interface(interface, id, label=None)¶
Add change layer to history operation.
Calling function must ensure that diagram sequence related to new interfaces
- change_interface_surface(surface_id, elevation, transform_z, id, label=None)¶
Add change interface surface to history operation.
- change_layer_name(name, id, label=None)¶
Add change layer name to history operation.
- delete_diagrams(id, count, oper, label=None)¶
Add diagram deleting to history
Calling function must ensure that interface sequence related to rest diagrams.
- delete_fracture(id, position, label=None)¶
Add delete fracture to history operation.
- delete_interface(id, label=None)¶
Add delete layer to history operation.
Calling function must ensure that diagram sequence related to rest interfaces
- delete_layer(id, label=None)¶
Add delete layer to history operation.
Calling function must ensure that interface sequence related to rest layers
- insert_diagrams(id, oper, label=None)¶
Add diagram inserting to history
Calling function must ensure that interface sequence related to inserted diagrams.
- insert_interface(interface, id, label=None)¶
Add insert layer to history operation.
Calling function must ensure that diagram sequence related to new interface
- insert_layer(layer, id, label=None)¶
Add insert layer to history operation.
Calling function must ensure that interface sequence related to new layer
- return_op()¶
return nedded check
- class ui.data.history.LocalLabel(history_id, label, view)¶
Bases:
object
Class with base history state variables
- class ui.data.history.RegionHistory(global_history)¶
Bases:
History
Region history
Basic region operation for history purpose
- add_fracture(id, name, is_own, is_bottom, label=None)¶
Add add fracture to history operation.
- add_layer(id, name, insert, label=None)¶
Add add layer to history operation.
- change_data(diagram_to, id, r0D, r1D, r2D, label=None)¶
Add change layer data operation.
- change_region(id, region, label=None)¶
Add change region to history operation.
- change_shape_region(shape_id, layer_id, dim, region_id, label=None)¶
Add change shapes region to history operation.
Add copy related to history operation.
- delete_data(id, label=None)¶
Add delete related to history operation.
- delete_fracture(id, label=None)¶
Add delete fracture to history operation.
- delete_layer(id, label=None)¶
Add delete layer to history operation.
- delete_region(id, label=None)¶
Add delete region to history operation.
- insert_region(id, region, label=None)¶
Add insert region to history operation.
- load_data(id, r0D, r1D, r2D, label=None)¶
Add load layer data operation.
- move_topology(id, label=None)¶
Add move topology to history operation.
- rename_layer(is_fracture, id, name, label=None)¶
Add rename layer to history operation.
- return_op()¶
return nedded check
- save_data(id, r0D, r1D, r2D, label=None)¶
Add save layer data operation.
- unmove_topology(id, label=None)¶
Add unmove topology to history operation.
- class ui.data.history.SurfacesHistory(global_history)¶
Bases:
History
Region history
Basic region operation for history purpose
- change_surface(surface, id, label=None)¶
Add change layer to history operation.
Calling function must ensure that diagram sequence related to new surfaces
- delete_surface(id, label=None)¶
Add delete layer to history operation.
Calling function must ensure that diagram sequence related to rest surfaces
- insert_surface(surface, id, label=None)¶
Add insert layer to history operation.
Calling function must ensure that diagram sequence related to new surface
- return_op()¶
return nedded check
ui.data.layers_structures module¶
- class ui.data.layers_structures.ChangeInterfaceActions(value)¶
Bases:
IntEnum
Interface possible actions
- bottom_editable = 5¶
- bottom_interpolated = 2¶
- editable = 3¶
- interpolated = 0¶
- split = 6¶
- top_editable = 4¶
- top_interpolated = 1¶
- class ui.data.layers_structures.ClickedControlType(value)¶
Bases:
IntEnum
Type of control that is clicked
- edit = 2¶
- edit2 = 7¶
- fracture = 4¶
- fracture_edit = 9¶
- fracture_view = 8¶
- interface = 3¶
- layer = 5¶
- none = 0¶
- view = 1¶
- view2 = 6¶
- class ui.data.layers_structures.DupDiagramData(insert_id, copy=True, dup1_id=None, dup2_id=None)¶
Bases:
object
Data for duplicating didram description
- copy¶
make only copy
- count¶
Amout of new diagrams
- dup1_id¶
Second diagram id for duplicating
- idx¶
Interface where is created new surface
- insert_id¶
Where will be diagram inserted
- class ui.data.layers_structures.Fracture(name, type=FractureInterface.none, fracture_diagram_id=None)¶
Bases:
object
One fracture in panel
- edit_rect¶
Clicable edit check box area (Only or own fracture interface type)
- edited¶
fracture diagram is edited
- fracture_diagram_id¶
Fracture param set id
- name¶
Fracture name
- rect¶
Clicable name area
- type¶
fracture Interface type
- view_rect¶
Clicable view check box area (Only or own fracture interface type)
- viewed¶
fracture diagram is viwed
- y¶
Middle coordinate
- class ui.data.layers_structures.FractureInterface(value)¶
Bases:
IntEnum
Fracture interface type
- bottom = 1¶
- none = 0¶
- own = 3¶
- top = 2¶
- class ui.data.layers_structures.Interface(surface_id, splited, elevation, transform_z=None, fracture_name=None, diagram_top_id=None, diagram_bot_id=None, fracture_interface=FractureInterface.none, fracture_diagram_id=None)¶
Bases:
object
One interface in panel. Diagram 1 is top and 2 is bottom. If diagram 2 is None
- diag_bot_id¶
Second diagram id (bottom). None if interface has not two independent Note Sets
- diag_top_id¶
First diagram id (top). None if interface is interpolated
- edit_rect1¶
Clicable edit check box area
- edit_rect2¶
Clicable edit check box area
- edited1¶
is first diagram edited (grafic control is set)
- edited2¶
is first diagram edited (grafic control is set)
- elevation¶
Float elevation description
- fracture¶
Fracture object or None if fracture is not on interface
- get_fracture_position()¶
Return dictionry with string description of fracture possitions -> FractureInterface enum if is only one possibility, return None
- rect¶
Clicable name area
- splited¶
Interface have two independent surfaces
- property str_elevation¶
Retuen elevation in string format
- surface_id¶
Surface structure
- transform_z¶
Transformation in Z direction (scale and shift).
- view_rect1¶
Clicable view check box area
- view_rect2¶
Clicable view check box area
- viewed1¶
is second diagram viwed (grafic control is set)
- viewed2¶
is second diagram viwed (grafic control is set)
- y¶
Middle coordinate
- y_bottom¶
Bottom line coordinate
- y_top¶
Top line coordinate
- class ui.data.layers_structures.Layer(name, shadow=False)¶
Bases:
object
One layer in panel
- name¶
Layer name, if name is
- rect¶
Clicable name area
- shadow¶
Laier is shadow
- y¶
Middle coordinate
- class ui.data.layers_structures.LayerSplitType(value)¶
Bases:
IntEnum
Fracture interface type
- editable = 1¶
- interpolated = 0¶
- split = 2¶
- class ui.data.layers_structures.Layers(global_history)¶
Bases:
object
Layers data
- class LayersIterData¶
Bases:
object
Data clas for passing between itarion functions get_first_layer_info and get_next_layer_info. This functions is use for layers serialization
- block_idx¶
Block idx, use for topology
- diag_bot_id¶
Second diagram id, None for copy block
- diag_top_id¶
First diagram id
- end¶
Last layer
- fracture_after¶
Fracture after layer. (With same topology as second diagram)
- fracture_before¶
Fracture before layer. (With same topology as first diagram)
- fracture_own¶
Fracture after layer. (With own topology)
- is_shadow¶
Layer type is shadow
- layer_idx¶
Layer idx
- stype1¶
First surface type
- stype2¶
second surface type
- surface_id1¶
First surface id
- surface_id2¶
Second surface id, None for copy block
- add_fracture(idx, name, position, dup)¶
add fracture to interface
Variable dup is returned by get_diagram_dup and new diagrams was added outside this function
- add_fracture_history(fracture, idx, position)¶
add fracture to interface
- add_interface(gl_interface, splited, fracture_name=None, diag_top_id=None, diag_bot_id=None, fracture_interface=FractureInterface.none, fracture_id=None)¶
add new interface
- add_layer(name, shadow=False)¶
add new layer
- add_layer_to_shadow(idx, name, interface, elevation, dup)¶
Append new layer to shadow block, return True if shadow block is replaces
- add_surface(surf_in)¶
- append_layer(name)¶
Append layer to the end
- change_interface(interface, idx)¶
Switch idx layer to set layer
- change_to_editable(idx, type, dup)¶
Change interface type to editable
Variable dup is returned by get_diagram_dup and new diagrams was added outside this function
- change_to_interpolated(idx, type)¶
Change interface type to interpolated
- compute_composition()¶
Compute coordinates for layers elements
- delete()¶
- delete_interface(idx)¶
delete set interface and move diagram indexes, if is needed. Return deleted interface
- delete_layer(idx)¶
delete layer and return object
- delete_surface(idx)¶
Delete surface if is not used or return False
- font¶
Layer diagram font
- get_change_interface_actions(idx)¶
Get list of interface possible actions
- get_clickable_idx(x, y, type)¶
Return number of control below point
- get_clickable_type(x, y)¶
Return control type of below point
- get_diagram_dup(idx)¶
Return first idx for division and if is possible division make
- get_diagram_dup_before(idx)¶
Return first idx for division and if is possible division make
- get_diagram_idx(idx, second, fracture=False)¶
Get diagram (surface) idx from interface idx or none if interface has not diagram
- get_diagram_quads(diagram_id)¶
Find and return list of quads in set diagram
- get_first_layer_info()¶
Get information about first layer. All temporary data is save to returned variable. This variable can be pass on get_next_layer_info function or used for data serialization. return
- get_group_copy(idx, count)¶
Return copy of set interfaces and layers.
- get_interface_copy(idx)¶
Return copy of set interface
- get_next_layer_info(data)¶
Get information about next layer. All temporary data is save to returned variable This variable can be pass on get_next_layer_info function or used for data serialization. This function is use for all layers iteration
- get_orig_copy(idx, count)¶
Return copy of set interfaces and layers.
- insert_interface(interface, idx)¶
insert set layer and move diagram indexes, if is needed
- insert_layer(layer, idx)¶
insert set layer
- interfaces¶
List of interfaces
- is_block_removable(idx)¶
Return if layer can be removed
- is_interface_removable(idx)¶
Return if layer can be removed
- is_layer_removable(idx)¶
Return if layer can be removed
- layers¶
List of layers
- load_surfaces(gl_surfaces)¶
TODO: deserialize directly into the Surface object.
- prepend_layer(name)¶
Prepend layer to the start
- remove_block(idx, removed_res)¶
Remove all block where id idx layer. Variable removed_res is one, that is was returned by remove_block_changes.
- remove_block_changes(idx)¶
Return tuple with count (first layer, removed layers,removed slices, removed fractures)
- remove_fracture(idx)¶
Remove fracture from idx interface. If fracture has surface, return surface idx end move all surfaces idx else return None
- remove_fracture_history(idx)¶
Remove fracture from idx interface and return it
- remove_interface(idx, removed_res)¶
Remove interface and merge layers. Variable removed_res is one, that is was returned by remove_interface_changes.
- remove_interface_changes(idx)¶
Return tuple with count (removed slices, removed fractures)
- remove_layer(idx, removed_res, dup)¶
Remove layer. Variable removed_res is one, that is was returned by remove_layer_changes. Variable dup is returned by get_diagram_dup and new diagrams was added outside this function. Is returned tuple with removed diagrams and count of removed layers
- remove_layer_changes(idx)¶
Return tuple with count (removed slices,added slice, removed fractures , remove first fracture)
- set_edited_diagram(diagram_id)¶
Find interface accoding to diagram id, and set id as edited
- set_edited_interface(idx, second, fracture=False)¶
If interface with set idx is set as edited return False, else change edited interface in data and return True
- set_surface(idx, new_surface)¶
- set_viewed_interface(idx, second, fracture=False)¶
Invert set viewed value and return its value
- split_interface(idx, dup)¶
Split interface. Variable dup is returned by get_diagram_dup and new diagrams was added outside this function
- split_layer(idx, name, split_type, dup)¶
Split set layer by interface with split_type type in set surface
Variable dup is returned by get_diagram_dup and new diagrams was added outside this function
- strip_edited(interface)¶
If some of interface diagram editing is set to true, is set to false and return true, else false
- surfaces¶
Class with list of surfaces
- switch_group_copy(idx, old_count, new_layers, new_interfaces)¶
Switch count of old interfaces and layers to new set and return old interfaces and layers.
- property x_edit¶
edit button x left coordinate
- property x_ilabel¶
elevation label x left coordinate
- x_ilabel_width¶
Coordinate of the longest interface name end
- property x_label¶
layer label x left coordinate
- x_label_width¶
Coordinate of the longest layer name end
- property x_view¶
view button x left coordinate
- y_font¶
Font height
ui.data.le_serializer module¶
- class ui.data.le_serializer.LESerializer(cfg)¶
Bases:
object
Class for diagram data serialization
- add_interface(gl_interface, top_layer, fracture, bot_layer)¶
- cfg_reset(cfg)¶
- cfg_to_geometry(cfg, path)¶
Save diagram data to set file
- eq_layer_topology(layer_a, layer_b)¶
- geometry_to_cfg(path, geometry, cfg)¶
Load diagram data from set file
- get_layer_nodesets(layer, top)¶
- Parameters
layer –
side –
- Returns
- isec_ns(ns_a, ns_b)¶
- load(cfg, path)¶
- save(cfg, path='')¶
- set_new(cfg)¶
Set new file
- exception ui.data.le_serializer.LESerializerException(message, errors)¶
Bases:
Exception
ui.data.polygon_operation module¶
- class ui.data.polygon_operation.PolygonOperation(line=None)¶
Bases:
object
Class for polygon localization
- add_line(diagram, line, label=None, not_history=True)¶
Add new line to decomposition
- add_point(diagram, point)¶
Add new point to decomposition
- get_line_origin_id(line)¶
Return line id in origin structure
- get_point_origin_id(point_id)¶
Return point id in origin structure
- get_polygon_origin_id(polygon)¶
Return polygon id in origin structure
- move_points(diagram, points)¶
move set point in decomposition, return if all moving is possible
- outer_id¶
Decomposition of the a plane into polygons.
- remove_line(diagram, line, label=None, not_history=True)¶
remove set point from decomposition
- remove_point(diagram, point)¶
remove set point from decomposition
- rest_polygon_id¶
Polygon that will be created during removing splitted line
- set_new_decomposition(diagram, decomposition)¶
set new decomposition
- split_line(diagram, line)¶
remove and move line
- tmp_line¶
Line that will be reuse after line splitting
- classmethod try_intersection(diagram, p1, p2, label)¶
Try look up intersection and split lines. Return new points, and_lines. Points is sorted from p1 to p2.
ui.data.region_structures module¶
- class ui.data.region_structures.Region(color, name, reg_id, dim, step, boundary=False, not_used=False)¶
Bases:
object
Class for graphic presentation of region
- boundary¶
Is boundary region
- cmp_shape_dim(layer_id, dim)¶
Compare real shape dimension on set layer with region dimension and evaluate if dimensions are compatible
- color¶
Region color
- dim¶
dimension (point = 0, well = 1, fracture = 2, bulk = 3)
- name¶
Region name
- not_used¶
is used
- reg_id¶
Region unique id
- class ui.data.region_structures.Regions(layer_heads, global_history)¶
Bases:
object
Regions diagram
All regions function for layer panel contains history operation without label and must be placed after first history operation with label. Function that worked with regions value and is not used by layer panel, should contain label.
- DEFAULT_REGION = 0¶
- add_fracture(id, name, is_own, is_bottom, to_history=True)¶
insert layer to structure and copy regions
- add_layer(id, name, oper, to_history=True)¶
insert layer to structure and copy regions
- add_layer_history(id, name, insert)¶
Add layer for reverse history operation
- add_new_region(color, name, dim, to_history=False, label=None)¶
Add region
- add_region(color, name, reg_id, dim, step, boundary=False, not_used=False)¶
Add region
- add_regions(dim, shape_id, to_history=False, label=None)¶
Set Shape region for all layers in current topology is added to current value
- add_shapes_to_region(is_fracture, layer_id, layer_name, topology_idx, regions)¶
Add shapes to region
Call diagram static function make_revert_map before this function
- copy_regions(dim, shape_id, copy_id, to_history=False, label=None)¶
Shape region for all layers in current topology is added to current value
copy data from related structure
- property current_layer_id¶
Id of selected layer in region panel
- property current_regions¶
Map all layers in current topology, and its regions
- property current_topology_id¶
Id of selected topology in region panel
- del_regions(dim, shape_id, to_history=False, label=None)¶
Shape region for all layers in current topology is removed from current value
- delete_block(id, layers)¶
delete block from structure
- delete_data(id, to_history=True)¶
For shadow block delete data, and set topology to -1
- delete_fracture(id, to_history=True)¶
delete fracture from structure
- delete_layer(id, to_history=True)¶
delete layer from structure
- delete_region(id, to_history=True, label=None)¶
Add region
- find_top_id(id)¶
return topology id for set layer id
- get_layers(topology_idx)¶
Prepare layer data for Regions panel. return: OrderedDict{ layer_id: layer_name}
- get_region(dim, shape_id)¶
Get Shape regions for all layers in current topology
- get_region_color(dim, shape_id)¶
Return current region color for set shape
- get_region_id(dim, shape_id)¶
Return current region color for set shape
- get_regions(dim, shape_id)¶
Get Shape regions for all layers in current topology
- get_shapes_from_region(is_fracture, layer_id)¶
Get shapes from region Call diagram static function make_map before this function
- get_shapes_of_region(reg_idx)¶
Get list of shape instances of specific region
- get_topology(layer_id)¶
Get topology id for set layer or fracture
- insert_region(id, region, to_history=True, label=None)¶
Add region
- layer_region(dim)¶
- layer_region_0D¶
Dictionary of indexes lists 1D shapes (points) (layers_id:{point.id:region.id})
- layer_region_1D¶
Dictionary of indexes lists 2D shapes (lines) (layers_id:{line.id:region.id})
- layer_region_2D¶
Dictionary of indexes lists 3D shapes (polygons) (layers_id:[{polygon.id:region.id}])
- layers¶
Dictionary of layers (layers_id:layers_name)
- layers_topology¶
Dictionary of lists layers in topology (topology id:[layers_id])
- move_topology(id, to_history=True)¶
increment layers id topology and bigger.
- regions¶
List of regions
- reload_regions(cfg)¶
Call if data file changed
- remap_reg_from¶
If this variable is set, remap in move topology shapes id from set diagram
- remap_reg_to¶
If this variable is set, remap in move topology shapes id to values in set diagram
- remap_region_shapes(top_id, to_history=True)¶
Remap all shapes id in set topology to new diagram
- rename_layer(is_fracture, id, name, to_history=True)¶
copy data from related structure
- set_default(dim, shape_id, to_history=False, label=None)¶
Shape region for current layer is set to default value. If region is already set to default return False
- set_region(dim, shape_id, region, layer_id=None, to_history=False, label=None)¶
Shape region for current layer is set to current value
- set_region_boundary(id, boundary, to_history=False, label=None)¶
Add region
- set_region_color(id, color, to_history=False, label=None)¶
Add region
- set_region_mesh_step(id, step, to_history=False, label=None)¶
Add region
- set_region_name(id, name, to_history=False, label=None)¶
Add region
- set_region_not_used(id, not_used, to_history=False, label=None)¶
Add region
- set_regions_from_list(dim, shape_id, topology_id, region_list, to_history=False, label=None)¶
Shape region for all layers in current topology is set to current value :param region_list: List of region to assign to the shapes [ region_id, ..].
- unmove_topology(id, to_history=True)¶
decrement layers id topology and bigger.
- class ui.data.region_structures.ShapeDim(value)¶
Bases:
IntEnum
Type of shape
- line = 1¶
Line
- point = 0¶
Point
- poly = 2¶
Polygon
- class ui.data.region_structures.TopologyOperations(value)¶
Bases:
IntEnum
Type of topology operation
- insert = 1¶
Added diagrams have topology index copy_top_id+1 and next is move about 1
- insert_next = 2¶
First added diagram have topology index copy_top_id, next added diagrams have topology index copy_top_id+1 and next is move about 1
- none = 0¶
Added diagrams have topology index copy_top_id
ui.data.selection module¶
- class ui.data.selection.Selection¶
Bases:
object
Selection operations
- delete_selected()¶
delete selected, returns list of objects to remove from diagram panel, if some objects in selection have associated region only sets all objects to None region
- deselect_selected()¶
deselect all items
- get_selected_regions(diagram)¶
For all layers of set diagram return: - selected region, if selected shapes have same regions and dimensions - previous point return applies to the highest dimension shape in case of mismatch - or None region if regions of the highest dimension are different
- is_empty()¶
returns True if no shape selected
- max_selected_dim()¶
- select(shape, select=None)¶
- select_all()¶
select all items
- select_current_region()¶
select items which have set current region
- set_current_region()¶
Set region of selected shapes to current regions where dimension match. Restrict selection to these shapes
ui.data.shp_structures module¶
- class ui.data.shp_structures.ShpData¶
Bases:
object
Shape file geometric data.
(Only geometric that will be displayed)
- clear()¶
Remove all lines, points ant reset border
- lines¶
List of displayed lines in ShpLine data type
- max¶
right bottom corner in QPoint coordinates
- min¶
left top corner in QPoint coordinates
- object¶
Graphic object
- points¶
List of displayed points in ShpPoint data type
- class ui.data.shp_structures.ShpDisp(file)¶
Bases:
object
Shape file displayed settings.
- BACKGROUND_COLORS = [<PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>, <PyQt5.QtGui.QColor object>]¶
- attr¶
Selected attribute
- attrs¶
File attributes
- av_highlight¶
Highlight shape with this attribute
- av_names¶
Values for selected attribute
- av_show¶
Show shape with this attribute
- color¶
displaing color fir shapes
- errors¶
Parse errors
- file¶
paths to shp file
- property file_name¶
File name without path
- classmethod next_color()¶
File name without path
- static parse_attr(value, type, dec)¶
Return string representation of attribute accoding to type
- refresh(attr)¶
Refresh drawing data after settings changes
- refreshed¶
Data should be repainted
- set_attr(attr)¶
change dislayed attribute
- set_color(color)¶
change displayed color
- set_highlight(i, value)¶
change highlighted attribute value
- set_show(i, value)¶
change dislayed attribute value
- shpdata¶
Datat for drawing
- class ui.data.shp_structures.ShpFiles¶
Bases:
object
Shape files, that is displazed in background.
- add_file(file)¶
Add new shapefile
- boundrect¶
shape file bounding rect in QRectF variable or None
- datas¶
Data for shp files
- del_file(idx)¶
Delete existing shapefile according to file index
- deserialize(shps)¶
Get shp persistent variable from dictionary
- is_empty()¶
Is set some shapefile
- is_file_open(file)¶
Is shapefile already opened
- serialize()¶
Set shp persistent variable to dictionary