section.h
1 #pragma once
2 
3 #include <memory> // std::shared_ptr
4 
5 #include <morphio/morphology.h>
6 #include <morphio/properties.h>
7 #include <morphio/section_base.h>
8 #include <morphio/section_iterators.hpp>
9 #include <morphio/types.h>
10 
11 namespace morphio {
12 
13 using upstream_iterator = upstream_iterator_t<Section>;
14 using breadth_iterator = breadth_iterator_t<Section, Morphology>;
15 using depth_iterator = depth_iterator_t<Section, Morphology>;
16 
36 class Section: public SectionBase<Section>
37 {
40 
41  public:
46  depth_iterator depth_end() const;
47 
52  breadth_iterator breadth_end() const;
53 
58  upstream_iterator upstream_end() const;
59 
65  range<const Point> points() const;
66 
72  range<const floatType> diameters() const;
73 
79  range<const floatType> perimeters() const;
80 
84  SectionType type() const;
85 
90  bool isHeterogeneous(bool downstream = true) const;
91 
95  bool hasSameShape(const Section& other) const noexcept;
96 
97  friend class mut::Section;
98  friend Section Morphology::section(uint32_t) const;
99  friend class SectionBase<Section>;
100 
101  protected:
102  Section(uint32_t id, const std::shared_ptr<Property::Properties>& properties)
103  : SectionBase(id, properties) {}
104 };
105 
106 } // namespace morphio
107 
108 std::ostream& operator<<(std::ostream& os, const morphio::Section& section);
morphio::depth_iterator_t
Definition: section_iterators.hpp:81
morphio::enums::SectionType
SectionType
Definition: enums.h:62
morphio::Section
Definition: section.h:36
morphio::Section::hasSameShape
bool hasSameShape(const Section &other) const noexcept
morphio::Section::type
SectionType type() const
morphio::Section::diameters
range< const floatType > diameters() const
morphio::Section::perimeters
range< const floatType > perimeters() const
morphio::Property::Section
Definition: properties.h:23
morphio::Section::upstream_begin
upstream_iterator upstream_begin() const
morphio::Property::Point
Definition: properties.h:33
morphio::upstream_iterator_t
Definition: section_iterators.hpp:109
morphio::Section::breadth_begin
breadth_iterator breadth_begin() const
morphio::Section::depth_begin
depth_iterator depth_begin() const
morphio::Section::isHeterogeneous
bool isHeterogeneous(bool downstream=true) const
morphio::Section::points
range< const Point > points() const
morphio::breadth_iterator_t
Definition: section_iterators.hpp:53
morphio::mut::Section
Definition: section.h:19
morphio::SectionBase
Definition: section_base.h:25
morphio::Morphology::section
Section section(uint32_t id) const