Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions

mitk::DataNodeSource Class Reference
[Process Classes]

Superclass of all classes generating data tree nodes (instances of class mitk::DataNode) as output. More...

#include <mitkDataNodeSource.h>

Inheritance diagram for mitk::DataNodeSource:
Inheritance graph
[legend]

List of all members.

Public Types

typedef mitk::DataNode OutputType
typedef OutputType::Pointer OutputTypePointer

Public Member Functions

 mitkClassMacro (DataNodeSource, itk::ProcessObject)
virtual itk::DataObject::Pointer MakeOutput (unsigned int idx)
virtual void SetOutput (OutputType *output)
virtual void SetOutput (unsigned int idx, OutputType *output)
virtual OutputTypeGetOutput ()
virtual OutputTypeGetOutput (unsigned int idx)

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 DataNodeSource ()
virtual ~DataNodeSource ()

Detailed Description

Superclass of all classes generating data tree nodes (instances of class mitk::DataNode) as output.

In itk and vtk the generated result of a ProcessObject is only guaranteed to be up-to-date, when Update() of the ProcessObject or the generated DataObject is called immediately before access of the data stored in the DataObject. This is also true for subclasses of mitk::BaseProcess and thus for mitk::DataNodeSource.

Definition at line 38 of file mitkDataNodeSource.h.


Member Typedef Documentation

Definition at line 43 of file mitkDataNodeSource.h.

Definition at line 47 of file mitkDataNodeSource.h.


Constructor & Destructor Documentation

mitk::DataNodeSource::DataNodeSource (  ) [protected]

Definition at line 22 of file mitkDataNodeSource.cpp.

References MakeOutput(), and SetOutput().

{
    // Create the output.
    OutputType::Pointer output = dynamic_cast<OutputType*> ( this->MakeOutput( 0 ).GetPointer() );
    assert (output.IsNotNull());
    this->SetNumberOfOutputs( 1 );
    this->SetOutput(0, output.GetPointer());
}
mitk::DataNodeSource::~DataNodeSource (  ) [protected, virtual]

Definition at line 34 of file mitkDataNodeSource.cpp.

{
}

Member Function Documentation

mitk::DataNodeSource::OutputType * mitk::DataNodeSource::GetOutput (  ) [virtual]

Returns the output with index 0 of the base data source

Returns:
the output

Definition at line 65 of file mitkDataNodeSource.cpp.

References GetOutput().

Referenced by GetOutput().

{
    if ( this->GetNumberOfOutputs() < 1 )
    {
        return 0;
    }
    else
    {
        return dynamic_cast<OutputType*> ( this->GetOutput( 0 ) );
    }
}
mitk::DataNodeSource::OutputType * mitk::DataNodeSource::GetOutput ( unsigned int  idx ) [virtual]

Returns the n'th output of the base data source

Parameters:
idxthe index of the wanted output
Returns:
the output with index idx.

Definition at line 80 of file mitkDataNodeSource.cpp.

{
    return dynamic_cast<OutputType*> ( this->itk::ProcessObject::GetOutput( idx ) );
}
itk::DataObject::Pointer mitk::DataNodeSource::MakeOutput ( unsigned int  idx ) [virtual]

Allocates a new output object and returns it. Currently the index idx is not evaluated.

Parameters:
idxthe index of the output for which an object should be created
Returns:
the new object

Definition at line 41 of file mitkDataNodeSource.cpp.

Referenced by DataNodeSource().

{
    return OutputType::New().GetPointer();
}
mitk::DataNodeSource::mitkClassMacro ( DataNodeSource  ,
itk::ProcessObject   
)
static Pointer mitk::DataNodeSource::New (  ) [static]

Reimplemented in mitk::DataNodeFactory.

void mitk::DataNodeSource::SetOutput ( unsigned int  idx,
OutputType output 
) [virtual]

Allows to set the n-th output of the base data source.

Parameters:
outputthe intended output of the base data source

Definition at line 57 of file mitkDataNodeSource.cpp.

{
    this->itk::ProcessObject::SetNthOutput(idx, output);    
}
void mitk::DataNodeSource::SetOutput ( OutputType output ) [virtual]

Allows to set the output of the base data source.

Parameters:
outputthe intended output of the base data source

Definition at line 49 of file mitkDataNodeSource.cpp.

Referenced by DataNodeSource().

{
    this->itk::ProcessObject::SetNthOutput( 0, output );
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines