[24a07e]: contrib / mul / msm / msm_pose_maker.h Maximize Restore History

Download this file

msm_pose_maker.h    64 lines (49 with data), 2.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef msm_pose_maker_h_
#define msm_pose_maker_h_
//:
// \file
// \author Tim Cootes
// \brief Compute a direction at each point, usually normal to curve
#include <msm/msm_points.h>
#include <msm/msm_curve.h>
#include <vgl/vgl_vector_2d.h>
#include <vcl_iosfwd.h>
//: Compute a direction at each point, usually normal to curve.
// Generates a unit direction vector for each point.
// Typically these are defined as normals to the curve passing
// through the point.
//
// Define tangent at point i as line between end0_[i] and end1_[i].
// If end0_[i]==end1_[i] then use vector (1,0) in ref. frame.
class msm_pose_maker
{
private:
//: Define tangent at point i as line between end0_[i] and end1_[i]
vcl_vector<unsigned> end0_;
//: Define tangent at point i as line between end0_[i] and end1_[i]
vcl_vector<unsigned> end1_;
public:
~msm_pose_maker() {}
//: Set up definitions of directions from the curves.
// Where multiple curves pass through a point, the direction
// is defined by the first in the list.
void set_from_curves(unsigned n_points, const msm_curves& curves);
//: Returns true if direction defined at point i
bool defined(unsigned i) { return end0_[i]!=0 || end1_[i]!=0; }
//: Compute a direction at each point, usually normal to curve.
void create_vectors(const msm_points& points,
vcl_vector<vgl_vector_2d<double> >& dir) const;
//: Print class to os
void print_summary(vcl_ostream& os) const;
//: Save class to binary file stream
void b_write(vsl_b_ostream& bfs) const;
//: Load class from binary file stream
void b_read(vsl_b_istream& bfs);
};
//: Binary file stream output operator for class reference
void vsl_b_write(vsl_b_ostream& bfs, const msm_pose_maker& b);
//: Binary file stream input operator for class reference
void vsl_b_read(vsl_b_istream& bfs, msm_pose_maker& b);
//: Stream output operator for class reference
vcl_ostream& operator<<(vcl_ostream& os,const msm_pose_maker& b);
#endif // msm_pose_maker_h_