Public Types | Public Member Functions
sal3d::Profile Class Reference

Laser stripe position detected in a Frame. More...

#include <Profile.hpp>

List of all members.

Public Types

typedef float value_type
 The data type of the elements in the Profile.
typedef value_typeiterator
 Iterator for the Profile class.
typedef const value_typeconst_iterator
 Const iterator for the Profile class.

Public Member Functions

 Profile (value_type *start, int length)
 Creates a Profile from a user allocated array of floats.
 Profile (sal3d_profile profile)
 Constructor from a C sal3d_profile. Creates a C++ Profile object that holds it.
 Profile (const Profile &profile)
 Copy constructor.
 ~Profile ()
 Destructor.
sal3d_profile c_profile () const
 Returns the C pointer to a profile.
const_iterator begin () const
 Gets a const iterator to the beginning of the values.
iterator begin ()
 Gets an iterator to the beginning of the values.
const_iterator end () const
 Gets a const iterator past the last value.
iterator end ()
 Gets an iterator past the last value.
int length () const
 Gets the profile's length.
Profileoperator= (const Profile &rhs)
 Copy assignment operator.
const value_typeoperator[] (int index) const
 Gets a const reference to the element at position index.
value_typeoperator[] (int index)
 Gets a reference to the element at position index.

Detailed Description

Laser stripe position detected in a Frame.

This class requires linking with acquire.lib (import library for acquire.dll).

As explained in the Acquisition Overview, we use the position of the laser stripe detected in Frame objects to build 3D models of scanned parts. The Profile class is used as the container for the peak positions of the laser detected in those Frames.

Profiles are also the constituent parts of a RangeMap. They can be obtained through the getNewProfile() method, which returns every time that it is called the next empty Profile in the RangeMap, up to the maximum number that was set in the constructor. They can also exist standalone, created from an array of floats. However, it is not possible to append Profiles to a Frame, so if a Frame created this way is to be added to a RangeMap, the only method is by copying the data.

SAL3D comes with a module to extract the laser stripe positions from Frames, called PeakFinderH, although one can also use other vendor provided functions to fill in a Profile. This is possible because a profile can be thought of as an array of floating point numbers, in which each value represents the position of the peak of the laser in a row or a column of a frame, depending on the orientation of the camera/laser set.

In the Profile section of the acquisition overview there is a graphic representation of a profile, which may help to clarify its meaning.


Constructor & Destructor Documentation

sal3d::Profile::Profile ( value_type start,
int  length 
) [inline]

Creates a Profile from a user allocated array of floats.

This function creates a Profile from a given array of floats. The user is responsible for the management of this memory.

Parameters:
[in]startThe pointer to the array of floats.
[in]lengthThe length of the array.
sal3d::Profile::Profile ( sal3d_profile  profile) [inline, explicit]

Constructor from a C sal3d_profile. Creates a C++ Profile object that holds it.

Warning:
The new C++ Profile object will get the ownership of the C profile. That means that you should not call sal3d_profile_release() on this profile, otherwise it would be called twice.
Parameters:
[in]profileThe C sal3d_profile used to create this object.
sal3d::Profile::Profile ( const Profile profile) [inline]

Copy constructor.

Parameters:
[in]profileThe profile to copy from.

Destructor.

Warning:
Remember to free any memory allocated for the Profile if the constructor from an array was used.

Member Function Documentation

Gets a const iterator to the beginning of the values.

Returns:
A const iterator pointing at the first value.

Referenced by begin(), and operator[]().

Gets an iterator to the beginning of the values.

Returns:
An iterator pointing at the first value.

References begin().

sal3d_profile sal3d::Profile::c_profile ( ) const [inline]

Returns the C pointer to a profile.

Warning:
Never call sal3d_profile_release() with the pointer returned by this function or the application will fail.
Returns:
The pointer to sal3d's C interface.

Referenced by sal3d::Merger::average(), sal3d::Metric::calibrate(), sal3d::COP::COP(), sal3d::COP::fillRow(), sal3d::PeakFinder::operator()(), and sal3d::PeakFinderH::operator()().

const_iterator sal3d::Profile::end ( ) const [inline]

Gets a const iterator past the last value.

Returns:
A const iterator pointing past the last value.

References length().

Referenced by end().

Gets an iterator past the last value.

Returns:
An iterator pointing at past the last value.

References end().

int sal3d::Profile::length ( ) const [inline]

Gets the profile's length.

Returns:
The length of this profile.

Referenced by sal3d::Metric::calibrate(), end(), and operator[]().

Profile& sal3d::Profile::operator= ( const Profile rhs) [inline]

Copy assignment operator.

Parameters:
[in]rhsThe profile to copy to this object.
Returns:
A reference to this object.
const value_type& sal3d::Profile::operator[] ( int  index) const [inline]

Gets a const reference to the element at position index.

Parameters:
[in]indexThe index of the value to get. The allowed range is [0..length()-1].
Returns:
The value at index index.
Exceptions:
std::out_of_rangeIf index is not within the allowed range.

References begin(), and length().

value_type& sal3d::Profile::operator[] ( int  index) [inline]

Gets a reference to the element at position index.

Parameters:
[in]indexThe index of the value to get. The allowed range is [0..length()-1].
Returns:
The value at index index.
Exceptions:
std::out_of_rangeIf index is not within the allowed range.

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