Jpp  15.0.0-rc.2
the software that should make you happy
 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
JROOT::JMarkerAttributes Class Reference

Auxiliary class to set marker attributes. More...

#include <JMarkerAttributes.hh>

Inheritance diagram for JROOT::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 () override
 Rewind index. More...
 
virtual bool hasNext () override
 Check availability of next element. More...
 
virtual const pointer_typenext () override
 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 26 of file JMarkerAttributes.hh.

Member Typedef Documentation

Definition at line 32 of file JMarkerAttributes.hh.

Constructor & Destructor Documentation

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

Constructor.

Parameters
sizemarker size

Definition at line 40 of file JMarkerAttributes.hh.

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

Member Function Documentation

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

Get reference to unique instance of this class object.

Returns
reference to this class object

Definition at line 67 of file JMarkerAttributes.hh.

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

Set marker size.

Parameters
sizemarker size

Definition at line 80 of file JMarkerAttributes.hh.

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

Rewind index.

Implements JLANG::JRewindable< T >.

Definition at line 91 of file JMarkerAttributes.hh.

92  {
93  index = 0;
94  }
virtual bool JROOT::JMarkerAttributes::hasNext ( )
inlineoverridevirtual

Check availability of next element.

Returns
true if the iteration has more elements; else false

Implements JLANG::JObjectIterator< T >.

Definition at line 102 of file JMarkerAttributes.hh.

103  {
104  return !this->empty();
105  }
virtual const pointer_type& JROOT::JMarkerAttributes::next ( )
inlineoverridevirtual

Get next element.

Returns
pointer to element

Implements JLANG::JObjectIterator< T >.

Definition at line 113 of file JMarkerAttributes.hh.

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

Get marker attributes.

Parameters
indexindex
Returns
marker attributes

Definition at line 135 of file JMarkerAttributes.hh.

136  {
137  return this->at(index%this->size());
138  }
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 90 of file JObjectIterator.hh.

91  {
92  skip_type i = 0;
93 
94  for ( ; i != ns && hasNext(); ++i) {
95  next();
96  }
97 
98  return i;
99  }
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 JROOT::JMarkerAttributes::index
private

Definition at line 142 of file JMarkerAttributes.hh.


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