Commit ca806766 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Started implementing shared library support for campvis-core.

Builds and runs fine so far, but no elaborate testing done yet. Compiler throws a bunch of C4275 warning, since sigslot:has_slots<> is used in exported classes but is itself not exported. While this is no direct problem for campvis-internal builds, it should still be fixed some time.

refs #377
parent 0be65bc3
......@@ -48,14 +48,14 @@ namespace campvis {
*
* \sa VisualizationPipeline
*/
class VisualizationProcessor : public AbstractProcessor {
class CAMPVIS_CORE_API VisualizationProcessor : public AbstractProcessor {
public:
/**
* Utility struct to encapuslate off-screen rendering with this processor using FBOs.
* This guard essentially activates the VisualizationProcessor's FBO and sets the OpenGL
* viewport size. Upon destruction it detaches all texutres and deactivates the FBO again.
*/
struct FramebufferActivationGuard {
struct CAMPVIS_CORE_API FramebufferActivationGuard {
public:
/**
* Constructor.
......
......@@ -29,6 +29,8 @@
#include <tbb/atomic.h>
#include <tbb/spin_mutex.h>
#include "tgt/logmanager.h"
#include "core/coreapi.h"
#include "core/pipeline/abstractprocessor.h"
#include <set>
......@@ -41,7 +43,7 @@ namespace campvis {
* \todo Add PropertyWidgets, add clone()?
* Think about a reasonable locking mechanism and implement that
*/
class AbstractProperty {
class CAMPVIS_CORE_API AbstractProperty {
public:
/**
* Creates a new AbstractProperty
......
......@@ -31,7 +31,7 @@ namespace campvis {
/**
* Property that simply offers a single button.
*/
class ButtonProperty : public AbstractProperty {
class CAMPVIS_CORE_API ButtonProperty : public AbstractProperty {
public:
/**
* Creates a new ButtonProperty
......
......@@ -30,7 +30,7 @@
namespace campvis {
class CameraProperty : public GenericProperty<tgt::Camera> {
class CAMPVIS_CORE_API CameraProperty : public GenericProperty<tgt::Camera> {
public:
/**
* Creates a new CameraProperty
......
......@@ -37,7 +37,7 @@ namespace campvis {
* Specialization of a StringProperty to specify the keys (string IDs) for DataHandles to read/write.
* Offers an additional DataAccessInfo flag whether processor will read or write from/to that ID.
*/
class DataNameProperty : public GenericProperty<std::string> {
class CAMPVIS_CORE_API DataNameProperty : public GenericProperty<std::string> {
public:
/**
* DataAccessInfo flag defining whether processor will read or write from/to the corresponding DataHandle.
......
......@@ -39,7 +39,7 @@ namespace campvis {
* or (un)lock them. This has to be done by the owners of the wrapped
* properties.
*/
class MetaProperty : public AbstractProperty, public HasPropertyCollection {
class CAMPVIS_CORE_API MetaProperty : public AbstractProperty, public HasPropertyCollection {
public:
/**
* Creates a new MetaProperty
......
......@@ -26,6 +26,8 @@
#define NUMERICPROPERTY_H__
#include "tgt/vector.h"
#include "core/coreapi.h"
#include "core/properties/genericproperty.h"
#include <limits>
......@@ -77,7 +79,7 @@ namespace campvis {
* Interface for numeric properties.
* Defines methods for incrementing and decrementing the property's value.
*/
class INumericProperty {
class CAMPVIS_CORE_API INumericProperty {
public:
/// Increments the value of the property.
virtual void increment() = 0;
......
......@@ -26,9 +26,11 @@
#define PROPERTYCOLLECTION_H__
#include "sigslot/sigslot.h"
#include <vector>
#include <string>
#include "core/coreapi.h"
namespace campvis {
class AbstractProperty;
......@@ -39,7 +41,7 @@ namespace campvis {
/**
* Abstract base class for classes having a PropertyCollection.
*/
class HasPropertyCollection : public sigslot::has_slots<> {
class CAMPVIS_CORE_API HasPropertyCollection : public sigslot::has_slots<> {
public:
HasPropertyCollection();
......
......@@ -26,6 +26,8 @@
#define TRANSFERFUNCTIONPROPERTY_H__
#include "sigslot/sigslot.h"
#include "core/coreapi.h"
#include "core/properties/abstractproperty.h"
#include "core/classification/abstracttransferfunction.h"
......@@ -36,7 +38,7 @@ namespace campvis {
/**
* \todo Implement correct behavior if the TF changes during locked property state.
*/
class TransferFunctionProperty : public AbstractProperty , public sigslot::has_slots<> {
class CAMPVIS_CORE_API TransferFunctionProperty : public AbstractProperty , public sigslot::has_slots<> {
public:
typedef ConcurrentGenericHistogramND<float, 1> IntensityHistogramType;
......
......@@ -26,13 +26,14 @@
#define ALGORITHMICGEOMETRY_H__
#include "tgt/vector.h"
#include "core/coreapi.h"
namespace campvis {
/**
* Implements various algorithms from algorithmic geometry
*/
struct AlgorithmicGeometry {
struct CAMPVIS_CORE_API AlgorithmicGeometry {
public:
/**
* Computes the orientation2D of the three points a, b, c in 2D.
......
......@@ -28,6 +28,8 @@
#include "tgt/logmanager.h"
#include "tgt/types.h"
#include "core/coreapi.h"
#include <utility>
namespace campvis {
......@@ -35,7 +37,7 @@ namespace campvis {
/**
* Helper struct for handling endianess.
**/
struct EndianHelper {
struct CAMPVIS_CORE_API EndianHelper {
/// Type of Endianness
enum Endianness {
IS_LITTLE_ENDIAN, ///< little endian
......
......@@ -29,6 +29,8 @@
#include "tgt/tgt_gl.h"
#include "tgt/vector.h"
#include "core/coreapi.h"
#include <string>
#include <vector>
......@@ -46,7 +48,7 @@ namespace campvis {
* Class performing a reduction of 2D image data using OpenGL.
* \note All methods need to be called from a valid OpenGL context.
*/
class GlReduction {
class CAMPVIS_CORE_API GlReduction {
public:
/// Operation to be performed by reduction
enum ReductionOperator {
......
......@@ -28,12 +28,14 @@
#include "sigslot/sigslot.h"
#include "tgt/assert.h"
#include "core/coreapi.h"
namespace campvis {
/**
* Abstract base class for a job that can be executed.
*/
class AbstractJob {
class CAMPVIS_CORE_API AbstractJob {
public:
/**
* Pure virtual destructor.
......
......@@ -28,6 +28,8 @@
#include <tbb/spin_mutex.h>
#include <set>
#include "core/coreapi.h"
namespace campvis {
/**
......@@ -35,7 +37,7 @@ namespace campvis {
* \sa Observable
* \todo Add more advanced version supporting arguments during notification.
*/
class Observer {
class CAMPVIS_CORE_API Observer {
public:
Observer();
virtual ~Observer();
......@@ -52,7 +54,7 @@ namespace campvis {
* Minimal implementation of the observer pattern.
* \sa Observer
*/
class Observable {
class CAMPVIS_CORE_API Observable {
public:
Observable();
virtual ~Observable();
......
......@@ -32,6 +32,8 @@
#include <tbb/concurrent_hash_map.h>
#include <tbb/concurrent_vector.h>
#include <tbb/compat/condition_variable>
#include "core/coreapi.h"
#include "core/tools/job.h"
#include "core/tools/runnable.h"
......@@ -62,7 +64,7 @@ namespace campvis {
*
* This class is to be considered as thread-safe.
*/
class OpenGLJobProcessor : public tgt::Singleton<OpenGLJobProcessor>, public Runnable, public sigslot::has_slots<> {
class CAMPVIS_CORE_API OpenGLJobProcessor : public tgt::Singleton<OpenGLJobProcessor>, public Runnable, public sigslot::has_slots<> {
friend class tgt::Singleton<OpenGLJobProcessor>;
public:
......@@ -140,7 +142,7 @@ namespace campvis {
/**
* Struct encapsulating the job queue for a single OpenGL context.
*/
struct PerContextJobQueue {
struct CAMPVIS_CORE_API PerContextJobQueue {
/**
* Creates an empty PerContextJobQueue.
*/
......
......@@ -28,6 +28,8 @@
#include "tgt/singleton.h"
#include "tgt/tgt_gl.h"
#include "core/coreapi.h"
namespace campvis {
class FaceGeometry;
......@@ -35,7 +37,7 @@ namespace campvis {
* Small helper singleton class for rendering the default [-1, 1]^2 quad.
* Texture coordinates are [0, 1]^2.
*/
class QuadRenderer : public tgt::Singleton<QuadRenderer> {
class CAMPVIS_CORE_API QuadRenderer : public tgt::Singleton<QuadRenderer> {
friend class tgt::Singleton<QuadRenderer>;
public:
......
......@@ -27,6 +27,8 @@
#include <tbb/atomic.h>
#include "core/coreapi.h"
namespace campvis {
/**
* Base class for reference counted objects.
......@@ -34,7 +36,7 @@ namespace campvis {
* \note Implementation inspired from Scott Meyers: More Effective C++, Item 29
* \todo Check thread-safety
*/
class ReferenceCounted {
class CAMPVIS_CORE_API ReferenceCounted {
public:
/**
* Create a new reference counted object.
......
......@@ -29,6 +29,8 @@
#include <tbb/compat/thread>
#include <tbb/atomic.h>
#include "core/coreapi.h"
namespace campvis {
/**
* Abstract base class for objects that shall run in a separate thread.
......@@ -36,7 +38,7 @@ namespace campvis {
* in the run() method which has to be overwritten in subclasses. Calling stop() sets _stopExecution to true
* and waits for the thread to finish. Hence, you should test for _stopExecution in your run() method.
*/
class Runnable {
class CAMPVIS_CORE_API Runnable {
public:
/**
* Creates a new Runnable object
......
......@@ -28,13 +28,15 @@
#include "tgt/singleton.h"
#include <tbb/task_group.h>
#include "core/coreapi.h"
namespace campvis {
/**
* Singleton class for managing and executing work items (jobs) in an asynchronous way.
* Enqueued jobs are dispatched via the tbb::task_group interface as single tasks.
* No priority schemes are implemented by now.
*/
class SimpleJobProcessor : public tgt::Singleton<SimpleJobProcessor> {
class CAMPVIS_CORE_API SimpleJobProcessor : public tgt::Singleton<SimpleJobProcessor> {
friend class tgt::Singleton<SimpleJobProcessor>;
public:
......
......@@ -31,6 +31,8 @@
#include <string>
#include <vector>
#include "core/coreapi.h"
namespace campvis {
/**
......@@ -40,7 +42,7 @@ namespace campvis {
*
* \todo Test, test, test!
*/
class StringUtils {
class CAMPVIS_CORE_API StringUtils {
public:
/**
* Converts the string \a str to lowercase.
......
Supports Markdown
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