GXTPAT class¶
- class GXTPAT(handle=0)[source]¶
GXTPAT class.
The full name of the pattern. ex: “felsic volcanics” Code: Short-form of the pattern description. This is the value which typically appears (for instance) in the “Rock code” channel in a Wholeplot From-To data group. ex: “FVOL” The code is CASE-SENSITIVE.
Label: Text to use as a short-form in labels, graphs etc. By default, this is the same as the code. ex: “FVol.” Pattern Attributes: (See DEFAULT.`GXPAT <geosoft.gxapi.GXPAT>` in srcetc for more inforation) Pattern: The Pattern Index; defined in DEFAULT.`GXPAT <geosoft.gxapi.GXPAT>`, or in the user’s USER.`GXPAT <geosoft.gxapi.GXPAT>` file. If not specified, defaults to 0 (solid fill). Size: The pattern tile size. If not specified, defaults to 2.0mm. Density: The tiling density. If not specified, defaults to 1.0. Thickness: The line thickness in the tile, expressed as a integer percentage (0-100) of the tile size. Color: The pattern line work color. If not specified, defaults to black.
Background color: The pattern background color. If not specified, defaults to transparent (C_ANY_NONE)
Symbols:
Symbol Font The name of the symbol font to use for a given symbol index
Symbol Number Index into the font.
Symbol Rotation: Rotation in degrees CCW.
Symbol Scaling Additional scale factor to apply to symbol size (Default 1.0)
- add_color(code, label, descr, color)[source]¶
Add a new color to the list
- Parameters:
code (str) – Code (required - CASE SENSITIVE)
label (str) – Label (optional, can be “”)
descr (str) – Description (optional, can be “”)
color (int) – Color (use
GXMVIEW.color
to convert to int).
New in version 7.0.
License: Geosoft Open License
Note: The new code must be unique; not in the existing list.
- code(code)[source]¶
Find the index of a given thematic pattern
- Parameters:
code (str) – Pattern code (case sensitive)
- Returns:
The code index, -1 if not found
- Return type:
int
New in version 7.0.
License: Geosoft Open License
- classmethod create()[source]¶
Creates an empty thematic pattern object.
New in version 7.0.
License: Geosoft Open License
- get_solid_pattern(index, code, label, descr, color)[source]¶
Get solid pattern info from the
GXTPAT
.- Parameters:
New in version 7.0.
License: Geosoft Open License
Note: Returns the solid color, pattern foreground color, or symbol color, along with the code, label and description.
- 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
- load_csv(file)[source]¶
Load thematic patterns from a CSV file
- Parameters:
file (str) – Thematic Pattern file name
New in version 7.0.
License: Geosoft Open License
Note: The type of thematic patterns file is recognized from the types of fields found inside it.
The following fields are identified. Only the “CODE” field is required, as the “default” thematic pattern is a solid black color.
CODE The pattern code (required by all types - CASE SENSITIVE) LABEL Longer text identifier to use in legends etc. (up to 31 characters) DESCRIPTION Much longer text string (up to 127 characters).
COLOR Line color used in patterns, and for solid colors, the color. If only this field is found (and none below), the pattern file is assumed to be type TPAT_TYPE_COLOR.
PATTERN Geosoft pattern ID. PAT_SIZE Pattern tile size, or symbol size (default 2mm) PAT_DENSITY Pattern tile density (default 1.0) PAT_THICKNESS Pattern line thickness as % of size (default 5) BACK_COLOR Background color for the pattern. Also used for symbols (Default background is transparent).
SYMBFONT Symbol font (e.g. “symbols.gfn”) SYMBNUM Symbol number of the current font SYMBROT Symbol rotation SYMBSCL Additional scaling factor applied to the current size
- setup_translation_vv(ltb, field, vv_values)[source]¶
Initializes a
GXVV
used to mapGXTPAT
indices to output values- Parameters:
New in version 7.3.
License: Geosoft Open License
Note: The input
GXLTB
object should have key values matching theGXTPAT
codes. Whether the matches are case sensitive or not is dependent on how theGXLTB
oject was created (see ltb.h). TheGXLTB
field values are converted to the outputGXVV
type.
- size()[source]¶
Returns the number of rows (items) in the
GXTPAT
object.- Returns:
Number of
GXTPAT
items.- Return type:
int
New in version 7.0.
License: Geosoft Open License
TPAT_STRING_SIZE constants¶
Default string sizes.