soma.h
1 #pragma once
2 
3 #include <morphio/properties.h> // Property
4 #include <morphio/soma.h> // morphio::soma
5 
6 namespace morphio {
7 namespace mut {
9 class Soma
10 {
11  public:
12  Soma() = default;
13  Soma(const Soma& soma) = default;
14 
15  explicit Soma(const Property::PointLevel& pointProperties);
16  explicit Soma(const morphio::Soma& soma);
17 
21  inline std::vector<Point>& points() noexcept;
22  inline const std::vector<Point>& points() const noexcept;
28  inline std::vector<morphio::floatType>& diameters() noexcept;
29  inline const std::vector<morphio::floatType>& diameters() const noexcept;
35  inline SomaType type() const noexcept;
39  Point center() const;
40 
45  floatType surface() const;
46 
51  floatType maxDistance() const;
52 
53  inline Property::PointLevel& properties() noexcept;
54  inline const Property::PointLevel& properties() const noexcept;
55 
56  private:
57  friend class Morphology;
58 
59  SomaType soma_type_ = SOMA_UNDEFINED;
60  Property::PointLevel point_properties_;
61 };
62 
63 inline std::vector<Point>& Soma::points() noexcept {
64  return point_properties_._points;
65 }
66 
67 const std::vector<Point>& Soma::points() const noexcept {
68  return point_properties_._points;
69 }
70 
71 inline std::vector<morphio::floatType>& Soma::diameters() noexcept {
72  return point_properties_._diameters;
73 }
74 
75 const std::vector<morphio::floatType>& Soma::diameters() const noexcept {
76  return point_properties_._diameters;
77 }
78 
79 inline SomaType Soma::type() const noexcept {
80  return soma_type_;
81 }
82 
83 inline Property::PointLevel& Soma::properties() noexcept {
84  return point_properties_;
85 }
86 
87 inline const Property::PointLevel& Soma::properties() const noexcept {
88  return point_properties_;
89 }
90 
91 std::ostream& operator<<(std::ostream& os, const std::shared_ptr<Soma>& sectionPtr);
92 std::ostream& operator<<(std::ostream& os, const Soma& soma);
93 
94 } // namespace mut
95 } // namespace morphio
morphio::enums::SomaType
SomaType
Definition: enums.h:52
morphio::mut::Soma::points
std::vector< Point > & points() noexcept
Definition: soma.h:63
morphio::mut::Soma::center
Point center() const
morphio::mut::Soma
Definition: soma.h:9
morphio::mut::Soma::diameters
std::vector< morphio::floatType > & diameters() noexcept
Definition: soma.h:71
morphio::mut::Soma::type
SomaType type() const noexcept
Definition: soma.h:79
morphio::enums::SOMA_UNDEFINED
@ SOMA_UNDEFINED
Undefined soma.
Definition: enums.h:53
morphio::mut::Soma::maxDistance
floatType maxDistance() const
morphio::Soma
Definition: soma.h:28
morphio::mut::Soma::surface
floatType surface() const
morphio::mut::Morphology
Definition: morphology.h:24
morphio::Property::PointLevel
Definition: properties.h:62