Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
ParallelTrack.h
1// trax track library
2// AD 2019
3//
4// "the resolution of all the fruitless searches"
5//
6// Peter Gabriel
7//
8// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
9// Copyright (c) 2019 Marc-Michael Horstmann
10//
11// Permission is hereby granted to any person obtaining a copy of this software
12// and associated source code (the "Software"), to use, view, and study the
13// Software for personal or internal business purposes, subject to the following
14// conditions:
15//
16// 1. Redistribution, modification, sublicensing, or commercial use of the
17// Software is NOT permitted without prior written consent from the copyright
18// holder.
19//
20// 2. The Software is provided "AS IS", without warranty of any kind, express
21// or implied.
22//
23// 3. All copies of the Software must retain this license notice.
24//
25// For further information, please contact: horstmann.marc@trendverlag.de
26
27#pragma once
28
29#include "trax/Track.h"
30
31namespace trax{
32
35 {
37 static dclspc std::shared_ptr<ParallelizableTrack> Make() noexcept;
38
39
40 struct Data{
41 spat::Vector2D<Length> shift{ 0_m, 0_m };
42 bool bTrackRelative{ true };
43 };
44
50 virtual std::shared_ptr<TrackBuilder> AddParallel( const spat::Vector2D<Length>& shift, bool bTrackRelative ) = 0;
51
52
57 virtual void RemoveParallel( const TrackBuilder& parallelTrack ) = 0;
58
59
61 virtual bool IsParallel( const TrackBuilder& parallelTrack ) const noexcept = 0;
62
63
67 virtual void Clear() = 0;
68
69
71 virtual int CountTracks() const = 0;
72
73
75 virtual int ParallelIdx( const TrackBuilder& parallelTrack ) const = 0;
76
77
79 virtual std::shared_ptr<TrackBuilder> GetParallel( int idx ) const = 0;
80
81
84 virtual const Data& GetParallelData( int idx ) const = 0;
85
86
90 virtual Length ParallelParameterFrom( int idx, Length sOriginalParameter ) const = 0;
91
92
96 virtual Length OriginalParameterFrom( int idx, Length sParallelParameter ) const = 0;
97 };
98
99} // namespace trax
Home of the Track and TrackBuilder interfaces.
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
constexpr Real _m(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1210
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
Implements a 2D - vector in cartesian coordinates.
Definition Vector2D.h:46
Definition ParallelTrack.h:40
Track that can be the original to parallel tracks.
Definition ParallelTrack.h:35
virtual const Data & GetParallelData(int idx) const =0
virtual void Clear()=0
Removes all parallel tracks.
virtual std::shared_ptr< TrackBuilder > AddParallel(const spat::Vector2D< Length > &shift, bool bTrackRelative)=0
Adds a parallel to this track.
virtual int CountTracks() const =0
virtual Length OriginalParameterFrom(int idx, Length sParallelParameter) const =0
virtual void RemoveParallel(const TrackBuilder &parallelTrack)=0
Removes the parallel track with index idx.
virtual std::shared_ptr< TrackBuilder > GetParallel(int idx) const =0
virtual Length ParallelParameterFrom(int idx, Length sOriginalParameter) const =0
static dclspc std::shared_ptr< ParallelizableTrack > Make() noexcept
Makes a ParallelizableTrack object.
virtual bool IsParallel(const TrackBuilder &parallelTrack) const noexcept=0
virtual int ParallelIdx(const TrackBuilder &parallelTrack) const =0
Interface for making and shaping tracks.
Definition Track.h:831