1 #include <QListIterator>
4 #include "util/MessageSystem.h"
6 #include "artisan/gviewport/LineObject.h"
8 Viewport::Viewport(DataStore
*dataStore
) : Artisan::GViewport::BasicViewport(dataStore
), m_dataStore(dataStore
) {
9 Message(Debug
, "Creating cpuTime Viewport instance . . .");
10 setViewport(Artisan::GViewport::Rect(1.0, 1.0));
12 Artisan::GViewport::Object
*object
= NULL
;
14 double lastTime
= 0.0;
15 double lastData
= 0.0;
17 QListIterator
<QPair
<double, double> > i
= m_dataStore
->iterator();
19 QPair
<double, double> pair
= i
.next();
21 if(lastTime
!= 0.0 || lastData
!= 0.0) {
22 object
= new Artisan::GViewport::LineObject(
23 Artisan::GViewport::Point(lastTime
, lastData
),
24 Artisan::GViewport::Point(pair
.first
, pair
.second
));
26 data()->addObject(object
);
28 lastTime
= pair
.first
;
29 lastData
= pair
.second
;
32 Artisan::GViewport::TreeType::Bound maxBound
= data()->tree().bounds();
34 setViewport(Artisan::GViewport::Rect(maxBound
.range(0).start(), maxBound
.range(0).end(), maxBound
.range(1).start(),
35 maxBound
.range(1).end()));
38 Viewport::~Viewport() {