VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
railUtils.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include "vrfutil/railSegment.h"
12 #include "matrix/vlVector.h"
13 #include "vrfutil/vrfutilDefines.h"
14 #include "terrainCS/coordSystem.h"
15 #include "vrfutil/iteratorBase.h"
16 #include "vrfutil/rwRailSegment.h"
18 #include "geometry/point.h"
19 
21 
25  const Coordinate_System& coordinateSystem,double & distanceToSeg);
26 
28 DT_DLL_vrfutil double distance2DAlongRailFromStart(const DtVector & pos, const DtRailSegmentList * rails,const Coordinate_System& coordinateSystem);
29 
31 DT_DLL_vrfutil DtVector locationAlongRail(double distanceFromStart, const DtRailSegmentList * rails,const Coordinate_System& coordinateSystem);
32 
34 DT_DLL_vrfutil DtVector locationAlongRailSegment(double distanceFromSegmentStart, const DtRailSegment* railSegment);
35 
37 DT_DLL_vrfutil double railHeading(const DtRailSegment* railSegment,const Coordinate_System& coordinateSystem);
38 
41 DT_DLL_vrfutil int findTurnDirection(double currentHeading, double desiredHeading,double & headingDiff);
42 
44 DT_DLL_vrfutil bool intersection(const DtRailSegment * currentSegment,const DtRailSegment * nextSegment);
45 
47 DT_DLL_vrfutil int findDrivingLane(const int turnDirection,const DtRailSegment* segment);
48 
49 DT_DLL_vrfutil const DtRailSegment * findClosestSegment( const DtVector & pos, const DtRailSegmentList * rails, const Coordinate_System & coordinateSystem,
50  double & distanceSqAlongClosest);
52 DT_DLL_vrfutil double distance2DAlongRailBetween2Points(const DtVector & pos1, const DtVector & pos2, const DtRailSegmentList * rails,
53  const Coordinate_System& coordinateSystem);
54 
55 DT_DLL_vrfutil double closestPointInXY(const DtRailSegment * seg, const DtVector & pointFronm, DtVector & closest,
56  const Coordinate_System & coordinateSystem);
57 
68  const int lane, const double headingChange);
69 
75 DT_DLL_vrfutil DtRailSegment * generateEntryPoint(const DtPoint & entry, DtRailSegmentList * rails,const DtVector & entityPos,
76  bool drivingOnLeft,bool pivots,const double turnRadius,const double entityHeading,DtVector & entryPoint, const Coordinate_System& coordinateSystem);
77 
80 DT_DLL_vrfutil void setUpLocalToBodyCoordinateTransform(const DtVector & offset, const double heading,
81  const Coordinate_System& coordinateSystem,DtCoordTransform& transform);
82 
84 
86  DtIteratorDirection dir,bool startAtClosestPt,
87  const Coordinate_System& coordinateSystem);
88 
90  DtIteratorDirection dir,bool startAtClosestPt,
91  const Coordinate_System& coordinateSystem,DtRailSegmentList & rails);
92 
110 DT_DLL_vrfutil bool calcOrthoOffset(const DtPoint& startPoint, const DtPoint& endPoint, double distance,
111  DtPoint& leftOffset, DtPoint& rightOffset);
112 
123 DT_DLL_vrfutil bool findPointOnLine(const DtPoint& startPoint,
124  const DtPoint& endPoint, DtPoint& result, double distance);
125 
126 DT_DLL_vrfutil bool isRailWithinDistance(const Coordinate_System* coordSys, const DtVector& sourceLocation,
127  DtRailSegment* railSegment, double allowDistance, double& actualDistSq);
128 
129 DT_DLL_vrfutil bool isLocationWithinRoad(const Coordinate_System* coordSys, const DtVector& sourceLocation,
130  DtRailSegment* railSegment);
131 
134 DT_DLL_vrfutil DtVector convertGeocVecToTopo(const DtVector& geocPoint, const DtCoordTransform& matrix);
135 
137 DT_DLL_vrfutil DtVector convertTopoVecToGeoc(const DtVector& topoPoint, const DtCoordTransform& matrix);
138 
139 DT_DLL_vrfutil DtCoordTransform generateTransformMatrix(const DtVector& geocViewpoint);
140 
157  const double allowedError, const Coordinate_System* localCoordinateSystem,
158  bool debug = false);
File: rwRailSegment.h.
std::list< DtRailSegment * > DtRailSegmentList
Definition: railSegment.h:197
DT_DLL_vrfutil DtRwRailSegmentList * createRwRailPath(const DtRailSegmentList *rails)
File: lclVecIter.h.
Definition: localVectorIterator.h:25
DT_DLL_vrfutil int findTurnDirection(double currentHeading, double desiredHeading, double &headingDiff)
Returns which direction the turn is, -1 indicates left, 1 indicates right.
DT_DLL_vrfutil int findDrivingLane(const int turnDirection, const DtRailSegment *segment)
Given the direction we want to turn determine the driving lane to be in.
DtRailSegment are segments entities can follow when using the rail movement system.
Definition: railSegment.h:23
DT_DLL_vrfutil DtRwRailSegmentList * createRwRailPathFromRoute(DtLocalVectorIterator &routeIter, const DtVector startPos, DtIteratorDirection dir, bool startAtClosestPt, const Coordinate_System &coordinateSystem)
DT_DLL_vrfutil double distance2DSqAlongRailSegment(const DtVector &pos, const DtRailSegment *seg, const Coordinate_System &coordinateSystem, double &distanceToSeg)
Set of Useful functions when an entity is moving along rails.
DT_DLL_vrfutil DtRailSegment * generateEntryPoint(const DtPoint &entry, DtRailSegmentList *rails, const DtVector &entityPos, bool drivingOnLeft, bool pivots, const double turnRadius, const double entityHeading, DtVector &entryPoint, const Coordinate_System &coordinateSystem)
Generates an entry rail segment to get the entity smoothly onto the rail path.
DT_DLL_vrfutil const DtRailSegment * findClosestSegment(const DtVector &pos, const DtRailSegmentList *rails, const Coordinate_System &coordinateSystem, double &distanceSqAlongClosest)
DtIteratorDirection
Definition: iteratorBase.h:23
DT_DLL_vrfutil double distance2DAlongRailFromStart(const DtVector &pos, const DtRailSegmentList *rails, const Coordinate_System &coordinateSystem)
How far from the start of the rail path pos is. This is distance along the path not as the crow flies...
Definition: coordSystem.h:54
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points.
DT_DLL_vrfutil double laneLengthTurnAdjustment(const DtRailSegment *seg, const int lane, const double headingChange)
This function calculates the difference in lane length from the segment centerline length because it ...
DT_DLL_vrfutil DtVector locationAlongRailSegment(double distanceFromSegmentStart, const DtRailSegment *railSegment)
DT_DLL_vrfutil bool isRailWithinDistance(const Coordinate_System *coordSys, const DtVector &sourceLocation, DtRailSegment *railSegment, double allowDistance, double &actualDistSq)
DT_DLL_vrfutil DtVector convertGeocVecToTopo(const DtVector &geocPoint, const DtCoordTransform &matrix)
This function converts a point (not a vector) using the given transformation matrix–which is expected...
DT_DLL_vrfutil double railHeading(const DtRailSegment *railSegment, const Coordinate_System &coordinateSystem)
Returns the heading from the start point to the end point of the given rail segment in the given coor...
DT_DLL_vrfutil void setUpLocalToBodyCoordinateTransform(const DtVector &offset, const double heading, const Coordinate_System &coordinateSystem, DtCoordTransform &transform)
Returns a coordinate transform matrix to transform from local coordinates to the body coordinates bas...
DT_DLL_vrfutil double distance2DAlongRailBetween2Points(const DtVector &pos1, const DtVector &pos2, const DtRailSegmentList *rails, const Coordinate_System &coordinateSystem)
Distance between two positions on the rail path.
DT_DLL_vrfutil DtVector convertTopoVecToGeoc(const DtVector &topoPoint, const DtCoordTransform &matrix)
Similarly.
DT_DLL_vrfutil bool calcOrthoOffset(const DtPoint &startPoint, const DtPoint &endPoint, double distance, DtPoint &leftOffset, DtPoint &rightOffset)
This function generates two offset values that can be used for any point on the given segment...
DT_DLL_vrfutil DtCoordTransform generateTransformMatrix(const DtVector &geocViewpoint)
DT_DLL_vrfutil bool intersection(const DtRailSegment *currentSegment, const DtRailSegment *nextSegment)
Given two segments, determine if where they meet is an intersection or just a bend in the road...
DT_DLL_vrfutil void fillInRailPathFromRoute(DtLocalVectorIterator &routeIter, const DtVector startPos, DtIteratorDirection dir, bool startAtClosestPt, const Coordinate_System &coordinateSystem, DtRailSegmentList &rails)
DT_DLL_vrfutil DtVector locationAlongRail(double distanceFromStart, const DtRailSegmentList *rails, const Coordinate_System &coordinateSystem)
DT_DLL_vrfutil bool findPointOnLine(const DtPoint &startPoint, const DtPoint &endPoint, DtPoint &result, double distance)
The end point is mostly only for directionality of the resulting point.
DT_DLL_vrfutil double closestPointInXY(const DtRailSegment *seg, const DtVector &pointFronm, DtVector &closest, const Coordinate_System &coordinateSystem)
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
voidpf uLong offset
Definition: ioapi.h:42
DT_DLL_vrfutil bool removeShortSegmentsFromRailPath(DtRailSegmentList &railPath, const double allowedError, const Coordinate_System *localCoordinateSystem, bool debug=false)
This function removes short segments from a rail path when possible so that feasible vehicle paths ca...
Definition: point.h:34
DT_DLL_vrfutil bool isLocationWithinRoad(const Coordinate_System *coordSys, const DtVector &sourceLocation, DtRailSegment *railSegment)

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)