Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::NodePredicateNot Class Reference

Composite predicate that negates (logically inverts) its single child predicate. More...

#include <mitkNodePredicateNot.h>

Inheritance diagram for mitk::NodePredicateNot:
Collaboration diagram for mitk::NodePredicateNot:

Public Member Functions

 mitkClassMacro (NodePredicateNot, NodePredicateCompositeBase)
 
 mitkNewMacro1Param (NodePredicateNot, const mitk::NodePredicateBase *)
 
 ~NodePredicateNot () override
 Destructor. More...
 
void AddPredicate (const mitk::NodePredicateBase *p) override
 Set the child predicate, replacing any existing one. More...
 
bool CheckNode (const mitk::DataNode *node) const override
 Check whether the node does NOT satisfy the child predicate condition. More...
 
- Public Member Functions inherited from mitk::NodePredicateCompositeBase
 mitkClassMacro (NodePredicateCompositeBase, NodePredicateBase)
 
 ~NodePredicateCompositeBase () override=0
 Pure virtual destructor (with implementation) making this class abstract. More...
 
virtual void RemovePredicate (const NodePredicateBase *p)
 Remove a child predicate from this composite. More...
 
virtual ChildPredicates GetPredicates () const
 Return all child predicates (immutable copy). More...
 
- Public Member Functions inherited from mitk::NodePredicateBase
 mitkClassMacroItkParent (NodePredicateBase, itk::Object)
 
 ~NodePredicateBase () override
 Virtual destructor. More...
 

Protected Member Functions

 NodePredicateNot (const mitk::NodePredicateBase *p)
 Constructor. More...
 

Additional Inherited Members

- Public Types inherited from mitk::NodePredicateCompositeBase
typedef std::list< NodePredicateBase::ConstPointer > ChildPredicates
 List type for storing child predicate smart pointers. More...
 
- Protected Attributes inherited from mitk::NodePredicateCompositeBase
ChildPredicates m_ChildPredicates
 List of child predicates managed by this composite. More...
 

Detailed Description

Composite predicate that negates (logically inverts) its single child predicate.

Although derived from NodePredicateCompositeBase, this predicate holds exactly one child predicate at a time. If AddPredicate() is called when a child already exists, the previous child is replaced.

auto notVisible = NodePredicateNot::New(
NodePredicateProperty::New("visible", BoolProperty::New(true)));
auto invisibleNodes = dataStorage->GetSubset(notVisible);
See also
NodePredicateAnd, NodePredicateOr, NodePredicateCompositeBase

Definition at line 36 of file mitkNodePredicateNot.h.

Constructor & Destructor Documentation

◆ ~NodePredicateNot()

mitk::NodePredicateNot::~NodePredicateNot ( )
override

Destructor.

◆ NodePredicateNot()

mitk::NodePredicateNot::NodePredicateNot ( const mitk::NodePredicateBase *  p)
protected

Constructor.

Member Function Documentation

◆ AddPredicate()

void mitk::NodePredicateNot::AddPredicate ( const mitk::NodePredicateBase *  p)
overridevirtual

Set the child predicate, replacing any existing one.

Only one child predicate is allowed for the NOT predicate. If a child already exists, it is removed before the new one is added.

Parameters
[in]pThe child predicate to set.

Reimplemented from mitk::NodePredicateCompositeBase.

◆ CheckNode()

bool mitk::NodePredicateNot::CheckNode ( const mitk::DataNode *  node) const
overridevirtual

Check whether the node does NOT satisfy the child predicate condition.

Parameters
[in]nodeThe DataNode to evaluate. Must not be nullptr.
Returns
true if the child predicate returns false for the node (i.e., negation).
Exceptions
std::invalid_argumentif node is nullptr.

Implements mitk::NodePredicateBase.

◆ mitkClassMacro()

mitk::NodePredicateNot::mitkClassMacro ( NodePredicateNot  ,
NodePredicateCompositeBase   
)

◆ mitkNewMacro1Param()

mitk::NodePredicateNot::mitkNewMacro1Param ( NodePredicateNot  ,
const mitk::NodePredicateBase *   
)

The documentation for this class was generated from the following file: