From 9418ff6e975587c0d858f8c8b9cdc33a8209a9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 25 Feb 2012 03:27:31 +0100 Subject: [PATCH] Removed unused AbstractPrimitive class. Moved Primitives namespace documentation to doc/namespaces.dox. --- doc/namespaces.dox | 6 ++ src/Primitives/AbstractPrimitive.h | 91 ------------------------------ 2 files changed, 6 insertions(+), 91 deletions(-) delete mode 100644 src/Primitives/AbstractPrimitive.h diff --git a/doc/namespaces.dox b/doc/namespaces.dox index 8ce3f9b8f..4a7054097 100644 --- a/doc/namespaces.dox +++ b/doc/namespaces.dox @@ -4,6 +4,12 @@ Tools for generating, optimizing and cleaning meshes. */ +/** @namespace Magnum::Primitives +@brief Primitive library + +Basic primitives for testing purposes. +*/ + /** @namespace Magnum::Shaders @brief Sample shaders diff --git a/src/Primitives/AbstractPrimitive.h b/src/Primitives/AbstractPrimitive.h deleted file mode 100644 index 09bb5dd3c..000000000 --- a/src/Primitives/AbstractPrimitive.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef Magnum_Primitives_AbstractPrimitive_h -#define Magnum_Primitives_AbstractPrimitive_h -/* - Copyright © 2010, 2011, 2012 Vladimír Vondruš - - This file is part of Magnum. - - Magnum is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License version 3 - only, as published by the Free Software Foundation. - - Magnum 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 version 3 for more details. -*/ - -/** @file - * @brief Class Magnum::Primitives::AbstractPrimitive - */ - -#include "TypeTraits.h" - -#include "IndexedMesh.h" - -namespace Magnum { - -class Buffer; -class IndexedMesh; - -/** - * @brief %Primitive library - * - * Basic primitives usable for testing. - */ -namespace Primitives { - -/** -@brief Base class for primitives -@tparam _IndexType Type used for indices. Only unsigned integral types are - allowed, as TypeTraits is used to check whether given type can be used. -*/ -template class AbstractPrimitive { - public: - /** @brief Type used for indices */ - typedef typename TypeTraits<_IndexType>::IndexType IndexType; - - /** @brief Destructor */ - inline virtual ~AbstractPrimitive() {} - - /** @brief Primitive type */ - virtual Mesh::Primitive primitive() const = 0; - - /** @brief Count of vertices */ - virtual size_t vertexCount() const = 0; - - /** @brief Count of indices */ - virtual size_t indexCount() const = 0; - - /** - * @brief Build the primitive - * @param mesh Destination mesh - * @param vertexBuffer Vertex buffer where to put the data - * - * Prepares the mesh and fills the vertex and index buffer with the - * data. - * @note Subclasses should call prepareMesh() at the beginning of their - * implementation, unless the mesh is prepared another way (e.g. using - * MeshBuilder). - */ - virtual void build(IndexedMesh* mesh, Buffer* vertexBuffer) = 0; - - protected: - /** - * @brief Prepare the mesh for primitive data - * @param mesh Mesh to prepare - * - * Sets primitive type, vertex count and index count and type on the - * mesh using primitive(), vertexCount(), indexCount() and IndexType. - */ - void prepareMesh(IndexedMesh* mesh) const { - mesh->setPrimitive(primitive()); - mesh->setVertexCount(vertexCount()); - mesh->setIndexCount(indexCount()); - mesh->setIndexType(TypeTraits::glType()); - } -}; - -}} - -#endif