From 418c46e9629912d2663714e7bd740000628a0c32 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 10 Aug 2011 10:18:40 +0000 Subject: [PATCH] 0020511: EDF 1101 SMESH : Add CGNS to Mesh Format Supported Move general utils independent of SMESH data structures to SMESHUtils --- src/SMESH/Makefile.am | 25 +++----- src/SMESHUtils/Makefile.am | 57 +++++++++++++++++++ src/{SMESH => SMESHUtils}/SMESH_Block.cxx | 0 src/{SMESH => SMESHUtils}/SMESH_Block.hxx | 8 +-- src/{SMESH => SMESHUtils}/SMESH_Comment.hxx | 0 .../SMESH_ComputeError.hxx | 0 src/{SMESH => SMESHUtils}/SMESH_File.cxx | 0 src/{SMESH => SMESHUtils}/SMESH_File.hxx | 4 +- src/{SMESH => SMESHUtils}/SMESH_Octree.cxx | 0 src/{SMESH => SMESHUtils}/SMESH_Octree.hxx | 0 .../SMESH_OctreeNode.cxx | 0 .../SMESH_OctreeNode.hxx | 0 src/{SMESH => SMESHUtils}/SMESH_TypeDefs.hxx | 19 ++++++- src/SMESHUtils/SMESH_Utils.hxx | 40 +++++++++++++ 14 files changed, 128 insertions(+), 25 deletions(-) create mode 100644 src/SMESHUtils/Makefile.am rename src/{SMESH => SMESHUtils}/SMESH_Block.cxx (100%) rename src/{SMESH => SMESHUtils}/SMESH_Block.hxx (98%) rename src/{SMESH => SMESHUtils}/SMESH_Comment.hxx (100%) rename src/{SMESH => SMESHUtils}/SMESH_ComputeError.hxx (100%) rename src/{SMESH => SMESHUtils}/SMESH_File.cxx (100%) rename src/{SMESH => SMESHUtils}/SMESH_File.hxx (97%) rename src/{SMESH => SMESHUtils}/SMESH_Octree.cxx (100%) rename src/{SMESH => SMESHUtils}/SMESH_Octree.hxx (100%) rename src/{SMESH => SMESHUtils}/SMESH_OctreeNode.cxx (100%) rename src/{SMESH => SMESHUtils}/SMESH_OctreeNode.hxx (100%) rename src/{SMESH => SMESHUtils}/SMESH_TypeDefs.hxx (95%) create mode 100755 src/SMESHUtils/SMESH_Utils.hxx diff --git a/src/SMESH/Makefile.am b/src/SMESH/Makefile.am index e6e345333..040c9849f 100644 --- a/src/SMESH/Makefile.am +++ b/src/SMESH/Makefile.am @@ -40,17 +40,10 @@ salomeinclude_HEADERS = \ SMESH_3D_Algo.hxx \ SMESH_Group.hxx \ SMESH_MeshEditor.hxx \ - SMESH_Block.hxx \ SMESH_Pattern.hxx \ - SMESH_TypeDefs.hxx \ SMESH_MesherHelper.hxx \ - SMESH_Octree.hxx \ - SMESH_OctreeNode.hxx \ - SMESH_Comment.hxx \ - SMESH_ComputeError.hxx \ - SMESH_File.hxx \ - SMESH_SMESH.hxx \ - SMESH_ProxyMesh.hxx + SMESH_ProxyMesh.hxx \ + SMESH_SMESH.hxx # Libraries targets @@ -69,14 +62,10 @@ dist_libSMESHimpl_la_SOURCES = \ SMESH_3D_Algo.cxx \ SMESH_Group.cxx \ SMESH_MeshEditor.cxx \ - SMESH_Block.cxx \ SMESH_Pattern.cxx \ SMESH_HypoFilter.cxx \ - SMESH_MesherHelper.cxx \ - SMESH_Octree.cxx \ - SMESH_OctreeNode.cxx \ - SMESH_File.cxx \ - SMESH_ProxyMesh.cxx + SMESH_ProxyMesh.cxx \ + SMESH_MesherHelper.cxx # additionnal information to compile and link file libSMESHimpl_la_CPPFLAGS = \ @@ -93,8 +82,10 @@ libSMESHimpl_la_CPPFLAGS = \ -I$(srcdir)/../DriverMED \ -I$(srcdir)/../DriverUNV \ -I$(srcdir)/../DriverSTL \ + -I$(srcdir)/../DriverCGNS \ -I$(srcdir)/../SMDS \ - -I$(srcdir)/../SMESHDS + -I$(srcdir)/../SMESHDS \ + -I$(srcdir)/../SMESHUtils libSMESHimpl_la_LDFLAGS = \ ../SMESHDS/libSMESHDS.la \ @@ -103,5 +94,7 @@ libSMESHimpl_la_LDFLAGS = \ ../DriverSTL/libMeshDriverSTL.la \ ../DriverMED/libMeshDriverMED.la \ ../DriverUNV/libMeshDriverUNV.la \ + ../DriverCGNS/libMeshDriverCGNS.la \ + ../SMESHUtils/libSMESHUtils.la \ $(GEOM_LDFLAGS) -lNMTTools \ $(CAS_LDPATH) -lTKShHealing -lTKPrim -lTKG2d diff --git a/src/SMESHUtils/Makefile.am b/src/SMESHUtils/Makefile.am new file mode 100644 index 000000000..8125be45c --- /dev/null +++ b/src/SMESHUtils/Makefile.am @@ -0,0 +1,57 @@ +# Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# File : Makefile.in +# Module : SMESH +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +# header files +salomeinclude_HEADERS = \ + SMESH_Block.hxx \ + SMESH_TypeDefs.hxx \ + SMESH_Octree.hxx \ + SMESH_OctreeNode.hxx \ + SMESH_Comment.hxx \ + SMESH_ComputeError.hxx \ + SMESH_File.hxx \ + SMESH_Utils.hxx + +# Libraries targets + +lib_LTLIBRARIES = libSMESHUtils.la + +dist_libSMESHUtils_la_SOURCES = \ + SMESH_Block.cxx \ + SMESH_Octree.cxx \ + SMESH_OctreeNode.cxx \ + SMESH_File.cxx + +# additionnal information to compile and link file +libSMESHUtils_la_CPPFLAGS = \ + $(KERNEL_CXXFLAGS) \ + $(CAS_CPPFLAGS) \ + $(VTK_INCLUDES) \ + $(BOOST_CPPFLAGS) \ + -I$(srcdir)/../SMDS \ + -I$(srcdir)/../SMESHDS + +libSMESHUtils_la_LDFLAGS = \ + ../SMESHDS/libSMESHDS.la \ + $(CAS_LDPATH) -lTKShHealing -lTKPrim -lTKG2d diff --git a/src/SMESH/SMESH_Block.cxx b/src/SMESHUtils/SMESH_Block.cxx similarity index 100% rename from src/SMESH/SMESH_Block.cxx rename to src/SMESHUtils/SMESH_Block.cxx diff --git a/src/SMESH/SMESH_Block.hxx b/src/SMESHUtils/SMESH_Block.hxx similarity index 98% rename from src/SMESH/SMESH_Block.hxx rename to src/SMESHUtils/SMESH_Block.hxx index 3771907ec..a6b1e72d1 100644 --- a/src/SMESH/SMESH_Block.hxx +++ b/src/SMESHUtils/SMESH_Block.hxx @@ -27,7 +27,7 @@ #ifndef SMESH_Block_HeaderFile #define SMESH_Block_HeaderFile -#include "SMESH_SMESH.hxx" +#include "SMESH_Utils.hxx" //#include //#include @@ -59,7 +59,7 @@ class gp_Pnt; // parameters inside the block and vice versa // ========================================================= -class SMESH_EXPORT SMESH_Block: public math_FunctionSetWithDerivatives +class SMESHUtils_EXPORT SMESH_Block: public math_FunctionSetWithDerivatives { public: enum TShapeID { @@ -311,7 +311,7 @@ public: // Note 2: curve adaptors need to have only Value(double), FirstParameter() and // LastParameter() defined to be used by Block algoritms - class SMESH_EXPORT TEdge { + class SMESHUtils_EXPORT TEdge { int myCoordInd; double myFirst; double myLast; @@ -331,7 +331,7 @@ public: ~TEdge(); }; - class SMESH_EXPORT TFace { + class SMESHUtils_EXPORT TFace { // 4 edges in the order u0, u1, 0v, 1v int myCoordInd[ 4 ]; double myFirst [ 4 ]; diff --git a/src/SMESH/SMESH_Comment.hxx b/src/SMESHUtils/SMESH_Comment.hxx similarity index 100% rename from src/SMESH/SMESH_Comment.hxx rename to src/SMESHUtils/SMESH_Comment.hxx diff --git a/src/SMESH/SMESH_ComputeError.hxx b/src/SMESHUtils/SMESH_ComputeError.hxx similarity index 100% rename from src/SMESH/SMESH_ComputeError.hxx rename to src/SMESHUtils/SMESH_ComputeError.hxx diff --git a/src/SMESH/SMESH_File.cxx b/src/SMESHUtils/SMESH_File.cxx similarity index 100% rename from src/SMESH/SMESH_File.cxx rename to src/SMESHUtils/SMESH_File.cxx diff --git a/src/SMESH/SMESH_File.hxx b/src/SMESHUtils/SMESH_File.hxx similarity index 97% rename from src/SMESH/SMESH_File.hxx rename to src/SMESHUtils/SMESH_File.hxx index 28400df80..22794e9e6 100644 --- a/src/SMESH/SMESH_File.hxx +++ b/src/SMESHUtils/SMESH_File.hxx @@ -24,7 +24,7 @@ #ifndef __SMESH_File_HXX__ #define __SMESH_File_HXX__ -#include "SMESH_SMESH.hxx" +#include "SMESH_Utils.hxx" #include #include @@ -38,7 +38,7 @@ /*! * \brief High level util for effective file reading and other file operations */ -class SMESH_EXPORT SMESH_File +class SMESHUtils_EXPORT SMESH_File { public: diff --git a/src/SMESH/SMESH_Octree.cxx b/src/SMESHUtils/SMESH_Octree.cxx similarity index 100% rename from src/SMESH/SMESH_Octree.cxx rename to src/SMESHUtils/SMESH_Octree.cxx diff --git a/src/SMESH/SMESH_Octree.hxx b/src/SMESHUtils/SMESH_Octree.hxx similarity index 100% rename from src/SMESH/SMESH_Octree.hxx rename to src/SMESHUtils/SMESH_Octree.hxx diff --git a/src/SMESH/SMESH_OctreeNode.cxx b/src/SMESHUtils/SMESH_OctreeNode.cxx similarity index 100% rename from src/SMESH/SMESH_OctreeNode.cxx rename to src/SMESHUtils/SMESH_OctreeNode.cxx diff --git a/src/SMESH/SMESH_OctreeNode.hxx b/src/SMESHUtils/SMESH_OctreeNode.hxx similarity index 100% rename from src/SMESH/SMESH_OctreeNode.hxx rename to src/SMESHUtils/SMESH_OctreeNode.hxx diff --git a/src/SMESH/SMESH_TypeDefs.hxx b/src/SMESHUtils/SMESH_TypeDefs.hxx similarity index 95% rename from src/SMESH/SMESH_TypeDefs.hxx rename to src/SMESHUtils/SMESH_TypeDefs.hxx index e337d56ff..404565812 100644 --- a/src/SMESH/SMESH_TypeDefs.hxx +++ b/src/SMESHUtils/SMESH_TypeDefs.hxx @@ -27,7 +27,7 @@ #ifndef __SMESH_TypeDefs_HXX__ #define __SMESH_TypeDefs_HXX__ -#include "SMESH_SMESH.hxx" +#include "SMESH_Utils.hxx" #include @@ -48,6 +48,19 @@ typedef std::set< const SMDS_MeshNode*, TIDCompare > TIDSortedNodeSet; typedef pair< const SMDS_MeshNode*, const SMDS_MeshNode* > NLink; +namespace SMESHUtils +{ + /*! + * \brief Enforce freeing memory allocated by std::vector + */ + template + void FreeVector(TVECTOR& vec) + { + TVECTOR v2; + vec.swap( v2 ); + } +} + //======================================================================= /*! * \brief A sorted pair of nodes @@ -139,7 +152,7 @@ DEFINE_SEQUENCE(SMESH_SequenceOfNode, // -------------------------------------------------------------------------------- // class SMESH_DataMapOfElemPtrSequenceOfElemPtr -// SMESH_EXPORT +// SMESHUtils_EXPORT // inline Standard_Integer HashCode(SMDS_MeshElementPtr theElem, // const Standard_Integer theUpper) // { @@ -147,7 +160,7 @@ DEFINE_SEQUENCE(SMESH_SequenceOfNode, // return HashCode(anElem,theUpper); // } -// SMESH_EXPORT +// SMESHUtils_EXPORT // inline Standard_Boolean IsEqual(SMDS_MeshElementPtr theOne, // SMDS_MeshElementPtr theTwo) // { diff --git a/src/SMESHUtils/SMESH_Utils.hxx b/src/SMESHUtils/SMESH_Utils.hxx new file mode 100755 index 000000000..de8f2a0f3 --- /dev/null +++ b/src/SMESHUtils/SMESH_Utils.hxx @@ -0,0 +1,40 @@ +// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// File : SMESH_Utils.hxx +// Author : Alexander A. BORODIN +// Module : SMESH +// +#ifndef _SMESH_Utils_hxx_ +#define _SMESH_Utils_hxx_ + +#ifdef WNT + #if defined SMESHUtils_EXPORTS + #define SMESHUtils_EXPORT __declspec( dllexport ) + #else + #define SMESHUtils_EXPORT __declspec( dllimport ) + #endif +#else + #define SMESHUtils_EXPORT +#endif + +#endif -- 2.39.2