Jpp 21.0.0-rc.1-88-g0130508c4
the software that should make you happy
Loading...
Searching...
No Matches
JROOT::JCanvas Class Reference

Data structure for size of TCanvas. More...

#include <JCanvas.hh>

Public Member Functions

 JCanvas ()
 Default constructor.
 
 JCanvas (const int x, const int y)
 Constructor.
 

Public Attributes

int x
 number of pixels in X
 
int y
 number of pixels in Y
 

Static Public Attributes

static const char SEPARATOR = 'x'
 

Friends

std::istream & operator>> (std::istream &in, JCanvas &cv)
 Read canvas from input stream.
 
std::ostream & operator<< (std::ostream &out, const JCanvas &cv)
 Write canvas to output stream.
 

Detailed Description

Data structure for size of TCanvas.

Definition at line 21 of file JCanvas.hh.

Constructor & Destructor Documentation

◆ JCanvas() [1/2]

JROOT::JCanvas::JCanvas ( )
inline

Default constructor.

Definition at line 29 of file JCanvas.hh.

29 :
30 x(500),
31 y(500)
32 {}
int y
number of pixels in Y
Definition JCanvas.hh:95
int x
number of pixels in X
Definition JCanvas.hh:94

◆ JCanvas() [2/2]

JROOT::JCanvas::JCanvas ( const int x,
const int y )
inline

Constructor.

Parameters
xwidth
yheight

Definition at line 41 of file JCanvas.hh.

42 :
43 x(x),
44 y(y)
45 {}

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
JCanvas & cv )
friend

Read canvas from input stream.

Parameters
ininput stream
cvcanvas
Returns
input stream

Definition at line 55 of file JCanvas.hh.

56 {
57 using namespace std;
58
59 string buffer;
60
61 getline(in,buffer);
62
63 size_t pos = buffer.find(SEPARATOR);
64
65 if (pos != string::npos) {
66
67 if (!(istringstream(buffer.substr(0,pos)) >> cv.x)) { in.setstate(ios::badbit); }
68 if (!(istringstream(buffer.substr(pos+1)) >> cv.y)) { in.setstate(ios::badbit); }
69
70 } else {
71
72 in.setstate(ios::badbit);
73 }
74
75 return in;
76 }
static const char SEPARATOR
Definition JCanvas.hh:24
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition JString.hh:478

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JCanvas & cv )
friend

Write canvas to output stream.

Parameters
outoutput stream
cvcanvas
Returns
output stream

Definition at line 86 of file JCanvas.hh.

87 {
88 out << cv.x << SEPARATOR << cv.y;
89
90 return out;
91 }

Member Data Documentation

◆ SEPARATOR

const char JROOT::JCanvas::SEPARATOR = 'x'
static

Definition at line 24 of file JCanvas.hh.

◆ x

int JROOT::JCanvas::x

number of pixels in X

Definition at line 94 of file JCanvas.hh.

◆ y

int JROOT::JCanvas::y

number of pixels in Y

Definition at line 95 of file JCanvas.hh.


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