section.h
1 #pragma once
2 
3 #include <iosfwd> // std::ostream
4 #include <memory> // std::shared_ptr
5 #include <vector> // std::vector
6 
7 #include <morphio/types.h>
8 #include <morphio/vasc/properties.h>
9 #include <morphio/vasc/vasculature.h>
10 
11 namespace morphio {
12 namespace vasculature {
14 class Section
15 {
18 
19  public:
20  Section(const Section& section) = default;
21 
22  Section& operator=(const Section& section);
23 
24  Section(uint32_t id, const std::shared_ptr<property::Properties>& morphology);
25 
26  bool operator==(const Section& section) const;
27  bool operator!=(const Section& section) const;
28  bool operator<(const Section& other) const;
29 
33  std::vector<Section> predecessors() const;
34 
38  std::vector<Section> successors() const;
39 
43  std::vector<Section> neighbors() const;
44 
46  uint32_t id() const noexcept;
47 
51  floatType length() const;
52 
53  graph_iterator begin() const;
54  graph_iterator end() const;
55 
61  range<const Point> points() const;
62 
68  range<const floatType> diameters() const;
69 
73  VascularSectionType type() const;
74 
75  protected:
76  template <typename Property>
77  range<const typename Property::Type> get() const;
78 
79  uint32_t id_;
80  SectionRange range_;
81  std::shared_ptr<property::Properties> properties_;
82 };
83 
84 } // namespace vasculature
85 } // namespace morphio
86 
87 std::ostream& operator<<(std::ostream& os, const morphio::vasculature::Section& section);
morphio::vasculature::property::Point
Definition: properties.h:19
morphio::vasculature::Section::neighbors
std::vector< Section > neighbors() const
morphio::vasculature::Section::successors
std::vector< Section > successors() const
morphio::vasculature::Section::diameters
range< const floatType > diameters() const
morphio::vasculature::Section::type
VascularSectionType type() const
morphio::vasculature::Section
Definition: section.h:14
morphio::vasculature::Section::id
uint32_t id() const noexcept
morphio::vasculature::Section::points
range< const Point > points() const
morphio::vasculature::Section::predecessors
std::vector< Section > predecessors() const
morphio::vasculature::property::VascSection
Definition: properties.h:13
morphio::enums::VascularSectionType
VascularSectionType
Definition: enums.h:99
morphio::vasculature::graph_iterator_t
Definition: iterators.hpp:10
morphio::vasculature::Section::length
floatType length() const