Documentation for OpenFLUID 2.2.2
Loading...
Searching...
No Matches
SpatialGraph.hpp
Go to the documentation of this file.
1/*
2
3 This file is part of OpenFLUID software
4 Copyright(c) 2021-2026, INRAE
5
6
7 == GNU General Public License Usage ==
8
9 OpenFLUID is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 OpenFLUID is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21
22
23 == Other Usage ==
24
25 Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26 license, and requires a written agreement between You and INRA.
27 Licensees for Other Usage of OpenFLUID may use this file in accordance
28 with the terms contained in the written agreement between You and INRA.
29
30*/
31
32/**
33 @file SpatialGraph.hpp
34
35 @author Jean-Christophe Fabre <jean-christophe.fabre@inra.fr>
36*/
37
38#ifndef __OPENFLUID_CORE_SPATIALGRAPH_HPP__
39#define __OPENFLUID_CORE_SPATIALGRAPH_HPP__
40
41
44
45
46namespace openfluid { namespace core {
47
48class SpatialUnit;
49class UnitsCollection;
50
51
53{
54 private:
55
56 UnitsListByClassMap_t m_PcsOrderedUnitsByClass;
57
58 UnitsPtrList_t m_PcsOrderedUnitsGlobal;
59
60 static bool removeUnitFromList(UnitsPtrList_t* UnitsList,
61 const UnitID_t& UnitID);
62
63 public:
64
65 SpatialGraph() = default;
66
68
69 bool deleteUnit(SpatialUnit* aUnit);
70
72 SpatialUnit* ToUnit);
73
75 SpatialUnit* ParentUnit);
76
78
79 SpatialUnit* spatialUnit(const UnitsClass_t& UnitsClass, UnitID_t UnitID);
80
81 const SpatialUnit* spatialUnit(const UnitsClass_t& UnitsClass, UnitID_t UnitID) const;
82
84
85 const UnitsCollection* spatialUnits(const UnitsClass_t& UnitsClass) const;
86
88 {
89 return &m_PcsOrderedUnitsByClass;
90 }
91
92 inline const UnitsPtrList_t* allSpatialUnits() const
93 {
94 return &m_PcsOrderedUnitsGlobal;
95 }
96
98 {
99 return &m_PcsOrderedUnitsGlobal;
100 }
101
102 bool isUnitsClassExist(const UnitsClass_t& UnitsClass) const;
103
104 void streamContents(std::ostream& OStream);
105
107
109
111
113
115
116};
117
118
119} } // namespaces
120
121
122#endif /* __OPENFLUID_CORE_SPATIALGRAPH_HPP__ */
123
Definition SpatialGraph.hpp:53
bool removeFromToConnection(SpatialUnit *FromUnit, SpatialUnit *ToUnit)
const UnitsPtrList_t * allSpatialUnits() const
Definition SpatialGraph.hpp:92
const UnitsListByClassMap_t * allSpatialUnitsByClass() const
Definition SpatialGraph.hpp:87
bool deleteUnit(SpatialUnit *aUnit)
bool isUnitsClassExist(const UnitsClass_t &UnitsClass) const
const UnitsCollection * spatialUnits(const UnitsClass_t &UnitsClass) const
SpatialUnit * spatialUnit(const UnitsClass_t &UnitsClass, UnitID_t UnitID)
UnitsPtrList_t * allSpatialUnits()
Definition SpatialGraph.hpp:97
const SpatialUnit * spatialUnit(const UnitsClass_t &UnitsClass, UnitID_t UnitID) const
SpatialUnit * addUnit(const SpatialUnit &aUnit)
bool removeChildParentConnection(SpatialUnit *ChildUnit, SpatialUnit *ParentUnit)
void streamContents(std::ostream &OStream)
UnitsCollection * spatialUnits(const UnitsClass_t &UnitsClass)
Definition SpatialUnit.hpp:111
Definition UnitsCollection.hpp:60
#define OPENFLUID_API
Definition dllexport.hpp:86
unsigned int UnitID_t
Definition TypeDefs.hpp:70
std::map< UnitsClass_t, UnitsCollection > UnitsListByClassMap_t
Definition SpatialUnit.hpp:62
std::string UnitsClass_t
Definition TypeDefs.hpp:98
std::list< SpatialUnit * > UnitsPtrList_t
Definition SpatialUnit.hpp:77
Definition ApplicationException.hpp:47