Commit e911e7b1 authored by Martin Heistermann's avatar Martin Heistermann
Browse files

Add OVM_EXPORT macros to support SHARED build properly.

parent 7708b31a
......@@ -36,6 +36,7 @@
#define STATUS_HH_
#include <iosfwd>
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -44,7 +45,7 @@ namespace OpenVolumeMesh {
* \brief Stores statuses like selected, tagged, deleted, hidden.
*/
class OpenVolumeMeshStatus {
class OVM_EXPORT OpenVolumeMeshStatus {
public:
OpenVolumeMeshStatus() = default;
......
......@@ -49,13 +49,14 @@
#include "../Core/OpenVolumeMeshHandle.hh"
#include "OpenVolumeMeshStatus.hh"
#include "../Core/PropertyDefines.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
// Forward declaration
class TopologyKernel;
class StatusAttrib {
class OVM_EXPORT StatusAttrib {
public:
explicit StatusAttrib(TopologyKernel& _kernel);
~StatusAttrib();
......
......@@ -45,11 +45,12 @@
#include <vector>
#include "../Config/Export.hh"
#include "OpenVolumeMeshHandle.hh"
namespace OpenVolumeMesh {
class OpenVolumeMeshEdge {
class OVM_EXPORT OpenVolumeMeshEdge {
friend class TopologyKernel;
public:
OpenVolumeMeshEdge(const VertexHandle& _fromVertex,
......@@ -84,7 +85,7 @@ std::ostream& operator<<(std::ostream& _os, const OpenVolumeMeshEdge& _edge);
//***************************************************************************
class OpenVolumeMeshFace {
class OVM_EXPORT OpenVolumeMeshFace {
friend class TopologyKernel;
public:
explicit OpenVolumeMeshFace(const std::vector<HalfEdgeHandle>& _halfedges) :
......@@ -115,7 +116,7 @@ std::ostream& operator<<(std::ostream& _os, const OpenVolumeMeshFace& _face);
//***************************************************************************
class OpenVolumeMeshCell {
class OVM_EXPORT OpenVolumeMeshCell {
friend class TopologyKernel;
public:
explicit OpenVolumeMeshCell(const std::vector<HalfFaceHandle>& _halffaces) :
......
......@@ -38,12 +38,13 @@
#include <string>
#include "OpenVolumeMeshHandle.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
class ResourceManager;
class BaseProperty {
class OVM_EXPORT BaseProperty {
public:
friend class ResourceManager;
......
#pragma once
#include "../Config/Export.hh"
#include <type_traits>
namespace OpenVolumeMesh {
namespace Entity {
struct Vertex {};
struct Edge {};
struct HalfEdge {};
struct Face {};
struct HalfFace {};
struct Cell {};
struct Mesh {};
struct OVM_EXPORT Vertex {};
struct OVM_EXPORT Edge {};
struct OVM_EXPORT HalfEdge {};
struct OVM_EXPORT Face {};
struct OVM_EXPORT HalfFace {};
struct OVM_EXPORT Cell {};
struct OVM_EXPORT Mesh {};
}
template<typename T>
struct is_entity : std::false_type {};
template<> struct is_entity<Entity::Vertex> : std::true_type {};
template<> struct is_entity<Entity::Edge> : std::true_type {};
template<> struct is_entity<Entity::HalfEdge> : std::true_type {};
template<> struct is_entity<Entity::Face> : std::true_type {};
template<> struct is_entity<Entity::HalfFace> : std::true_type {};
template<> struct is_entity<Entity::Cell> : std::true_type {};
template<> struct is_entity<Entity::Mesh> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::Vertex> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::Edge> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::HalfEdge> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::Face> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::HalfFace> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::Cell> : std::true_type {};
template<> struct OVM_EXPORT is_entity<Entity::Mesh> : std::true_type {};
} // namespace OpenVolumeMesh
......@@ -52,6 +52,7 @@
#endif
#include "OpenVolumeMeshHandle.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -242,7 +243,7 @@ protected:
//===========================================================================
class VertexOHalfEdgeIter :
class OVM_EXPORT VertexOHalfEdgeIter :
public BaseCirculator<
VertexHandle,
HalfEdgeHandle> {
......@@ -305,7 +306,7 @@ private:
//===========================================================================
class VertexVertexIter :
class OVM_EXPORT VertexVertexIter :
public BaseCirculator<
VertexHandle,
VertexHandle> {
......@@ -366,7 +367,7 @@ private:
//===========================================================================
class HalfEdgeHalfFaceIter : public BaseCirculator<
class OVM_EXPORT HalfEdgeHalfFaceIter : public BaseCirculator<
HalfEdgeHandle,
HalfFaceHandle> {
public:
......@@ -424,7 +425,7 @@ private:
//===========================================================================
class VertexFaceIter : public BaseCirculator<
class OVM_EXPORT VertexFaceIter : public BaseCirculator<
VertexHandle,
FaceHandle> {
public:
......@@ -482,7 +483,7 @@ private:
//===========================================================================
class VertexCellIter : public BaseCirculator<
class OVM_EXPORT VertexCellIter : public BaseCirculator<
VertexHandle,
CellHandle> {
public:
......@@ -538,7 +539,7 @@ private:
size_t cur_index_;
};
class HalfEdgeCellIter : public BaseCirculator<
class OVM_EXPORT HalfEdgeCellIter : public BaseCirculator<
HalfEdgeHandle,
CellHandle> {
public:
......@@ -600,7 +601,7 @@ private:
//===========================================================================
class CellVertexIter : public BaseCirculator<
class OVM_EXPORT CellVertexIter : public BaseCirculator<
CellHandle,
VertexHandle> {
public:
......@@ -658,7 +659,7 @@ private:
//===========================================================================
class CellCellIter : public BaseCirculator<
class OVM_EXPORT CellCellIter : public BaseCirculator<
CellHandle,
CellHandle> {
public:
......@@ -716,7 +717,7 @@ private:
//===========================================================================
class HalfFaceVertexIter : public BaseCirculator<
class OVM_EXPORT HalfFaceVertexIter : public BaseCirculator<
HalfFaceHandle,
VertexHandle> {
public:
......@@ -774,7 +775,7 @@ private:
//===========================================================================
class BoundaryHalfFaceHalfFaceIter : public BaseCirculator<HalfFaceHandle,
class OVM_EXPORT BoundaryHalfFaceHalfFaceIter : public BaseCirculator<HalfFaceHandle,
HalfFaceHandle> {
private:
typedef BaseCirculator<HalfFaceHandle,
......@@ -834,7 +835,7 @@ private:
//===========================================================================
class VertexIter : public BaseIterator<VertexHandle> {
class OVM_EXPORT VertexIter : public BaseIterator<VertexHandle> {
public:
typedef BaseIterator<VertexHandle> BaseIter;
......@@ -888,7 +889,7 @@ private:
//===========================================================================
class EdgeIter : public BaseIterator<EdgeHandle> {
class OVM_EXPORT EdgeIter : public BaseIterator<EdgeHandle> {
public:
typedef BaseIterator<EdgeHandle> BaseIter;
......@@ -942,7 +943,7 @@ private:
//===========================================================================
class HalfEdgeIter : public BaseIterator<HalfEdgeHandle> {
class OVM_EXPORT HalfEdgeIter : public BaseIterator<HalfEdgeHandle> {
public:
typedef BaseIterator<HalfEdgeHandle> BaseIter;
......@@ -996,7 +997,7 @@ private:
//===========================================================================
class FaceIter : public BaseIterator<FaceHandle> {
class OVM_EXPORT FaceIter : public BaseIterator<FaceHandle> {
public:
typedef BaseIterator<FaceHandle> BaseIter;
......@@ -1050,7 +1051,7 @@ private:
//===========================================================================
class HalfFaceIter : public BaseIterator<HalfFaceHandle> {
class OVM_EXPORT HalfFaceIter : public BaseIterator<HalfFaceHandle> {
public:
typedef BaseIterator<HalfFaceHandle> BaseIter;
......@@ -1104,7 +1105,7 @@ private:
//===========================================================================
class CellIter : public BaseIterator<CellHandle> {
class OVM_EXPORT CellIter : public BaseIterator<CellHandle> {
public:
typedef BaseIterator<CellHandle> BaseIter;
......@@ -1162,7 +1163,7 @@ namespace Internal {
//===========================================================================
class VertexIHalfEdgeIterImpl : public BaseCirculator<VertexHandle, HalfEdgeHandle> {
class OVM_EXPORT VertexIHalfEdgeIterImpl : public BaseCirculator<VertexHandle, HalfEdgeHandle> {
public:
typedef BaseCirculator<VertexHandle, HalfEdgeHandle> BaseIter;
......@@ -1179,7 +1180,7 @@ private:
//===========================================================================
class VertexEdgeIterImpl : public BaseCirculator<VertexHandle, EdgeHandle> {
class OVM_EXPORT VertexEdgeIterImpl : public BaseCirculator<VertexHandle, EdgeHandle> {
public:
typedef BaseCirculator<VertexHandle, EdgeHandle> BaseIter;
......@@ -1196,7 +1197,7 @@ private:
//===========================================================================
class VertexHalfFaceIterImpl : public BaseCirculator<VertexHandle, HalfFaceHandle> {
class OVM_EXPORT VertexHalfFaceIterImpl : public BaseCirculator<VertexHandle, HalfFaceHandle> {
public:
typedef BaseCirculator<VertexHandle, HalfFaceHandle> BaseIter;
......@@ -1214,7 +1215,7 @@ private:
//===========================================================================
class HalfEdgeFaceIterImpl : public BaseCirculator<HalfEdgeHandle, FaceHandle> {
class OVM_EXPORT HalfEdgeFaceIterImpl : public BaseCirculator<HalfEdgeHandle, FaceHandle> {
public:
typedef BaseCirculator<HalfEdgeHandle, FaceHandle> BaseIter;
......@@ -1232,7 +1233,7 @@ private:
//===========================================================================
class EdgeHalfFaceIterImpl : public BaseCirculator<EdgeHandle, HalfFaceHandle> {
class OVM_EXPORT EdgeHalfFaceIterImpl : public BaseCirculator<EdgeHandle, HalfFaceHandle> {
public:
typedef BaseCirculator<EdgeHandle, HalfFaceHandle> BaseIter;
......@@ -1250,7 +1251,7 @@ private:
//===========================================================================
class EdgeFaceIterImpl : public HalfEdgeFaceIterImpl {
class OVM_EXPORT EdgeFaceIterImpl : public HalfEdgeFaceIterImpl {
public:
typedef EdgeHandle CenterEntityHandle;
......@@ -1260,7 +1261,7 @@ public:
//===========================================================================
class EdgeCellIterImpl : public HalfEdgeCellIter {
class OVM_EXPORT EdgeCellIterImpl : public HalfEdgeCellIter {
public:
typedef EdgeHandle CenterEntityHandle;
......@@ -1270,7 +1271,7 @@ public:
//===========================================================================
class HalfFaceHalfEdgeIterImpl : public BaseCirculator<HalfFaceHandle, HalfEdgeHandle> {
class OVM_EXPORT HalfFaceHalfEdgeIterImpl : public BaseCirculator<HalfFaceHandle, HalfEdgeHandle> {
public:
typedef BaseCirculator<HalfFaceHandle, HalfEdgeHandle> BaseIter;
......@@ -1287,7 +1288,7 @@ private:
//===========================================================================
class HalfFaceEdgeIterImpl : public BaseCirculator<HalfFaceHandle, EdgeHandle> {
class OVM_EXPORT HalfFaceEdgeIterImpl : public BaseCirculator<HalfFaceHandle, EdgeHandle> {
public:
typedef BaseCirculator<HalfFaceHandle, EdgeHandle> BaseIter;
......@@ -1304,7 +1305,7 @@ private:
//===========================================================================
class FaceVertexIterImpl : public HalfFaceVertexIter {
class OVM_EXPORT FaceVertexIterImpl : public HalfFaceVertexIter {
public:
typedef FaceHandle CenterEntityHandle;
......@@ -1314,7 +1315,7 @@ public:
//===========================================================================
class FaceHalfEdgeIterImpl : public HalfFaceHalfEdgeIterImpl {
class OVM_EXPORT FaceHalfEdgeIterImpl : public HalfFaceHalfEdgeIterImpl {
public:
typedef FaceHandle CenterEntityHandle;
......@@ -1324,7 +1325,7 @@ public:
//===========================================================================
class FaceEdgeIterImpl : public HalfFaceEdgeIterImpl {
class OVM_EXPORT FaceEdgeIterImpl : public HalfFaceEdgeIterImpl {
public:
typedef FaceHandle CenterEntityHandle;
......@@ -1334,7 +1335,7 @@ public:
//===========================================================================
class CellHalfEdgeIterImpl : public BaseCirculator<CellHandle, HalfEdgeHandle> {
class OVM_EXPORT CellHalfEdgeIterImpl : public BaseCirculator<CellHandle, HalfEdgeHandle> {
public:
typedef BaseCirculator<CellHandle, HalfEdgeHandle> BaseIter;
......@@ -1352,7 +1353,7 @@ private:
//===========================================================================
class CellEdgeIterImpl : public BaseCirculator<CellHandle, EdgeHandle> {
class OVM_EXPORT CellEdgeIterImpl : public BaseCirculator<CellHandle, EdgeHandle> {
public:
typedef BaseCirculator<CellHandle, EdgeHandle> BaseIter;
......@@ -1370,7 +1371,7 @@ private:
//===========================================================================
class CellHalfFaceIterImpl : public BaseCirculator<CellHandle, HalfFaceHandle> {
class OVM_EXPORT CellHalfFaceIterImpl : public BaseCirculator<CellHandle, HalfFaceHandle> {
public:
typedef BaseCirculator<CellHandle, HalfFaceHandle> BaseIter;
......@@ -1387,7 +1388,7 @@ private:
//===========================================================================
class CellFaceIterImpl : public BaseCirculator<CellHandle, FaceHandle> {
class OVM_EXPORT CellFaceIterImpl : public BaseCirculator<CellHandle, FaceHandle> {
public:
typedef BaseCirculator<CellHandle, FaceHandle> BaseIter;
......@@ -1467,6 +1468,33 @@ public:
//===========================================================================
template class OVM_EXPORT GenericCirculator<Internal::VertexIHalfEdgeIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::VertexEdgeIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::VertexHalfFaceIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::HalfEdgeFaceIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::EdgeHalfFaceIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::EdgeFaceIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::EdgeCellIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::HalfFaceHalfEdgeIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::HalfFaceEdgeIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::FaceVertexIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::FaceHalfEdgeIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::FaceEdgeIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::CellHalfEdgeIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::CellEdgeIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::CellHalfFaceIterImpl>;
template class OVM_EXPORT GenericCirculator<Internal::CellFaceIterImpl>;
typedef GenericCirculator<Internal::VertexIHalfEdgeIterImpl> VertexIHalfEdgeIter;
typedef GenericCirculator<Internal::VertexEdgeIterImpl> VertexEdgeIter;
typedef GenericCirculator<Internal::VertexHalfFaceIterImpl> VertexHalfFaceIter;
......@@ -1595,7 +1623,6 @@ private:
};
//===========================================================================
typedef BoundaryItemIter<VertexIter, VertexHandle> BoundaryVertexIter;
typedef BoundaryItemIter<HalfEdgeIter, HalfEdgeHandle> BoundaryHalfEdgeIter;
typedef BoundaryItemIter<EdgeIter, EdgeHandle> BoundaryEdgeIter;
......
......@@ -40,6 +40,7 @@
#include <vector>
#include "OpenVolumeMeshHandle.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -49,7 +50,7 @@ namespace OpenVolumeMesh {
**/
class OpenVolumeMeshBaseProperty {
class OVM_EXPORT OpenVolumeMeshBaseProperty {
public:
friend class ResourceManager;
......
......@@ -43,11 +43,12 @@
#include "Entities.hh"
#include "../System/FunctionalInclude.hh"
#include "../System/Deprecation.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
// Define handle types in order to distinguish different entities by their indices
class OpenVolumeMeshHandle {
class OVM_EXPORT OpenVolumeMeshHandle {
public:
// Default constructor
explicit constexpr OpenVolumeMeshHandle(int _idx) : idx_(_idx) {}
......@@ -124,6 +125,14 @@ public:
};
// Default entity handles
//
template class OVM_EXPORT HandleT<Entity::Vertex>;
template class OVM_EXPORT HandleT<Entity::HalfEdge>;
template class OVM_EXPORT HandleT<Entity::Edge>;
template class OVM_EXPORT HandleT<Entity::HalfFace>;
template class OVM_EXPORT HandleT<Entity::Face>;
template class OVM_EXPORT HandleT<Entity::Cell>;
template class OVM_EXPORT HandleT<Entity::Mesh>;
using VertexHandle = HandleT<Entity::Vertex>;
using HalfEdgeHandle = HandleT<Entity::HalfEdge>;
......@@ -191,16 +200,22 @@ private:
CellHandle thld_;
};
OVM_EXPORT
bool operator==(const int& _lhs, const OpenVolumeMeshHandle& _rhs);
OVM_EXPORT
bool operator==(const unsigned int& _lhs, const OpenVolumeMeshHandle& _rhs);
OVM_EXPORT
bool operator!=(const int& _lhs, const OpenVolumeMeshHandle& _rhs);
OVM_EXPORT
bool operator!=(const unsigned int& _lhs, const OpenVolumeMeshHandle& _rhs);
OVM_EXPORT
std::ostream& operator<<(std::ostream& _ostr, const OpenVolumeMeshHandle& _handle);
OVM_EXPORT
std::istream& operator>>(std::istream& _istr, OpenVolumeMeshHandle& _handle);
} // Namespace OpenVolumeMesh
......
......@@ -54,33 +54,33 @@ class ResourceManager;
template <class T>
const std::string typeName();
template <> const std::string typeName<int>();
template <> const std::string typeName<unsigned int>();
template <> const std::string typeName<short>();
template <> const std::string typeName<long>();
template <> const std::string typeName<unsigned long>();
template <> const std::string typeName<char>();
template <> const std::string typeName<unsigned char>();
template <> const std::string typeName<bool>();
template <> const std::string typeName<float>();
template <> const std::string typeName<double>();
template <> const std::string typeName<std::string>();
template <> const std::string typeName<std::map<HalfEdgeHandle, int> >();
template <> const std::string typeName<std::vector<double> >();
template <> const std::string typeName<std::vector<VertexHandle> >();
template <> const std::string typeName<std::vector<HalfFaceHandle> >();
template <> const std::string typeName<std::vector<std::vector<HalfFaceHandle> > >();
template <> OVM_EXPORT const std::string typeName<int>();
template <> OVM_EXPORT const std::string typeName<unsigned int>();
template <> OVM_EXPORT const std::string typeName<short>();
template <> OVM_EXPORT const std::string typeName<long>();
template <> OVM_EXPORT const std::string typeName<unsigned long>();
template <> OVM_EXPORT const std::string typeName<char>();
template <> OVM_EXPORT const std::string typeName<unsigned char>();
template <> OVM_EXPORT const std::string typeName<bool>();
template <> OVM_EXPORT const std::string typeName<float>();
template <> OVM_EXPORT const std::string typeName<double>();
template <> OVM_EXPORT const std::string typeName<std::string>();
template <> OVM_EXPORT const std::string typeName<std::map<HalfEdgeHandle, int> >();
template <> OVM_EXPORT const std::string typeName<std::vector<double> >();
template <> OVM_EXPORT const std::string typeName<std::vector<VertexHandle> >();
template <> OVM_EXPORT const std::string typeName<std::vector<HalfFaceHandle> >();
template <> OVM_EXPORT const std::string typeName<std::vector<std::vector<HalfFaceHandle> > >();
template<typename Entity>
const std::string entityTypeName();
template <> const std::string entityTypeName<Entity::Vertex>();
template <> const std::string entityTypeName<Entity::HalfEdge>();
template <> const std::string entityTypeName<Entity::Edge>();
template <> const std::string entityTypeName<Entity::Face>();
template <> const std::string entityTypeName<Entity::HalfFace>();
template <> const std::string entityTypeName<Entity::Cell>();
template <> const std::string entityTypeName<Entity::Mesh>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::Vertex>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::HalfEdge>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::Edge>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::Face>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::HalfFace>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::Cell>();
template <> OVM_EXPORT const std::string entityTypeName<Entity::Mesh>();
template<typename T, typename Entity>
class PropertyTT : public PropertyPtr<OpenVolumeMeshPropertyT<T>, Entity> {
......
......@@ -52,6 +52,7 @@
#include <string>
#include <iterator>
#include "../Config/Export.hh"
namespace OpenVolumeMesh
{
......@@ -59,11 +60,13 @@ namespace OpenVolumeMesh
template <typename ValueT>
std::ostream& serialize(std::ostream& os, const ValueT& rhs);
OVM_EXPORT
std::ostream& serialize(std::ostream& os, const std::string& rhs);
template <typename ValueT>
std::istream& deserialize(std::istream& is, ValueT& rhs);
OVM_EXPORT
std::istream& deserialize(std::istream& is, std::string& rhs);
template <typename KeyT, typename ValueT>
......@@ -78,6 +81,7 @@ std::ostream& operator<<(std::ostream& os, const std::vector< ValueT >& rhs);
template <typename ValueT>
std::istream& operator>>(std::istream& is, std::vector< ValueT >& rhs);
OVM_EXPORT
std::istream& operator>>(std::istream& is, std::vector< bool >& rhs);
}
......
......@@ -43,10 +43,11 @@
#include "OpenVolumeMeshHandle.hh"
#include "ResourceManager.hh"
#include "Iterators.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {