Commit e911e7b1 authored by Martin Heistermann's avatar Martin Heistermann

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
This diff is collapsed.
......@@ -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 {
class TopologyKernel : public ResourceManager {
class OVM_EXPORT TopologyKernel : public ResourceManager {
public:
TopologyKernel() = default;
......
......@@ -47,6 +47,7 @@
#include <fstream>
#include <istream>
#include <ostream>
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -59,7 +60,7 @@ namespace IO {
* \todo Implement binary file support
*/
class FileManager {
class OVM_EXPORT FileManager {
public:
/// Default constructor
......
......@@ -54,6 +54,8 @@
#include <cassert>
#include <cstdlib>
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
namespace Geometry {
......@@ -830,20 +832,20 @@ using namespace Geometry;
template <class T>
const std::string typeName();
template <> const std::string typeName<Vec2f>();
template <> const std::string typeName<Vec2d>();
template <> const std::string typeName<Vec2i>();
template <> const std::string typeName<Vec2ui>();
template <> OVM_EXPORT const std::string typeName<Vec2f>();
template <> OVM_EXPORT const std::string typeName<Vec2d>();
template <> OVM_EXPORT const std::string typeName<Vec2i>();
template <> OVM_EXPORT const std::string typeName<Vec2ui>();
template <> const std::string typeName<Vec3f>();
template <> const std::string typeName<Vec3d>();
template <> const std::string typeName<Vec3i>();
template <> const std::string typeName<Vec3ui>();
template <> OVM_EXPORT const std::string typeName<Vec3f>();
template <> OVM_EXPORT const std::string typeName<Vec3d>();
template <> OVM_EXPORT const std::string typeName<Vec3i>();
template <> OVM_EXPORT const std::string typeName<Vec3ui>();
template <> const std::string typeName<Vec4f>();
template <> const std::string typeName<Vec4d>();
template <> const std::string typeName<Vec4i>();
template <> const std::string typeName<Vec4ui>();
template <> OVM_EXPORT const std::string typeName<Vec4f>();
template <> OVM_EXPORT const std::string typeName<Vec4d>();
template <> OVM_EXPORT const std::string typeName<Vec4i>();
template <> OVM_EXPORT const std::string typeName<Vec4ui>();
} // namespace OpenVolumeMesh
......
......@@ -44,13 +44,14 @@
#define HEXAHEDRALMESHITERATORS_HH
#include "../Core/Iterators.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
class HexahedralMeshTopologyKernel;
class CellSheetCellIter : public BaseCirculator<CellHandle, CellHandle> {
class OVM_EXPORT CellSheetCellIter : public BaseCirculator<CellHandle, CellHandle> {
private:
typedef BaseCirculator<CellHandle, CellHandle> BaseIter;
public:
......@@ -104,7 +105,7 @@ private:
};
class HalfFaceSheetHalfFaceIter : public BaseCirculator<HalfFaceHandle,HalfFaceHandle> {
class OVM_EXPORT HalfFaceSheetHalfFaceIter : public BaseCirculator<HalfFaceHandle,HalfFaceHandle> {
private:
typedef BaseCirculator<HalfFaceHandle, HalfFaceHandle> BaseIter;
public:
......@@ -174,7 +175,7 @@ private:
* 0-------1
*/
class HexVertexIter : public BaseCirculator<CellHandle,
class OVM_EXPORT HexVertexIter : public BaseCirculator<CellHandle,
VertexHandle> {
private:
typedef BaseCirculator<CellHandle,
......
......@@ -42,6 +42,7 @@
#include "../Core/TopologyKernel.hh"
#include "HexahedralMeshIterators.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -75,7 +76,7 @@ namespace OpenVolumeMesh {
* \li \c 6. ZB
*/
class HexahedralMeshTopologyKernel : public TopologyKernel {
class OVM_EXPORT HexahedralMeshTopologyKernel : public TopologyKernel {
public:
// Orientation constants
......
......@@ -44,6 +44,7 @@
#define TETRAHEDRALMESHITERATORS_HH
#include "../Core/Iterators.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -56,7 +57,7 @@ class TetrahedralMeshTopologyKernel;
*
*/
class TetVertexIter : public BaseCirculator<CellHandle,
class OVM_EXPORT TetVertexIter : public BaseCirculator<CellHandle,
VertexHandle> {
private:
typedef BaseCirculator<CellHandle,
......
......@@ -50,6 +50,7 @@
#include "../Core/TopologyKernel.hh"
#include "TetrahedralMeshIterators.hh"
#include "../Config/Export.hh"
namespace OpenVolumeMesh {
......@@ -60,7 +61,7 @@ namespace OpenVolumeMesh {
*
*/
class TetrahedralMeshTopologyKernel : public TopologyKernel {
class OVM_EXPORT TetrahedralMeshTopologyKernel : public TopologyKernel {
public:
TetrahedralMeshTopologyKernel() = default;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment