GTXclient C++ API
GTXserver-17.0.3
|
Class handling connection and communication with GTXserver. More...
#include <GTXClient.hpp>
Public Member Functions | |
GTXClient () | |
Default constructor, initializes the client library. | |
void | SetDebugMode (bool debug) |
Set the Debug Mode (off by default) More... | |
unsigned short | GetDefaultPort (void) |
Get the default port for GTXserver. More... | |
const char * | LocateGTXserver () |
void | SetGTXserverPath (const char *path) |
Set the GTXserver path to be used by GTXClient::RunGTXserver() More... | |
unsigned short | RunGTXserver (unsigned short port) |
Locate GTXserver executable and run it. More... | |
void | Connect (const char *host, unsigned short port, const char *path) |
Open a session with a running GTXserver to read isatis file system. More... | |
bool | IsConnected () |
Check is client is connected with the server. More... | |
void | Disconnect () |
Close the current session with the GTXserver. More... | |
int | GetServerVersion () |
Retrieves Server Protocol Version. More... | |
GTXStringArray | GetStudyList () |
Get study list in the Isatis file system. More... | |
void | SetStudy (const char *study) |
Set the name of the current study. More... | |
void | NewStudy (const char *study, const char *path) |
Create a new study in the Isatis file system. More... | |
void | DeleteStudy () |
Delete the current study. More... | |
GTXStringArray | GetDirectoryList () |
Get the list of directories in the current study. More... | |
bool | DirectoryExists (const char *directory) |
Check if a given directory exists. More... | |
void | SetDirectory (const char *directory) |
Set the current directory. More... | |
void | NewDirectory (const char *directory) |
Create a new directory in the current study. More... | |
void | DeleteDirectory () |
Delete the current directory. More... | |
GTXStringArray | GetFileList () |
Get the list of files in the current directory. More... | |
GTXStringArray | GetFileList (GTXFileInfo::FileType file_type, int file_dim) |
Get the list of files in the current directory given a type and dimension. More... | |
bool | FileExists (const char *file) |
Check if a given file exists. More... | |
void | SetFile (const char *file) |
Set the current file in the current directory. More... | |
void | DeleteFile () |
Delete the current file. More... | |
GTXFileInfo | GetFileInfo () |
Get information about current file. More... | |
const char * | GetFileComment () |
Get the comment of the current file. More... | |
void | SetFileComment (bool append, const char *comment) |
Set a comment for the current file. More... | |
void | NewPointsFile2D (const char *name, gtx_long nsample, const double x[], const double y[]) |
Create a new 2D points file in the current directory. More... | |
void | NewPointsFile3D (const char *name, gtx_long nsample, const double x[], const double y[], const double z[]) |
Create a new 3D points file in the current directory. More... | |
void | NewGridFile2D (const char *name, double X0, double Y0, double DX, double DY, int NX, int NY) |
Create a new 2D grid file in the current directory. More... | |
void | NewGridFile3D (const char *name, double X0, double Y0, double Z0, double DX, double DY, double DZ, int NX, int NY, int NZ) |
Create a new 3D grid file in the current directory. More... | |
void | NewLinesFile (const char *name, int dimension) |
Create a new lines file in the current directory. More... | |
void | PointsFileAppend2D (gtx_long nsample, const double x[], const double y[]) |
Append samples to the current Points 2D File. More... | |
void | PointsFileAppend3D (gtx_long nsample, const double x[], const double y[], const double z[]) |
Append samples to the current 3D Points File. More... | |
void | LinesFileAddLineCores2DOld (int nsample, double xbegin, double ybegin, const double xend[], const double yend[]) |
Add a new line in the current 2D lines file with core definition. More... | |
void | LinesFileAddLineCores3DOld (int nsample, double xbegin, double ybegin, double zbegin, const double xend[], const double yend[], const double zend[]) |
Add a new line in the current 3D lines file with core definition. More... | |
void | LinesFileAddCoreLine2D (int nsample, double xbegin, double ybegin, const double xend[], const double yend[]) |
Add a new line in the current 2D lines file with core definition. More... | |
void | LinesFileAddCoreLine3D (int nsample, double xbegin, double ybegin, double zbegin, const double xend[], const double yend[], const double zend[]) |
Add a new line in the current 3D lines file with core definition. More... | |
void | LinesFileAddGravityLine2D (int nsample, const double xg[], const double yg[]) |
Add a new line in the current 2D lines file with gravity centers definition. More... | |
void | LinesFileAddGravityLine3D (int nsample, const double xg[], const double yg[], const double zg[]) |
Add a new line in the current 3D lines file with gravity centers definition. More... | |
void | LinesFileCreateLink (const char *points_file) |
Create a Link between current Lines file and its header Points file. More... | |
void | GridModifyOrigin (double x0, double y0, double z0) |
Modify the origin of the current file (must be a grid) More... | |
void | GridModifyMesh (double dx, double dy, double dz) |
Modify the mesh of the current file (must be a grid) More... | |
void | GridModifyRotation (double az, double ay, double ax) |
Modify the rotation of the current file (must be a grid) More... | |
GTXStringArray | GetVariableList () |
Get the list of variables in the current file. More... | |
GTXStringArray | GetVariableList (GTXVariableInfo::VariableType var_type) |
Get the list of variables in the current file. More... | |
bool | VariableExists (const char *variable) |
Check if a given variable exists. More... | |
void | SetVariable (const char *variable) |
Set the current variable in the current file. More... | |
void | DeleteVariable () |
Delete the current variable. More... | |
void | SetIndice (const int indice) |
Set the current indice for the current macro variable. More... | |
void | SetAlphaIndice (const char *alphaindice) |
Set the current alpha indice for the current macro variable. More... | |
GTXVariableInfo | GetVariableInfo () |
Get the current variable information. More... | |
GTXIntArray | GetMacroIndices () |
Get the list of available indices for the current macro variable. More... | |
GTXStringArray | GetMacroAlphaIndices () |
Get the list of available macro alpha indices for the current macro variable. More... | |
void | AddMacroIndicesWithAlpha (const GTXIntArray indices, const GTXStringArray alpha_indices) |
Add a list of indices for the current macro variable. More... | |
void | AddMacroIndices (const GTXIntArray indices) |
Add a list of indices for the current macro variable. More... | |
GTXCharData | ReadCharVariable (bool compress) |
Read samples from the current variable. More... | |
GTXCharData | ReadCharVariableSub (gtx_long first, gtx_long last, bool compress) |
Read continuous samples from the current variable. More... | |
GTXCharData | ReadLineCharVariable (int line_index) |
Read samples of a line from the current alphanumerical variable. More... | |
GTXDoubleData | ReadLineDoubleVariable (int line_index) |
Read samples of a line from the current variable. More... | |
GTXDoubleData | ReadDoubleVariable (bool compress) |
Read samples from the current variable. More... | |
GTXDoubleData | ReadDoubleVariableSub (gtx_long first, gtx_long last, bool compress) |
Read a subpart of the samples from the current variable. More... | |
GTXByteArray | ReadSelectionVariable () |
Read selection from the current variable. More... | |
GTXByteArray | ReadSelectionVariableSub (gtx_long first, gtx_long last) |
Read a subpart of the selection from the current variable. More... | |
void | NewDoubleVariable (const char *name, int bit_length, const GTXVariableFormat &format) |
Create a new double variable in the current file. More... | |
void | NewCharVariable (const char *name, int max_length) |
Create a new character variable in the current file. More... | |
void | SetVariableAsLineName (void) |
Set the current variable as the Line Name variable. More... | |
void | WriteDoubleVariable (bool compress, const GTXDoubleData &ddata) |
Write data to the current numerical variable. More... | |
void | WriteDoubleVariableSub (gtx_long first, gtx_long last, bool compress, const GTXDoubleData &ddata) |
Write continuous subpart of data to the current numerical variable. More... | |
void | WriteLineDoubleVariable (int line_index, const GTXDoubleData &ddata) |
Write line data to the current numerical variable. More... | |
void | WriteCharVariable (bool compress, const GTXCharData &cdata) |
Write data to the current alphanumerical variable. More... | |
void | WriteCharVariableSub (gtx_long first, gtx_long last, bool compress, const GTXCharData &cdata) |
Write continuous subpart of data to the current alphanumerical variable. More... | |
void | WriteLineCharVariable (int line_index, const GTXCharData &cdata) |
Write line data to the current alphanumerical variable. More... | |
void | WriteSelectionVariableSub (const gtx_long first, const gtx_long last, const GTXByteArray data) |
Write continuous subpart of selection data (0,1) to the current variable (must be a selection) More... | |
void | WriteSelectionVariable (const GTXByteArray data) |
Write selection data (0,1) to the current variable (must be a selection) More... | |
const char * | GetVariableComment () |
Get the comment of the current variable. More... | |
void | SetVariableComment (bool append, const char *comment) |
Set a comment for the current variable. More... | |
void | SetSelection (const char *sel) |
Set the current selection. More... | |
void | SetVariableUnit (const char *factor, const char *symbol) |
Change the unit factor and symbol of a variable. More... | |
void | SetUnit (const char *unit) |
Set the current distance unit. More... | |
double | UnitFactorFromSymbol (const char *symbol) |
Get the unit factor corresponding to a given unit symbol. More... | |
const char * | UnitSymbolFromFactor (double factor) |
Get the unit factor corresponding to a given unit symbol. More... | |
void | SetUnitMode (int mode) |
Change the way length units are used. More... | |
void | SetCreationUnits (const char *x_unit, const char *y_unit, const char *z_unit) |
Change the default units for length variables creation. More... | |
void | VendorDataWrite (int level, const GTXVendorData &vdata) |
Write a vendor data. More... | |
GTXVendorData | VendorDataRead (const char *identifier, int level) |
Read a Vendor Data from Isatis file system. More... | |
bool | VendorDataExists (const char *identifier, int level) |
Checks if a Vendor Data exists. More... | |
int | VendorDataGetVersion (const char *identifier, int level) |
Get version string from a Vendor Data. More... | |
GTXFaultSystem | ReadFaults (int priority) |
Get fault system associated to the current file. More... | |
void | WriteFaults (GTXFaultSystem fs) |
Write fault system to the current file. More... | |
void | NewPolygonsFile (const char *name, const GTXPolygonSystem *psystem) |
Create a new polygon file in the current directory. More... | |
GTXPolygonSystem | ReadPolygons () |
Get current file as polygon system (if possible) More... | |
void | NewWireframesFile (const char *name, const GTXWireframeSystem &wsys) |
Create a new Wireframes file in the current directory. More... | |
GTXWireframeSystem | ReadWireframes () |
Get current file as wireframe system (if possible) More... | |
Friends | |
class | GTXVendorData |
Class handling connection and communication with GTXserver.
void GTXClient::AddMacroIndices | ( | const GTXIntArray | indices | ) |
Add a list of indices for the current macro variable.
This function add, from the GTXserver, the list of available indices for the current macro variable.
GTXError |
indices | Array of numerical indices |
References GTXIntArray::GetCount(), and GTXIntArray::GetValues().
void GTXClient::AddMacroIndicesWithAlpha | ( | const GTXIntArray | indices, |
const GTXStringArray | alpha_indices | ||
) |
Add a list of indices for the current macro variable.
This function add, from the GTXserver, the list of available indices for the current macro variable.
GTXError |
indices | Array of numerical indices |
alpha_indices | Array of alpha indices |
References GTXIntArray::GetCount(), GTXIntArray::GetValues(), and GTXStringArray::GetValues().
void GTXClient::Connect | ( | const char * | host, |
unsigned short | port, | ||
const char * | path | ||
) |
Open a session with a running GTXserver to read isatis file system.
This function opens a session with a GTXserver running on the host host that listens to the port port and starts to read the Isatis file system located at path. If the server is a mono session one, the server will remain attached to this client until disconnect then it will quit. If the server is a multi session one, the server will still be available for other clients.
host | hostname or IP address "aaa.bbb.ccc.ddd" of the machine where the GTXserver is running on |
port | port number where the GTXserver is listening to. If 0, a call to /ref GTXClient::GetDefaultPort is made to determine the port where GTXserver may be running. |
path | pathname of the Isatis file system to be accessed (should be a path entered by the user (GTX_DATA or GTX_INIT (see below)) |
void GTXClient::DeleteDirectory | ( | ) |
Delete the current directory.
This function will delete the current directory. If successfull, the is no current directory set.
GTXError |
void GTXClient::DeleteFile | ( | ) |
Delete the current file.
This function will delete the current file. If successfull, the is no current file set.
GTXError |
void GTXClient::DeleteStudy | ( | ) |
Delete the current study.
This function will delete the current study. If successfull, the is no current study set.
GTXError |
void GTXClient::DeleteVariable | ( | ) |
Delete the current variable.
This function will delete the current variable. If successfull, the is no current variable directory.
GTXError |
bool GTXClient::DirectoryExists | ( | const char * | directory | ) |
Check if a given directory exists.
This function asks the server if a given directory exists (or for old servers, it retrieves the list of directories and check it by itself).
GTXError |
directory | directory name to check |
void GTXClient::Disconnect | ( | ) |
Close the current session with the GTXserver.
This function closes the current session with the GTXserver. The server will exit if in mono session mode, if in multi-session mode, it will only close the current connection.
GTXError |
bool GTXClient::FileExists | ( | const char * | file | ) |
Check if a given file exists.
This function asks the server if a given file exists (or for old servers, it retrieves the list of files and check it by itself).
GTXError |
file | file name to check |
unsigned short GTXClient::GetDefaultPort | ( | void | ) |
Get the default port for GTXserver.
When the GTXserver is ran without argument, it runs on a default port. This default port is taken from the local /etc/services file using getservbyname with the service name equal to "GTXserver". If not found in the services file, it defaults to a hard-coded value.
GTXStringArray GTXClient::GetDirectoryList | ( | ) |
Get the list of directories in the current study.
This function retrieve, from the GTXserver, the list of available directories in the current study.
GTXError |
const char * GTXClient::GetFileComment | ( | ) |
Get the comment of the current file.
Get the comment/description to the current file
GTXError |
comment | returned comment |
C++ only: comment must be freed using
GTXFileInfo GTXClient::GetFileInfo | ( | ) |
Get information about current file.
This function retrieve, from the GTXserver, the information about the current file.
GTXError |
file_info | The information about current file |
GTXStringArray GTXClient::GetFileList | ( | ) |
Get the list of files in the current directory.
This function retrieve, from the GTXserver, the list of available files in the current directory.
GTXError |
GTXStringArray GTXClient::GetFileList | ( | GTXFileInfo::FileType | file_type, |
int | file_dim | ||
) |
Get the list of files in the current directory given a type and dimension.
This function retrieve, from the GTXserver, the list of available files in the current directory searching for a given type and dimension.
GTXError |
file_type | File type ( |
file_dim | File dimension (2,3 or -1 if it does not matter) |
GTXStringArray GTXClient::GetMacroAlphaIndices | ( | ) |
Get the list of available macro alpha indices for the current macro variable.
This function retrieve, from the GTXserver, the list of available alphanumerical indices for the current macro variable
GTXError |
GTXIntArray GTXClient::GetMacroIndices | ( | ) |
Get the list of available indices for the current macro variable.
This function retrieve, from the GTXserver, the list of available indices for the current macro variable.
GTXError |
int GTXClient::GetServerVersion | ( | ) |
Retrieves Server Protocol Version.
When the client is connected to the server, allows to know the server protocol version. The version is encoded as followed: Major * 1000000 + Minor * 1000 + Patch * 10 + Sub-Version It may now correspond to the Isatis version but to the major latest change in the protocol.
GTXStringArray GTXClient::GetStudyList | ( | ) |
Get study list in the Isatis file system.
This function retrieve, from the GTXserver, the list of available studies in the Isatis file system selected by the GTXClient::Connect call
GTXError |
const char * GTXClient::GetVariableComment | ( | ) |
Get the comment of the current variable.
Get the comment/description to the current variable
GTXError |
comment | returned comment |
C++ only: comment must be freed using
GTXVariableInfo GTXClient::GetVariableInfo | ( | ) |
Get the current variable information.
This function retrieve, from the GTXserver, the information about the current variable. If used on a length variable, information will be returned using the current default unit (GTXClient::SetUnit) or in the variable unit if current unit mode is true (GTXClient::SetUnitMode).
GTXError |
var_info | The current variable information |
GTXStringArray GTXClient::GetVariableList | ( | ) |
GTXStringArray GTXClient::GetVariableList | ( | GTXVariableInfo::VariableType | var_type | ) |
Get the list of variables in the current file.
This function retrieve, from the GTXserver, the list of available variables in the current file.
GTXError |
void GTXClient::GridModifyMesh | ( | double | dx, |
double | dy, | ||
double | dz | ||
) |
Modify the mesh of the current file (must be a grid)
This function modify the mesh of the current file (must be a grid)
GTXError |
dx | X size of one cell of the grid |
dy | Y size of one cell of the grid |
dz | Z size of one cell of the grid (unused if 2D) |
void GTXClient::GridModifyOrigin | ( | double | x0, |
double | y0, | ||
double | z0 | ||
) |
Modify the origin of the current file (must be a grid)
This function modify the origin of the current file (must be a grid)
GTXError |
x0 | X origin of the grid |
y0 | Y origin of the grid |
z0 | Z origin of the grid (unused if 2D) |
void GTXClient::GridModifyRotation | ( | double | az, |
double | ay, | ||
double | ax | ||
) |
Modify the rotation of the current file (must be a grid)
This function modify the rotation of the current file (must be a grid)
GTXError |
az | rotation around Z axis |
ay | rotation around the Y'-axis (new Y axis in the system after the first rotation) (unused in 2D) |
ax | rotation around the X"-axis (new X axis in the systemd after the two first rotations) (unused in 2D) |
bool GTXClient::IsConnected | ( | ) |
Check is client is connected with the server.
Check the status of the connection with the GTXserver
void GTXClient::LinesFileAddCoreLine2D | ( | int | nsample, |
double | xbegin, | ||
double | ybegin, | ||
const double | xend[], | ||
const double | yend[] | ||
) |
Add a new line in the current 2D lines file with core definition.
This function add a new line in the current 2D lines file. Coordinates are given with beginning and end of cores.
GTXError |
nsample | Number of sample to be added to the new line |
xbegin | X coordinate of the beginning of the first core |
ybegin | Y coordinate of the beginning of the first core |
xend | Array of X coordinate of the end of cores |
yend | Array of Y coordinate of the end of cores |
When appending samples to a lines file linked to a points file, the link is deleted. If you want to restore it, you must append one sample per added line to the points file using GTXClientPointsFileAppend() and link the lines file to the points file using GTXClientLinesFileCreateLink().
The X and Y values must be given in the current unit if unit_mode = false or according to the corresponding creation unit if unit_mode = true.
void GTXClient::LinesFileAddCoreLine3D | ( | int | nsample, |
double | xbegin, | ||
double | ybegin, | ||
double | zbegin, | ||
const double | xend[], | ||
const double | yend[], | ||
const double | zend[] | ||
) |
Add a new line in the current 3D lines file with core definition.
This function add a new line in the current 3D lines file. Coordinates are given with beginning and end of cores.
GTXError |
nsample | Number of sample to be added to the new line |
xbegin | X coordinate of the beginning of the first core |
ybegin | Y coordinate of the beginning of the first core |
zbegin | Z coordinate of the beginning of the first core |
xend | Array of X coordinate of the end of cores |
yend | Array of Y coordinate of the end of cores |
zend | Array of Z coordinate of the end of cores |
When appending samples to a lines file linked to a points file, the link is deleted. If you want to restore it, you must append one sample per added line to the points file using GTXClientPointsFileAppend() and link the lines file to the points file using GTXClientLinesFileCreateLink().
The X,Y and Z values must be given in the current unit if unit_mode = false or according to the corresponding creation unit if unit_mode = true.
void GTXClient::LinesFileAddGravityLine2D | ( | int | nsample, |
const double | xg[], | ||
const double | yg[] | ||
) |
Add a new line in the current 2D lines file with gravity centers definition.
This function add a new line in the current 2D lines file. Coordinates are given with gravity centers.
GTXError |
nsample | Number of sample to be added to the new line |
xg | Array of X coordinate of the centers of gravity |
yg | Array of Y coordinate of the centers of gravity |
When appending samples to a lines file linked to a points file, the link is deleted. If you want to restore it, you must append one sample per added line to the points file using GTXClientPointsFileAppend() and link the lines file to the points file using GTXClientLinesFileCreateLink().
The X and Y values must be given in the current unit if unit_mode = false or according to the corresponding creation unit if unit_mode = true.
void GTXClient::LinesFileAddGravityLine3D | ( | int | nsample, |
const double | xg[], | ||
const double | yg[], | ||
const double | zg[] | ||
) |
Add a new line in the current 3D lines file with gravity centers definition.
This function add a new line in the current 3D lines file. Coordinates are given with gravity centers.
GTXError |
nsample | Number of sample to be added to the new line |
xg | Array of X coordinate of the centers of gravity |
yg | Array of Y coordinate of the centers of gravity |
zg | Array of Z coordinate of the centers of gravity |
When appending samples to a lines file linked to a points file, the link is deleted. If you want to restore it, you must append one sample per added line to the points file using GTXClientPointsFileAppend() and link the lines file to the points file using GTXClientLinesFileCreateLink().
The X,Y and Z values must be given in the current unit if unit_mode = false or according to the corresponding creation unit if unit_mode = true.
void GTXClient::LinesFileAddLineCores2DOld | ( | int | nsample, |
double | xbegin, | ||
double | ybegin, | ||
const double | xend[], | ||
const double | yend[] | ||
) |
Add a new line in the current 2D lines file with core definition.
This function add a new line in the current 2D lines file. Coordinates are given with beginning and end of cores.
GTXError |
nsample | Number of sample to be added to the new line |
xbegin | X coordinate of the beginning of the first core |
ybegin | Y coordinate of the beginning of the first core |
xend | Array of X coordinate of the end of cores |
yend | Array of Y coordinate of the end of cores |
You should consider using GTXClient::LinesFileAddCoreLine2D to create real cores in Isatis instead of converting to gravity centers like this function does. Warning: if you use the new function, you must also remove the storage of an additional undefined value at the beginning of each line (see client/CPP/write_files.cpp for an example).
When appending samples to a lines file linked to a points file, the link is deleted. If you want to restore it, you must append one sample per added line to the points file using GTXClient::PointsFileAppend() and link the lines file to the points file using GTXClient::LinesFileCreateLink().
The X and Y values must be given in the current unit if unit_mode = false or according to the corresponding creation unit if unit_mode = true.
void GTXClient::LinesFileAddLineCores3DOld | ( | int | nsample, |
double | xbegin, | ||
double | ybegin, | ||
double | zbegin, | ||
const double | xend[], | ||
const double | yend[], | ||
const double | zend[] | ||
) |
Add a new line in the current 3D lines file with core definition.
This function add a new line in the current 3D lines file. Coordinates are given with beginning and end of cores.
GTXError |
nsample | Number of sample to be added to the new line |
xbegin | X coordinate of the beginning of the first core |
ybegin | Y coordinate of the beginning of the first core |
zbegin | Z coordinate of the beginning of the first core |
xend | Array of X coordinate of the end of cores |
yend | Array of Y coordinate of the end of cores |
zend | Array of Z coordinate of the end of cores |
You should consider using GTXClient::LinesFileAddCoreLine3D to create real cores in Isatis instead of converting to gravity centers like this function does. Warning: if you use the new function, you must also remove the storage of an additional undefined value at the beginning of each line (see client/CPP/write_files.cpp for an example).
When appending samples to a lines file linked to a points file, the link is deleted. If you want to restore it, you must append one sample per added line to the points file using GTXClientPointsFileAppend() and link the lines file to the points file using GTXClientLinesFileCreateLink().
The X,Y and Z values must be given in the current unit if unit_mode = false or according to the corresponding creation unit if unit_mode = true.
void GTXClient::LinesFileCreateLink | ( | const char * | points_file | ) |
Create a Link between current Lines file and its header Points file.
This function creates a link between the current Lines file and its associated Points File. Lines file must have been set before and the Points file must have as many samples as the Lines file has separate lines.
GTXError |
points_file | points file to link to |
const char * GTXClient::LocateGTXserver | ( | ) |
This function tries to determine the location of GTXserver executable using:
void GTXClient::NewCharVariable | ( | const char * | name, |
int | max_length | ||
) |
Create a new character variable in the current file.
This function create a new character variable in the current file.
GTXError |
name | Name of the variable to be created |
max_length | Maximum length of string per sample (without \0) |
void GTXClient::NewDirectory | ( | const char * | directory | ) |
Create a new directory in the current study.
This function creates a new directory in the current study.
GTXError |
directory | Directory name to be created |
void GTXClient::NewDoubleVariable | ( | const char * | name, |
int | bit_length, | ||
const GTXVariableFormat & | format | ||
) |
Create a new double variable in the current file.
This function creates a new double variable (also known as numerical variable) in the current file
GTXError |
name | Name of the variable to be created |
bit_length | Number of bits per sample, authorized values are 1, 2, 4, 8, 16, 32 and 64 |
format | variable format |
void GTXClient::NewGridFile2D | ( | const char * | name, |
double | X0, | ||
double | Y0, | ||
double | DX, | ||
double | DY, | ||
int | NX, | ||
int | NY | ||
) |
Create a new 2D grid file in the current directory.
This function create a new 2D grid file in the current directory.
GTXError |
name | Name of the grid file to be created |
X0 | X origin of the grid |
Y0 | Y origin of the grid |
DX | X size of one cell of the grid |
DY | Y size of one cell of the grid |
NX | X nodes number |
NY | Y nodes number |
void GTXClient::NewGridFile3D | ( | const char * | name, |
double | X0, | ||
double | Y0, | ||
double | Z0, | ||
double | DX, | ||
double | DY, | ||
double | DZ, | ||
int | NX, | ||
int | NY, | ||
int | NZ | ||
) |
Create a new 3D grid file in the current directory.
This function create a new 3D grid file in the current directory.
GTXError |
name | Name of the grid file to be created |
X0 | X origin of the grid |
Y0 | Y origin of the grid |
Z0 | Z origin of the grid |
DX | X size of one cell of the grid |
DY | Y size of one cell of the grid |
DZ | Z size of one cell of the grid |
NX | X nodes number |
NY | Y nodes number |
NZ | Z nodes number |
void GTXClient::NewLinesFile | ( | const char * | name, |
int | dimension | ||
) |
Create a new lines file in the current directory.
This function create a new lines file in the current directory.
GTXError |
name | Name of the new lines file |
dimension | File dimension 2 for 2D, 3 for 3D |
void GTXClient::NewPointsFile2D | ( | const char * | name, |
gtx_long | nsample, | ||
const double | x[], | ||
const double | y[] | ||
) |
Create a new 2D points file in the current directory.
This function create a new 2D points file in the current directory.
GTXError |
name | Name of the file to be created |
nsample | Number of samples to be created in this file |
x | Array of X coordinate of each sample |
y | Array of Y coordinate of each sample |
The X and Y values must be given in the current unit if unit_mode = false or according to the corresponding creation unit if unit_mode = true.
void GTXClient::NewPointsFile3D | ( | const char * | name, |
gtx_long | nsample, | ||
const double | x[], | ||
const double | y[], | ||
const double | z[] | ||
) |
Create a new 3D points file in the current directory.
This function create a new 3D points file in the current directory.
GTXError |
name | Name of the file to be created |
nsample | Number of samples to be created in this file |
x | Array of X coordinate of each sample |
y | Array of Y coordinate of each sample |
z | Array of Z coordinate of each sample |
The X,Y and Z values must be given in the current unit if unit_mode = false or according to the corresponding creation unit if unit_mode = true.
void GTXClient::NewPolygonsFile | ( | const char * | name, |
const GTXPolygonSystem * | psystem | ||
) |
Create a new polygon file in the current directory.
This function creates a new polygons file in the current directory.
GTXError |
name | File name of the polygons file |
psystem | Polygon system to be created |
The X,Y and Z values must be given in the current unit if unit_mode = 0 or according to the corresponding creation unit if unit_mode = 1.
void GTXClient::NewStudy | ( | const char * | study, |
const char * | path | ||
) |
Create a new study in the Isatis file system.
This function create a new study in the Isatis file system.
GTXError |
study | Name of the study to be created |
path | Physical file PATH (only works with Isatis >= 4.1) |
void GTXClient::NewWireframesFile | ( | const char * | name, |
const GTXWireframeSystem & | wsys | ||
) |
Create a new Wireframes file in the current directory.
This function creates a new wireframes file in the current directory.
GTXError |
name | File name of the wireframes file to be created |
wsys | Wireframe system to be created |
The X,Y and Z values must be given in the current unit if unit_mode = 0 or according to the corresponding creation unit if unit_mode = 1.
void GTXClient::PointsFileAppend2D | ( | gtx_long | nsample, |
const double | x[], | ||
const double | y[] | ||
) |
Append samples to the current Points 2D File.
This function appends samples to the current 2D Points File
GTXError |
nsample | Number of samples to be appended in this file |
x | Array of X coordinate of each sample |
y | Array of Y coordinate of each sample |
Creating a Points File by appending samples 1 by 1 is not optimum at all. If you know the number of samples from the beginning, you should directly create the file with the right number of points.
void GTXClient::PointsFileAppend3D | ( | gtx_long | nsample, |
const double | x[], | ||
const double | y[], | ||
const double | z[] | ||
) |
Append samples to the current 3D Points File.
This function appends samples to the current 3D Points File
GTXError |
nsample | Number of samples to be appended in this file |
x | Array of X coordinate of each sample |
y | Array of Y coordinate of each sample |
z | Array of Z coordinate of each sample |
Creating a Points File by appending samples 1 by 1 is not optimum at all. If you know the number of samples from the beginning, you should directly create the file with the right number of points.
GTXCharData GTXClient::ReadCharVariable | ( | bool | compress | ) |
Read samples from the current variable.
This function read all samples from the current variable. The variable must be an alphanumerical variable.
GTXError |
compress | Samples masked by the current selection are transformed into test values if 0, or do not appear in the output array if this flag is set to 1 |
References GTXCharData::SetUndefinedValue().
GTXCharData GTXClient::ReadCharVariableSub | ( | gtx_long | first, |
gtx_long | last, | ||
bool | compress | ||
) |
Read continuous samples from the current variable.
This function read contiguous samples from the current variable. The variable must be an alphanumerical variable.
GTXError |
first | Sample Number of the first item to read (from 1 to nsample) |
last | Sample Number of the last item to read (from 1 to nsample) |
compress | Samples masked by the current selection are transformed into test values if 0, or do not appear in the output array if this flag is set to 1 |
data | Array of character variable samples |
References GTXCharData::SetUndefinedValue().
GTXDoubleData GTXClient::ReadDoubleVariable | ( | bool | compress | ) |
Read samples from the current variable.
This function read all samples from the current variable. The variable must be an numerical variable.
GTXError |
compress | Samples masked by the current selection are transformed into test values if 0, or do not appear in the output array if this flag is set to 1 |
References GTXDoubleData::SetUndefinedValue().
GTXDoubleData GTXClient::ReadDoubleVariableSub | ( | gtx_long | first, |
gtx_long | last, | ||
bool | compress | ||
) |
Read a subpart of the samples from the current variable.
This function read a subpart of the samples from the current variable. The variable must be an numerical variable.
GTXError |
first | Sample Number of the first item to read (from 1 to nsample) |
last | Sample Number of the last item to read (from 1 to nsample) |
compress | Samples masked by the current selection are transformed into test values if 0, or do not appear in the output array if this flag is set to 1 |
References GTXDoubleData::SetUndefinedValue().
GTXFaultSystem GTXClient::ReadFaults | ( | int | priority | ) |
Get fault system associated to the current file.
This function retrieve, from the GTXserver, the fault system associated to the current file. Faults in the fault system can be masked with the given priority.
GTXError |
priority | Authorized priority |
You may use a 0 priority to get all the faults with all their segments. Use the value from GTXClientGetFileInfo to get the faults as they were saved in Isatis Fault Manager.
All coordinates are returned in the current unit (\ref GTXClient::SetUnit) or using the corresponding coordinate variable unit if unit_mode is set to 1 (\ref GTXClient::SetUnitMode).
Some memory is allocated inside passed fault_system. Memory must be freed using GTXClientFreeFaults.
GTXCharData GTXClient::ReadLineCharVariable | ( | int | line_index | ) |
Read samples of a line from the current alphanumerical variable.
This function read all samples of a line from the current alphanumerical variable.
GTXError |
line_index | The line index [1..nline] |
GTXDoubleData GTXClient::ReadLineDoubleVariable | ( | int | line_index | ) |
Read samples of a line from the current variable.
This function read all samples of a line from the current variable. The variable must be an numerical variable.
GTXError |
line_index | The line index [1..nline] |
GTXPolygonSystem GTXClient::ReadPolygons | ( | ) |
Get current file as polygon system (if possible)
This function retrieve, from the GTXserver, the polygon system associated to the current file.
GTXError |
GTXByteArray GTXClient::ReadSelectionVariable | ( | ) |
Read selection from the current variable.
This function read all selection from the current variable. The variable must be an numerical variable.
GTXError |
GTXByteArray GTXClient::ReadSelectionVariableSub | ( | gtx_long | first, |
gtx_long | last | ||
) |
Read a subpart of the selection from the current variable.
This function read a subpart of the selection from the current variable. The variable must be an numerical variable.
GTXError |
first | Selection Number of the first item to read (from 1 to nselection) |
last | Selection Number of the last item to read (from 1 to nselection) |
Warning: This functions needs a server version >= 4.0.7 for 4.0.x series or >= 4.1.1 for 4.1.x series.
GTXWireframeSystem GTXClient::ReadWireframes | ( | ) |
Get current file as wireframe system (if possible)
This function retrieve, from the GTXserver, the wireframe system associated to the current file.
GTXError |
unsigned short GTXClient::RunGTXserver | ( | unsigned short | port | ) |
Locate GTXserver executable and run it.
This function tries to locate the GTXserver executable using GTXClient::LocateGTXserver() and run it. If it is not found or if in cannot run, this function will throw an exception.
GTXError |
port | if you have a preferred port to RUN GTXserver on. If 0 a free port is taken and its value is returned. |
void GTXClient::SetAlphaIndice | ( | const char * | alphaindice | ) |
Set the current alpha indice for the current macro variable.
Set the current alpha indice for the current macro variable.
GTXError |
alphaindice | Macro alpha indice to set |
void GTXClient::SetCreationUnits | ( | const char * | x_unit, |
const char * | y_unit, | ||
const char * | z_unit | ||
) |
Change the default units for length variables creation.
This functions allows to change the default units used for coordinate variables creation when unit_mode (GTXClient::SetUnitMode) is set to true. After that, all coordinate variables creation take those units into account. This has no effect when unit_mode is false.
GTXError |
x_unit | new X coordinate unit |
y_unit | new Y coordinate unit |
z_unit | new Z coordinate unit |
void GTXClient::SetDebugMode | ( | bool | debug | ) |
Set the Debug Mode (off by default)
debug | new debug mode, false by default. When true, debug messages are sent to the terminal. |
void GTXClient::SetDirectory | ( | const char * | directory | ) |
Set the current directory.
Set the current directory to name.
GTXError |
directory | Name of the directory to be set as current |
void GTXClient::SetFile | ( | const char * | file | ) |
Set the current file in the current directory.
Set the current file in the current directory.
GTXError |
file | Name of the file to be set as current |
void GTXClient::SetFileComment | ( | bool | append, |
const char * | comment | ||
) |
Set a comment for the current file.
Set or append a comment/description to the current file
GTXError |
append |
|
comment | Comment to be set or append to the existing one |
void GTXClient::SetGTXserverPath | ( | const char * | path | ) |
Set the GTXserver path to be used by GTXClient::RunGTXserver()
path,: | full path of the GTXserver executable, should be less than 1024 characters or empty string to remove any previous specification of it. |
void GTXClient::SetIndice | ( | const int | indice | ) |
Set the current indice for the current macro variable.
Set the current indice for the current macro variable.
GTXError |
indice | Macro indice to set |
void GTXClient::SetSelection | ( | const char * | sel | ) |
Set the current selection.
Set the current selection for further reading in the current file.
GTXError |
sel | Name of the selection to be set as curent, use NULL or empty to unset a selection |
void GTXClient::SetStudy | ( | const char * | study | ) |
Set the name of the current study.
This function will set the name of the current study, all following calls will be made using this study.
GTXError |
study | Name of the study to be set |
void GTXClient::SetUnit | ( | const char * | unit | ) |
Set the current distance unit.
Set the current distance unit.
GTXError |
unit | Distance unit to set |
void GTXClient::SetUnitMode | ( | int | mode | ) |
Change the way length units are used.
This functions allows to change the way units are used at the creation of new length variables and reading of existing ones. When mode is 0, all length variables are read/written using the current unit (\ref GTXClient::SetUnit). When mode is 1, each length variable is read/written using its own unit. This also affect File Information and File Creation that are also based on coordinates variables which are the main length variables.
GTXError |
mode | new unit mode |
Warning: setting mode to 1 and back to 0 resets creation units (set with GTXClient::SetCreationUnits) to the current unit.
void GTXClient::SetVariable | ( | const char * | variable | ) |
Set the current variable in the current file.
Set the current variable in the current file
GTXError |
variable | Name of the variable to be set as curent |
void GTXClient::SetVariableAsLineName | ( | void | ) |
Set the current variable as the Line Name variable.
This function sets the current variable as the line name of the file in which it appears. The file must be a Points file linked to Lines file and the variable must be alphanumerical.
GTXError |
void GTXClient::SetVariableComment | ( | bool | append, |
const char * | comment | ||
) |
Set a comment for the current variable.
Set or append a comment/description to the current variable
GTXError |
append |
|
comment | Comment to be set or append to the existing one |
void GTXClient::SetVariableUnit | ( | const char * | factor, |
const char * | symbol | ||
) |
Change the unit factor and symbol of a variable.
This functions allows to change the unit attached to a variable. If the factor unit is part of the known units list, it changes the variable to a length one. Then we can specify a different symbol to display. If the factor, is not known as a length one, the variable will be float (e.g, not length) and the symbol will not be used.
GTXError |
factor | new unit factor |
symbol | new unit symbol (used for length or NULL) |
double GTXClient::UnitFactorFromSymbol | ( | const char * | symbol | ) |
Get the unit factor corresponding to a given unit symbol.
This function returns the unit factor corresponding to a given unit symbol or 0. if not a known length symbol.
symbol | unit symbol to be searched for |
const char * GTXClient::UnitSymbolFromFactor | ( | double | factor | ) |
Get the unit factor corresponding to a given unit symbol.
This function returns the unit symbol corresponding to a given unit symbol or an empty string if not a known length factor.
factor | unit factor to be searched for |
bool GTXClient::VariableExists | ( | const char * | variable | ) |
Check if a given variable exists.
This function asks the server if a given variable exists (or for old servers, it retrieves the list of variables and check it by itself).
GTXError |
variable | variable name to check |
bool GTXClient::VendorDataExists | ( | const char * | identifier, |
int | level | ||
) |
Checks if a Vendor Data exists.
This function verifies the existence of a Vendor Data
GTXError |
identifier | Identifier of the Vendor Data |
level | Where to read the Vendor Data
|
int GTXClient::VendorDataGetVersion | ( | const char * | identifier, |
int | level | ||
) |
Get version string from a Vendor Data.
This function reads the version string from a stored Vendor Data
GTXError |
identifier | Identifier of the Vendor Data |
level | Where to read the Vendor Data
|
GTXVendorData GTXClient::VendorDataRead | ( | const char * | identifier, |
int | level | ||
) |
Read a Vendor Data from Isatis file system.
This function reads a Vendor Data from the Isatis file system
GTXError |
identifier | Identifier of the Vendor Data |
level | Where to read the Vendor Data
|
void GTXClient::VendorDataWrite | ( | int | level, |
const GTXVendorData & | vdata | ||
) |
Write a vendor data.
This function writes a vendor data .
GTXError |
level | Where to write the Vendor Data
|
vdata | The Vendor Data to be written |
void GTXClient::WriteCharVariable | ( | bool | compress, |
const GTXCharData & | cdata | ||
) |
Write data to the current alphanumerical variable.
This function writes data to the current alphanumerical variable
GTXError |
compress | Samples masked by the selection are in the array but ignored if 0, or do not appear in the array if this flag is set to 1 |
cdata | Array of alphanumerical variable samples |
void GTXClient::WriteCharVariableSub | ( | gtx_long | first, |
gtx_long | last, | ||
bool | compress, | ||
const GTXCharData & | cdata | ||
) |
Write continuous subpart of data to the current alphanumerical variable.
This function writes a subpart of data to the current alphanumerical variable
GTXError |
first | Sample Number of the first item to write (from 1 to nsample) |
last | Sample Number of the last item to write (from 1 to nsample) |
compress | Samples masked by the selection are in the array but ignored if 0, or do not appear in the array if this flag is set to 1 |
cdata | Array of alphanumerical variable samples |
void GTXClient::WriteDoubleVariable | ( | bool | compress, |
const GTXDoubleData & | ddata | ||
) |
Write data to the current numerical variable.
This function writes data to the current numerical variable
GTXError |
compress | Samples masked by the selection are in the array but ignored if 0, or do not appear in the array if this flag is set to 1 |
ddata | Array of numerical variable samples |
If the variable is a length one, data must be in the current unit (GTXClient::SetUnit) if unit_mode is false (GTXClient::SetUnitMode). If the variable is a length one and unit_mode is true, it must be expressed in the variable unit.
void GTXClient::WriteDoubleVariableSub | ( | gtx_long | first, |
gtx_long | last, | ||
bool | compress, | ||
const GTXDoubleData & | ddata | ||
) |
Write continuous subpart of data to the current numerical variable.
This function writes a subpart of data to the current numerical variable
GTXError |
first | Sample Number of the first item to write (from 1 to nsample) |
last | Sample Number of the last item to write (from 1 to nsample) |
compress | Samples masked by the selection are in the array but ignored if 0, or do not appear in the array if this flag is set to 1 |
ddata | Array of numerical variable samples |
void GTXClient::WriteFaults | ( | GTXFaultSystem | fs | ) |
void GTXClient::WriteLineCharVariable | ( | int | line_index, |
const GTXCharData & | cdata | ||
) |
Write line data to the current alphanumerical variable.
This function writes line data to the current alphanumerical variable
GTXError |
line_index | The line index [1..nline] |
cdata | Array of alphanumerical variable samples |
void GTXClient::WriteLineDoubleVariable | ( | int | line_index, |
const GTXDoubleData & | ddata | ||
) |
Write line data to the current numerical variable.
This function writes line data to the current numerical variable
GTXError |
line_index | The line index [1..nline] |
ddata | Array of numerical variable samples |
void GTXClient::WriteSelectionVariable | ( | const GTXByteArray | data | ) |
Write selection data (0,1) to the current variable (must be a selection)
This function writes data to the current numerical/selection variable
GTXError |
data | Array of variable samples (0,1) |
References GTXByteArray::GetCount(), and GTXByteArray::GetValues().
void GTXClient::WriteSelectionVariableSub | ( | const gtx_long | first, |
const gtx_long | last, | ||
const GTXByteArray | data | ||
) |
Write continuous subpart of selection data (0,1) to the current variable (must be a selection)
This function writes data to the current numerical/selection variable
GTXError |
first | Sample Number of the first item to write (from 1 to nsample) |
last | Sample Number of the last item to write (from 1 to nsample) |
data | Array of variable samples (0,1) |
References GTXByteArray::GetCount(), and GTXByteArray::GetValues().