PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
validator/PlatformDrawObject.cpp
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: platforms/validator/PlatformDrawObject.cpp
4// Purpose: Validator Platform Drawing Primitives Implementation
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2025 Shane T. Mueller <smueller@obereed.net>
7// License: GPL 2
8//
9// This file is part of the PEBL project.
10//
11// PEBL is free software; you can redistribute it and/or modify
12// it under the terms of the GNU General Public License as published by
13// the Free Software Foundation; either version 2 of the License, or
14// (at your option) any later version.
15//
16// PEBL is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19// GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with PEBL; if not, write to the Free Software
23// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25#include "PlatformDrawObject.h"
26
27// All drawing primitives are stubs for validator - no actual rendering
28
29PlatformLine::PlatformLine(int x1, int y1, int dx, int dy, Variant fg)
30 : PLine(x1, y1, dx, dy, fg) {}
32bool PlatformLine::Draw() { return true; }
33std::ostream& PlatformLine::SendToStream(std::ostream& out) const {
34 out << "PlatformLine (validator)"; return out;
35}
36
37PlatformThickLine::PlatformThickLine(int x1, int y1, int x2, int y2, int width, Variant fg)
38 : PThickLine(x1, y1, x2, y2, width, fg) {}
40bool PlatformThickLine::Draw() { return true; }
41std::ostream& PlatformThickLine::SendToStream(std::ostream& out) const {
42 out << "PlatformThickLine (validator)"; return out;
43}
44
45PlatformRectangle::PlatformRectangle(int x1, int y1, int dx, int dy, Variant fg, bool filled)
46 : PRectangle(x1, y1, dx, dy, fg, filled) {}
48bool PlatformRectangle::Draw() { return true; }
49std::ostream& PlatformRectangle::SendToStream(std::ostream& out) const {
50 out << "PlatformRectangle (validator)"; return out;
51}
52
53PlatformSquare::PlatformSquare(int x, int y, int size, Variant fg, bool filled)
54 : PSquare(x, y, size, fg, filled) {}
56bool PlatformSquare::Draw() { return true; }
57std::ostream& PlatformSquare::SendToStream(std::ostream& out) const {
58 out << "PlatformSquare (validator)"; return out;
59}
60
61PlatformEllipse::PlatformEllipse(int x1, int y1, int rx, int ry, Variant fg, bool filled)
62 : PEllipse(x1, y1, rx, ry, fg, filled) {}
64bool PlatformEllipse::Draw() { return true; }
65std::ostream& PlatformEllipse::SendToStream(std::ostream& out) const {
66 out << "PlatformEllipse (validator)"; return out;
67}
68
69PlatformCircle::PlatformCircle(int x1, int y1, int r, Variant fg, bool filled)
70 : PCircle(x1, y1, r, fg, filled) {}
72bool PlatformCircle::Draw() { return true; }
73std::ostream& PlatformCircle::SendToStream(std::ostream& out) const {
74 out << "PlatformCircle (validator)"; return out;
75}
76
77PlatformPolygon::PlatformPolygon(int x, int y, Variant xpoints, Variant ypoints, Variant fg, bool filled)
78 : PPolygon(x, y, xpoints, ypoints, fg, filled) {}
80bool PlatformPolygon::Draw() { return true; }
81std::ostream& PlatformPolygon::SendToStream(std::ostream& out) const {
82 out << "PlatformPolygon (validator)"; return out;
83}
84
85PlatformBezier::PlatformBezier(int x, int y, Variant xpoints, Variant ypoints, int steps, Variant fg)
86 : PBezier(x, y, xpoints, ypoints, steps, fg) {}
88bool PlatformBezier::Draw() { return true; }
89std::ostream& PlatformBezier::SendToStream(std::ostream& out) const {
90 out << "PlatformBezier (validator)"; return out;
91}
virtual bool Draw()
This method initiates everything needed to display the main window
PlatformBezier(int x, int y, Variant xpoints, Variant ypoints, int steps, Variant fg)
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
PlatformCircle(int x1, int y1, int r, Variant fg, bool filled)
virtual bool Draw()
This method initiates everything needed to display the main window
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
virtual bool Draw()
This method initiates everything needed to display the main window
PlatformEllipse(int x1, int y1, int dx, int dy, Variant fg, bool filled)
virtual bool Draw()
This method initiates everything needed to display the main window
PlatformLine(int x1, int y1, int dx, int dy, Variant fg)
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
PlatformPolygon(int x, int y, Variant xpoints, Variant ypoints, Variant fg, bool filled)
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
virtual bool Draw()
This method initiates everything needed to display the main window
virtual bool Draw()
This method initiates everything needed to display the main window
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
PlatformRectangle(int x1, int y1, int dx, int dy, Variant fg, bool filled)
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
PlatformSquare(int x, int y, int size, Variant fg, bool filled)
virtual bool Draw()
This method initiates everything needed to display the main window
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
PlatformThickLine(int x1, int y1, int x2, int y2, int width, Variant fg)
virtual bool Draw()
This method initiates everything needed to display the main window