Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 {
33  {
34  public:
36  itkCloneMacro(Self);
38  mitkNewMacro2Param(Self, const RuleIDType &, const std::string &);
39  mitkNewMacro4Param(Self, const RuleIDType &, const std::string &, const std::string &, const std::string &);
40 
44 
46  RuleIDType GetRuleID() const override;
47 
48  bool IsAbstract() const override;
49 
51  std::string GetDisplayName() const override;
52 
55  std::string GetSourceRoleName() const override;
58  std::string GetDestinationRoleName() const override;
59 
61  RelationUIDType Connect(IPropertyOwner *source, const IPropertyProvider *destination) const;
62 
63  protected:
64  GenericIDRelationRule(const RuleIDType &ruleIDTag);
65  GenericIDRelationRule(const RuleIDType &ruleIDTag, const std::string &displayName);
66  GenericIDRelationRule(const RuleIDType &ruleIDTag,
67  const std::string &displayName,
68  const std::string &sourceRole,
69  const std::string &destinationRole);
70  ~GenericIDRelationRule() override = default;
71 
74 
85  InstanceIDVectorType GetInstanceID_datalayer(const IPropertyProvider *source,
86  const IPropertyProvider *destination) const override;
87 
95  bool HasImplicitDataRelation(const IPropertyProvider *source,
96  const IPropertyProvider *destination) const override;
97 
107  void Connect_datalayer(IPropertyOwner *source,
108  const IPropertyProvider *destination,
109  const InstanceIDType &instanceID) const override;
110 
117  void Disconnect_datalayer(IPropertyOwner *source, const InstanceIDType &instanceID) const override;
118 
119  bool IsSupportedRuleID(const RuleIDType& ruleID) const override;
120 
121  itk::LightObject::Pointer InternalClone() const override;
122 
123  private:
124  RuleIDType m_RuleIDTag;
125  std::string m_DisplayName;
126  std::string m_SourceRole;
127  std::string m_DestinationRole;
128  };
129 
130 } // namespace mitk
131 
132 #endif
#define MITKCORE_EXPORT
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:72
DataCollection - Class to facilitate loading/accessing structured data.
PropertyRelationRuleBase::InstanceIDType InstanceIDType
#define mitkNewMacro2Param(classname, typea, typeb)
Definition: mitkCommon.h:85
#define mitkNewMacro4Param(classname, typea, typeb, typec, typed)
Definition: mitkCommon.h:111
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
std::vector< RelationUIDType > RelationUIDVectorType
std::vector< InstanceIDType > InstanceIDVectorType
PropertyRelationRuleBase::RuleIDType RuleIDType
PropertyRelationRuleBase::RelationUIDVectorType RelationUIDVectorType
PropertyRelationRuleBase::RelationUIDType RelationUIDType
PropertyRelationRuleBase::InstanceIDVectorType InstanceIDVectorType