3.0.0-rc2
Generic utility functions.

Functions

TiglReturnCode tiglCheckPointInside (TiglCPACSConfigurationHandle cpacsHandle, double px, double py, double pz, const char *componentUID, TiglBoolean *isInside)
 Checks whether a point lies inside the given geometric object. More...
 
TiglReturnCode tiglComponentGetHashCode (TiglCPACSConfigurationHandle cpacsHandle, const char *componentUID, int *hashCodePtr)
 Returns a unique HashCode for a geometric component. More...
 
TiglReturnCode tiglConfigurationGetBoundingBox (TiglCPACSConfigurationHandle cpacsHandle, double *minX, double *minY, double *minZ, double *maxX, double *maxY, double *maxZ)
 Computes the bounding box coordinates of the configuration. More...
 
TiglReturnCode tiglConfigurationGetLength (TiglCPACSConfigurationHandle cpacsHandle, double *pLength)
 Returns the length of the plane. More...
 
const char * tiglGetErrorString (TiglReturnCode errorCode)
 Translates an error code into a string. More...
 
TiglReturnCode tiglWingGetMAC (TiglCPACSConfigurationHandle cpacsHandle, const char *wingUID, double *mac_chord, double *mac_x, double *mac_y, double *mac_z)
 This function calculates location of the quarter of mean aerodynamic chord, and gives the chord lenght as well. More...
 
TiglReturnCode tiglWingGetSpan (TiglCPACSConfigurationHandle cpacsHandle, const char *wingUID, double *pSpan)
 Returns the span of a wing. More...
 

Detailed Description

Generic utility functions for geometric components that fits not only to wings or fuselages.

Function Documentation

TiglReturnCode tiglCheckPointInside ( TiglCPACSConfigurationHandle  cpacsHandle,
double  px,
double  py,
double  pz,
const char *  componentUID,
TiglBoolean isInside 
)

Checks whether a point lies inside the given geometric object.

This function works only for solid objects!

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]pxX coordinate of point
[in]pyY coordinate of point
[in]pzZ coordinate of point
[in]componentUIDUID of the component (e.g. a fuselage UID, wing UID, wing segment UID ...)
[out]isInsideReturns, whether the point lies inside the object or not.
Returns
  • TIGL_SUCCESS if no error occurred.
  • TIGL_NOT_FOUND if no configuration was found for the given handle.
  • TIGL_UID_ERROR if the component does not exist or is not a geometric object.
  • TIGL_NULL_POINTER if componentUID or isInside are null.
  • TIGL_ERROR if some error occurred, e.g. the component is not a solid object.
TiglReturnCode tiglComponentGetHashCode ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  componentUID,
int *  hashCodePtr 
)

Returns a unique HashCode for a geometric component.

The component, for example a wing or a fuselage, could be specified via its UID. The HashCode is the same as long as the geometry of this component has not changed. The HashCode is valid through the current session only! The hash value is computed from the value of the underlying shape reference.

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]componentUIDThe uid of the component for which the hash should be computed
[out]hashCodePtrThe pointer to a hash value to represent this shape
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_NOT_FOUND if no configuration was found for the given handle
  • TIGL_NULL_POINTER if surfaceAreaPtr is a null pointer
  • TIGL_ERROR if some other error occurred
TiglReturnCode tiglConfigurationGetBoundingBox ( TiglCPACSConfigurationHandle  cpacsHandle,
double *  minX,
double *  minY,
double *  minZ,
double *  maxX,
double *  maxY,
double *  maxZ 
)

Computes the bounding box coordinates of the configuration.

Note, that the resulting values are a fast but very rough approximation!

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[out]minXMinimum x value
[out]minYMinimum y value
[out]minZMinimum z value
[out]maxXMaximum x value
[out]maxYMaximum y value
[out]maxZMaximum z value
Returns
Error code
TiglReturnCode tiglConfigurationGetLength ( TiglCPACSConfigurationHandle  cpacsHandle,
double *  pLength 
)

Returns the length of the plane.

The calculation of the airplane lenght is realized as follows:

All part of the configuration (currently all wing and fuselage segments) are put into a bounding box. The length of the plane is returned as the length of the box in x-direction.

Note, that this resulting value is a fast but very rough approximation!

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[out]pLengthLength of plane
Returns
Error code
const char* tiglGetErrorString ( TiglReturnCode  errorCode)

Translates an error code into a string.

Parameters
[in]errorCodeReturn value of a tigl function
Returns
Error code as a string.
TiglReturnCode tiglWingGetMAC ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  wingUID,
double *  mac_chord,
double *  mac_x,
double *  mac_y,
double *  mac_z 
)

This function calculates location of the quarter of mean aerodynamic chord, and gives the chord lenght as well.

It uses the classical method that can be applied to trapozaidal wings. This method is used for each segment. The values are found by taking into account of sweep and dihedral. But the effect of insidance angle is neglected. These values should coinside with the values found with tornado tool.

Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]wingUIDUID of the Wing
[out]mac_chordMean areadynamic chord length
[out]mac_x,mac_y,mac_z- Position of the MAC
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_NULL_POINTER if wingUID, mac_chord, mac_x, mac_y or mac_z are null pointers
  • TIGL_ERROR In case of an unknown error
TiglReturnCode tiglWingGetSpan ( TiglCPACSConfigurationHandle  cpacsHandle,
const char *  wingUID,
double *  pSpan 
)

Returns the span of a wing.

The calculation of the wing span is realized as follows:

  • If the wing is mirrored at a symmetry plane (like the main wing), the wing body and its mirrored counterpart are computed and are put into a bounding box. The length of the box in a specific space dimension is returned as the wing span depending on the symmetry plane (y direction for x-z planes, z direction for x-y planes, x direction for y-z symmetry planes).
  • If no symmetry plane is defined (e.g. for the fins), the largest dimension of the bounding box around the wing is returned.
Parameters
[in]cpacsHandleHandle for the CPACS configuration
[in]wingUIDUID of the Wing
[out]pSpanWing span
Returns
Error code