Commit ed1d2878 authored by Sylvain Thery's avatar Sylvain Thery

dll compiling

parent 7f6ebf00
......@@ -94,6 +94,8 @@ void MyQT::createMap()
// render the topo of the map without boundary darts
m_render_topo->setInitialBoundaryDartsColor(0,1,0);
m_render_topo->updateDataGMap<PFP>(myMap, position, 0.9f, 0.9f,true);
CGoGNout << "hopla" << CGoGNendl;
}
// initialization GL callback
......
......@@ -116,19 +116,20 @@ IF (CGoGN_ONELIB)
ELSE()
IF (CGoGN_WITH_QT)
add_definitions(-DCGoGN_QT_DLL_EXPORT)
add_library( utils ${files_utils_withQt} )
ELSE()
add_library( utils ${files_utils} )
ENDIF()
target_link_libraries(utils ${CGoGN_EXT_LIBS})
add_library( container ${files_container})
add_library( container ${files_container})
target_link_libraries(container utils)
add_library( topology ${files_topology})
add_library( topology ${files_topology})
target_link_libraries(topology container)
add_library( algo ${files_algo})
add_library( algo ${files_algo})
target_link_libraries(algo utils topology)
......
......@@ -33,6 +33,16 @@
#include "Utils/colorMaps.h"
#include "Utils/vbo_base.h"
#ifdef WIN32
#ifndef CGoGN_ALGO_API
#if defined CGoGN_ALGO_DLL_EXPORT
#define CGoGN_ALGO_API __declspec(dllexport)
#else
#define CGoGN_ALGO_API __declspec(dllimport)
#endif
#endif
#endif
namespace CGoGN
{
......@@ -42,7 +52,7 @@ namespace Algo
namespace Histogram
{
class HistoColorMap
class CGoGN_ALGO_API HistoColorMap
{
protected:
double m_min;
......@@ -121,7 +131,7 @@ public:
* Histogram class
* T must have operators -, / ,< ,>
*/
class Histogram
class CGoGN_ALGO_API Histogram
{
// std::vector<double> m_data;
......@@ -196,22 +206,22 @@ public:
/**
* get min value of attribute (perhaps modified by user)
*/
double getMin() const;
inline double getMin() const;
/**
* get max value of attribute (perhaps modified by user)
*/
double getMax() const;
inline double getMax() const;
/**
* get real min value of attribute
*/
double getQMin() const;
inline double getQMin() const;
/**
* get real max value of attribute
*/
double getQMax() const;
inline double getQMax() const;
/**
......
......@@ -28,6 +28,18 @@
#include "Topology/map/embeddedMap3.h"
#include "Algo/Multiresolution/filter.h"
#ifdef WIN32
#ifndef CGoGN_ALGO_API
#if defined CGoGN_ALGO_DLL_EXPORT
#define CGoGN_ALGO_API __declspec(dllexport)
#else
#define CGoGN_ALGO_API __declspec(dllimport)
#endif
#endif
#endif
namespace CGoGN
{
......@@ -42,7 +54,7 @@ namespace IHM
template<typename T, unsigned int ORBIT> class AttributeHandler_IHM ;
class ImplicitHierarchicalMap3 : public EmbeddedMap3
CGoGN_ALGO_API class ImplicitHierarchicalMap3 : public EmbeddedMap3
{
template<typename T, unsigned int ORBIT> friend class AttributeHandler_IHM ;
......
......@@ -31,10 +31,20 @@
#include "Algo/Import/ply.h"
#ifdef WIN32
#ifndef CGoGN_ALGO_API
#if defined CGoGN_ALGO_DLL_EXPORT
#define CGoGN_ALGO_API __declspec(dllexport)
#else
#define CGoGN_ALGO_API __declspec(dllimport)
#endif
#endif
#endif
namespace CGoGN
{
class PlyImportData
class CGoGN_ALGO_API PlyImportData
{
public:
......
......@@ -1182,7 +1182,7 @@ void MarchingCube<DataType, Windowing, PFP>::removeFacesOfBoundary(VertexAttribu
DartMarker<L_MAP> mf(*m_map);
for (Dart d = m_map->begin(); d != m_map->end();) // next done inside loop because of deleteFace
{
if (!mf.isMarked(d) && !m_map->isBoundaryMarked2(d))
if (!mf.isMarked(d) && !m_map->isBoundaryMarked<2>(d))
{
Dart dd = d;
Dart e = m_map->phi1(d);
......
......@@ -26,6 +26,18 @@
#define __MC_TABLE__
#include "type.h"
#ifdef WIN32
#ifndef CGoGN_ALGO_API
#if defined CGoGN_ALGO_DLL_EXPORT
#define CGoGN_ALGO_API __declspec(dllexport)
#else
#define CGoGN_ALGO_API __declspec(dllimport)
#endif
#endif
#endif
namespace CGoGN
{
......@@ -47,7 +59,7 @@ namespace MC
* file. It can not be included in the marching-cube files
* because it is template
*/
class accelMCTable
class CGoGN_ALGO_API accelMCTable
{
public:
/**
......
......@@ -42,6 +42,16 @@
// forward definition
namespace CGoGN { namespace Utils { class GLSLShader; } }
#ifdef WIN32
#ifndef CGoGN_ALGO_API
#if defined CGoGN_ALGO_DLL_EXPORT
#define CGoGN_ALGO_API __declspec(dllexport)
#else
#define CGoGN_ALGO_API __declspec(dllimport)
#endif
#endif
#endif
namespace CGoGN
{
......@@ -65,7 +75,7 @@ enum drawingType
SIZE_BUFFER
} ;
class MapRender
class CGoGN_ALGO_API MapRender
{
protected:
/**
......
......@@ -469,7 +469,7 @@ void TopoPrimalRender<PFP>::updateData(MAP& map, const VertexAttribute<VEC3, MAP
*positionDartBuf++ = P;
*positionDartBuf++ = PP;
if (map.isBoundaryMarked2(d))
if (map.isBoundaryMarked<2>(d))
{
*colorDartBuf++ = m_boundaryDartsColor;
*colorDartBuf++ = m_boundaryDartsColor;
......@@ -488,7 +488,7 @@ void TopoPrimalRender<PFP>::updateData(MAP& map, const VertexAttribute<VEC3, MAP
*positionDartBuf++ = QQ;
Dart dx = map.phi2(d);
if (map.isBoundaryMarked2(dx))
if (map.isBoundaryMarked<2>(dx))
{
*colorDartBuf++ = m_boundaryDartsColor;
*colorDartBuf++ = m_boundaryDartsColor;
......
......@@ -39,6 +39,16 @@
#include "Utils/Shaders/shaderSimpleColor.h"
#ifdef WIN32
#ifndef CGoGN_ALGO_API
#if defined CGoGN_ALGO_DLL_EXPORT
#define CGoGN_ALGO_API __declspec(dllexport)
#else
#define CGoGN_ALGO_API __declspec(dllimport)
#endif
#endif
#endif
namespace CGoGN
{
......@@ -52,10 +62,7 @@ namespace GL2
{
class TopoGenRender
class CGoGN_ALGO_API TopoGenRender
{
protected:
/**
......
......@@ -32,6 +32,14 @@
#include <vector>
#include <map>
#ifdef WIN32
#if defined CGoGN_CONTAINER_DLL_EXPORT
#define CGoGN_CONTAINER_API __declspec(dllexport)
#else
#define CGoGN_CONTAINER_API __declspec(dllimport)
#endif
#endif
namespace CGoGN
{
......@@ -53,7 +61,8 @@ public:
* All the attributes always have the same size and
* the management of holes is shared by all attributes
*/
class AttributeContainer
class CGoGN_CONTAINER_API AttributeContainer
{
public:
/**
......@@ -389,44 +398,44 @@ public:
/**
* initialize a line of the container (an element of each attribute)
*/
void initLine(unsigned int index);
inline void initLine(unsigned int index);
/**
* initialize all markers of a line of the container
*/
void initMarkersOfLine(unsigned int index);
inline void initMarkersOfLine(unsigned int index);
/**
* copy the content of line src in line dst
*/
void copyLine(unsigned int dstIndex, unsigned int srcIndex);
inline void copyLine(unsigned int dstIndex, unsigned int srcIndex);
/**
* increment the ref counter of the given line
* @param index index of the line
*/
void refLine(unsigned int index);
inline void refLine(unsigned int index);
/**
* decrement the ref counter of the given line
* @param index index of the line
* @return true if the line was removed
*/
bool unrefLine(unsigned int eltIdx);
inline bool unrefLine(unsigned int eltIdx);
/**
* get the number of refs of the given line
* @param index index of the line
* @return number of refs of the line
*/
unsigned int getNbRefs(unsigned int index) const;
inline unsigned int getNbRefs(unsigned int index) const;
/**
* set the number of refs of the given line
* @param index index of the line
* @param nb number of refs
*/
void setNbRefs(unsigned int eltIdx, unsigned int nb);
inline void setNbRefs(unsigned int eltIdx, unsigned int nb);
/**************************************
* ATTRIBUTES MANAGEMENT *
......@@ -435,12 +444,12 @@ public:
/**
* copy the data of attribute src in attribute dst (type has to be the same)
*/
bool copyAttribute(unsigned int dstIndex, unsigned int srcIndex);
inline bool copyAttribute(unsigned int dstIndex, unsigned int srcIndex);
/**
* swap the data of attribute 1 with attribute 2 (type has to be the same)
*/
bool swapAttributes(unsigned int index1, unsigned int index2);
inline bool swapAttributes(unsigned int index1, unsigned int index2);
/**************************************
* ATTRIBUTES DATA ACCESS *
......@@ -455,7 +464,7 @@ public:
template<typename T>
AttributeMultiVector<T>* getDataVector(unsigned int attrIndex);
AttributeMultiVectorGen* getVirtualDataVector(unsigned int attrIndex);
inline AttributeMultiVectorGen* getVirtualDataVector(unsigned int attrIndex);
/**
......@@ -465,7 +474,7 @@ public:
template<typename T>
AttributeMultiVector<T>* getDataVector(const std::string& attribName);
AttributeMultiVectorGen* getVirtualDataVector(const std::string& attribName);
inline AttributeMultiVectorGen* getVirtualDataVector(const std::string& attribName);
/**
* get a given element of a given attribute
......@@ -541,8 +550,504 @@ public:
};
} // namespace CGoGN
#include "attributeContainer.hpp"
#endif
///**
//* Container for AttributeMultiVectors
//* All the attributes always have the same size and
//* the management of holes is shared by all attributes
//*/
//class CGoGN_CONTAINTER_API AttributeContainer
//{
//public:
// /**
// * constante d'attribut inconnu
// */
// static const unsigned int UNKNOWN = 0xffffffff;
//
// /**
// * Taille du bloc
// */
// // static const unsigned int BlockSize = _BLOCKSIZE_;
//
//protected:
// /**
// * vector of pointers to AttributeMultiVectors
// */
// std::vector<AttributeMultiVectorGen*> m_tableAttribs;
//
// /**
// * vector of pointers to AttributeMultiVectors of MarkerBool
// */
// std::vector<AttributeMultiVector<MarkerBool>*> m_tableMarkerAttribs;
//
// /**
// * vector of free indices in the vector of AttributeMultiVectors
// */
// std::vector<unsigned int> m_freeIndices;
//
// /**
// * vector of pointers to HoleBlockRef -> structure that manages holes and refs
// */
// std::vector<HoleBlockRef*> m_holesBlocks;
//
// /**
// * vector of indices of blocks that have free space
// */
// std::vector<unsigned int> m_tableBlocksWithFree;
//
// /**
// * vector of indices of blocks that are empty
// */
// std::vector<unsigned int> m_tableBlocksEmpty;
//
// ContainerBrowser* m_currentBrowser;
//
// /**
// * orbit of the container
// */
// unsigned int m_orbit;
//
// /**
// * number of attributes
// */
// unsigned int m_nbAttributes;
//
// /**
// * counter for attributes without name
// */
// unsigned int m_nbUnknown;
//
// /**
// * size (number of elts) of the container
// */
// unsigned int m_size;
//
// /**
// * size of the container with holes
// */
// unsigned int m_maxSize;
//
// /**
// * memory cost of each line
// */
// unsigned int m_lineCost;
//
// /**
// * map pointer (shared for all container of the same map) for attribute registration
// */
// std::map<std::string, RegisteredBaseAttribute*>* m_attributes_registry_map;
//
//public:
// CGoGN_XX_API AttributeContainer();
//
// CGoGN_XX_API ~AttributeContainer();
//
// unsigned int getOrbit() const;
//
// void setOrbit(unsigned int orbit);
//
// void setRegistry(std::map<std::string, RegisteredBaseAttribute*>* re);
//
// void setContainerBrowser(ContainerBrowser* bro) { m_currentBrowser = bro; }
//
// bool hasBrowser() { return m_currentBrowser != NULL; }
//
// /**************************************
// * BASIC FEATURES *
// **************************************/
//
// /**
// * add a new attribute to the container
// * @param T (template) type of the new attribute
// * @param attribName name of the new attribute
// * @return pointer to the new AttributeMultiVector
// */
// template <typename T>
// AttributeMultiVector<T>* addAttribute(const std::string& attribName);
//
// /// special version for marker
// CGoGN_XX_API AttributeMultiVector<MarkerBool>* addMarkerAttribute(const std::string& attribName);
//
//
// /**
// * add a new attribute to the container
// * @param typeName type of the new attribute in a string
// * @param attribName name of the new attribute
// * @return pointer to the new AttributeMultiVectorGen (unknown type inside)
// */
// CGoGN_XX_API AttributeMultiVectorGen* addAttribute(const std::string& typeName, const std::string& attribName);
//
//
//protected:
// /**
// * add a new attribute with a given index (for load only)
// * @param T (template) type of the new attribute
// * @param attribName name of the new attribute
// * @param typeName name of the new attribute's type
// * @param index index of the new attribute
// */
// template <typename T>
// void addAttribute(const std::string& attribName, const std::string& typeName, unsigned int index);
//
//public:
// /**
// * Remove an attribute (destroys data)
// * @param attribName name of the attribute to remove
// * @return removed or not
// */
// template <typename T>
// bool removeAttribute(const std::string& attribName);
//
// CGoGN_XX_API bool removeMarkerAttribute(const std::string& attribName);
//
// /**
// * Remove an attribute (destroys data)
// * @param index index of the attribute to remove
// * @return removed or not
// */
// template <typename T>
// bool removeAttribute(unsigned int index);
//
// /**************************************
// * INFO ABOUT THE CONTAINER *
// **************************************/
//
// /**
// * Number of attributes of the container
// */
// unsigned int getNbAttributes() const;
//
// /**
// * Size of the container (number of lines)
// */
// unsigned int size() const;
//
// /**
// * Capacity of the container (number of lines including holes)
// */
// unsigned int capacity() const;
//
// /**
// * Total memory cost of container
// */
// unsigned int memoryTotalSize() const;
//
// /**
// * Memory cost of every used line
// */
// unsigned int memorySize() const;
//
// /**
// * is the line used in the container
// */
// inline bool used(unsigned int index) const;
//
// /**
// * @brief check if container contain marker attribute
// */
// CGoGN_XX_API bool hasMarkerAttribute() const;
//
// /**************************************
// * CONTAINER TRAVERSAL *
// **************************************/
//
// /**
// * return the index of the first line of the container
// */
// unsigned int begin() const;
//
// /**
// * return the index after the last line of the container
// */
// unsigned int end() const;
//
// /**
// * get the index of the line after it in the container
// * MUST BE USED INSTEAD OF ++ !
// */
// void next(unsigned int &it) const;
//
//
//
// /**
// * return the index of the first line of the container
// */
// unsigned int realBegin() const;
//
// /**
// * return the index after the last line of the container
// */
// unsigned int realEnd() const;
//
// /**
// * get the index of the line after it in the container
// * MUST BE USED INSTEAD OF ++ !
// */
// void realNext(unsigned int &it) const;
//
//
// /**
// * return the index of the last line of the container
// */
// unsigned int realRBegin() const;
//
// /**
// * return the index before the first line of the container
// */
// unsigned int realREnd() const;
//
// /**
// * get the index of the line before "it" in the container
// * MUST BE USED INSTEAD OF ++ !
// */
// void realRNext(unsigned int &it) const;
//
// /**************************************
// * INFO ABOUT ATTRIBUTES *
// **************************************/
//
// /**
// * recuperation du code d'un attribut
// * @param attribName nom de l'attribut
// * @return l'indice de l'attribut
// */
// CGoGN_XX_API unsigned int getAttributeIndex(const std::string& attribName) const;
//
// /**