Salome HOME
Windows porting
authorszy <szy@opencascade.com>
Tue, 30 Aug 2005 12:57:02 +0000 (12:57 +0000)
committerszy <szy@opencascade.com>
Tue, 30 Aug 2005 12:57:02 +0000 (12:57 +0000)
16 files changed:
src/Controls/SMESH_Controls.cxx
src/SMDS/SMDS_EdgePosition.hxx
src/SMDS/SMDS_FacePosition.hxx
src/SMDS/SMDS_Mesh.hxx
src/SMDS/SMDS_MeshElement.hxx
src/SMDS/SMDS_MeshGroup.hxx
src/SMDS/SMDS_MeshNode.hxx
src/SMDS/SMDS_MeshObject.hxx
src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx
src/SMDS/SMDS_Position.hxx
src/SMDS/SMDS_SpacePosition.hxx
src/SMDS/SMDS_VertexPosition.hxx
src/SMDS/SMDS_VolumeTool.hxx
src/SMESHDS/SMESHDS_Mesh.cxx
src/SMESHDS/SMESHDS_Mesh.hxx
src/SMESHDS/SMESHDS_SubMesh.cxx

index 0714f7ea4b8027f389c0dea1d8ae4a6b41dcc161..1aef723e89b63098ee06af41b623a08ef660286e 100644 (file)
@@ -253,7 +253,13 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
 
   // Compute lengths of the sides
 
 
   // Compute lengths of the sides
 
-  double aLen[ nbNodes ];
+  //double aLen[ nbNodes ];
+#ifndef WNT
+  double aLen [nbNodes];
+#else
+  double* aLen = (double *)new double[nbNodes];
+#endif
+
   for ( int i = 0; i < nbNodes - 1; i++ )
     aLen[ i ] = getDistance( P( i + 1 ), P( i + 2 ) );
   aLen[ nbNodes - 1 ] = getDistance( P( 1 ), P( nbNodes ) );
   for ( int i = 0; i < nbNodes - 1; i++ )
     aLen[ i ] = getDistance( P( i + 1 ), P( i + 2 ) );
   aLen[ nbNodes - 1 ] = getDistance( P( 1 ), P( nbNodes ) );
@@ -279,6 +285,9 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
       aMinLen = Min( aMinLen, aLen[ i ] );
       aMaxLen = Max( aMaxLen, aLen[ i ] );
     }
       aMinLen = Min( aMinLen, aLen[ i ] );
       aMaxLen = Max( aMaxLen, aLen[ i ] );
     }
+#ifdef WNT
+  delete [] aLen;
+#endif
     if ( aMinLen <= Precision::Confusion() )
       return 0.;
 
     if ( aMinLen <= Precision::Confusion() )
       return 0.;
 
@@ -1270,7 +1279,12 @@ bool FreeEdges::IsSatisfy( long theId )
     return false;
 
   int nbNodes = aFace->NbNodes();
     return false;
 
   int nbNodes = aFace->NbNodes();
-  const SMDS_MeshNode* aNodes[ nbNodes ];
+  //const SMDS_MeshNode* aNodes[ nbNodes ];
+#ifndef WNT
+  const SMDS_MeshNode* aNodes [nbNodes];
+#else
+  const SMDS_MeshNode** aNodes = (const SMDS_MeshNode **)new SMDS_MeshNode*[nbNodes];
+#endif
   int i = 0;
   SMDS_ElemIteratorPtr anIter = aFace->nodesIterator();
   if ( anIter != 0 )
   int i = 0;
   SMDS_ElemIteratorPtr anIter = aFace->nodesIterator();
   if ( anIter != 0 )
@@ -1285,13 +1299,20 @@ bool FreeEdges::IsSatisfy( long theId )
   }
 
   for ( int i = 0; i < nbNodes - 1; i++ )
   }
 
   for ( int i = 0; i < nbNodes - 1; i++ )
-    if ( IsFreeEdge( &aNodes[ i ], theId ) )
+         if ( IsFreeEdge( &aNodes[ i ], theId ) ) {
+#ifdef WNT
+               delete [] aNodes;
+#endif
       return true;
       return true;
+         }
 
   aNodes[ 1 ] = aNodes[ nbNodes - 1 ];
 
   aNodes[ 1 ] = aNodes[ nbNodes - 1 ];
-
-  return IsFreeEdge( &aNodes[ 0 ], theId );
-
+  const Standard_Boolean isFree = IsFreeEdge( &aNodes[ 0 ], theId );
+#ifdef WNT
+               delete [] aNodes;
+#endif
+//  return 
+ return isFree;
 }
 
 SMDSAbs_ElementType FreeEdges::GetType() const
 }
 
 SMDSAbs_ElementType FreeEdges::GetType() const
@@ -2138,7 +2159,7 @@ void ManifoldPart::expandBoundary
 {
   ManifoldPart::TVectorOfLink aLinks;
   getLinks( theNextFace, aLinks );
 {
   ManifoldPart::TVectorOfLink aLinks;
   getLinks( theNextFace, aLinks );
-  int aNbLink = aLinks.size();
+  int aNbLink = (int)aLinks.size();
   for ( int i = 0; i < aNbLink; i++ )
   {
     ManifoldPart::Link aLink = aLinks[ i ];
   for ( int i = 0; i < aNbLink; i++ )
   {
     ManifoldPart::Link aLink = aLinks[ i ];
index 84916246b8c302dee16fa30b73ae0b8fd9bc5845..fd297d3abee7691a43c5952a02041238ec534fe1 100644 (file)
 
 #include "SMDS_Position.hxx"
 
 
 #include "SMDS_Position.hxx"
 
-class SMDS_EdgePosition:public SMDS_Position
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
+class SMDS_WNT_EXPORT SMDS_EdgePosition:public SMDS_Position
 {
 
   public:
 {
 
   public:
index 255fd05d8cecde7b938a9d887eea57fd16297c77..8ca74130fd0d83724e10f138101ad5a7b967d0c4 100644 (file)
 
 #include "SMDS_Position.hxx"
 
 
 #include "SMDS_Position.hxx"
 
-class SMDS_FacePosition:public SMDS_Position
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
+class SMDS_WNT_EXPORT SMDS_FacePosition:public SMDS_Position
 {
 
   public:
 {
 
   public:
index 7f00c4be76141b6c4710eb9a7d749a9c055a0ed5..612082ce47ea78b9cf49bc4571e89459098be71d 100644 (file)
 #include "SMDS_ElemIterator.hxx"
 #include <NCollection_Map.hxx>
 
 #include "SMDS_ElemIterator.hxx"
 #include <NCollection_Map.hxx>
 
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
 #include <boost/shared_ptr.hpp>
 #include <set>
 #include <list>
 #include <boost/shared_ptr.hpp>
 #include <set>
 #include <list>
@@ -48,7 +59,7 @@ typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshFace *> > SMDS_FaceIterat
 typedef SMDS_Iterator<const SMDS_MeshVolume *> SMDS_VolumeIterator;
 typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshVolume *> > SMDS_VolumeIteratorPtr;
 
 typedef SMDS_Iterator<const SMDS_MeshVolume *> SMDS_VolumeIterator;
 typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshVolume *> > SMDS_VolumeIteratorPtr;
 
-class SMDS_Mesh:public SMDS_MeshObject{
+class SMDS_WNT_EXPORT SMDS_Mesh:public SMDS_MeshObject{
 public:
   
   SMDS_Mesh();
 public:
   
   SMDS_Mesh();
index b9f61351b37ceeff2b652c00243fe3f95be3e07c..73870b707fbf37d96184688cd7ac4c763a98ca0a 100644 (file)
 #include "SMDS_ElemIterator.hxx"
 #include "SMDS_MeshElementIDFactory.hxx"
 
 #include "SMDS_ElemIterator.hxx"
 #include "SMDS_MeshElementIDFactory.hxx"
 
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
 #include <vector>
 #include <iostream>
 
 #include <vector>
 #include <iostream>
 
@@ -42,7 +54,7 @@ class SMDS_MeshFace;
 ///////////////////////////////////////////////////////////////////////////////
 /// Base class for elements
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
 /// Base class for elements
 ///////////////////////////////////////////////////////////////////////////////
-class SMDS_MeshElement:public SMDS_MeshObject
+class SMDS_WNT_EXPORT SMDS_MeshElement:public SMDS_MeshObject
 {
 
   public:
 {
 
   public:
index ef2264c12f695c5776cce27251c88a38df5eb993..37893fab42bb46d6e4405b38d9e7f6f659f21165 100644 (file)
 #include "SMDS_Mesh.hxx"
 #include <set>
 
 #include "SMDS_Mesh.hxx"
 #include <set>
 
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
 
 
-class SMDS_MeshGroup:public SMDS_MeshObject
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
+class SMDS_WNT_EXPORT SMDS_MeshGroup:public SMDS_MeshObject
 {
   public:
        SMDS_MeshGroup(const SMDS_Mesh * theMesh,
 {
   public:
        SMDS_MeshGroup(const SMDS_Mesh * theMesh,
index fec75242ed25207965628935ca18bcc208225170..042a1734af5bfdefef81be8e24fbb719339bfe8c 100644 (file)
 #include "SMDS_Position.hxx"
 #include <NCollection_List.hxx>
 
 #include "SMDS_Position.hxx"
 #include <NCollection_List.hxx>
 
-class SMDS_MeshNode:public SMDS_MeshElement
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
+class SMDS_WNT_EXPORT SMDS_MeshNode:public SMDS_MeshElement
 {
 
   public:
 {
 
   public:
index 8386f211566afd77415ac71ef8d4314383ac5108..f734309cf2d79000b9b3a5111aa28ca0a552a8ca 100644 (file)
 #ifndef _SMDS_MeshObject_HeaderFile
 #define _SMDS_MeshObject_HeaderFile
 
 #ifndef _SMDS_MeshObject_HeaderFile
 #define _SMDS_MeshObject_HeaderFile
 
-class SMDS_MeshObject
+
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
+class SMDS_WNT_EXPORT SMDS_MeshObject
 {
  public:
   virtual ~SMDS_MeshObject() {}
 {
  public:
   virtual ~SMDS_MeshObject() {}
index 8b2613474f4dd349495e4f9236222263a91a2630..84ce2134d879b2ea16b9a6cf4c2e760cffcfde03 100644 (file)
@@ -75,7 +75,11 @@ bool SMDS_PolyhedralVolumeOfNodes::ChangeNodes (std::vector<const SMDS_MeshNode
   }
 
   int k = 0;
   }
 
   int k = 0;
+#ifndef WNT
   const SMDS_MeshNode* aNodes [aNbNodes];
   const SMDS_MeshNode* aNodes [aNbNodes];
+#else
+  const SMDS_MeshNode** aNodes = (const SMDS_MeshNode **)new SMDS_MeshNode*[aNbNodes];
+#endif
   std::set<const SMDS_MeshNode *>::iterator anIter = aSet.begin();
   for (; anIter != aSet.end(); anIter++, k++) {
     aNodes[k] = *anIter;
   std::set<const SMDS_MeshNode *>::iterator anIter = aSet.begin();
   for (; anIter != aSet.end(); anIter++, k++) {
     aNodes[k] = *anIter;
@@ -91,6 +95,10 @@ bool SMDS_PolyhedralVolumeOfNodes::ChangeNodes (std::vector<const SMDS_MeshNode
     myNodes[i] = aNodes[i];
   }
 
     myNodes[i] = aNodes[i];
   }
 
+#ifdef WNT
+  delete [] aNodes;
+#endif
+
   return true;
 }
 
   return true;
 }
 
index a18ec9eb223e0fbb72011cf411cc79ce0d1e3975..9b11dc6f9662361070efa0dbb0837566fe62cd06 100644 (file)
 #include "SMDS_TypeOfPosition.hxx"
 #include <boost/shared_ptr.hpp>
 
 #include "SMDS_TypeOfPosition.hxx"
 #include <boost/shared_ptr.hpp>
 
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
 class SMDS_Position;
 typedef boost::shared_ptr<SMDS_Position> SMDS_PositionPtr;
 
 
 class SMDS_Position;
 typedef boost::shared_ptr<SMDS_Position> SMDS_PositionPtr;
 
 
-class SMDS_Position
+class SMDS_WNT_EXPORT SMDS_Position
 {
 
   public:
 {
 
   public:
index e4fadd6b1837cf79ac9aafac5aff6bcc2511e94c..f4c7bff1a6d962a9cb44567e539e83f9d596f799 100644 (file)
 
 #include "SMDS_Position.hxx"
 
 
 #include "SMDS_Position.hxx"
 
-class SMDS_SpacePosition:public SMDS_Position
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
+class SMDS_WNT_EXPORT SMDS_SpacePosition:public SMDS_Position
 {
 
   public:
 {
 
   public:
index 52ef0591804abad199259494ec2ce8d00a7c024f..68c1e3a58af5a9690f5ccc10f57be7a825519ef1 100644 (file)
 
 #include "SMDS_Position.hxx"
 
 
 #include "SMDS_Position.hxx"
 
-class SMDS_VertexPosition:public SMDS_Position
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
+class SMDS_WNT_EXPORT SMDS_VertexPosition:public SMDS_Position
 {
 
   public:      
 {
 
   public:      
index 89732b1da2c265a8f4c40ec8f1eb3de77b7a4622..e8891b93a1c4ecc7fa07392f4ffb1b6cf07c3b81 100644 (file)
@@ -37,6 +37,18 @@ class SMDS_PolyhedralVolumeOfNodes;
 #include <vector>
 #include <set>
 
 #include <vector>
 #include <set>
 
+//#ifdef WNT
+//#include <SALOME_WNT.hxx>
+//#else
+//#define SALOME_WNT_EXPORT
+//#endif
+
+#if defined WNT && defined WIN32 && defined SMDS_EXPORTS
+#define SMDS_WNT_EXPORT __declspec( dllexport )
+#else
+#define SMDS_WNT_EXPORT
+#endif
+
 // =========================================================================
 //
 // Class providing topological and other information about SMDS_MeshVolume:
 // =========================================================================
 //
 // Class providing topological and other information about SMDS_MeshVolume:
@@ -45,7 +57,7 @@ class SMDS_PolyhedralVolumeOfNodes;
 //
 // =========================================================================
 
 //
 // =========================================================================
 
-class SMDS_VolumeTool
+class SMDS_WNT_EXPORT SMDS_VolumeTool
 {
  public:
 
 {
  public:
 
index ded954d0ce39c9e9cdf7921c4159bb8d01e3cef7..40d686a7ee356904441b2f1647879f168df6abd1 100644 (file)
@@ -173,11 +173,20 @@ bool SMESHDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * elem,
 
   //ASSERT( nbnodes < 9 );
   //int i, IDs[ 8 ];
 
   //ASSERT( nbnodes < 9 );
   //int i, IDs[ 8 ];
+#ifndef WNT
   int i, IDs[ nbnodes ];
   int i, IDs[ nbnodes ];
+#else
+  int i, *IDs;
+  IDs = new int[ nbnodes];
+#endif
   for ( i = 0; i < nbnodes; i++ )
     IDs [ i ] = nodes[ i ]->GetID();
   myScript->ChangeElementNodes( elem->GetID(), IDs, nbnodes);
 
   for ( i = 0; i < nbnodes; i++ )
     IDs [ i ] = nodes[ i ]->GetID();
   myScript->ChangeElementNodes( elem->GetID(), IDs, nbnodes);
 
+#ifdef WNT
+  delete [] IDs;
+#endif
+
   return true;
 }
 
   return true;
 }
 
@@ -192,12 +201,21 @@ bool SMESHDS_Mesh::ChangePolygonNodes
   ASSERT(nodes.size() > 3);
 
   int nb = nodes.size();
   ASSERT(nodes.size() > 3);
 
   int nb = nodes.size();
+#ifndef WNT
   const SMDS_MeshNode* nodes_array [nb];
   const SMDS_MeshNode* nodes_array [nb];
+#else
+  const SMDS_MeshNode** nodes_array = (const SMDS_MeshNode **)new SMDS_MeshNode*[nb];
+#endif
   for (int inode = 0; inode < nb; inode++) {
     nodes_array[inode] = nodes[inode];
   }
   for (int inode = 0; inode < nb; inode++) {
     nodes_array[inode] = nodes[inode];
   }
-
+#ifndef WNT
   return ChangeElementNodes(elem, nodes_array, nb);
   return ChangeElementNodes(elem, nodes_array, nb);
+#else
+  bool aRes = ChangeElementNodes(elem, nodes_array, nb);
+  delete [] nodes_array;
+  return aRes;
+#endif
 }
 
 //=======================================================================
 }
 
 //=======================================================================
index 86b9071c114cac6251169a2ef3d00da43c5b0c06..fdf90a30b400efc9238ac50e352d69dc58f7744b 100644 (file)
@@ -43,6 +43,9 @@
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Edge.hxx>
 #include <map>
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Edge.hxx>
 #include <map>
+#ifdef WNT
+#include <hash_map>
+#endif
 
 //Not portable see http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#5_4 to know more.
 #ifdef __GNUC__
 
 //Not portable see http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#5_4 to know more.
 #ifdef __GNUC__
@@ -235,13 +238,39 @@ public:
   ~SMESHDS_Mesh();
   
 private:
   ~SMESHDS_Mesh();
   
 private:
+#ifndef WNT
   struct HashTopoDS_Shape{
     size_t operator()(const TopoDS_Shape& S) const {
       return S.HashCode(2147483647);
     }
   };
   struct HashTopoDS_Shape{
     size_t operator()(const TopoDS_Shape& S) const {
       return S.HashCode(2147483647);
     }
   };
+#else
+  typedef gstd::hash_compare< TopoDS_Shape, less<TopoDS_Shape> > HashTopoDS;
+
+  class HashTopoDS_Shape : public HashTopoDS {
+  public:
+  
+    size_t operator()(const TopoDS_Shape& S) const {
+      return S.HashCode(2147483647);
+    }
+
+       bool operator()(const TopoDS_Shape& S1,const TopoDS_Shape& S2) const {
+               return S1==S2;
+       }
+  };
+
+
+
+#endif
+
   typedef std::list<const SMESHDS_Hypothesis*> THypList;
   typedef std::list<const SMESHDS_Hypothesis*> THypList;
+
+#ifndef WNT
+  typedef gstd::hash_map<TopoDS_Shape,THypList,HashTopoDS_Shape> ShapeToHypothesis;
+#else
   typedef gstd::hash_map<TopoDS_Shape,THypList,HashTopoDS_Shape> ShapeToHypothesis;
   typedef gstd::hash_map<TopoDS_Shape,THypList,HashTopoDS_Shape> ShapeToHypothesis;
+#endif
+
   ShapeToHypothesis          myShapeToHypothesis;
 
   int                        myMeshID;
   ShapeToHypothesis          myShapeToHypothesis;
 
   int                        myMeshID;
index 4218db744e24a4e62c38a5a0b53791e60575206d..5bdbfc6a4e3bccbc644d6eabb228579d60cda8a5 100644 (file)
@@ -87,7 +87,11 @@ int SMESHDS_SubMesh::NbElements() const
     return myElements.size();
 
   int nbElems = 0;
     return myElements.size();
 
   int nbElems = 0;
+#ifndef WNT
   set<const SMESHDS_SubMesh*>::iterator it = mySubMeshes.begin();
   set<const SMESHDS_SubMesh*>::iterator it = mySubMeshes.begin();
+#else
+  set<const SMESHDS_SubMesh*>::const_iterator it = mySubMeshes.begin();
+#endif
   for ( ; it != mySubMeshes.end(); it++ )
     nbElems += (*it)->NbElements();
 
   for ( ; it != mySubMeshes.end(); it++ )
     nbElems += (*it)->NbElements();
 
@@ -105,7 +109,11 @@ int SMESHDS_SubMesh::NbNodes() const
    return myNodes.size(); 
 
   int nbElems = 0;
    return myNodes.size(); 
 
   int nbElems = 0;
+#ifndef WNT
   set<const SMESHDS_SubMesh*>::iterator it = mySubMeshes.begin();
   set<const SMESHDS_SubMesh*>::iterator it = mySubMeshes.begin();
+#else
+  set<const SMESHDS_SubMesh*>::const_iterator it = mySubMeshes.begin();
+#endif
   for ( ; it != mySubMeshes.end(); it++ )
     nbElems += (*it)->NbNodes();
 
   for ( ; it != mySubMeshes.end(); it++ )
     nbElems += (*it)->NbNodes();