public:
Negation(const Shape<T, D> &);
+ Negation(const Negation &);
+ Negation &operator=(const Negation &);
+ ~Negation();
virtual Negation *clone() const;
shape(s.clone())
{ }
+template<typename T, unsigned D>
+inline Negation<T, D>::Negation(const Negation<T, D> &other):
+ shape(other.shape->clone())
+{ }
+
+template<typename T, unsigned D>
+inline Negation<T, D> &Negation<T, D>::operator=(const Negation<T, D> &other)
+{
+ delete shape;
+ shape = other.shape->clone();
+ return *this;
+}
+
+template<typename T, unsigned D>
+inline Negation<T, D>::~Negation()
+{
+ delete shape;
+}
+
template<typename T, unsigned D>
inline Negation<T, D> *Negation<T, D>::clone() const
{
{
unsigned count = shape->get_intersections(ray, points, size);
for(unsigned i=0; i<count; ++i)
+ {
points[i].normal = -points[i].normal;
+ points[i].entry = !points[i].entry;
+ }
return count;
}