codac 2.0.0
Loading...
Searching...
No Matches
codac2_SlicedTubeBase.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "codac2_Slice.h"
13#include "codac2_TubeBase.h"
14
15namespace codac2
16{
34 class SlicedTubeBase : public TubeBase
35 {
36 public:
37
43 SlicedTubeBase(const std::shared_ptr<TDomain>& tdomain)
45 { }
46
54 {
55 for(auto& s : *_tdomain)
56 s._slices.erase(this);
57 }
58
67 inline size_t nb_slices() const
68 {
69 return _tdomain->nb_tslices();
70 }
71
81 inline std::shared_ptr<const SliceBase> first_slice() const
82 {
83 const auto& slices = _tdomain->front().slices();
84 assert(slices.find(this) != slices.end());
85 return slices.at(this);
86 }
87
97 inline std::shared_ptr<const SliceBase> last_slice() const
98 {
99 const auto& slices = _tdomain->back().slices();
100 assert(slices.find(this) != slices.end());
101 return slices.at(this);
102 }
103 };
104}
std::shared_ptr< const SliceBase > first_slice() const
Returns the first slice of this tube.
Definition codac2_SlicedTubeBase.h:81
~SlicedTubeBase()
Destroys this sliced tube.
Definition codac2_SlicedTubeBase.h:53
size_t nb_slices() const
Returns the number of temporal elements of this tube.
Definition codac2_SlicedTubeBase.h:67
std::shared_ptr< const SliceBase > last_slice() const
Returns the last slice of this tube.
Definition codac2_SlicedTubeBase.h:97
SlicedTubeBase(const std::shared_ptr< TDomain > &tdomain)
Creates a sliced tube over a given temporal domain.
Definition codac2_SlicedTubeBase.h:43
const std::shared_ptr< TDomain > _tdomain
Shared temporal domain of this tube.
Definition codac2_TubeBase.h:71
TubeBase(const std::shared_ptr< TDomain > &tdomain)
Creates a tube over a given temporal domain.
Definition codac2_TubeBase.h:38
const std::shared_ptr< TDomain > & tdomain() const
Returns the temporal domain of this tube.
Definition codac2_TubeBase.h:49
Definition codac2_OctaSym.h:21