29#include "common/support/CommonSupportConsole.h"
30#include "trax/support/TraxSupportXML.h"
31#include "trax/Curve.h"
59 dclspc std::unique_ptr<Curve> CreateLine(
const boost::property_tree::ptree& pt );
60 dclspc std::unique_ptr<Curve> CreateLineP(
const boost::property_tree::ptree& pt );
61 dclspc std::unique_ptr<Curve> CreateArc(
const boost::property_tree::ptree& pt );
62 dclspc std::unique_ptr<Curve> CreateArcP(
const boost::property_tree::ptree& pt );
63 dclspc std::unique_ptr<Curve> CreateHelix(
const boost::property_tree::ptree& pt );
64 dclspc std::unique_ptr<Curve> CreateHelixP(
const boost::property_tree::ptree& pt );
65 dclspc std::unique_ptr<Curve> CreateCubic(
const boost::property_tree::ptree& pt );
66 dclspc std::unique_ptr<Curve> CreateSpline(
const boost::property_tree::ptree& pt );
67 dclspc std::unique_ptr<Curve> CreateClothoid(
const boost::property_tree::ptree& pt );
68 dclspc std::unique_ptr<Curve> CreateRotator(
const boost::property_tree::ptree& pt );
69 dclspc std::unique_ptr<Curve> CreateRotatorChain(
const boost::property_tree::ptree& pt );
70 dclspc std::unique_ptr<Curve> CreatePolygonalChain(
const boost::property_tree::ptree& pt );
71 dclspc std::unique_ptr<Curve> CreateSampledCurve(
const boost::property_tree::ptree& pt );
72 dclspc std::unique_ptr<Curve> CreateEEPCurve(
const boost::property_tree::ptree& pt );
74 dclspc
void RegisterAllCurveReaders(
class PTreeReader& toReader );
76 dclspc std::unique_ptr<RoadwayTwist> CreateConstantTwist(
const boost::property_tree::ptree& pt );
77 dclspc std::unique_ptr<RoadwayTwist> CreateLinearTwist(
const boost::property_tree::ptree& pt );
78 dclspc std::unique_ptr<RoadwayTwist> CreatePiecewiseTwist(
const boost::property_tree::ptree& pt );
79 dclspc std::unique_ptr<RoadwayTwist> CreatePiecewiseLinearTwist(
const boost::property_tree::ptree& pt );
80 dclspc std::unique_ptr<RoadwayTwist> CreatePiecewiseCircularTwist(
const boost::property_tree::ptree& pt );
81 dclspc std::unique_ptr<RoadwayTwist> CreateDirectionalTwist(
const boost::property_tree::ptree& pt );
83 dclspc
void RegisterAllTwistReaders(
class PTreeReader& toReader );
99 dclspc PTreeReader(
const char* pLocale =
nullptr );
100 dclspc PTreeReader(
SocketRegistry& socketRegistry,
const char* pLocale =
nullptr );
101 PTreeReader(
const PTreeReader& ) =
delete;
102 dclspc PTreeReader( PTreeReader&& )
noexcept;
103 dclspc
virtual ~PTreeReader();
105 PTreeReader& operator=(
const PTreeReader& ) =
delete;
106 PTreeReader& operator=( PTreeReader&& )
noexcept =
delete;
108 using CurveReaderFunction = std::unique_ptr<Curve> (*)(
const boost::property_tree::ptree& pt );
110 void dclspc RegisterCurveReader(
const std::string& typeName, CurveReaderFunction readerFunc );
112 void dclspc UnregisterCurveReader(
const std::string& typeName );
115 using TwistReaderFunction = std::unique_ptr<RoadwayTwist> (*)(
const boost::property_tree::ptree& pt );
117 void dclspc RegisterTwistReader(
const std::string& typeName, TwistReaderFunction readerFunc );
119 void dclspc UnregisterTwistReader(
const std::string& typeName );
121 inline const char* GetLocale()
const{
125 virtual std::shared_ptr<trax::TrackSystem> ReadTrackSystem(
const boost::property_tree::ptree& pt )
const = 0;
127 std::unique_ptr<Curve> CreateCurve(
const boost::property_tree::ptree& pt )
const;
129 std::unique_ptr<RoadwayTwist> CreateTwist(
const boost::property_tree::ptree& pt )
const;
132 std::unique_ptr<SocketRegistry> m_pSocketRegistry;
133 class PTreeReaderBaseImpl* m_pImpl =
nullptr;
134 const char* m_pLocale =
nullptr;
136 std::unique_ptr<RoadwayTwist> CreateCombinedTwist(
const boost::property_tree::ptree& pt )
const;
143 template<
class Interface>
144 inline void AttributesToReferences(
const boost::property_tree::ptree& pt, Interface& refInterface ){
145 const auto iter = pt.find(
"<xmlattr>" );
146 if( iter != pt.not_found() )
147 for(
const auto& attribute : iter->second )
148 refInterface.Reference( attribute.first, attribute.second.data() );
154 dclspc
void Read(
const boost::property_tree::ptree& pt,
Cubic::Data& curve );
155 dclspc
void Read(
const boost::property_tree::ptree& pt,
CurveSample& sample );
156 dclspc
void Read(
const boost::property_tree::ptree& pt,
EEPCurve::Data& data );
Base class for XML readers based on ptree.
Definition CollectionSupportXML.h:97
ptree operator support
Definition CommonSupportXML.h:42
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
CubicData Data
Data definig the curve.
Definition Curve.h:1073
The dynamic data of a curve at one point.
Definition Curve.h:410
Data definig the curve.
Definition Curve.h:1944
Interface for objects that indicates system states somehow.
Definition Indicator.h:45
A RoadwayTwist is used to define the actual rotating angle around the tangent at a curve to get the c...
Definition RoadwayTwist.h:81
Collection to hold a set of Signal objects.
Definition SignalCollection.h:36
Interface for a registry that reconnects Plugs and Jacks according to their IDs.
Definition SocketRegistry.h:40
A track system is the container for tracks.
Definition TrackSystem.h:56