Jpp  17.1.1
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  push_back(TAttMarker(kOrange, 47, 0.75 * size));
52  push_back(TAttMarker(kPink, 41, 0.75 * size));
53  push_back(TAttMarker(kViolet, 43, 0.75 * size));
54 
55  push_back(TAttMarker(kBlack, 24, 0.85 * size));
56  push_back(TAttMarker(kRed, 25, 0.70 * size));
57  push_back(TAttMarker(kBlue, 32, 0.75 * size));
58  push_back(TAttMarker(kGreen, 26, 0.75 * size));
59  push_back(TAttMarker(kMagenta, 28, 0.75 * size));
60  push_back(TAttMarker(kYellow, 30, 0.75 * size));
61  push_back(TAttMarker(kCyan, 27, 0.75 * size));
62  push_back(TAttMarker(kOrange, 46, 0.75 * size));
63  push_back(TAttMarker(kPink, 40, 0.75 * size));
64  push_back(TAttMarker(kViolet, 42, 0.75 * size));
65  }

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 73 of file JMarkerAttributes.hh.

74  {
75  static JMarkerAttributes marker(1.0);
76 
77  return marker;
78  }
Auxiliary class to set marker attributes.
void JROOT::JMarkerAttributes::setMarkerSize ( const Double_t  size)
inline

Set marker size.

Parameters
sizemarker size

Definition at line 86 of file JMarkerAttributes.hh.

87  {
88  for (iterator i = this->begin(); i != this->end(); ++i) {
89  i->SetMarkerSize(i->GetMarkerSize() * size);
90  }
91  }
virtual void JROOT::JMarkerAttributes::rewind ( )
inlineoverridevirtual

Rewind index.

Implements JLANG::JRewindable< T >.

Definition at line 97 of file JMarkerAttributes.hh.

98  {
99  index = 0;
100  }
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 108 of file JMarkerAttributes.hh.

109  {
110  return !this->empty();
111  }
virtual const pointer_type& JROOT::JMarkerAttributes::next ( )
inlineoverridevirtual

Get next element.

Returns
pointer to element

Implements JLANG::JObjectIterator< T >.

Definition at line 119 of file JMarkerAttributes.hh.

120  {
121  static pointer_type ps;
122 
123  if (index < this->size()) {
124  ps.reset(&this->at(index));
125  }
126 
127  ++index;
128 
129  index = index%this->size();
130 
131  return ps;
132  }
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 141 of file JMarkerAttributes.hh.

142  {
143  return this->at(index%this->size());
144  }
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 >, and JLANG::JAbstractObjectReader< JDAQSummaryslice >.

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 148 of file JMarkerAttributes.hh.


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