Documentation for OpenFLUID
2.2.0
|
#include <fluidx/SpatialDomainDescriptor.hpp>
Public Types | |
typedef std::map< openfluid::core::UnitID_t, SpatialUnitDescriptor > | SpatialUnitsByID_t |
typedef std::map< openfluid::core::UnitsClass_t, SpatialUnitsByID_t > | SpatialUnitsByIDByClass_t |
typedef std::map<openfluid::core::UnitID_t, SpatialUnitDescriptor> openfluid::fluidx::SpatialDomainDescriptor::SpatialUnitsByID_t |
typedef std::map<openfluid::core::UnitsClass_t,SpatialUnitsByID_t> openfluid::fluidx::SpatialDomainDescriptor::SpatialUnitsByIDByClass_t |
|
default |
|
inline |
void openfluid::fluidx::SpatialDomainDescriptor::addAttribute | ( | const openfluid::core::UnitsClass_t & | ClassName, |
const std::string & | AttrName, | ||
const std::string & | DefaultValue, | ||
bool | Check = true |
||
) |
[in] | ClassName | the units class of the spatial unit |
[in] | AttrName | the name of the attribute |
[in] | DefaultValue | the value of the attribute |
[in] | Check | enables internal checks when set to true (default value = true) |
openfluid::base::FrameworkException | if the spatial unit does not exist, or if Check is true and the attribute already exists |
EventID_t openfluid::fluidx::SpatialDomainDescriptor::addEvent | ( | const openfluid::core::UnitsClass_t & | UnitsClass, |
const openfluid::core::UnitID_t & | UnitID, | ||
const openfluid::core::Event & | Event | ||
) |
Adds an event from an event definition. If the spatial unit of the event does not exist, the event is ignored
[in] | UnitsClass | the spatial units class |
[in] | UnitID | the spatial unit ID |
[in] | Event | the event definition |
void openfluid::fluidx::SpatialDomainDescriptor::addEvent | ( | const openfluid::fluidx::EventDescriptor & | EvDesc | ) |
Adds an event from an event descriptor. If the spatial unit of the event does not exist, the event is ignored
[in] | EvDesc | the event descriptor to add |
void openfluid::fluidx::SpatialDomainDescriptor::addFromToRelation | ( | const openfluid::core::UnitClassID_t & | FromUnit, |
const openfluid::core::UnitClassID_t & | ToUnit | ||
) |
Adds the ToUnit to the list of "To" relations of FromUnit. It does nothing if the relation already exists.
[in] | FromUnit | the source spatial unit of the relation |
[in] | ToUnit | the target spatial unit of the relation |
openfluid::base::FrameworkException | if FromUnit or ToUnit does not exist |
void openfluid::fluidx::SpatialDomainDescriptor::addParentChildRelation | ( | const openfluid::core::UnitClassID_t & | ParentUnit, |
const openfluid::core::UnitClassID_t & | ChildUnit | ||
) |
Adds the ParentUnit to the list of "Parent" relations of ChildUnit. It does nothing if the relation already exists.
[in] | ParentUnit | the source spatial unit of the relation |
[in] | ChildUnit | the target spatial unit of the relation |
openfluid::base::FrameworkException | if ParentUnit or ChildUnit does not exist |
void openfluid::fluidx::SpatialDomainDescriptor::addUnit | ( | const openfluid::fluidx::SpatialUnitDescriptor & | UnitDesc, |
bool | Check = true |
||
) |
Adds a spatial unit to the spatial domain
[in] | UnitDesc | the spatial unit descriptor to add |
[in] | Check | enables internal checks when set to true (default value = true) |
openfluid::base::FrameworkException | if the spatial unit already exists, or if Check is true and the spatial unit has a wrong spatial relation |
void openfluid::fluidx::SpatialDomainDescriptor::checkAttributesConsistency | ( | ) | const |
Checks if spatial attributes are consistent.
openfluid::base::FrameworkException | if spatial attributes are not consistent |
void openfluid::fluidx::SpatialDomainDescriptor::checkUnitsRelations | ( | ) | const |
Checks if spatial units relations (From-To, Parent-Child) are consistent.
openfluid::base::FrameworkException | if spatial units relations are not consistent |
void openfluid::fluidx::SpatialDomainDescriptor::clearDomain | ( | ) |
Clears the spatial domain
void openfluid::fluidx::SpatialDomainDescriptor::clearRelations | ( | const openfluid::core::UnitClassID_t & | Unit | ) |
Removes all relations related to the given spatial unit.
[in] | Unit | units class and ID of the spatial unit |
openfluid::base::FrameworkException | if the spatial unit does not exist |
void openfluid::fluidx::SpatialDomainDescriptor::deleteAttribute | ( | const openfluid::core::UnitsClass_t & | ClassName, |
const std::string & | AttrName | ||
) |
Deletes an attribute for the given units class
[in] | ClassName | the units class of the spatial unit |
[in] | AttrName | the name of the attribute |
openfluid::base::FrameworkException | if the units class or attribute does not exist |
void openfluid::fluidx::SpatialDomainDescriptor::deleteEvent | ( | const openfluid::core::UnitsClass_t & | UnitsClass, |
const openfluid::core::UnitID_t & | UnitID, | ||
const openfluid::fluidx::EventID_t & | EventID | ||
) |
Deletes an event
[in] | UnitsClass | the spatial units class |
[in] | UnitID | the spatial unit ID |
[in] | EventID | the ID of the event to delete |
openfluid::base::FrameworkException | if the spatial units does not exist |
void openfluid::fluidx::SpatialDomainDescriptor::deleteUnit | ( | const openfluid::core::UnitsClass_t & | ClassName, |
const openfluid::core::UnitID_t & | ID | ||
) |
Removes a spatial unit
[in] | ClassName | the units class of the spatial unit to remove |
[in] | ID | the ID of the spatial unit to remove |
openfluid::fluidx::EventDescriptor& openfluid::fluidx::SpatialDomainDescriptor::event | ( | const openfluid::fluidx::EventID_t & | ID | ) |
Returns a reference to the event descriptor corresponding to the event ID
[in] | ID | The ID of the event |
openfluid::base::FrameworkException | if the event ID does not exist |
const openfluid::fluidx::EventDescriptor& openfluid::fluidx::SpatialDomainDescriptor::event | ( | const openfluid::fluidx::EventID_t & | ID | ) | const |
Returns a const reference to the event descriptor corresponding to the event ID
[in] | ID | The ID of the event |
openfluid::base::FrameworkException | if the event ID does not exist |
std::string openfluid::fluidx::SpatialDomainDescriptor::getAttribute | ( | const openfluid::core::UnitsClass_t & | ClassName, |
const openfluid::core::UnitID_t & | ID, | ||
const openfluid::core::AttributeName_t & | AttrName | ||
) | const |
Gets the value of a spatial attribute
[in] | ClassName | the units class of the spatial unit |
[in] | ID | the ID of the spatial unit |
[in] | AttrName | the name of the attribute |
openfluid::base::FrameworkException | if the spatial unit or the attribute does not exist |
std::set<std::string> openfluid::fluidx::SpatialDomainDescriptor::getAttributesNames | ( | const openfluid::core::UnitsClass_t & | ClassName | ) | const |
Returns the attributes names for a given units class
ClassName | the units class of the spatial unit |
std::list<openfluid::core::UnitClassID_t> openfluid::fluidx::SpatialDomainDescriptor::getChildSpatialUnits | ( | const openfluid::core::UnitClassID_t & | Unit | ) | const |
Builds a list of units class and ID linked with a "Child" relation to the given spatial unit
[in] | Unit | units class and ID of the spatial unit |
openfluid::base::FrameworkException | if the spatial unit does not exists |
std::set<std::string> openfluid::fluidx::SpatialDomainDescriptor::getClassNames | ( | ) | const |
Returns the names of units classes of the spatial domain
std::list<openfluid::core::UnitClassID_t> openfluid::fluidx::SpatialDomainDescriptor::getFromSpatialUnits | ( | const openfluid::core::UnitClassID_t & | Unit | ) | const |
Builds a list of units class and ID linked with a "From" relation to the given spatial unit
[in] | Unit | units class and ID of the spatial unit |
openfluid::base::FrameworkException | if the spatial unit does not exists |
std::set<int> openfluid::fluidx::SpatialDomainDescriptor::getIDsOfClass | ( | const openfluid::core::UnitsClass_t & | ClassName | ) | const |
Returns the spatial units IDs for a given units class
[in] | ClassName | the name of the spatial units class |
unsigned int openfluid::fluidx::SpatialDomainDescriptor::getUnitsCount | ( | ) | const |
Returns the count of all spatial units in the spatial domain
unsigned int openfluid::fluidx::SpatialDomainDescriptor::getUnitsCount | ( | const openfluid::core::UnitsClass_t & | ClassName | ) | const |
Returns the count of spatial units for a given units class in the spatial domain
bool openfluid::fluidx::SpatialDomainDescriptor::isClassNameExists | ( | const openfluid::core::UnitsClass_t & | ClassName | ) | const |
Returns true if the spatial units class exists
[in] | ClassName | the name of the units class |
bool openfluid::fluidx::SpatialDomainDescriptor::isSpatialUnitExist | ( | const openfluid::core::UnitsClass_t & | ClassName, |
const openfluid::core::UnitID_t & | ID | ||
) | const |
Returns true if the spatial unit descriptor exists for the given units class and unit ID
[in] | ClassName | the name of the units class |
[in] | ID | the ID of the spatial |
void openfluid::fluidx::SpatialDomainDescriptor::modifyEvent | ( | const openfluid::fluidx::EventID_t & | EventID, |
const openfluid::core::Event & | Event | ||
) |
Modify an event
[in] | EventID | the ID of the event to modify |
[in] | Event | the new definition of the event |
const std::list<openfluid::core::UnitClassID_t>& openfluid::fluidx::SpatialDomainDescriptor::parentSpatialUnits | ( | const openfluid::core::UnitClassID_t & | Unit | ) | const |
Returns a const reference to the list of units class and ID linked with a "Parent" relation to the given spatial unit
[in] | Unit | units class and ID of the spatial unit |
openfluid::base::FrameworkException | if the spatial unit does not exists |
void openfluid::fluidx::SpatialDomainDescriptor::removeFromToRelation | ( | const openfluid::core::UnitClassID_t & | FromUnit, |
const openfluid::core::UnitClassID_t & | ToUnit | ||
) |
Removes the ToUnit from the list of "To" relations of FromUnit. It does nothing if the relation does not exists.
[in] | FromUnit | the source spatial unit of the relation |
[in] | ToUnit | the target spatial unit of the relation |
openfluid::base::FrameworkException | if FromUnit does not exist |
void openfluid::fluidx::SpatialDomainDescriptor::removeParentChildRelation | ( | const openfluid::core::UnitClassID_t & | ParentUnit, |
const openfluid::core::UnitClassID_t & | ChildUnit | ||
) |
Removes the ParentUnit from the list of "Parent" relations of ChildUnit. It does nothing if the relation does not exists.
[in] | ParentUnit | the source spatial unit of the relation |
[in] | ChildUnit | the target spatial unit of the relation |
openfluid::base::FrameworkException | if ChildUnit does not exist |
void openfluid::fluidx::SpatialDomainDescriptor::renameAttribute | ( | const openfluid::core::UnitsClass_t & | ClassName, |
const std::string & | OldAttrName, | ||
const std::string & | NewAttrName | ||
) |
Renames an attribute
[in] | ClassName | the units class of the spatial unit |
[in] | OldAttrName | the old name of the attribute |
[in] | NewAttrName | the new name of the attribute |
openfluid::base::FrameworkException | if the units class or attribute does not exist |
void openfluid::fluidx::SpatialDomainDescriptor::setAttribute | ( | const openfluid::core::UnitsClass_t & | ClassName, |
const openfluid::core::UnitID_t & | ID, | ||
const openfluid::core::AttributeName_t & | AttrName, | ||
const std::string & | AttrValue | ||
) |
Sets the value of an attribute on a spatial unit
[in] | ClassName | the units class of the spatial unit |
[in] | ID | the ID of the spatial unit |
[in] | AttrName | the name of the attribute |
[in] | AttrValue | the value of the attribute |
openfluid::base::FrameworkException | if the spatial unit or the attribute does not exist |
const SpatialUnitDescriptor& openfluid::fluidx::SpatialDomainDescriptor::spatialUnit | ( | const openfluid::core::UnitsClass_t & | ClassName, |
const openfluid::core::UnitID_t & | ID | ||
) | const |
Returns a const reference to the spatial unit descriptor identified by a units class and a unit ID
[in] | ClassName | the name of the units class |
[in] | ID | the ID of the spatial |
openfluid::base::FrameworkException | if spatial unit is not found |
|
inline |
Returns a reference to the structure of spatial units descriptors
|
inline |
Returns a const reference to the structure of spatial units descriptors
const std::list<openfluid::core::UnitClassID_t>& openfluid::fluidx::SpatialDomainDescriptor::toSpatialUnits | ( | const openfluid::core::UnitClassID_t & | Unit | ) | const |
Returns a const reference to the list of units class and ID linked with a "To" relation to the given spatial unit
[in] | Unit | units class and ID of the spatial unit |
openfluid::base::FrameworkException | if the spatial unit does not exists |