Skip to content
Snippets Groups Projects
Commit 6d6d8c3b authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Remove macro BASE

parent 15519bb5
No related branches found
No related tags found
No related merge requests found
......@@ -60,9 +60,6 @@ template <typename T> struct mut_typ<T const> { typedef T typ; };
#define for_i(n) for_int (i, n)
// typedef for a base class
#define BASE(cls) using base = cls;
//------------------------------------------------------------------------------
// coordinates
......
......@@ -15,11 +15,9 @@
#include "layer.h"
namespace ba3d {
//------------------------------------------------------------------------------
Layer::Layer(dxyz d) : base(geometry::key(geometry::eid::Box)) {
Layer::Layer(dxyz d) : Object(geometry::key(geometry::eid::Box)) {
transform(d.size(), xyz::_0, d.mid());
}
//------------------------------------------------------------------------------
}
......@@ -21,7 +21,8 @@ namespace ba3d {
//------------------------------------------------------------------------------
// particle layer: a transparent box
class Layer : public Object { BASE(Object)
class Layer : public Object
{
public:
Layer(dxyz);
};
......
......@@ -34,19 +34,19 @@ QString const& name(kind k) {
using namespace geometry;
Particle::Particle(key key) : base(key), scale(xyz::_1) {}
Particle::Particle(key key) : Object(key), scale(xyz::_1) {}
void Particle::set() {
transform(xyz::_0, xyz::_0);
}
void Particle::transform(xyz rotate_, xyz translate_) {
base::transform(turn, scale,
Object::transform(turn, scale,
(rotate = rotate_), offset + (translate = translate_));
}
void Particle::fancy(xyz rotate, flt r) {
base::transform(turn, scale*r, rotate, offset + translate);
Object::transform(turn, scale*r, rotate, offset + translate);
}
//------------------------------------------------------------------------------
......
......@@ -32,7 +32,8 @@ QString const& name(kind);
//------------------------------------------------------------------------------
class Particle : public Object { BASE(Object)
class Particle : public Object
{
protected:
Particle(geometry::key);
xyz turn, // turn before scale
......
......@@ -29,7 +29,6 @@ class Camera; class Program; class Model;
class Geometry; class Buffer; class Object;
class Canvas: public QOpenGLWidget, protected QOpenGLFunctions {
BASE(QOpenGLWidget)
Q_OBJECT
friend class Object;
public:
......
......@@ -24,7 +24,8 @@ namespace ba3d {
class Camera;
class Canvas;
class Program: public QOpenGLShaderProgram { BASE(QOpenGLShaderProgram)
class Program: public QOpenGLShaderProgram
{
friend class Canvas;
public:
Program();
......
......@@ -26,7 +26,8 @@ class Canvas;
class Camera;
class Program;
class Widget3D : public QWidget { BASE(QWidget)
class Widget3D : public QWidget
{
Q_OBJECT
public:
Widget3D();
......
......@@ -21,7 +21,8 @@
//------------------------------------------------------------------------------
class App : public QApplication { BASE(QApplication)
class App : public QApplication
{
public:
App(int& argc, char* argv[]);
~App();
......@@ -29,7 +30,7 @@ public:
int exec();
};
App::App(int& argc, char* argv[]) : base(argc, argv) {
App::App(int& argc, char* argv[]) : QApplication(argc, argv) {
setOrganizationName("c53");
setApplicationName("ba3d");
}
......@@ -43,7 +44,7 @@ int App::exec() {
QScopedPointer<DemoModel> model(new DemoModel);
win.widg3t().setModel(model.data());
return base::exec();
return QApplication::exec();
}
//------------------------------------------------------------------------------
......
......@@ -24,7 +24,8 @@
class QSlider;
class MainWin : public QMainWindow { BASE(QMainWindow)
class MainWin : public QMainWindow
{
Q_OBJECT
public:
MainWin();
......
......@@ -22,7 +22,8 @@
//------------------------------------------------------------------------------
class App : public QApplication { BASE(QApplication)
class App : public QApplication
{
public:
App(int& argc, char* argv[]);
~App();
......@@ -30,7 +31,7 @@ public:
int exec();
};
App::App(int& argc, char* argv[]) : base(argc, argv) {
App::App(int& argc, char* argv[]) : QApplication(argc, argv) {
setOrganizationName("c53");
setApplicationName("ba3d");
}
......@@ -57,7 +58,7 @@ int App::exec() {
ml->showKind(kind); ms->showKind(kind);
});
return base::exec();
return QApplication::exec();
}
//------------------------------------------------------------------------------
......
......@@ -23,8 +23,9 @@
class QComboBox;
class MainWin : public QMainWindow { BASE(QMainWindow)
Q_OBJECT
class MainWin : public QMainWindow
{
Q_OBJECT
public:
MainWin();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment