BTK  0.3dev.0
Open-source library to visualize/process biomechanical data
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
btk::Point Class Reference

Coordinates of a point in a 3D space along the time. More...

#include <btkPoint.h>

Inheritance diagram for btk::Point:
Inheritance graph
[legend]

Public Types

typedef btkSharedPtr< const PointConstPointer
 
typedef btkNullPtr< PointNullPointer
 
typedef btkSharedPtr< PointPointer
 
typedef MeasureTraits< Point >
::Residuals 
Residuals
 
enum  Type {
  Marker = 0, Angle, Force, Moment,
  Power, Scalar, Reaction
}
 
- Public Types inherited from btk::Measure< Point >
typedef MeasureTraits< Point >
::Data 
Data
 Associated data with the measure.
 
typedef MeasureTraits< Point >
::Values 
Values
 Values of the measure.
 
- Public Types inherited from btk::DataObjectLabeled
typedef btkSharedPtr< const
DataObjectLabeled
ConstPointer
 
typedef btkSharedPtr
< DataObjectLabeled
Pointer
 
- Public Types inherited from btk::DataObject
typedef btkSharedPtr< const
DataObject
ConstPointer
 
typedef btkNullPtr< DataObjectNullPointer
 
typedef btkSharedPtr< DataObjectPointer
 
- Public Types inherited from btk::Object
typedef btkSharedPtr< const
Object
ConstPointer
 
typedef btkSharedPtr< ObjectPointer
 

Public Member Functions

Pointer Clone () const
 
ResidualsGetResiduals ()
 
const ResidualsGetResiduals () const
 
Type GetType () const
 
void SetDataSlice (int idx, double x, double y, double z, double res=0.0)
 
void SetResiduals (const Residuals &r)
 
void SetType (Point::Type t)
 
virtual ~Point ()
 
- Public Member Functions inherited from btk::Measure< Point >
Measure< Point >::Data::Pointer GetData () const
 
int GetFrameNumber () const
 
Measure< Point >::ValuesGetValues ()
 
const Measure< Point >::ValuesGetValues () const
 
void SetData (typename Measure< Point >::Data::Pointer data, bool parenting=true)
 
void SetFrameNumber (int frameNumber)
 
void SetValues (const Values &v)
 
- Public Member Functions inherited from btk::DataObjectLabeled
const std::string & GetDescription () const
 
const std::string & GetLabel () const
 
virtual void SetDescription (const std::string &description)
 
virtual void SetLabel (const std::string &label)
 
- Public Member Functions inherited from btk::DataObject
DataObjectGetParent () const
 
bool HasParent () const
 
void Modified ()
 
void SetParent (DataObject *parent)
 
void Update ()
 
- Public Member Functions inherited from btk::Object
unsigned long int GetTimestamp () const
 

Static Public Member Functions

static Pointer New (const std::string &label="", Type t=Marker, const std::string &desc="")
 Creates a smart pointer associated with a Point object. More...
 
static Pointer New (int frameNumber)
 Creates a smart pointer associated with a Point object. More...
 
static Pointer New (const std::string &label, int frameNumber, Type t=Marker, const std::string &desc="")
 Creates a smart pointer associated with a Point object. More...
 
static NullPointer Null ()
 
- Static Public Member Functions inherited from btk::DataObject
static NullPointer Null ()
 

Protected Member Functions

 Point (const std::string &label, Type t, const std::string &desc)
 
 Point (const std::string &label, int frameNumber, Type t, const std::string &desc)
 
- Protected Member Functions inherited from btk::Measure< Point >
 Measure (const std::string &label, const std::string &desc="")
 
 Measure (const std::string &label, int frameNumber, const std::string &desc="")
 
 Measure (const Measure &toCopy)
 
- Protected Member Functions inherited from btk::DataObjectLabeled
 DataObjectLabeled (const std::string &label="", const std::string &description="")
 
 DataObjectLabeled (const DataObjectLabeled &toCopy)
 
- Protected Member Functions inherited from btk::DataObject
 DataObject ()
 
 DataObject (const DataObject &toCopy)
 
virtual ~DataObject ()
 
- Protected Member Functions inherited from btk::Object
 Object ()
 
 Object (const Object &toCopy)
 
virtual ~Object ()
 

Additional Inherited Members

- Protected Attributes inherited from btk::Measure< Point >
Measure< Point >::Data::Pointer mp_Data
 Smart pointer associated with the data of this measurement.
 
- Protected Attributes inherited from btk::DataObjectLabeled
std::string m_Description
 
std::string m_Label
 
- Protected Attributes inherited from btk::Object
unsigned long int m_Timestamp
 

Detailed Description

Coordinates of a point in a 3D space along the time.

The coordinates of the point are generally measured by an acquisition system. For each frame, the 3D value has a residual. It can provide informations on the quality of these 3D data (residual associated with the reconstruction of the marker). These values are stored in a Point::Data object.

This class is also used to represent angles, forces, moments, powers and scalars. To know/set the type of the point, you can use the methods GetType() and SetType().

Note: In some case the values at specific frames are invalid (mainly due to marker's occlusion). To detect if the frame is invalid, you can check the residual which will be set to the value -1. It is the same thing if you want to set the frame as invalid. You can set the values of the frames to 0 and the associated residual to -1.

Note: A residual with a value equal to 0 means that this frame has been post-processed (interpolation, filtering, etc.).

Member Typedef Documentation

Smart pointer associated with a const Point object.

Special null pointer associated with a Point object. This type should be used only internally to test the nullity of a smart pointer. See the static method Null() instead.

Smart pointer associated with a Point object.

Vector of double representing the residuals associated with each frames (if applicable).

Member Enumeration Documentation

Enums used to specify the point's type.

Enumerator
Marker 

Enum value which set the point object as a marker.

Angle 

Enum value which set the point object as an angle.

Force 

Enum value which set the point object as a force.

Moment 

Enum value which set the point object as a moment.

Power 

Enum value which set the point object as a power.

Scalar 

Enum value which set the point object as a scalar.

Reaction 

Special type to indicate the point corresponds to one part of a wrench (not really used);

Constructor & Destructor Documentation

btk::Point::~Point ( )
inlinevirtual

Empty destructor.

btk::Point::Point ( const std::string &  label,
Type  t,
const std::string &  desc 
)
protected

Constructor.

btk::Point::Point ( const std::string &  label,
int  frameNumber,
Type  t,
const std::string &  desc 
)
protected

Constructor.

Member Function Documentation

Pointer btk::Point::Clone ( ) const
inline

Returns a deep copy of this object.

Point::Residuals & btk::Point::GetResiduals ( )

Gets the residuals.

Convenient method to return the residuals associated with measure's data.

Warning
This method tries to access directly to data's residuals even if no data has been set. Use this method carefully or use GetData() to access to point's data.
const Point::Residuals & btk::Point::GetResiduals ( ) const

Gets the residuals.

Convenient method to return the residuals associated with measure's data.

Warning
This method tries to access directly to data's residuals even if no data has been set. Use this method carefully or use GetData() to access to point's data.
Type btk::Point::GetType ( ) const
inline

Returns the point's type.

static Pointer btk::Point::New ( const std::string &  label = "",
Type  t = Marker,
const std::string &  desc = "" 
)
inlinestatic

Creates a smart pointer associated with a Point object.

The Point created has no values.

The call of this function must be followed by the use of the method Point::SetFrameNumber as no btk::Point::Data object is allocated.

static Pointer btk::Point::New ( int  frameNumber)
inlinestatic

Creates a smart pointer associated with a Point object.

The point created has an empty label and a number of frames equals to framenumber.

The number of frames must be equal or greater than 0. In case the number of frame is set to 0, no btk::Point::Data object is allocated. You will need to use the method Measure::SetFrameNumber if you want to assign point data later.

static Pointer btk::Point::New ( const std::string &  label,
int  frameNumber,
Type  t = Marker,
const std::string &  desc = "" 
)
inlinestatic

Creates a smart pointer associated with a Point object.

The point created has a label and a number of frames equals to label and framenumber respectively.

The number of frames must be equal or greater than 0. In case the number of frame is set to 0, no btk::Point::Data object is allocated. You will need to use the method Measure::SetFrameNumber if you want to assign point data later.

static NullPointer btk::Point::Null ( )
inlinestatic

Static function to return a null pointer.

Note
This static method should be used only to test if a shared ponter is null or not. It is advised to call the method without parenthesis as special (in)equality operator are implemented to use a function pointer. See the description of the class NullPtr for an example.
void btk::Point::SetDataSlice ( int  idx,
double  x,
double  y,
double  z,
double  res = 0.0 
)
inline

Convenient method to easily set the coordinates x, y, z and the residual res for the given idx.

Warning
This function is not safe. There is no checking to determine if the index is out of range or not. It has the advantage to be faster.
void btk::Point::SetResiduals ( const Residuals r)

Sets the residuals.

void btk::Point::SetType ( Point::Type  t)

Sets the point's type.