LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
geoalgo::GeoObjCollection Class Reference

#include "GeoObjCollection.h"

Public Member Functions

void Clear ()
 
void Add (const Point_t &pt, std::string label="", std::string c="")
 
void Add (const AABox_t &box, std::string label="", std::string c="")
 
void Add (const LineSegment_t &seg, std::string label="", std::string c="")
 
void Add (const HalfLine_t &seg, std::string label="", std::string c="")
 
void Add (const Trajectory_t &trj, std::string label="", std::string c="")
 
void Add (const Cone_t &cone, std::string label="", std::string c="")
 
void Add (const Sphere_t &sphere, std::string label="", std::string c="")
 
const std::vector< geoalgo::Point_t > & Point () const
 
const std::vector< std::string > & PointColor () const
 
const std::vector< geoalgo::AABox_t > & AABox () const
 
const std::vector< std::string > & AABoxColor () const
 
const std::vector< geoalgo::LineSegment_t > & LineSegment () const
 
const std::vector< std::string > & LineSegmentColor () const
 
const std::vector< geoalgo::HalfLine_t > & HalfLine () const
 
const std::vector< std::string > & HalfLineColor () const
 
const std::vector< geoalgo::Trajectory_t > & Trajectory () const
 
const std::vector< std::string > & TrajectoryColor () const
 
const std::vector< geoalgo::Cone_t > & Cone () const
 
const std::vector< std::string > & ConeColor () const
 
const std::vector< geoalgo::Sphere_t > & Sphere () const
 
const std::vector< std::string > & SphereColor () const
 
const std::map< geoalgo::Point_t, std::string > & Labels () const
 

Protected Member Functions

const Point_t_Point_ (size_t i) const
 
const AABox_t_AABox_ (size_t i) const
 
const LineSegment_t_LineSegment_ (size_t i) const
 
const Trajectory_t_Trajectory_ (size_t i) const
 
const Cone_t_Cone_ (size_t i) const
 
const Sphere_t_Sphere_ (size_t i) const
 
void _AddLabel_ (const Point_t &pt, std::string label)
 

Protected Attributes

std::vector< geoalgo::Point_t_pt_v
 
std::vector< std::string > _pt_col
 
std::vector< geoalgo::AABox_t_box_v
 
std::vector< std::string > _box_col
 
std::vector< geoalgo::LineSegment_t_seg_v
 
std::vector< std::string > _seg_col
 
std::vector< geoalgo::HalfLine_t_lin_v
 
std::vector< std::string > _lin_col
 
std::vector< geoalgo::Trajectory_t_trj_v
 
std::vector< std::string > _trj_col
 
std::vector< geoalgo::Cone_t_cone_v
 
std::vector< std::string > _cone_col
 
std::vector< geoalgo::Sphere_sphere_v
 
std::vector< std::string > _sphere_col
 
std::map< geoalgo::Point_t, std::string > _labels
 

Detailed Description

Definition at line 35 of file GeoObjCollection.h.

Member Function Documentation

const AABox_t& geoalgo::GeoObjCollection::_AABox_ ( size_t  i) const
inlineprotected

Definition at line 80 of file GeoObjCollection.h.

References _box_v.

80 { return _box_v[i]; }
std::vector< geoalgo::AABox_t > _box_v
void geoalgo::GeoObjCollection::_AddLabel_ ( const Point_t pt,
std::string  label 
)
protected

Definition at line 29 of file GeoObjCollection.cxx.

References _labels, and pt.

Referenced by _Sphere_(), and Add().

30  {
31  auto const iter = _labels.find(pt);
32  if (iter == _labels.end())
33 
34  _labels.insert(std::make_pair(pt, Form("%s\n", label.c_str())));
35 
36  else {
37 
38  label = Form("%s%s\n", (*iter).second.c_str(), label.c_str());
39 
40  _labels[pt] = label;
41  }
42  }
std::map< geoalgo::Point_t, std::string > _labels
TMarker * pt
Definition: egs.C:25
const Cone_t& geoalgo::GeoObjCollection::_Cone_ ( size_t  i) const
inlineprotected

Definition at line 86 of file GeoObjCollection.h.

References _cone_v.

86 { return _cone_v[i]; }
std::vector< geoalgo::Cone_t > _cone_v
const LineSegment_t& geoalgo::GeoObjCollection::_LineSegment_ ( size_t  i) const
inlineprotected

Definition at line 82 of file GeoObjCollection.h.

References _seg_v.

82 { return _seg_v[i]; }
std::vector< geoalgo::LineSegment_t > _seg_v
const Point_t& geoalgo::GeoObjCollection::_Point_ ( size_t  i) const
inlineprotected

Definition at line 78 of file GeoObjCollection.h.

References _pt_v.

78 { return _pt_v[i]; }
std::vector< geoalgo::Point_t > _pt_v
const Sphere_t& geoalgo::GeoObjCollection::_Sphere_ ( size_t  i) const
inlineprotected

Definition at line 88 of file GeoObjCollection.h.

References _AddLabel_(), and _sphere_v.

88 { return _sphere_v[i]; }
std::vector< geoalgo::Sphere > _sphere_v
const Trajectory_t& geoalgo::GeoObjCollection::_Trajectory_ ( size_t  i) const
inlineprotected

Definition at line 84 of file GeoObjCollection.h.

References _trj_v.

84 { return _trj_v[i]; }
std::vector< geoalgo::Trajectory_t > _trj_v
const std::vector<geoalgo::AABox_t>& geoalgo::GeoObjCollection::AABox ( ) const
inline

Definition at line 57 of file GeoObjCollection.h.

References _box_v.

57 { return _box_v; }
std::vector< geoalgo::AABox_t > _box_v
const std::vector<std::string>& geoalgo::GeoObjCollection::AABoxColor ( ) const
inline

Definition at line 58 of file GeoObjCollection.h.

References _box_col.

58 { return _box_col; }
std::vector< std::string > _box_col
void geoalgo::GeoObjCollection::Add ( const Point_t pt,
std::string  label = "",
std::string  c = "" 
)

Definition at line 44 of file GeoObjCollection.cxx.

References _AddLabel_(), _pt_col, and _pt_v.

45  {
46  if (name.empty()) name = Form("Pt (%zu)", _pt_v.size());
47  _AddLabel_(pt, name);
48  _pt_v.push_back(pt);
49  _pt_col.push_back(c);
50  }
std::vector< std::string > _pt_col
void _AddLabel_(const Point_t &pt, std::string label)
TMarker * pt
Definition: egs.C:25
std::vector< geoalgo::Point_t > _pt_v
void geoalgo::GeoObjCollection::Add ( const AABox_t box,
std::string  label = "",
std::string  c = "" 
)

Definition at line 52 of file GeoObjCollection.cxx.

References _AddLabel_(), _box_col, _box_v, geoalgo::AABox::Max(), and geoalgo::AABox::Min().

53  {
54  if (name.empty()) name = Form("AABox (%zu)", _box_v.size());
55  _AddLabel_(box.Min() + (box.Max() - box.Min()) / 2., name);
56  _box_v.push_back(box);
57  _box_col.push_back(c);
58  }
void _AddLabel_(const Point_t &pt, std::string label)
std::vector< geoalgo::AABox_t > _box_v
std::vector< std::string > _box_col
void geoalgo::GeoObjCollection::Add ( const LineSegment_t seg,
std::string  label = "",
std::string  c = "" 
)

Definition at line 60 of file GeoObjCollection.cxx.

References _AddLabel_(), _seg_col, _seg_v, and geoalgo::LineSegment::End().

61  {
62  if (name.empty()) name = Form("LSeg (%zu)", _seg_v.size());
63  _AddLabel_(seg.End(), name);
64  _seg_v.push_back(seg);
65  _seg_col.push_back(c);
66  }
void _AddLabel_(const Point_t &pt, std::string label)
std::vector< std::string > _seg_col
std::vector< geoalgo::LineSegment_t > _seg_v
void geoalgo::GeoObjCollection::Add ( const HalfLine_t seg,
std::string  label = "",
std::string  c = "" 
)

Definition at line 68 of file GeoObjCollection.cxx.

References _AddLabel_(), _lin_col, _lin_v, and geoalgo::HalfLine::Start().

69  {
70  if (name.empty()) name = Form("Line (%zu)", _lin_v.size());
71  _AddLabel_(lin.Start() + lin.Start() * 10, name);
72  _lin_v.push_back(lin);
73  _lin_col.push_back(c);
74  }
void _AddLabel_(const Point_t &pt, std::string label)
std::vector< geoalgo::HalfLine_t > _lin_v
std::vector< std::string > _lin_col
void geoalgo::GeoObjCollection::Add ( const Trajectory_t trj,
std::string  label = "",
std::string  c = "" 
)

Definition at line 76 of file GeoObjCollection.cxx.

References _AddLabel_(), _trj_col, and _trj_v.

77  {
78  if (trj.size() < 2) throw GeoAlgoException("Trajectory size cannot be smaller than 2!");
79  if (name.empty()) name = Form("Trj (%zu)", _trj_v.size());
80  _AddLabel_(trj.back(), name);
81  _trj_v.push_back(trj);
82  _trj_col.push_back(c);
83 
84  return;
85  }
void _AddLabel_(const Point_t &pt, std::string label)
std::vector< std::string > _trj_col
std::vector< geoalgo::Trajectory_t > _trj_v
void geoalgo::GeoObjCollection::Add ( const Cone_t cone,
std::string  label = "",
std::string  c = "" 
)

Definition at line 87 of file GeoObjCollection.cxx.

References _AddLabel_(), _cone_col, _cone_v, geoalgo::HalfLine::Dir(), geoalgo::Cone::Length(), and geoalgo::HalfLine::Start().

88  {
89  if (name.empty()) name = Form("Cone (%zu)", _cone_v.size());
90  _AddLabel_(cone.Start() + cone.Dir() * cone.Length(), name);
91  _cone_v.push_back(cone);
92  _cone_col.push_back(c);
93  }
void _AddLabel_(const Point_t &pt, std::string label)
std::vector< std::string > _cone_col
std::vector< geoalgo::Cone_t > _cone_v
void geoalgo::GeoObjCollection::Add ( const Sphere_t sphere,
std::string  label = "",
std::string  c = "" 
)

Definition at line 95 of file GeoObjCollection.cxx.

References _AddLabel_(), _sphere_col, _sphere_v, and geoalgo::Sphere::Center().

96  {
97  if (name.empty()) name = Form("Sphere (%zu)", _sphere_v.size());
98  _AddLabel_(sphere.Center(), name);
99  _sphere_v.push_back(sphere);
100  _sphere_col.push_back(c);
101  }
void _AddLabel_(const Point_t &pt, std::string label)
std::vector< geoalgo::Sphere > _sphere_v
std::vector< std::string > _sphere_col
void geoalgo::GeoObjCollection::Clear ( )

Definition at line 10 of file GeoObjCollection.cxx.

References _box_col, _box_v, _cone_col, _cone_v, _labels, _lin_col, _lin_v, _pt_col, _pt_v, _seg_col, _seg_v, _sphere_col, _trj_col, and _trj_v.

11  {
12  _pt_v.clear();
13  _box_v.clear();
14  _seg_v.clear();
15  _trj_v.clear();
16  _lin_v.clear();
17  _cone_v.clear();
18  //_sphere_v.clear();
19  _pt_col.clear();
20  _box_col.clear();
21  _seg_col.clear();
22  _trj_col.clear();
23  _lin_col.clear();
24  _cone_col.clear();
25  _sphere_col.clear();
26  _labels.clear();
27  }
std::vector< std::string > _pt_col
std::vector< geoalgo::AABox_t > _box_v
std::vector< std::string > _cone_col
std::vector< geoalgo::Cone_t > _cone_v
std::map< geoalgo::Point_t, std::string > _labels
std::vector< std::string > _trj_col
std::vector< std::string > _box_col
std::vector< geoalgo::Trajectory_t > _trj_v
std::vector< geoalgo::HalfLine_t > _lin_v
std::vector< std::string > _lin_col
std::vector< std::string > _sphere_col
std::vector< std::string > _seg_col
std::vector< geoalgo::Point_t > _pt_v
std::vector< geoalgo::LineSegment_t > _seg_v
const std::vector<geoalgo::Cone_t>& geoalgo::GeoObjCollection::Cone ( ) const
inline

Definition at line 69 of file GeoObjCollection.h.

References _cone_v.

69 { return _cone_v; }
std::vector< geoalgo::Cone_t > _cone_v
const std::vector<std::string>& geoalgo::GeoObjCollection::ConeColor ( ) const
inline

Definition at line 70 of file GeoObjCollection.h.

References _cone_col.

70 { return _cone_col; }
std::vector< std::string > _cone_col
const std::vector<geoalgo::HalfLine_t>& geoalgo::GeoObjCollection::HalfLine ( ) const
inline

Definition at line 63 of file GeoObjCollection.h.

References _lin_v.

63 { return _lin_v; }
std::vector< geoalgo::HalfLine_t > _lin_v
const std::vector<std::string>& geoalgo::GeoObjCollection::HalfLineColor ( ) const
inline

Definition at line 64 of file GeoObjCollection.h.

References _lin_col.

64 { return _lin_col; }
std::vector< std::string > _lin_col
const std::map<geoalgo::Point_t, std::string>& geoalgo::GeoObjCollection::Labels ( ) const
inline

Definition at line 75 of file GeoObjCollection.h.

References _labels.

75 { return _labels; }
std::map< geoalgo::Point_t, std::string > _labels
const std::vector<geoalgo::LineSegment_t>& geoalgo::GeoObjCollection::LineSegment ( ) const
inline

Definition at line 60 of file GeoObjCollection.h.

References _seg_v.

60 { return _seg_v; }
std::vector< geoalgo::LineSegment_t > _seg_v
const std::vector<std::string>& geoalgo::GeoObjCollection::LineSegmentColor ( ) const
inline

Definition at line 61 of file GeoObjCollection.h.

References _seg_col.

61 { return _seg_col; }
std::vector< std::string > _seg_col
const std::vector<geoalgo::Point_t>& geoalgo::GeoObjCollection::Point ( ) const
inline

Definition at line 54 of file GeoObjCollection.h.

References _pt_v.

54 { return _pt_v; }
std::vector< geoalgo::Point_t > _pt_v
const std::vector<std::string>& geoalgo::GeoObjCollection::PointColor ( ) const
inline

Definition at line 55 of file GeoObjCollection.h.

References _pt_col.

55 { return _pt_col; }
std::vector< std::string > _pt_col
const std::vector<geoalgo::Sphere_t>& geoalgo::GeoObjCollection::Sphere ( ) const
inline

Definition at line 72 of file GeoObjCollection.h.

References _sphere_v.

72 { return _sphere_v; }
std::vector< geoalgo::Sphere > _sphere_v
const std::vector<std::string>& geoalgo::GeoObjCollection::SphereColor ( ) const
inline

Definition at line 73 of file GeoObjCollection.h.

References _sphere_col.

73 { return _sphere_col; }
std::vector< std::string > _sphere_col
const std::vector<geoalgo::Trajectory_t>& geoalgo::GeoObjCollection::Trajectory ( ) const
inline

Definition at line 66 of file GeoObjCollection.h.

References _trj_v.

66 { return _trj_v; }
std::vector< geoalgo::Trajectory_t > _trj_v
const std::vector<std::string>& geoalgo::GeoObjCollection::TrajectoryColor ( ) const
inline

Definition at line 67 of file GeoObjCollection.h.

References _trj_col.

67 { return _trj_col; }
std::vector< std::string > _trj_col

Member Data Documentation

std::vector<std::string> geoalgo::GeoObjCollection::_box_col
protected

Definition at line 95 of file GeoObjCollection.h.

Referenced by AABoxColor(), Add(), and Clear().

std::vector<geoalgo::AABox_t> geoalgo::GeoObjCollection::_box_v
protected

Definition at line 94 of file GeoObjCollection.h.

Referenced by _AABox_(), AABox(), Add(), and Clear().

std::vector<std::string> geoalgo::GeoObjCollection::_cone_col
protected

Definition at line 103 of file GeoObjCollection.h.

Referenced by Add(), Clear(), and ConeColor().

std::vector<geoalgo::Cone_t> geoalgo::GeoObjCollection::_cone_v
protected

Definition at line 102 of file GeoObjCollection.h.

Referenced by _Cone_(), Add(), Clear(), and Cone().

std::map<geoalgo::Point_t, std::string> geoalgo::GeoObjCollection::_labels
protected

Definition at line 106 of file GeoObjCollection.h.

Referenced by _AddLabel_(), Clear(), and Labels().

std::vector<std::string> geoalgo::GeoObjCollection::_lin_col
protected

Definition at line 99 of file GeoObjCollection.h.

Referenced by Add(), Clear(), and HalfLineColor().

std::vector<geoalgo::HalfLine_t> geoalgo::GeoObjCollection::_lin_v
protected

Definition at line 98 of file GeoObjCollection.h.

Referenced by Add(), Clear(), and HalfLine().

std::vector<std::string> geoalgo::GeoObjCollection::_pt_col
protected

Definition at line 93 of file GeoObjCollection.h.

Referenced by Add(), Clear(), and PointColor().

std::vector<geoalgo::Point_t> geoalgo::GeoObjCollection::_pt_v
protected

Definition at line 92 of file GeoObjCollection.h.

Referenced by _Point_(), Add(), Clear(), and Point().

std::vector<std::string> geoalgo::GeoObjCollection::_seg_col
protected

Definition at line 97 of file GeoObjCollection.h.

Referenced by Add(), Clear(), and LineSegmentColor().

std::vector<geoalgo::LineSegment_t> geoalgo::GeoObjCollection::_seg_v
protected

Definition at line 96 of file GeoObjCollection.h.

Referenced by _LineSegment_(), Add(), Clear(), and LineSegment().

std::vector<std::string> geoalgo::GeoObjCollection::_sphere_col
protected

Definition at line 105 of file GeoObjCollection.h.

Referenced by Add(), Clear(), and SphereColor().

std::vector<geoalgo::Sphere> geoalgo::GeoObjCollection::_sphere_v
protected

Definition at line 104 of file GeoObjCollection.h.

Referenced by _Sphere_(), Add(), and Sphere().

std::vector<std::string> geoalgo::GeoObjCollection::_trj_col
protected

Definition at line 101 of file GeoObjCollection.h.

Referenced by Add(), Clear(), and TrajectoryColor().

std::vector<geoalgo::Trajectory_t> geoalgo::GeoObjCollection::_trj_v
protected

Definition at line 100 of file GeoObjCollection.h.

Referenced by _Trajectory_(), Add(), Clear(), and Trajectory().


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