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