38 lines
871 B
C++
38 lines
871 B
C++
|
|
#ifndef EXTRUDE_H
|
|
#define EXTRUDE_H EXTRUDE_H
|
|
|
|
#include <vector>
|
|
|
|
#include "util/Polygon.h"
|
|
#include "Shape.h"
|
|
|
|
class Extrude : public Shape
|
|
{
|
|
public:
|
|
Extrude();
|
|
IntersectionList intersect(refptr<Shape> _this, const Ray & ray);
|
|
void addPolygon(refptr<Polygon> polygon);
|
|
void addOffset(double distance,
|
|
const Vector & scale, const Vector & shift);
|
|
class Offset
|
|
{
|
|
public:
|
|
Offset(double d, const Vector & s, const Vector & p)
|
|
: distance(d), scale(s), shift(p)
|
|
{
|
|
}
|
|
double distance;
|
|
Vector scale;
|
|
Vector shift;
|
|
};
|
|
virtual refptr<Shape> clone();
|
|
|
|
protected:
|
|
std::vector< refptr<Polygon> > m_polygons;
|
|
std::vector<Offset> m_offsets;
|
|
};
|
|
|
|
#endif
|
|
|