Commit 2d27d912 authored by Mike Kremer's avatar Mike Kremer

Added new files with new headers and namespacce

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@13 66977474-1d4b-4f09-8fe9-267525286df2
parent b4439443
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenVolumeMesh. *
* *
* OpenVolumeMesh 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 with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenVolumeMesh 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 LesserGeneral Public *
* License along with OpenVolumeMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#include "OpenVolumeMeshBaseKernel.hh" #include "OpenVolumeMeshBaseKernel.hh"
namespace OpenVolumeMesh {
void OpenVolumeMeshBaseKernel::property_stats(std::ostream& _ostr) const { void OpenVolumeMeshBaseKernel::property_stats(std::ostream& _ostr) const {
const OpenVolumeMeshPropertyContainer::Properties& vps = const OpenVolumeMeshPropertyContainer::Properties& vps =
vprops_.properties(); vprops_.properties();
...@@ -223,3 +267,5 @@ void OpenVolumeMeshBaseKernel::mprop_stats(std::ostream& _ostr) const { ...@@ -223,3 +267,5 @@ void OpenVolumeMeshBaseKernel::mprop_stats(std::ostream& _ostr) const {
*it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats( *it == NULL ? (void) (_ostr << "[deleted]" << "\n") : (*it)->stats(
_ostr); _ostr);
} }
} // Namespace OpenVolumeMesh
//============================================================================= /*===========================================================================*\
// * *
// CLASS OpenVolumeMeshBaseKernel * OpenVolumeMesh *
// * Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
//============================================================================= * www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenVolumeMesh. *
* *
* OpenVolumeMesh 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 with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenVolumeMesh 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 LesserGeneral Public *
* License along with OpenVolumeMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#ifndef OPENVOLUMEMESHBASEKERNEL_HH #ifndef OPENVOLUMEMESHBASEKERNEL_HH
#define OPENVOLUMEMESHBASEKERNEL_HH #define OPENVOLUMEMESHBASEKERNEL_HH
...@@ -19,6 +54,8 @@ ...@@ -19,6 +54,8 @@
#include "OpenVolumeMeshPropertyContainer.hh" #include "OpenVolumeMeshPropertyContainer.hh"
#include "OpenVolumeMeshHandle.hh" #include "OpenVolumeMeshHandle.hh"
namespace OpenVolumeMesh {
//== CLASS DEFINITION ========================================================= //== CLASS DEFINITION =========================================================
/// This class provides the basic property management like adding/removing /// This class provides the basic property management like adding/removing
...@@ -821,6 +858,8 @@ private: ...@@ -821,6 +858,8 @@ private:
OpenVolumeMeshPropertyContainer mprops_; OpenVolumeMeshPropertyContainer mprops_;
}; };
} // Namespace OpenVolumeMesh
//============================================================================= //=============================================================================
#endif // OPENVOLUMEMESHBASEKERNEL_HH defined #endif // OPENVOLUMEMESHBASEKERNEL_HH defined
//============================================================================= //=============================================================================
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenVolumeMesh. *
* *
* OpenVolumeMesh 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 with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenVolumeMesh 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 LesserGeneral Public *
* License along with OpenVolumeMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#ifndef OPENVOLUMEMESHBASEPROPERTY_HH #ifndef OPENVOLUMEMESHBASEPROPERTY_HH
#define OPENVOLUMEMESHBASEPROPERTY_HH #define OPENVOLUMEMESHBASEPROPERTY_HH
#include <limits>
#include <string> #include <string>
//== CLASS DEFINITION ========================================================= //== CLASS DEFINITION =========================================================
...@@ -11,11 +56,13 @@ ...@@ -11,11 +56,13 @@
**/ **/
namespace OpenVolumeMesh {
class OpenVolumeMeshBaseProperty { class OpenVolumeMeshBaseProperty {
public: public:
/// Indicates an error when a size is returned by a member. /// Indicates an error when a size is returned by a member.
static const size_t UnknownSize = size_t(-1); static const size_t UnknownSize = std::numeric_limits<size_t>::max();
public: public:
...@@ -102,5 +149,7 @@ private: ...@@ -102,5 +149,7 @@ private:
bool persistent_; bool persistent_;
}; };
} // Namespace OpenVolumeMesh
#endif //OPENVOLUMEMESHBASEPROPERTY_HH #endif //OPENVOLUMEMESHBASEPROPERTY_HH
/* /*===========================================================================*\
* HandleType.hh * *
* * OpenVolumeMesh *
* Created on: 27.06.2011 * Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* Author: mike * www.openmesh.org *
*/ * *
*---------------------------------------------------------------------------*
* This file is part of OpenVolumeMesh. *
* *
* OpenVolumeMesh 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 with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenVolumeMesh 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 LesserGeneral Public *
* License along with OpenVolumeMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#ifndef OPENVOLUMEMESHHANDLE_HH_ #ifndef OPENVOLUMEMESHHANDLE_HH_
#define OPENVOLUMEMESHHANDLE_HH_ #define OPENVOLUMEMESHHANDLE_HH_
namespace OpenVolumeMesh {
// Define handle types in order to distinguish different entities by their indices // Define handle types in order to distinguish different entities by their indices
class OpenVolumeMeshHandle { class OpenVolumeMeshHandle {
public: public:
...@@ -51,4 +88,6 @@ class CellHandle : public OpenVolumeMeshHandle { public: CellHandle(int _idx ...@@ -51,4 +88,6 @@ class CellHandle : public OpenVolumeMeshHandle { public: CellHandle(int _idx
class HalfEdgeHandle : public OpenVolumeMeshHandle { public: HalfEdgeHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} }; class HalfEdgeHandle : public OpenVolumeMeshHandle { public: HalfEdgeHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
class HalfFaceHandle : public OpenVolumeMeshHandle { public: HalfFaceHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} }; class HalfFaceHandle : public OpenVolumeMeshHandle { public: HalfFaceHandle(int _idx = -1) : OpenVolumeMeshHandle(_idx) {} };
} // Namespace OpenVolumeMesh
#endif /* OPENVOLUMEMESHHANDLE_HH_ */ #endif /* OPENVOLUMEMESHHANDLE_HH_ */
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenVolumeMesh. *
* *
* OpenVolumeMesh 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 with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenVolumeMesh 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 LesserGeneral Public *
* License along with OpenVolumeMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#ifndef OPENVOLUMEMESHPROPERTY_HH #ifndef OPENVOLUMEMESHPROPERTY_HH
#define OPENVOLUMEMESHPROPERTY_HH #define OPENVOLUMEMESHPROPERTY_HH
...@@ -12,6 +54,8 @@ ...@@ -12,6 +54,8 @@
#include "OpenVolumeMeshBaseProperty.hh" #include "OpenVolumeMeshBaseProperty.hh"
#include "OpenVolumeMeshHandle.hh" #include "OpenVolumeMeshHandle.hh"
namespace OpenVolumeMesh {
//== CLASS DEFINITION ========================================================= //== CLASS DEFINITION =========================================================
/** \class OpenVolumeMeshPropertyT /** \class OpenVolumeMeshPropertyT
...@@ -33,7 +77,7 @@ class OpenVolumeMeshPropertyT: public OpenVolumeMeshBaseProperty { ...@@ -33,7 +77,7 @@ class OpenVolumeMeshPropertyT: public OpenVolumeMeshBaseProperty {
public: public:
typedef T Value; typedef T Value;
typedef std::vector<T> vector_type; typedef std::vector<T> vector_type;
typedef T value_type; typedef T value_type;
typedef typename vector_type::reference reference; typedef typename vector_type::reference reference;
typedef typename vector_type::const_reference const_reference; typedef typename vector_type::const_reference const_reference;
...@@ -483,6 +527,8 @@ struct MPropHandleT: public OpenVolumeMeshBasePropHandleT<T> { ...@@ -483,6 +527,8 @@ struct MPropHandleT: public OpenVolumeMeshBasePropHandleT<T> {
} }
}; };
} // Namespace OpenVolumeMesh
//============================================================================= //=============================================================================
#endif // OPENVOLUMEMESHPROPERTY_HH defined #endif // OPENVOLUMEMESHPROPERTY_HH defined
//============================================================================= //=============================================================================
/*===========================================================================*\
* *
* OpenVolumeMesh *
* Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenVolumeMesh. *
* *
* OpenVolumeMesh 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 with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenVolumeMesh 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 LesserGeneral Public *
* License along with OpenVolumeMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#ifndef OPENVOLUMEMESHPROPERTYCONTAINER_HH #ifndef OPENVOLUMEMESHPROPERTYCONTAINER_HH
#define OPENVOLUMEMESHPROPERTYCONTAINER_HH #define OPENVOLUMEMESHPROPERTYCONTAINER_HH
...@@ -6,6 +48,8 @@ ...@@ -6,6 +48,8 @@
#include "OpenVolumeMeshProperty.hh" #include "OpenVolumeMeshProperty.hh"
namespace OpenVolumeMesh {
//== FORWARDDECLARATIONS ====================================================== //== FORWARDDECLARATIONS ======================================================
class BaseKernel; class BaseKernel;
...@@ -18,6 +62,7 @@ public: ...@@ -18,6 +62,7 @@ public:
OpenVolumeMeshPropertyContainer() { OpenVolumeMeshPropertyContainer() {
} }
virtual ~OpenVolumeMeshPropertyContainer() { virtual ~OpenVolumeMeshPropertyContainer() {
std::for_each(properties_.begin(), properties_.end(), Delete()); std::for_each(properties_.begin(), properties_.end(), Delete());
} }
...@@ -245,4 +290,6 @@ private: ...@@ -245,4 +290,6 @@ private:
Properties properties_; Properties properties_;
}; };
} // Namespace OpenVolumeMesh
#endif //OPENVOLUMEMESHPROPERTYCONTAINER_HH #endif //OPENVOLUMEMESHPROPERTYCONTAINER_HH
/* /*===========================================================================*\
* Status.hh * *
* * OpenVolumeMesh *
* Created on: Jun 10, 2011 * Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* Author: kremer * www.openmesh.org *
*/ * *
*---------------------------------------------------------------------------*
* This file is part of OpenVolumeMesh. *
* *
* OpenVolumeMesh 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 with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenVolumeMesh 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 LesserGeneral Public *
* License along with OpenVolumeMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#ifndef STATUS_HH_ #ifndef STATUS_HH_
#define STATUS_HH_ #define STATUS_HH_
namespace OpenVolumeMesh {
/** \class OpenVolumeMeshStatus
*
* \brief Stores statuses like selected, tagged, deleted, etc.
*/
class OpenVolumeMeshStatus { class OpenVolumeMeshStatus {
public: public:
...@@ -35,4 +77,6 @@ private: ...@@ -35,4 +77,6 @@ private:
bool deleted_; bool deleted_;
}; };
} // Namespace OpenVolumeMesh
#endif /* STATUS_HH_ */ #endif /* STATUS_HH_ */
/* /*===========================================================================*\
* Iterators.hh * *
* * OpenVolumeMesh *
* Created on: 24.06.2011 * Copyright (C) 2011 by Computer Graphics Group, RWTH Aachen *
* Author: mike * www.openmesh.org *
*/ * *
*---------------------------------------------------------------------------*
* This file is part of OpenVolumeMesh. *
* *
* OpenVolumeMesh 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 with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenVolumeMesh 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 LesserGeneral Public *
* License along with OpenVolumeMesh. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision: 1 $ *
* $Date: 2011-01-09 12:46:45 +0100 (Mo, 09. Jan 2011) $ *
* $LastChangedBy: kremer $ *
* *
\*===========================================================================*/
#ifndef ITERATORS_HH_ #ifndef ITERATORS_HH_
#define ITERATORS_HH_ #define ITERATORS_HH_
...@@ -11,6 +46,8 @@ ...@@ -11,6 +46,8 @@
#include <vector> #include <vector>
#include <iterator> #include <iterator>
namespace OpenVolumeMesh {
// Forward declaration // Forward declaration
template <class VecT> template <class VecT>
class OpenVolumeMesh; class OpenVolumeMesh;
...@@ -32,7 +69,7 @@ public: ...@@ -32,7 +69,7 @@ public:
valid_(true), cur_handle_(_ch), ref_handle_(_ih), mesh_(_mesh) {} valid_(true), cur_handle_(_ch), ref_handle_(_ih), mesh_(_mesh) {}
// STL compliance (needs to have default constructor) // STL compliance (needs to have default constructor)
BaseIterator() : valid_(false) {} BaseIterator() : valid_(false), mesh_(0) {}
virtual ~BaseIterator() {} virtual ~BaseIterator() {}
bool operator== (const BaseIterator& _c) const { bool operator== (const BaseIterator& _c) const {
return (this->cur_handle_ == _c.cur_handle() && return (this->cur_handle_ == _c.cur_handle() &&
...@@ -891,6 +928,8 @@ private: ...@@ -891,6 +928,8 @@ private: