Track loader for tracks of version 4. More...
#include <stdlib.h>#include <math.h>#include <stdio.h>#include <stdarg.h>#include <limits>#include <tgf.h>#include <robottools.h>#include <track.h>#include <portability.h>#include "trackinc.h"
Go to the source code of this file.
Macros | |
| #define | TSTX(x) |
| #define | TSTY(y) |
| #define | TSTZ(z) |
| #define | MAX_TMP_INTS 256 |
Functions | |
| static void | formatTrackPath (char *buffer, const int size, const char *format,...) |
| Format a track parameter path and fail if it would be truncated. | |
| static tTrackSeg * | findFirstSegmentByName (const tTrack *track, const char *name) |
| static tTrackSeg * | findLastSegmentByName (const tTrack *track, const char *name) |
| static void | initSideForTurn (const int turntype, tTrackSeg *const curBorder, const tTrackSeg *const curSeg, const int side, const int bankingtype, const tdble startwidth, const tdble endwidth, const tdble maxwidth) |
| Set up side and border track segments for turns. | |
| static void | initSideForStraight (tTrackSeg *const curBorder, const tTrackSeg *const curSeg, const int side, const int bankingtype, const tdble startwidth, const tdble endwidth) |
| Set up side and border track segments for straight segments. | |
| static tTrackSeg * | commonSideInit (tTrackSeg *const curSeg, const int side, const int lefttype, const int righttype, const int bankingtype, const tdble startwidth, const tdble endwidth, tTrackSurface *surface, const tdble borderheight, const int borderstyle) |
| Common side/border allocation and initialization for straights and turns. | |
| static tTrackSurface * | getTrackSurface (void *trackHandle, tTrack *theTrack, const char *material) |
| Gets surface properties based on the material. | |
| static void | readDefaultSideParameters (void *trackHandle, tTrack *theTrack) |
| Reads default side/border track segment parameters. | |
| static void | addSides (tTrackSeg *curSeg, void *trackHandle, tTrack *theTrack, int curStep, int steps) |
| Adds the specified side/border/barrier segments to given main track segement. | |
| static void | normSeg (tTrackSeg *curSeg) |
| Segment coordinate normalization, track is moved to the origin of the coordinate system. | |
| static void | CreateSegRing (void *TrackHandle, tTrack *theTrack, int ext) |
| static void | readGeoreference (tTrack *track, void *handle) |
| void | ReadTrack4 (tTrack *theTrack, void *TrackHandle, tRoadCam **camList, int ext) |
| static void | updateMinMaxForTurn (const tTrackSeg *const curBorder, const tdble radius, const tdble sign, const tdble z) |
| Update global min/max values for turns (discretized approximation). | |
| static void | initAnglesAndGradients (tTrackSeg *const curBorder, const tdble startwidth, const tdble endwidth) |
| Set up border segment angles and gradients. | |
Track loader for tracks of version 4.
Definition in file track4.cpp.
| #define MAX_TMP_INTS 256 |
| #define TSTX | ( | x | ) |
Definition at line 38 of file track4.cpp.
| #define TSTY | ( | y | ) |
Definition at line 43 of file track4.cpp.
| #define TSTZ | ( | z | ) |
Definition at line 48 of file track4.cpp.
|
static |
Adds the specified side/border/barrier segments to given main track segement.
| [in,out] | curSeg | Main track segment to process |
| [in] | trackHandle | Handle to track parameter set |
| [in] | theTrack | Pointer to track structure |
| [in] | curStep | Current step (for segment subdivision) |
| [in] | steps | Number of steps (segment subdivisions) |
Definition at line 297 of file track4.cpp.

|
static |
Common side/border allocation and initialization for straights and turns.
| [in,out] | curSeg | Segment to attach the new side/border |
| [in] | side | 0 for right side, 1 for left side (TRK_SECT_RSIDE, TRK_SECT_LSIDE) |
| [in] | lefttype | For side: TR_LSIDE, for border: TR_LBORDER |
| [in] | righttype | For side: TR_RSIDE, for border: TR_RBORDER |
| [in] | bankingtype | For TRK_VAL_TANGENT 1, for TRK_VAL_LEVEL 0 |
| [in] | startwidth | Start width of the side/border |
| [in] | endwidth | End width of the side/border |
| [in] | surface | Surface for the side/border |
| [in] | borderheight | Border height for borders, should usually be 0.0 for sides |
| [in] | borderstyle | Type of segment, for sides always TR_PLAN, for borders either TR_PLAN, TR_CURB or TR_WALL |
Definition at line 1522 of file track4.cpp.

|
static |
|
static |
Format a track parameter path and fail if it would be truncated.
Truncated parameter paths would read unrelated or default track data, so track loading must stop instead of continuing with a partial path.
| [in,out] | buffer | buffer for the formatted path |
| [in] | size | buffer size |
| [in] | format | printf-style format string |
Definition at line 72 of file track4.cpp.

|
static |
Gets surface properties based on the material.
If the material is not known, then a new material is created, initialized and attached to tTrack.
| [in] | trackHandle | Handle to track parameter set |
| [in,out] | theTrack | Pointer to track structure |
| [in] | material | Material name of the surface |
Definition at line 187 of file track4.cpp.

|
static |
Set up border segment angles and gradients.
| [in,out] | curBorder | Border segment to set up |
| [in] | startwidth | Start width of the border |
| [in] | endwidth | End width of the border |
Definition at line 1359 of file track4.cpp.
|
static |
Set up side and border track segments for straight segments.
Border segments are the ones touching the main segment (e.g. curbs), side segments are the segments touching the barrier.
| [in,out] | curBorder | Border segment to set up |
| [in] | curSeg | Connecting inner segment (e.g. main track segment for borders) |
| [in] | side | 0 for right side, 1 for left side (TRK_SECT_RSIDE, TRK_SECT_LSIDE) |
| [in] | bankingtype | For TRK_VAL_TANGENT 1, for TRK_VAL_LEVEL 0 |
| [in] | startwidth | Start width of the border |
| [in] | endwidth | End width of the border |
Definition at line 1460 of file track4.cpp.
|
static |
Set up side and border track segments for turns.
Border segments are the ones touching the main segment (e.g. curbs), side segments are the segments touching the barrier.
| [in] | turntype | Turn type, either TR_LFT or TR_RGT |
| [in,out] | curBorder | Border segment to set up |
| [in] | curSeg | Connecting inner segment (e.g. main track segment for borders) |
| [in] | side | 0 for right side, 1 for left side (TRK_SECT_RSIDE, TRK_SECT_LSIDE) |
| [in] | bankingtype | For TRK_VAL_TANGENT 1, for TRK_VAL_LEVEL 0 |
| [in] | startwidth | Start width of the border |
| [in] | endwidth | End width of the border |
| [in] | maxwidth | Maximum width of the border |
Definition at line 1384 of file track4.cpp.

|
static |
Segment coordinate normalization, track is moved to the origin of the coordinate system.
| [in,out] | curSeg | Segment to normalize |
Definition at line 439 of file track4.cpp.
|
static |
Reads default side/border track segment parameters.
| [in] | trackHandle | Handle to track parameter set |
| [in,out] | theTrack | Pointer to track structure |
Definition at line 230 of file track4.cpp.

|
static |
|
static |
Update global min/max values for turns (discretized approximation).
| [in] | curBorder | Border segment |
| [in] | radius | Radius to hand over, either curBorder->radiusl or curBorder->radiusr |
| [in] | sign | Sign to consider turn type (TR_LFT or TR_RGT) |
| [in] | z | Z value |
Definition at line 1333 of file track4.cpp.

|
static |
Definition at line 135 of file track4.cpp.
|
static |
Definition at line 137 of file track4.cpp.
|
static |
Definition at line 136 of file track4.cpp.
|
static |
Definition at line 138 of file track4.cpp.
|
static |
Definition at line 134 of file track4.cpp.
|
static |
Definition at line 129 of file track4.cpp.
|
static |
Definition at line 131 of file track4.cpp.
|
static |
Definition at line 130 of file track4.cpp.
|
static |
Definition at line 132 of file track4.cpp.
|
static |
Definition at line 128 of file track4.cpp.
|
static |
Definition at line 126 of file track4.cpp.
|
static |
Definition at line 140 of file track4.cpp.
|
static |
Definition at line 58 of file track4.cpp.
|
static |
Definition at line 57 of file track4.cpp.
|
static |
Definition at line 56 of file track4.cpp.
|
static |
Definition at line 122 of file track4.cpp.
|
static |
Definition at line 120 of file track4.cpp.
|
static |
Definition at line 123 of file track4.cpp.
|
static |
Definition at line 121 of file track4.cpp.
|
static |
Definition at line 124 of file track4.cpp.
|
static |
Definition at line 60 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.