mirror of
https://github.com/mapmapteam/mapmap.git
synced 2026-06-16 12:33:19 +02:00
Add typedefs for std::tr1::shared_ptr<*>
This commit is contained in:
@@ -27,12 +27,13 @@
|
||||
#include "Shape.h"
|
||||
#include "Mapper.h"
|
||||
|
||||
class Common {
|
||||
class Common
|
||||
{
|
||||
public:
|
||||
static std::vector< std::tr1::shared_ptr<Mapping> > mappings;
|
||||
static std::vector< std::tr1::shared_ptr<Mapper> > mappers;
|
||||
static std::tr1::shared_ptr<Mapping> currentMapping;
|
||||
static std::tr1::shared_ptr<Mapper> currentMapper;
|
||||
static std::vector<Mapping::ptr> mappings;
|
||||
static std::vector<Mapper::ptr> mappers;
|
||||
static Mapping::ptr currentMapping;
|
||||
static Mapper::ptr currentMapper;
|
||||
|
||||
static int currentSourceIdx;
|
||||
|
||||
@@ -41,7 +42,10 @@ public:
|
||||
static void initializeLibremapper(int frameWidth, int frameHeight);
|
||||
static void nextImage();
|
||||
|
||||
static int nImages() { return mappings.size(); }
|
||||
static int nImages()
|
||||
{
|
||||
return mappings.size();
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* COMMON_H_ */
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
void QuadTextureMapper::draw()
|
||||
{
|
||||
// FIXME: use typedefs, member of the class for type names that are too long to type:
|
||||
std::tr1::shared_ptr<TextureMapping> textureMapping = std::tr1::static_pointer_cast<TextureMapping>(_mapping);
|
||||
Q_CHECK_PTR(textureMapping);
|
||||
|
||||
|
||||
@@ -22,26 +22,23 @@
|
||||
#define MAPPER_H_
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#include "Shape.h"
|
||||
#include "Paint.h"
|
||||
|
||||
#include "Util.h"
|
||||
|
||||
#include <tr1/memory>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <SOIL/SOIL.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "Shape.h"
|
||||
#include "Paint.h"
|
||||
#include "Util.h"
|
||||
|
||||
class Mapping
|
||||
{
|
||||
protected:
|
||||
std::tr1::shared_ptr<Paint> _paint;
|
||||
std::tr1::shared_ptr<Shape> _shape;
|
||||
Paint::ptr _paint;
|
||||
Shape::ptr _shape;
|
||||
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Mapping> ptr;
|
||||
Mapping(Paint* paint, Shape* shape)
|
||||
: _paint(paint), _shape(shape)
|
||||
{}
|
||||
@@ -52,14 +49,14 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
std::tr1::shared_ptr<Paint> getPaint() const { return _paint; }
|
||||
std::tr1::shared_ptr<Shape> getShape() const { return _shape; }
|
||||
Paint::ptr getPaint() const { return _paint; }
|
||||
Shape::ptr getShape() const { return _shape; }
|
||||
};
|
||||
|
||||
class TextureMapping : public Mapping
|
||||
{
|
||||
private:
|
||||
std::tr1::shared_ptr<Shape> _inputShape;
|
||||
Shape::ptr _inputShape;
|
||||
|
||||
public:
|
||||
TextureMapping(Paint* paint,
|
||||
@@ -74,17 +71,18 @@ public:
|
||||
_inputShape->build();
|
||||
}
|
||||
public:
|
||||
std::tr1::shared_ptr<Shape> getInputShape() const { return _inputShape; }
|
||||
Shape::ptr getInputShape() const { return _inputShape; }
|
||||
};
|
||||
|
||||
class Mapper
|
||||
{
|
||||
protected:
|
||||
std::tr1::shared_ptr<Mapping> _mapping;
|
||||
Mapping::ptr _mapping;
|
||||
Mapper(Mapping* mapping) : _mapping(mapping) {}
|
||||
virtual ~Mapper() {}
|
||||
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Mapper> ptr;
|
||||
virtual void draw() = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,16 +23,16 @@
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtOpenGL>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <tr1/memory>
|
||||
|
||||
class Paint
|
||||
{
|
||||
protected:
|
||||
Paint() {}
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Paint> ptr;
|
||||
virtual ~Paint() {}
|
||||
virtual void build() {}
|
||||
};
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define SHAPE_H_
|
||||
|
||||
#include <vector>
|
||||
#include <tr1/memory>
|
||||
|
||||
struct Point
|
||||
{
|
||||
@@ -32,9 +33,12 @@ struct Point
|
||||
class Shape
|
||||
{
|
||||
public:
|
||||
typedef std::tr1::shared_ptr<Shape> ptr;
|
||||
std::vector<Point> vertices;
|
||||
Shape() {}
|
||||
Shape(std::vector<Point> vertices_) : vertices(vertices_) {}
|
||||
Shape(std::vector<Point> vertices_) :
|
||||
vertices(vertices_)
|
||||
{}
|
||||
virtual ~Shape() {}
|
||||
|
||||
virtual void build() {}
|
||||
|
||||
Reference in New Issue
Block a user