0020511: EDF 1101 SMESH : Add CGNS to Mesh Format Supported

Move general utils independent of SMESH data structures to SMESHUtils
This commit is contained in:
eap 2011-08-10 10:18:40 +00:00
parent b87bbe0ce5
commit 418c46e962
14 changed files with 128 additions and 25 deletions

View File

@ -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

View File

@ -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

View File

@ -27,7 +27,7 @@
#ifndef SMESH_Block_HeaderFile
#define SMESH_Block_HeaderFile
#include "SMESH_SMESH.hxx"
#include "SMESH_Utils.hxx"
//#include <Geom2d_Curve.hxx>
//#include <Geom_Curve.hxx>
@ -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 ];

View File

@ -24,7 +24,7 @@
#ifndef __SMESH_File_HXX__
#define __SMESH_File_HXX__
#include "SMESH_SMESH.hxx"
#include "SMESH_Utils.hxx"
#include <string>
#include <vector>
@ -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:

View File

@ -27,7 +27,7 @@
#ifndef __SMESH_TypeDefs_HXX__
#define __SMESH_TypeDefs_HXX__
#include "SMESH_SMESH.hxx"
#include "SMESH_Utils.hxx"
#include <SMDS_MeshNode.hxx>
@ -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 <class TVECTOR>
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)
// {

40
src/SMESHUtils/SMESH_Utils.hxx Executable file
View File

@ -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