Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkGenericIDRelationRule.cpp
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 
14 
16 {
17  return m_RuleIDTag.empty();
18 };
19 
21 {
22  return ruleID == this->GetRuleID() || (IsAbstract() && ruleID.find("IDRelation_") == 0);
23 };
24 
26 {
27  return "IDRelation_" + m_RuleIDTag;
28 };
29 
31 {
32  return m_DisplayName;
33 };
34 
36 {
37  return m_SourceRole;
38 };
39 
41 {
42  return m_DestinationRole;
43 };
44 
46 {
47  return Superclass::Connect(source, destination);
48 };
49 
51  : GenericIDRelationRule(ruleIDTag, ruleIDTag + " relation"){};
52 
53 mitk::GenericIDRelationRule::GenericIDRelationRule(const RuleIDType &ruleIDTag, const std::string &displayName)
55  ruleIDTag, displayName, "source of " + ruleIDTag + " relation", "destination of " + ruleIDTag + " relation"){};
56 
58  const std::string &displayName,
59  const std::string &sourceRole,
60  const std::string &destinationRole)
61  : m_RuleIDTag(ruleIDTag), m_DisplayName(displayName), m_SourceRole(sourceRole), m_DestinationRole(destinationRole){};
62 
64  const IPropertyProvider * /*source*/, const IPropertyProvider * /*destination*/) const
65 {
66  // Data layer is not supported by the class. Therefore return empty vector.
67  return InstanceIDVectorType();
68 };
69 
71  const IPropertyProvider * /*destination*/) const
72 {
73  // Data layer is not supported by the class.
74  return false;
75 };
76 
78  const IPropertyProvider * /*destination*/,
79  const InstanceIDType & /*instanceID*/) const {
80  // Data layer is not supported by the class. => Do nothing
81 };
82 
83 void mitk::GenericIDRelationRule::Disconnect_datalayer(IPropertyOwner * /*source*/, const InstanceIDType & /*instanceID*/) const {
84  // Data layer is not supported by the class. => Do nothing
85 };
86 
87 itk::LightObject::Pointer mitk::GenericIDRelationRule::InternalClone() const
88 {
89  itk::LightObject::Pointer result = Self::New(this->m_RuleIDTag, this->m_DisplayName, this->m_SourceRole, this->m_DestinationRole).GetPointer();
90 
91  return result;
92 };
void Connect_datalayer(IPropertyOwner *source, const IPropertyProvider *destination, const InstanceIDType &instanceID) const override
std::string GetSourceRoleName() const override
RelationUIDType Connect(IPropertyOwner *source, const IPropertyProvider *destination) const
static Pointer New(const RuleIDType &_arg)
PropertyRelationRuleBase::InstanceIDType InstanceIDType
RelationUIDType Connect(IPropertyOwner *source, const IPropertyProvider *destination) const
bool IsSupportedRuleID(const RuleIDType &ruleID) const override
std::string GetDisplayName() const override
GenericIDRelationRule(const RuleIDType &ruleIDTag)
itk::LightObject::Pointer InternalClone() const override
InstanceIDVectorType GetInstanceID_datalayer(const IPropertyProvider *source, const IPropertyProvider *destination) const override
bool HasImplicitDataRelation(const IPropertyProvider *source, const IPropertyProvider *destination) const override
PropertyRelationRuleBase::RuleIDType RuleIDType
std::string GetDestinationRoleName() const override
RuleIDType GetRuleID() const override
PropertyRelationRuleBase::RelationUIDType RelationUIDType
void Disconnect_datalayer(IPropertyOwner *source, const InstanceIDType &instanceID) const override
PropertyRelationRuleBase::InstanceIDVectorType InstanceIDVectorType