Jpp
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

◆ pointer_type

Definition at line 33 of file JMarkerAttributes.hh.

Constructor & Destructor Documentation

◆ JMarkerAttributes()

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

◆ getInstance()

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  }

◆ setMarkerSize()

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  }

◆ rewind()

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  }

◆ hasNext()

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  }

◆ next()

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  }

◆ get()

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  }

◆ skip()

template<class T>
virtual skip_type JLANG::JObjectIterator< T >::skip ( const skip_type  ns)
inlinevirtualinherited

Member Data Documentation

◆ index

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:
JLANG::skip_type
unsigned int skip_type
Type definition for number of objects to skip.
Definition: JObjectIterator.hh:25
std::vector< TAttMarker >
JLANG::JObjectIterator::hasNext
virtual bool hasNext()=0
Check availability of next element.
JGIZMO::JMarkerAttributes::index
unsigned int index
Definition: JMarkerAttributes.hh:143
JGIZMO::JMarkerAttributes
Auxiliary class to set marker attributes.
Definition: JMarkerAttributes.hh:27
JGIZMO::JMarkerAttributes::pointer_type
JRewindableObjectIterator< TAttMarker >::pointer_type pointer_type
Definition: JMarkerAttributes.hh:33
JLANG::JObjectIterator::next
virtual const pointer_type & next()=0
Get next element.