Medical Imaging Interaction Toolkit  2018.4.99-08619e4f
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 
76  DataRelationUIDVectorType GetRelationUIDs_DataLayer(const IPropertyProvider* source,
77  const IPropertyProvider* destination, const InstanceIDVectorType& instances_IDLayer) const override;
78 
79  void Connect_datalayer(IPropertyOwner *source,
80  const IPropertyProvider *destination,
81  const InstanceIDType &instanceID) const override;
82 
83  void Disconnect_datalayer(IPropertyOwner *source, const RelationUIDType& relationUID) const override;
84 
85  bool IsSupportedRuleID(const RuleIDType& ruleID) const override;
86 
87  itk::LightObject::Pointer InternalClone() const override;
88 
89  private:
90  RuleIDType m_RuleIDTag;
91  std::string m_DisplayName;
92  std::string m_SourceRole;
93  std::string m_DestinationRole;
94  };
95 
96 } // namespace mitk
97 
98 #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
PropertyRelationRuleBase::DataRelationUIDVectorType DataRelationUIDVectorType
#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< std::pair< RelationUIDType, RuleIDType > > DataRelationUIDVectorType
std::vector< InstanceIDType > InstanceIDVectorType
PropertyRelationRuleBase::RuleIDType RuleIDType
PropertyRelationRuleBase::RelationUIDVectorType RelationUIDVectorType
PropertyRelationRuleBase::RelationUIDType RelationUIDType
PropertyRelationRuleBase::InstanceIDVectorType InstanceIDVectorType