COPASI API  4.16.103
Public Member Functions | Public Attributes | Private Attributes | List of all members
Bar Class Reference

#include <qwt3dBars.h>

Inheritance diagram for Bar:
Inheritance graph
[legend]
Collaboration diagram for Bar:
Collaboration graph
[legend]

Public Member Functions

 Bar ()
 
 Bar (double rad, double showColumn=-1, double showRow=-1)
 
Qwt3D::Enrichment * clone () const
 
void configure (double rad, double showColumn, double showRow)
 
void draw (Qwt3D::Triple const &)
 
void drawBegin ()
 
void drawEnd ()
 
void drawZero ()
 
virtual ~Bar ()
 

Public Attributes

double mShowColumn
 
double mShowRow
 

Private Attributes

double diag_
 
double level_
 
double radius_
 

Detailed Description

Definition at line 23 of file qwt3dBars.h.

Constructor & Destructor Documentation

Bar::Bar ( )

Definition at line 22 of file qwt3dBars.cpp.

References configure().

Referenced by clone().

23 {
24  configure(0, -1, -1);
25 }
void configure(double rad, double showColumn, double showRow)
Definition: qwt3dBars.cpp:36
Bar::Bar ( double  rad,
double  showColumn = -1,
double  showRow = -1 
)

Definition at line 27 of file qwt3dBars.cpp.

References configure().

28 {
29  configure(rad, showColumn, showRow);
30 }
void configure(double rad, double showColumn, double showRow)
Definition: qwt3dBars.cpp:36
Bar::~Bar ( )
virtual

Definition at line 33 of file qwt3dBars.cpp.

34 {}

Member Function Documentation

Qwt3D::Enrichment* Bar::clone ( ) const
inline

Definition at line 30 of file qwt3dBars.h.

References Bar().

30 {return new Bar(*this);}
Bar()
Definition: qwt3dBars.cpp:22
void Bar::configure ( double  rad,
double  showColumn,
double  showRow 
)

Definition at line 36 of file qwt3dBars.cpp.

References mShowColumn, mShowRow, and radius_.

Referenced by Bar().

37 {
38  plot = 0;
39  radius_ = rad;
40  mShowColumn = showColumn;
41  mShowRow = showRow;
42 }
double mShowColumn
Definition: qwt3dBars.h:37
double mShowRow
Definition: qwt3dBars.h:38
double radius_
Definition: qwt3dBars.h:40
void Bar::draw ( Qwt3D::Triple const &  pos)

Definition at line 56 of file qwt3dBars.cpp.

References diag_, mShowColumn, and mShowRow.

57 {
58  Qwt3D::GLStateBewarer sb(GL_LINE_SMOOTH, true);
59  sb.turnOn();
60 
61  //an option to add further labels
62  // if ((pos.x == mShowColumn) || (pos.y == mShowRow))
63  // {
64  // Label3D lb;
65  // lb.draw(pos, diag_, diag_ * 2);
66  //}
67 
68  // set the zero level
69  GLdouble minz = 0; //plot->hull().minVertex.z;
70 
71  Qwt3D::RGBA mTo = (*plot->dataColor())(pos);
72  Qwt3D::RGBA mFrom = (*plot->dataColor())(pos.x, pos.y, minz);
73 
74  glBegin(GL_QUADS);
75 
76  if (((int)(100 * pos.x) == (int)(100 * mShowColumn)) || ((int)(100 * pos.y) == (int)(100 * mShowRow)))
77  glColor3d(0.71, 0.835, 1); //(1, 0, 0);
78  else
79  glColor4d(mTo.r, mTo.g, mTo.b, mTo.a);
80 
81  //glColor4d(mFrom.r, mFrom.g, mFrom.b, mFrom.a);
82  glVertex3d(pos.x - diag_, pos.y - diag_, minz);
83  glVertex3d(pos.x + diag_, pos.y - diag_, minz);
84  glVertex3d(pos.x + diag_, pos.y + diag_, minz);
85  glVertex3d(pos.x - diag_, pos.y + diag_, minz);
86 
87  if (((int)(100 * pos.x) == (int)(100 * mShowColumn)) || ((int)(100 * pos.y) == (int)(100 * mShowRow)))
88  glColor3d(0.71, 0.835, 1); //(1, 0, 0);
89  else
90  glColor4d(mTo.r, mTo.g, mTo.b, mTo.a);
91 
92  glVertex3d(pos.x - diag_, pos.y - diag_, pos.z);
93  glVertex3d(pos.x + diag_, pos.y - diag_, pos.z);
94  glVertex3d(pos.x + diag_, pos.y + diag_, pos.z);
95  glVertex3d(pos.x - diag_, pos.y + diag_, pos.z);
96 
97  glColor4d(mFrom.r, mFrom.g, mFrom.b, mFrom.a);
98  glVertex3d(pos.x - diag_, pos.y - diag_, minz);
99  glVertex3d(pos.x + diag_, pos.y - diag_, minz);
100  glColor4d(mTo.r, mTo.g, mTo.b, mTo.a);
101  glVertex3d(pos.x + diag_, pos.y - diag_, pos.z);
102  glVertex3d(pos.x - diag_, pos.y - diag_, pos.z);
103 
104  glColor4d(mFrom.r, mFrom.g, mFrom.b, mFrom.a);
105  glVertex3d(pos.x - diag_, pos.y + diag_, minz);
106  glVertex3d(pos.x + diag_, pos.y + diag_, minz);
107  glColor4d(mTo.r, mTo.g, mTo.b, mTo.a);
108  glVertex3d(pos.x + diag_, pos.y + diag_, pos.z);
109  glVertex3d(pos.x - diag_, pos.y + diag_, pos.z);
110 
111  glColor4d(mFrom.r, mFrom.g, mFrom.b, mFrom.a);
112  glVertex3d(pos.x - diag_, pos.y - diag_, minz);
113  glVertex3d(pos.x - diag_, pos.y + diag_, minz);
114  glColor4d(mTo.r, mTo.g, mTo.b, mTo.a);
115  glVertex3d(pos.x - diag_, pos.y + diag_, pos.z);
116  glVertex3d(pos.x - diag_, pos.y - diag_, pos.z);
117 
118  glColor4d(mFrom.r, mFrom.g, mFrom.b, mFrom.a);
119  glVertex3d(pos.x + diag_, pos.y - diag_, minz);
120  glVertex3d(pos.x + diag_, pos.y + diag_, minz);
121  glColor4d(mTo.r, mTo.g, mTo.b, mTo.a);
122  glVertex3d(pos.x + diag_, pos.y + diag_, pos.z);
123  glVertex3d(pos.x + diag_, pos.y - diag_, pos.z);
124  glEnd();
125 
126  glColor3d(0, 0, 0);
127  glBegin(GL_LINES);
128  glVertex3d(pos.x - diag_, pos.y - diag_, minz); glVertex3d(pos.x + diag_, pos.y - diag_, minz);
129  glVertex3d(pos.x - diag_, pos.y - diag_, pos.z); glVertex3d(pos.x + diag_, pos.y - diag_, pos.z);
130  glVertex3d(pos.x - diag_, pos.y + diag_, pos.z); glVertex3d(pos.x + diag_, pos.y + diag_, pos.z);
131  glVertex3d(pos.x - diag_, pos.y + diag_, minz); glVertex3d(pos.x + diag_, pos.y + diag_, minz);
132 
133  glVertex3d(pos.x - diag_, pos.y - diag_, minz); glVertex3d(pos.x - diag_, pos.y + diag_, minz);
134  glVertex3d(pos.x + diag_, pos.y - diag_, minz); glVertex3d(pos.x + diag_, pos.y + diag_, minz);
135  glVertex3d(pos.x + diag_, pos.y - diag_, pos.z); glVertex3d(pos.x + diag_, pos.y + diag_, pos.z);
136  glVertex3d(pos.x - diag_, pos.y - diag_, pos.z); glVertex3d(pos.x - diag_, pos.y + diag_, pos.z);
137 
138  glVertex3d(pos.x - diag_, pos.y - diag_, minz); glVertex3d(pos.x - diag_, pos.y - diag_, pos.z);
139  glVertex3d(pos.x + diag_, pos.y - diag_, minz); glVertex3d(pos.x + diag_, pos.y - diag_, pos.z);
140  glVertex3d(pos.x + diag_, pos.y + diag_, minz); glVertex3d(pos.x + diag_, pos.y + diag_, pos.z);
141  glVertex3d(pos.x - diag_, pos.y + diag_, minz); glVertex3d(pos.x - diag_, pos.y + diag_, pos.z);
142  glEnd();
143 }
double diag_
Definition: qwt3dBars.h:41
double mShowColumn
Definition: qwt3dBars.h:37
double mShowRow
Definition: qwt3dBars.h:38
void Bar::drawBegin ( )

Definition at line 44 of file qwt3dBars.cpp.

References diag_, drawZero(), and radius_.

45 {
46  drawZero();
47  diag_ = radius_;
48  glLineWidth(0);
49  glEnable(GL_POLYGON_OFFSET_FILL);
50  glPolygonOffset(1, 1);
51 }
double diag_
Definition: qwt3dBars.h:41
void drawZero()
Definition: qwt3dBars.cpp:145
double radius_
Definition: qwt3dBars.h:40
void Bar::drawEnd ( )

Definition at line 53 of file qwt3dBars.cpp.

54 {}
void Bar::drawZero ( )

Definition at line 145 of file qwt3dBars.cpp.

Referenced by drawBegin().

146 {
147  glColor3d(0, 0, 0);
148  glBegin(GL_LINE_LOOP);
149  glVertex3d(plot->hull().minVertex.x, plot->hull().minVertex.y, 0);
150  glVertex3d(plot->hull().maxVertex.x, plot->hull().minVertex.y, 0);
151  glVertex3d(plot->hull().maxVertex.x, plot->hull().maxVertex.y, 0);
152  glVertex3d(plot->hull().minVertex.x, plot->hull().maxVertex.y, 0);
153  glEnd();
154 }

Member Data Documentation

double Bar::diag_
private

Definition at line 41 of file qwt3dBars.h.

Referenced by draw(), and drawBegin().

double Bar::level_
private

Definition at line 40 of file qwt3dBars.h.

double Bar::mShowColumn

Definition at line 37 of file qwt3dBars.h.

Referenced by configure(), and draw().

double Bar::mShowRow

Definition at line 38 of file qwt3dBars.h.

Referenced by configure(), and draw().

double Bar::radius_
private

Definition at line 40 of file qwt3dBars.h.

Referenced by configure(), and drawBegin().


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