VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
features Library API Changes

Table of Contents

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:

Changes that are internal to an implementation or limited to comments are not listed.

Breaking Changes

DtAStarGraph path result classes were renamed

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.

// 5.2
DtAStarGraph::Path result = graph.makePath(start, end, radius, ...); // remaining arguments omitted
DtAStarGraph::PathVertex::List vertices = result.getSinglePath();
// 5.3
DtAStarGraph::PathList result = graph.makePath(start, end, radius, ...); // remaining arguments omitted
DtAStarGraph::PathVertexData::VertexList vertices = result.getSinglePath();

DtAStarGraph path result members and methods were renamed

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.

DtAStarGraph static conversion helpers changed signature

The rail segment conversion helpers take the renamed types:

// 5.2
static DtRailSegment* vertex2RailSegment(const PathVertex& v, const PathVertex& next);
static DtRailSegmentList* DtPath2RailSegmentList(const Path& path);
// 5.3
static DtRailSegment* vertex2RailSegment(const PathVertexData& v, const PathVertexData& next);
static DtRailSegmentList* DtPath2RailSegmentList(const PathList& path);

DtAStarGraph::makePath return type changed

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.

DtMakePathResult::path changed type

The asynchronous job result class now exposes the renamed type:

// 5.2
MAKVRinTerra::DtAStarGraph::Path path;
// 5.3

Code that retrieves a DtMakePathResult from a completed DtMakePathJob and assigns result->path to a local variable must use the new type.

DtFeatureNavigator::addObstacle and related methods were removed

The following public virtual methods were removed from DtFeatureNavigator:

virtual void addObstacle(const DtAreaFeature& obstacle);
virtual void addObstacle(const DtAreaFeature& obstacle, const DtAlgorithmManager* mgr);
virtual void addObstacleDoNoCheckPager(const DtAreaFeature& obstacle, const DtAlgorithmManager* mgr);

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.

DtFeatureNavigator protected members were replaced

Classes that derive from DtFeatureNavigator and reference its protected state are affected. The following protected members were removed:

const std::unique_ptr<DtAreaFeatureSet> myObstacles;
DuplicateRemover myDuplicateRemover;
DtProj::CPtr myProjection;
DtFeatureGeometry myPagedInArea;
GeometryVector myAreas;
DtFeatureGeometry myGeometry;

They were replaced by a single member:

const std::unique_ptr<DtAreaFeatureSetOperation> myObstacles;

The removed state moved into DtAreaFeatureSetOperation. The processed areas and geometry are available from that object through its areas() and geometry() accessors.

DtPathPlanner::PathVertex now aliases PathVertexData

The DtPathPlanner::PathVertex typedef was retained but retargeted:

// 5.2
typedef DtAStarGraph::PathVertex PathVertex;
// 5.3
typedef DtAStarGraph::PathVertexData PathVertex;

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:

// 5.2
struct PathSegment
{
PathVertex::List path;
double length;
// ...
};
// 5.3
struct PathSegment
{
PathVertex::VertexList path;
double length;
// ...
};

DtPathPlanner::insertNavigationPaths is no longer public

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.

Additions

DtAreaFeatureSetOperation

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.

std::unique_ptr<DtAreaFeatureSetOperation> obstacles =
"GEO(MAK_OBSTACLE | (MAK_WATERWAY - MAK_ROAD))", terrainIf, 0.0);
obstacles->processGeometryInAreaBlocking(areaOfInterest);

Processing is available in a blocking form (processGeometryInAreaBlocking) and a non-blocking form (processGeometryInArea followed by processPendingGeometryInArea while data paging completes).

DtFeatureNavigator constructor taking a DtAreaFeatureSetOperation

A second constructor accepts a composed obstacle set:

DtFeatureNavigator(const DtAreaFeatureSetOperation& obstacles, const DtAlgorithmManager& mgr);

The existing DtAreaFeatureSet constructor is unchanged and remains supported; it wraps the feature set in a DtAreaFeatureSetOperation internally.

DtPathPlanner::planPath overload taking a DtAreaFeatureSetOperation

A new planPath overload accepts a composed obstacle set in place of a single DtAreaFeatureSet:

PathVertex::VertexList planPath(
const DtAreaFeatureSetOperation& obstacles,
DtAStarGraph& graph,
DtAStarGraph::DtWeightFactorsList& weightFactors,
const double offRoadPathWeight,

The corresponding DtAreaFeatureSet overload is unchanged.

DtPathPlanner::setAdjustStartIfInObstacle

A new setter controls whether the planner moves the start point out of an obstacle before planning:

void setAdjustStartIfInObstacle(bool v);

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.

DtAStarGraph::PathVertexData::printString

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:

std::string printString() const;

DtProj::isWebMercator

DtProj gained a predicate alongside the existing isGeocentric, isFlatEarth, and isUTM queries:

bool isWebMercator() const;

DtTHROW_NEW_STD_EXCEPTION macro

features/featureGeometry.h now defines a macro for throwing exception types whose constructors take const char* rather than DtString:

#define DtTHROW_NEW_STD_EXCEPTION(exceptionClass, errorMsg) // ... expansion omitted

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.

Summary of Header Changes

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]


Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)