![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the features library between VR-Forces 5.2 (SVN r280939) and the current trunk.
It covers the following public headers:
features/aStarGraph.hfeatures/featureGeometry.hfeatures/featureNavigator.hfeatures/geosGeometry.hfeatures/pathPlanner.hfeatures/proj.hChanges that are internal to an implementation or limited to comments are not listed.
The classes that carry the result of an A* search were renamed to better describe their contents. Any code that declares variables of these types, or that accesses their members, must be updated. The behavior of the classes is unchanged, so the update is purely mechanical.
| 5.2 name | 5.3 name |
|---|---|
DtAStarGraph::PathVertex | DtAStarGraph::PathVertexData |
DtAStarGraph::PathVertex::List | DtAStarGraph::PathVertexData::VertexList |
DtAStarGraph::MultiPathVertex::List | DtAStarGraph::MultiPathVertex::SetOfPaths |
DtAStarGraph::Path | DtAStarGraph::PathList |
DtAStarGraph::Path::Sequence | DtAStarGraph::PathList::Sequence |
DtAStarGraph::PathList is the type returned from DtAStarGraph::makePath, and it holds a collection of independent paths. The path planning code produces a single path, so the collection always contains one entry.
Several members and methods of the path result classes were renamed at the same time. The replacement names are direct substitutions with identical signatures unless noted.
| 5.2 declaration | 5.3 declaration |
|---|---|
static double PathVertex::Distance(const List&) | static double PathVertexData::pathLength(const VertexList&) |
MultiPathVertex::pathVertex | MultiPathVertex::vertexData |
MultiPathVertex::nextVertices | MultiPathVertex::branches |
MultiPathVertex::addPath(List::const_iterator, List::const_iterator) | MultiPathVertex::addBranch(VertexList::const_iterator, VertexList::const_iterator) |
MultiPathVertex::addPathToEnd(List::const_iterator, List::const_iterator) | MultiPathVertex::addPathToEndOfEachBranch(VertexList::const_iterator, VertexList::const_iterator) |
MultiPathVertex::addPathToEnd(const MultiPathVertex&) | MultiPathVertex::addPathToEndOfEachBranch(const MultiPathVertex&) |
Path::addPath(const MultiPathVertex::List&) | PathList::addPaths(const MultiPathVertex::SetOfPaths&) |
Note that Path::addPathToEnd(const PathVertex::List&) was not renamed; the equivalent member on PathList is still addPathToEnd, now taking a PathVertexData::VertexList. Only the MultiPathVertex overloads were given the ...ToEndOfEachBranch name. Code that called addPathToEnd on a MultiPathVertex and code that called it on a Path were previously easy to confuse; review each call site individually rather than performing a global rename.
Path::addPath(const MultiPathVertex::List&) became PathList::addPaths because the two remaining addPath overloads (taking a PathVertexData::VertexList and a PathList) kept their names. A call that previously resolved by overload resolution to the MultiPathVertex::List version must be changed explicitly to addPaths.
The rail segment conversion helpers take the renamed types:
Both overloads of makePath (the parameter list form and the SearchParameters form) now return PathList instead of Path. Code that stores the return value in an explicitly typed variable must be updated.
The asynchronous job result class now exposes the renamed type:
Code that retrieves a DtMakePathResult from a completed DtMakePathJob and assigns result->path to a local variable must use the new type.
The following public virtual methods were removed from DtFeatureNavigator:
Obstacle accumulation is now the responsibility of DtAreaFeatureSetOperation, which the navigator holds internally. Construct the navigator from the feature set or feature set operation that describes the complete obstacle set, then call processObstacles with the geometry of the area of interest. There is no supported replacement for incrementally adding individual DtAreaFeature objects to an existing navigator.
Classes that derive from DtFeatureNavigator and reference its protected state are affected. The following protected members were removed:
They were replaced by a single member:
The removed state moved into DtAreaFeatureSetOperation. The processed areas and geometry are available from that object through its areas() and geometry() accessors.
The DtPathPlanner::PathVertex typedef was retained but retargeted:
As a consequence, the nested list type changed from PathVertex::List to PathVertex::VertexList. This affects the member of DtPathPlanner::PathSegment and the return type of every planPath overload:
Both overloads of insertNavigationPaths moved from the public section to the protected section of DtPathPlanner. External callers must instead call one of the planPath overloads, which invoke insertNavigationPaths internally. Derived classes retain access.
The new header features/areaFeatureSetOperation.h defines DtAreaFeatureSetOperation, a class that composes area feature sets with union, difference, and intersection operations. This is the mechanism behind the new navigator and path planner overloads described below.
An operation is built either from a single DtAreaFeatureSet, from two feature sets combined by an OperationType, or from two nested operations. The static parseFeatureSetQuery method builds an operation tree from a query string that supports FEATURE_SET() blocks for feature set expressions and GEO() blocks for geometric composition, with an optional buffer distance applied to the borders of each feature set.
Processing is available in a blocking form (processGeometryInAreaBlocking) and a non-blocking form (processGeometryInArea followed by processPendingGeometryInArea while data paging completes).
A second constructor accepts a composed obstacle set:
The existing DtAreaFeatureSet constructor is unchanged and remains supported; it wraps the feature set in a DtAreaFeatureSetOperation internally.
A new planPath overload accepts a composed obstacle set in place of a single DtAreaFeatureSet:
The corresponding DtAreaFeatureSet overload is unchanged.
A new setter controls whether the planner moves the start point out of an obstacle before planning:
The default is false, which preserves the 5.2 behavior. Set it to true to have the planner relocate a start point that falls inside an obstacle to the nearest point outside it.
A new method returns a human-readable description of a path vertex, including its location and selected attributes of the associated path feature when one is present. It is intended for diagnostics and logging:
DtProj gained a predicate alongside the existing isGeocentric, isFlatEarth, and isUTM queries:
features/featureGeometry.h now defines a macro for throwing exception types whose constructors take const char* rather than DtString:
Because this is a preprocessor macro in a public header, any application symbol with the same name will collide. Rename conflicting symbols if a build error appears after upgrading. The macro is used internally by features/geosGeometry.h, where the invalid-geometry throw was switched from DtTHROW_NEW to DtTHROW_NEW_STD_EXCEPTION; the exception type and message are unchanged, so the behavior seen by catch handlers is the same.
| Header | Breaking | Additions |
|---|---|---|
aStarGraph.h | Path result class, member, and method renames; makePath and conversion helper signature changes; DtMakePathResult::path type change | PathVertexData::printString |
featureGeometry.h | None | DtTHROW_NEW_STD_EXCEPTION macro |
featureNavigator.h | addObstacle, addObstacle with manager, and addObstacleDoNoCheckPager removed; protected members replaced | Constructor taking DtAreaFeatureSetOperation |
geosGeometry.h | None | None |
pathPlanner.h | PathVertex retargeted to PathVertexData; PathSegment::path and planPath return types changed; insertNavigationPaths moved to protected | planPath overload taking DtAreaFeatureSetOperation; setAdjustStartIfInObstacle |
proj.h | None | isWebMercator |
Return to VR-Forces 5.3 API Migration Guide.
[Home]