GXTPAT class

class geosoft.gx.GXTPAT
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.PAT in srcetc for more inforation)
Pattern:       The Pattern Index; defined in DEFAULT.PAT, or in the user's
USER.PAT 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.
Colour:        The pattern line work colour. If not specified, defaults to black.

Background colour: The pattern background colour. 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((str)arg1, (str)arg2, (str)arg3, (int)arg4) → None:
Add a new color to the list
Parameters:
  • arg1 (str) – Code (required - CASE SENSITIVE)
  • arg2 (str) – Label (optional, can be “”)
  • arg3 (str) – Description (optional, can be “”)
  • arg4 (int) – Color (use iColor_MVIEW to convert to int).
Returns:

Nothing

Return type:

None

New in version 7.0.0.

Note:

The new code must be unique; not in the existing list.
code((str)arg1) → int:
Find the index of a given thematic pattern
Parameters:arg1 (str) – Pattern code (case sensitive)
Returns:The code index, -1 if not found
Return type:int

New in version 7.0.0.

static create((GXContext)ctx) → GXTPAT:
Creates an empty thematic pattern object.
Parameters:ctx (geosoft.gx.GXContext) – The GX execution context
Returns:TPAT object
Return type:geosoft.gx.GXTPAT

New in version 7.0.0.

get_solid_pattern((int)arg1, (str_ref)arg2, (str_ref)arg3, (str_ref)arg4, (int_ref)arg5) → None:
Get solid pattern info from the TPAT.
Parameters:
Returns:

Nothing

Return type:

None

New in version 7.0.0.

Note:

Returns the solid colour, pattern foreground color, or symbol
color, along with the code, label and description.
is_null() → bool

Check if the instance of geosoft.gx.GXTPAT is null (undefined)

Returns:True if this is a null instance of geosoft.gx.GXTPAT, False otherwise.
Return type:bool`
load_csv((str)arg1) → None:
Load thematic patterns from a CSV file
Parameters:arg1 (str) – Thematic Pattern file name
Returns:Nothing
Return type:None

New in version 7.0.0.

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 colour.

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 colour used in patterns, and for solid colours, the colour.
       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
static null() → GXTPAT

A null (undefined) instance of geosoft.gx.GXTPAT

Returns:A null geosoft.gx.GXTPAT
Return type:geosoft.gx.GXTPAT
setup_translation_vv((GXLTB)arg1, (int)arg2, (GXVV)arg3) → None:
Initializes a VV used to map TPAT indices to output values
Parameters:
  • arg1 (geosoft.gx.GXLTB) – Table containing TPAT codes as the key
  • arg2 (int) – Field in LTB with the output values (numeric or string)
  • arg3 (geosoft.gx.GXVV) – Returned values for each TPAT index
Returns:

Nothing

Return type:

None

New in version 7.3.0.

Note:

The input LTB object should have key values matching the TPAT codes.
Whether the matches are case sensitive or not is dependent on how the
LTB oject was created (see ltb.h).
The LTB field values are converted to the output VV type.
size() → int:
Returns the number of rows (items) in the TPAT object.
Returns:Number of TPAT items.
Return type:int

New in version 7.0.0.

TPAT_STRING_SIZE constants

Default string sizes.
gx.TPAT_CODE_SIZE = 21
gx.TPAT_LABEL_SIZE = 32
gx.TPAT_DESC_SIZE = 128
gx.TPAT_SYMBFONT_SIZE = 32