mirror of https://github.com/mosra/magnum.git
2 changed files with 6 additions and 81 deletions
@ -1,81 +0,0 @@
|
||||
#ifndef Magnum_MeshTools_AbstractTool_h |
||||
#define Magnum_MeshTools_AbstractTool_h |
||||
/*
|
||||
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
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::MeshTools::AbstractTool |
||||
*/ |
||||
|
||||
#include "MeshBuilder.h" |
||||
|
||||
namespace Magnum { |
||||
|
||||
/**
|
||||
* @brief %Mesh tools |
||||
* |
||||
* Tools for generating, optimizing and cleaning meshes. |
||||
*/ |
||||
namespace MeshTools { |
||||
|
||||
/**
|
||||
* @brief Base class for mesh tools |
||||
* |
||||
* Provides access to internals of MeshBuilder instance for subclasses. See |
||||
* also AbstractIndexTool. |
||||
*/ |
||||
template<class Vertex> class AbstractTool { |
||||
public: |
||||
/**
|
||||
* @brief Constructor |
||||
* @param builder %Mesh builder to operate on |
||||
*/ |
||||
inline AbstractTool(MeshBuilder<Vertex>& builder): builder(builder), vertices(builder._vertices), indices(builder._indices) {} |
||||
|
||||
protected: |
||||
MeshBuilder<Vertex>& builder; /**< @brief Builder instance */ |
||||
std::vector<Vertex>& vertices; /**< @brief Builder vertices */ |
||||
std::vector<unsigned int>& indices; /**< @brief Builder indices */ |
||||
}; |
||||
|
||||
/**
|
||||
* @brief Base class for mesh tools operating only on indices |
||||
* |
||||
* Provides access only to index array and vertex count. See also |
||||
* AbstractTool. |
||||
*/ |
||||
class MAGNUM_EXPORT AbstractIndexTool { |
||||
public: |
||||
/**
|
||||
* @brief Constructor |
||||
* @param builder %Mesh builder to operate on |
||||
*/ |
||||
template<class Vertex> inline AbstractIndexTool(MeshBuilder<Vertex>& builder): indices(builder._indices), vertexCount(builder.vertexCount()) {} |
||||
|
||||
/**
|
||||
* @brief Constructor |
||||
* @param indices Indices array to operate on |
||||
* @param vertexCount Vertex count |
||||
*/ |
||||
inline AbstractIndexTool(std::vector<unsigned int>& indices, unsigned int vertexCount): indices(indices), vertexCount(vertexCount) {} |
||||
|
||||
protected: |
||||
std::vector<unsigned int>& indices; /**< @brief Builder indices */ |
||||
const unsigned int vertexCount; /**< @brief Count of builder vertices */ |
||||
}; |
||||
|
||||
}} |
||||
|
||||
#endif |
||||
Loading…
Reference in new issue