Jpp  18.6.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
JROOT::JCanvas Class Reference

Data structure for size of TCanvas. More...

#include <JCanvas.hh>

Public Member Functions

 JCanvas ()
 Default constructor. More...
 
 JCanvas (const int __x, const int __y)
 Constructor. More...
 

Public Attributes

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

Static Public Attributes

static const char SEPARATOR = 'x'
 

Friends

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

Detailed Description

Data structure for size of TCanvas.

Definition at line 26 of file JCanvas.hh.

Constructor & Destructor Documentation

JROOT::JCanvas::JCanvas ( )
inline

Default constructor.

Definition at line 31 of file JCanvas.hh.

31  :
32  x(500),
33  y(500)
34  {}
int y
number of pixels in Y
Definition: JCanvas.hh:99
int x
number of pixels in X
Definition: JCanvas.hh:98
JROOT::JCanvas::JCanvas ( const int  __x,
const int  __y 
)
inline

Constructor.

Parameters
__xwidth
__yheight

Definition at line 43 of file JCanvas.hh.

44  :
45  x(__x),
46  y(__y)
47  {}
int y
number of pixels in Y
Definition: JCanvas.hh:99
int x
number of pixels in X
Definition: JCanvas.hh:98

Friends And Related Function Documentation

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

Read canvas from input stream.

Parameters
ininput stream
cvcanvas
Returns
input stream

Definition at line 57 of file JCanvas.hh.

58  {
59  using namespace std;
60 
61  string buffer;
62 
63  getline(in,buffer);
64 
65  size_t pos = buffer.find(SEPARATOR);
66 
67  if (pos != string::npos) {
68 
69  if (!(istringstream(buffer.substr(0,pos)) >> cv.x)) { in.setstate(ios::badbit); }
70  if (!(istringstream(buffer.substr(pos+1)) >> cv.y)) { in.setstate(ios::badbit); }
71 
72  } else {
73 
74  THROW(JParseError, "JCanvas error parsing " << buffer);
75  }
76 
77  return in;
78  }
int y
number of pixels in Y
Definition: JCanvas.hh:99
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:478
static const char SEPARATOR
Definition: JCanvas.hh:96
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
int x
number of pixels in X
Definition: JCanvas.hh:98
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 88 of file JCanvas.hh.

89  {
90  out << cv.x << SEPARATOR << cv.y;
91 
92  return out;
93  }
int y
number of pixels in Y
Definition: JCanvas.hh:99
static const char SEPARATOR
Definition: JCanvas.hh:96
int x
number of pixels in X
Definition: JCanvas.hh:98

Member Data Documentation

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

Definition at line 96 of file JCanvas.hh.

int JROOT::JCanvas::x

number of pixels in X

Definition at line 98 of file JCanvas.hh.

int JROOT::JCanvas::y

number of pixels in Y

Definition at line 99 of file JCanvas.hh.


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