From c883f50f90d6f0fcfa3bee94e974ede149c35ca6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 24 Dec 2009 20:38:40 +0100 Subject: Refactored TriangleRecord --- src/TriangleRecord.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/TriangleRecord.h (limited to 'src/TriangleRecord.h') diff --git a/src/TriangleRecord.h b/src/TriangleRecord.h new file mode 100644 index 0000000..13b3248 --- /dev/null +++ b/src/TriangleRecord.h @@ -0,0 +1,58 @@ +/* + * TriangleRecord.h + * + * Copyright (C) 2009 Matthias Schiffer + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License along + * with this program. If not, see . + */ + +#ifndef ZOOM_TRIANGLERECORD_H_ +#define ZOOM_TRIANGLERECORD_H_ + +#include "Triangle.h" + +#include + +namespace Zoom { + +class TriangleRecord { + public: + class TriangleData { + protected: + TriangleData() {} + + public: + virtual ~TriangleData() {} + }; + + TriangleRecord(const Triangle& triangle0, boost::shared_ptr data0) + : triangle(triangle0), data(data0) {} + TriangleRecord(const Triangle& triangle0) : triangle(triangle0) {} + TriangleRecord() {} + + const Triangle& getTriangle() const {return triangle;} + Triangle& getTriangle() {return triangle;} + void setTriangle(const Triangle &t) {triangle = t;} + + boost::shared_ptr getData() const {return data;} + void setData(boost::shared_ptr d) {data = d;} + + private: + Triangle triangle; + boost::shared_ptr data; +}; + +} + +#endif /* ZOOM_TRIANGLERECORD_H_ */ -- cgit v1.2.3