section.h
1 /* Copyright (c) 2013-2023, EPFL/Blue Brain Project
2  *
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #pragma once
6 
7 #include <iosfwd> // std::ostream
8 #include <memory> // std::shared_ptr
9 #include <vector> // std::vector
10 
11 #include <morphio/types.h>
12 #include <morphio/vasc/properties.h>
13 #include <morphio/vasc/vasculature.h>
14 
15 namespace morphio {
16 namespace vasculature {
18 class Section
19 {
22 
23  public:
24  Section(const Section& section) = default;
25 
26  Section& operator=(const Section& section);
27 
28  Section(uint32_t id, const std::shared_ptr<property::Properties>& morphology);
29 
30  bool operator==(const Section& section) const;
31  bool operator!=(const Section& section) const;
32  bool operator<(const Section& other) const;
33 
37  std::vector<Section> predecessors() const;
38 
42  std::vector<Section> successors() const;
43 
47  std::vector<Section> neighbors() const;
48 
50  uint32_t id() const noexcept;
51 
55  floatType length() const;
56 
57  graph_iterator begin() const;
58  graph_iterator end() const;
59 
65  range<const Point> points() const;
66 
72  range<const floatType> diameters() const;
73 
77  VascularSectionType type() const;
78 
79  protected:
80  template <typename Property>
81  range<const typename Property::Type> get() const;
82 
83  uint32_t id_;
84  SectionRange range_;
85  std::shared_ptr<property::Properties> properties_;
86 };
87 
88 } // namespace vasculature
89 } // namespace morphio
90 
91 std::ostream& operator<<(std::ostream& os, const morphio::vasculature::Section& section);
morphio::vasculature::property::Point
Definition: properties.h:23
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:18
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:17
morphio::enums::VascularSectionType
VascularSectionType
Definition: enums.h:121
morphio::vasculature::graph_iterator_t
Definition: iterators.hpp:15
morphio::vasculature::Section::length
floatType length() const