Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkGenericIDRelationRule.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 mitkGenericIDRelationRule_h
14 #define mitkGenericIDRelationRule_h
15 
17 
18 namespace mitk
19 {
41  {
42  public:
44  itkCloneMacro(Self);
46  mitkNewMacro2Param(Self, const RuleIDType &, const std::string &);
47  mitkNewMacro4Param(Self, const RuleIDType &, const std::string &, const std::string &, const std::string &);
48 
52 
57  RuleIDType GetRuleID() const override;
58 
66  bool IsAbstract() const override;
67 
72  std::string GetDisplayName() const override;
73 
78  std::string GetSourceRoleName() const override;
79 
84  std::string GetDestinationRoleName() const override;
85 
102  RelationUIDType Connect(IPropertyOwner *source, const IPropertyProvider *destination) const;
103 
104  protected:
106  GenericIDRelationRule(const RuleIDType &ruleIDTag, const std::string &displayName);
108  const std::string &displayName,
109  const std::string &sourceRole,
110  const std::string &destinationRole);
111  ~GenericIDRelationRule() override = default;
112 
115 
118  const IPropertyProvider* destination, const InstanceIDVectorType& instances_IDLayer) const override;
119 
121  const IPropertyProvider *destination,
122  const InstanceIDType &instanceID) const override;
123 
124  void Disconnect_datalayer(IPropertyOwner *source, const RelationUIDType& relationUID) const override;
125 
126  bool IsSupportedRuleID(const RuleIDType& ruleID) const override;
127 
129 
131 
132  private:
133  RuleIDType m_RuleIDTag;
134  std::string m_DisplayName;
135  std::string m_SourceRole;
136  std::string m_DestinationRole;
137  };
138 
139 } // namespace mitk
140 
141 #endif
#define MITKCORE_EXPORT
Relation rule for ID-only relations between IIdentifiable property providers.
PropertyRelationRuleBase::DataRelationUIDVectorType DataRelationUIDVectorType
DataRelationUIDVectorType GetRelationUIDs_DataLayer(const IPropertyProvider *source, const IPropertyProvider *destination, const InstanceIDVectorType &instances_IDLayer) const override
PropertyRelationRuleBase::InstanceIDVectorType InstanceIDVectorType
std::string GetDestinationRoleName() const override
Get a human-readable description of the destination role.
PropertyRelationRuleBase::RelationUIDType RelationUIDType
mitkNewMacro1Param(Self, const RuleIDType &)
void Disconnect_datalayer(IPropertyOwner *source, const RelationUIDType &relationUID) const override
GenericIDRelationRule(const GenericIDRelationRule &other)
PropertyRelationRuleBase::InstanceIDType InstanceIDType
bool IsAbstract() const override
Check whether this rule instance is abstract.
GenericIDRelationRule(const RuleIDType &ruleIDTag, const std::string &displayName)
GenericIDRelationRule(const RuleIDType &ruleIDTag)
mitkNewMacro2Param(Self, const RuleIDType &, const std::string &)
mitkClassMacro(GenericIDRelationRule, PropertyRelationRuleBase)
PropertyRelationRuleBase::RelationUIDVectorType RelationUIDVectorType
RelationUIDType Connect(IPropertyOwner *source, const IPropertyProvider *destination) const
Connect two property providers with an ID-based relation.
~GenericIDRelationRule() override=default
std::string GetDisplayName() const override
Get a human-readable display name for the rule.
PropertyRelationRuleBase::RuleIDType RuleIDType
GenericIDRelationRule(const RuleIDType &ruleIDTag, const std::string &displayName, const std::string &sourceRole, const std::string &destinationRole)
mitkNewMacro4Param(Self, const RuleIDType &, const std::string &, const std::string &, const std::string &)
bool IsSupportedRuleID(const RuleIDType &ruleID) const override
std::string GetSourceRoleName() const override
Get a human-readable description of the source role.
void Connect_datalayer(IPropertyOwner *source, const IPropertyProvider *destination, const InstanceIDType &instanceID) const override
RuleIDType GetRuleID() const override
Get the rule ID string ("IDRelation_<ruleIDTag>").
Interface implemented by classes that provide write/read access to property information.
Interface implemented by classes that provide access to property information.
Base class for defining and detecting property-based relations between data objects.
std::vector< RelationUIDType > RelationUIDVectorType
std::vector< std::pair< RelationUIDType, RuleIDType > > DataRelationUIDVectorType
std::vector< InstanceIDType > InstanceIDVectorType
Find image slices visible on a given plane.