From 3d2f7d745738bc964a1561eb370a9033c44b9983 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Thu, 3 Mar 2011 21:42:20 +0000 Subject: [PATCH] dll_headers for geometry dll (only 2D yet) --- libsrc/csg/csgpkg.cpp | 4 +- libsrc/csg/identify.hpp | 8 ++-- libsrc/general/flags.hpp | 46 +++++++++++----------- libsrc/general/mystring.hpp | 22 +++++------ libsrc/general/ngexception.hpp | 6 +-- libsrc/geom2d/genmesh2d.cpp | 2 +- libsrc/geom2d/geom2dpkg.cpp | 4 +- libsrc/geom2d/vsgeom2d.cpp | 6 +-- libsrc/gprim/adtree.hpp | 8 ++-- libsrc/gprim/geom2d.hpp | 22 +++++------ libsrc/gprim/geom3d.hpp | 2 +- libsrc/gprim/spline.cpp | 60 ++++++++++++++++++++++++++++ libsrc/gprim/spline.hpp | 70 +++------------------------------ libsrc/gprim/splinegeometry.hpp | 10 ++--- libsrc/include/mydefs.hpp | 10 +++-- libsrc/linalg/densemat.cpp | 6 +-- libsrc/linalg/densemat.hpp | 38 +++++++++--------- libsrc/meshing/basegeom.cpp | 2 +- libsrc/meshing/basegeom.hpp | 6 +-- libsrc/meshing/bisect.hpp | 2 +- libsrc/meshing/global.hpp | 2 +- libsrc/meshing/meshclass.hpp | 66 +++++++++++++++---------------- libsrc/meshing/meshfunc2d.cpp | 2 +- libsrc/meshing/meshing2.hpp | 14 +++---- libsrc/meshing/meshtype.hpp | 30 +++++++------- libsrc/meshing/msghandler.hpp | 34 ++++++++-------- libsrc/visualization/mvdraw.cpp | 10 ++--- libsrc/visualization/mvdraw.hpp | 48 +++++++++++----------- 28 files changed, 272 insertions(+), 268 deletions(-) diff --git a/libsrc/csg/csgpkg.cpp b/libsrc/csg/csgpkg.cpp index 3d0d54d4..6ce6bf1a 100644 --- a/libsrc/csg/csgpkg.cpp +++ b/libsrc/csg/csgpkg.cpp @@ -17,8 +17,8 @@ extern "C" int Ng_CSG_Init (Tcl_Interp * interp); namespace netgen { - extern NetgenGeometry * ng_geometry; - extern AutoPtr mesh; + extern DLL_HEADER NetgenGeometry * ng_geometry; + extern DLL_HEADER AutoPtr mesh; static VisualSceneGeometry vsgeom; diff --git a/libsrc/csg/identify.hpp b/libsrc/csg/identify.hpp index cf9149fe..ef3f7556 100644 --- a/libsrc/csg/identify.hpp +++ b/libsrc/csg/identify.hpp @@ -28,10 +28,10 @@ namespace netgen int nr; public: - Identification (int anr, const CSGeometry & ageom); - virtual ~Identification (); - virtual void Print (ostream & ost) const = 0; - virtual void GetData (ostream & ost) const = 0; + DLL_HEADER Identification (int anr, const CSGeometry & ageom); + DLL_HEADER virtual ~Identification (); + DLL_HEADER virtual void Print (ostream & ost) const = 0; + DLL_HEADER virtual void GetData (ostream & ost) const = 0; /// obsolete // virtual void IdentifySpecialPoints (Array & points); diff --git a/libsrc/general/flags.hpp b/libsrc/general/flags.hpp index 769e8647..810fbfbe 100644 --- a/libsrc/general/flags.hpp +++ b/libsrc/general/flags.hpp @@ -30,56 +30,56 @@ class Flags SYMBOLTABLE*> numlistflags; public: /// - Flags (); + DLL_HEADER Flags (); /// - ~Flags (); + DLL_HEADER ~Flags (); /// Deletes all flags - void DeleteFlags (); + DLL_HEADER void DeleteFlags (); /// Sets string flag, overwrite if exists - void SetFlag (const char * name, const char * val); + DLL_HEADER void SetFlag (const char * name, const char * val); /// Sets numerical flag, overwrite if exists - void SetFlag (const char * name, double val); + DLL_HEADER void SetFlag (const char * name, double val); /// Sets boolean flag - void SetFlag (const char * name); + DLL_HEADER void SetFlag (const char * name); /// Sets string arary falg - void SetFlag (const char * name, const Array & val); + DLL_HEADER void SetFlag (const char * name, const Array & val); /// Sets double array flag - void SetFlag (const char * name, const Array & val); + DLL_HEADER void SetFlag (const char * name, const Array & val); /// Save flags to file - void SaveFlags (const char * filename) const; + DLL_HEADER void SaveFlags (const char * filename) const; /// write flags to stream - void PrintFlags (ostream & ost) const; + DLL_HEADER void PrintFlags (ostream & ost) const; /// Load flags from file - void LoadFlags (const char * filename); + DLL_HEADER void LoadFlags (const char * filename); /// set flag of form -name=hello -val=0.5 -defined - void SetCommandLineFlag (const char * st); + DLL_HEADER void SetCommandLineFlag (const char * st); /// Returns string flag, default value if not exists - const char * GetStringFlag (const char * name, const char * def) const; + DLL_HEADER const char * GetStringFlag (const char * name, const char * def) const; /// Returns numerical flag, default value if not exists - double GetNumFlag (const char * name, double def) const; + DLL_HEADER double GetNumFlag (const char * name, double def) const; /// Returns address of numerical flag, null if not exists - const double * GetNumFlagPtr (const char * name) const; + DLL_HEADER const double * GetNumFlagPtr (const char * name) const; /// Returns address of numerical flag, null if not exists - double * GetNumFlagPtr (const char * name); + DLL_HEADER double * GetNumFlagPtr (const char * name); /// Returns boolean flag - bool GetDefineFlag (const char * name) const; + DLL_HEADER bool GetDefineFlag (const char * name) const; /// Returns string list flag, empty array if not exist - const Array & GetStringListFlag (const char * name) const; + DLL_HEADER const Array & GetStringListFlag (const char * name) const; /// Returns num list flag, empty array if not exist - const Array & GetNumListFlag (const char * name) const; + DLL_HEADER const Array & GetNumListFlag (const char * name) const; /// Test, if string flag is defined - bool StringFlagDefined (const char * name) const; + DLL_HEADER bool StringFlagDefined (const char * name) const; /// Test, if num flag is defined - bool NumFlagDefined (const char * name) const; + DLL_HEADER bool NumFlagDefined (const char * name) const; /// Test, if string list flag is defined - bool StringListFlagDefined (const char * name) const; + DLL_HEADER bool StringListFlagDefined (const char * name) const; /// Test, if num list flag is defined - bool NumListFlagDefined (const char * name) const; + DLL_HEADER bool NumListFlagDefined (const char * name) const; }; } diff --git a/libsrc/general/mystring.hpp b/libsrc/general/mystring.hpp index b9a4ac35..49cc7001 100644 --- a/libsrc/general/mystring.hpp +++ b/libsrc/general/mystring.hpp @@ -45,17 +45,17 @@ istream& operator >> (istream &, MyStr &); class MyStr { public: - MyStr(); - MyStr(const char *); - MyStr(char); - MyStr(const MyStr &); - MyStr(int); - MyStr(void *); - MyStr(long); - MyStr(double); - MyStr(const Point3d& p); - MyStr(const Vec3d& p); - MyStr(const string & st); + DLL_HEADER MyStr(); + DLL_HEADER MyStr(const char *); + DLL_HEADER MyStr(char); + DLL_HEADER MyStr(const MyStr &); + DLL_HEADER MyStr(int); + DLL_HEADER MyStr(void *); + DLL_HEADER MyStr(long); + DLL_HEADER MyStr(double); + DLL_HEADER MyStr(const Point3d& p); + DLL_HEADER MyStr(const Vec3d& p); + DLL_HEADER MyStr(const string & st); ~MyStr(); MyStr Left(unsigned); diff --git a/libsrc/general/ngexception.hpp b/libsrc/general/ngexception.hpp index d38bd244..70dc0a4a 100644 --- a/libsrc/general/ngexception.hpp +++ b/libsrc/general/ngexception.hpp @@ -17,12 +17,12 @@ class NgException string what; public: /// - NgException (const string & s); + DLL_HEADER NgException (const string & s); /// - virtual ~NgException (); + DLL_HEADER virtual ~NgException (); /// append string to description - void Append (const string & s); + DLL_HEADER void Append (const string & s); // void Append (const char * s); /// verbal description of exception diff --git a/libsrc/geom2d/genmesh2d.cpp b/libsrc/geom2d/genmesh2d.cpp index 56085a05..43b1b0e0 100644 --- a/libsrc/geom2d/genmesh2d.cpp +++ b/libsrc/geom2d/genmesh2d.cpp @@ -528,7 +528,7 @@ namespace netgen mesh -> SetNextMajorTimeStamp(); - extern void Render(); + extern DLL_HEADER void Render(); Render(); } diff --git a/libsrc/geom2d/geom2dpkg.cpp b/libsrc/geom2d/geom2dpkg.cpp index fee12e02..d079d308 100644 --- a/libsrc/geom2d/geom2dpkg.cpp +++ b/libsrc/geom2d/geom2dpkg.cpp @@ -8,7 +8,9 @@ namespace netgen { - extern NetgenGeometry * ng_geometry; + + + extern DLL_HEADER NetgenGeometry * ng_geometry; static VisualSceneGeometry2d vsgeom2d; diff --git a/libsrc/geom2d/vsgeom2d.cpp b/libsrc/geom2d/vsgeom2d.cpp index 38d0b649..6d108145 100644 --- a/libsrc/geom2d/vsgeom2d.cpp +++ b/libsrc/geom2d/vsgeom2d.cpp @@ -60,7 +60,7 @@ namespace netgen glBegin (GL_LINE_STRIP); for (int j = 0; j < points.Size(); j++) - glVertex3f (points[j](0), points[j](1), 0); + glVertex3d (points[j](0), points[j](1), 0); glEnd(); } @@ -76,8 +76,8 @@ namespace netgen glBegin (GL_LINES); for (int j = 1; j < 5; j++) { - glVertex3f (points[j](0), points[j](1), 0); - glVertex3f (otherpoints[j](0), otherpoints[j](1), 0); + glVertex3d (points[j](0), points[j](1), 0); + glVertex3d (otherpoints[j](0), otherpoints[j](1), 0); } glEnd (); } diff --git a/libsrc/gprim/adtree.hpp b/libsrc/gprim/adtree.hpp index 913ce7e4..d0f02b6d 100644 --- a/libsrc/gprim/adtree.hpp +++ b/libsrc/gprim/adtree.hpp @@ -449,12 +449,12 @@ class Point3dTree ADTree3 * tree; public: - Point3dTree (const Point<3> & pmin, const Point<3> & pmax); - ~Point3dTree (); - void Insert (const Point<3> & p, int pi); + DLL_HEADER Point3dTree (const Point<3> & pmin, const Point<3> & pmax); + DLL_HEADER ~Point3dTree (); + DLL_HEADER void Insert (const Point<3> & p, int pi); void DeleteElement (int pi) { tree->DeleteElement(pi); } - void GetIntersecting (const Point<3> & pmin, const Point<3> & pmax, + DLL_HEADER void GetIntersecting (const Point<3> & pmin, const Point<3> & pmax, Array & pis) const; const ADTree3 & Tree() const { return *tree; }; }; diff --git a/libsrc/gprim/geom2d.hpp b/libsrc/gprim/geom2d.hpp index 04abf0f3..334df09c 100644 --- a/libsrc/gprim/geom2d.hpp +++ b/libsrc/gprim/geom2d.hpp @@ -41,10 +41,10 @@ namespace netgen inline Vec2d operator- (const Vec2d & p1, const Vec2d & v); inline Vec2d operator+ (const Vec2d & p1, const Vec2d & v); inline Vec2d operator* (double scal, const Vec2d & v); - double Angle (const Vec2d & v); - double FastAngle (const Vec2d & v); - double Angle (const Vec2d & v1, const Vec2d & v2); - double FastAngle (const Vec2d & v1, const Vec2d & v2); + DLL_HEADER double Angle (const Vec2d & v); + DLL_HEADER double FastAngle (const Vec2d & v); + DLL_HEADER double Angle (const Vec2d & v1, const Vec2d & v2); + DLL_HEADER double FastAngle (const Vec2d & v1, const Vec2d & v2); ostream & operator<<(ostream & s, const Vec2d & v); double Dist2(const Line2d & g, const Line2d & h ); // GH int Near (const Point2d & p1, const Point2d & p2, const double eps); @@ -54,8 +54,8 @@ namespace netgen int IsOnLongLine (const Line2d & l, const Point2d & p); int Hit (const Line2d & l1, const Line2d & l2, double heps = EPSGEOM); ostream & operator<<(ostream & s, const Line2d & l); - Point2d CrossPoint (const PLine2d & l1, const PLine2d & l2); - Point2d CrossPoint (const Line2d & l1, const Line2d & l2); + DLL_HEADER Point2d CrossPoint (const PLine2d & l1, const PLine2d & l2); + DLL_HEADER Point2d CrossPoint (const Line2d & l1, const Line2d & l2); int Parallel (const PLine2d & l1, const PLine2d & l2, double peps = EPSGEOM); int IsOnLine (const PLine2d & l, const Point2d & p, double heps = EPSGEOM); int IsOnLongLine (const PLine2d & l, const Point2d & p); @@ -290,13 +290,13 @@ namespace netgen /// Angle in [0,2*PI) /// - friend double Angle (const Vec2d & v); + friend DLL_HEADER double Angle (const Vec2d & v); /// - friend double FastAngle (const Vec2d & v); + friend DLL_HEADER double FastAngle (const Vec2d & v); /// - friend double Angle (const Vec2d & v1, const Vec2d & v2); + friend DLL_HEADER double Angle (const Vec2d & v1, const Vec2d & v2); /// - friend double FastAngle (const Vec2d & v1, const Vec2d & v2); + friend DLL_HEADER double FastAngle (const Vec2d & v1, const Vec2d & v2); /// friend ostream & operator<<(ostream & s, const Vec2d & v); @@ -356,7 +356,7 @@ namespace netgen friend double Dist2(const Line2d & g, const Line2d & h ); // GH /// - friend Point2d CrossPoint (const Line2d & l1, const Line2d & l2); + friend DLL_HEADER Point2d CrossPoint (const Line2d & l1, const Line2d & l2); /// returns 1 iff parallel friend int CrossPointBarycentric (const Line2d & l1, const Line2d & l2, double & lam1, double & lam2); diff --git a/libsrc/gprim/geom3d.hpp b/libsrc/gprim/geom3d.hpp index 8092799d..05216d8f 100644 --- a/libsrc/gprim/geom3d.hpp +++ b/libsrc/gprim/geom3d.hpp @@ -11,7 +11,7 @@ namespace netgen { - extern void MyError (const char * ch); + extern DLL_HEADER void MyError (const char * ch); class Point3d; class Vec3d; diff --git a/libsrc/gprim/spline.cpp b/libsrc/gprim/spline.cpp index f04192bc..266686a0 100644 --- a/libsrc/gprim/spline.cpp +++ b/libsrc/gprim/spline.cpp @@ -270,6 +270,66 @@ namespace netgen } + template + void SplineSeg3 :: LineIntersections (const double a, const double b, const double c, + Array < Point > & points, const double eps) const + { + points.SetSize(0); + + double t; + + const double c1 = a*p1(0) - sqrt(2.)*a*p2(0) + a*p3(0) + + b*p1(1) - sqrt(2.)*b*p2(1) + b*p3(1) + + (2.-sqrt(2.))*c; + const double c2 = -2.*a*p1(0) + sqrt(2.)*a*p2(0) -2.*b*p1(1) + sqrt(2.)*b*p2(1) + (sqrt(2.)-2.)*c; + const double c3 = a*p1(0) + b*p1(1) + c; + + if(fabs(c1) < 1e-20) + { + if(fabs(c2) < 1e-20) + return; + + t = -c3/c2; + if((t > -eps) && (t < 1.+eps)) + points.Append(GetPoint(t)); + return; + } + + const double discr = c2*c2-4.*c1*c3; + + if(discr < 0) + return; + + if(fabs(discr/(c1*c1)) < 1e-14) + { + t = -0.5*c2/c1; + if((t > -eps) && (t < 1.+eps)) + points.Append(GetPoint(t)); + return; + } + + t = (-c2 + sqrt(discr))/(2.*c1); + if((t > -eps) && (t < 1.+eps)) + points.Append(GetPoint(t)); + + t = (-c2 - sqrt(discr))/(2.*c1); + if((t > -eps) && (t < 1.+eps)) + points.Append(GetPoint(t)); + } + + + template < int D > + void SplineSeg3 :: GetRawData (Array & data) const + { + data.Append(3); + for(int i=0; i; diff --git a/libsrc/gprim/spline.hpp b/libsrc/gprim/spline.hpp index b2a5c367..528d3dac 100644 --- a/libsrc/gprim/spline.hpp +++ b/libsrc/gprim/spline.hpp @@ -154,7 +154,7 @@ namespace netgen virtual Vec GetTangent (const double t) const; - virtual void GetDerivatives (const double t, + DLL_HEADER virtual void GetDerivatives (const double t, Point & point, Vec & first, Vec & second) const; @@ -169,14 +169,14 @@ namespace netgen const GeomPoint & TangentPoint (void) const { return p2; } - virtual void LineIntersections (const double a, const double b, const double c, + DLL_HEADER virtual void LineIntersections (const double a, const double b, const double c, Array < Point > & points, const double eps) const; - virtual double MaxCurvature(void) const; + DLL_HEADER virtual double MaxCurvature(void) const; - virtual void Project (const Point point, Point & point_on_curve, double & t) const; + DLL_HEADER virtual void Project (const Point point, Point & point_on_curve, double & t) const; - virtual void GetRawData (Array & data) const; + DLL_HEADER virtual void GetRawData (Array & data) const; }; @@ -520,66 +520,6 @@ namespace netgen */ - template - void SplineSeg3 :: LineIntersections (const double a, const double b, const double c, - Array < Point > & points, const double eps) const - { - points.SetSize(0); - - double t; - - const double c1 = a*p1(0) - sqrt(2.)*a*p2(0) + a*p3(0) - + b*p1(1) - sqrt(2.)*b*p2(1) + b*p3(1) - + (2.-sqrt(2.))*c; - const double c2 = -2.*a*p1(0) + sqrt(2.)*a*p2(0) -2.*b*p1(1) + sqrt(2.)*b*p2(1) + (sqrt(2.)-2.)*c; - const double c3 = a*p1(0) + b*p1(1) + c; - - if(fabs(c1) < 1e-20) - { - if(fabs(c2) < 1e-20) - return; - - t = -c3/c2; - if((t > -eps) && (t < 1.+eps)) - points.Append(GetPoint(t)); - return; - } - - const double discr = c2*c2-4.*c1*c3; - - if(discr < 0) - return; - - if(fabs(discr/(c1*c1)) < 1e-14) - { - t = -0.5*c2/c1; - if((t > -eps) && (t < 1.+eps)) - points.Append(GetPoint(t)); - return; - } - - t = (-c2 + sqrt(discr))/(2.*c1); - if((t > -eps) && (t < 1.+eps)) - points.Append(GetPoint(t)); - - t = (-c2 - sqrt(discr))/(2.*c1); - if((t > -eps) && (t < 1.+eps)) - points.Append(GetPoint(t)); - } - - - template < int D > - void SplineSeg3 :: GetRawData (Array & data) const - { - data.Append(3); - for(int i=0; i > geompoints; Array < SplineSeg* > splines; - ~SplineGeometry(); + DLL_HEADER ~SplineGeometry(); - int Load (const Array & raw_data, const int startpos = 0); + DLL_HEADER int Load (const Array & raw_data, const int startpos = 0); - void GetRawData (Array & raw_data) const; + DLL_HEADER void GetRawData (Array & raw_data) const; const Array*> & GetSplines () const @@ -44,7 +44,7 @@ namespace netgen SplineSeg & GetSpline (const int i) {return *splines[i];} const SplineSeg & GetSpline (const int i) const {return *splines[i];} - void GetBoundingBox (Box & box) const; + DLL_HEADER void GetBoundingBox (Box & box) const; Box GetBoundingBox () const { Box box; GetBoundingBox (box); return box; } @@ -52,7 +52,7 @@ namespace netgen const GeomPoint & GetPoint(int i) const { return geompoints[i]; } // void SetGrading (const double grading); - void AppendPoint (const Point & p, const double reffac = 1., const bool hpref = false); + DLL_HEADER void AppendPoint (const Point & p, const double reffac = 1., const bool hpref = false); void AppendSegment(SplineSeg * spline) diff --git a/libsrc/include/mydefs.hpp b/libsrc/include/mydefs.hpp index 563fc9c9..12c6e60c 100644 --- a/libsrc/include/mydefs.hpp +++ b/libsrc/include/mydefs.hpp @@ -25,14 +25,16 @@ #ifdef WIN32 - #define DLL_HEADER __declspec(dllexport) + #ifdef NGINTERFACE_EXPORTS + #define DLL_HEADER __declspec(dllexport) + #else + #define DLL_HEADER __declspec(dllimport) + #endif #else - #define DLL_HEADER + #define DLL_HEADER #endif - - #define noDEMOVERSION #define noDEVELOP #define noSTEP diff --git a/libsrc/linalg/densemat.cpp b/libsrc/linalg/densemat.cpp index df5ead6a..11596654 100644 --- a/libsrc/linalg/densemat.cpp +++ b/libsrc/linalg/densemat.cpp @@ -244,12 +244,12 @@ namespace netgen { double det; - if (m1.width != m1.height) + if (m1.Width() != m1.Height()) { (*myerr) << "CalcInverse: matrix not symmetric" << endl; return; } - if (m1.width != m2.width || m1.height != m2.height) + if (m1.Width() != m2.Width() || m1.Height() != m2.Height()) { (*myerr) << "CalcInverse: dim(m2) != dim(m1)" << endl; return; @@ -267,7 +267,7 @@ namespace netgen } det = 1.0 / det; - switch (m1.width) + switch (m1.Width()) { case 1: { diff --git a/libsrc/linalg/densemat.hpp b/libsrc/linalg/densemat.hpp index a6b1e042..5d721b5a 100644 --- a/libsrc/linalg/densemat.hpp +++ b/libsrc/linalg/densemat.hpp @@ -21,16 +21,16 @@ protected: public: /// - DenseMatrix (); + DLL_HEADER DenseMatrix (); /// - DenseMatrix (int h, int w = 0); + DLL_HEADER DenseMatrix (int h, int w = 0); /// - DenseMatrix (const DenseMatrix & m2); + DLL_HEADER DenseMatrix (const DenseMatrix & m2); /// - ~DenseMatrix (); + DLL_HEADER ~DenseMatrix (); /// - void SetSize (int h, int w = 0); + DLL_HEADER void SetSize (int h, int w = 0); int Height() const { return height; } int Width() const {return width; } @@ -41,19 +41,19 @@ public: double operator() (int i) const { return data[i]; } /// - DenseMatrix & operator= (const DenseMatrix & m2); + DLL_HEADER DenseMatrix & operator= (const DenseMatrix & m2); /// - DenseMatrix & operator+= (const DenseMatrix & m2); + DLL_HEADER DenseMatrix & operator+= (const DenseMatrix & m2); /// - DenseMatrix & operator-= (const DenseMatrix & m2); + DLL_HEADER DenseMatrix & operator-= (const DenseMatrix & m2); /// - DenseMatrix & operator= (double v); + DLL_HEADER DenseMatrix & operator= (double v); /// - DenseMatrix & operator*= (double v); + DLL_HEADER DenseMatrix & operator*= (double v); /// - void Mult (const FlatVector & v, FlatVector & prod) const + DLL_HEADER void Mult (const FlatVector & v, FlatVector & prod) const { double sum; const double * mp, * sp; @@ -106,11 +106,11 @@ public: } /// - void MultTrans (const Vector & v, Vector & prod) const; + DLL_HEADER void MultTrans (const Vector & v, Vector & prod) const; /// - void Residuum (const Vector & x, const Vector & b, Vector & res) const; + DLL_HEADER void Residuum (const Vector & x, const Vector & b, Vector & res) const; /// - double Det () const; + DLL_HEADER double Det () const; /// friend DenseMatrix operator* (const DenseMatrix & m1, const DenseMatrix & m2); @@ -122,17 +122,17 @@ public: /// friend void Mult (const DenseMatrix & m1, const DenseMatrix & m2, DenseMatrix & m3); /// - friend void CalcInverse (const DenseMatrix & m1, DenseMatrix & m2); +// friend void CalcInverse (const DenseMatrix & m1, DenseMatrix & m2); /// friend void CalcAAt (const DenseMatrix & a, DenseMatrix & m2); /// - friend void CalcAtA (const DenseMatrix & a, DenseMatrix & m2); +// friend void CalcAtA (const DenseMatrix & a, DenseMatrix & m2); /// friend void CalcABt (const DenseMatrix & a, const DenseMatrix & b, DenseMatrix & m2); /// friend void CalcAtB (const DenseMatrix & a, const DenseMatrix & b, DenseMatrix & m2); /// - void Solve (const Vector & b, Vector & x) const; + DLL_HEADER void Solve (const Vector & b, Vector & x) const; /// void SolveDestroy (const Vector & b, Vector & x); /// @@ -270,8 +270,8 @@ extern ostream & operator<< (ostream & ost, const MatrixFixWidth & m) }; -extern void CalcAtA (const DenseMatrix & a, DenseMatrix & m2); -extern void CalcInverse (const DenseMatrix & m1, DenseMatrix & m2); +extern DLL_HEADER void CalcAtA (const DenseMatrix & a, DenseMatrix & m2); +extern DLL_HEADER void CalcInverse (const DenseMatrix & m1, DenseMatrix & m2); #endif diff --git a/libsrc/meshing/basegeom.cpp b/libsrc/meshing/basegeom.cpp index 761b95da..c8d642e2 100644 --- a/libsrc/meshing/basegeom.cpp +++ b/libsrc/meshing/basegeom.cpp @@ -4,7 +4,7 @@ namespace netgen { - Array geometryregister; + DLL_HEADER Array geometryregister; GeometryRegister :: ~GeometryRegister() { ; } diff --git a/libsrc/meshing/basegeom.hpp b/libsrc/meshing/basegeom.hpp index 80a40e1e..98ea7dda 100644 --- a/libsrc/meshing/basegeom.hpp +++ b/libsrc/meshing/basegeom.hpp @@ -13,7 +13,7 @@ struct Tcl_Interp; namespace netgen { - class NetgenGeometry + class DLL_HEADER NetgenGeometry { public: virtual ~NetgenGeometry () { ; } @@ -31,7 +31,7 @@ namespace netgen - class GeometryRegister + class DLL_HEADER GeometryRegister { public: virtual ~GeometryRegister(); @@ -42,7 +42,7 @@ namespace netgen virtual void SetParameters (Tcl_Interp * interp) { ; } }; - extern Array geometryregister; + extern DLL_HEADER Array geometryregister; } diff --git a/libsrc/meshing/bisect.hpp b/libsrc/meshing/bisect.hpp index 7fa56ac8..2da9b97e 100644 --- a/libsrc/meshing/bisect.hpp +++ b/libsrc/meshing/bisect.hpp @@ -38,7 +38,7 @@ extern void ZRefinement (Mesh &, const class NetgenGeometry *, -class Refinement +class DLL_HEADER Refinement { MeshOptimize2d * optimizer2d; diff --git a/libsrc/meshing/global.hpp b/libsrc/meshing/global.hpp index 9805b1a2..b97c7886 100644 --- a/libsrc/meshing/global.hpp +++ b/libsrc/meshing/global.hpp @@ -25,7 +25,7 @@ namespace netgen /// calling parameters // extern Flags parameters; - extern MeshingParameters mparam; + extern DLL_HEADER MeshingParameters mparam; extern Array tets_in_qualclass; diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index 1d3cbbc1..e73a2d2c 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -182,9 +182,9 @@ namespace netgen /// - Mesh(); + DLL_HEADER Mesh(); /// - ~Mesh(); + DLL_HEADER ~Mesh(); Mesh & operator= (const Mesh & mesh2); @@ -214,8 +214,8 @@ namespace netgen void SetAllocSize(int nnodes, int nsegs, int nsel, int nel); - PointIndex AddPoint (const Point3d & p, int layer = 1); - PointIndex AddPoint (const Point3d & p, int layer, POINTTYPE type); + DLL_HEADER PointIndex AddPoint (const Point3d & p, int layer = 1); + DLL_HEADER PointIndex AddPoint (const Point3d & p, int layer, POINTTYPE type); #ifdef PARALLEL PointIndex AddPoint (const Point3d & p, bool aisghost, int layer = 1); PointIndex AddPoint (const Point3d & p, bool aisghost, int layer, POINTTYPE type); @@ -234,7 +234,7 @@ namespace netgen T_POINTS & Points() { return points; } - SegmentIndex AddSegment (const Segment & s); + DLL_HEADER SegmentIndex AddSegment (const Segment & s); void DeleteSegment (int segnr) { segments.Elem(segnr)[0] = PointIndex::BASE-1; @@ -257,7 +257,7 @@ namespace netgen - SurfaceElementIndex AddSurfaceElement (const Element2d & el); + DLL_HEADER SurfaceElementIndex AddSurfaceElement (const Element2d & el); void DeleteSurfaceElement (int eli) { surfelements.Elem(eli).Delete(); @@ -284,10 +284,10 @@ namespace netgen { return surfelements[ei]; } - void RebuildSurfaceElementLists (); - void GetSurfaceElementsOfFace (int facenr, Array & sei) const; + DLL_HEADER void RebuildSurfaceElementLists (); + DLL_HEADER void GetSurfaceElementsOfFace (int facenr, Array & sei) const; - ElementIndex AddVolumeElement (const Element & el); + DLL_HEADER ElementIndex AddVolumeElement (const Element & el); int GetNE () const { return volelements.Size(); } @@ -311,10 +311,10 @@ namespace netgen /// - double ElementError (int eli) const; + DLL_HEADER double ElementError (int eli) const; /// - void AddLockedPoint (PointIndex pi); + DLL_HEADER void AddLockedPoint (PointIndex pi); /// void ClearLockedPoints (); @@ -341,7 +341,7 @@ namespace netgen boundary elements without inner element. Results are stored in openelements. if dom == 0, all sub-domains, else subdomain dom */ - void FindOpenElements (int dom = 0); + DLL_HEADER void FindOpenElements (int dom = 0); /** @@ -349,11 +349,11 @@ namespace netgen and surface elements without neighbours. store in opensegmentsy */ - void FindOpenSegments (int surfnr = 0); + DLL_HEADER void FindOpenSegments (int surfnr = 0); /** remove one layer of surface elements */ - void RemoveOneLayerSurfaceElements (); + DLL_HEADER void RemoveOneLayerSurfaceElements (); int GetNOpenSegments () { return opensegments.Size(); } @@ -363,43 +363,43 @@ namespace netgen Checks overlap of boundary return == 1, iff overlap */ - int CheckOverlappingBoundary (); + DLL_HEADER int CheckOverlappingBoundary (); /** Checks consistent boundary return == 0, everything ok */ - int CheckConsistentBoundary () const; + DLL_HEADER int CheckConsistentBoundary () const; /* checks element orientation */ - int CheckVolumeMesh () const; + DLL_HEADER int CheckVolumeMesh () const; /** finds average h of surface surfnr if surfnr > 0, else of all surfaces. */ - double AverageH (int surfnr = 0) const; + DLL_HEADER double AverageH (int surfnr = 0) const; /// Calculates localh - void CalcLocalH (); + DLL_HEADER void CalcLocalH (); /// - void SetLocalH (const Point3d & pmin, const Point3d & pmax, double grading); + DLL_HEADER void SetLocalH (const Point3d & pmin, const Point3d & pmax, double grading); /// - void RestrictLocalH (const Point3d & p, double hloc); + DLL_HEADER void RestrictLocalH (const Point3d & p, double hloc); /// - void RestrictLocalHLine (const Point3d & p1, const Point3d & p2, + DLL_HEADER void RestrictLocalHLine (const Point3d & p1, const Point3d & p2, double hloc); /// number of elements per radius - void CalcLocalHFromSurfaceCurvature(double elperr); + DLL_HEADER void CalcLocalHFromSurfaceCurvature(double elperr); /// - void CalcLocalHFromPointDistances(void); + DLL_HEADER void CalcLocalHFromPointDistances(void); /// - void RestrictLocalH (resthtype rht, int nr, double loch); + DLL_HEADER void RestrictLocalH (resthtype rht, int nr, double loch); /// - void LoadLocalMeshSize (const char * meshsizefilename); + DLL_HEADER void LoadLocalMeshSize (const char * meshsizefilename); /// - void SetGlobalH (double h); + DLL_HEADER void SetGlobalH (double h); /// void SetMinimalH (double h); /// @@ -416,10 +416,10 @@ namespace netgen bool LocalHFunctionGenerated(void) const { return (lochfunc != NULL); } /// Find bounding box - void GetBox (Point3d & pmin, Point3d & pmax, int dom = -1) const; + DLL_HEADER void GetBox (Point3d & pmin, Point3d & pmax, int dom = -1) const; /// Find bounding box of points of typ ptyp or less - void GetBox (Point3d & pmin, Point3d & pmax, POINTTYPE ptyp ) const; + DLL_HEADER void GetBox (Point3d & pmin, Point3d & pmax, POINTTYPE ptyp ) const; /// int GetNOpenElements() const @@ -470,7 +470,7 @@ namespace netgen /** Remove unused points. etc. */ - void Compress (); + DLL_HEADER void Compress (); /// void Save (ostream & outfile) const; @@ -574,13 +574,13 @@ namespace netgen { return edgedecoding.Append(fd) - 1; } /// - void SetMaterial (int domnr, const char * mat); + DLL_HEADER void SetMaterial (int domnr, const char * mat); /// const char * GetMaterial (int domnr) const; - void SetNBCNames ( int nbcn ); + DLL_HEADER void SetNBCNames ( int nbcn ); - void SetBCName ( int bcnr, const string & abcname ); + DLL_HEADER void SetBCName ( int bcnr, const string & abcname ); string GetBCName ( int bcnr ) const; diff --git a/libsrc/meshing/meshfunc2d.cpp b/libsrc/meshing/meshfunc2d.cpp index ac4fbe8e..4d01ceef 100644 --- a/libsrc/meshing/meshfunc2d.cpp +++ b/libsrc/meshing/meshfunc2d.cpp @@ -4,7 +4,7 @@ namespace netgen { - void Optimize2d (Mesh & mesh, MeshingParameters & mp) + DLL_HEADER void Optimize2d (Mesh & mesh, MeshingParameters & mp) { int i; diff --git a/libsrc/meshing/meshing2.hpp b/libsrc/meshing/meshing2.hpp index 278b4e64..f859395e 100644 --- a/libsrc/meshing/meshing2.hpp +++ b/libsrc/meshing/meshing2.hpp @@ -43,27 +43,27 @@ class Meshing2 public: /// - Meshing2 (const Box<3> & aboundingbox); + DLL_HEADER Meshing2 (const Box<3> & aboundingbox); /// - virtual ~Meshing2 (); + DLL_HEADER virtual ~Meshing2 (); /// Load rules, either from file, or compiled rules void LoadRules (const char * filename); /// - MESHING2_RESULT GenerateMesh (Mesh & mesh, double gh, int facenr); + DLL_HEADER MESHING2_RESULT GenerateMesh (Mesh & mesh, double gh, int facenr); - void Delaunay (Mesh & mesh, int domainnr, const MeshingParameters & mp); - void BlockFillLocalH (Mesh & mesh, const MeshingParameters & mp); + DLL_HEADER void Delaunay (Mesh & mesh, int domainnr, const MeshingParameters & mp); + DLL_HEADER void BlockFillLocalH (Mesh & mesh, const MeshingParameters & mp); /// - void AddPoint (const Point3d & p, PointIndex globind, MultiPointGeomInfo * mgi = NULL, + DLL_HEADER void AddPoint (const Point3d & p, PointIndex globind, MultiPointGeomInfo * mgi = NULL, bool pointonsurface = true); /// - void AddBoundaryElement (INDEX i1, INDEX i2, + DLL_HEADER void AddBoundaryElement (INDEX i1, INDEX i2, const PointGeomInfo & gi1, const PointGeomInfo & gi2); /// diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index ed7b6c78..96e7eb94 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -39,8 +39,8 @@ namespace netgen - extern int GetTimeStamp(); - extern int NextTimeStamp(); + extern DLL_HEADER int GetTimeStamp(); + extern DLL_HEADER int NextTimeStamp(); class PointGeomInfo { @@ -335,7 +335,7 @@ namespace netgen /// Element2d (int anp); /// - Element2d (ELEMENT_TYPE type); + DLL_HEADER Element2d (ELEMENT_TYPE type); /// Element2d (int pi1, int pi2, int pi3); /// @@ -802,8 +802,8 @@ namespace netgen { public: /// - Segment(); - Segment (const Segment& other); + DLL_HEADER Segment(); + DLL_HEADER Segment (const Segment& other); ~Segment() { ; } @@ -927,13 +927,13 @@ namespace netgen double domout_singular; public: - FaceDescriptor(); - FaceDescriptor(int surfnri, int domini, int domouti, int tlosurfi); - FaceDescriptor(const Segment & seg); - FaceDescriptor(const FaceDescriptor& other); - ~FaceDescriptor() { ; } + DLL_HEADER FaceDescriptor(); + DLL_HEADER FaceDescriptor(int surfnri, int domini, int domouti, int tlosurfi); + DLL_HEADER FaceDescriptor(const Segment & seg); + DLL_HEADER FaceDescriptor(const FaceDescriptor& other); + DLL_HEADER ~FaceDescriptor() { ; } - int SegmentFits (const Segment & seg); + DLL_HEADER int SegmentFits (const Segment & seg); int SurfNr () const { return surfnr; } int DomainIn () const { return domin; } @@ -1231,17 +1231,17 @@ namespace netgen public: /// - Identifications (class Mesh & amesh); + DLL_HEADER Identifications (class Mesh & amesh); /// - ~Identifications (); + DLL_HEADER ~Identifications (); - void Delete (); + DLL_HEADER void Delete (); /* Identify points pi1 and pi2, due to identification nr identnr */ - void Add (PointIndex pi1, PointIndex pi2, int identnr); + DLL_HEADER void Add (PointIndex pi1, PointIndex pi2, int identnr); int Get (PointIndex pi1, PointIndex pi2) const; diff --git a/libsrc/meshing/msghandler.hpp b/libsrc/meshing/msghandler.hpp index e7632873..bab57174 100644 --- a/libsrc/meshing/msghandler.hpp +++ b/libsrc/meshing/msghandler.hpp @@ -17,39 +17,39 @@ namespace netgen //Message Pipeline: //importance: importance of message: 1=very important, 3=middle, 5=low, 7=unimportant - extern void PrintMessage(int importance, + extern DLL_HEADER void PrintMessage(int importance, const MyStr& s1, const MyStr& s2=MyStr()); - extern void PrintMessage(int importance, + extern DLL_HEADER void PrintMessage(int importance, const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4=MyStr()); - extern void PrintMessage(int importance, + extern DLL_HEADER void PrintMessage(int importance, const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4, const MyStr& s5, const MyStr& s6=MyStr(), const MyStr& s7=MyStr(), const MyStr& s8=MyStr()); // CR without line-feed - extern void PrintMessageCR(int importance, + extern DLL_HEADER void PrintMessageCR(int importance, const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); - extern void PrintFnStart(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", + extern DLL_HEADER void PrintFnStart(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); - extern void PrintWarning(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", + extern DLL_HEADER void PrintWarning(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); - extern void PrintError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", + extern DLL_HEADER void PrintError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); - extern void PrintFileError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", + extern DLL_HEADER void PrintFileError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); - extern void PrintSysError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", + extern DLL_HEADER void PrintSysError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); - extern void PrintUserError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", + extern DLL_HEADER void PrintUserError(const MyStr& s1, const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); - extern void PrintTime(const MyStr& s1="", const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", + extern DLL_HEADER void PrintTime(const MyStr& s1="", const MyStr& s2="", const MyStr& s3="", const MyStr& s4="", const MyStr& s5="", const MyStr& s6="", const MyStr& s7="", const MyStr& s8=""); - extern void SetStatMsg(const MyStr& s); + extern DLL_HEADER void SetStatMsg(const MyStr& s); - extern void PushStatus(const MyStr& s); - extern void PushStatusF(const MyStr& s); - extern void PopStatus(); - extern void SetThreadPercent(double percent); - extern void GetStatus(MyStr & s, double & percentage); + extern DLL_HEADER void PushStatus(const MyStr& s); + extern DLL_HEADER void PushStatusF(const MyStr& s); + extern DLL_HEADER void PopStatus(); + extern DLL_HEADER void SetThreadPercent(double percent); + extern DLL_HEADER void GetStatus(MyStr & s, double & percentage); } diff --git a/libsrc/visualization/mvdraw.cpp b/libsrc/visualization/mvdraw.cpp index 769a13b2..3464c7a9 100644 --- a/libsrc/visualization/mvdraw.cpp +++ b/libsrc/visualization/mvdraw.cpp @@ -22,9 +22,9 @@ namespace netgen { - Point3d VisualScene :: center; - double VisualScene :: rad; - GLdouble VisualScene :: backcolor; + DLL_HEADER Point3d VisualScene :: center; + DLL_HEADER double VisualScene :: rad; + DLL_HEADER GLdouble VisualScene :: backcolor; /* #if TOGL_MAJOR_VERSION!=2 @@ -97,8 +97,8 @@ namespace netgen } - extern void Render(); - void Render () + extern DLL_HEADER void Render(); + DLL_HEADER void Render () { multithread.redraw = 1; } diff --git a/libsrc/visualization/mvdraw.hpp b/libsrc/visualization/mvdraw.hpp index 1d6d8a8d..211227cd 100644 --- a/libsrc/visualization/mvdraw.hpp +++ b/libsrc/visualization/mvdraw.hpp @@ -19,19 +19,19 @@ namespace netgen class VisualScene { protected: - static Point3d center; - static double rad; + static DLL_HEADER Point3d center; + static DLL_HEADER double rad; static float lookatmat[16]; static float transmat[16]; static float rotmat[16]; static float centermat[16]; - static float transformationmat[16]; + static DLL_HEADER float transformationmat[16]; GLdouble clipplane[4]; int changeval; - static GLdouble backcolor; + static DLL_HEADER GLdouble backcolor; static int selface; static int selelement; @@ -52,42 +52,42 @@ namespace netgen public: - VisualScene (); - virtual ~VisualScene(); + DLL_HEADER VisualScene (); + DLL_HEADER virtual ~VisualScene(); - virtual void BuildScene (int zoomall = 0); - virtual void DrawScene (); + DLL_HEADER virtual void BuildScene (int zoomall = 0); + DLL_HEADER virtual void DrawScene (); - void CalcTransformationMatrices(); - void StandardRotation (const char * dir); - void ArbitraryRotation (const Array & alpha, const Array & vec); - void ArbitraryRotation (const double alpha, const Vec3d & vec); + DLL_HEADER void CalcTransformationMatrices(); + DLL_HEADER void StandardRotation (const char * dir); + DLL_HEADER void ArbitraryRotation (const Array & alpha, const Array & vec); + DLL_HEADER void ArbitraryRotation (const double alpha, const Vec3d & vec); - void MouseMove(int oldx, int oldy, + DLL_HEADER void MouseMove(int oldx, int oldy, int newx, int newy, char mode); - void LookAt (const Point<3> & cam, const Point<3> & obj, + DLL_HEADER void LookAt (const Point<3> & cam, const Point<3> & obj, const Point<3> & camup); - void SetClippingPlane (); + DLL_HEADER void SetClippingPlane (); - virtual void MouseDblClick (int px, int py); + DLL_HEADER virtual void MouseDblClick (int px, int py); - void SetLight (); + DLL_HEADER void SetLight (); static void SetBackGroundColor (double col) { backcolor = col; } - void CreateTexture (int ncols, int linear, int typ = GL_DECAL); - void DrawColorBar (double minval, double maxval, int logscale = 0, bool linear = 1); - void DrawCoordinateCross (); - void DrawNetgenLogo (); - void SetOpenGlColor(double val, double valmin, double valmax, int logscale = 0); + DLL_HEADER void CreateTexture (int ncols, int linear, int typ = GL_DECAL); + DLL_HEADER void DrawColorBar (double minval, double maxval, int logscale = 0, bool linear = 1); + DLL_HEADER void DrawCoordinateCross (); + DLL_HEADER void DrawNetgenLogo (); + DLL_HEADER void SetOpenGlColor(double val, double valmin, double valmax, int logscale = 0); #ifdef PARALLELGL - void InitParallelGL (); - void Broadcast (); + DLL_HEADER void InitParallelGL (); + DLL_HEADER void Broadcast (); #endif };