MCPcopy Create free account
hub / github.com/MITK/MITK / CheckNode

Method CheckNode

Modules/Core/src/DataManagement/mitkNodePredicateProperty.cpp:27–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27bool mitk::NodePredicateProperty::CheckNode(const mitk::DataNode *node) const
28{
29 if (node == nullptr)
30 throw std::invalid_argument("NodePredicateProperty: invalid node");
31
32 if (m_ValidPropertyName.empty())
33 throw std::invalid_argument("NodePredicateProperty: invalid property name");
34
35 // check, if any of the properties of node are equal to m_ValidProperty.
36 if (m_ValidProperty.IsNull())
37 // if (m_ValidProperty==nullptr)
38 {
39 return (node->GetProperty(m_ValidPropertyName.c_str(), m_Renderer) != nullptr); // search only for name
40 }
41 else
42 {
43 mitk::BaseProperty::Pointer p = node->GetProperty(m_ValidPropertyName.c_str(), m_Renderer);
44 if (p.IsNull())
45 return false;
46 return (*p == *m_ValidProperty); // search for name and property
47 }
48}

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.45
IsNullMethod · 0.45
GetPropertyMethod · 0.45

Tested by

no test coverage detected