Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
JGIZMO::JMarkerAttributes Class Reference

Auxiliary class to set marker attributes. More...

#include <JMarkerAttributes.hh>

Inheritance diagram for JGIZMO::JMarkerAttributes:
JLANG::JRewindableObjectIterator< T > std::vector< TAttMarker > JLANG::JObjectIterator< T > JLANG::JRewindable< T >

Public Types

typedef
JRewindableObjectIterator
< TAttMarker >::pointer_type 
pointer_type
 

Public Member Functions

 JMarkerAttributes (const Double_t size=1.0)
 Constructor. More...
 
void setMarkerSize (const Double_t size)
 Set marker size. More...
 
virtual void rewind ()
 Rewind index. More...
 
virtual bool hasNext ()
 Check availability of next element. More...
 
virtual const pointer_typenext ()
 Get next element. More...
 
const TAttMarker & get (unsigned int index)
 Get marker attributes. More...
 
virtual skip_type skip (const skip_type ns)
 Skip items. More...
 

Static Public Member Functions

static JMarkerAttributesgetInstance ()
 Get reference to unique instance of this class object. More...
 

Private Attributes

unsigned int index
 

Detailed Description

Auxiliary class to set marker attributes.

Definition at line 27 of file JMarkerAttributes.hh.

Member Typedef Documentation

Definition at line 33 of file JMarkerAttributes.hh.

Constructor & Destructor Documentation

JGIZMO::JMarkerAttributes::JMarkerAttributes ( const Double_t  size = 1.0)
inline

Constructor.

Parameters
sizemarker size

Definition at line 41 of file JMarkerAttributes.hh.

41  :
43  index(0)
44  {
45  push_back(TAttMarker(kBlack, 20, 0.85 * size));
46  push_back(TAttMarker(kRed, 21, 0.70 * size));
47  push_back(TAttMarker(kBlue, 23, 0.75 * size));
48  push_back(TAttMarker(kGreen, 22, 0.75 * size));
49  push_back(TAttMarker(kMagenta, 34, 0.75 * size));
50  push_back(TAttMarker(kYellow, 29, 0.75 * size));
51  push_back(TAttMarker(kCyan, 33, 0.75 * size));
52 
53  push_back(TAttMarker(kBlack, 24, 0.85 * size));
54  push_back(TAttMarker(kRed, 25, 0.70 * size));
55  push_back(TAttMarker(kBlue, 32, 0.75 * size));
56  push_back(TAttMarker(kGreen, 26, 0.75 * size));
57  push_back(TAttMarker(kMagenta, 28, 0.75 * size));
58  push_back(TAttMarker(kYellow, 30, 0.75 * size));
59  push_back(TAttMarker(kCyan, 27, 0.75 * size));
60  }

Member Function Documentation

static JMarkerAttributes& JGIZMO::JMarkerAttributes::getInstance ( )
inlinestatic

Get reference to unique instance of this class object.

Returns
reference to this class object

Definition at line 68 of file JMarkerAttributes.hh.

69  {
70  static JMarkerAttributes marker(1.0);
71 
72  return marker;
73  }
Auxiliary class to set marker attributes.
void JGIZMO::JMarkerAttributes::setMarkerSize ( const Double_t  size)
inline

Set marker size.

Parameters
sizemarker size

Definition at line 81 of file JMarkerAttributes.hh.

82  {
83  for (iterator i = this->begin(); i != this->end(); ++i) {
84  i->SetMarkerSize(i->GetMarkerSize() * size);
85  }
86  }
virtual void JGIZMO::JMarkerAttributes::rewind ( )
inlinevirtual

Rewind index.

Implements JLANG::JRewindable< T >.

Definition at line 92 of file JMarkerAttributes.hh.

93  {
94  index = 0;
95  }
virtual bool JGIZMO::JMarkerAttributes::hasNext ( )
inlinevirtual

Check availability of next element.

Returns
true if the iteration has more elements; else false

Implements JLANG::JObjectIterator< T >.

Definition at line 103 of file JMarkerAttributes.hh.

104  {
105  return !this->empty();
106  }
virtual const pointer_type& JGIZMO::JMarkerAttributes::next ( )
inlinevirtual

Get next element.

Returns
pointer to element

Implements JLANG::JObjectIterator< T >.

Definition at line 114 of file JMarkerAttributes.hh.

115  {
116  static pointer_type ps;
117 
118  if (index < this->size()) {
119  ps.reset(&this->at(index));
120  }
121 
122  ++index;
123 
124  index = index%this->size();
125 
126  return ps;
127  }
JRewindableObjectIterator< TAttMarker >::pointer_type pointer_type
const TAttMarker& JGIZMO::JMarkerAttributes::get ( unsigned int  index)
inline

Get marker attributes.

Parameters
indexindex
Returns
marker attributes

Definition at line 136 of file JMarkerAttributes.hh.

137  {
138  return this->at(index%this->size());
139  }
template<class T>
virtual skip_type JLANG::JObjectIterator< T >::skip ( const skip_type  ns)
inlinevirtualinherited

Skip items.

Parameters
nsnumber of items to skip
Returns
number of items skipped

Reimplemented in JLANG::JPipe< T >, JLANG::JPipe< JTail_t >, JLANG::JPipe< JHead_t >, JLANG::JSTDObjectIterator< T >, JLANG::JAbstractObjectReader< T >, JLANG::JAbstractObjectReader< JNullType >, JLANG::JAbstractObjectReader< const T >, JLANG::JAbstractObjectReader< JTail_t >, JLANG::JAbstractObjectReader< JHead_t >, JLANG::JAbstractObjectReader< KM3NETDAQ::KM3NETDAQ::JDAQEvent >, JLANG::JAbstractObjectReader< JDAQSummaryslice >, and JLANG::JAbstractObjectReader< JTypeList< JDAQEvent, JTypelist_t > >.

Definition at line 88 of file JObjectIterator.hh.

89  {
90  skip_type i = 0;
91 
92  for ( ; i != ns && hasNext(); ++i) {
93  next();
94  }
95 
96  return i;
97  }
unsigned int skip_type
Type definition for number of objects to skip.
virtual const pointer_type & next()=0
Get next element.
virtual bool hasNext()=0
Check availability of next element.

Member Data Documentation

unsigned int JGIZMO::JMarkerAttributes::index
private

Definition at line 143 of file JMarkerAttributes.hh.


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