maptek.vulcan_gui module
This module provides an interface to the Vulcan GUI functionality.
- Functionality includes:
Panels
Gpan Panels
On screen data
Selections
Display
Macro functions
- confirm(*args, **kwargs)
Popup confirmation prompt.
- Parameters:
msg (str (default =
'Confirm'
)
) – Message to display to the user.ok (str (default =
'Ok'
)
) – First choice option.cancel (str (default =
'Cancel'
)
) – Second choice option.
- start_busy_message(msg, time=-1)
Starts a busy message (small non-interactive message).
- end_busy_message()
Ends any running busy message.
- globals()
Returns a dictionary of current data (some loaded) in Vulcan.
Example
>>> from pprint import pprint >>> pprint(vulcan_gui.gfx.globals()) {'block_model': '', 'dgd': 'thordata.dgd.isis', 'environment': 'STD', 'layer_descriptions': {'TMP': 'Created layer'}, 'layers': ['TMP'], 'loaded_layers': ['TMP'], 'loaded_triangulations': ['topo.00t'], 'project': 'THOR', 'scd': 'THOR.SCD', 'scd_location': '__cwd__', 'unit': 'Metres', 'unit_abbrev': 'm'}
- save()
Issues a save command to Vulcan.
- get_main_window_handle() unsigned int
Get the main window handle of the Workbench
- get_current_dgd_attribute_templates() dict
Gets the attribute templates from the currently opened design database.
- get_resource_attribute_templates() dict
Gets the attribute templates from the resource template file.
- add_layer(lyr, loadMethod='LOAD_IF_EXISTS') bool
Adds a layer to Vulcan. Load options defined in
gui_options.layer_load
- Parameters:
lyr (
layer const &
) –loadMethod (
str
) –
- load_triangulations(files) bool
Load a list of triangulations into Vulcan.
- Parameters:
files (
list[str]
) –
- remove_layers(layer_names) bool
Remove a list of layers from Vulcan.
- Parameters:
layer_names (
list[str]
) –- Raises:
RuntimeError – If any layers fail (not loaded or had unsaved data), indicating which item(s) failed.
- set_object_visibility(object, mode) bool
Sets the visibility of an object in Vulcan. Only supports objects from the GUI with the visibility modes of VISIBLE, SHADOW, and INVISIBLE
- Parameters:
object (
obj const &
) –mode (
str
) –
- get_object_visibility(object) str
Gets the visibility of an object in Vulcan.
- Parameters:
object (
obj const &
) –
- class gui_options(*args, **kwargs)
Bases:
object
Proxy of C++ gui_options class.
- display = ('VISIBLE', 'INVISIBLE', 'SHADOW', 'HIGHLIGHT', 'VISIBLE_AND_POINTS', 'SHADOW_AND_POINTS', 'HIGHLIGHT_AND_POINTS', 'MARKERS', 'CONTRAST', 'CONTRAST_AND_POINTS', 'FREEZE')
List of the available GUI display options
- label = ('OFF', 'POINT_NAME', 'POINT_Z', 'POINT_W', 'POINT_LOCATION', 'POINT_SEQUENCE', 'POINT_SEQUENCE_FIRST_LAST', 'POINT_GRADIENT_ANGLE', 'POINT_GRADIENT_RATIO', 'POINT_GRADIENT_PERCENTAGE', 'OBJECT_VALUE', 'OBJECT_GROUP', 'OBJECT_CLASS', 'OBJECT_NAME_FIRST_CENTER_LAST', 'OBJECT_NAME_FIRST_CENTER', 'OBJECT_NAME_CENTER_LAST', 'OBJECT_NAME_CENTER', 'OBJECT_NAME_FIRST_LAST', 'OBJECT_NAME_FIRST', 'OBJECT_NAME_LAST', 'OBJECT_DYNAMIC', 'OBJECT_DESCRIPTION')
List of the available GUI label options
- layer_load = ('LOAD_IF_EXISTS', 'CLEAR_IF_EXISTS', 'PROMPT_IF_EXISTS', 'PROMPT_IF_NOT_LOADED', 'ACTIVE_IF_EXISTS', 'ACTIVE_PROMPT_IF_NOT_SET', 'PROMPT_NEW_ACTIVE')
List of the available GUI load options
- selection_type = ('NOTYPE', 'BYLAYER', 'BYOBJECT', 'BYNAME', 'BYGROUP', 'BYFEATURE', 'BYALL')
List of the available GUI type options
- selection_criteria = ('ALL', 'LINE', 'POLYGON', 'TEXT', '3DTEXT', 'ARROW', 'DIMENSIONLINE', 'DIMENSIONRADIUS', 'DIMENSIONARC', 'DIMENSIONANGLE', 'IMPLIEDPOLYGON')
List of the available GUI criteria options
- class panel(*args, **kwargs)
Bases:
object
Interface for building basic Vulcan panels.
- __init__(*args, **kwargs)
Interface for building basic Vulcan panels.
- begin_block(self, border=False, title='')
Creates a new area on the panel with optional border and title.
- end_block(self)
- pan_if(self)
Makes the next element conditional on the previous element.
- pan_else(self)
- pan_endif(self)
- staticline(self)
Line drawn across panel.
- end_indent(self)
- begin_same_line(self)
- end_same_line(self)
- skip_line(self)
- statictext(self, prompt, bold=False)
Text placed on the panel.
- editbox(self, tag, prompt, defaultVal=None, width=None)
- numberbox(self, tag, prompt, defaultVal=None, width=None)
- integerbox(self, tag, prompt, defaultVal=None, width=None)
- fileselector(self, tag, prompt, filter, width=None)
Combobox with a built in file filter using wildcard matching.
Example
>>> # *.bmf would return any files ending in .bmf >>> pan.fileselector('file', 'Select a block model', '*.bmf')
- combobox(self, tag, prompt, options, width=None)
- filterbox(self, tag, prompt, filter, width=None)
Combobox with a built in filter, using gpan filter strings.
- radiobutton(self, tag, prompt, initial=False, bank=0)
Radiobutton to pick one of several options. Only one tag per bank will return ‘1’.
- colour(self, tag, prompt, defaultVal=None)
Selector for colour using Vulcan colour palette.
- linestyle(self, tag, prompt, style=None, thickness=None)
Selector for linestyle using Vulcan linestyles.
- pattern(self, tag, prompt, defaultVal=None)
Selector for pattern using Vulcan patterns.
- display(self, values=None) bool
Displays the panel. Stores to optional input dictionary.
- Parameters:
values (
dict
) –
- set_values(self, values)
Preloads panel key values with input dictionary values.
- Parameters:
values (
dict
) –
- save_spec(self, specName)
Saves the panel data to a specification file.
- Parameters:
specName (
str
) –
- property values
Get/Set for panel values (dict)
- class gpan(*args)
Bases:
object
Display Vulcan gpan panels
- __init__(self) gpan
- __init__(self, specFile) gpan
Display Vulcan gpan panels
- Parameters:
specFile (
str
) –
- display(self, cgpFile, panelName, values=None, on_change=None, user_button=None) str
Displays the specified panel file/name. Stores to optional input dictionary. Callbacks should be a function name to call, taking a dictionary as input and returning a dictionary to the panel.
- set_values(self, values)
Preloads panel key values with input dictionary values.
- Parameters:
values (
dict
) –
- save_spec(self, specName)
Saves the panel data to a specification file.
- Parameters:
specName (
str
) –
- property values
Get/Set for panel values (dict)
- class temp_object(object)
Bases:
object
Class for displaying temporary objects in the GUI.
- __init__(object)
Class for displaying temporary objects in the GUI.
- set_display_mode(self, mode)
Sets the display mode for the temporary object (visible, shadow, etc).
Options listed in
gui_options.display
- Parameters:
mode (
str
) –
- set_label_mode(self, mode)
Sets the label mode for the temporary object.
Options listed in
gui_options.label
- Parameters:
mode (
str
) –
- remove(self)
Removes the temporary object from screen.
- class pick_point
Bases:
object
Pick points inside of Vulcan.
- __init__()
Pick points inside of Vulcan.
- pick(self, firstPrompt, secondPrompt='') point_list
- property rubberband
Get/Set for rubberband.
- property single_point
Get/Set for single_point.
- class selection(prompt)
Bases:
object
Class for creating object selections inside of Vulcan.
- __init__(prompt)
Class for creating object selections inside of Vulcan.
- set_criteria(self, types)
Sets the allowed types to be picked from a list of options
gui_options.selection_criteria
.- Parameters:
types (
list[str]
) –
- get_criteria(self) str_list
Returns the list of allowed selection types.
- set_single_object(self, singleObj=True)
Sets the selection to single object mode.
- Parameters:
singleObj (
bool
) –
- set_selection_type(self, type)
Sets the selection type (BYLAYER, BYGROUP, etc). Options:
gui_options.selection_type
- Parameters:
type (
str
) –
- set_display_mode(self, type)
Sets the display mode of selected data. Options in:
gui_options.display
- Parameters:
type (
str
) –
- set_ignore_preselected(self, ignore=True)
Sets the flag to ignore preselected data.
- Parameters:
ignore (
bool
) –
- pick(self, layername=None, group=None, feature=None)
Runs a non-interactive selection filtering by the input parameters.
- Parameters:
layername (
str *
) –group (
str *
) –feature (
str *
) –
- get_object(self, index) VulcanObj
Gets an object from the selection by index.
- Parameters:
index (
int
) –
- replace(self, object) bool
Replaces an object (If it originated from Vulcan).
- Parameters:
object (
obj &
) –
- delete_object(object, refreshDisplay=True)
Deletes an object from a selection (If it originated from Vulcan).
- Parameters:
object (
(obj&)
) – Object to be deleted from VulcanrefreshDisplay (
(bool
, defaultTrue)
) – Flag to refresh the display in Vulcan after deleting the object.
- next()
- property objects
- type_options = ('NOTYPE', 'BYLAYER', 'BYOBJECT', 'BYNAME', 'BYGROUP', 'BYFEATURE', 'BYALL')
- criteria_options = ('ALL', 'LINE', 'POLYGON', 'TEXT', '3DTEXT', 'ARROW', 'DIMENSIONLINE', 'DIMENSIONRADIUS', 'DIMENSIONARC', 'DIMENSIONANGLE', 'IMPLIEDPOLYGON')
- property criteria
Get/Set for selection criteria
- property single_object
Get/Set for single object mode
- property selection_type
Get/Set for selection type
- property display_mode
Get/Set for selection display mode
- property ignore_preselected
Get/Set for ignore preselected
Bases:
object
- get_report_window() str_list
Gets any messages from the report window that were saved during a macro run.
- class macro
Bases:
object
Macro class for interacting with Vulcan.
These are generated in Vulcan via menu option, and can be modified as needed to automate a Vulcan menu option.
Warning
Macro command requirements can change between Vulcan versions.
- __init__()
Macro class for interacting with Vulcan.
These are generated in Vulcan via menu option, and can be modified as needed to automate a Vulcan menu option.
Warning
Macro command requirements can change between Vulcan versions.
- select_by_attr(self, layer='*', object='*', group='*', feature='*')
- select_interactive(self, prompt='', do_layer=0, do_name=0, do_group=0, do_feature=0)
- point_absolute(self, x, y, z)
- Parameters:
x (
double
) –y (
double
) –z (
double
) –
- point_relative(self, x, y, z)
- Parameters:
x (
double
) –y (
double
) –z (
double
) –