30#include "trax/Event.h"
32#include "trax/TrackLocation.h"
33#include "trax/Location.h"
34#include "trax/Curve.h"
36#include "trax/Switch.h"
38#include "common/support/CommonSupportStream.h"
39#include "dim/support/DimSupportStream.h"
40#include "spat/support/SpatSupportStream.h"
53 inline std::ostream& operator << ( std::ostream& os,
const Track::EndType& endType );
57 inline std::ostream& operator << ( std::ostream& os,
const Track::End& end );
61 inline std::ostream& operator << ( std::ostream& ost,
const Location& location );
63 inline std::ostream& operator << ( std::ostream& ost,
const TrackLocation& location );
65 inline std::ostream& operator << ( std::ostream& ost,
const TrackLocationRef& location );
67 inline std::ostream& operator << ( std::ostream& ost,
const TrackRange& range );
69 inline std::ostream& operator<<( std::ostream& ost,
const Orientation& orient );
71 inline std::ostream& operator<<( std::ostream& ost,
const Orientation::Value& orient );
77 inline std::ostream& operator << ( std::ostream& os,
const LineP::Data& data );
78 inline std::ostream& operator << ( std::ostream& os,
const Arc::Data& data );
79 inline std::ostream& operator << ( std::ostream& os,
const ArcP::Data& data );
80 inline std::ostream& operator << ( std::ostream& os,
const Helix::Data& data );
81 inline std::ostream& operator << ( std::ostream& os,
const HelixP::Data& data );
82 inline std::ostream& operator << ( std::ostream& os,
const Cubic::Data& data );
83 inline std::ostream& operator << ( std::ostream& os,
const Spline::Data& data );
84 inline std::ostream& operator << ( std::ostream& os,
const Clothoid::Data& data );
85 inline std::ostream& operator << ( std::ostream& os,
const Rotator::Data& data );
87 inline std::ostream& operator << ( std::ostream& os,
const PolygonalChain::Data& data );
99 inline std::istream&
operator >> ( std::istream& is, PolygonalChain::Data& data );
101 inline std::ostream& operator << ( std::ostream& os,
const PiecewiseTwist::Data& data );
102 inline std::istream&
operator >> ( std::istream& is, PiecewiseTwist::Data& data );
104 inline std::ostream& operator << ( std::ostream& os,
const EventFilter::Type& type );
106 inline std::istream&
operator >> ( std::istream& is, EventFilter::Type& type );
109 inline std::ostream& operator << ( std::ostream& os,
const JackEnumerator& jackenumerator );
110 inline std::ostream& operator << ( std::ostream& os,
const Jack& jack );
111 inline std::ostream& operator << ( std::ostream& os,
const Plug& plug );
117 inline std::ostream& operator << ( std::ostream& os,
const Track::EndType& endType ){
118 os <<
"Track::EndType( " << ToString( endType ) <<
" )";
125 if( token !=
"Track::EndType(" )
126 throw std::runtime_error(
"No Track::EndType" );
136 std::ostream& operator<<( std::ostream& os,
const Track::End& end )
138 os <<
"Track::End( " << end.id <<
", " << ToString(end.type) <<
" )";
146 if( token !=
"Track::End(" )
147 throw std::runtime_error(
"No Track::End" );
152 is >> c; assert( c ==
',' );
155 is >> c; assert( c ==
')' );
159 inline std::ostream& operator<<( std::ostream& ost,
const Location& location )
167 inline std::ostream& operator << ( std::ostream& ost,
const TrackLocation& location ){
173 ost <<
"TrackLocationRef( " << location.
refid <<
", " << location.
location <<
" )";
177 inline std::ostream& operator << ( std::ostream& ost,
const TrackRange& range ){
178 ost <<
"TrackRange( " << range.
refid <<
", " << range.
range <<
" )";
182 inline std::ostream& operator<<( std::ostream& ost,
const Orientation& orient ){
193 ost <<
"NarrowSwitch::Status(" << ToString(status) <<
" )";
197 inline std::ostream& operator << ( std::ostream& os,
const LineP::Data& data ){
198 os <<
"LineP::Data( " << data.
vb <<
", " << data.
up <<
" )";
202 inline std::ostream& operator << ( std::ostream& os,
const Arc::Data& data ){
203 os <<
"Arc::Data( " << data.
k <<
" )";
207 inline std::ostream& operator << ( std::ostream& os,
const ArcP::Data& data ){
208 os <<
"ArcP::Data( " << data.
vb2 <<
" )";
212 inline std::ostream& operator << ( std::ostream& os,
const Helix::Data& data ){
213 os <<
"Helix::Data( " << data.
k <<
", " << data.
t <<
" )";
217 inline std::ostream& operator << ( std::ostream& os,
const HelixP::Data& data ){
218 os <<
"HelixP::Data( " << data.
center <<
", " << data.
a <<
", " << data.
b <<
" )";
222 inline std::ostream& operator << ( std::ostream& os,
const Cubic::Data& data ){
223 os <<
"Cubic::Data( " << data.
a <<
", " << data.
b <<
", " << data.
c <<
", " << data.
d <<
" )";
227 inline std::ostream& operator << ( std::ostream& os,
const Spline::Data& data ){
229 os <<
"Spline::Data( " << data.front();
230 std::for_each(data.begin() + 1, data.end(), [&](
const CubicData& cubicData )
232 os <<
", " << cubicData;
240 inline std::ostream& operator << ( std::ostream& os,
const Clothoid::Data& data ){
241 os <<
"Clothoid::Data( " << data.
a <<
" )";
245 inline std::ostream& operator << ( std::ostream& os,
const Rotator::Data& data ){
246 os <<
"Rotator::Data( " << data.
a <<
", " << data.
b <<
", " << data.
a0 <<
", " << data.
b0 <<
" )";
250 inline std::ostream& operator << ( std::ostream& os,
const RotatorChain::Data& data ){
252 os <<
"RotatorChain::Data( " << data.front();
253 std::for_each(data.begin() + 1, data.end(), [&](
const std::tuple<Angle,Angle,Length>& tuple )
263 inline std::ostream& operator << ( std::ostream& os,
const PolygonalChain::Data& data ){
265 os <<
"PolygonalChain::Data( " << data.front();
268 os <<
", " << bundle;
278 common::StreamInHead( is,
"LineP::Data" );
282 is >> c; assert( c ==
',' );
284 is >> c; assert( c ==
')' );
290 common::StreamInHead( is,
"Arc::Data" );
294 is >> c; assert( c ==
')' );
300 common::StreamInHead( is,
"ArcP::Data" );
304 is >> c; assert( c ==
')' );
310 common::StreamInHead( is,
"Helix::Data" );
314 is >> c; assert( c ==
',' );
316 is >> c; assert( c ==
')' );
322 common::StreamInHead( is,
"HelixP::Data" );
326 is >> c; assert( c ==
',' );
328 is >> c; assert( c ==
',' );
330 is >> c; assert( c ==
')' );
336 common::StreamInHead( is,
"Cubic::Data" );
340 is >> c; assert( c ==
',' );
342 is >> c; assert( c ==
',' );
344 is >> c; assert( c ==
',' );
346 is >> c; assert( c ==
')' );
350 template<
typename ValueType>
351 inline std::istream& StreamInVector( std::istream& is, std::vector<ValueType>& vector )
356 vector.push_back( value );
369 common::StreamInHead( is,
"Spline::Data" );
370 return StreamInVector( is, data );
375 common::StreamInHead( is,
"Clothoid::Data" );
379 is >> c; assert( c ==
')' );
385 common::StreamInHead( is,
"Rotator::Data" );
389 is >> c; assert( c ==
',' );
391 is >> c; assert( c ==
',' );
393 is >> c; assert( c ==
',' );
395 is >> c; assert( c ==
')' );
401 common::StreamInHead( is,
"RotatorChain::Data" );
402 return StreamInVector( is, data );
405 inline std::istream&
operator >> ( std::istream& is, PolygonalChain::Data& data )
407 common::StreamInHead( is,
"PolygonalChain::Data" );
408 return StreamInVector( is, data );
411 inline std::ostream& operator << ( std::ostream& os,
const PiecewiseTwist::Data& data ){
413 os <<
"PiecewiseTwist::Data( " << data.front();
414 std::for_each(data.begin() + 1, data.end(), [&](
const PiecewiseTwist::Data::value_type value )
424 inline std::istream&
operator >> ( std::istream& is, PiecewiseTwist::Data& data )
426 common::StreamInHead( is,
"PiecewiseTwist::Data" );
427 return StreamInVector( is, data );
449 inline std::ostream& operator<<( std::ostream& os,
const JackEnumerator& jackenumerator )
451 os <<
"JackEnumerator( " << std::endl;
452 for(
auto&
Jack : jackenumerator )
454 os <<
Jack <<
", " << std::endl;
460 inline std::ostream& operator<<( std::ostream& os,
const Jack& jack )
462 os << jack.
Reference(
"name" ) <<
"[" << jack.
Reference(
"parent" ) <<
"]" <<
"( " << jack.
ID() <<
", ";
471 inline std::ostream& operator<<( std::ostream& os,
const Plug& plug )
Home of the Track and TrackBuilder interfaces.
A Location specifies a position on a track system by referencing a track and a TrackLocation on it.
Definition Location.h:110
dclspc void Get(TrackLocation &tl) const noexcept
Gets the TrackLocation - data of this track location.
std::istream & operator>>(std::istream &is, common::Interval< Valtype > &i)
Streams Interval data in.
Definition CommonSupportStream.h:72
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
dclspc Track::EndType ToEndType(const std::string &end)
Makes a status value from a status string.
Implements a Vector bundle.
Definition VectorBundle.h:42
Data definig the curve.
Definition Curve.h:613
AnglePerLength k
Curvature of the arc.
Definition Curve.h:614
Data definig the curve.
Definition Curve.h:681
spat::VectorBundle2< Length, One > vb2
Center point, tangent and normal of the arc. The curve radius is the length of vb2....
Definition Curve.h:696
Data defining the curve.
Definition Curve.h:1405
Length a
Single parameter to specify a clothoid.
Definition Curve.h:1406
Data definig a cubic curve.
Definition Curve.h:434
spat::Vector< Length > c
Definition Curve.h:463
spat::Position< Length > a
Definition Curve.h:461
spat::Vector< Length > b
Definition Curve.h:462
spat::Vector< Length > d
Definition Curve.h:464
CubicData Data
Data definig the curve.
Definition Curve.h:1073
Data definig the curve.
Definition Curve.h:823
AnglePerLength k
Curvature of the helix.
Definition Curve.h:834
AnglePerLength t
Torsion of the helix.
Definition Curve.h:835
Data definig the curve.
Definition Curve.h:915
Length a
radius (not curve radius)
Definition Curve.h:940
spat::VectorBundle2< Length, One > center
Definition Curve.h:938
Length b
b/a == tan(alpha) : slope
Definition Curve.h:941
virtual IDType ID() const noexcept=0
virtual const std::string & Reference(const std::string &name) const =0
Gets a reference that was set for this object by name.
Interface for enumerating the Jacks an object provides.
Definition Jack.h:177
A jack a plug can get connected with.
Definition Jack.h:83
virtual Plug * GetPlug() const noexcept=0
Gets a connected plug if any.
Data definig the curve.
Definition Curve.h:523
spat::VectorBundle< Length, One > vb
Position of parameter s=0 and tangent of the line.
Definition Curve.h:534
spat::Vector< One > up
Up direction.
Definition Curve.h:535
Status
Status.
Definition Switch.h:56
Provides two values for orientation.
Definition Orientation.h:37
Value
Values for orientation.
Definition Orientation.h:40
@ anti
Denoting the non parallel or opposite orientation.
Definition Orientation.h:42
A Plug of some object can get plugged into a jack of some object, specific to a certain event.
Definition Plug.h:57
virtual Jack & JackOnPulse() noexcept=0
Get a Jack that triggers a pulse if the Plug receives a pulse.
Data definig the curve.
Definition Curve.h:1580
Angle a0
Starting angle in the plain.
Definition Curve.h:1583
AnglePerLength b
Angular factor to rotate towards the up direction.
Definition Curve.h:1582
Angle b0
Starting angle.
Definition Curve.h:1584
AnglePerLength a
Angular factor to rotate in the plain.
Definition Curve.h:1581
std::vector< SegmentValueType > Data
Data defining the curve.
Definition Curve.h:1641
std::vector< SegmentValueType > Data
Data definig the curve.
Definition Curve.h:1183
Designates an end at a specific track.
Definition Track.h:303
EndType
Designates one of the two ends of a track.
Definition Track.h:292
A TrackLocation ist a location on a single track.
Definition TrackLocation.h:43
Orientation orientation
Orientation on the track. True means orientation in track direction.
Definition TrackLocation.h:45
Length parameter
Parameter along a track starting from Track::front.
Definition TrackLocation.h:44
A track location, referencing the track by id.
Definition TrackLocation.h:102
TrackLocation location
location on track.
Definition TrackLocation.h:103
IDType refid
ID of track.
Definition TrackLocation.h:104
An interval on a track, referenced by an id.
Definition TrackLocation.h:132
IDType refid
ID of track.
Definition TrackLocation.h:134
common::Interval< Length > range
range on track.
Definition TrackLocation.h:133