BTK
0.3dev.0
Open-source library to visualize/process biomechanical data
|
Interface to create a filter/process in a pipeline. More...
#include <btkProcessObject.h>
Public Types | |
typedef btkSharedPtr< const ProcessObject > | ConstPointer |
typedef btkSharedPtr < ProcessObject > | Pointer |
Public Types inherited from btk::Object | |
typedef btkSharedPtr< const Object > | ConstPointer |
typedef btkSharedPtr< Object > | Pointer |
Public Member Functions | |
int | GetInputNumber () const |
int | GetOutputNumber () const |
int | GetValidInputNumber () const |
void | ResetState () |
void | Update () |
Public Member Functions inherited from btk::Object | |
unsigned long int | GetTimestamp () const |
Protected Member Functions | |
virtual void | GenerateData ()=0 |
int | GetInputIndex (DataObject::Pointer input) |
DataObject::Pointer | GetNthInput (int idx) |
DataObject::ConstPointer | GetNthInput (int idx) const |
DataObject::Pointer | GetNthOutput (int idx) |
DataObject::ConstPointer | GetNthOutput (int idx) const |
int | GetOutputIndex (DataObject::Pointer output) |
bool | IsModified () const |
virtual DataObject::Pointer | MakeOutput (int idx)=0 |
void | Modified () |
ProcessObject () | |
void | SetInputNumber (int num) |
virtual void | SetNthInput (int idx, DataObject::Pointer input) |
virtual void | SetNthOutput (int idx, DataObject::Pointer output) |
void | SetOutputNumber (int num) |
virtual | ~ProcessObject () |
Protected Member Functions inherited from btk::Object | |
Object () | |
Object (const Object &toCopy) | |
virtual | ~Object () |
Additional Inherited Members | |
Protected Attributes inherited from btk::Object | |
unsigned long int | m_Timestamp |
Interface to create a filter/process in a pipeline.
An inherited class has to implement the GenerateData() method and the MakeOutput() metod. GenerateData() is the core of the process as it compute the outputs based on the inputs and its algorithms. The method MakeOutput() is used in the SetOutputNumber() and SetNthOutput() to create newly valid output.
The following code presents the minimum required to use the pipeline principle.
Smart pointer associated with a const ProcessObject object.
Smart pointer associated with a ProcessObject object.
|
protected |
Process constructor with zero input and output. The inherited class set the number of inputs/ouputs with the functions SetInputNumber() and SetOutputNumber().
|
protectedvirtual |
This destructor doesn't delete its ouptuts (which can be used as input by others process). In fact, it says that they are disconnected of their source.
|
protectedpure virtual |
Generates the outputs' data.
Implemented in btk::SeparateKnownVirtualMarkersFilter, btk::VerticalGroundReactionForceGaitEventDetector, btk::ASCIIFileWriter, btk::MultiSTLFileWriter, btk::AcquisitionFileReader, btk::AcquisitionFileWriter, btk::ForcePlatformWrenchFilter, btk::MeasureFrameExtractor< T >, btk::SubAcquisitionFilter, btk::DownsampleFilter< T >, btk::WrenchDirectionAngleFilter, btk::MergeAcquisitionFilter, btk::AcquisitionUnitConverter, btk::SpecializedPointsExtractor, btk::AnalogOffsetRemover, btk::CollectionAssembly< T >, btk::ForcePlatformsExtractor, and btk::IMUsExtractor.
|
protected |
Returns the index of the DataObject given in input. If no DataObject corresponds, then the method returns -1.
|
inline |
Returns the number of inputs.
|
protected |
Gets the input at index idx or an empty Pointer if idx is out of range.
|
protected |
Gets the input at index idx or an empty ConstPointer if idx is out of range.
|
protected |
Gets the output at idx or a empty Pointer if idx is out of range.
|
protected |
Gets the output at idx or a empty ConstPointer if idx is out of range.
|
protected |
Returns the index of the DataObject given in input. If no DataObject corresponds, then the method returns -1.
|
inline |
Returns the number of outputs.
int btk::ProcessObject::GetValidInputNumber | ( | ) | const |
Returns the number of inputs which are valid (i.e. not null).
|
inlineprotected |
Indicates if the process is modified or not.
|
protectedpure virtual |
Creates and returns a DataObject::Pointer for the given index idx.
Implemented in btk::SeparateKnownVirtualMarkersFilter, btk::VerticalGroundReactionForceGaitEventDetector, btk::ASCIIFileWriter, btk::MultiSTLFileWriter, btk::AcquisitionFileReader, btk::AcquisitionFileWriter, btk::ForcePlatformWrenchFilter, btk::MeasureFrameExtractor< T >, btk::SubAcquisitionFilter, btk::DownsampleFilter< T >, btk::WrenchDirectionAngleFilter, btk::MergeAcquisitionFilter, btk::AcquisitionUnitConverter, btk::SpecializedPointsExtractor, btk::AnalogOffsetRemover, btk::CollectionAssembly< T >, btk::ForcePlatformsExtractor, and btk::IMUsExtractor.
|
protectedvirtual |
This method has to be called each time that the ProcessObject is modified.
Reimplemented from btk::Object.
void btk::ProcessObject::ResetState | ( | ) |
Reset the state of the process. Usefull when an exception was thrown during the generation of the data.
|
protected |
Sets the number of inputs.
|
protectedvirtual |
Sets an input of the filter. If necessary, the size of inputs is increased if idx is greater or equal than the number of inputs.
|
protectedvirtual |
Set the output at the index idx or create a new output from the method MakeOutput() if the pointer in output is null. If necessary, the size of the outputs is increased if idx is greater or equal than the number of outputs.
|
protected |
Sets the number of outputs. The outputs generated used the MakeOutput() method.
void btk::ProcessObject::Update | ( | ) |
Recursive method which 1) determines the processes to update and 2) generate the data by using the GenerateData() method.