GXMVIEW class¶
- class GXMVIEW(handle=0)[source]¶
GXMVIEW class.
A view (
GXMVIEW
class) has a 2-D/3-D translation matrix, a map projection and a clip region. A view contains any number of “groups”, and each “group” contains one or more graphics elements (entities). Different types of groups will contain different types of entities:Note:
GXCSYMB
groups (color symbols) contain data and rules for presenting the data as color symbols. Seecol_symbol
and theGXCSYMB
class.GXAGG
groups (aggregates) contain images. Seeaggregate
and theGXAGG
class.Standard groups contain symbols, lines, polylines, and polygons. See
start_group
.- add_folder_2d(name, parent_name)[source]¶
Add a Map folder to the
GXMVIEW
.- Parameters:
name (str) – Folder name
parent_name (str) – Parent folder name, or empty string for root
GXMVIEW
.
New in version 2022.1.
License: Geosoft Open License
- add_folder_3d(name, parent_guid, guid)[source]¶
Add a 3DView folder to the
GXMVIEW
.- Parameters:
New in version 9.10.
License: Geosoft Open License
- aggregate(agg, name)[source]¶
Add an aggregate to a view.
- Parameters:
agg (GXAGG) – Aggregate
name (str) – Aggregate name Maximum length is
MVIEW_NAME_LENGTH
New in version 5.0.
License: Geosoft Open License
- arc(x, y, radius, ratio, angle, start, end)[source]¶
Draw an arc.
- Parameters:
x (float) – Center x
y (float) – Center y
radius (float) – Radius
ratio (float) – Ratio x/y
angle (float) – Angle
start (float) – Start angle
end (float) – End angle
New in version 5.0.
License: Geosoft Open License
- axis_x(y_loc, left, right, major_tick, minor_tick, tick_size)[source]¶
Draw an X axis
- Parameters:
y_loc (float) – Y location in view units
left (float) – Left X
right (float) – Right X
major_tick (float) – Major tick interval
minor_tick (float) – Minor tick interval (half size of major)
tick_size (float) – Tick size in view units (negative for down ticks)
New in version 5.0.
License: Geosoft Open License
Note: All coordinates are in view units.
See also
rOptimumTick_MVIEW
- axis_y(x_loc, bottom, top, major_tick, minor_tick, tick_size)[source]¶
Draw a Y axis
- Parameters:
x_loc (float) – X location in view units
bottom (float) – Bottom Y
top (float) – Top Y
major_tick (float) – Major tick interval
minor_tick (float) – Minor tick interval (half size of major)
tick_size (float) – Tick size in view units (negative for left ticks)
New in version 5.0.
License: Geosoft Open License
Note: All coordinates are in view units.
See also
rOptimumTick_MVIEW
- best_fit_window(m_min_x, m_min_y, m_max_x, m_max_y, v_min_x, v_min_y, v_max_x, v_max_y, fit_view)[source]¶
Fit an area in ground coordinates centered to an area in mm on map or vise versa keeping X and Y scales the same.
- Parameters:
m_min_x (float_ref) – X minimum (mm) of the area in map relative to map origin
m_min_y (float_ref) – Y minimum ..
m_max_x (float_ref) – X maximum ..
m_max_y (float_ref) – Y maximum ..
v_min_x (float_ref) – Min X in ground coordinate to fit to the area defined above
v_min_y (float_ref) – Min Y in ground coordinate ..
v_max_x (float_ref) – Max X in ground coordinate ..
v_max_y (float_ref) – Max Y in ground coordinate ..
fit_view (int) – MVIEW_FIT constants
New in version 5.1.8.
License: Geosoft Open License
Note: X and Y scales will be redefined and units will remain unchanged. The final X and Y ranges (if changed) are returned.
See also
- box_3d(min_x, min_y, min_z, max_x, max_y, max_z)[source]¶
Draw a 3D box
- Parameters:
min_x (float) – Min X
min_y (float) – Min Y
min_z (float) – Min Z
max_x (float) – Max X
max_y (float) – Max Y
max_z (float) – Max Z
New in version 5.1.6.
License: Geosoft Open License
Note: The Fill color is used to color the box.
- capture_3d_snapshot(name, description, light_weight, guid)[source]¶
Capture current 3D view state to a snapshot.
- Parameters:
name (str) – Snapshot name
description (str) – Snapshot description
light_weight (bool) – Is this a light weight snapshot, i.e. just captures view orientation and type and not group visibility/clipping etc.
guid (str_ref) – Snapshot GUID
New in version 9.9.
License: Geosoft Open License
- change_line_message(line)[source]¶
Change the specified line in a view.
- Parameters:
line (str) – Change to this line
New in version 5.0.
License: Geosoft Open License
Note: The line name can be created by calling LineLabel_DB using
DB_LINE_LABEL_FORMAT_LINK
. This insures that the label is created is the same way as used in the database.
- chord(x, y, radius, ratio, angle, start, end)[source]¶
Draw a filled arc.
- Parameters:
x (float) – Center x
y (float) – Center y
radius (float) – Radius
ratio (float) – Ratio x/y
angle (float) – Angle
start (float) – Start angle
end (float) – End angle
New in version 5.0.
License: Geosoft Open License
- classified_symbols(vv_x, vv_y, vv_z, scal_mm, zmin, zval, size, fcol)[source]¶
Plot classified symbols
- Parameters:
scal_mm (float) – Scale factor to convert mm to view units
zmin (float) – Classified minimum Z to plot
zval (str) – Comma delimited list of Z maximums
size (str) – Comma delimited list of sizes in mm
fcol (str) – Comma delimited list of color strings
New in version 5.0.
License: Geosoft Open License
Note: For example, to plot three levels <95, 95-100 and 100-120, three string arguments would be:
“95,100,120” maximums of each class “2.0,2.5,3.0” sizes in mm “y,g,r” fill colors
- clear_esrild_ts()[source]¶
Clear ESRI local datum transformations currently in use.
New in version 7.1.
License: Geosoft Open License
- clip_clear()[source]¶
Remove/clear the view clip region.
New in version 5.0.
License: Geosoft Open License
- clip_groups(mode)[source]¶
Set the Clipping mode on/off for all groups.
- Parameters:
mode (int) – MVIEW_CLIP constants
New in version 5.0.
License: Geosoft Open License
- clip_marked_groups(mode)[source]¶
Set the Clipping mode on/off for marked groups.
- Parameters:
mode (int) – MVIEW_CLIP constants
New in version 5.0.
License: Geosoft Open License
- clip_mode(mode)[source]¶
Set the view clipping mode on or off.
- Parameters:
mode (int) – MVIEW_CLIP constants
New in version 5.0.
License: Geosoft Open License
Note: Entitles that follow in this group will be clipped or not clipped depending on this mode.
The montaj editor cannot change the clip mode of embedded clipped/unclipped enties that are controlled by this call. Use the Group clipping functions instead.
It is highly recommended that you use the
group_clip_mode
function to control clipping on a group-by-group basis, instead of usingclip_mode
when inside a group, as it is impossible to determine the true visible extents of a group. In such cases, the “zoom to full map extents” command may give incorrect results.
- clip_poly(vv_x, vv_y, unit)[source]¶
Add a polygon to the clip region.
- Parameters:
unit (int) – MVIEW_UNIT constants
New in version 5.0.
License: Geosoft Open License
Note: The polygon will be added to the current clip region. The
GXVV
’s cannot have any dummy elements.
- clip_poly_ex(vv_x, vv_y, unit, exclude)[source]¶
Add a polygon to the clip region.
- Parameters:
unit (int) – MVIEW_UNIT constants
exclude (int) – Exclude
New in version 5.0.
License: Geosoft Open License
Note: The polygon will be added to the current clip region. The
GXVV
’s cannot have any dummy elements.
- clip_rect(min_x, min_y, max_x, max_y, unit)[source]¶
Add a rectangle to the clip region.
- Parameters:
min_x (float) – X minimum
min_y (float) – Y minimum
max_x (float) – X maximum
max_y (float) – Y maximum
unit (int) – MVIEW_UNIT constants
New in version 5.0.
License: Geosoft Open License
Note: The rectangle will be added to the current clip region.
- clip_rect_ex(min_x, min_y, max_x, max_y, unit, exclude)[source]¶
Add a rectangle to the clip region.
- Parameters:
min_x (float) – X minimum
min_y (float) – Y minimum
max_x (float) – X maximum
max_y (float) – Y maximum
unit (int) – MVIEW_UNIT constants
exclude (int) – Exclude
New in version 5.0.
License: Geosoft Open License
Note: The rectangle will be added to the current clip region.
- col_symbol(name, csymb)[source]¶
Add a colored symbol object to a view.
New in version 5.0.
License: Geosoft Open License
- classmethod color(color)[source]¶
Get a color from a color string label
- Parameters:
color (str) – Color name string
- Returns:
Color int
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: Color strings may be “R”,”G”,”B”,”C”,”M”,”Y”, “H”,”S”,”V”, or “K” or a combination of these characters, each followed by up to three digits specifying a number between 0 and 255. An empty string produce C_ANY_NONE.
You must stay in the same color model, RGB, CMY, HSV or K.
For example “R”, “R127G22”, “H255S127V32”
Characters are not case sensitive.
See also
iColorXXX_MVIEW macros
- classmethod color2_rgb(color, r, g, b)[source]¶
Convert to RGB values.
New in version 6.3.
License: Geosoft Open License
Note: Color component intensities will be in the range 0-255.
See also
- classmethod color_cmy(c, m, y)[source]¶
Return CMY color.
- Parameters:
c (int) – Cyan
m (int) – Magenta
y (int) – Yellow
- Returns:
Color int based on color model.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: Color component intensities must be in the range 0-255.
See also
- classmethod color_descr(color, color_descr)[source]¶
Convert a color to a color string label
- Parameters:
color (int) – COL_ANY variable
color_descr (str_ref) – Color descriptor returned
New in version 5.0.
License: Geosoft Open License
Note: See
color
.
- classmethod color_hsv(h, s, v)[source]¶
Return HSV color.
- Parameters:
h (int) – Hue
s (int) – Saturation
v (int) – Color
- Returns:
Color int based on color model.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: Color component intensities must be in the range 0-255.
See also
- classmethod color_rgb(r, g, b)[source]¶
Return RGB color.
- Parameters:
r (int) – Red
g (int) – Green
b (int) – Blue
- Returns:
Color int based on color model.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
Note: Color component intensities must be in the range 0-255.
See also
- complex_polygon(vv_i, vv_x, vv_y)[source]¶
Draw a polygon with holes in it.
- Parameters:
New in version 5.0.
License: Geosoft Open License
Note: You pass a
GXVV
with polygon sizes and 2 point vvs.
- copy_marked_groups(mvie_wd)[source]¶
Copies all marked groups from one view into another view
New in version 5.0.
License: Geosoft Open License
Note: Projections in source and destination views are used to copy the entities. Entities are clipped by the destination view’s clipping region.
- copy_raw_marked_groups(mvie_wd)[source]¶
Copies all marked groups raw from one view into another
New in version 5.1.2.
License: Geosoft Open License
Note: The projections, and clipping is completly ignored.
- crc_group(name, crc)[source]¶
Compute CRC for a group.
- Parameters:
name (str) – Group name
crc (int) – CRC to start (use
CRC_INIT_VALUE
)
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- crc_view(crc, file)[source]¶
Generate an XML CRC of a View
- Parameters:
crc (int_ref) – CRC returned
file (str) – Name of xml to generate (.zip added)
New in version 6.0.
License: Geosoft Open License
- crc_view_group(group, crc, file)[source]¶
Generate an XML CRC of a Group
- Parameters:
group (str) – Name of Group
crc (int_ref) – CRC returned
file (str) – Name of xml to generate (.zip added)
New in version 6.0.
License: Geosoft Open License
- classmethod create(map, name, mode)[source]¶
Create
GXMVIEW
.- Parameters:
name (str) – View name (maximum
MVIEW_NAME_LENGTH
)mode (int) – MVIEW_OPEN constants
- Returns:
GXMVIEW
, aborts if creation fails- Return type:
New in version 5.0.
License: Geosoft Open License
Note: View scaling is set to mm on the map and the view origin is set to the map origin.
- classmethod create_crooked_section(map, ipj, name, x0, y0, xs, ys, scale, v_ex, dist0, elev, v_vxs, v_vx, v_vy)[source]¶
Creates a new crooked section view.
- Parameters:
ipj (GXIPJ) – Geographic projection of input X, Y locations below (without orientation)
name (str) – View Name
x0 (float) – Base view bottom left corner X (mm)
y0 (float) – Base view bottom left corner Y (mm)
xs (float) – Base view size in X (mm)
ys (float) – Base view size in Y (mm)
scale (float) – Map horizontal scale (X-axis)
v_ex (float) – Vertical exaggeration (1.0 is normal, must be >0.0)
dist0 (float) – Starting distance at the left side of the view.
elev (float) – Elevation at TOP of the view
v_vxs (GXVV) – Cumulative distances along the secton
v_vx (GXVV) – True X locations along the section
v_vy (GXVV) – True Y locations along the section
- Returns:
GXMVIEW
, aborts if creation fails- Return type:
New in version 7.2.
License: Geosoft Open License
Note: A crooked section is a section running vertically beneath a path of (X, Y) locations, like a river. This view supports linking to other plan, section, or 3D views. The data view coordinates are set up so that vertical coordinate corresponds to elevation, and the X coordinate is the distance along the crooked feature, beginning at zero on the left, but the status bar will show the true (X, Y, Z) location.
If the scale is set to
rDUMMY
, then it will be calculated so that the points will all fit horizontally.
- classmethod create_crooked_section_data_profile(map, ipj, name, x0, y0, xs, ys, scale, dist0, min_z, max_z, log_z, v_vxs, v_vx, v_vy)[source]¶
Creates a new crooked section data profile view.
- Parameters:
ipj (GXIPJ) – Geographic projection of input X, Y locations below (without orientation)
name (str) – View Name
x0 (float) – Base view bottom left corner X (mm)
y0 (float) – Base view bottom left corner Y (mm)
xs (float) – Base view size in X (mm)
ys (float) – Base view size in Y (mm)
scale (float) – Map horizontal scale (X-axis)
dist0 (float) – Starting distance at the left side of the view.
min_z (float) – Data value at bottom of the view
max_z (float) – Data value at top of the view
log_z (int) – Make logarithmic Y-axis (0:No, 1:Yes)?
v_vxs (GXVV) – Cumulative distances along the secton
v_vx (GXVV) – True X locations along the section
v_vy (GXVV) – True Y locations along the section
- Returns:
GXMVIEW
, aborts if creation fails- Return type:
New in version 7.2.
License: Geosoft Open License
Note: This is the same as
create_crooked_section
, except that the vertical axis plots a data value, not elevation, and allows for logarithmic scaling.See Also:
create_crooked_section
.
- create_plane(plane)[source]¶
Create a 3D Plane for 2D Groups
- Parameters:
plane (str) – Name of Plane
- Returns:
x - Index of plane
- Return type:
int
New in version 5.1.2.
License: Geosoft Open License
- csymb_3d(CSYMB3D, name)[source]¶
Add a 3D coloured symbol (
GXCSYMB3D
) object to the view.- Parameters:
name (str) – Name Maximum length is
MVIEW_NAME_LENGTH
New in version 2024.1.
License: Geosoft Open License
- cylinder_3d(start_x, start_y, start_z, end_x, end_y, end_z, start_radius, end_radius, flags)[source]¶
Draw a 3D cylinder
- Parameters:
start_x (float) – Start X
start_y (float) – Start Y
start_z (float) – Start Z
end_x (float) – End X
end_y (float) – End Y
end_z (float) – End Z
start_radius (float) – Start Radius (can be zero)
end_radius (float) – End Radius (can be zero)
flags (int) – MVIEW_CYLINDER3D constants
New in version 5.1.6.
License: Geosoft Open License
Note: The Fill color is used to color the cylinder. The flags determine if the cylinder is open and what end are closed. Note that you can create cones by specifying a 0 radius for one of the ends.
- datalinkd(datalinkd, name)[source]¶
Add a Data Link Display (
GXDATALINKD
) object to the view.- Parameters:
name (str) – Name Maximum length is
MVIEW_NAME_LENGTH
New in version 6.4.
License: Geosoft Open License
- define_plane_3d(center_x, center_y, center_z, x_vector_x, x_vector_y, x_vector_z, y_vector_x, y_vector_y, y_vector_z)[source]¶
Define a 2D drawing plane based on point and normal
- Parameters:
center_x (float) – Center point X
center_y (float) – Center point Y
center_z (float) – Center point Z
x_vector_x (float) – X Vector X
x_vector_y (float) – X Vector Y
x_vector_z (float) – X Vector Z
y_vector_x (float) – Y Vector X
y_vector_y (float) – Y Vector Y
y_vector_z (float) – Y Vector Z
New in version 5.1.6.
License: Geosoft Open License
Note: 2D rendering commands are translated to 3D commands based on the plane.
- define_viewer_axis_3d(center_x, center_y, center_z, dir_point_x, dir_point_y, dir_point_z)[source]¶
Define a 2D drawing plane based on the user’s view that oriented around the vector.
- Parameters:
center_x (float) – Center point X
center_y (float) – Center point Y
center_z (float) – Center point Z
dir_point_x (float) – Directional Point X
dir_point_y (float) – Directional Point Y
dir_point_z (float) – Directional Point Z
New in version 5.1.6.
License: Geosoft Open License
- define_viewer_plane_3d(center_x, center_y, center_z)[source]¶
Define a 2D drawing plane based on the user’s view.
- Parameters:
center_x (float) – Center point X
center_y (float) – Center point Y
center_z (float) – Center point Z
New in version 5.1.6.
License: Geosoft Open License
Note: The plane is always facing the viewer. Otherwise the this is identical to the previous
- del_marked_groups()[source]¶
Delete marked groups.
New in version 5.0.
License: Geosoft Open License
- delete_ext_clip_ply(ext_ply)[source]¶
Deletes an extended clip
GXPLY
object used by this view.- Parameters:
ext_ply (int) – Extended ClipPLY number
New in version 6.0.
License: Geosoft Open License
- delete_folder_2d(name)[source]¶
Delete a 3DView folder.
- Parameters:
name (str) – Folder name.
New in version 2022.1.
License: Geosoft Open License
- delete_folder_3d(guid)[source]¶
Delete a Map folder.
- Parameters:
guid (str) – Folder GUID.
New in version 9.10.
License: Geosoft Open License
- delete_group(group)[source]¶
Delete a group.
- Parameters:
group (str) – Group name
New in version 5.1.8.
License: Geosoft Open License
Note: Does nothing if the group does not already exist.
- delete_group_itr(group)[source]¶
Deletes existing
GXITR
associated with a group.- Parameters:
group (int) – Group number
New in version 9.3.
License: Geosoft Open License
Note: A group
GXITR
associate a color distribution with mixed vector groups (e.g. Drillhole Lithology tubes) groups. Used by legend UI support in 3D. Note that modifying this information does not currently change the group contents and a group needs to be regenerated (e.g. with maker) to refresh the objects.
- delete_group_storage(group, storage_name)[source]¶
Deletes existing generic storage associated with a group.
- Parameters:
group (int) – Group number
storage_name (str) – Storage name
New in version 9.3.
License: Geosoft Open License
Note: External API users should not use storage names starting with “Geosoft”
- delete_group_tpat(group)[source]¶
Deletes existing
GXTPAT
associated with a group.- Parameters:
group (int) – Group number
New in version 9.3.
License: Geosoft Open License
Note: A group
GXTPAT
associate a thematic color map with mixed vector groups (e.g. Drillhole Lithology tubes) groups. Used by legend UI support in 3D. Note that modifying this information does not currently change the group contents and a group needs to be regenerated (e.g. with maker) to refresh the objects.
- delete_plane(plane, del_grp)[source]¶
Delete a plane in a view
- Parameters:
plane (int) – Plane number to delete
del_grp (int) – TRUE to delete all groups on the plane
New in version 5.1.2.
License: Geosoft Open License
Note: If the groups on the plane are not deleted, they will remain in the 3D view as “New” groups but will be unassigned to a plane. The SetAllNewGroupsToPlane function can be used to assign these groups to a different plane.
- draw_object_3d(type, mode, objects, default_count, vert_v_vx, vert_v_vy, vert_v_vz, norm_v_vx, norm_v_vy, norm_v_vz, color_vv, index_vv, count_vv)[source]¶
Draw a 3D object optimized for rendering
- Parameters:
type (int) – MVIEW_DRAWOBJ3D_ENTITY constants
mode (int) – MVIEW_DRAWOBJ3D_MODE constants
objects (int) – Number of Objects
default_count (int) – Default Count (if variable and not specified)
vert_v_vx (GXVV) – Verticies X
vert_v_vy (GXVV) – Verticies Y
vert_v_vz (GXVV) – Verticies Z
norm_v_vx (GXVV) – Normals X (can be NULL)
norm_v_vy (GXVV) – Normals Y (can be NULL)
norm_v_vz (GXVV) – Normals Z (can be NULL)
New in version 6.2.
License: Geosoft Open License
- draw_surface_3d_ex(group_name, vert_v_vx, vert_v_vy, vert_v_vz, norm_v_vx, norm_v_vy, norm_v_vz, color_vv, color, tri_vv_pt1, tri_vv_pt2, tri_vv_pt3, ipj)[source]¶
Draw a 3D object built from triangles
- Parameters:
New in version 7.0.
License: Geosoft Open License
Note: Provide one normal per vertex. Triangles are defined by indices into the set of vertices.
- draw_surface_3d_from_file(group_name, surface_file)[source]¶
Draw a 3D object from a surface file
- Parameters:
group_name (str) – Group name
surface_file (str) – Surface file
New in version 7.0.
License: Geosoft Open License
- draw_vector_voxel_vectors(vox, group, itr, scale_factor, height_base_ratio, max_base_size_ratio, cutoff_value, max_vectors)[source]¶
Display vectors from a vector voxel in the view.
- Parameters:
group (str) – View group name Maximum length is
MVIEW_NAME_LENGTH
itr (GXITR) – Image transform - must contain zones
scale_factor (float) – Vector length scale factor - w.r.t. the voxel minimum horizontal cell size (default 1)
height_base_ratio (float) – Ratio of the vector cone height to its base (default 4)
max_base_size_ratio (float) – Ratio of maximum base size to minimum horizontal cell size (default 0.25)
cutoff_value (float) – Cutoff value - do not plot vectors with amplitudes less than this value (
rDUMMY
or 0 to plot all)max_vectors (int) – Maximum number of vectors - decimate as required to reduce (
iDUMMY
to plot all)
New in version 7.6.
License: Geosoft Open License
Note: This will result in a
GXVECTOR3D
group object within the view
- draw_vectors_3d(group, vv_x, vv_y, vv_z, vv_vx, vv_vy, vv_vz, itr, scale_for_max_vector, height_base_ratio, max_base_size_ratio)[source]¶
Display vectors in the view.
- Parameters:
group (str) – View group name Maximum length is
MVIEW_NAME_LENGTH
vv_x (GXVV) – X locations
vv_y (GXVV) – Y locations
vv_z (GXVV) – Z locations
vv_vx (GXVV) – Vector X component
vv_vy (GXVV) – Vector Y component
vv_vz (GXVV) – Vector Z component
itr (GXITR) – Image transform - must contain zones
scale_for_max_vector (float) – Scale factor for the longest vector in map units / vector units. Vector lengths for the rest of the vectors scale by the square root of the vector amplitudes. This results in the apparent (viewed) area of the vector being proportional to the amplitude.
height_base_ratio (float) – Ratio of the vector cone height to its base (default 4)
max_base_size_ratio (float) – Maximum base size in view units. Leave blank (dummy) for no limit. If applied this can make larger vectors skinnier, but does not reduce the length, so they don’t obscure other vectors as much.
New in version 8.0.1.
License: Geosoft Open License
- easy_maker(name, groups)[source]¶
Used for GX makers which use both maps and databases.
- Parameters:
name (str) – Maker name, used in menu prompt
groups (str) – INI groups (terminate each with a “;”)
New in version 5.0.
License: Geosoft Open License
- ellipse(x, y, radius, ratio, angle)[source]¶
Draw an ellipse
- Parameters:
x (float) – Center x
y (float) – Center y
radius (float) – Radius
ratio (float) – Ratio x/y
angle (float) – Angle
New in version 5.0.
License: Geosoft Open License
- emf_object(min_x, min_y, max_x, max_y, file)[source]¶
Add an EMF file data object to the view.
- Parameters:
min_x (float) – Min X
min_y (float) – Min Y
max_x (float) – Max X
max_y (float) – Max Y
file (str) – EMF File holding data
New in version 6.4.
License: Geosoft Open License
- exist_group(name)[source]¶
Checks to see if a group exists.
- Parameters:
name (str) – Group name
- Returns:
0 - group does not exist. 1 - group exists.
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- ext_clip_ply_list(lst)[source]¶
Get the names of existing extended clip
GXPLY
objects in this view as list.New in version 6.0.
License: Geosoft Open License
- extent(what, unit, min_x, min_y, max_x, max_y)[source]¶
Get the view extents
- Parameters:
what (int) – MVIEW_EXTENT constants
unit (int) – MVIEW_EXTENT_UNIT constants
min_x (float_ref) – X minimum
min_y (float_ref) – Y minimum
max_x (float_ref) – X maximum
max_y (float_ref) – Y maximum
New in version 5.0.
License: Geosoft Open License
Note: The CLIP region is the current view window or the limits of the current clip polygon.
If
MVIEW_EXTENT_ALL
is requested and the view has no groups, the clip extents are returned.If clip extents are requested and there are no clip extents, an area 0.0,0.0 1.0,1.0 is returned.
The
MVIEW_EXTENT_VISIBLE
flag will return the union of theMVIEW_EXTENT_CLIP
area and the extents of all non-masked visible groups in the view.
- external_string_object(min_x, min_y, max_x, max_y, name, cl, data)[source]¶
Add an external string data object to the view.
- Parameters:
min_x (float) – Min X
min_y (float) – Min Y
max_x (float) – Max X
max_y (float) – Max Y
name (str) – Name of external object
cl (str) – Class of external object
data (str) – String data of external object
New in version 5.0.
License: Geosoft Open License
- fill_color(color)[source]¶
Set the fill color.
- Parameters:
color (int) – Color
New in version 5.0.
License: Geosoft Open License
- find_group(group_name)[source]¶
Find a Group by name.
- Parameters:
group_name (str) – Group name
- Returns:
Group Number.
- Return type:
int
New in version 7.2.
License: Geosoft Open License
- find_group_by_guid(guid)[source]¶
Find a Group by name.
- Parameters:
guid (str) – GUID
- Returns:
Group Number.
- Return type:
int
New in version 9.3.
License: Geosoft Open License
- find_plane(plane)[source]¶
Find a plane in a view
- Parameters:
plane (str) – Name of the plane
- Returns:
Plane number, -1 if not found
- Return type:
int
New in version 5.1.2.
License: Geosoft Open License
- fit_map_window_3d(m_min_x, m_min_y, m_max_x, m_max_y, v_min_x, v_min_y, v_max_x, v_max_y)[source]¶
Set the 2D view window for a 3D view.
- Parameters:
m_min_x (float) – X minimum (mm) of the area in map relative to map origin
m_min_y (float) – Y minimum ..
m_max_x (float) – X maximum ..
m_max_y (float) – Y maximum ..
v_min_x (float) – Min X in ground coordinate to fit to the area defined above
v_min_y (float) – Min Y in ground coordinate ..
v_max_x (float) – Max X in ground coordinate ..
v_max_y (float) – Max Y in ground coordinate ..
New in version 5.1.2.
License: Geosoft Open License
Note: 3D views are placed in 2D maps within a 2D mapping window that is analgous to a 2D View. This allows all 2D functions (such as changing a view location and size) to treat a 3D view just like a 2D view.
The
fit_map_window_3d
function allows you to locate and set the “apparent” 2D mapping of a 3D view on the map. An intial map window is established as specified on the map, and the view scaling is established to fit the specified area within that map area.
- fit_window(m_min_x, m_min_y, m_max_x, m_max_y, v_min_x, v_min_y, v_max_x, v_max_y)[source]¶
Fit an area in ground coordinates to an area in mm on map.
- Parameters:
m_min_x (float) – X minimum (mm) of the area in map relative to map origin
m_min_y (float) – Y minimum ..
m_max_x (float) – X maximum ..
m_max_y (float) – Y maximum ..
v_min_x (float) – Min X in ground coordinate to fit to the area defined above
v_min_y (float) – Min Y in ground coordinate ..
v_max_x (float) – Max X in ground coordinate ..
v_max_y (float) – Max Y in ground coordinate ..
New in version 5.0.
License: Geosoft Open License
Note: X and Y scales will be redefined and the units will be set to <unknown>. Coordinate ranges must be greater than 0.0.
See also
- classmethod font_weight_lst(lst)[source]¶
Fill a
GXLST
with the different font weights.New in version 5.1.
License: Geosoft Open License
- gen_new_group_name(group, new_name)[source]¶
Generate the name of a group from a base name that is new. (always unique and won’t overwrite existing objects).
- Parameters:
group (str) – Base Name of group
new_name (str_ref) – New Name of group
New in version 5.0.8.
License: Geosoft Open License
- get_3d_group_flags(group_num)[source]¶
Get a 3D geometry group’s 3D rendering flags.
- Parameters:
group_num (int) – Group number
- Returns:
Combination of MVIEW_3D_RENDER constants flags or 0
- Return type:
int
New in version 9.1.
License: Geosoft Open License
- get_3d_point_of_view(x, y, z, distance, declination, inclination)[source]¶
Get 3D point of view (values are will be
rDUMMY
if view for 2D views)- Parameters:
New in version 9.2.
License: Geosoft Open License
- get_3d_snapshots()[source]¶
Get the list of 3D snapshots in a 3D view.
New in version 9.9.
License: Geosoft Open License
Note: Returns name/guid pairs.
- get_agg_file_names(group, vv)[source]¶
Get the names of grid files stored in an
GXAGG
.New in version 5.1.5.
License: Geosoft Open License
Note: The group must be an
GXAGG
group. Check this usingis_group
andMVIEW_IS_AGG
.
- get_aggregate(group)[source]¶
Get an existing Aggregate object from the view.
New in version 9.2.
License: Geosoft Open License
Note: This method returns a cached object owned by the
GXMVIEW
and will be destroyed automatically when theGXMVIEW
is disposed
- get_class_name(cl, name)[source]¶
Get a class name.
- Parameters:
cl (str) – Class
name (str_ref) – Name
New in version 5.1.2.
License: Geosoft Open License
Note:
GXMVIEW
class names are intended to be used to record the names of certain classes in the view, such as “Plane” for the default drawing plane.
- get_clip_ply(poly)[source]¶
Get clipping polygons, in the user projection
- Parameters:
poly (GXPLY) – Poly
New in version 5.0.
License: Geosoft Open License
Note: The returned
GXPLY
is recast into the User projection. For oriented views (especially sections), useget_ply
, which returns the ClipGXPLY
in the view’s native projection (e.g. the one set usingset_ipj
).
- get_col_symbol(group)[source]¶
Get an existing colored symbol object from the view.
New in version 9.2.
License: Geosoft Open License
Note: This method returns a cached object owned by the
GXMVIEW
and will be destroyed automatically when theGXMVIEW
is disposed
- get_csymb_3d(group)[source]¶
Get an existing 3D coloured symbol
GXCSYMB3D
object from the view.New in version 2024.1.
License: Geosoft Open License
Note: This method returns a cached object owned by the
GXMVIEW
and will be destroyed automatically when theGXMVIEW
is disposed
- get_datalinkd(group)[source]¶
Get an existing Data Link Display (
GXDATALINKD
) object from the view.- Parameters:
group (int) – Group number
- Returns:
GXDATALINKD
object- Return type:
New in version 9.2.
License: Geosoft Open License
Note: This method returns a cached object owned by the
GXMVIEW
and will be destroyed automatically when theGXMVIEW
is disposed
- get_def_plane(name)[source]¶
Get the default drawing plane.
- Parameters:
name (str_ref) – Name
New in version 5.1.2.
License: Geosoft Open License
Note: 2D drawing to a 3D View will always be placed on the default drawing plane. If no default drawing plane has been set, the first valid plane in the view is used as the default drawing plane.
- get_ext_clip_ply(ext_ply, ply)[source]¶
Get an extended clip
GXPLY
object used by this view.New in version 6.0.
License: Geosoft Open License
- get_folder_items_2d(parent_name)[source]¶
Get the list of key-value pairs representing the name(key) and the type(value) of all children in the specified parent folders in the
GXMVIEW
.- Parameters:
parent_name (str) – Parent folder name, or empty string for root MVIEW
- Return type:
New in version 9.10.
License: Geosoft Open License
Note: Returns name/type pairs. Types can be ‘Folder’, ‘Group’ or ‘Unknown’
- get_folder_items_3d(parent_guid)[source]¶
Get the list of folders in the
GXMVIEW
.- Parameters:
parent_guid (str) – Folder parent GUID, or empty string for parent MVIEW
- Return type:
New in version 9.10.
License: Geosoft Open License
Note: Returns name/guid pairs. Empty GUID indicates item is a group.
- get_group_ext_clip_ply(group, ext_ply)[source]¶
Gets extended clip information for group in view.
- Parameters:
New in version 6.0.
License: Geosoft Open License
- get_group_extent(group_name, xmin, ymin, xmax, ymax, unit)[source]¶
Get extent of a group in a view
- Parameters:
group_name (str) – Group name
xmin (float_ref) – Minimum X, returned
ymin (float_ref) – Minimum Y, returned
xmax (float_ref) – Maximum X, returned
ymax (float_ref) – Maximum Y, returned
unit (int) – MVIEW_UNIT constants
New in version 5.0.
License: Geosoft Open License
- get_group_freeze_scale(group_num, scale)[source]¶
Get a scale freezing value for the group (
rDUMMY
for disabled).- Parameters:
group_num (int) – Group number
scale (float_ref) – Variable to fill with freeze scale
New in version 7.2.
License: Geosoft Open License
- get_group_guid(group, guid)[source]¶
Gets a GUID of a group in the
GXMVIEW
.- Parameters:
group (int) – Group number
guid (str_ref) – GUID
New in version 9.3.
License: Geosoft Open License
Note: If a GUID was never queried a new one will be assigned and the map will be modified. Only if the map is saved will this value then persist.
- get_group_itr(group)[source]¶
Get group
GXITR
- Parameters:
group (int) – Group number
- Return type:
New in version 9.3.
License: Geosoft Open License
Note: A group
GXITR
associate a color distribution with mixed vector groups (e.g. Drillhole Lithology tubes) groups. Used by legend UI support in 3D. Note that modifying this information does not currently change the group contents and a group needs to be regenerated (e.g. with maker) to refresh the objects.
- get_group_tpat(group)[source]¶
Get group
GXTPAT
- Parameters:
group (int) – Group number
- Return type:
New in version 9.3.
License: Geosoft Open License
Note: A group
GXTPAT
associate a thematic color map with mixed vector groups (e.g. Drillhole Lithology tubes) groups. Used by legend UI support in 3D. Note that modifying this information does not currently change the group contents and a group needs to be regenerated (e.g. with maker) to refresh the objects.
- get_group_transparency(group_name, trans)[source]¶
Gets the transparency value of group
- Parameters:
group_name (str) – Group name
trans (float_ref) – Transparency (1.0 - Opaque, 0.0 - Transparent)
New in version 6.0.
License: Geosoft Open License
- get_guid(guid)[source]¶
Gets the GUID of the
GXMVIEW
.- Parameters:
guid (str_ref) – GUID
New in version 9.3.
License: Geosoft Open License
Note: If a GUID was never queried a new one will be assigned and the map will be modified. Only if the map is saved will this value then persist.
- get_ipj(ipj)[source]¶
Get the projection of the view.
New in version 5.0.
License: Geosoft Open License
- get_maker_name(group, str_val)[source]¶
Used to retrieve the maker for a particular view group.
- Parameters:
group (int) – Group number
str_val (str_ref) – String in which to place the maker name
New in version 9.7.
License: Geosoft Open License
- get_map()[source]¶
Get the
GXMAP
of the view.New in version 7.2.
License: Geosoft Open License
- get_map_scale()[source]¶
Get the current map scale of the view
- Returns:
The current map scale to 6 significant digits
- Return type:
float
New in version 5.0.
License: Geosoft Open License
- get_meta(group, meta)[source]¶
Retrieves Metadata from a group
New in version 5.1.6.
License: Geosoft Open License
- get_name(name)[source]¶
Gets the name of a view.
- Parameters:
name (str_ref) – View name returned
New in version 5.0.
License: Geosoft Open License
- get_name_ext_clip_ply(ext_ply, name)[source]¶
Get the name of the extended clip
GXPLY
object in this view.- Parameters:
ext_ply (int) – Extended ClipPLY number
name (str_ref) – Name
New in version 6.0.
License: Geosoft Open License
- get_plane_clip_ply(plane, pply)[source]¶
Get the Plane Clip Region
- Parameters:
plane (int) – Plane index
pply (GXPLY) – Clip Region
New in version 6.0.
License: Geosoft Open License
Note: By default it is the View’s Clip Region
- get_plane_equation(plane, pitch, yaw, roll, x, y, z, sx, sy, sz)[source]¶
Get the equation of a plane
- Parameters:
plane (int) – Plane index
pitch (float_ref) – Rotation about X (Y toward Z +ve, between -360 and 360)
yaw (float_ref) – Rotation about Y (Z toward X +ve, between -360 and 360)
roll (float_ref) – Rotation about Z (Y toward X +ve, between -360 and 360)
x (float_ref) – X offset of plane
y (float_ref) – Y offset of plane
z (float_ref) – Z offset of plane
sx (float_ref) – X scale
sy (float_ref) – Y scale
sz (float_ref) – Z scale
New in version 5.1.2.
License: Geosoft Open License
- get_plane_surf_info(plane, sample, base, scale, min, max)[source]¶
Get the surface information
- Parameters:
New in version 9.9.
License: Geosoft Open License
- get_plane_surface(plane, surface)[source]¶
Get the surface image of a plane
- Parameters:
plane (int) – Plane index
surface (str_ref) – Optional surface image/grid name, can be empty
New in version 9.9.
License: Geosoft Open License
- get_ply(poly)[source]¶
Get clipping polygons, in the base projection
- Parameters:
poly (GXPLY) – Poly
New in version 6.0.
License: Geosoft Open License
Note: This should be used to get the clipping polygon for oriented views (especially sections).
- get_reg()[source]¶
Get the
GXREG
of the view.New in version 5.0.5.
License: Geosoft Open License
- get_surface_filename(group, filename)[source]¶
Get the surface filename.
- Parameters:
group (str) – Group name
filename (str_ref) – filename returned
New in version 9.7.
License: Geosoft Open License
Note: The group must be a
GXSURFACE
group. Check this usingis_group
andMVIEW_IS_GENSURF
orMVIEW_IS_VOXSURF
.
- get_user_ipj(ipj)[source]¶
Get the user projection of the view.
New in version 5.0.
License: Geosoft Open License
- get_vector_3d(group)[source]¶
Get an existing
GXVECTOR3D
object from the view.- Parameters:
group (int) – Group number
- Returns:
GXVECTOR3D
object- Return type:
New in version 9.3.
License: Geosoft Open License
Note: This method returns a cached object owned by the
GXMVIEW
and will be destroyed automatically when theGXMVIEW
is disposed
- get_view_plane_equation(pitch, yaw, roll, x, y, z, sx, sy, sz)[source]¶
Get the View’s Plane Equation
- Parameters:
New in version 5.1.2.
License: Geosoft Open License
- get_voxd(group)[source]¶
Get an existing
GXVOXD
object from the view.New in version 8.2.
License: Geosoft Open License
Note: This method returns a cached object owned by the
GXMVIEW
and will be destroyed automatically when theGXMVIEW
is disposed
- grid(x_inc, y_inc, dx, dy, grid_type)[source]¶
Draw a grid in the current window
- Parameters:
x_inc (float) – X grid increment
y_inc (float) – Y grid increment
dx (float) – dX dot increment/cross X size
dy (float) – dY dot increment/cross Y size
grid_type (int) – MVIEW_GRID constants
New in version 5.0.
License: Geosoft Open License
Note: The grid will be drawn in the current window specified by the last SetWindow call.
See also
- group_clip_mode(mode)[source]¶
Set the Clipping mode on or off for new groups.
- Parameters:
mode (int) – MVIEW_CLIP constants
New in version 5.0.
License: Geosoft Open License
Note: All new groups will be clipped.
- group_itr_exists(group)[source]¶
Determine if group
GXITR
exists.- Parameters:
group (int) – Group number
- Returns:
- Return type:
int
New in version 9.3.
License: Geosoft Open License
Note: A group
GXITR
associate a color distribution with mixed vector groups (e.g. Drillhole Lithology tubes) groups. Used by legend UI support in 3D. Note that modifying this information does not currently change the group contents and a group needs to be regenerated (e.g. with maker) to refresh the objects.
- group_name(group_num, group_name)[source]¶
Get a group name
- Parameters:
group_num (int) – Group number, error if not valid
group_name (str_ref) – Group Name
New in version 7.2.
License: Geosoft Open License
- group_storage_exists(group, storage_name)[source]¶
Determine if generic storage associated with a group exists.
- Parameters:
group (int) – Group number
storage_name (str) – Storage name
- Returns:
1 - storage exists, 0 - storage does not exist
- Return type:
int
New in version 9.3.
License: Geosoft Open License
Note: External API users should not use storage names starting with “Geosoft”
- group_to_ply(name, pply)[source]¶
Save all polygons in group into
GXPLY
obj.New in version 5.0.
License: Geosoft Open License
Note: The coordinates will be in the working coordinate system of the view. The SetWorkingIPJ_MVIEW method can be used to change the working coordinate system. This function will return an empty
GXPLY
if the group is hidden.
- group_tpat_exists(group)[source]¶
Determine if group
GXTPAT
exists.- Parameters:
group (int) – Group number
- Returns:
- Return type:
int
New in version 9.3.
License: Geosoft Open License
Note: A group
GXTPAT
associate a thematic color map with mixed vector groups (e.g. Drillhole Lithology tubes) groups. Used by legend UI support in 3D. Note that modifying this information does not currently change the group contents and a group needs to be regenerated (e.g. with maker) to refresh the objects.
- hide_marked_groups(mode)[source]¶
Hide/Show marked groups.
- Parameters:
mode (int) – MVIEW_HIDE constants
New in version 5.0.
License: Geosoft Open License
- hide_shadow_2d_interpretations(mode)[source]¶
Hide/Show 2d shadow interpretations.
- Parameters:
mode (int) – MVIEW_HIDE constants
New in version 8.5.
License: Geosoft Open License
- is_group(group, what)[source]¶
Query a status or characteristic of a group
- Parameters:
group (str) – Group name
what (int) – MVIEW_IS constants
- Returns:
TRUE or FALSE (1 or 0)
- Return type:
int
New in version 5.0.5.
License: Geosoft Open License
- is_group_empty(group)[source]¶
Is the group empty?
- Parameters:
group (str) – Group name
- Returns:
TRUE or FALSE (1 or 0)
- Return type:
int
New in version 6.3.
License: Geosoft Open License
- is_group_exportable(group)[source]¶
Query whether the group is an exportable type.
- Parameters:
group (str) – Group name
- Returns:
TRUE or FALSE (1 or 0)
- Return type:
int
New in version 9.7.
License: Geosoft Open License
- is_movable()[source]¶
Is this view movable?
- Return type:
bool
New in version 6.4.
License: Geosoft Open License
Note: Views are always physically movable in the API, this flag is for preventing accidental moving in the
GXGUI
. By default views are not movable.
- is_null()[source]¶
Check if this is a null (undefined) instance
- Returns:
True if this is a null (undefined) instance, False otherwise.
- Return type:
bool
- is_plane_visible(plane)[source]¶
Is the plane visible?
- Parameters:
plane (str) – Name of the plane
- Return type:
bool
New in version 9.7.
License: Geosoft Open License
- is_projection_empty()[source]¶
Returns 1 if the view projection and view user projection are both empty (undefined).
- Returns:
1 if the view projection and view user projection are both empty.
- Return type:
int
New in version 9.0.
License: Geosoft Open License
Note: Use, for instance, to see if the map view contains projection information. The first time you add data that has projection information you should set up an empty view projection so that subsequent data added with a different projection is properly displayed in relation to the initial data.
- is_section()[source]¶
Is the view a section view?
- Returns:
TRUE if view is a section view.
- Return type:
int
New in version 8.2.
License: Geosoft Open License
Note: Section views are recognized because their projection contains one of the following orientations:
IPJ_ORIENT_SECTION
- Target-type sections with Z projection horizontallyIPJ_ORIENT_SECTION_NORMAL
- LikeIPJ_ORIENT_SECTION
, but Z projects perpendicular to the secton plane.IPJ_ORIENT_SECTION_CROOKED
- Crooked sectionsIPJ_ORIENT_3D
- Some Sections extracted from a voxel - e.g. VoxelToGrids, as the voxel can have any orientation in 3D.
- is_surface_item_visible(group, guid)[source]¶
Is the surface item visible?
- Parameters:
group (str) – Group name
guid (str) – Item GUID
- Return type:
bool
New in version 9.7.
License: Geosoft Open License
- is_surface_plane(plane)[source]¶
Is a surface plane?
- Parameters:
plane (str) – Name of the plane
- Return type:
bool
New in version 9.7.
License: Geosoft Open License
- is_view_3d()[source]¶
Is the view 3D?
- Returns:
TRUE if view is 3D
- Return type:
int
New in version 5.1.2.
License: Geosoft Open License
- is_visible()[source]¶
Is this view visible?
- Return type:
bool
New in version 6.3.
License: Geosoft Open License
- label_fid(vv_x, fid_start, fid_incr, interval, y_loc, y_scale)[source]¶
Label fiducials on a profile
- Parameters:
New in version 5.0.
License: Geosoft Open License
Note: A 1mm long vertical tick is drawn at the place where a label is present. The label is drawn below the tick.
The incoming X
GXVV
is used to define the place for label.
- label_x(l_loc, left, right, lable_int, just, bound, orient)[source]¶
Label annotations on the X axis
- Parameters:
l_loc (float) – Y location in view units
left (float) – Left X
right (float) – Right X
lable_int (float) – Label interval
just (int) – MVIEW_LABEL_JUST constants
bound (int) – MVIEW_LABEL_BOUND constants
orient (int) – MVIEW_LABEL_ORIENT constants
New in version 5.0.
License: Geosoft Open License
Note: Label bounding will justify edge labels to be inside the bar limits. But bounding does not apply if labels are drawn vertically (top right or top left)
See also
- label_y(x, bottom, top, lable_int, just, bound, orient)[source]¶
Label annotations on the Y axis
- Parameters:
x (float) – X location in view units
bottom (float) – Bottom Y
top (float) – Top Y
lable_int (float) – Label interval
just (int) – MVIEW_LABEL_JUST constants
bound (int) – MVIEW_LABEL_BOUND constants
orient (int) – MVIEW_LABEL_ORIENT constants
New in version 5.0.
License: Geosoft Open License
Note: Label bounding will justify edge labels to be inside the bar limits. But bounding does not apply if labels are drawn vertically (top right or top left)
See also
- line(x0, y0, x1, y1)[source]¶
Draw a line.
- Parameters:
x0 (float) – X0
y0 (float) – Y0
x1 (float) – X1
y1 (float) – Y1
New in version 5.0.
License: Geosoft Open License
- line_color(color)[source]¶
Set the line color.
- Parameters:
color (int) – Color
New in version 5.0.
License: Geosoft Open License
- line_smooth(smooth)[source]¶
Set the line edge smoothing.
- Parameters:
smooth (int) – MVIEW_SMOOTH constants
New in version 6.3.
License: Geosoft Open License
- line_style(style, pitch)[source]¶
Set the style of a line.
- Parameters:
style (int) – Line Style #, see default.lpt
pitch (float) – Pitch in view units
New in version 5.0.
License: Geosoft Open License
Note: Line styles are selected by ordinal value (line style #) from those defined in default.lpt. If default.lpt does not have a the style specified, the file user.lpt is searched. If this file does not contain the line style solid is assumed.
Note that line styles from default.lpt and user.lpt are read into the map at the time the map is created, not at display time.
- line_thick(thick)[source]¶
Set the line thickness.
- Parameters:
thick (float) – Line thickness in view space units
New in version 5.0.
License: Geosoft Open License
- line_vv(gvv)[source]¶
Draw line segments stored in a GS_D2LINE
GXVV
.New in version 5.0.
License: Geosoft Open License
- link(db, name)[source]¶
Make a link to a database.
- Parameters:
db (GXDB) – Database handle
name (str) – Link name
New in version 5.0.
License: Geosoft Open License
- list_groups(lst, flag)[source]¶
Get a list of the groups in a view.
- Parameters:
lst (GXLST) – List
flag (int) – MVIEW_GROUP_LIST constants
- Returns:
Number of groups in the list
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- list_plane_groups(plane, lst)[source]¶
List all groups in a specific plane of a 3D view
- Parameters:
plane (int) – Plane number
lst (GXLST) – List of plane names and numbers
New in version 5.1.2.
License: Geosoft Open License
Note: The group names are placed in the list names, group numbers are placed in the list values.
Groups are added to the end of the
GXLST
.
- list_planes(lst)[source]¶
List all planes in a 3D view
- Parameters:
lst (GXLST) – List of plane names and numbers
New in version 5.1.2.
License: Geosoft Open License
Note: The plane names are placed in the list names, plane numbers are placed in the list values.
Planes are added to the end of the
GXLST
.
- maker(db, map, prog, type, name, groups)[source]¶
Generates a Maker for the database and/or map.
- Parameters:
db (int) – Database required? (0 = No, 1 = Yes)
map (int) – Map required? (0 = No, 1 = Yes)
prog (str) – Program name
type (int) – MAKER constants
name (str) – Maker name, used in menu prompt
groups (str) – INI groups (terminate each with a “;”)
New in version 5.0.
License: Geosoft Open License
- map_origin(x_origin, y_origin)[source]¶
Get the map origin from a view
- Parameters:
New in version 5.0.
License: Geosoft Open License
- mark_all_groups(mark)[source]¶
Mark or unmark all groups.
- Parameters:
mark (int) – 0 - unmark, 1 - mark
New in version 5.0.
License: Geosoft Open License
- mark_empty_groups(mark)[source]¶
Mark/unmark all empty groups.
- Parameters:
mark (int) – 0 - unmark, 1 - mark
New in version 6.3.
License: Geosoft Open License
- mark_group(name, mark)[source]¶
Mark or unmark a specific group
- Parameters:
name (str) – Group name
mark (int) – 0 - unmark, 1 - mark
New in version 5.0.
License: Geosoft Open License
- measure_text(text, x_min, y_min, x_max, y_max)[source]¶
Compute the bounding rectangle in view units of the text using the current attributes.
- Parameters:
New in version 6.0.
License: Geosoft Open License
Note: Area will be 0 if error occurred (does not fail). This will return the bounding rectangle as if the text was placed at 0,0 and adjusted according to the current text alignment and angle set for the view. Also see notes for
text_size
.
- meta(meta, name)[source]¶
Store Metadata in a group
New in version 5.1.3.
License: Geosoft Open License
- mode_pj(mode)[source]¶
Set the working projection mode
- Parameters:
mode (int) – MVIEW_PJ constants
New in version 5.0.
License: Geosoft Open License
Note: This controls how your coordinates and attributes will be interpreted. A working projection must be set useing SetWorkingIPJ_MVIEW for this method to have any effect.
See also
SetWorkingIPJ
- move_group_backward(group)[source]¶
Move the group backward one position (render sooner).
- Parameters:
group (str) – Group name
New in version 5.1.1.
License: Geosoft Open License
- move_group_forward(group)[source]¶
Move the group forward one position (render later).
- Parameters:
group (str) – Group name
New in version 5.1.1.
License: Geosoft Open License
- move_group_to_back(group)[source]¶
Move the group to the back (render first).
- Parameters:
group (str) – Group name
New in version 5.1.1.
License: Geosoft Open License
- move_group_to_folder_2d(parent_name, group)[source]¶
Add group to a Map folder in
GXMVIEW
.- Parameters:
parent_name (str) – Parent folder name, or empty string for root
GXMVIEW
.group (int) – Group number
New in version 2022.1.
License: Geosoft Open License
- move_group_to_folder_3d(guid, group)[source]¶
Add group to a 3DView folder in
GXMVIEW
.- Parameters:
guid (str) – Folder parent GUID, or empty string for parent
GXMVIEW
.group (int) – Group number
New in version 9.10.
License: Geosoft Open License
- move_group_to_front(group)[source]¶
Move the group to the front (render last).
- Parameters:
group (str) – Group name
New in version 5.1.1.
License: Geosoft Open License
- north()[source]¶
Returns North direction at center of view.
- Returns:
North direction id deg. azimuth relative to view Y.
- Return type:
float
New in version 5.0.
License: Geosoft Open License
Note: North is calculated from the
GXIPJ
North direction. It will berDUMMY
ifGXIPJ
is unknown.
- num_ext_clip_ply()[source]¶
Get the number of extended clip
GXPLY
objects in this view.- Returns:
Number of PLYs
- Return type:
int
New in version 6.0.
License: Geosoft Open License
- classmethod optimum_tick(min, max, sep)[source]¶
Return a default optimum tick interval
- Parameters:
min (float) – Minimum of range
max (float) – Maximum
sep (float_ref) – Optimum interval
New in version 5.0.
License: Geosoft Open License
- pat_angle(angle)[source]¶
Sets the pattern angle
- Parameters:
angle (float) – Angle
New in version 5.0.
License: Geosoft Open License
Note: Allows the user to apply a rotation to the basic pattern. Care should be taken to ensure that the tiling remains continuous; i.e. if the pattern consists of horizontal lines, only angles of -90, 0, 90, 180 (etc.) would give seamless tiling. However, simple, closed figure, such as a star, could be given any angle. Rotations about the center point (0.5, 0.5) of the unit cell are performed prior to applying PatSize. The default value is 0.0. Setting an angle of -999 inititates the random angle feature, and each pattern tile is rotated to a different angle. Using this along with PatStyle(View,
MVIEW_TILE_RANDOM
) can give a “hand-drawn” effect to geological fills.See the IMPORTANT note for sPatNumber_MVIEW().
- pat_density(density)[source]¶
Sets the tiling density.
- Parameters:
density (float) – Relative density (default = 1).
New in version 5.0.
License: Geosoft Open License
Note: This number is the ratio between the plotted unit cell size and the distance between the plotted tile centers. The default value is 1. A value larger than 1 increases the density of the pattern, while values less than 1 make the pattern more “spread out”. This can be used along with sPatStyleMethod to create more complicated fills from simple patterns.
See the IMPORTANT note for sPatNumber_MVIEW().
- pat_number(number)[source]¶
Sets the pattern number
- Parameters:
number (int) – Pattern number
New in version 5.0.
License: Geosoft Open License
Note: Pattern 0 is solid fill.(default) Set the pattern color using
fill_color
.Patterns are selected by ordinal value (pattern number) from those defined in default.pat. If default.pat does not have a the pattern specified, the file user.pat is searched. If this file does not contain the pattern solid is assumed.
Note that patterns from default.pat and user.pat are read into the map at the time the map is created, not at display time.
IMPORTANT: A call to this function resets all the various pattern attributes to those defined for the selected pattern. If you want to modify any attributes, call that function (e.g. sPatSize_MVIEW(), AFTER you call sPatNumber_MVIEW().
- pat_size(size)[source]¶
Sets the pattern unit cell size (X)
- Parameters:
size (float) – Pattern size in view units
New in version 5.0.
License: Geosoft Open License
Note: See the IMPORTANT note for sPatNumber_MVIEW().
- pat_style(style)[source]¶
Sets the tiling method (i.e. rectangle, triangle)
- Parameters:
style (int) – MVIEW_TILE constants
New in version 5.0.
License: Geosoft Open License
Note: Normally, the unit cell is duplicated across the fill area like floor tiles (
MVIEW_TILE_RECTANGULAR
). DIAGONAL tiling rotates the tiling positions (but not the tiles) by 45 degrees. TRIANGULAR tiling Offsets each succeeding row by half the unit cell size, and lessens the vertical offset, so that the unit cell centers form a triangular grid pattern. RANDOM tiling adds small random offsets in both directions to give the diffuse effect seen on many geological maps.NOTE: Some patterns are designed to be interlocking and may only work “correctly” with one tiling method.
See the IMPORTANT note for sPatNumber_MVIEW().
- pat_thick(thick)[source]¶
Sets the pattern line thickness
- Parameters:
thick (float) – Line thickness as fraction of pattern size (ie. 0.05)
New in version 5.0.
License: Geosoft Open License
Note: See the IMPORTANT note for sPatNumber_MVIEW().
- plot_to_view(x, y)[source]¶
Convert a plot coordinate in mm to a VIEW coordinate.
- Parameters:
New in version 5.0.
License: Geosoft Open License
- point_3d(x, y, z)[source]¶
Draw a 3D point.
- Parameters:
x (float) – X
y (float) – Y
z (float) – Z
New in version 5.1.6.
License: Geosoft Open License
Note: The Line color and line thickness will affect rendering.
- poly_line(type, vv_x, vv_y)[source]¶
Draw a polyline or polygon (dummies deleted).
- Parameters:
type (int) – MVIEW_DRAW constants
vv_x (GXVV) – X coordinates.
vv_y (GXVV) – Y coordinates.
New in version 5.0.
License: Geosoft Open License
Note: Dummies in X and/or Y
GXVV
are deleted and it results in ‘solid’ line. Usingpoly_line_dm
(below) function if gaps from dummies are to be kept.
- poly_line_3d(vv_x, vv_y, vv_z)[source]¶
Draw a 3D polyline.
New in version 5.1.6.
License: Geosoft Open License
Note: Dummies are not allowed in the line. Line Color, Thickness is supported on rendering
- poly_line_dm(vv_x, vv_y)[source]¶
Draw a polyline with gaps defined by dummies in X/Y VVs
New in version 5.0.
License: Geosoft Open License
- poly_wrap(vv_x, vv_y)[source]¶
Draw wrapped polylines from X and Y
GXVV
’s.New in version 5.0.
License: Geosoft Open License
Note: Convert a given VVy into a wrapped VVy using the current view window as the wrap region. Then draw polylines from it.
See also
- polygon_dm(vv_x, vv_y)[source]¶
Like PolyLineDm, but draw polygons.
New in version 5.0.6.
License: Geosoft Open License
- polygon_mply(mply)[source]¶
Draw multiple complex polygons from
GXMPLY
.New in version 9.5.
License: Geosoft Open License
- polygon_ply(ply)[source]¶
Draw a complex polygon from
GXPLY
.New in version 5.1.
License: Geosoft Open License
- re_scale(scale)[source]¶
Change the scale of a view.
- Parameters:
scale (float) – Scale factor (> 0.0)
New in version 5.0.
License: Geosoft Open License
Note: The view size is multiplied by the scale factor. The view location will move relative to the map origin by the scale factor.
- read_group_storage(group, storage_name)[source]¶
Reads existing generic storage associated with a group into an in-memory
GXBF
.- Parameters:
group (int) – Group number
storage_name (str) – Storage name
- Returns:
GXBF
Object- Return type:
New in version 9.3.
License: Geosoft Open License
Note: External API users should not use storage names starting with “Geosoft”
- rectangle(x0, y0, x1, y1)[source]¶
Draw a rectangle.
- Parameters:
x0 (float) – X0
y0 (float) – Y0
x1 (float) – X1
y1 (float) – Y1
New in version 5.0.
License: Geosoft Open License
- relocate_group(group, min_x, min_y, max_x, max_y, asp)[source]¶
Re-locate a group in a view.
- Parameters:
group (str) – Group name
min_x (float) – Area X minimum
min_y (float) – Area Y minimum
max_x (float) – Area X maximum
max_y (float) – Area Y maximum
asp (int) – MVIEW_RELOCATE constants
New in version 5.0.
License: Geosoft Open License
- rename_group(old, new_group_name)[source]¶
Rename a group.
- Parameters:
old (str) – Old group name
new_group_name (str) – New group name
New in version 5.1.1.
License: Geosoft Open License
Note: Does nothing if the group does not already exist.
- render(hdc, left, bottom, right, top, min_x, min_y, max_x, max_y)[source]¶
Render a specified area of view onto a Windows DC handle
- Parameters:
hdc (int) – DC Handle
left (int) – Left value of the render rect in Windows coordinates (bottom>top)
bottom (int) – Bottom value
right (int) – Right value
top (int) – Top value
min_x (float) – Area X minimum
min_y (float) – Area Y minimum
max_x (float) – Area X maximum
max_y (float) – Area Y maximum
New in version 6.4.
License: Geosoft Open License
- render_ex(hdc, left, bottom, right, top, min_x, min_y, max_x, max_y, asp, padding_pixel, text_rendering_hint)[source]¶
Render a specified area of view onto a Windows DC handle, setting the type of it and returning the new data extents
- Parameters:
hdc (int) – DC Handle
left (int) – Left value of the render rect in Windows coordinates (bottom>top)
bottom (int) – Bottom value
right (int) – Right value
top (int) – Top value
min_x (float_ref) – Area X minimum
min_y (float_ref) – Area Y minimum
max_x (float_ref) – Area X maximum
max_y (float_ref) – Area Y maximum
asp (int) – MVIEW_RELOCATE constants
padding_pixel (int) – Add padding to avoid x/y axis border out of view if needed, default 0
text_rendering_hint (int) – A (GDI/Graphics) TextRenderingHint to apply while rendering the MVIEW. A value < 0or null reference will not effect the current TextRenderingHint.
New in version 2022.2.
License: Geosoft Open License
- render_order()[source]¶
Query the view render order
- Returns:
Render order
- Return type:
int
New in version 6.3.
License: Geosoft Open License
Note: Views with lower numbers should render first,
iDUMMY
is undefined
- restore_3d_snapshot(guid)[source]¶
Restore 3D view to specific snapshot state.
- Parameters:
guid (str) – Snapshot GUID
New in version 9.9.
License: Geosoft Open License
- scale_all_group(xs, ys)[source]¶
Scale all groups (except for GRID) in a view
- Parameters:
xs (float) – X scale
ys (float) – Y scale
New in version 5.0.
License: Geosoft Open License
Note: X (and Y) scale is the ratio of the new dimension over the old dimension of a reference object. For example, if a horizontal straight line of 10m long becomes 20m, X scale should be 2.
The view is then scaled back so that the view occupies the same area size as before. The view’s clip area is updated as well.
- scale_mm()[source]¶
Get the horizontal scale in view X units/mm
- Returns:
Returns horizontal scale in view X units/mm
- Return type:
float
New in version 5.0.
License: Geosoft Open License
Note: The scale factor is intended to be used by methods that would like to specify sizes in mm. Examples would be text sizes, line thicknesses and line pitch.
- scale_pj_mm()[source]¶
Get horizontal scale in projected user units/mm
- Returns:
Returns horizontal scale in projected user units/mm
- Return type:
float
New in version 5.0.
License: Geosoft Open License
Note: The scale factor is intended to be used by methods that would like to specify sizes in mm. Examples would be text sizes, line thicknesses and line pitch. Same as rScaleMM if working projection not defined
- scale_window(min_x, min_y, max_x, max_y, bot_x, bot_y, x_scal, y_scal)[source]¶
Assign view coordinates to define a window.
- Parameters:
min_x (float) – X minimum in view coordinates
min_y (float) – Y minimum
max_x (float) – X maximum
max_y (float) – Y maximum
bot_x (float) – X minimum in plot coordinates
bot_y (float) – Y minimum
x_scal (float) – Horizontal scale (view unit/plot unit in mm)
y_scal (float) – Vertical scale
New in version 5.0.
License: Geosoft Open License
Note: The provided coordinates are converted to map mm using the current view translation and scaling. SetWindow is effectively called.
See also
- scale_ymm()[source]¶
Get the vertical scale in Y units/mm
- Returns:
Returns vertical scale in view Y units/mm
- Return type:
float
New in version 5.0.
License: Geosoft Open License
Note: The scale factor is intended to be used by methods that would like to specify sizes in mm. Examples would be text sizes, line thicknesses and line pitch.
- segment(x, y, radius, ratio, angle, start, end)[source]¶
Draw a filled segment of an ellipse.
- Parameters:
x (float) – Center x
y (float) – Center y
radius (float) – Radius
ratio (float) – Ratio x/y
angle (float) – Angle
start (float) – Start angle
end (float) – End angle
New in version 5.0.7.
License: Geosoft Open License
- set_3d_group_flags(group_num, flags)[source]¶
Set a 3D geometry group’s 3D rendering flags.
- Parameters:
group_num (int) – Group number
flags (int) – Combination of MVIEW_3D_RENDER constants flags or 0
New in version 9.1.
License: Geosoft Open License
- set_3d_point_of_view(x, y, z, distance, declination, inclination)[source]¶
Set 3D point of view (no effect on 2D views)
- Parameters:
x (float) – X center
y (float) – Y center
z (float) – Z center
distance (float) – Distance from center
declination (float) – Declination, 0 to 360 CW from Y
inclination (float) – Inclination, -90 to +90
New in version 9.2.
License: Geosoft Open License
- set_3dn(o3dn)[source]¶
Set the
GX3DN
object for this viewNew in version 5.1.2.
License: Geosoft Open License
Note: To make the view a 2D view, set a
GX3DN
of NULL.
- set_all_groups_to_plane(plane)[source]¶
Set all groups to be within one plane
- Parameters:
plane (int) – Plane Index to set all groups to
New in version 5.1.2.
License: Geosoft Open License
- set_all_new_groups_to_plane(plane)[source]¶
Set all groups that are not in any plane to this plane
- Parameters:
plane (int) – Plane Index to set all groups to
New in version 5.1.2.
License: Geosoft Open License
- set_class_name(cl, name)[source]¶
Set a class name.
- Parameters:
cl (str) – Class
name (str) – Name
New in version 5.1.2.
License: Geosoft Open License
Note:
GXMVIEW
class names are intended to be used to record the names of certain classes in the view, such as “Plane” for the default drawing plane.
- set_clip_ply(poly)[source]¶
Set clipping region to a
GXPLY
- Parameters:
poly (GXPLY) – Poly
New in version 5.0.
License: Geosoft Open License
- set_def_plane(name)[source]¶
Set the default drawing plane.
- Parameters:
name (str) – Name
New in version 5.1.2.
License: Geosoft Open License
Note: 2D drawing to a 3D View will always be placed on the default drawing plane. If no default drawing plane has been set, the first valid plane in the view is used as the default drawing plane.
- set_ext_clip_ply(ext_ply, name, ply)[source]¶
Set an extended clip
GXPLY
object used by this view.- Parameters:
ext_ply (int) – Extended ClipPLY number, If greater or equal to the return value of
num_ext_clip_ply
it will be added to the end of the current listname (str) – Name (Has to be unique, otherwise error will be returned)
ply (GXPLY) –
GXPLY
object to set, use a nullGXPLY
to rename an existing object
- Returns:
Index of new or changed
GXPLY
, -1 on error- Return type:
int
New in version 6.0.
License: Geosoft Open License
- set_freeze_scale(scale)[source]¶
Set a scale freezing value into stream (
rDUMMY
for disabled).- Parameters:
scale (float) – Freeze Scale value
New in version 7.2.
License: Geosoft Open License
Note: Objects written after this will override any scale freezing set for the group
- set_group_ext_clip_ply(group, ext_ply)[source]¶
Sets extended clip information for group in view.
- Parameters:
group (str) – Group Name
ext_ply (int) – Extended
GXPLY
number (-1 to clear)
New in version 6.0.
License: Geosoft Open License
- set_group_freeze_scale(group_num, scale)[source]¶
Set a scale freezing value for the group (
rDUMMY
for disabled).- Parameters:
group_num (int) – Group number
scale (float) – Variable to fill with freeze scale
New in version 7.2.
License: Geosoft Open License
- set_group_itr(group, itr)[source]¶
Set group
GXITR
- Parameters:
group (int) – Group number
New in version 9.3.
License: Geosoft Open License
Note: A group
GXITR
associate a color distribution with mixed vector groups (e.g. Drillhole Lithology tubes) groups. Used by legend UI support in 3D. Note that modifying this information does not currently change the group contents and a group needs to be regenerated (e.g. with maker) to refresh the objects.
- set_group_moveable(group, move)[source]¶
Set the movable attribute of a group.
- Parameters:
group (str) – Group name
move (int) – 0 - not movable, 1 - movable
New in version 5.0.5.
License: Geosoft Open License
- set_group_to_plane(plane, group)[source]¶
Set a group to a plane
- Parameters:
plane (int) – Plane Index to set all groups to
group (str) – Name of group to set
New in version 5.1.2.
License: Geosoft Open License
- set_group_tpat(group, tpat)[source]¶
Set group
GXTPAT
- Parameters:
group (int) – Group number
New in version 9.3.
License: Geosoft Open License
Note: A group
GXTPAT
associate a thematic color map with mixed vector groups (e.g. Drillhole Lithology tubes) groups. Used by legend UI support in 3D. Note that modifying this information does not currently change the group contents and a group needs to be regenerated (e.g. with maker) to refresh the objects.
- set_group_transparency(group_name, trans)[source]¶
Sets the transparency value of group
- Parameters:
group_name (str) – Group name
trans (float) – Transparency (1.0 - Opaque, 0.0 - Transparent)
New in version 6.0.
License: Geosoft Open License
- set_ipj(ipj)[source]¶
Set the projection of the view.
New in version 5.0.
License: Geosoft Open License
Note: This function also sets the User
GXIPJ
, and automatically clears the WARP before doing so. This would be equivalent to calling_ClearWarp_IPJ' followed by `set_user_ipj
on the view.
- set_mark_moveable(move)[source]¶
Set the movable attribute of marked groups.
- Parameters:
move (int) – 0 - not movable, 1 - movable
New in version 5.0.5.
License: Geosoft Open License
- set_meta(group, meta, name)[source]¶
Update the
GXMETA
in this group with the new meta object.New in version 5.1.6.
License: Geosoft Open License
- set_movability(movable)[source]¶
Set the view movability
New in version 6.4.
License: Geosoft Open License
Note: Views are always physically movable in the API, this flag is for preventing accidental moving in the
GXGUI
. By default views are not movable.
- set_plane_clip_ply(plane, pply)[source]¶
Set the Plane Clip Region
- Parameters:
plane (int) – Plane index
pply (GXPLY) – Clip Region
New in version 5.1.4.
License: Geosoft Open License
Note: By default it is the View’s Clip Region
- set_plane_equation(plane, pitch, yaw, roll, x, y, z, sx, sy, sz)[source]¶
Set the equation of a plane
- Parameters:
plane (int) – Plane index
pitch (float) – Rotation about X (Z toward Y +ve, between -360 and 360)
yaw (float) – Rotation about Y (Z toward X +ve, between -360 and 360)
roll (float) – Rotation about Z (Y toward X +ve, between -360 and 360)
x (float) – X offset of plane
y (float) – Y offset of plane
z (float) – Z offset of plane
sx (float) – X scale
sy (float) – Y scale
sz (float) – Z scale
New in version 5.1.2.
License: Geosoft Open License
Note: For a grid with the “Y” axis giving elevation: use rotations = (-90, 0, 0) for a section with azimuth 90 (E-W) use rotations = (-90, 0, -90) for a section with azimuth 0 (N-S)
- set_plane_surf_info(plane, sample, base, scale, min, max)[source]¶
Set the surface information
- Parameters:
plane (int) – Plane index
sample (int) – Sample rate (>=1)
base (float) – Base
scale (float) – Scale
min (float) – Min
max (float) – Max
New in version 5.1.2.
License: Geosoft Open License
- set_plane_surface(plane, surface)[source]¶
Set the surface image of a plane
- Parameters:
plane (int) – Plane index
surface (str) – Optional surface image/grid name, can be empty
New in version 5.1.2.
License: Geosoft Open License
- set_render_order(order)[source]¶
Set the view render order
- Parameters:
order (int) – Render order
New in version 6.3.
License: Geosoft Open License
Note: Views with lower numbers should render first,
iDUMMY
is undefined
- set_thin_res(thin)[source]¶
Set polyline/polygon thinning resolution
- Parameters:
thin (float) – Thinning resolution in mm, -1.0 to turn off.
New in version 5.0.
License: Geosoft Open License
Note: The thinning resolution controls the removal of redundant points from polylines and polygons. Points that deviate from a straight line by less than the thinning resolution are removed. This can significantly reduce the size of a
GXMAP
file. We recommend that you set the thinning resolution to 0.02 mm.By default, the thinning resolution is set to 0.05mm.
Set resolution to 0.0 to remove colinear points only.
To turn off thinning after turning it on, call SetThinRes_MVIEW with a resolution of -1.
- set_u_fac(hdc)[source]¶
Set the unit conversion of a view.
- Parameters:
hdc (float) – New UFac value
New in version 5.0.
License: Geosoft Open License
- set_user_ipj(ipj)[source]¶
Set the user projection of the view.
New in version 5.0.
License: Geosoft Open License
- set_visibility(visible)[source]¶
Set the view visibility
New in version 6.3.
License: Geosoft Open License
- set_window(min_x, min_y, max_x, max_y, unit)[source]¶
Set the view window
- Parameters:
min_x (float) – X minimum
min_y (float) – Y minimum
max_x (float) – X maximum
max_y (float) – Y maximum
unit (int) – MVIEW_UNIT constants
New in version 5.0.
License: Geosoft Open License
Note: The current clip region will be set to the clip window.
See also
- set_working_ipj(ipj)[source]¶
Set the working projection of the view.
- Parameters:
ipj (GXIPJ) – The input projection
New in version 5.0.
License: Geosoft Open License
Note: The working projection is the coordinate system of coordinates drawn to the view. The working coordinate system can be different than the view coordinate system, in which case the coordinates are re-projected to the view coordinate system before they are placed in the view.
See also
mode_pj
to control use of the working projection.
- size_symbols(vv_x, vv_y, vv_z)[source]¶
Plot sized symbols
New in version 5.0.
License: Geosoft Open License
- sphere_3d(x, y, z, radius)[source]¶
Draw a 3D sphere
- Parameters:
x (float) – Center X
y (float) – Center Y
z (float) – Center Z
radius (float) – Radius
New in version 5.1.6.
License: Geosoft Open License
Note: The Fill color is used to color the sphere.
- start_group(name, mode)[source]¶
Start a group.
- Parameters:
name (str) – Group name, can be NULL, Maximum length is
MVIEW_NAME_LENGTH
mode (int) – MVIEW_GROUP constants
New in version 5.0.
License: Geosoft Open License
Note: Line and fill colors and thickness must be set before drawing to a group.
If the group name is NULL, output will be sent to the primary group stream and the MVIEW_GROUP constants is ignored.
Group names must be different from view names.
- symb_angle(angle)[source]¶
Set the Symb angle.
- Parameters:
angle (float) – Angle in degrees CCW from +X
New in version 5.0.
License: Geosoft Open License
- symb_color(color)[source]¶
Set the Symbol color.
- Parameters:
color (int) – Color
New in version 5.0.
License: Geosoft Open License
- symb_fill_color(color)[source]¶
Set the Symbol color fill.
- Parameters:
color (int) – Color
New in version 5.0.
License: Geosoft Open License
- symb_font(face, geofont, weight, italic)[source]¶
Set the symbol font and style.
- Parameters:
face (str) – Face name
geofont (bool) – Geosoft font?
weight (int) – MVIEW_FONT_WEIGHT constants
italic (bool) – Italic font?
New in version 5.0.
License: Geosoft Open License
Note: If the font cannot be found, the DEFAULT_SYMBOL_FONT specified in the [MONTAJ] section of GEOSOFT.INI will be used.
See
text_font
for the font name syntax.
- symb_number(number)[source]¶
Set the Symbol number.
- Parameters:
number (int) – Symbol number
New in version 5.0.
License: Geosoft Open License
Note: The lower 16 bits of the number is interpreted as UTF-16 with a valid Unicode character code point. GFN fonts wil produce valid symbols depending on the font for 0x01-0x7f and the degree, plus-minus and diameter symbol(latin small letter o with stroke) for 0xB0, 0xB1 and 0xF8 respectively.
It is possible to check if a character is valid using
GXUNC.is_valid_utf16_char
. The high 16-bits are reserved for future use. Also see:GXUNC.valid_symbol
andGXUNC.validate_symbols
.
- symb_size(size)[source]¶
Set the Symb size.
- Parameters:
size (float) – Size in view units
New in version 5.0.
License: Geosoft Open License
- symbol(x, y)[source]¶
Plot a symbol
- Parameters:
x (float) – X
y (float) – Y
New in version 5.0.
License: Geosoft Open License
- symbols(vv_x, vv_y)[source]¶
Plot symbols
New in version 5.0.
License: Geosoft Open License
- symbols_itr(itr, vv_x, vv_y, vv_z)[source]¶
Plot symbols using an
GXITR
- Parameters:
New in version 5.0.
License: Geosoft Open License
- text(text, x, y)[source]¶
Draw text.
- Parameters:
text (str) – Text to plot
x (float) – X location of text
y (float) – Y location of text
New in version 5.0.
License: Geosoft Open License
- text_angle(angle)[source]¶
Set the text angle.
- Parameters:
angle (float) – Angle in degrees CCW from +X
New in version 5.0.
License: Geosoft Open License
- text_color(color)[source]¶
Set the Text color.
- Parameters:
color (int) – Color
New in version 5.0.
License: Geosoft Open License
- text_font(face, geo_font, weight, italic)[source]¶
Set the text font.
- Parameters:
face (str) – Font face name
geo_font (int) – Geosoft font? (TRUE or FALSE)
weight (int) – MVIEW_FONT_WEIGHT constants
italic (int) – Italic font? (TRUE or FALSE)
New in version 5.0.
License: Geosoft Open License
Note: Font characteristics can be defined using the function parameters, or may be defined as decorations in the font name. A decorated font name has the following format:
font_name(type,weight,italics,charset)
where type - “TT” or “GFN” weight - last word from MVIEW_FONT_WEIGHT (ie. “LIGHT”) italics - “ITALICS” for for italics charset - Before version 6.2. this decoration was honoured and it affected the display of characters above ASCII 127. 6.2. introduced Unicode in the core montaj engine that eliminated the need for such a setting. All strings on the GX API level are encoded in UTF8 constants during runtime which makes it possible to represent all possible characters without using character sets. This decoration will now be ignored.
Qualifiers take precidence over passed parameters. The order of qualifiers is not relevant.
examples:
“sr(GFN,ITALICS)” - geosoft GFN font, normal weight, italics “Arial(TT,XBOLD)” - TrueType font, bold “Times(TT,ITALICS,_EastEurope)” - TrueType font, italics, Eastern Europe charcters
Decorated name qualifiers take precedence over passed parameters.
If the font cannot be found, or if “Default” is used, the DEFAULT_MAP_FONT specified in the [MONTAJ] section of GEOSOFT.INI will be used.
- text_ref(ref)[source]¶
Set the text plot reference point.
- Parameters:
ref (int) – TEXT_REF constants
New in version 5.0.
License: Geosoft Open License
- text_size(size)[source]¶
Set the text size.
- Parameters:
size (float) – Size in view units
New in version 5.0.
License: Geosoft Open License
Note: Because views may have differing X and Y scales this size can only make sense in one of these directions otherwise text would appear warped on these kinds of views. The X direction was chosen to represent the font size. For instance if the X scale is 1 unit/mm and my Y scale is 2 units/mm a font size of 3.0 view units will result in un-rotated text that appears 6 view units or 3mm high in the Y direction.
Another important thing to keep in mind that this size represents what is known as the “ascent” height of the font. The full height of the text may be higher if characters with accents or lower extension (e.g. the lowercase y) appear in the text. For TrueType fonts the mapping system will do a best effort positioning and sizing of the text using the alignment set and information about the font that it queries from the operating system. For instance; if Arial text “Blog” is placed at (0,0) and the alignment setting is Left-Bottom the left side of the B should be aligned at 0 in the X direction and the bottom of all the letters except y will be at 0 in the Y direction. The lower part of the y will extend below 0 in the Y (this is known as the “descent” height of the font at this size). The letters B and l should be very close to the size set here (this may differ slightly for different fonts).
- tran_scale(x, y, xs, ys)[source]¶
Set the view translation and scaling
- Parameters:
x (float) – X origin (user X to be placed at map 0)
y (float) – Y origin (user Y to be placed at map 0)
xs (float) – X mm/user unit
ys (float) – Y mm/user unit
New in version 5.0.
License: Geosoft Open License
Note: Warning. For reasons unknown (and maybe a bug), this function resets the view
GXIPJ
units. It is a good idea to call the SetUnits_IPJ function after calling this function in order to restore them. This will be addressed in v6.4.
- transparency(trans)[source]¶
Sets the transparency for new objects.
- Parameters:
trans (float) – Transparency (1.0 - Opaque, 0.0 - Transparent)
New in version 6.0.
License: Geosoft Open License
Note: 1.0 Renders completely opaque objects while 0.0 will be transparent. Objects written after this will have a combined transparency value with the group transparency if it is set (e.g. 0.5 for group and 0.8 stream will result in 0.4).
- update_met_afrom_group(group, meta)[source]¶
Fill the
GXMETA
with group dataset informationNew in version 5.1.6.
License: Geosoft Open License
- user_to_view(x, y)[source]¶
Convert a USERplot in mm to a VIEW coordinate
- Parameters:
New in version 5.0.
License: Geosoft Open License
See also
- view_group_json(group, file)[source]¶
Generate a JSON representation of a Group.
- Parameters:
group (str) – Name of Group
file (str) – Name of JSON file to generate.
New in version 9.7.
License: Geosoft Open License
- view_to_plot(x, y)[source]¶
Convert a VIEW coordinate to a plot coordinate in mm.
- Parameters:
New in version 5.0.
License: Geosoft Open License
- view_to_user(x, y)[source]¶
Convert a VIEW coordinate to a USER coordinate.
- Parameters:
New in version 5.0.
License: Geosoft Open License
See also
- voxd(voxd, name)[source]¶
Add a Voxel Display (
GXVOXD
) object to the view.- Parameters:
name (str) – Name Maximum length is
MVIEW_NAME_LENGTH
New in version 6.2.
License: Geosoft Open License
- write_group_storage(group, storage_name, bf)[source]¶
Open generic existing storage associated with a group for reading.
- Parameters:
New in version 9.3.
License: Geosoft Open License
Note: External API users should not use storage names starting with “Geosoft”
- z_value(val)[source]¶
Sets Z-value info.
- Parameters:
val (float) – Z-Value
New in version 6.0.
License: Geosoft Open License
Note: This number is stored in map mainly for exports to other vector formats (e.g ShapeFiles) A contour map that’s exported to a shape file will use this value as a Z-value attributes for its shapes.
MAKER constants¶
Maker defines
MVIEW_CLIP constants¶
Boolean clipping defines
MVIEW_COLOR constants¶
24-bit color defines
The color
function can be used to create a color int from a
color string description.
The iColorXXX_MVIEW macros can be used to create colors from component
intensities.
MVIEW_CYLINDER3D constants¶
What parts of the cylinder are closed
MVIEW_DRAW constants¶
Polygon drawing defines
MVIEW_DRAWOBJ3D_ENTITY constants¶
What types of entities to draw
- MVIEW_DRAWOBJ3D_ENTITY_POINTS¶
Draw 3D Points (no normals) [1 verticies per object]
- gxapi.MVIEW_DRAWOBJ3D_ENTITY_POINTS = 0¶
- MVIEW_DRAWOBJ3D_ENTITY_LINES¶
Draw 3D Lines (no normals) [2 verticies per object]
- gxapi.MVIEW_DRAWOBJ3D_ENTITY_LINES = 1¶
- MVIEW_DRAWOBJ3D_ENTITY_LINE_STRIPS¶
Draw 3D Line strip (no normals) [2+x verticies per object]
- gxapi.MVIEW_DRAWOBJ3D_ENTITY_LINE_STRIPS = 2¶
- MVIEW_DRAWOBJ3D_ENTITY_LINE_LOOPS¶
Draw 3D Line loop (no normals, closes loop with first point) [2+x verticies per object]
- gxapi.MVIEW_DRAWOBJ3D_ENTITY_LINE_LOOPS = 3¶
- MVIEW_DRAWOBJ3D_ENTITY_TRIANGLES¶
Draw 3D Triangles [3 verticies per object]
- gxapi.MVIEW_DRAWOBJ3D_ENTITY_TRIANGLES = 4¶
- MVIEW_DRAWOBJ3D_ENTITY_TRIANGLE_STRIPS¶
Draw 3D Triangle strips [3+x verticies per object]
- gxapi.MVIEW_DRAWOBJ3D_ENTITY_TRIANGLE_STRIPS = 5¶
- MVIEW_DRAWOBJ3D_ENTITY_TRIANGLE_FANS¶
Draw 3D Triangle fans [3+x verticies per object]
- gxapi.MVIEW_DRAWOBJ3D_ENTITY_TRIANGLE_FANS = 6¶
- MVIEW_DRAWOBJ3D_ENTITY_QUADS¶
Draw 3D Quads (Must be in the same plane) [4 verticies per object]
- gxapi.MVIEW_DRAWOBJ3D_ENTITY_QUADS = 7¶
MVIEW_DRAWOBJ3D_MODE constants¶
What types of entities to draw
MVIEW_EXTENT constants¶
Types of extents defines
MVIEW_FIT constants¶
Fit area defines
MVIEW_FONT_WEIGHT constants¶
Font weight defines
MVIEW_GRID constants¶
Grid Drawing defines
MVIEW_GROUP constants¶
Open Group defines
MVIEW_GROUP_LIST constants¶
What groups to list
MVIEW_HIDE constants¶
Boolean hidding defines
MVIEW_IS constants¶
Defines for mview types
MVIEW_LABEL_BOUND constants¶
Label Binding Defines
MVIEW_LABEL_JUST constants¶
Label Justification Defines
MVIEW_LABEL_ORIENT constants¶
Label Orientation Defines
MVIEW_NAME_LENGTH constants¶
Maximum length for view and group names
MVIEW_OPEN constants¶
Open GXMVIEW
define
MVIEW_PJ constants¶
Projection modes
- MVIEW_PJ_OFF¶
No reprojection is used and all locations and attributes are assumed to be in the view coordinate system.
- gxapi.MVIEW_PJ_OFF = 0¶
- MVIEW_PJ_LOCATION¶
Only locations will be transformed to the view coordinate system.
- gxapi.MVIEW_PJ_LOCATION = 1¶
- MVIEW_PJ_ALL¶
Locations and attributes (sizes, thicknesses, angles) will be transformed to the view coordinate system.
- gxapi.MVIEW_PJ_ALL = 2¶
- MVIEW_PJ_ON¶
Mode before the last
MVIEW_PJ_OFF
.- gxapi.MVIEW_PJ_ON = 3¶
MVIEW_RELOCATE constants¶
Relocation Defines
MVIEW_SMOOTH constants¶
Interpolation method to use for drawing line and polygon edges
MVIEW_TILE constants¶
Tiling defines
MVIEW_UNIT constants¶
Coordinate systems defines
MVIEW_EXTENT_UNIT constants¶
Types of units for extents (these map to the MVIEW_UNIT constants defines directly)
TEXT_REF constants¶
Text reference locations
MVIEW_3D_RENDER constants¶
3D Geometry rendering defines. These flags only affect mixed geometry groups and not the data specific groups (e.g. voxels, vector voxels surfaces etc.). Each of those groups has predefined optimum behaviour and any changes to these flags are ignored.
- MVIEW_3D_RENDER_BACKFACES¶
This flag is enabled if the backfaces of geometry should be rendered
- gxapi.MVIEW_3D_RENDER_BACKFACES = 1¶
- MVIEW_3D_DONT_SCALE_GEOMETRY¶
If the exaggeration scales of the 3D view in X, Y and/or Z is set to anything other than 1.0 any geometric objects (spheres, cubes etc.) for 3D groups with the following flags will render untransformed while only the centers of the objects are changed. This ensures the objects appear in the correct place with respect to other data being rendered (and scaled).
- gxapi.MVIEW_3D_DONT_SCALE_GEOMETRY = 2¶