/* template.h -*-C++-*- * by Will Wagner * last updated 12 Aug 1997, 18:00:08 wwagner * * This file is the generic header file for any added object types. * The only thing that needs to happen is to change all instances of * the string `template' in this file to whatever the object name * actually is. Private methods and new data members will also need * to be added here, of course. * * The intersection test counters are protected (instead of private) * in case a derivative class needs to also use the same ones. Add * other counters as needed. * * Changes * 23 Jul 1997 * - Created the file. * * 28 Jul 1997 * - Moved the token definitions into this file; other minor changes. * * 29 Jul 1997 * - Got rid of the Destroy method, since delete will work just as * well; removed the static Register_Objects method, and made it a * static function in the implementation file; corrected the * Transform method's signature; added intersection test counters; * added statistics method. * * 11 Aug 1997 * - Minor changes. * * Things to do * - Make sure all the method arguments are correct. * */ #ifndef __INC_TEMPLATE_H__ #define __INC_TEMPLATE_H__ #include "object.h" /* Any new keyword tokens need to be defined here. */ #define TEMPLATE_TOKEN 999 class Template : public Object { private: protected: /* intersection test counters */ static Counter template_tests, template_test_successes; public: Template(void); Template(const Template&); virtual ~Template(void); static Object *Parse(Parser&); static void Stats(void); virtual int All_Intersections(Ray&, IStack&); virtual int Inside(pov_vector&) const; virtual pov_vector Normal(Intersection&) const; virtual Object* Copy(void) const; virtual void Translate(pov_vector&, Transformation&); virtual void Rotate(pov_vector&, Transformation&); virtual void Scale(pov_vector&, Transformation&); virtual void Transform(Transformation&); virtual void Invert(void); }; #endif /* __INC_TEMPLATE_H__ */