Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkPropertyRelations.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkPropertyRelations_h
14 #define mitkPropertyRelations_h
15 
16 #include <map>
17 #include <mitkIPropertyRelations.h>
18 
19 namespace mitk
20 {
31  {
32  public:
34  ~PropertyRelations() override;
35 
39 
40  bool AddRule(const PropertyRelationRuleBase *rule, bool overwrite = false) override;
41 
43 
44  RuleResultVectorType GetRulesForSourceCandidate(const IPropertyProvider* sourceCandidate) const override;
45 
47 
48  PropertyRelationRuleBase::ConstPointer GetRule(const RuleIDType &ruleID) const override;
49 
50  RuleIDVectorType GetRuleIDs() const override;
51 
52  bool HasRuleForSource(const IPropertyProvider* source) const override;
53 
54  void RemoveAllRules() override;
55 
56  void RemoveRule(const RuleIDType &ruleID) override;
57 
58  private:
59  using RuleMap = std::map<const std::string, PropertyRelationRuleBase::ConstPointer>;
60 
62  PropertyRelations &operator=(const PropertyRelations &);
63 
64  RuleMap m_RuleMap;
65  };
66 
73 }
74 
75 #endif
#define MITKCORE_EXPORT
Interface implemented by classes that provide access to property information.
Interface of property relations service.
std::vector< RuleIDType > RuleIDVectorType
PropertyRelationRuleBase::RuleIDType RuleIDType
std::list< PropertyRelationRuleBase::ConstPointer > RuleResultVectorType
Base class for defining and detecting property-based relations between data objects.
Concrete implementation of the IPropertyRelations service interface.
RuleIDVectorType GetRuleIDs() const override
Get all IDs of registered rules.
~PropertyRelations() override
RuleResultVectorType GetRulesForDestinationCandidate(const IPropertyProvider *destCandidate) const override
Get all relation rules that would accept the passed IPropertOwner as destination.
RuleResultVectorType GetRulesForSource(const IPropertyProvider *source) const override
Get all relation rules the passed source is really a source of. (PropertyRelationRuleBase::IsSource()...
void RemoveRule(const RuleIDType &ruleID) override
Remove relation rule instance with the passed ID. If rule does not exist nothing happens.
bool AddRule(const PropertyRelationRuleBase *rule, bool overwrite=false) override
Add rule for a specific relation. If there is already a property rule instance it won't be added....
PropertyRelationRuleBase::ConstPointer GetRule(const RuleIDType &ruleID) const override
Get the relation rule that has the specified ruleID.
bool HasRuleForSource(const IPropertyProvider *source) const override
Check if a passed instance has defined relation covered by the registered rules.
void RemoveAllRules() override
Remove all relation rules.
RuleResultVectorType GetRulesForSourceCandidate(const IPropertyProvider *sourceCandidate) const override
Get all relation rules that would accept the passed IPropertOwner as source.
Find image slices visible on a given plane.
MITKCORE_EXPORT IPropertyRelations * CreateTestInstancePropertyRelations()
Create an unmanaged instance of PropertyRelations for testing purposes.