#include <GeometryObject.h>
Public Types | |
typedef PSCalib::SegGeometry | SG |
typedef boost::shared_ptr< GeometryObject > | shpGO |
Public Member Functions | |
GeometryObject (std::string pname=std::string(), unsigned pindex=0, std::string oname=std::string(), unsigned oindex=0, double x0=0, double y0=0, double z0=0, double rot_z=0, double rot_y=0, double rot_x=0, double tilt_z=0, double tilt_y=0, double tilt_x=0) | |
Class constructor accepts path to the calibration "geometry" file and verbosity control bit-word. | |
virtual | ~GeometryObject () |
std::string | string_geo () |
std::string | string_geo_children () |
void | print_geo () |
Prints info about self object. | |
void | print_geo_children () |
Prints info about children objects. | |
void | set_parent (shpGO parent) |
Sets shared pointer to the parent object. | |
void | add_child (shpGO child) |
Adds shared pointer of the children geometry object to the vector. | |
shpGO | get_parent () |
Returns shared pointer to the parent geometry object. | |
std::vector< shpGO > | get_list_of_children () |
Returns vector of shared pointers to children geometry objects. | |
std::string | get_geo_name () |
Returns self object name. | |
unsigned | get_geo_index () |
Returns self object index. | |
std::string | get_parent_name () |
Returns parent object name. | |
unsigned | get_parent_index () |
Returns parent object index. | |
void | evaluate_pixel_coords (const bool do_tilt=true, const bool do_eval=false) |
Re-evaluate pixel coordinates (useful if geo is changed). | |
void | get_pixel_coords (const double *&X, const double *&Y, const double *&Z, unsigned &size, const bool do_tilt=true, const bool do_eval=false) |
Returns pointers to pixel coordinate arrays. | |
void | get_pixel_areas (const double *&areas, unsigned &size) |
Returns pointers to pixel areas array. | |
void | get_pixel_mask (const int *&mask, unsigned &size, const unsigned &mbits=0377) |
Returns pointers to pixel mask array. | |
unsigned | get_size_geo_array () |
Returns size of geometry object array - number of pixels. | |
double | get_pixel_scale_size () |
Returns pixel scale size of geometry object. | |
std::string | str_data () |
Returns string of data for output file. | |
void | get_geo_pars (double &x0, double &y0, double &z0, double &rot_z, double &rot_y, double &rot_x, double &tilt_z, double &tilt_y, double &tilt_x) |
Gets self object geometry parameters. | |
void | set_geo_pars (const double &x0=0, const double &y0=0, const double &z0=0, const double &rot_z=0, const double &rot_y=0, const double &rot_x=0, const double &tilt_z=0, const double &tilt_y=0, const double &tilt_x=0) |
Sets self object geometry parameters. | |
void | move_geo (const double &dx=0, const double &dy=0, const double &dz=0) |
Adds offset for origin of the self object w.r.t. current position. | |
void | tilt_geo (const double &dt_x=0, const double &dt_y=0, const double &dt_z=0) |
Adds tilts to the self object w.r.t. current orientation. | |
void | deallocate_memory () |
Delete arrays with allocated memory, reset pointers to 0. |
#include "PSCalib/GeometryObject.h" typedef boost::shared_ptr<GeometryObject> shpGO;
PSCalib::GeometryObject* geo = new PSCalib::GeometryObject(pname, pindex, oname, oindex, x0, y0, z0, rot_z, rot_y, rot_x, tilt_z, tilt_y, tilt_x );
// get pixel coordinates const double* X; const double* Y; const double* Z; unsigned size; bool do_tilt=true; geo->get_pixel_coords(X, Y, Z, size, do_tilt); // get pixel areas const double* A; unsigned size; geo->get_pixel_areas(A, size); // get pixel mask const int* mask; unsigned size; unsigned mbits = 377; // 1-edges; 2-wide central cols; 4-non-bound; 8-non-bound neighbours geo->get_pixel_mask(mask, size, mbits); shpGO parobj = geo->get_parent(); std::vector<shpGO> lst = geo->get_list_of_children(); std::string oname = geo->get_geo_name(); unsigned oindex = geo->get_geo_index(); std::string pname = geo->get_parent_name(); unsigned pindex = geo->get_parent_index(); double pixsize= geo->get_pixel_scale_size(); double x, y, z, rot_z, rot_y, rot_x, tilt_z, tilt_y, tilt_x; geo->get_geo_pars(x, y, z, rot_z, rot_y, rot_x, tilt_z, tilt_y, tilt_x); // Next methods are used in class GeometryAccess for building of hierarchial geometry structure. geo->set_parent(parent_geo); geo->add_child(child_geo);
Definition at line 144 of file GeometryObject.h.
Definition at line 147 of file GeometryObject.h.
typedef boost::shared_ptr<GeometryObject> PSCalib::GeometryObject::shpGO |
Definition at line 150 of file GeometryObject.h.
PSCalib::GeometryObject::GeometryObject | ( | std::string | pname = std::string() , |
|
unsigned | pindex = 0 , |
|||
std::string | oname = std::string() , |
|||
unsigned | oindex = 0 , |
|||
double | x0 = 0 , |
|||
double | y0 = 0 , |
|||
double | z0 = 0 , |
|||
double | rot_z = 0 , |
|||
double | rot_y = 0 , |
|||
double | rot_x = 0 , |
|||
double | tilt_z = 0 , |
|||
double | tilt_y = 0 , |
|||
double | tilt_x = 0 | |||
) |
Class constructor accepts path to the calibration "geometry" file and verbosity control bit-word.
[in] | pname | - parent name |
[in] | pindex | - parent index |
[in] | oname | - this object name |
[in] | oindex | - this object index |
[in] | x0 | - object origin coordinate x[um] in parent frame |
[in] | y0 | - object origin coordinate y[um] in parent frame |
[in] | z0 | - object origin coordinate z[um] in parent frame |
[in] | rot_z | - object rotation/design angle [deg] around axis z of the parent frame |
[in] | rot_y | - object rotation/design angle [deg] around axis y of the parent frame |
[in] | rot_x | - object rotation/design angle [deg] around axis x of the parent frame |
[in] | tilt_z | - object tilt/deviation angle [deg] around axis z of the parent frame |
[in] | tilt_y | - object tilt/deviation angle [deg] around axis y of the parent frame |
[in] | tilt_x | - object tilt/deviation angle [deg] around axis x of the parent frame |
virtual PSCalib::GeometryObject::~GeometryObject | ( | ) | [virtual] |
void PSCalib::GeometryObject::add_child | ( | shpGO | child | ) | [inline] |
Adds shared pointer of the children geometry object to the vector.
Definition at line 200 of file GeometryObject.h.
void PSCalib::GeometryObject::deallocate_memory | ( | ) |
Delete arrays with allocated memory, reset pointers to 0.
void PSCalib::GeometryObject::evaluate_pixel_coords | ( | const bool | do_tilt = true , |
|
const bool | do_eval = false | |||
) |
Re-evaluate pixel coordinates (useful if geo is changed).
[in] | do_tilt | - on/off tilt angle correction |
[in] | do_eval | - enforce (re-)evaluation of pixel coordinates |
unsigned PSCalib::GeometryObject::get_geo_index | ( | ) | [inline] |
std::string PSCalib::GeometryObject::get_geo_name | ( | ) | [inline] |
void PSCalib::GeometryObject::get_geo_pars | ( | double & | x0, | |
double & | y0, | |||
double & | z0, | |||
double & | rot_z, | |||
double & | rot_y, | |||
double & | rot_x, | |||
double & | tilt_z, | |||
double & | tilt_y, | |||
double & | tilt_x | |||
) |
Gets self object geometry parameters.
std::vector<shpGO> PSCalib::GeometryObject::get_list_of_children | ( | ) | [inline] |
Returns vector of shared pointers to children geometry objects.
Definition at line 206 of file GeometryObject.h.
shpGO PSCalib::GeometryObject::get_parent | ( | ) | [inline] |
Returns shared pointer to the parent geometry object.
Definition at line 203 of file GeometryObject.h.
unsigned PSCalib::GeometryObject::get_parent_index | ( | ) | [inline] |
std::string PSCalib::GeometryObject::get_parent_name | ( | ) | [inline] |
void PSCalib::GeometryObject::get_pixel_areas | ( | const double *& | areas, | |
unsigned & | size | |||
) |
Returns pointers to pixel areas array.
[out] | areas | - pointer to pixel areas array |
[out] | size | - size of the pixel areas array (number of pixels) |
void PSCalib::GeometryObject::get_pixel_coords | ( | const double *& | X, | |
const double *& | Y, | |||
const double *& | Z, | |||
unsigned & | size, | |||
const bool | do_tilt = true , |
|||
const bool | do_eval = false | |||
) |
Returns pointers to pixel coordinate arrays.
[out] | X | - pointer to x pixel coordinate array |
[out] | Y | - pointer to y pixel coordinate array |
[out] | Z | - pointer to z pixel coordinate array |
[out] | size | - size of the pixel coordinate array (number of pixels) |
[in] | do_tilt | - on/off tilt angle correction |
[in] | do_eval | - enforce (re-)evaluation of pixel coordinates |
void PSCalib::GeometryObject::get_pixel_mask | ( | const int *& | mask, | |
unsigned & | size, | |||
const unsigned & | mbits = 0377 | |||
) |
Returns pointers to pixel mask array.
[out] | mask | - pointer to pixel mask array |
[out] | size | - size of the pixel mask array (number of pixels) |
[in] | mbits | - mask control bits; + 1 - mask edges, + 2 - mask two central columns, + 4 - mask non-bounded pixels, + 8 - mask nearest neighbours of nonbonded pixels. |
double PSCalib::GeometryObject::get_pixel_scale_size | ( | ) |
Returns pixel scale size of geometry object.
unsigned PSCalib::GeometryObject::get_size_geo_array | ( | ) |
Returns size of geometry object array - number of pixels.
void PSCalib::GeometryObject::move_geo | ( | const double & | dx = 0 , |
|
const double & | dy = 0 , |
|||
const double & | dz = 0 | |||
) |
Adds offset for origin of the self object w.r.t. current position.
void PSCalib::GeometryObject::print_geo | ( | ) |
Prints info about self object.
void PSCalib::GeometryObject::print_geo_children | ( | ) |
Prints info about children objects.
void PSCalib::GeometryObject::set_geo_pars | ( | const double & | x0 = 0 , |
|
const double & | y0 = 0 , |
|||
const double & | z0 = 0 , |
|||
const double & | rot_z = 0 , |
|||
const double & | rot_y = 0 , |
|||
const double & | rot_x = 0 , |
|||
const double & | tilt_z = 0 , |
|||
const double & | tilt_y = 0 , |
|||
const double & | tilt_x = 0 | |||
) |
Sets self object geometry parameters.
void PSCalib::GeometryObject::set_parent | ( | shpGO | parent | ) | [inline] |
std::string PSCalib::GeometryObject::str_data | ( | ) |
Returns string of data for output file.
std::string PSCalib::GeometryObject::string_geo | ( | ) |
std::string PSCalib::GeometryObject::string_geo_children | ( | ) |
void PSCalib::GeometryObject::tilt_geo | ( | const double & | dt_x = 0 , |
|
const double & | dt_y = 0 , |
|||
const double & | dt_z = 0 | |||
) |
Adds tilts to the self object w.r.t. current orientation.