From: abd Date: Thu, 28 Aug 2008 09:50:28 +0000 (+0000) Subject: Fix compilation problems on Win32 platform X-Git-Tag: EndIntegAG1302~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d175964e7976f63ebb31fb1d3bc88405e78cc104;p=tools%2Fmedcoupling.git Fix compilation problems on Win32 platform --- diff --git a/src/INTERP_KERNEL/BoundingBox.hxx b/src/INTERP_KERNEL/BoundingBox.hxx index 0715ba3f9..0e96a5bda 100644 --- a/src/INTERP_KERNEL/BoundingBox.hxx +++ b/src/INTERP_KERNEL/BoundingBox.hxx @@ -1,6 +1,7 @@ #ifndef __BOUNDINGBOX_HXX__ #define __BOUNDINGBOX_HXX__ +#include #include namespace INTERP_KERNEL @@ -10,7 +11,7 @@ namespace INTERP_KERNEL * \brief Class representing the bounding box of a number of points. * */ - class BoundingBox + class INTERPKERNEL_EXPORT BoundingBox { public: diff --git a/src/INTERP_KERNEL/ConvexIntersector.hxx b/src/INTERP_KERNEL/ConvexIntersector.hxx index 52c5f9bae..60c927024 100644 --- a/src/INTERP_KERNEL/ConvexIntersector.hxx +++ b/src/INTERP_KERNEL/ConvexIntersector.hxx @@ -7,7 +7,7 @@ namespace INTERP_KERNEL { template - class ConvexIntersector: public PlanarIntersector + class INTERPKERNEL_EXPORT ConvexIntersector: public PlanarIntersector { public: ConvexIntersector(const NormalizedUnstructuredMesh& mesh_A, diff --git a/src/INTERP_KERNEL/Geometric2D/AbstractEdge.hxx b/src/INTERP_KERNEL/Geometric2D/AbstractEdge.hxx index ec2e21e5b..6c0da69ab 100644 --- a/src/INTERP_KERNEL/Geometric2D/AbstractEdge.hxx +++ b/src/INTERP_KERNEL/Geometric2D/AbstractEdge.hxx @@ -1,6 +1,8 @@ #ifndef __ABSTRACTEDGE_HXX__ #define __ABSTRACTEDGE_HXX__ +#include "Geometric2D_defines.hxx" + #include #include @@ -14,7 +16,7 @@ namespace INTERP_KERNEL class ComposedEdge; class ElementaryEdge; - class IteratorOnComposedEdge + class GEOMETRIC2D_EXPORT IteratorOnComposedEdge { friend class AbstractEdge; friend class ComposedEdge; @@ -44,7 +46,7 @@ namespace INTERP_KERNEL mutable ItOnFixdLev _current[MAX_INTERSCT_DEPH]; }; - class AbstractEdge + class GEOMETRIC2D_EXPORT AbstractEdge { public: virtual ~AbstractEdge() { } diff --git a/src/INTERP_KERNEL/Geometric2D/Bounds.hxx b/src/INTERP_KERNEL/Geometric2D/Bounds.hxx index 6b3553786..8ae859040 100644 --- a/src/INTERP_KERNEL/Geometric2D/Bounds.hxx +++ b/src/INTERP_KERNEL/Geometric2D/Bounds.hxx @@ -1,6 +1,8 @@ #ifndef __BOUNDS_HXX__ #define __BOUNDS_HXX__ +#include "Geometric2D_defines.hxx" + namespace INTERP_KERNEL { /*! @@ -14,7 +16,7 @@ namespace INTERP_KERNEL ON_BOUNDARY_NEG = 3 } Position; - class Bounds + class GEOMETRIC2D_EXPORT Bounds { public: Bounds():_xMin(0),_xMax(0.),_yMin(0.),_yMax(0.) { } diff --git a/src/INTERP_KERNEL/Geometric2D/ComposedEdge.hxx b/src/INTERP_KERNEL/Geometric2D/ComposedEdge.hxx index 16a24adf1..684e92fef 100644 --- a/src/INTERP_KERNEL/Geometric2D/ComposedEdge.hxx +++ b/src/INTERP_KERNEL/Geometric2D/ComposedEdge.hxx @@ -1,13 +1,15 @@ #ifndef __COMPOSEDNODE_HXX__ #define __COMPOSEDNODE_HXX__ +#include "Geometric2D_defines.hxx" + #include "AbstractEdge.hxx" #include namespace INTERP_KERNEL { - class ComposedEdge : public AbstractEdge + class GEOMETRIC2D_EXPORT ComposedEdge : public AbstractEdge { public: ComposedEdge() { } diff --git a/src/INTERP_KERNEL/Geometric2D/ComposedEdgeWithIt.hxx b/src/INTERP_KERNEL/Geometric2D/ComposedEdgeWithIt.hxx index ff31eb129..ee7426ee2 100644 --- a/src/INTERP_KERNEL/Geometric2D/ComposedEdgeWithIt.hxx +++ b/src/INTERP_KERNEL/Geometric2D/ComposedEdgeWithIt.hxx @@ -1,13 +1,15 @@ #ifndef __COMPOSEDNODEWITHIT_HXX__ #define __COMPOSEDNODEWITHIT_HXX__ +#include "Geometric2D_defines.hxx" + #include "ComposedEdge.hxx" #include namespace INTERP_KERNEL { - class ComposedEdgeWithIt : public ComposedEdge + class GEOMETRIC2D_EXPORT ComposedEdgeWithIt : public ComposedEdge { public: ComposedEdgeWithIt():_iterator(this) { } diff --git a/src/INTERP_KERNEL/Geometric2D/Edge.hxx b/src/INTERP_KERNEL/Geometric2D/Edge.hxx index 2a72b6c39..f44fc578d 100644 --- a/src/INTERP_KERNEL/Geometric2D/Edge.hxx +++ b/src/INTERP_KERNEL/Geometric2D/Edge.hxx @@ -1,6 +1,8 @@ #ifndef __EDGE_HXX__ #define __EDGE_HXX__ +#include "Geometric2D_defines.hxx" + #include "InterpolationUtils.hxx" #include "ComposedEdge.hxx" #include "Bounds.hxx" @@ -42,7 +44,7 @@ namespace INTERP_KERNEL FULL_UNKNOWN = 3 } TypeOfEdgeLocInPolygon; - class MergePoints + class GEOMETRIC2D_EXPORT MergePoints { public: MergePoints(); @@ -71,7 +73,7 @@ namespace INTERP_KERNEL unsigned _ass2End2 : 1; }; - class IntersectElement + class GEOMETRIC2D_EXPORT IntersectElement { public: IntersectElement(double val1, double val2, bool start1, bool end1, bool start2, bool end2, Node *node, const Edge& e1, const Edge& e2, bool keepOrder); @@ -105,7 +107,7 @@ namespace INTERP_KERNEL static const unsigned NO_LIMIT = 19; }; - class Intersector + class GEOMETRIC2D_EXPORT Intersector { protected: //! All non symetric methods are relative to 'e1'. @@ -130,14 +132,14 @@ namespace INTERP_KERNEL const Edge& _e2; }; - class SameTypeIntersector : public Intersector + class GEOMETRIC2D_EXPORT SameTypeIntersector : public Intersector { protected: SameTypeIntersector(const Edge& e1, const Edge& e2):Intersector(e1,e2) { } bool keepOrder() const { return true; } }; - class CrossTypeIntersector : public Intersector + class GEOMETRIC2D_EXPORT CrossTypeIntersector : public Intersector { protected: CrossTypeIntersector(const Edge& e1, const Edge& e2, bool reverse):Intersector(e1,e2),_reverse(reverse) { } @@ -157,7 +159,7 @@ namespace INTERP_KERNEL /*! * Deal with an oriented edge of a polygon. */ - class Edge + class GEOMETRIC2D_EXPORT Edge { public: Edge(Node *start, Node *end, bool direction=true):_cnt(1),_loc(FULL_UNKNOWN) { if(direction) { _start=start; _end=end; } else { _start=end; _end=start; } _start->incrRef(); _end->incrRef(); } diff --git a/src/INTERP_KERNEL/Geometric2D/EdgeArcCircle.hxx b/src/INTERP_KERNEL/Geometric2D/EdgeArcCircle.hxx index d8868d231..709c2e608 100644 --- a/src/INTERP_KERNEL/Geometric2D/EdgeArcCircle.hxx +++ b/src/INTERP_KERNEL/Geometric2D/EdgeArcCircle.hxx @@ -1,11 +1,13 @@ #ifndef __EDGEARCCIRCLE_HXX__ #define __EDGEARCCIRCLE_HXX__ +#include "Geometric2D_defines.hxx" + #include "Edge.hxx" namespace INTERP_KERNEL { - class ArcCArcCIntersector : public SameTypeIntersector + class GEOMETRIC2D_EXPORT ArcCArcCIntersector : public SameTypeIntersector { friend class EdgeArcCircle; public: @@ -21,7 +23,7 @@ namespace INTERP_KERNEL //! 'delta' 'start' in ]-Pi;Pi[ static bool isAngleNotIn(double start, double delta, double angleIn); //! for an angle 'angle' in ]-3*Pi;3*Pi[ returns angle in ]-Pi;Pi[ - static double normalizeAngle(double angle) { if(angle>M_PI) return angle-2.*M_PI; if(angle<-M_PI) return angle+2.*M_PI; return angle; } + static double normalizeAngle(double angle) { if(angle> M_PI) return angle-2.*M_PI; if(angle<-M_PI) return angle+2.*M_PI; return angle; } private: const EdgeArcCircle& getE1() const { return (const EdgeArcCircle&)_e1; } const EdgeArcCircle& getE2() const { return (const EdgeArcCircle&)_e2; } diff --git a/src/INTERP_KERNEL/Geometric2D/EdgeInfLin.hxx b/src/INTERP_KERNEL/Geometric2D/EdgeInfLin.hxx index 3f47b9ade..3cee120c6 100644 --- a/src/INTERP_KERNEL/Geometric2D/EdgeInfLin.hxx +++ b/src/INTERP_KERNEL/Geometric2D/EdgeInfLin.hxx @@ -1,11 +1,13 @@ #ifndef __EDGEINFLIN_HXX__ #define __EDGEINFLIN_HXX__ +#include "Geometric2D_defines.hxx" + #include "EdgeLin.hxx" namespace INTERP_KERNEL { - class EdgeInfLin : public EdgeLin + class GEOMETRIC2D_EXPORT EdgeInfLin : public EdgeLin { public: EdgeInfLin(Node *start, Node *end):EdgeLin(start,end,true) { } diff --git a/src/INTERP_KERNEL/Geometric2D/EdgeLin.cxx b/src/INTERP_KERNEL/Geometric2D/EdgeLin.cxx index fd4b86178..bd042f7f4 100644 --- a/src/INTERP_KERNEL/Geometric2D/EdgeLin.cxx +++ b/src/INTERP_KERNEL/Geometric2D/EdgeLin.cxx @@ -49,7 +49,8 @@ void SegSegIntersector::getCurveAbscisse(Node *node, TypeOfLocInEdge& where, Mer obviousCaseForCurvAbscisse(node,where,commonNode,obvious); if(obvious) return ; - double ret=((*node)[!_ind]-(*_e1.getStartNode())[!_ind])/((*_e1.getEndNode())[!_ind]-(*_e1.getStartNode())[!_ind]); + int index = !_ind; + double ret=((*node)[index]-(*_e1.getStartNode())[index])/((*_e1.getEndNode())[index]-(*_e1.getStartNode())[index]); if(ret>0. && ret <1.) where=INSIDE; else if(ret<0.) diff --git a/src/INTERP_KERNEL/Geometric2D/EdgeLin.hxx b/src/INTERP_KERNEL/Geometric2D/EdgeLin.hxx index 23cde4982..1cf341f63 100644 --- a/src/INTERP_KERNEL/Geometric2D/EdgeLin.hxx +++ b/src/INTERP_KERNEL/Geometric2D/EdgeLin.hxx @@ -1,11 +1,13 @@ #ifndef __EDGELIN_HXX__ #define __EDGELIN_HXX__ +#include "Geometric2D_defines.hxx" + #include "Edge.hxx" namespace INTERP_KERNEL { - class SegSegIntersector : SameTypeIntersector + class GEOMETRIC2D_EXPORT SegSegIntersector : SameTypeIntersector { friend class Edge; public: @@ -24,7 +26,7 @@ namespace INTERP_KERNEL double _matrix[4];//SPACEDIM*SPACEDIM }; - class EdgeLin : public Edge + class GEOMETRIC2D_EXPORT EdgeLin : public Edge { friend class SegSegIntersector; public: diff --git a/src/INTERP_KERNEL/Geometric2D/ElementaryEdge.hxx b/src/INTERP_KERNEL/Geometric2D/ElementaryEdge.hxx index ae2dab936..a3be02924 100644 --- a/src/INTERP_KERNEL/Geometric2D/ElementaryEdge.hxx +++ b/src/INTERP_KERNEL/Geometric2D/ElementaryEdge.hxx @@ -1,13 +1,15 @@ #ifndef __ELEMENTARYEDGE_HXX__ #define __ELEMENTARYEDGE_HXX__ +#include "Geometric2D_defines.hxx" + #include "AbstractEdge.hxx" #include "InterpolationUtils.hxx" #include "Edge.hxx" namespace INTERP_KERNEL { - class ElementaryEdge : public AbstractEdge + class GEOMETRIC2D_EXPORT ElementaryEdge : public AbstractEdge { public: ElementaryEdge(Edge *ptr, bool direction):_direction(direction),_ptr(ptr) { } diff --git a/src/INTERP_KERNEL/Geometric2D/Geometric2D_defines.hxx b/src/INTERP_KERNEL/Geometric2D/Geometric2D_defines.hxx new file mode 100755 index 000000000..e29fa807c --- /dev/null +++ b/src/INTERP_KERNEL/Geometric2D/Geometric2D_defines.hxx @@ -0,0 +1,22 @@ + +#ifndef __GEOMETRIC2D_DEFINES_HXX__ +#define __GEOMETRIC2D_DEFINES_HXX__ + +//export symbols +#ifdef WIN32 +# ifdef GEOMETRIC2D_EXPORTS +# define GEOMETRIC2D_EXPORT __declspec(dllexport) +# else +# define GEOMETRIC2D_EXPORT __declspec(dllimport) +# endif +#else +# define GEOMETRIC2D_EXPORT +#endif + +#ifdef WIN32 +# include +# define fmax __max +# define fmin __min +#endif + +#endif //__GEOMETRIC2D_DEFINES_HXX__ \ No newline at end of file diff --git a/src/INTERP_KERNEL/Geometric2D/Node.cxx b/src/INTERP_KERNEL/Geometric2D/Node.cxx index 1f88b6d94..902ae7cb1 100644 --- a/src/INTERP_KERNEL/Geometric2D/Node.cxx +++ b/src/INTERP_KERNEL/Geometric2D/Node.cxx @@ -43,9 +43,9 @@ bool Node::decrRef() bool Node::isEqual(const Node& other) const { - const unsigned SPACEDIM=2; + const int SPACEDIM=2; bool ret=true; - for(unsigned i=0;i @@ -24,7 +26,7 @@ namespace INTERP_KERNEL /*! * As nodes can be shared between edges it is dealed with ref counting. */ - class Node + class GEOMETRIC2D_EXPORT Node { public: Node(double x, double y); @@ -44,7 +46,7 @@ namespace INTERP_KERNEL bool isEqualAndKeepTrack(const Node& other, std::vector& track) const; void dumpInXfigFile(std::ostream& stream, int resolution, const Bounds& box) const; double distanceWithSq(const Node& other) const; - double operator[](int i) const { return _coords[i]; } + double operator[]( int i) const { return _coords[i]; } //!for tests only ! void setNewCoords(double x, double y) { _coords[0]=x; _coords[1]=y; } static double sign(double val) { if(val>=0) return 1.; else return -1.; } diff --git a/src/INTERP_KERNEL/Geometric2D/Precision.hxx b/src/INTERP_KERNEL/Geometric2D/Precision.hxx index 9eb3d275e..64273aee9 100644 --- a/src/INTERP_KERNEL/Geometric2D/Precision.hxx +++ b/src/INTERP_KERNEL/Geometric2D/Precision.hxx @@ -1,6 +1,9 @@ + +#include "Geometric2D_defines.hxx" + namespace INTERP_KERNEL { - class QUADRATIC_PLANAR + class GEOMETRIC2D_EXPORT QUADRATIC_PLANAR { public: static double _precision; diff --git a/src/INTERP_KERNEL/Geometric2D/QuadraticPolygon.hxx b/src/INTERP_KERNEL/Geometric2D/QuadraticPolygon.hxx index 9096db02d..21103c78b 100644 --- a/src/INTERP_KERNEL/Geometric2D/QuadraticPolygon.hxx +++ b/src/INTERP_KERNEL/Geometric2D/QuadraticPolygon.hxx @@ -1,6 +1,8 @@ #ifndef __QUADRATICPOLYGON_HXX__ #define __QUADRATICPOLYGON_HXX__ +#include "Geometric2D_defines.hxx" + #include "ComposedEdge.hxx" #include @@ -10,7 +12,7 @@ namespace INTERP_KERNEL class Edge; class MergePoints; - class QuadraticPolygon : public ComposedEdge + class GEOMETRIC2D_EXPORT QuadraticPolygon : public ComposedEdge { public: QuadraticPolygon() { } diff --git a/src/INTERP_KERNEL/Geometric2DIntersector.hxx b/src/INTERP_KERNEL/Geometric2DIntersector.hxx index 795049c04..deaf8b275 100644 --- a/src/INTERP_KERNEL/Geometric2DIntersector.hxx +++ b/src/INTERP_KERNEL/Geometric2DIntersector.hxx @@ -8,7 +8,7 @@ namespace INTERP_KERNEL class QuadraticPolygon; template - class Geometric2DIntersector : public PlanarIntersector + class INTERPKERNEL_EXPORT Geometric2DIntersector : public PlanarIntersector { public: Geometric2DIntersector(const NormalizedUnstructuredMesh& mesh_A, diff --git a/src/INTERP_KERNEL/Geometric2DIntersector.txx b/src/INTERP_KERNEL/Geometric2DIntersector.txx index 90e02f173..f0502120e 100644 --- a/src/INTERP_KERNEL/Geometric2DIntersector.txx +++ b/src/INTERP_KERNEL/Geometric2DIntersector.txx @@ -9,10 +9,10 @@ namespace INTERP_KERNEL { - namespace QUADRATIC_PLANAR + /*namespace QUADRATIC_PLANAR { extern double _precision; - } + }*/ template Geometric2DIntersector::Geometric2DIntersector(const NormalizedUnstructuredMesh& mesh_A, diff --git a/src/INTERP_KERNEL/INTERPKERNEL_defines.hxx b/src/INTERP_KERNEL/INTERPKERNEL_defines.hxx new file mode 100755 index 000000000..18086a7e2 --- /dev/null +++ b/src/INTERP_KERNEL/INTERPKERNEL_defines.hxx @@ -0,0 +1,15 @@ +#ifndef __INTERPKERNEL_DEFINES_HXX__ +#define __INTERPKERNEL_DEFINES_HXX__ + +//export symbols +#ifdef WIN32 +# ifdef INTERPKERNEL_EXPORTS +# define INTERPKERNEL_EXPORT __declspec(dllexport) +# else +# define INTERPKERNEL_EXPORT __declspec(dllimport) +# endif +#else +# define INTERPKERNEL_EXPORT +#endif + +#endif //__INTERPKERNEL_DEFINES_HXX__ diff --git a/src/INTERP_KERNEL/InterpKernelMatrix.hxx b/src/INTERP_KERNEL/InterpKernelMatrix.hxx index 1d326aa0d..4525b3c7e 100755 --- a/src/INTERP_KERNEL/InterpKernelMatrix.hxx +++ b/src/INTERP_KERNEL/InterpKernelMatrix.hxx @@ -20,7 +20,7 @@ namespace INTERP_KERNEL std::istream& operator>>(std::istream& in, Matrix& m); template - class Matrix + class INTERPKERNEL_EXPORT Matrix { class Row : public std::vector< typename std::pair > { @@ -45,10 +45,10 @@ namespace INTERP_KERNEL }; private: - uint _nb_rows; + unsigned int _nb_rows; T* _coeffs; - uint* _cols; - std::vector _ncols_offset; + unsigned int* _cols; + std::vector _ncols_offset; std::vector< Row > _auxiliary_matrix; friend std::ostream& operator<<<>(std::ostream& in, const Matrix& m); friend std::istream& operator>><>(std::istream& in, Matrix& m); @@ -113,7 +113,7 @@ namespace INTERP_KERNEL } /*! declares a method that specifies the number of rows */ - void resize(uint nbrows) + void resize(unsigned int nbrows) { _nb_rows=nbrows; _auxiliary_matrix.resize(nbrows); @@ -152,7 +152,7 @@ namespace INTERP_KERNEL for (int i=0; i< _nb_rows; i++) { output[i]=0; - for (int j=_ncols_offset[i]; j< _ncols_offset[i+1]; j++) { + for (unsigned int j=_ncols_offset[i]; j< _ncols_offset[i+1]; j++) { int icol = _cols[j]; output[i]+=input[icol]*_coeffs[j]; } @@ -168,16 +168,16 @@ namespace INTERP_KERNEL { _ncols_offset.resize(_nb_rows+1); _ncols_offset[0]=0; - for (int i=0; i<_nb_rows; i++) + for (unsigned int i=0; i<_nb_rows; i++) _ncols_offset[i+1]=_ncols_offset[i]+_auxiliary_matrix[i].size(); int nbcoeffs= _ncols_offset[_nb_rows]; - _cols=new uint[nbcoeffs]; + _cols=new unsigned int[nbcoeffs]; _coeffs=new T[nbcoeffs]; - uint* cols_ptr=_cols; + unsigned int* cols_ptr=_cols; T* coeffs_ptr=_coeffs; - for (uint i=0; i<_nb_rows; i++) + for (unsigned int i=0; i<_nb_rows; i++) { - for (uint j=0; j<_auxiliary_matrix[i].size(); j++) + for (unsigned int j=0; j<_auxiliary_matrix[i].size(); j++) { *cols_ptr++ = OTT::ind2C(_auxiliary_matrix[i][j].first); *coeffs_ptr++ = _auxiliary_matrix[i][j].second; @@ -190,7 +190,7 @@ namespace INTERP_KERNEL /*! * 0 <= irow < n */ - Row &operator [] (uint irow) + Row &operator [] (unsigned int irow) { return _auxiliary_matrix[irow]; } diff --git a/src/INTERP_KERNEL/Interpolation.hxx b/src/INTERP_KERNEL/Interpolation.hxx index 7f13d8792..5a7a1e0fe 100644 --- a/src/INTERP_KERNEL/Interpolation.hxx +++ b/src/INTERP_KERNEL/Interpolation.hxx @@ -12,7 +12,7 @@ namespace INTERP_KERNEL { template - class Interpolation + class INTERPKERNEL_EXPORT Interpolation { public: Interpolation() { } diff --git a/src/INTERP_KERNEL/Interpolation2D.hxx b/src/INTERP_KERNEL/Interpolation2D.hxx index 800736b28..9eecb454a 100755 --- a/src/INTERP_KERNEL/Interpolation2D.hxx +++ b/src/INTERP_KERNEL/Interpolation2D.hxx @@ -5,7 +5,7 @@ namespace INTERP_KERNEL { - class Interpolation2D : public InterpolationPlanar + class INTERPKERNEL_EXPORT Interpolation2D : public InterpolationPlanar { public: Interpolation2D() { } diff --git a/src/INTERP_KERNEL/Interpolation3D.hxx b/src/INTERP_KERNEL/Interpolation3D.hxx index 04a6c7f64..125996348 100644 --- a/src/INTERP_KERNEL/Interpolation3D.hxx +++ b/src/INTERP_KERNEL/Interpolation3D.hxx @@ -7,7 +7,7 @@ namespace INTERP_KERNEL { - class Interpolation3D : public Interpolation + class INTERPKERNEL_EXPORT Interpolation3D : public Interpolation { public: Interpolation3D(); diff --git a/src/INTERP_KERNEL/Interpolation3D.txx b/src/INTERP_KERNEL/Interpolation3D.txx index df76196f1..253a98b6b 100644 --- a/src/INTERP_KERNEL/Interpolation3D.txx +++ b/src/INTERP_KERNEL/Interpolation3D.txx @@ -70,8 +70,8 @@ namespace INTERP_KERNEL LOG(2, "Source mesh has " << numSrcElems << " elements and target mesh has " << numTargetElems << " elements "); - MeshElement* srcElems[numSrcElems]; - MeshElement* targetElems[numTargetElems]; + std::vector*> srcElems(numSrcElems); + std::vector*> targetElems(numTargetElems); std::map*, int> indices; diff --git a/src/INTERP_KERNEL/Interpolation3DSurf.hxx b/src/INTERP_KERNEL/Interpolation3DSurf.hxx index 9b7b61652..656d80413 100644 --- a/src/INTERP_KERNEL/Interpolation3DSurf.hxx +++ b/src/INTERP_KERNEL/Interpolation3DSurf.hxx @@ -5,7 +5,7 @@ namespace INTERP_KERNEL { - class Interpolation3DSurf : public InterpolationPlanar + class INTERPKERNEL_EXPORT Interpolation3DSurf : public InterpolationPlanar { public: Interpolation3DSurf(); diff --git a/src/INTERP_KERNEL/InterpolationPlanar.hxx b/src/INTERP_KERNEL/InterpolationPlanar.hxx index d9aa7b703..9a079fa74 100755 --- a/src/INTERP_KERNEL/InterpolationPlanar.hxx +++ b/src/INTERP_KERNEL/InterpolationPlanar.hxx @@ -10,7 +10,7 @@ namespace INTERP_KERNEL typedef enum {Triangulation, Convex, Geometric2D, Generic} IntersectionType; template - class InterpolationPlanar : public Interpolation< InterpolationPlanar > + class INTERPKERNEL_EXPORT InterpolationPlanar : public Interpolation< InterpolationPlanar > { private: int _printLevel; diff --git a/src/INTERP_KERNEL/InterpolationUtils.hxx b/src/INTERP_KERNEL/InterpolationUtils.hxx index af61e9d19..1efd06792 100644 --- a/src/INTERP_KERNEL/InterpolationUtils.hxx +++ b/src/INTERP_KERNEL/InterpolationUtils.hxx @@ -1,6 +1,8 @@ #ifndef _INTERPOLATIONUTILS_HXX_ #define _INTERPOLATIONUTILS_HXX_ +#include + #include "NormalizedUnstructuredMesh.hxx" #include diff --git a/src/INTERP_KERNEL/IntersectorHexa.hxx b/src/INTERP_KERNEL/IntersectorHexa.hxx index 526573e3f..d2f04198b 100644 --- a/src/INTERP_KERNEL/IntersectorHexa.hxx +++ b/src/INTERP_KERNEL/IntersectorHexa.hxx @@ -13,7 +13,7 @@ namespace INTERP_KERNEL * */ template - class IntersectorHexa : public TargetIntersector + class INTERPKERNEL_EXPORT IntersectorHexa : public TargetIntersector { public: diff --git a/src/INTERP_KERNEL/IntersectorTetra.hxx b/src/INTERP_KERNEL/IntersectorTetra.hxx index 4b4160342..1da074520 100644 --- a/src/INTERP_KERNEL/IntersectorTetra.hxx +++ b/src/INTERP_KERNEL/IntersectorTetra.hxx @@ -10,12 +10,18 @@ #include #include #include -#include +#ifdef WIN32 +# include +#else +# include +#endif #include "MEDMEM_define.hxx" #include "MEDMEM_CellModel.hxx" +#ifndef WIN32 using __gnu_cxx::hash_map; +#endif namespace INTERP_KERNEL { @@ -23,7 +29,7 @@ namespace INTERP_KERNEL * \brief Class representing a triangular face, used as key in caching hash map in IntersectorTetra. * */ - class TriangleFaceKey + class INTERPKERNEL_EXPORT TriangleFaceKey { public: @@ -64,6 +70,13 @@ namespace INTERP_KERNEL { return _hashVal; } + +#ifdef WIN32 + operator size_t () const + { + return _hashVal; + } +#endif inline void sort3Ints(int* sorted, int node1, int node2, int node3); @@ -121,10 +134,11 @@ namespace INTERP_KERNEL } } } - +#ifndef WIN32 namespace __gnu_cxx { + /** * \brief Template specialization of __gnu_cxx::hash function object for use with a __gnu_cxx::hash_map * with TriangleFaceKey as key class. @@ -132,6 +146,7 @@ namespace __gnu_cxx */ template<> class hash + { public: /** @@ -146,6 +161,16 @@ namespace __gnu_cxx } }; } +#else + struct TriangleFaceKeyComparator + { + bool operator()(const INTERP_KERNEL::TriangleFaceKey& key1, + const INTERP_KERNEL::TriangleFaceKey& key2 ) const + { + return key1.hashVal() < key2.hashVal(); + } + }; +#endif namespace INTERP_KERNEL { @@ -156,7 +181,7 @@ namespace INTERP_KERNEL * */ template - class IntersectorTetra : public TargetIntersector + class INTERPKERNEL_EXPORT IntersectorTetra : public TargetIntersector { public: @@ -194,7 +219,11 @@ namespace INTERP_KERNEL hash_map< int, double* > _nodes; /// hash_map relating triangular faces to calculated volume contributions, used for caching - hash_map< TriangleFaceKey, double > _volumes; + hash_map< TriangleFaceKey, double +#ifdef WIN32 + , hash_compare +#endif + > _volumes; /// reference to the source mesh const NormalizedUnstructuredMesh& _srcMesh; diff --git a/src/INTERP_KERNEL/IntersectorTetra.txx b/src/INTERP_KERNEL/IntersectorTetra.txx index cd4090e6d..f394287a2 100644 --- a/src/INTERP_KERNEL/IntersectorTetra.txx +++ b/src/INTERP_KERNEL/IntersectorTetra.txx @@ -157,7 +157,7 @@ namespace INTERP_KERNEL assert(faceModel.getDimension() == 2); - int faceNodes[faceModel.getNumberOfNodes()]; + std::vector faceNodes(faceModel.getNumberOfNodes()); // get the nodes of the face for(int j = 1; j <= faceModel.getNumberOfNodes(); ++j) diff --git a/src/INTERP_KERNEL/MEDNormalizedUnstructuredMesh.hxx b/src/INTERP_KERNEL/MEDNormalizedUnstructuredMesh.hxx index be8546611..8ee434ee2 100644 --- a/src/INTERP_KERNEL/MEDNormalizedUnstructuredMesh.hxx +++ b/src/INTERP_KERNEL/MEDNormalizedUnstructuredMesh.hxx @@ -1,6 +1,8 @@ #ifndef __MEDNORMALIZEDUNSTRUCTUREDMESH_HXX__ #define __MEDNORMALIZEDUNSTRUCTUREDMESH_HXX__ +#include + #include "NormalizedUnstructuredMesh.hxx" namespace MEDMEM @@ -9,7 +11,7 @@ namespace MEDMEM } template -class MEDNormalizedUnstructuredMesh : public INTERP_KERNEL::NormalizedUnstructuredMesh > +class INTERPKERNEL_EXPORT MEDNormalizedUnstructuredMesh : public INTERP_KERNEL::NormalizedUnstructuredMesh > { public: MEDNormalizedUnstructuredMesh(const MEDMEM::MESH *mesh); diff --git a/src/INTERP_KERNEL/MeshElement.hxx b/src/INTERP_KERNEL/MeshElement.hxx index 7b0394fc6..d13a2467f 100644 --- a/src/INTERP_KERNEL/MeshElement.hxx +++ b/src/INTERP_KERNEL/MeshElement.hxx @@ -13,7 +13,7 @@ namespace INTERP_KERNEL * easy bounding box intersection tests between MeshElements and collections of MeshElement (MeshRegions) */ template - class MeshElement + class INTERPKERNEL_EXPORT MeshElement { public: @@ -51,7 +51,7 @@ namespace INTERP_KERNEL * has a smaller YMIN is sorted before one with a larger YMIN. * */ - class ElementBBoxOrder + class INTERPKERNEL_EXPORT ElementBBoxOrder { public : diff --git a/src/INTERP_KERNEL/MeshElement.txx b/src/INTERP_KERNEL/MeshElement.txx index 13b859dee..49ffab789 100644 --- a/src/INTERP_KERNEL/MeshElement.txx +++ b/src/INTERP_KERNEL/MeshElement.txx @@ -23,7 +23,7 @@ namespace INTERP_KERNEL MeshElement::MeshElement(const ConnType index, const NormalizedUnstructuredMesh& mesh) : _index(index), _box(0), _number(mesh.getNumberOfNodesOfElement(index)) { - const double* vertices[_number]; + const double**vertices = new const double*[_number]; for(unsigned char i = 0 ; i < _number ; ++i) vertices[i] = getCoordsOfNode(i , index, mesh); diff --git a/src/INTERP_KERNEL/MeshRegion.hxx b/src/INTERP_KERNEL/MeshRegion.hxx index 6ea13181f..864d02858 100644 --- a/src/INTERP_KERNEL/MeshRegion.hxx +++ b/src/INTERP_KERNEL/MeshRegion.hxx @@ -15,7 +15,7 @@ namespace INTERP_KERNEL * */ template - class MeshRegion + class INTERPKERNEL_EXPORT MeshRegion { public: diff --git a/src/INTERP_KERNEL/MeshRegion.txx b/src/INTERP_KERNEL/MeshRegion.txx index 91d6610ab..e8e7c9a6e 100644 --- a/src/INTERP_KERNEL/MeshRegion.txx +++ b/src/INTERP_KERNEL/MeshRegion.txx @@ -47,7 +47,7 @@ namespace INTERP_KERNEL if(_box == 0) { - const double* pts[numNodes]; + const double** pts = new const double*[numNodes]; // get coordinates of the nodes of the element for(unsigned char i = 0 ; i < numNodes ; ++i) diff --git a/src/INTERP_KERNEL/PlanarIntersector.hxx b/src/INTERP_KERNEL/PlanarIntersector.hxx index 389f27f67..a200a46c6 100644 --- a/src/INTERP_KERNEL/PlanarIntersector.hxx +++ b/src/INTERP_KERNEL/PlanarIntersector.hxx @@ -10,7 +10,7 @@ namespace INTERP_KERNEL class TranslationRotationMatrix; template - class PlanarIntersector + class INTERPKERNEL_EXPORT PlanarIntersector { public: PlanarIntersector(double dimCaracteristic, double precision, double medianPlane, bool doRotate, int printLevel); diff --git a/src/INTERP_KERNEL/PointLocator.hxx b/src/INTERP_KERNEL/PointLocator.hxx index 43ec36fd3..2d6d59112 100644 --- a/src/INTERP_KERNEL/PointLocator.hxx +++ b/src/INTERP_KERNEL/PointLocator.hxx @@ -6,7 +6,7 @@ #include "PointLocatorAlgos.txx" namespace INTERP_KERNEL { -class PointLocator +class INTERPKERNEL_EXPORT PointLocator { public: PointLocator(const MEDMEM::MESH& mesh); diff --git a/src/INTERP_KERNEL/PointLocatorAlgos.txx b/src/INTERP_KERNEL/PointLocatorAlgos.txx index 7f18751c3..94ac407a4 100644 --- a/src/INTERP_KERNEL/PointLocatorAlgos.txx +++ b/src/INTERP_KERNEL/PointLocatorAlgos.txx @@ -105,7 +105,7 @@ namespace INTERP_KERNEL{ { //in 2D, nbedges==nbnodes int nbedges=nbnodes; - int sign[nbedges]; + int* sign = new int[nbedges]; for (int iedge=0; iedge::ind2C(conn_elem[iedge])); @@ -147,7 +147,7 @@ namespace INTERP_KERNEL{ } const MEDMEM::CELLMODEL& model=MEDMEM::CELLMODEL_Map::retrieveCellModel(elem_type); int nbfaces = model.getNumberOfConstituents(1); - int sign[nbfaces]; + int* sign = new int[nbfaces]; for (int iface=0; iface - class PolygonAlgorithms + class INTERPKERNEL_EXPORT PolygonAlgorithms { public: PolygonAlgorithms(double epsilon, double precision); diff --git a/src/INTERP_KERNEL/RegionNode.hxx b/src/INTERP_KERNEL/RegionNode.hxx index 0ea861014..5ffb1b6e4 100644 --- a/src/INTERP_KERNEL/RegionNode.hxx +++ b/src/INTERP_KERNEL/RegionNode.hxx @@ -12,7 +12,7 @@ namespace INTERP_KERNEL * in the bounding-box filtering process. */ template - class RegionNode + class INTERPKERNEL_EXPORT RegionNode { public: diff --git a/src/INTERP_KERNEL/Remapper.hxx b/src/INTERP_KERNEL/Remapper.hxx index a2344da50..64d5c07d9 100644 --- a/src/INTERP_KERNEL/Remapper.hxx +++ b/src/INTERP_KERNEL/Remapper.hxx @@ -9,7 +9,7 @@ namespace INTERP_KERNEL { -class Remapper +class INTERPKERNEL_EXPORT Remapper { public: Remapper(); diff --git a/src/INTERP_KERNEL/TargetIntersector.hxx b/src/INTERP_KERNEL/TargetIntersector.hxx index 61f895ea0..aed6f20b0 100644 --- a/src/INTERP_KERNEL/TargetIntersector.hxx +++ b/src/INTERP_KERNEL/TargetIntersector.hxx @@ -1,6 +1,8 @@ #ifndef __TARGETINTERSECTOR__HXX__ #define __TARGETINTERSECTOR__HXX__ +#include + namespace INTERP_KERNEL { /** @@ -9,7 +11,7 @@ namespace INTERP_KERNEL * with the source elements. */ template - class TargetIntersector + class INTERPKERNEL_EXPORT TargetIntersector { public: diff --git a/src/INTERP_KERNEL/TetraAffineTransform.hxx b/src/INTERP_KERNEL/TetraAffineTransform.hxx index d9e447a6a..835bdbb28 100644 --- a/src/INTERP_KERNEL/TetraAffineTransform.hxx +++ b/src/INTERP_KERNEL/TetraAffineTransform.hxx @@ -1,6 +1,8 @@ #ifndef __TETRA_AFFINE_TRANSFORM_HXX__ #define __TETRA_AFFINE_TRANSFORM_HXX__ +#include + #undef INVERSION_SELF_CHECK // debugging : check that calculated inverse is correct namespace INTERP_KERNEL @@ -11,7 +13,7 @@ namespace INTERP_KERNEL * into the unit tetrahedron. * */ - class TetraAffineTransform + class INTERPKERNEL_EXPORT TetraAffineTransform { public: diff --git a/src/INTERP_KERNEL/TransformedTriangle.hxx b/src/INTERP_KERNEL/TransformedTriangle.hxx index 14e54fc00..b3d8feaaf 100644 --- a/src/INTERP_KERNEL/TransformedTriangle.hxx +++ b/src/INTERP_KERNEL/TransformedTriangle.hxx @@ -1,6 +1,8 @@ #ifndef __TRANSFORMED_TRIANGLE_HXX__ #define __TRANSFORMED_TRIANGLE_HXX__ +#include + #include @@ -82,10 +84,9 @@ namespace INTERP_KERNEL * If OPTIMIZE is defined, a large number of methods will be prefixed with inline and some optimizations concerning the tests * with zero double products will be used. */ - class TransformedTriangle + class INTERPKERNEL_EXPORT TransformedTriangle { - - + public: diff --git a/src/INTERP_KERNEL/TriangulationIntersector.hxx b/src/INTERP_KERNEL/TriangulationIntersector.hxx index 0e9bfbf24..17eb20f81 100644 --- a/src/INTERP_KERNEL/TriangulationIntersector.hxx +++ b/src/INTERP_KERNEL/TriangulationIntersector.hxx @@ -6,7 +6,7 @@ namespace INTERP_KERNEL { template - class TriangulationIntersector : public PlanarIntersector + class INTERPKERNEL_EXPORT TriangulationIntersector : public PlanarIntersector { public: TriangulationIntersector(const NormalizedUnstructuredMesh& mesh_A, diff --git a/src/INTERP_KERNEL/VTKNormalizedUnstructuredMesh.hxx b/src/INTERP_KERNEL/VTKNormalizedUnstructuredMesh.hxx index 253d22a24..9aebf11cc 100644 --- a/src/INTERP_KERNEL/VTKNormalizedUnstructuredMesh.hxx +++ b/src/INTERP_KERNEL/VTKNormalizedUnstructuredMesh.hxx @@ -8,7 +8,7 @@ class vtkUnstructuredGrid; template -class VTKNormalizedUnstructuredMesh : public INTERP_KERNEL::NormalizedUnstructuredMesh<3,MESHDIM,vtkIdType,INTERP_KERNEL::ALL_C_MODE,VTKNormalizedUnstructuredMesh > +class INTERPKERNEL_EXPORT VTKNormalizedUnstructuredMesh : public INTERP_KERNEL::NormalizedUnstructuredMesh<3,MESHDIM,vtkIdType,INTERP_KERNEL::ALL_C_MODE,VTKNormalizedUnstructuredMesh > { public: VTKNormalizedUnstructuredMesh(vtkUnstructuredGrid *mesh);