How to create a Measurement




A simple Measurement of type "x" (RP::x) can be created as follows:

// create a position vector at (0,0,0)
EVector pos(3,0);
// create a vector of one component with value pos[0]
EVector m(1,0); m[0]=pos[0];
// create a 1x1 Matrix with value 0
EMatrix M(1,1,0);
// square of the x measurement error
M[0][0] = pow(5*mm,2);

// Create the measurement
Measurement* meas = new Measurement();
// Set the mandatory measurement attributes
// First the measurement type, which should match the measurement HyperVector

meas->set_name(RP::x);
// The measurement HyperVector
meas->set_hv(HyperVector(m,M));
// The measurement position. Used for Ordering Measurements inside a Trajectory
// and to create measurements surfaces automatically.

meas->set_position(pos);


A measurement Surface is optional. This functionality is a bit obsolete and no Surface is needed in principle since measurements surfaces can be build on the fly using the measurement position and the normal to the surface, which is a volume property (RP::SurfNormal). To set the surface:

meas->set_surface(surf);

where surf is a pointer to a Surface that has being created previously.

The available measurement types are:

  • x, y,z, xy, xz, yz, xyz
  • wire_r, wire_ru
  • wireplane_r, wireplane_ru
  • pos, dir, slope, curv
  • pos_slope, pos_dir, curv
  • pos_slope_curv, pos_dir_curv