LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
geoalgo::GeoObjCollection Class Reference

#include "GeoObjCollection.h"

Public Member Functions

 GeoObjCollection ()
 Default constructor. More...
 
virtual ~GeoObjCollection ()
 Default destructor. More...
 
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 31 of file GeoObjCollection.h.

Constructor & Destructor Documentation

geoalgo::GeoObjCollection::GeoObjCollection ( )

Default constructor.

Definition at line 8 of file GeoObjCollection.cxx.

9  {}
virtual geoalgo::GeoObjCollection::~GeoObjCollection ( )
inlinevirtual

Default destructor.

Definition at line 39 of file GeoObjCollection.h.

References Add(), Clear(), label, and pt.

39 {}

Member Function Documentation

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

Definition at line 85 of file GeoObjCollection.h.

References _box_v.

86  { 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 30 of file GeoObjCollection.cxx.

References _labels, label, and pt.

Referenced by _Sphere_(), and Add().

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

Definition at line 94 of file GeoObjCollection.h.

References _cone_v.

95  { 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 88 of file GeoObjCollection.h.

References _seg_v.

89  { 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 82 of file GeoObjCollection.h.

References _pt_v.

83  { 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 97 of file GeoObjCollection.h.

References _AddLabel_(), _sphere_v, and label.

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

Definition at line 91 of file GeoObjCollection.h.

References _trj_v.

92  { 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 60 of file GeoObjCollection.h.

References _box_v.

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

Definition at line 61 of file GeoObjCollection.h.

References _box_col.

61 { 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 45 of file GeoObjCollection.cxx.

References _AddLabel_(), _pt_col, and _pt_v.

Referenced by ~GeoObjCollection().

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

Definition at line 53 of file GeoObjCollection.cxx.

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

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

Definition at line 61 of file GeoObjCollection.cxx.

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

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

Definition at line 70 of file GeoObjCollection.cxx.

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

71  {
72  if(name.empty()) name = Form("Line (%zu)",_lin_v.size());
73  _AddLabel_(lin.Start()+lin.Start()*10,name);
74  _lin_v.push_back(lin);
75  _lin_col.push_back(c);
76  }
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 78 of file GeoObjCollection.cxx.

References _AddLabel_(), _trj_col, and _trj_v.

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

Definition at line 90 of file GeoObjCollection.cxx.

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

91  {
92  if(name.empty()) name = Form("Cone (%zu)",_cone_v.size());
93  _AddLabel_(cone.Start()+cone.Dir()*cone.Length(),name);
94  _cone_v.push_back(cone);
95  _cone_col.push_back(c);
96  }
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 99 of file GeoObjCollection.cxx.

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

100  {
101  if(name.empty()) name = Form("Sphere (%zu)",_sphere_v.size());
102  _AddLabel_(sphere.Center(),name);
103  _sphere_v.push_back(sphere);
104  _sphere_col.push_back(c);
105  }
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 11 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.

Referenced by ~GeoObjCollection().

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

Definition at line 72 of file GeoObjCollection.h.

References _cone_v.

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

Definition at line 73 of file GeoObjCollection.h.

References _cone_col.

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

Definition at line 66 of file GeoObjCollection.h.

References _lin_v.

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

Definition at line 67 of file GeoObjCollection.h.

References _lin_col.

67 { 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 78 of file GeoObjCollection.h.

References _labels.

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

Definition at line 63 of file GeoObjCollection.h.

References _seg_v.

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

Definition at line 64 of file GeoObjCollection.h.

References _seg_col.

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

Definition at line 57 of file GeoObjCollection.h.

References _pt_v.

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

Definition at line 58 of file GeoObjCollection.h.

References _pt_col.

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

Definition at line 75 of file GeoObjCollection.h.

References _sphere_v.

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

Definition at line 76 of file GeoObjCollection.h.

References _sphere_col.

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

Definition at line 69 of file GeoObjCollection.h.

References _trj_v.

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

Definition at line 70 of file GeoObjCollection.h.

References _trj_col.

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

Member Data Documentation

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

Definition at line 106 of file GeoObjCollection.h.

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

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

Definition at line 105 of file GeoObjCollection.h.

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

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

Definition at line 114 of file GeoObjCollection.h.

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

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

Definition at line 113 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 117 of file GeoObjCollection.h.

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

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

Definition at line 110 of file GeoObjCollection.h.

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

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

Definition at line 109 of file GeoObjCollection.h.

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

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

Definition at line 104 of file GeoObjCollection.h.

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

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

Definition at line 103 of file GeoObjCollection.h.

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

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

Definition at line 108 of file GeoObjCollection.h.

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

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

Definition at line 107 of file GeoObjCollection.h.

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

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

Definition at line 116 of file GeoObjCollection.h.

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

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

Definition at line 115 of file GeoObjCollection.h.

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

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

Definition at line 112 of file GeoObjCollection.h.

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

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

Definition at line 111 of file GeoObjCollection.h.

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


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