Upgrade to SMESH7.7.1

This commit is contained in:
Jean-Marie Verdun 2016-05-14 10:05:56 +02:00 committed by wmayer
parent 79dcdfbc78
commit 666a3e5a68
413 changed files with 123000 additions and 24038 deletions

View File

@ -17,7 +17,12 @@ if(CMAKE_COMPILER_IS_CLANGXX)
endif()
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
find_package(VTK REQUIRED)
find_package(HDF5 REQUIRED)
find_package(OPENCASCADE)
find_package(MEDFile REQUIRED)
find_package(Boost COMPONENTS filesystem program_options regex signals system thread REQUIRED)
include(${VTK_USE_FILE})
include_directories(
src/SMDS
src/Driver
@ -34,6 +39,9 @@ include_directories(
${NGLIB_INCLUDE_DIR}
${NETGEN_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR}
${VTK_INCLUDE_DIR}
${HDF5_INCLUDE_DIR}
${BOOST_INCLUDE_DIR}
)
link_directories(${OCC_LIBRARY_DIR})
@ -150,7 +158,7 @@ ENDIF(UNIX)
#########
FILE(GLOB SMDS_source_files src/SMDS/*.cpp inc/SMDS*.hxx)
ADD_LIBRARY(SMDS SHARED ${SMDS_source_files})
TARGET_LINK_LIBRARIES(SMDS ${SMESH_LIBS})
TARGET_LINK_LIBRARIES(SMDS ${SMESH_LIBS} ${HDF5_C_STATIC_LIBRARY} ${VTK_LIBRARIES})
SET_BIN_DIR(SMDS SMDS)
if(WIN32)
@ -183,7 +191,7 @@ endif(WIN32)
#############
FILE(GLOB DriverSTL_source_files src/DriverSTL/*.cpp inc/DriverSTL*.h*)
ADD_LIBRARY(DriverSTL SHARED ${DriverSTL_source_files})
TARGET_LINK_LIBRARIES(DriverSTL ${SMESH_LIBS} Driver SMDS)
TARGET_LINK_LIBRARIES(DriverSTL ${SMESH_LIBS} Driver SMDS ${Boost_LIBRARIES})
SET_BIN_DIR(DriverSTL DriverSTL)
if(WIN32)
@ -244,7 +252,7 @@ endif(WIN32)
###########
FILE(GLOB SMESHDS_source_files src/SMESHDS/*.cpp inc/SMESHDS_*.h*)
ADD_LIBRARY(SMESHDS SHARED ${SMESHDS_source_files})
TARGET_LINK_LIBRARIES(SMESHDS ${SMESH_LIBS} SMDS )
TARGET_LINK_LIBRARIES(SMESHDS ${SMESH_LIBS} SMDS ${Boost_LIBRARIES} )
SET_BIN_DIR(SMESHDS SMESHDS)
@ -256,9 +264,9 @@ SET_BIN_DIR(SMESHDS SMESHDS)
#########
# SMESH #
#########
FILE(GLOB SMESH_source_files src/SMESH/*.cpp src/Controls/*.cpp inc/SMESH_*.h*)
FILE(GLOB SMESH_source_files src/SMESH/*.c src/SMESH/*.cpp src/Controls/*.cpp inc/SMESH_*.h*)
ADD_LIBRARY(SMESH SHARED ${SMESH_source_files})
TARGET_LINK_LIBRARIES(SMESH SMDS SMESHDS Driver DriverSTL DriverDAT DriverUNV ${SMESH_LIBS})
TARGET_LINK_LIBRARIES(SMESH SMDS SMESHDS Driver DriverSTL DriverDAT DriverUNV ${SMESH_LIBS} ${OPENCASCADE_LIBRARIES} ${OCC_LIBRARIES} ${OCC_DEBUG_LIBRARIES} ${OCC_OCAF_DEBUG_LIBRARIES} ${OCC_OCAF_LIBRARIES} ${MEDFILE_LIBRARIES})
SET_BIN_DIR(SMESH SMESH)
if(WIN32)
@ -362,7 +370,7 @@ if (BUILD_FEM_NETGEN)
################
FILE(GLOB NETGENPlugin_source_files src/NETGENPlugin/*.cpp inc/NETGENPlugin_*.h* )
ADD_LIBRARY(NETGENPlugin SHARED ${NETGENPlugin_source_files})
TARGET_LINK_LIBRARIES(NETGENPlugin SMDS SMESHDS SMESH StdMeshers ${SMESH_LIBS} )
TARGET_LINK_LIBRARIES(NETGENPlugin SMDS SMESHDS SMESH StdMeshers ${SMESH_LIBS} )
SET_BIN_DIR(NETGENPlugin NETGENPlugin)
if(WIN32)

View File

@ -0,0 +1,51 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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 : Basics_OCCTVersion.hxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S (julia.dorovskikh@opencascade.com)
#ifndef BASICS_OCCTVERSION_HXX
#define BASICS_OCCTVERSION_HXX
#include <Standard_Version.hxx>
//
// NOTE: Since version 6.7.0 OCC_VERSION_DEVELOPMENT macro in the Standard_Version.hxx
// points to the development status of the OCCT version: for example "dev", "alpha",
// "beta", "rc1", etc.
// OCC_VERSION_MAJOR, OCC_VERSION_MINOR and OCC_VERSION_MAINTENANCE macros
// specify actual (final) version number; for development version it is a future
// target version number (i.e. version number is incremented immediately after
// releasing of the stable version).
//
#ifdef OCC_VERSION_SERVICEPACK
# define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK)
#else
# ifdef OCC_VERSION_DEVELOPMENT
# define OCC_VERSION_LARGE ((OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)-1)
# else
# define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)
# endif
#endif
#endif // BASICS_OCCTVERSION_HXX

View File

@ -0,0 +1,143 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// SALOME Utils : general SALOME's definitions and tools
// File : Basics_DirUtils.hxx
// Autor : Alexander A. BORODIN
// Module : SALOME
//
#ifndef _Basics_UTILS_HXX_
#define _Basics_UTILS_HXX_
#include "SALOME_Basics.hxx"
#include <string>
#include <iostream>
#ifndef WIN32
#include <sys/time.h>
#else
#include <winsock2.h>
#include <windows.h>
#pragma comment(lib,"winmm.lib")
#endif
namespace Kernel_Utils
{
BASICS_EXPORT std::string GetHostname();
class BASICS_EXPORT Localizer
{
public:
Localizer();
~Localizer();
private:
std::string myCurLocale;
};
//! GUID type
enum GUIDtype {
DefUserID = 1, //!< Default user attribute ID
ObjectdID //!< Global usage object identifier ID
};
//! Get predefined GUID
BASICS_EXPORT std::string GetGUID( GUIDtype );
#ifndef WIN32
BASICS_EXPORT void print_traceback();
#else
#if (_MSC_VER >= 1400) // Visual Studio 2005
BASICS_EXPORT int setenv(const char*, const char*, int);
#endif
#endif
}
//
// =============================================================
// Helper macro for time analysis
// =============================================================
//
#ifndef WIN32
#define START_TIMING(name) static long name##tcount=0;static long name##cumul;long name##tt0; timeval name##tv; gettimeofday(&name##tv,0); \
name##tt0=name##tv.tv_usec+name##tv.tv_sec*1000000; \
if(name##tcount==0)std::cerr<<__FILE__<<":"<<__LINE__<<":"<<#name<<std::endl;
#define END_TIMING(name,NUMBER) name##tcount=name##tcount+1;gettimeofday(&name##tv,0); \
name##cumul=name##cumul+name##tv.tv_usec+name##tv.tv_sec*1000000 -name##tt0; \
if(name##tcount==NUMBER){ \
std::cerr <<__FILE__<<":"<<__LINE__<<":"<<#name<<" temps CPU(mus): "<< name##cumul<<std::endl; \
name##tcount=0;name##cumul=0;}
#else
#define START_TIMING(name) static long name##tcount=0;static DWORD name##cumul;DWORD name##tv;DWORD name##tt0 = timeGetTime(); \
if(name##tcount==0)std::cerr<<__FILE__<<":"<<__LINE__<<":"<<#name<<std::endl;
#define END_TIMING(name,NUMBER) name##tcount=name##tcount+1; name##tv = timeGetTime(); \
name##cumul=name##cumul+name##tv - name##tt0; \
if(name##tcount==NUMBER){ \
std::cerr <<__FILE__<<":"<<__LINE__<<":"<<#name<<" temps CPU(mus): "<< name##cumul<<std::endl; \
name##tcount=0;name##cumul=0;}
#endif
//
// =============================================================
// Macro and template functions for type conversions.
// =============================================================
//
#include <string>
#include <sstream>
#include <stdlib.h>
template < class T >
std::string ToString(const T &arg)
{
std::stringstream out;
out << arg;
return(out.str());
}
template < class T >
double ToDouble(const T &arg) {
std::stringstream out;
out << arg;
double value = atof(out.str().c_str());
return value;
}
//
// =============================================================
// Simple Logger macros (no dependency with SALOME)
// =============================================================
//
#if defined(_DEBUG_) || defined(_DEBUG)
#define STDLOG(msg) {std::cerr<<std::flush<<__FILE__<<" ["<<__LINE__<<"] : "<<msg<<std::endl<<std::flush;}
#else
#define STDLOG(msg)
#endif
#ifdef LOG
#undef LOG
#endif
#define LOG STDLOG
#endif //_Basics_UTILS_HXX_

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _INCLUDE_DRIVERDAT_R_SMDS_MESH
#define _INCLUDE_DRIVERDAT_R_SMDS_MESH

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH DriverDAT : driver to read and write 'dat' files
// File : DriverDAT_W_SMDS_Mesh.h
// Module : SMESH

View File

@ -0,0 +1,46 @@
// Copyright (C) 2007-2016 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, or (at your option) any later version.
//
// 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 : DriverGMF.hxx
// Created : Thu Nov 15 16:45:58 2012
// Author : Edward AGAPOV (eap)
#ifndef __DriverGMF_HXX__
#define __DriverGMF_HXX__
#include <string>
namespace DriverGMF
{
/*!
* \brief An object closing GMF mesh at destruction
*/
struct MeshCloser
{
int _gmfMeshID;
MeshCloser( const int gmfMeshID ): _gmfMeshID(gmfMeshID) {}
~MeshCloser();
};
bool isExtensionCorrect( const std::string& fileName );
}
#endif

View File

@ -0,0 +1,64 @@
// Copyright (C) 2007-2016 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, or (at your option) any later version.
//
// 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 : DriverGMF_Read.hxx
// Created : Mon Sep 17 15:36:47 2012
// Author : Edward AGAPOV (eap)
#ifndef __DriverGMF_Read_HXX__
#define __DriverGMF_Read_HXX__
#include "SMESH_DriverGMF.hxx"
#include "Driver_SMESHDS_Mesh.h"
#include <vector>
#include <string>
/*!
* \brief Driver reading a mesh from the GMF file. The mesh to read is selected by
* an index (counted form 0) set via SetMeshId()
*/
class MESHDriverGMF_EXPORT DriverGMF_Read : public Driver_SMESHDS_Mesh
{
public:
DriverGMF_Read();
~DriverGMF_Read();
void SetMakeRequiredGroups( bool theMakeRequiredGroups )
{
_makeRequiredGroups = theMakeRequiredGroups;
}
virtual Status Perform();
private:
Status storeBadNodeIds(const char* gmfKwd, int elemNb, int nb, ...);
bool _makeRequiredGroups;
};
#endif

View File

@ -0,0 +1,93 @@
// Copyright (C) 2007-2016 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, or (at your option) any later version.
//
// 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 : DriverGMF_Write.hxx
// Created : Mon Sep 17 15:36:47 2012
// Author : Edward AGAPOV (eap)
#ifndef __DriverGMF_Write_HXX__
#define __DriverGMF_Write_HXX__
#include "SMESH_DriverGMF.hxx"
#include "Driver_SMESHDS_Mesh.h"
#include "SMDSAbs_ElementType.hxx"
#include "SMDS_ElemIterator.hxx"
#include <gp_Pnt.hxx>
/*!
* \brief Class for storing control points for writing GMF size maps
*/
class MESHDriverGMF_EXPORT Control_Pnt : public gp_Pnt
{
public:
Control_Pnt();
Control_Pnt(const gp_Pnt& aPnt, double theSize);
Control_Pnt(double x, double y, double z);
Control_Pnt(double x, double y, double z, double size);
double Size() const { return size; };
void SetSize( double theSize ) { size = theSize; };
private:
double size;
};
/*!
* \brief Driver Writing a mesh into a GMF file.
*/
class MESHDriverGMF_EXPORT DriverGMF_Write : public Driver_SMESHDS_Mesh
{
public:
DriverGMF_Write();
~DriverGMF_Write();
void SetExportRequiredGroups( bool toExport )
{
_exportRequiredGroups = toExport;
}
virtual Status Perform();
// Size Maps
Status PerformSizeMap( const std::vector<Control_Pnt>& points );
void SetSizeMapPrefix( std::string prefix )
{
myVerticesFile = prefix + ".mesh";
mySolFile = prefix + ".sol";
};
std::vector<std::string> GetSizeMapFiles();
private:
SMDS_ElemIteratorPtr elementIterator(SMDSAbs_ElementType type);
SMDS_ElemIteratorPtr elementIterator(SMDSAbs_EntityType type);
SMDS_ElemIteratorPtr elementIterator(SMDSAbs_GeometryType type);
bool _exportRequiredGroups;
std::string myVerticesFile;
std::string mySolFile;
};
#endif

View File

@ -0,0 +1,46 @@
// Copyright (C) 2007-2016 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, or (at your option) any later version.
//
// 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
//
// Declarations needed for usage of DriverMED
#include "SMDSAbs_ElementType.hxx"
#include "SMESH_DriverMED.hxx"
#include <boost/shared_ptr.hpp>
class DriverMED_Family;
typedef boost::shared_ptr<DriverMED_Family> DriverMED_FamilyPtr;
namespace DriverMED
{
// Implemetation is in DriverMED_W_Field.cxx
/*
* Returns MED element geom type (MED::EGeometrieElement) by SMDS type
*/
MESHDRIVERMED_EXPORT int GetMedGeoType( SMDSAbs_EntityType smdsType );
/*
* Returns SMDS element geom type by MED type (MED::EGeometrieElement)
*/
MESHDRIVERMED_EXPORT SMDSAbs_EntityType GetSMDSType( int medType );
}

View File

@ -0,0 +1,144 @@
// Copyright (C) 2007-2016 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, or (at your option) any later version.
//
// 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
//
// SMESH DriverMED : tool to split groups on families
// File : DriverMED_Family.hxx
// Author : Julia DOROVSKIKH
// Module : SMESH
//
#ifndef _INCLUDE_DRIVERMED_FAMILY
#define _INCLUDE_DRIVERMED_FAMILY
#include "SMESH_DriverMED.hxx"
#include "DriverMED.hxx"
#include "SMDS_Mesh.hxx"
#include "SMESHDS_GroupBase.hxx"
#include "SMESHDS_SubMesh.hxx"
#include "MED_Common.hxx"
#include <boost/shared_ptr.hpp>
#include <set>
#define REST_NODES_FAMILY 1
#define FIRST_NODE_FAMILY 2
#define REST_EDGES_FAMILY -1
#define REST_FACES_FAMILY -2
#define REST_VOLUMES_FAMILY -3
#define REST_0DELEM_FAMILY -4
#define REST_BALL_FAMILY -5
#define FIRST_ELEM_FAMILY -6
typedef std::list<DriverMED_FamilyPtr > DriverMED_FamilyPtrList;
typedef std::map<int,SMESHDS_SubMesh* > SMESHDS_SubMeshPtrMap;
typedef std::list<SMESHDS_GroupBase* > SMESHDS_GroupBasePtrList;
typedef std::set<const SMDS_MeshElement*,TIDCompare > ElementsSet;
class MESHDRIVERMED_EXPORT DriverMED_Family
{
public:
DriverMED_Family();
//! Methods for groups storing to MED
/*!
Split each group from list <theGroups> and each sub-mesh from list <theSubMeshes>
on some parts (families) on the basis of the elements membership in other groups
from <theGroups> and other sub-meshes from <theSubMeshes>.
Resulting families have no common elements.
*/
static
DriverMED_FamilyPtrList
MakeFamilies (SMESHDS_SubMeshIteratorPtr theSubMeshes,
const SMESHDS_GroupBasePtrList& theGroups,
const bool doGroupOfNodes,
const bool doGroupOfEdges,
const bool doGroupOfFaces,
const bool doGroupOfVolumes,
const bool doGroupOf0DElems,
const bool doGroupOfBalls);
//! Create TFamilyInfo for this family
MED::PFamilyInfo
GetFamilyInfo (const MED::PWrapper& theWrapper,
const MED::PMeshInfo& theMeshInfo) const;
//! Returns elements of this family
const ElementsSet& GetElements () const;
//! Returns a family ID
int GetId () const;
//! Sets a family ID
void SetId (const int theId);
public:
// Methods for groups reading from MED
void AddElement(const SMDS_MeshElement* theElement);
const MED::TStringSet& GetGroupNames() const;
void AddGroupName(std::string theGroupName);
void SetType(const SMDSAbs_ElementType theType);
SMDSAbs_ElementType GetType();
const std::set< SMDSAbs_ElementType >& GetTypes() const;
bool MemberOf(std::string theGroupName) const;
int GetGroupAttributVal() const;
void SetGroupAttributVal( int theValue);
private:
//! Initialize the tool by SMESHDS_GroupBase
void Init (SMESHDS_GroupBase* group);
//! Split <theSubMesh> on some parts (families) on the basis of the elements type.
static
DriverMED_FamilyPtrList
SplitByType(SMESHDS_SubMesh* theSubMesh,
const int theId);
/*! Remove from <Elements> elements, common with <by>,
Remove from <by> elements, common with <Elements>,
Create family <common> from common elements, with combined groups list.
*/
void Split (DriverMED_FamilyPtr by,
DriverMED_FamilyPtr common);
//! Check, if this family has empty list of elements
bool IsEmpty () const;
private:
int myId;
SMDSAbs_ElementType myType;
ElementsSet myElements;
MED::TStringSet myGroupNames;
int myGroupAttributVal;
std::set<SMDSAbs_ElementType> myTypes; // Issue 0020576
};
#endif

View File

@ -0,0 +1,64 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// SMESH DriverMED : driver to read and write 'med' files
// File : DriverMED_R_SMESHDS_Mesh.h
// Module : SMESH
//
#ifndef _INCLUDE_DRIVERMED_R_SMESHDS_MESH
#define _INCLUDE_DRIVERMED_R_SMESHDS_MESH
#include "SMESH_DriverMED.hxx"
#include "DriverMED.hxx"
#include "Driver_SMESHDS_Mesh.h"
#include "SMDSAbs_ElementType.hxx"
#include <list>
#include <map>
class SMESHDS_Mesh;
class SMESHDS_Group;
class SMESHDS_SubMesh;
typedef std::pair< std::string, SMDSAbs_ElementType > TNameAndType;
class MESHDRIVERMED_EXPORT DriverMED_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
{
public:
virtual Status Perform();
std::list< TNameAndType > GetGroupNamesAndTypes();
void GetGroup(SMESHDS_Group* theGroup);
void CreateAllSubMeshes();
void GetSubMesh(SMESHDS_SubMesh* theSubMesh, const int theId);
std::list<std::string> GetMeshNames(Status& theStatus);
void SetMeshName(std::string theMeshName);
private:
std::string myMeshName;
std::map<int, DriverMED_FamilyPtr> myFamilies;
};
#endif

View File

@ -0,0 +1,83 @@
// Copyright (C) 2007-2016 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, or (at your option) any later version.
//
// 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
//
// SMESH DriverMED : driver to write a field to 'med' file
// Module : SMESH
//
#ifndef _INCLUDE_DriverMED_W_Field
#define _INCLUDE_DriverMED_W_Field
#include "SMESH_DriverMED.hxx"
#include "Driver_SMESHDS_Mesh.h"
#include "SMDSAbs_ElementType.hxx"
#include "SMDS_ElemIterator.hxx"
#include <string>
#include <vector>
class MESHDRIVERMED_EXPORT DriverMED_W_Field: public Driver_SMESHDS_Mesh
{
public:
DriverMED_W_Field();
void AddODOnVertices(bool toAdd) { _addODOnVertices = toAdd; }
bool Set(SMESHDS_Mesh * mesh,
const std::string & fieldName,
SMDSAbs_ElementType type,
const int nbComps,
const bool isIntData);
void SetCompName(const int iComp, const char* name);
void SetDtIt(const int dt, const int it);
void AddValue( double val );
void AddValue( int val );
/*
* Returns elements in the order they are written in MED file. Result can be NULL!
*/
SMDS_ElemIteratorPtr GetOrderedElems();
/*
* Add one field to the file
*/
virtual Status Perform();
private:
std::string _fieldName;
SMDSAbs_ElementType _elemType;
std::vector< std::string > _compNames;
std::vector< double > _dblValues;
std::vector< int > _intValues;
int _dt, _it;
bool _addODOnVertices;
std::vector< const SMDS_MeshElement* > _elemsByGeom[SMDSEntity_Last];
std::vector< std::pair< SMDSAbs_EntityType, int > > _nbElemsByGeom;
};
#endif

View File

@ -0,0 +1,93 @@
// Copyright (C) 2007-2016 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, or (at your option) any later version.
//
// 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
//
// SMESH DriverMED : driver to read and write 'med' files
// File : DriverMED_W_SMESHDS_Mesh.h
// Module : SMESH
//
#ifndef _INCLUDE_DRIVERMED_W_SMESHDS_MESH
#define _INCLUDE_DRIVERMED_W_SMESHDS_MESH
#include "SMESH_DriverMED.hxx"
#include "Driver_SMESHDS_Mesh.h"
#include "MED_Common.hxx"
#include <string>
#include <list>
#include <map>
#include <vector>
class SMESHDS_Mesh;
class SMESHDS_GroupBase;
class SMESHDS_SubMesh;
class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
{
public:
DriverMED_W_SMESHDS_Mesh();
virtual void SetFile(const std::string& theFileName);
void SetFile(const std::string& theFileName, MED::EVersion theId);
void SetAutoDimension(bool toFindOutDimension) { myAutoDimension = toFindOutDimension; }
static std::string GetVersionString(const MED::EVersion theVersion, int theNbDigits=2);
void AddGroupOfNodes();
void AddGroupOfEdges();
void AddGroupOfFaces();
void AddGroupOfVolumes();
void AddGroupOf0DElems();
void AddGroupOfBalls();
/*! functions to prepare adding one mesh
*/
void AddGroup(SMESHDS_GroupBase * theGroup);
void AddAllSubMeshes();
void AddSubMesh(SMESHDS_SubMesh* theSubMesh, int theID);
void AddODOnVertices(bool toAdd) { myAddODOnVertices = toAdd; }
static bool getNodesOfMissing0DOnVert(SMESHDS_Mesh* mesh,
std::vector<const SMDS_MeshElement*>& nodes);
/*! add one mesh
*/
virtual Status Perform();
private:
MED::EVersion myMedVersion;
std::list<SMESHDS_GroupBase*> myGroups;
bool myAllSubMeshes;
std::vector<SMESHDS_SubMesh*> mySubMeshes;
bool myDoGroupOfNodes;
bool myDoGroupOfEdges;
bool myDoGroupOfFaces;
bool myDoGroupOfVolumes;
bool myDoGroupOf0DElems;
bool myDoGroupOfBalls;
bool myAutoDimension;
bool myAddODOnVertices;
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _INCLUDE_DRIVERSTL_R_SMDS_MESH
#define _INCLUDE_DRIVERSTL_R_SMDS_MESH
@ -26,7 +27,7 @@
#include "Driver_SMDS_Mesh.h"
#include <Standard_TypeDef.hxx>
class SMESH_File;
class MESHDRIVERSTL_EXPORT DriverSTL_R_SMDS_Mesh: public Driver_SMDS_Mesh
{
@ -37,8 +38,8 @@ class MESHDRIVERSTL_EXPORT DriverSTL_R_SMDS_Mesh: public Driver_SMDS_Mesh
private:
// PRIVATE METHODS
Status readAscii() const;
Status readBinary() const;
Status readAscii (SMESH_File& file) const;
Status readBinary(SMESH_File& file) const;
private:
// PRIVATE FIELDS

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH DriverSTL : driver to read and write 'stl' files
// File : DriverSTL_W_SMDS_Mesh.h
// Module : SMESH
@ -29,13 +30,19 @@
#include "SMESH_DriverSTL.hxx"
#include "Driver_SMDS_Mesh.h"
#include <Standard_TypeDef.hxx>
#include "SMDS_ElemIterator.hxx"
#include <vector>
/*!
* \brief Writer of a mesh in STL (STereoLithography) file format.
*/
class MESHDRIVERSTL_EXPORT DriverSTL_W_SMDS_Mesh: public Driver_SMDS_Mesh
{
public:
DriverSTL_W_SMDS_Mesh();
~DriverSTL_W_SMDS_Mesh();
virtual Status Perform();
void SetIsAscii( const bool theIsAscii = false );
@ -43,10 +50,15 @@ class MESHDRIVERSTL_EXPORT DriverSTL_W_SMDS_Mesh: public Driver_SMDS_Mesh
// PRIVATE METHODS
Status writeAscii () const;
Status writeBinary () const;
void findVolumeTriangles();
SMDS_ElemIteratorPtr getFaces() const;
private:
// PRIVATE FIELDS
bool myIsAscii;
int myNbVolumeTrias;
std::vector<const SMDS_MeshElement*> myVolumeFacets; // tmp faces
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _INCLUDE_DRIVERUNV_R_SMDS_MESH
#define _INCLUDE_DRIVERUNV_R_SMDS_MESH

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _INCLUDE_DRIVERUNV_W_SMDS_MESH
#define _INCLUDE_DRIVERUNV_W_SMDS_MESH

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _INCLUDE_DRIVER_DOCUMENT
#define _INCLUDE_DRIVER_DOCUMENT

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH Driver : implementaion of driver for reading and writing
// File : Mesh_Reader.h
// Module : SMESH
@ -26,10 +27,13 @@
#ifndef _INCLUDE_DRIVER_MESH
#define _INCLUDE_DRIVER_MESH
#include <string>
#include "SMESH_ComputeError.hxx"
#ifdef WNT
#if defined MESHDRIVER_EXPORTS
#include <string>
#include <vector>
#ifdef WIN32
#if defined MESHDRIVER_EXPORTS || defined MeshDriver_EXPORTS
#define MESHDRIVER_EXPORT __declspec( dllexport )
#else
#define MESHDRIVER_EXPORT __declspec( dllimport )
@ -50,17 +54,30 @@ class MESHDRIVER_EXPORT Driver_Mesh
DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers,
// so the numbers from the file are ignored
DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
DRS_FAIL // general failure (exception etc.)
};
void SetMeshId(int theMeshId);
virtual void SetFile(const std::string& theFileName);
virtual void SetMeshName(const std::string& theMeshName);
virtual std::string GetMeshName() const;
virtual void SetOption(const std::string& optionName,
const std::string& optionValue) {}
virtual Status Perform() = 0;
void SetMeshId(int theMeshId);
void SetFile(const std::string& theFileName);
virtual SMESH_ComputeErrorPtr GetError();
protected:
std::string myFile;
int myMeshId;
std::string myMeshName;
int myMeshId;
Status addMessage(const std::string& msg, const bool isFatal=false);
std::vector< std::string > myErrorMessages;
Status myStatus;
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _INCLUDE_DRIVER_SMDS_MESH
#define _INCLUDE_DRIVER_SMDS_MESH

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef _INCLUDE_DRIVER_SMESHDS_MESH
#define _INCLUDE_DRIVER_SMESHDS_MESH

View File

@ -0,0 +1,346 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef _GEOMUtils_HXX_
#define _GEOMUtils_HXX_
#include <Standard_Macro.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopAbs.hxx>
#include <gp_Ax3.hxx>
#include <gp_Vec.hxx>
#include <V3d_View.hxx>
#include <NCollection_DataMap.hxx>
#include <functional>
#include <map>
#include <vector>
#include <string>
#include <utility>
class Bnd_Box;
inline Standard_Boolean IsEqual (const TopoDS_Shape& S1, const TopoDS_Shape& S2)
{
return S1.IsSame(S2);
}
namespace GEOMUtils
{
typedef std::vector<std::string> NodeLinks;
typedef std::map<std::string, NodeLinks> LevelInfo;
typedef std::vector<LevelInfo> LevelsList;
typedef std::map<std::string,std::pair<LevelsList,LevelsList> > TreeModel;
/*!
* \brief Compute numerical functor for the shape.
*
* Resulting value can be used to sort out shapes according to some parameter.
*
* Returns a pair of two values (dist, functor) where
* - \a dist is a some value that is computed according to the center of mass of given shape;
* - \a functor is a numerical functor value
*
* The numerical functor is computed according to the shape's topological properties as follows:
* - orientation for vertices
* - length for edges and wires
* - area for faces and shells
* - volume for solids, compounds, compsolids
*
* If \a isOldSorting parameter is set to \c true, for all cases linear properties of the shape
* are used (to support backward compatibility in some methods). By default, this parameter is
* set to \c false.
*/
Standard_EXPORT std::pair<double, double> ShapeToDouble (const TopoDS_Shape& theShape,
bool isOldSorting = false);
/*!
* \brief Get Local Coordinate System, corresponding to the given shape.
*
* Origin of the LCS is situated at the shape's center of mass.
* Axes of the LCS are obtained from shape's location or,
* if the shape is a planar face, from position of its plane.
*/
Standard_EXPORT gp_Ax3 GetPosition (const TopoDS_Shape& theShape);
/*!
* \brief Get vector, defined by the given edge.
* \param theShape The edge.
* \param doConsiderOrientation If True, take into account the edge orientation.
* \note It is recommended to use doConsiderOrientation=Standard_False, because
* the same edge can have different orientation depending on the way it was
* extracted from a shape.
*/
Standard_EXPORT gp_Vec GetVector (const TopoDS_Shape& theShape,
Standard_Boolean doConsiderOrientation);
/*!
* \brief Sort shapes in the list by their coordinates.
* \param SL The list of shapes to sort.
*/
struct CompareShapes : public std::binary_function<TopoDS_Shape, TopoDS_Shape, bool>
{
CompareShapes (bool isOldSorting)
: myIsOldSorting(isOldSorting) {}
bool operator() (const TopoDS_Shape& lhs, const TopoDS_Shape& rhs);
typedef NCollection_DataMap<TopoDS_Shape, std::pair<double, double> > GEOMUtils_DataMapOfShapeDouble;
GEOMUtils_DataMapOfShapeDouble myMap;
bool myIsOldSorting;
};
/*!
* \brief Sort shapes by their centers of mass, using formula X*999 + Y*99 + Z*0.9
*/
Standard_EXPORT void SortShapes (TopTools_ListOfShape& SL,
const Standard_Boolean isOldSorting = Standard_True);
/*!
* \brief Convert TopoDS_COMPSOLID to TopoDS_COMPOUND.
*
* If the argument shape is not of type TopoDS_COMPSOLID, this method returns it as is.
*
* \param theCompsolid The compsolid to be converted.
* \retval TopoDS_Shape Returns the resulting compound.
*/
Standard_EXPORT TopoDS_Shape CompsolidToCompound (const TopoDS_Shape& theCompsolid);
/*!
* \brief Recursively extract all shapes from compounds and compsolids of the given shape into theList.
*
* If theShape is not compound or compsolid, theList will contain only theShape itself.
*
* \param theShape The shape to be exploded.
* \param theList Output parameter.
*/
Standard_EXPORT void AddSimpleShapes (const TopoDS_Shape& theShape,
TopTools_ListOfShape& theList);
/*!
* \brief Build a triangulation on \a theShape if it is absent.
* \param theShape The shape to check/build triangulation on.
* \retval bool Returns false if the shape has no faces, i.e. impossible to build triangulation.
*/
Standard_EXPORT bool CheckTriangulation (const TopoDS_Shape& theShape);
/*!
* \brief Return type of shape for explode. In case of compound it will be a type of its first sub shape.
* \param theShape The shape to get type of.
* \retval TopAbs_ShapeEnum Return type of shape for explode.
*/
Standard_EXPORT TopAbs_ShapeEnum GetTypeOfSimplePart (const TopoDS_Shape& theShape);
/*!
* \brief Find an edge of theShape, closest to thePoint.
*
* \param theShape The shape to explore.
* \param thePoint The point near the required edge.
* \retval TopoDS_Shape Returns the found edge or an empty shape if multiple edges found.
*/
Standard_EXPORT TopoDS_Shape GetEdgeNearPoint (const TopoDS_Shape& theShape,
const TopoDS_Vertex& thePoint);
/*!
* \brief Compute precise bounding box of the shape based on the rough bounding box.
*
* \param theShape the shape.
* \param theBox rough bounding box on input; precise bounding box on output.
* \retval Standard_True in case of success; Standard_False otherwise.
*/
Standard_EXPORT Standard_Boolean PreciseBoundingBox(const TopoDS_Shape &theShape, Bnd_Box &theBox);
/*!
* \brief Computes minumal distance between two shapes for singular cases
* (workaround for bugs 19899, 19908 and 19910 from Mantis).
*
* \param aSh1 the first shape
* \param aSh2 the second shape
* \param Ptmp1 the output result point on the first shape
* \param Ptmp2 the output result point on the second shape
* \retval negative value if it is not a singular case; actual distance for singular case.
*/
Standard_EXPORT Standard_Real GetMinDistanceSingular(const TopoDS_Shape& aSh1,
const TopoDS_Shape& aSh2,
gp_Pnt& Ptmp1, gp_Pnt& Ptmp2);
/*!
* \brief Computes minumal distance between two shapes.
*
* \param theShape1 the first shape
* \param theShape2 the second shape
* \param thePnt1 the output result point on the first shape
* \param thePnt2 the output result point on the second shape
* \retval negative value in case of failure; otherwise the real distance.
*/
Standard_EXPORT Standard_Real GetMinDistance(const TopoDS_Shape& theShape1,
const TopoDS_Shape& theShape2,
gp_Pnt& thePnt1, gp_Pnt& thePnt2);
/*!
* \brief Returns the point clicked in 3D view.
*
* \param x The X coordinate in the view.
* \param y The Y coordinate in the view.
* \param theView View where the given point takes place.
* \retval gp_Pnt Returns the point clicked in 3D view
*/
Standard_EXPORT gp_Pnt ConvertClickToPoint( int x, int y, Handle(V3d_View) theView );
/*!
* \brief Convert dependency tree data to the string representation
*
* \param tree dependency tree data
* \param dependencyStr output string
*/
Standard_EXPORT void ConvertTreeToString( const TreeModel& tree,
std::string& dependencyStr );
/*!
* \brief Restore dependency tree data from the string representation
*
* \param dependencyStr string representation of tree data
* \param tree output dependency tree data
*/
Standard_EXPORT void ConvertStringToTree( const std::string& dependencyStr,
TreeModel& tree );
/*!
* \brief Check shape
*
* \param shape input shape object
* \param checkGeometry when set to \c true, causes check of underlying geometry
* in addition to the topology
* \return \c true if shape is valid or \c false otherwise
*/
Standard_EXPORT bool CheckShape( TopoDS_Shape& shape, bool checkGeometry = false );
/*!
* \brief Limit shape tolerance to the given value
*
* \param shape shape being fixed
* \param type topology type which tolerance is to be limited; TopAbs_SHAPE means
* all types of topology
* \param tolerance expected tolerance value (1e-7 by default)
* \param checkGeometry check geometry validity of result
* \return \c true if resulting shape is valid
*
* \note Resulting tolerance of the shape is not mandatory equal to requested value
* as it might be changed by fixshape operation in order to get valid shape where possible
* \note By default, result only checked for topology validity; check of geometry can be done by
* passing \c true to \a checkGeometry parameter
*/
Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape,
TopAbs_ShapeEnum type,
Standard_Real tolerance = Precision::Confusion(),
bool checkGeometry = false );
/*!
* \brief Limit shape tolerance to the given value
* This is overloaded function, it behaves exactly as previous one
*/
Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape,
Standard_Real tolerance = Precision::Confusion(),
bool checkGeometry = false );
/*!
* \brief Limit shape tolerance to the given value
* This is overloaded function, it behaves exactly as previous one
*/
Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape,
bool checkGeometry );
/*!
* \brief Fix curves of the given shape
*
* The function checks each curve of the input shape in the following way:
* - compute deviation of the curve from the underlying surface in a set of points
* computed with the certain discretization step value
* - find maximum tolerance between computed deviation values
* - limit tolerance of the curve with the computed maximum value
*
* \param shape shape being fixed
* \return \c true if resulting shape is valid
*/
Standard_EXPORT bool FixShapeCurves( TopoDS_Shape& shape );
/*!
* \brief Write shape to the BREP file
*
* \param source shape
* \return \c true if file was written or \c false otherwise
*/
Standard_EXPORT bool Write( const TopoDS_Shape& shape,
const char* fileName );
/*!
* \brief Extract single SOLID from COMPSOLID or COMPOUND.
*
* If the argument shape is a COMPUND or COMPSOLID and there's
* only single simple-shape type inside, this sub-shape is returned as a result;
* otherwise, the shape is not changed.
*
* \param shape compound or compsolid being processed.
* \retval TopoDS_Shape resulting shape
*/
Standard_EXPORT TopoDS_Shape ReduceCompound( const TopoDS_Shape& shape );
/*!
* \brief Generate triangulation for the shape.
*
* \param shape shape being meshed
* \param deflection deflection coefficient to be used
* \param forced if \c true, causes generation of mesh regardless it is already present in the shape
*/
Standard_EXPORT void MeshShape( const TopoDS_Shape shape,
double deflection, bool forced = true );
/*!
* \brief Get default deflection coefficient used for triangulation
* \return default deflection value
*/
Standard_EXPORT double DefaultDeflection();
/**
* \brief Check if the shape is not a closed wire or edge.
*
* This function is used for pipe creation algorithm to test if
* the pipe path is not closed. It returns false if theShape is a wire or
* an edge with coincident end vertices. Otherwise it returns true.
*
* \param theShape the shape to be tested.
* \return true if theShape is not a closed wire or edge.
*/
Standard_EXPORT bool IsOpenPath(const TopoDS_Shape &theShape);
};
#endif

View File

@ -39,7 +39,8 @@
#if OCC_VERSION_HEX < 0x070000
#ifndef _Handle_MeshVS_DataSource3D_HeaderFile
#include <Handle_MeshVS_DataSource3D.hxx>
//#include <Handle_MeshVS_DataSource3D.hxx>
#include <MeshVS_DataSource3D.hxx>
#endif
class Standard_Transient;

View File

@ -0,0 +1,156 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_Algorithm_HeaderFile
#define MED_Algorithm_HeaderFile
#include "MED_WrapperBase.hxx"
#include "MED_Structures.hxx"
#include <set>
namespace MED
{
//---------------------------------------------------------------
typedef std::map<EGeometrieElement,PElemInfo> TGeom2ElemInfo;
typedef std::map<EEntiteMaillage,TGeom2ElemInfo> TEntity2TGeom2ElemInfo;
//! Get set of TElemInfo by its geometrical type and corresponding MED ENTITY
MEDWRAPPER_EXPORT
TEntity2TGeom2ElemInfo
GetEntity2TGeom2ElemInfo(const PWrapper& theWrapper,
const PMeshInfo& theMeshInfo,
const MED::TEntityInfo& theEntityInfo);
//---------------------------------------------------------------
typedef std::set<PFamilyInfo> TFamilyInfoSet;
//! Read set of MED FAMILIES for defined MED file
MEDWRAPPER_EXPORT
TFamilyInfoSet
GetFamilyInfoSet(const PWrapper& theWrapper,
const PMeshInfo& theMeshInfo);
//---------------------------------------------------------------
typedef boost::tuple<PFamilyInfo,TInt> TFamilyTSize;
bool
operator<(const TFamilyTSize& theLeft, const TFamilyTSize& theRight);
typedef std::set<TFamilyTSize> TFamilyTSizeSet;
//---------------------------------------------------------------
typedef std::map<EEntiteMaillage,TFamilyTSizeSet> TEntity2FamilySet;
//! Split set of MED FAMILIES by corresponding MED ENTITY
MEDWRAPPER_EXPORT
TEntity2FamilySet
GetEntity2FamilySet(const PWrapper& theWrapper,
const TEntity2TGeom2ElemInfo& theEntity2TGeom2ElemInfo,
const TFamilyInfoSet& theFamilyInfoSet);
//---------------------------------------------------------------
typedef std::map<std::string,TFamilyInfoSet> TGroupInfo;
//! Split the input set of MED FAMILIES by corresponding MED GROUPS
MEDWRAPPER_EXPORT
TGroupInfo
GetGroupInfo(const TFamilyInfoSet& theFamilyInfoSet);
//---------------------------------------------------------------
typedef std::set<PTimeStampInfo> TTimeStampInfoSet;
typedef std::map<PFieldInfo,TTimeStampInfoSet> TFieldInfo2TimeStampInfoSet;
//! Read set of MED TIMESTAMPS groupped by corresponding MED FIELDS
MEDWRAPPER_EXPORT
TFieldInfo2TimeStampInfoSet
GetFieldInfo2TimeStampInfoSet(const PWrapper& theWrapper,
const PMeshInfo& theMeshInfo,
const MED::TEntityInfo& theEntityInfo);
//---------------------------------------------------------------
typedef std::map<EEntiteMaillage,TFieldInfo2TimeStampInfoSet> TEntite2TFieldInfo2TimeStampInfoSet;
//! Split the input set of MED TIMESTAMPS by corresponding MED FIELDS and MED ENTITIES
MEDWRAPPER_EXPORT
TEntite2TFieldInfo2TimeStampInfoSet
GetEntite2TFieldInfo2TimeStampInfoSet(const TFieldInfo2TimeStampInfoSet& theFieldInfo2TimeStampInfoSet);
//---------------------------------------------------------------
typedef std::map<TGaussInfo::TKey,PGaussInfo,TGaussInfo::TLess> TKey2Gauss;
//! Read set of MED GAUSS
MEDWRAPPER_EXPORT
TKey2Gauss
GetKey2Gauss(const PWrapper& theWrapper,
TErr* theErr = NULL,
EModeSwitch theMode = eFULL_INTERLACE);
//---------------------------------------------------------------
//! Get MED PROFILE by its name
MEDWRAPPER_EXPORT
PProfileInfo
GetProfileInfo(const PWrapper& theWrapper,
const std::string& theProfileName,
TErr* theErr = NULL,
EModeProfil theMode = eCOMPACT);
//---------------------------------------------------------------
typedef std::map<TProfileInfo::TKey,PProfileInfo> TKey2Profile;
typedef boost::tuple<EModeProfil,TKey2Profile> TMKey2Profile;
//! Read set of MED PROFILES
MEDWRAPPER_EXPORT
TMKey2Profile
GetMKey2Profile(const PWrapper& theWrapper,
TErr* theErr = NULL,
EModeProfil theMode = eCOMPACT);
//---------------------------------------------------------------
//! Get Entity for Grille by family id.
MEDWRAPPER_EXPORT
EEntiteMaillage
GetEntityByFamilyId(PGrilleInfo& theInfo,
TInt theId);
typedef std::map<TInt,TInt> TFamilyID2NbCells;
//! Get Number of cells for theId family, for Grille
MEDWRAPPER_EXPORT
TFamilyID2NbCells
GetFamilyID2NbCells(PGrilleInfo& theInfo);
//! Convert eNOEUD_ELEMENT to eMAILLE
MEDWRAPPER_EXPORT
EEntiteMaillage
ConvertEntity(const EEntiteMaillage& aEntity);
}
#endif

View File

@ -0,0 +1,184 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_Common_HeaderFile
#define MED_Common_HeaderFile
#include "MED_WrapperBase.hxx"
#include <string>
#include <set>
#include <map>
#include <hdf5.h>
#include <boost/tuple/tuple.hpp>
#include "MED_Vector.hxx"
#include "MED_SharedPtr.hxx"
#include "MED_SliceArray.hxx"
#ifdef WIN32
#pragma warning(disable:4099)
#endif
namespace MED{
enum EVersion {eVUnknown = -1, eV2_1, eV2_2};
typedef enum {eFAUX, eVRAI} EBooleen ;
typedef double TFloat;
#if defined(HAVE_F77INT64)
typedef long TInt;
#else
typedef int TInt;
#endif
typedef hid_t TIdt;
typedef herr_t TErr;
typedef enum {eFULL_INTERLACE, eNO_INTERLACE} EModeSwitch;
typedef enum {eFLOAT64=6, eINT=24, eLONG=26 } ETypeChamp;
typedef enum {eNON_STRUCTURE, eSTRUCTURE} EMaillage;
typedef enum {eCART, eCYL, eSPHER} ERepere;
typedef enum {eNOD, eDESC} EConnectivite ;
typedef enum {ePOINT1=1, eSEG2=102, eSEG3=103, eTRIA3=203,
eQUAD4=204, eTRIA6=206, eTRIA7=207, eQUAD8=208, eQUAD9=209,eTETRA4=304,
ePYRA5=305, ePENTA6=306, eHEXA8=308, eOCTA12=312, eTETRA10=310,
ePYRA13=313, ePENTA15=315, eHEXA20=320, eHEXA27=327,
ePOLYGONE=400, ePOLYGON2=420, ePOLYEDRE=500, eNONE=0,
eBALL=1101 /*no such a type in med.h, it's just a trick*/,
eAllGeoType=-1 } EGeometrieElement;
typedef enum {eMAILLE, eFACE, eARETE, eNOEUD, eNOEUD_ELEMENT, eSTRUCT_ELEMENT} EEntiteMaillage;
typedef enum {eNO_PFLMOD, eGLOBAL, eCOMPACT} EModeProfil;
typedef enum {eGRILLE_CARTESIENNE, eGRILLE_POLAIRE, eGRILLE_STANDARD} EGrilleType;
typedef enum {eCOOR, eCONN, eNOM, eNUM, eFAM, eCOOR_IND1, eCOOR_IND2, eCOOR_IND3} ETable;
typedef TVector<TFloat> TFloatVector;
typedef TVector<std::string> TStringVector;
typedef TVector<TInt> TIntVector;
typedef std::set<std::string> TStringSet;
typedef std::map<EGeometrieElement,TInt> TGeom2Size;
typedef std::map<EEntiteMaillage,TGeom2Size> TEntityInfo;
typedef std::set<EGeometrieElement> TGeomSet;
typedef std::map<EEntiteMaillage,TGeomSet> TEntity2GeomSet;
MEDWRAPPER_EXPORT
const TEntity2GeomSet&
GetEntity2GeomSet();
template<EVersion>
TInt MEDWRAPPER_EXPORT
GetDESCLength();
template<EVersion>
TInt MEDWRAPPER_EXPORT
GetIDENTLength();
template<EVersion>
TInt MEDWRAPPER_EXPORT
GetNOMLength();
template<EVersion>
TInt MEDWRAPPER_EXPORT
GetLNOMLength();
template<EVersion>
TInt MEDWRAPPER_EXPORT
GetPNOMLength();
template<EVersion>
void MEDWRAPPER_EXPORT
GetVersionRelease(TInt& majeur, TInt& mineur, TInt& release);
template<EVersion>
MEDWRAPPER_EXPORT
TInt
GetNbConn(EGeometrieElement typmai,
EEntiteMaillage typent,
TInt mdim);
MEDWRAPPER_EXPORT
TInt
GetNbNodes(EGeometrieElement typmai);
struct TNameInfo;
typedef SharedPtr<TNameInfo> PNameInfo;
struct TMeshInfo;
typedef SharedPtr<TMeshInfo> PMeshInfo;
struct TFamilyInfo;
typedef SharedPtr<TFamilyInfo> PFamilyInfo;
struct TElemInfo;
typedef SharedPtr<TElemInfo> PElemInfo;
struct TNodeInfo;
typedef SharedPtr<TNodeInfo> PNodeInfo;
struct TPolygoneInfo;
typedef SharedPtr<TPolygoneInfo> PPolygoneInfo;
struct TPolyedreInfo;
typedef SharedPtr<TPolyedreInfo> PPolyedreInfo;
struct TCellInfo;
typedef SharedPtr<TCellInfo> PCellInfo;
struct TBallInfo;
typedef SharedPtr<TBallInfo> PBallInfo;
struct TFieldInfo;
typedef SharedPtr<TFieldInfo> PFieldInfo;
struct TTimeStampInfo;
typedef SharedPtr<TTimeStampInfo> PTimeStampInfo;
struct TProfileInfo;
typedef SharedPtr<TProfileInfo> PProfileInfo;
struct TGaussInfo;
typedef SharedPtr<TGaussInfo> PGaussInfo;
class TGrilleInfo;
typedef SharedPtr<TGrilleInfo> PGrilleInfo;
struct TTimeStampValueBase;
typedef SharedPtr<TTimeStampValueBase> PTimeStampValueBase;
struct TWrapper;
typedef SharedPtr<TWrapper> PWrapper;
}
#endif

View File

@ -0,0 +1,56 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_CoordUtils_HeaderFile
#define MED_CoordUtils_HeaderFile
#include "MED_WrapperBase.hxx"
#include "MED_Structures.hxx"
namespace MED
{
typedef TFloat (*TGetCoord)(const TCCoordSlice& theCoordSlice);
//---------------------------------------------------------------
class MEDWRAPPER_EXPORT TCoordHelper
{
TGetCoord* myGetCoord;
public:
TCoordHelper(TGetCoord* theGetCoord);
TFloat
GetCoord(TCCoordSlice& theCoordSlice,
TInt theCoordId);
};
typedef SharedPtr<TCoordHelper> PCoordHelper;
//---------------------------------------------------------------
MEDWRAPPER_EXPORT
PCoordHelper
GetCoordHelper(PNodeInfo theNodeInfo);
}
#endif

View File

@ -0,0 +1,49 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_Factory_HeaderFile
#define MED_Factory_HeaderFile
#include "MED_WrapperFactory.hxx"
#include "MED_Wrapper.hxx"
namespace MED
{
MEDWRAPPER_FACTORY_EXPORT
EVersion
GetVersionId(const std::string& theFileName,
bool theDoPreCheckInSeparateProcess = false);
MEDWRAPPER_FACTORY_EXPORT
bool getMEDVersion( const std::string&, int&, int&, int& );
MEDWRAPPER_FACTORY_EXPORT
PWrapper
CrWrapper(const std::string& theFileName,
bool theDoPreCheckInSeparateProcess = false);
MEDWRAPPER_FACTORY_EXPORT
PWrapper
CrWrapper(const std::string& theFileName, EVersion theId);
}
#endif

View File

@ -0,0 +1,69 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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 : MED_GaussDef.hxx
// Author : Edward AGAPOV (eap)
//
#ifndef MED_GaussDef_HeaderFile
#define MED_GaussDef_HeaderFile
#include "MED_WrapperBase.hxx"
//#include "MED_GaussUtils.hxx" <<<---- avoid dependence on boost
#include <vector>
namespace MED
{
class TShapeFun;
typedef std::vector<double> TDoubleVector;
/*!
* \brief Description of family of integration points
*/
struct TGaussDef
{
int myType; //!< element geometry (EGeometrieElement or med_geometrie_element)
TDoubleVector myRefCoords; //!< description of reference points
TDoubleVector myCoords; //!< coordinates of Gauss points
TDoubleVector myWeights; //!< weights, len(weights)==<nb of gauss points>
/*!
* \brief Creates definition of gauss points family
* \param geomType - element geometry (EGeometrieElement or med_geometrie_element)
* \param nbPoints - nb gauss point
* \param variant - [1-3] to choose the variant of definition
*
* Throws in case of invalid parameters
* variant == 1 refers to "Fonctions de forme et points d'integration
* des elements finis" v7.4 by J. PELLET, X. DESROCHES, 15/09/05
* variant == 2 refers to the same doc v6.4 by J.P. LEFEBVRE, X. DESROCHES, 03/07/03
* variant == 3 refers to the same doc v6.4, second variant for 2D elements
*/
MEDWRAPPER_EXPORT TGaussDef(const int geomType, const int nbPoints, const int variant=1);
MEDWRAPPER_EXPORT int dim() const { return myType/100; }
MEDWRAPPER_EXPORT int nbPoints() const { return myWeights.capacity(); }
private:
void add(const double x, const double weight);
void add(const double x, const double y, const double weight);
void add(const double x, const double y, const double z, const double weight);
void setRefCoords(const TShapeFun& aShapeFun);
};
}
#endif

View File

@ -0,0 +1,365 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_GaussUtils_HeaderFile
#define MED_GaussUtils_HeaderFile
#include "MED_WrapperBase.hxx"
#include "MED_Structures.hxx"
namespace MED
{
//---------------------------------------------------------------
typedef TVector<TCCoordSlice> TCCoordSliceArr;
typedef TVector<TCoordSlice> TCoordSliceArr;
//! Define a helper class to handle Gauss Points coordinates
class MEDWRAPPER_EXPORT TGaussCoord:
virtual TModeSwitchInfo
{
TInt myNbElem;
TInt myNbGauss;
TInt myDim;
TInt myGaussStep;
TNodeCoord myGaussCoord;
public:
TGaussCoord();
//! To init the class
void
Init(TInt theNbElem,
TInt theNbGauss,
TInt theDim,
EModeSwitch theMode = eFULL_INTERLACE);
TInt
GetNbElem() const;
TInt
GetNbGauss() const;
TInt
GetDim() const;
unsigned char*
GetValuePtr();
//! Get slice of the coordinate that corresponds to defined cell (const version)
TCCoordSliceArr
GetCoordSliceArr(TInt theElemId) const;
//! Get slice of the coordinate that corresponds to defined cell
TCoordSliceArr
GetCoordSliceArr(TInt theElemId);
};
typedef SharedPtr<TGaussCoord> PGaussCoord;
//---------------------------------------------------------------
//! To calculate Gauss Points coordinates
MEDWRAPPER_EXPORT
bool
GetGaussCoord3D(const TGaussInfo& theGaussInfo,
const TCellInfo& theCellInfo,
const TNodeInfo& theNodeInfo,
TGaussCoord& theGaussCoord,
const TElemNum& theElemNum = TElemNum(),
EModeSwitch theMode = eFULL_INTERLACE);
//---------------------------------------------------------------
//! To calculate Gauss Points coordinates for defined TCellInfo as its bary center
MEDWRAPPER_EXPORT
bool
GetBaryCenter(const TCellInfo& theCellInfo,
const TNodeInfo& theNodeInfo,
TGaussCoord& theGaussCoord,
const TElemNum& theElemNum = TElemNum(),
EModeSwitch theMode = eFULL_INTERLACE);
//! To calculate Gauss Points coordinates for defined TPolygoneInfo as its bary center
MEDWRAPPER_EXPORT
bool
GetBaryCenter(const TPolygoneInfo& thePolygoneInfo,
const TNodeInfo& theNodeInfo,
TGaussCoord& theGaussCoord,
const TElemNum& theElemNum = TElemNum(),
EModeSwitch theMode = eFULL_INTERLACE);
//! To calculate Gauss Points coordinates for defined TPolyedreInfo as its bary center
MEDWRAPPER_EXPORT
bool
GetBaryCenter(const TPolyedreInfo& thePolyedreInfo,
const TNodeInfo& theNodeInfo,
TGaussCoord& theGaussCoord,
const TElemNum& theElemNum = TElemNum(),
EModeSwitch theMode = eFULL_INTERLACE);
//---------------------------------------------------------------
//! Shape function definitions
//---------------------------------------------------------------
struct MEDWRAPPER_EXPORT TShapeFun
{
class TFun;
TFloatVector myRefCoord;
TInt myDim;
TInt myNbRef;
TShapeFun(TInt theDim = 0, TInt theNbRef = 0);
TInt GetNbRef() const { return myNbRef; }
TCCoordSlice GetCoord(TInt theRefId) const;
TCoordSlice GetCoord(TInt theRefId);
void GetFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
virtual
void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const = 0;
virtual
bool IsSatisfy(const TCCoordSliceArr& theRefCoord) const;
bool Eval(const TCellInfo& theCellInfo,
const TNodeInfo& theNodeInfo,
const TElemNum& theElemNum,
const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TGaussCoord& theGaussCoord,
EModeSwitch theMode);
};
//---------------------------------------------------------------
struct TSeg2a: TShapeFun {
TSeg2a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TSeg3a: TShapeFun {
TSeg3a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTria3a: TShapeFun {
TTria3a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTria6a: TShapeFun {
TTria6a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTria3b: TShapeFun {
TTria3b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTria6b: TShapeFun {
TTria6b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad4a: TShapeFun {
TQuad4a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad8a: TShapeFun {
TQuad8a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad9a: TShapeFun {
TQuad9a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad4b: TShapeFun {
TQuad4b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad8b: TShapeFun {
TQuad8b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TQuad9b: TShapeFun {
TQuad9b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTetra4a: TShapeFun {
TTetra4a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTetra10a: TShapeFun {
TTetra10a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTetra4b: TShapeFun {
TTetra4b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TTetra10b: TShapeFun {
TTetra10b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct THexa8a: TShapeFun {
THexa8a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct THexa20a: TShapeFun {
THexa20a(TInt theDim = 3, TInt theNbRef = 20);
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct THexa27a: THexa20a {
THexa27a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct THexa8b: TShapeFun {
THexa8b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct THexa20b: TShapeFun {
THexa20b(TInt theDim = 3, TInt theNbRef = 20);
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPenta6a: TShapeFun {
TPenta6a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPenta6b: TShapeFun {
TPenta6b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPenta15a: TShapeFun {
TPenta15a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPenta15b: TShapeFun {
TPenta15b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPyra5a: TShapeFun {
TPyra5a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPyra5b: TShapeFun {
TPyra5b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPyra13a: TShapeFun {
TPyra13a();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
struct TPyra13b: TShapeFun {
TPyra13b();
virtual void InitFun(const TCCoordSliceArr& theRef,
const TCCoordSliceArr& theGauss,
TFun& theFun) const;
};
//---------------------------------------------------------------
}
#endif

View File

@ -0,0 +1,95 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_SharedPtr_HeaderFile
#define MED_SharedPtr_HeaderFile
#include <boost/shared_ptr.hpp>
namespace MED
{
//! To extend the boost::shared_ptr to support such features automatic dynamic cast
/*!
All entities of the MEDWrapper package are handled as pointer.
This class was introduced to provide correct and flexible memory management
for all of the MEDWrapper objects.
*/
template<class T> class SharedPtr: public boost::shared_ptr<T>
{
public:
//! Default constructor
SharedPtr() {}
//! Construct the class by any type of a pointer
template<class Y>
explicit SharedPtr(Y * p):
boost::shared_ptr<T>(p)
{}
//! Construct the class by any specialisation of the class
template<class Y>
SharedPtr(SharedPtr<Y> const & r):
boost::shared_ptr<T>(boost::dynamic_pointer_cast<T,Y>(r))
{}
//! Copy-constructor
template<class Y>
SharedPtr&
operator=(SharedPtr<Y> const & r)
{
SharedPtr<T>(r).swap(*this);
return *this;
}
//! Introduce a flexible way to reset the wrapped pointer
template<class Y>
SharedPtr&
operator()(Y * p) // Y must be complete
{
return operator=<Y>(SharedPtr<Y>(p));
}
//! Introduce a flexible way to reset the wrapped pointer
template<class Y>
SharedPtr&
operator()(SharedPtr<Y> const & r) // Y must be complete
{
return operator=<Y>(SharedPtr<Y>(r));
}
//! To provide a flexible way to use reference to the wrapped pointer (const version)
operator const T& () const
{
return *(this->get());
}
//! To provide a flexible way to use reference to the wrapped pointer
operator T& ()
{
return *(this->get());
}
};
}
#endif

View File

@ -0,0 +1,185 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_SliceArray_HeaderFile
#define MED_SliceArray_HeaderFile
#ifdef WIN32 // for correctly compiling "valarray" in modules, which are includes this file
#undef max
#undef min
#endif
#include <valarray>
#include <stdexcept>
//#if defined(_DEBUG_)
# define MED_TCSLICE_CHECK_RANGE
//#endif
namespace MED
{
//---------------------------------------------------------------
//! This class intends to provide an uniform way to handle multy-dimention data (const version)
/*!
It just contains pointer to real sequence and implement proper calcultion of its indexes.
This class deal with constant pointer to the sources data and provide const method to
read the them (data).
*/
template<class TValueType>
class TCSlice
{
const TValueType* myCValuePtr; //!< Reference to source multy-dimension data
size_t mySourceSize; //!< Size of the source multy-dimension data
std::slice mySlice; //!< Defines algorithm of index calculation
protected:
void
check_id(size_t theId) const
{
long int anId = -1;
if(theId < mySlice.size()){
anId = mySlice.start() + theId*mySlice.stride();
if(anId < (long int)mySourceSize)
return;
}
throw std::out_of_range("TCSlice::check_id");
}
//! Calculate internal index to get proper element from the source multy-dimension data
size_t
calculate_id(size_t theId) const
{
return mySlice.start() + theId*mySlice.stride();
}
size_t
get_id(size_t theId) const
{
#ifdef MED_TCSLICE_CHECK_RANGE
check_id(theId);
#endif
return calculate_id(theId);
}
size_t
get_id_at(size_t theId) const
{
check_id(theId);
return calculate_id(theId);
}
public:
typedef TValueType value_type;
//! Construct the class from bare pointer
TCSlice(const value_type* theValuePtr,
size_t theSourceSize,
const std::slice& theSlice):
myCValuePtr(theValuePtr),
mySourceSize(theSourceSize),
mySlice(theSlice)
{}
//! Construct the class from corresponding container
TCSlice(const TVector<value_type>& theContainer,
const std::slice& theSlice):
myCValuePtr(&theContainer[0]),
mySourceSize(theContainer.size()),
mySlice(theSlice)
{}
//! Default constructor (dangerous)
TCSlice():
myCValuePtr(NULL)
{}
//! Get element by its number (const version)
const value_type&
operator[](size_t theId) const
{
return *(myCValuePtr + get_id(theId));
}
const value_type&
at(size_t theId) const
{
return *(myCValuePtr + get_id_at(theId));
}
//! Get range of the order numbers
size_t
size() const
{
return mySlice.size();
}
};
//---------------------------------------------------------------
//! This class extend TCSlice functionality for non-constant case
template<class TValueType>
class TSlice: public TCSlice<TValueType>
{
TValueType* myValuePtr;
public:
typedef TValueType value_type;
typedef TCSlice<TValueType> TSupperClass;
//! Construct the class from bare pointer
TSlice(value_type* theValuePtr,
size_t theSourceSize,
const std::slice& theSlice):
TSupperClass(theValuePtr, theSourceSize, theSlice),
myValuePtr(theValuePtr)
{}
//! Construct the class from corresponding container
TSlice(TVector<value_type>& theContainer,
const std::slice& theSlice):
TSupperClass(theContainer, theSlice),
myValuePtr(&theContainer[0])
{}
//! Default constructor (dangerous)
TSlice():
myValuePtr(NULL)
{}
//! Get element by its number
value_type&
operator[](size_t theId)
{
return *(myValuePtr + this->get_id(theId));
}
value_type&
at(size_t theId)
{
return *(myValuePtr + this->get_id_at(theId));
}
};
}
#undef MED_TCSLICE_CHECK_RANGE
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,578 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_TWrapper_HeaderFile
#define MED_TWrapper_HeaderFile
#include "MED_TStructures.hxx"
#include "MED_Wrapper.hxx"
namespace MED
{
template<EVersion eVersion>
class TTWrapper: public TWrapper
{
public:
//----------------------------------------------------------------------------
//! Gets version of the MED library used for the MED file
virtual
EVersion
GetVersion()
{
return eVersion;
}
//----------------------------------------------------------------------------
virtual
PMeshInfo
CrMeshInfo(TInt theDim = 0, TInt theSpaceDim = 0,
const std::string& theValue = "",
EMaillage theType = eNON_STRUCTURE,
const std::string& theDesc = "")
{
return PMeshInfo(new TTMeshInfo<eVersion>
(theDim,
theSpaceDim,
theValue,
theType,
theDesc));
}
virtual
PMeshInfo
CrMeshInfo(const PMeshInfo& theInfo)
{
return PMeshInfo(new TTMeshInfo<eVersion>(theInfo));
}
//----------------------------------------------------------------------------
virtual
PFamilyInfo
CrFamilyInfo(const PMeshInfo& theMeshInfo,
TInt theNbGroup = 0,
TInt theNbAttr = 0,
TInt theId = 0,
const std::string& theValue = "")
{
return PFamilyInfo(new TTFamilyInfo<eVersion>
(theMeshInfo,
theNbGroup,
theNbAttr,
theId,
theValue));
}
virtual
PFamilyInfo
CrFamilyInfo(const PMeshInfo& theMeshInfo,
const std::string& theValue,
TInt theId,
const MED::TStringSet& theGroupNames,
const MED::TStringVector& theAttrDescs = MED::TStringVector(),
const MED::TIntVector& theAttrIds = MED::TIntVector(),
const MED::TIntVector& theAttrVals = MED::TIntVector())
{
return PFamilyInfo(new TTFamilyInfo<eVersion>
(theMeshInfo,
theValue,
theId,
theGroupNames,
theAttrDescs,
theAttrIds,
theAttrVals));
}
virtual
PFamilyInfo
CrFamilyInfo(const PMeshInfo& theMeshInfo,
const PFamilyInfo& theInfo)
{
return PFamilyInfo(new TTFamilyInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PElemInfo
CrElemInfo(const PMeshInfo& theMeshInfo,
TInt theNbElem,
EBooleen theIsElemNum = eVRAI,
EBooleen theIsElemNames = eVRAI)
{
return PElemInfo(new TTElemInfo<eVersion>
(theMeshInfo,
theNbElem,
theIsElemNum,
theIsElemNames));
}
virtual
PElemInfo
CrElemInfo(const PMeshInfo& theMeshInfo,
TInt theNbElem,
const TIntVector& theFamNum,
const TIntVector& aElemNum,
const TStringVector& aElemNames)
{
return PElemInfo(new TTElemInfo<eVersion>
(theMeshInfo,
theNbElem,
theFamNum,
aElemNum,
aElemNames));
}
//----------------------------------------------------------------------------
virtual
PNodeInfo
CrNodeInfo(const PMeshInfo& theMeshInfo,
TInt theNbElem,
EModeSwitch theMode = eFULL_INTERLACE,
ERepere theSystem = eCART,
EBooleen theIsElemNum = eVRAI,
EBooleen theIsElemNames = eVRAI)
{
return PNodeInfo(new TTNodeInfo<eVersion>
(theMeshInfo,
theNbElem,
theMode,
theSystem,
theIsElemNum,
theIsElemNames));
}
virtual
PNodeInfo
CrNodeInfo(const PMeshInfo& theMeshInfo,
const TFloatVector& theNodeCoords,
EModeSwitch theMode = eFULL_INTERLACE,
ERepere theSystem = eCART,
const TStringVector& theCoordNames = TStringVector(),
const TStringVector& theCoordUnits = TStringVector(),
const TIntVector& theFamilyNums = TIntVector(),
const TIntVector& theElemNums = TIntVector(),
const TStringVector& theElemNames = TStringVector())
{
return PNodeInfo(new TTNodeInfo<eVersion>
(theMeshInfo,
theNodeCoords,
theMode,
theSystem,
theCoordNames,
theCoordUnits,
theFamilyNums,
theElemNums,
theElemNames));
}
virtual
PNodeInfo
CrNodeInfo(const PMeshInfo& theMeshInfo,
const PNodeInfo& theInfo)
{
return PNodeInfo(new TTNodeInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PPolygoneInfo
CrPolygoneInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TInt theNbElem,
TInt theConnSize,
EConnectivite theConnMode = eNOD,
EBooleen theIsElemNum = eVRAI,
EBooleen theIsElemNames = eVRAI)
{
return PPolygoneInfo(new TTPolygoneInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theNbElem,
theConnSize,
theConnMode,
theIsElemNum,
theIsElemNames));
}
virtual
PPolygoneInfo
CrPolygoneInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
const TIntVector& theIndexes,
const TIntVector& theConnectivities,
EConnectivite theConnMode = eNOD,
const TIntVector& theFamilyNums = TIntVector(),
const TIntVector& theElemNums = TIntVector(),
const TStringVector& theElemNames = TStringVector())
{
return PPolygoneInfo(new TTPolygoneInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theIndexes,
theConnectivities,
theConnMode,
theFamilyNums,
theElemNums,
theElemNames));
}
virtual
PPolygoneInfo
CrPolygoneInfo(const PMeshInfo& theMeshInfo,
const PPolygoneInfo& theInfo)
{
return PPolygoneInfo(new TTPolygoneInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PPolyedreInfo
CrPolyedreInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TInt theNbElem,
TInt theNbFaces,
TInt theConnSize,
EConnectivite theConnMode = eNOD,
EBooleen theIsElemNum = eVRAI,
EBooleen theIsElemNames = eVRAI)
{
return PPolyedreInfo(new TTPolyedreInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theNbElem,
theNbFaces,
theConnSize,
theConnMode,
theIsElemNum,
theIsElemNames));
}
virtual
PPolyedreInfo
CrPolyedreInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
const TIntVector& theIndexes,
const TIntVector& theFaces,
const TIntVector& theConnectivities,
EConnectivite theConnMode = eNOD,
const TIntVector& theFamilyNums = TIntVector(),
const TIntVector& theElemNums = TIntVector(),
const TStringVector& theElemNames = TStringVector())
{
return PPolyedreInfo(new TTPolyedreInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theIndexes,
theFaces,
theConnectivities,
theConnMode,
theFamilyNums,
theElemNums,
theElemNames));
}
virtual
PPolyedreInfo
CrPolyedreInfo(const PMeshInfo& theMeshInfo,
const PPolyedreInfo& theInfo)
{
return PPolyedreInfo(new TTPolyedreInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PCellInfo
CrCellInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TInt theNbElem,
EConnectivite theConnMode = eNOD,
EBooleen theIsElemNum = eVRAI,
EBooleen theIsElemNames = eVRAI,
EModeSwitch theMode = eFULL_INTERLACE)
{
return PCellInfo(new TTCellInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theNbElem,
theConnMode,
theIsElemNum,
theIsElemNames,
theMode));
}
virtual
PCellInfo
CrCellInfo(const PMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
const TIntVector& theConnectivities,
EConnectivite theConnMode = eNOD,
const TIntVector& theFamilyNums = TIntVector(),
const TIntVector& theElemNums = TIntVector(),
const TStringVector& theElemNames = TStringVector(),
EModeSwitch theMode = eFULL_INTERLACE)
{
return PCellInfo(new TTCellInfo<eVersion>
(theMeshInfo,
theEntity,
theGeom,
theConnectivities,
theConnMode,
theFamilyNums,
theElemNums,
theElemNames,
theMode));
}
virtual
PCellInfo
CrCellInfo(const PMeshInfo& theMeshInfo,
const PCellInfo& theInfo)
{
return PCellInfo(new TTCellInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
//! Creates a MEDWrapper MED Balls representation
virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo,
TInt theNbBalls,
EBooleen theIsElemNum = eVRAI)
{
return PBallInfo( new TTBallInfo<eVersion>( theMeshInfo, theNbBalls, theIsElemNum ));
}
//! Creates a MEDWrapper MED Balls representation
virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo,
const TIntVector& theNodes,
TFloatVector& theDiameters,
const TIntVector& theFamilyNums = TIntVector(),
const TIntVector& theElemNums = TIntVector())
{
return PBallInfo( new TTBallInfo<eVersion>( theMeshInfo, theNodes, theDiameters,
theFamilyNums, theElemNums));
}
//! A copy-constructor for the MEDWrapper MED Balls representation
virtual PBallInfo CrBallInfo(const PMeshInfo& theMeshInfo,
const PBallInfo& theInfo)
{
return PBallInfo( new TTBallInfo<eVersion>( theMeshInfo, theInfo ));
}
//----------------------------------------------------------------------------
virtual
PFieldInfo
CrFieldInfo(const PMeshInfo& theMeshInfo,
TInt theNbComp = 0,
ETypeChamp theType = eFLOAT64,
const std::string& theValue = "",
EBooleen theIsLocal = eVRAI,
TInt theNbRef = 1)
{
return PFieldInfo(new TTFieldInfo<eVersion>
(theMeshInfo,
theNbComp,
theType,
theValue,
theIsLocal,
theNbRef));
}
virtual
PFieldInfo
CrFieldInfo(const PMeshInfo& theMeshInfo,
const PFieldInfo& theInfo)
{
return PFieldInfo(new TTFieldInfo<eVersion>
(theMeshInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PTimeStampInfo
CrTimeStampInfo(const PFieldInfo& theFieldInfo,
EEntiteMaillage theEntity,
const TGeom2Size& theGeom2Size,
const TGeom2NbGauss& theGeom2NbGauss = TGeom2NbGauss(),
TInt theNumDt = 0,
TInt theNumOrd = 0,
TFloat theDt = 0,
const std::string& theUnitDt = "",
const TGeom2Gauss& theGeom2Gauss = TGeom2Gauss())
{
return PTimeStampInfo(new TTTimeStampInfo<eVersion>
(theFieldInfo,
theEntity,
theGeom2Size,
theGeom2NbGauss,
theNumDt,
theNumOrd,
theDt,
theUnitDt,
theGeom2Gauss));
}
virtual
PTimeStampInfo
CrTimeStampInfo(const PFieldInfo& theFieldInfo,
const PTimeStampInfo& theInfo)
{
return PTimeStampInfo(new TTTimeStampInfo<eVersion>
(theFieldInfo,
theInfo));
}
//----------------------------------------------------------------------------
virtual
PGaussInfo
CrGaussInfo(const TGaussInfo::TInfo& theInfo,
EModeSwitch theMode = eFULL_INTERLACE)
{
return PGaussInfo(new TTGaussInfo<eVersion>
(theInfo,
theMode));
}
//----------------------------------------------------------------------------
virtual
PProfileInfo
CrProfileInfo(const TProfileInfo::TInfo& theInfo,
EModeProfil theMode = eCOMPACT)
{
return PProfileInfo(new TTProfileInfo<eVersion>
(theInfo,
theMode));
}
//----------------------------------------------------------------------------
virtual
PTimeStampValueBase
CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
ETypeChamp theTypeChamp,
const TGeom2Profile& theGeom2Profile = TGeom2Profile(),
EModeSwitch theMode = eFULL_INTERLACE)
{
if(theTypeChamp == eFLOAT64)
return PTimeStampValueBase(new TTTimeStampValue<eVersion, TFloatMeshValue>
(theTimeStampInfo,
theTypeChamp,
theGeom2Profile,
theMode));
return PTimeStampValueBase(new TTTimeStampValue<eVersion, TIntMeshValue>
(theTimeStampInfo,
theTypeChamp,
theGeom2Profile,
theMode));
}
virtual
PTimeStampValueBase
CrTimeStampValue(const PTimeStampInfo& theTimeStampInfo,
const PTimeStampValueBase& theInfo,
ETypeChamp theTypeChamp)
{
if(theTypeChamp == eFLOAT64)
return PTimeStampValueBase(new TTTimeStampValue<eVersion, TFloatMeshValue>
(theTimeStampInfo,
theInfo,
theTypeChamp));
return PTimeStampValueBase(new TTTimeStampValue<eVersion, TIntMeshValue>
(theTimeStampInfo,
theInfo,
theTypeChamp));
}
//----------------------------------------------------------------------------
virtual
PGrilleInfo
CrGrilleInfo(const PMeshInfo& theMeshInfo,
const PGrilleInfo& theInfo)
{
return PGrilleInfo(new TTGrilleInfo<eVersion>
(theMeshInfo,
theInfo));
}
virtual
PGrilleInfo
CrGrilleInfo(const PMeshInfo& theMeshInfo,
const EGrilleType& type)
{
return PGrilleInfo(new TTGrilleInfo<eVersion>
(theMeshInfo,
type));
}
virtual
PGrilleInfo
CrGrilleInfo(const PMeshInfo& theMeshInfo,
const EGrilleType& type,
const TInt& nbNodes)
{
return PGrilleInfo(new TTGrilleInfo<eVersion>
(theMeshInfo,
type,
nbNodes));
}
virtual
PGrilleInfo
CrGrilleInfo(const PMeshInfo& theMeshInfo,
const EGrilleType& type,
const MED::TIntVector& nbNodeVec)
{
return PGrilleInfo(new TTGrilleInfo<eVersion>
(theMeshInfo,
type,
nbNodeVec));
}
//----------------------------------------------------------------------------
};
}
#endif

View File

@ -0,0 +1,73 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_Utilities_HeaderFile
#define MED_Utilities_HeaderFile
#include "MED_WrapperBase.hxx"
#include <iostream>
#include <sstream>
#include <string>
#include <string.h>
#include <stdexcept>
namespace MED
{
class MEDWRAPPER_EXPORT PrefixPrinter
{
static int myCounter;
bool myIsActive;
public:
PrefixPrinter(bool theIsActive = true);
~PrefixPrinter();
static std::string GetPrefix();
};
}
#ifdef _DEBUG_
#define MSG(deb,msg) if(deb) std::cout<<MED::PrefixPrinter::GetPrefix()<<msg<<" ("<<__FILE__<<" ["<<__LINE__<<"])\n"
#define BEGMSG(deb,msg) if(deb) std::cout<<MED::PrefixPrinter::GetPrefix()<<msg
#define INITMSGA(deb,lev,msg) MED::PrefixPrinter aPrefixPrinter_##lev(deb); BEGMSG(deb,msg)
#define INITMSG(deb,msg) INITMSGA(deb,,msg)
#define ADDMSG(deb,msg) if(deb) std::cout<<msg
#else
#define MSG(deb,msg)
#define BEGMSG(deb,msg)
#define INITMSGA(deb,lev,msg)
#define INITMSG(deb,msg)
#define ADDMSG(deb,msg)
#endif
#ifndef EXCEPTION
#define EXCEPTION(TYPE, MSG) {\
std::ostringstream aStream;\
aStream<<__FILE__<<"["<<__LINE__<<"]::"<<MSG;\
throw TYPE(aStream.str().c_str());\
}
#endif
#endif

View File

@ -0,0 +1,489 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_V2_2_Wrapper_HeaderFile
#define MED_V2_2_Wrapper_HeaderFile
#ifdef WIN32
#if defined MEDWRAPPER_V2_2_EXPORTS || defined MEDWrapper_V2_2_EXPORTS
#if defined WIN32
#define MED_V22_WRAPPER_EXPORT __declspec( dllexport )
#else
#define MED_V22_WRAPPER_EXPORT
#endif
#else
#if defined WIN32
#define MED_V22_WRAPPER_EXPORT __declspec( dllimport )
#else
#define MED_V22_WRAPPER_EXPORT
#endif
#endif
#else
#define MED_V22_WRAPPER_EXPORT
#endif
#include "MED_Structures.hxx"
#include "MED_TWrapper.hxx"
namespace MED
{
template<>
TInt MED_V22_WRAPPER_EXPORT
GetDESCLength<eV2_2>();
template<>
TInt MED_V22_WRAPPER_EXPORT
GetIDENTLength<eV2_2>();
template<>
TInt MED_V22_WRAPPER_EXPORT
GetNOMLength<eV2_2>();
template<>
TInt MED_V22_WRAPPER_EXPORT
GetLNOMLength<eV2_2>();
template<>
TInt MED_V22_WRAPPER_EXPORT
GetPNOMLength<eV2_2>();
template<>
void MED_V22_WRAPPER_EXPORT
GetVersionRelease<eV2_2>(TInt& majeur, TInt& mineur, TInt& release);
template<>
TInt MED_V22_WRAPPER_EXPORT
GetNbConn<eV2_2>(EGeometrieElement typmai,
EEntiteMaillage typent,
TInt mdim);
namespace V2_2
{
//----------------------------------------------------------------------------
class TFile;
typedef boost::shared_ptr<TFile> PFile;
typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
//----------------------------------------------------------------------------
class MED_V22_WRAPPER_EXPORT TVWrapper: public MED::TTWrapper<eV2_2>
{
TVWrapper();
TVWrapper(const TVWrapper&);
TVWrapper& operator=(const TVWrapper&);
public:
TVWrapper(const std::string& theFileName);
//----------------------------------------------------------------------------
virtual
TInt
GetNbMeshes(TErr* theErr = NULL);
virtual
void
GetMeshInfo(TInt theMeshId, MED::TMeshInfo&,
TErr* theErr = NULL);
virtual
void
SetMeshInfo(const MED::TMeshInfo& theInfo,
TErr* theErr = NULL);
void SetMeshInfo(const MED::TMeshInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TInt
GetNbFamilies(const MED::TMeshInfo& theMeshInfo,
TErr* theErr = NULL);
virtual
TInt
GetNbFamAttr(TInt theFamId,
const MED::TMeshInfo& theInfo,
TErr* theErr = NULL);
virtual
TInt
GetNbFamGroup(TInt theFamId,
const MED::TMeshInfo& theInfo,
TErr* theErr = NULL);
virtual
void
GetFamilyInfo(TInt theFamId,
MED::TFamilyInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetFamilyInfo(const MED::TFamilyInfo& theInfo,
TErr* theErr = NULL);
void
SetFamilyInfo(const MED::TFamilyInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
void
GetNames(TElemInfo& theInfo,
TInt nb,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
virtual
void
GetNumeration(TElemInfo& theInfo,
TInt nb,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
virtual
void
GetFamilies(TElemInfo& theInfo,
TInt nb,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
virtual
void
SetNames(const TElemInfo& theInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
void
SetNames(const TElemInfo& theInfo,
EModeAcces theMode,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
virtual
void
SetNumeration(const TElemInfo& theInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
void
SetNumeration(const TElemInfo& theInfo,
EModeAcces theMode,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
virtual
void
SetFamilies(const TElemInfo& theInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
void
SetFamilies(const TElemInfo& theInfo,
EModeAcces theMode,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TInt
GetNbNodes(const MED::TMeshInfo& theMeshInfo,
TErr* theErr = NULL)
{
return GetNbNodes(theMeshInfo,eCOOR,theErr);
}
TInt
GetNbNodes(const MED::TMeshInfo& theMeshInfo,
ETable theTable,
TErr* theErr = NULL);
virtual
void
GetNodeInfo(MED::TNodeInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetNodeInfo(const MED::TNodeInfo& theInfo,
TErr* theErr = NULL);
void
SetNodeInfo(const MED::TNodeInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
void
GetPolygoneInfo(TPolygoneInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetPolygoneInfo(const TPolygoneInfo& theInfo,
TErr* theErr = NULL);
void
SetPolygoneInfo(const MED::TPolygoneInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
virtual
TInt
GetNbPolygones(const TMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
EConnectivite theConnMode = eNOD,
TErr* theErr = NULL);
virtual
TInt
GetPolygoneConnSize(const TMeshInfo& theMeshInfo,
EEntiteMaillage theEntity,
EGeometrieElement theGeom,
EConnectivite theConnMode = eNOD,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
void
GetPolyedreInfo(TPolyedreInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetPolyedreInfo(const TPolyedreInfo& theInfo,
TErr* theErr = NULL);
void
SetPolyedreInfo(const MED::TPolyedreInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
virtual
TInt
GetNbPolyedres(const TMeshInfo& theMeshInfo,
EEntiteMaillage,
EGeometrieElement,
EConnectivite,
TErr* theErr = NULL);
virtual
void
GetPolyedreConnSize(const TMeshInfo& theMeshInfo,
TInt& theNbFaces,
TInt& theConnSize,
EConnectivite theConnMode = eNOD,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TEntityInfo
GetEntityInfo(const MED::TMeshInfo& theMeshInfo,
EConnectivite theConnMode = eNOD,
TErr* theErr = NULL);
virtual
TInt
GetNbCells(const MED::TMeshInfo& theMeshInfo,
EEntiteMaillage,
EGeometrieElement,
EConnectivite theConnMode = eNOD,
TErr* theErr = NULL);
virtual
void
GetCellInfo(MED::TCellInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetCellInfo(const MED::TCellInfo& theInfo,
TErr* theErr = NULL);
void
SetCellInfo(const MED::TCellInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
//! Read geom type of MED_BALL structural element
EGeometrieElement GetBallGeom(const TMeshInfo& theMeshInfo);
//! Read number of balls in the Mesh
virtual TInt GetNbBalls(const TMeshInfo& theMeshInfo);
//! Read a MEDWrapped representation of MED_BALL from the MED file
virtual void GetBallInfo(TBallInfo& theInfo, TErr* theErr = NULL);
//! Write a MEDWrapped representation of MED_BALL to the MED file
virtual void SetBallInfo(const TBallInfo& theInfo, TErr* theErr);
//! Write a MEDWrapped representation of MED_BALL to the MED file
void SetBallInfo(const TBallInfo& theInfo, EModeAcces theMode, TErr* theErr);
//----------------------------------------------------------------------------
virtual
TInt
GetNbFields(TErr* theErr = NULL);
virtual
TInt
GetNbComp(TInt theFieldId,
TErr* theErr = NULL);
virtual
void
GetFieldInfo(TInt theFieldId,
MED::TFieldInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetFieldInfo(const MED::TFieldInfo& theInfo,
TErr* theErr = NULL);
void
SetFieldInfo(const MED::TFieldInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TInt
GetNbGauss(TErr* theErr = NULL);
virtual
TGaussInfo::TInfo
GetGaussPreInfo(TInt theId,
TErr* theErr = NULL);
virtual
void
GetGaussInfo(TInt theId,
TGaussInfo& theInfo,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TInt
GetNbProfiles(TErr* theErr = NULL);
virtual
TProfileInfo::TInfo
GetProfilePreInfo(TInt theId,
TErr* theErr = NULL);
virtual
void
GetProfileInfo(TInt theId,
TProfileInfo& theInfo,
TErr* theErr = NULL);
virtual
void
SetProfileInfo(const TProfileInfo& theInfo,
TErr* theErr = NULL);
void
SetProfileInfo(const TProfileInfo& theInfo,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
TInt
GetNbTimeStamps(const MED::TFieldInfo& theInfo,
const MED::TEntityInfo& theEntityInfo,
EEntiteMaillage& theEntity,
TGeom2Size& theGeom2Size,
TErr* theErr = NULL);
virtual
void
GetTimeStampInfo(TInt theTimeStampId,
MED::TTimeStampInfo& theInfo,
TErr* theErr = NULL);
virtual
void
GetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
const TMKey2Profile& theMKey2Profile,
const TKey2Gauss& theKey2Gauss,
TErr* theErr = NULL);
virtual
void
SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
TErr* theErr = NULL);
void
SetTimeStampValue(const PTimeStampValueBase& theTimeStampValue,
EModeAcces theMode,
TErr* theErr = NULL);
//----------------------------------------------------------------------------
virtual
void
GetGrilleInfo(TGrilleInfo& theGrilleInfo,
TErr* theErr = NULL);
virtual
void
SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
TErr* theErr = NULL);
void
SetGrilleInfo(const MED::TGrilleInfo& theGrilleInfo,
EModeAcces theMode,
TErr* theErr = NULL);
virtual
void
GetGrilleType(const MED::TMeshInfo& theMeshInfo,
EGrilleType& type,
TErr* theErr = NULL);
void
GetGrilleStruct(const MED::TMeshInfo& theMeshInfo,
TIntVector& theStruct,
TErr* theErr = NULL);
protected:
PFile myFile;
};
}
}
#endif

View File

@ -0,0 +1,152 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef MED_Vector_HeaderFile
#define MED_Vector_HeaderFile
#include <vector>
#include <stdexcept>
//#if defined(_DEBUG_)
# define MED_TVECTOR_CHECK_RANGE
//#endif
namespace MED
{
//! Main purpose to introduce the class was to customize operator []
template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
class TVector : public std::vector<_Tp, _Alloc>
{
public:
typedef size_t size_type;
typedef std::vector<_Tp, _Alloc> superclass;
typedef typename superclass::allocator_type allocator_type;
typedef _Tp value_type;
typedef value_type& reference;
typedef const value_type& const_reference;
protected:
void
check_range(size_type __n) const
{
if (__n >= this->size())
throw std::out_of_range("TVector [] access out of range");
}
const_reference
get_value(size_type __n) const
{
return superclass::operator[](__n);
}
reference
get_value(size_type __n)
{
return superclass::operator[](__n);
}
public:
explicit
TVector(const allocator_type& __a = allocator_type()):
superclass(__a)
{}
TVector(size_type __n, const value_type& __val,
const allocator_type& __a = allocator_type()):
superclass(__n, __val, __a)
{}
explicit
TVector(size_type __n):
superclass(__n)
{}
TVector(const TVector& __x):
superclass(__x)
{}
template<typename _InputIterator>
TVector(_InputIterator __first, _InputIterator __last,
const allocator_type& __a = allocator_type()):
superclass(__first, __last, __a)
{}
template<typename _Yp, typename _Al>
TVector(TVector<_Yp, _Al> __y):
superclass(__y.begin(), __y.end())
{}
TVector&
operator=(const TVector& __x)
{
superclass::operator=(__x);
return *this;
}
template<typename _Yp, typename _Al>
TVector&
operator=(TVector<_Yp, _Al> __y)
{
this->assign(__y.begin(), __y.end());
return *this;
}
reference
operator[](size_type __n)
{
#if defined(MED_TVECTOR_CHECK_RANGE)
check_range(__n);
#endif
return get_value(__n);
}
const_reference
operator[](size_type __n) const
{
#if defined(MED_TVECTOR_CHECK_RANGE)
check_range(__n);
#endif
return get_value(__n);
}
reference
at(size_type __n)
{
check_range(__n);
return get_value(__n);
}
const_reference
at(size_type __n) const
{
check_range(__n);
return get_value(__n);
}
};
}
#undef MED_TVECTOR_CHECK_RANGE
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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 : MED_WrapperBase.hxx
// Author : Alexander A. BORODIN
//
#ifndef _MED_WrapperBase_HXX_
#define _MED_WrapperBase_HXX_
#ifdef WIN32
#if defined MEDWRAPPER_BASE_EXPORTS || defined MEDWrapperBase_EXPORTS
#if defined WIN32
#define MEDWRAPPER_EXPORT __declspec( dllexport )
#else
#define MEDWRAPPER_EXPORT
#endif
#else
#if defined WIN32
#define MEDWRAPPER_EXPORT __declspec( dllimport )
#else
#define MEDWRAPPER_EXPORT
#endif
#endif
#else
#define MEDWRAPPER_EXPORT
#endif
#endif

View File

@ -0,0 +1,46 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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 : MED_WrapperFactory.hxx
// Author : Alexander A. BORODIN
//
#ifndef _MED_WrapperFactory_HXX_
#define _MED_WrapperFactory_HXX_
#ifdef WIN32
#if defined MEDWRAPPER_FACTORY_EXPORTS || defined MEDWrapper_EXPORTS
#if defined WIN32
#define MEDWRAPPER_FACTORY_EXPORT __declspec( dllexport )
#else
#define MEDWRAPPER_FACTORY_EXPORT
#endif
#else
#if defined WIN32
#define MEDWRAPPER_FACTORY_EXPORT __declspec( dllimport )
#else
#define MEDWRAPPER_FACTORY_EXPORT
#endif
#endif
#else
#define MEDWRAPPER_FACTORY_EXPORT
#endif
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//=============================================================================
// File : NETGENPlugin_Defs.hxx
// Author : Alexander A. BORODIN
@ -27,7 +28,7 @@
#define _NETGENPlugin_DEFS_HXX_
#ifdef WIN32
#ifdef NETGENPLUGIN_EXPORTS
#if defined NETGENPLUGIN_EXPORTS || defined NETGENEngine_EXPORTS
#define NETGENPLUGIN_EXPORT __declspec( dllexport )
#else
#define NETGENPLUGIN_EXPORT __declspec( dllimport )

View File

@ -1,31 +1,30 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis.hxx
// Author : Michael Sazonov (OCN)
// Date : 27/03/2006
// Project : SALOME
// $Header: /home/server/cvs/NETGENPLUGIN/NETGENPLUGIN_SRC/src/NETGENPlugin/NETGENPlugin_Hypothesis.hxx,v 1.4.2.2 2008/11/27 14:29:44 abd Exp $
//=============================================================================
//
#ifndef _NETGENPlugin_Hypothesis_HXX_
#define _NETGENPlugin_Hypothesis_HXX_
@ -33,11 +32,15 @@
#include "NETGENPlugin_Defs.hxx"
#include "SMESH_Hypothesis.hxx"
#include "SMESH_Exception.hxx"
#include "Utils_SALOME_Exception.hxx"
#include <map>
// Parameters for work of NETGEN
//
using namespace std;
class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis: public SMESH_Hypothesis
{
public:
@ -47,6 +50,9 @@ public:
void SetMaxSize(double theSize);
double GetMaxSize() const { return _maxSize; }
void SetMinSize(double theSize);
double GetMinSize() const { return _minSize; }
void SetSecondOrder(bool theVal);
bool GetSecondOrder() const { return _secondOrder; }
@ -77,6 +83,22 @@ public:
void SetNbSegPerRadius(double theVal);
double GetNbSegPerRadius() const { return _nbSegPerRadius; }
typedef std::map<std::string, double> TLocalSize;
static TLocalSize GetDefaultLocalSize() { return TLocalSize(); }
void SetLocalSizeOnEntry(const std::string& entry, double localSize);
double GetLocalSizeOnEntry(const std::string& entry);
const TLocalSize& GetLocalSizesAndEntries() const { return _localSize; }
void UnsetLocalSizeOnEntry(const std::string& entry);
void SetQuadAllowed(bool theVal);
bool GetQuadAllowed() const { return _quadAllowed; }
void SetSurfaceCurvature(bool theVal);
bool GetSurfaceCurvature() const { return _surfaceCurvature; }
void SetFuseEdges(bool theVal);
bool GetFuseEdges() const { return _fuseEdges; }
// the default values (taken from NETGEN 4.5 sources)
static double GetDefaultMaxSize();
@ -86,12 +108,15 @@ public:
static double GetDefaultNbSegPerRadius();
static bool GetDefaultSecondOrder();
static bool GetDefaultOptimize();
static bool GetDefaultQuadAllowed();
static bool GetDefaultSurfaceCurvature();
static bool GetDefaultFuseEdges();
// Persistence
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
friend NETGENPLUGIN_EXPORT std::ostream & operator <<(std::ostream & save, NETGENPlugin_Hypothesis & hyp);
friend NETGENPLUGIN_EXPORT std::istream & operator >>(std::istream & load, NETGENPlugin_Hypothesis & hyp);
virtual ostream & SaveTo(ostream & save);
virtual istream & LoadFrom(istream & load);
friend NETGENPLUGIN_EXPORT ostream & operator <<(ostream & save, NETGENPlugin_Hypothesis & hyp);
friend NETGENPLUGIN_EXPORT istream & operator >>(istream & load, NETGENPlugin_Hypothesis & hyp);
/*!
* \brief Does nothing
@ -101,20 +126,24 @@ public:
*/
virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
/*!
/*!
* \brief Initialize my parameter values by default parameters.
* \retval bool - true if parameter values have been successfully defined
*/
virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
private:
double _maxSize;
double _maxSize, _minSize;
double _growthRate;
double _nbSegPerEdge;
double _nbSegPerRadius;
Fineness _fineness;
bool _secondOrder;
bool _optimize;
TLocalSize _localSize;
bool _quadAllowed;
bool _surfaceCurvature;
bool _fuseEdges;
};
#endif

View File

@ -1,30 +1,30 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_2D.hxx
// Author : Michael Sazonov (OCN)
// Date : 27/03/2006
// Project : SALOME
// $Header: /home/server/cvs/NETGENPLUGIN/NETGENPLUGIN_SRC/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx,v 1.4.2.2 2008/11/27 14:29:44 abd Exp $
//=============================================================================
//
#ifndef _NETGENPlugin_Hypothesis_2D_HXX_
@ -33,7 +33,7 @@
#include "NETGENPlugin_Defs.hxx"
#include "NETGENPlugin_Hypothesis.hxx"
#include "SMESH_Exception.hxx"
#include "Utils_SALOME_Exception.hxx"
// Parameters for work of NETGEN.
// This class is just to give 2D dimension, actually
@ -45,16 +45,16 @@ public:
NETGENPlugin_Hypothesis_2D(int hypId, int studyId, SMESH_Gen * gen);
void SetQuadAllowed(bool theVal);
bool GetQuadAllowed() const { return _quadAllowed; }
static bool GetDefaultQuadAllowed();
// void SetQuadAllowed(bool theVal);
// bool GetQuadAllowed() const { return _quadAllowed; }
// static bool GetDefaultQuadAllowed();
// Persistence
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
// virtual ostream & SaveTo(ostream & save);
// virtual istream & LoadFrom(istream & load);
private:
bool _quadAllowed;
// private:
// bool _quadAllowed;
};
#endif

View File

@ -0,0 +1,57 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_2D_ONLY_i.hxx
// Project : SALOME
//=============================================================================
//
#ifndef _NETGENPlugin_Hypothesis_2D_ONLY_i_HXX_
#define _NETGENPlugin_Hypothesis_2D_ONLY_i_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include "NETGENPlugin_Hypothesis_2D_i.hxx"
class SMESH_Gen;
// NETGENPlugin parameters hypothesis ("2D only" case)
class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D_ONLY_i:
public virtual POA_NETGENPlugin::NETGENPlugin_Hypothesis_2D_ONLY,
public NETGENPlugin_Hypothesis_2D_i
{
public:
// Constructor
NETGENPlugin_Hypothesis_2D_ONLY_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~NETGENPlugin_Hypothesis_2D_ONLY_i();
char* GetName();
};
#endif

View File

@ -0,0 +1,73 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_2D_i.hxx
// Author : Michael Sazonov (OCN)
// Date : 03/04/2006
// Project : SALOME
//=============================================================================
//
#ifndef _NETGENPlugin_Hypothesis_2D_i_HXX_
#define _NETGENPlugin_Hypothesis_2D_i_HXX_
#include "NETGENPlugin_Defs.hxx"
// #include <SALOMEconfig.h>
// #include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include "NETGENPlugin_Hypothesis_i.hxx"
#include "NETGENPlugin_Hypothesis_2D.hxx"
class SMESH_Gen;
// NETGENPlugin parameters hypothesis (2D case)
class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_Hypothesis_2D,
public NETGENPlugin_Hypothesis_i
{
public:
// Constructor
NETGENPlugin_Hypothesis_2D_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~NETGENPlugin_Hypothesis_2D_i();
// Get implementation
::NETGENPlugin_Hypothesis_2D* GetImpl();
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
protected:
// to remember whether a parameter is already set (issue 0021364)
// enum SettingMethod
// {
// METH_SetQuadAllowed = NETGENPlugin_Hypothesis_i::METH_LAST * 2,
// METH_LAST = METH_SetQuadAllowed
// };
};
#endif

View File

@ -0,0 +1,59 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_2D_i.hxx
// Project : SALOME
//=============================================================================
//
#ifndef _NETGENPlugin_Hypothesis_3D_i_HXX_
#define _NETGENPlugin_Hypothesis_3D_i_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include "NETGENPlugin_Hypothesis_i.hxx"
class SMESH_Gen;
// NETGENPlugin parameters hypothesis (3D "only" case)
class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_3D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_Hypothesis_3D,
public NETGENPlugin_Hypothesis_i
{
public:
// Constructor
NETGENPlugin_Hypothesis_3D_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl);
// Get type name of hypothesis
char* GetName();
// Destructor
virtual ~NETGENPlugin_Hypothesis_3D_i();
};
#endif

View File

@ -0,0 +1,151 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Hypothesis_i.hxx
// Author : Michael Sazonov (OCN)
// Date : 03/04/2006
// Project : SALOME
//=============================================================================
//
#ifndef _NETGENPlugin_Hypothesis_i_HXX_
#define _NETGENPlugin_Hypothesis_i_HXX_
#include "NETGENPlugin_Defs.hxx"
//#include <SALOMEconfig.h>
//#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
// #include "SMESH_Hypothesis_i.hxx"
#include "NETGENPlugin_Hypothesis.hxx"
class SMESH_Gen;
//class GEOM_Object;
// NETGENPlugin parameters hypothesis
class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_i:
public virtual POA_NETGENPlugin::NETGENPlugin_Hypothesis,
public virtual SMESH_Hypothesis_i
{
public:
// Constructor
NETGENPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~NETGENPlugin_Hypothesis_i();
void SetMaxSize(CORBA::Double theSize);
CORBA::Double GetMaxSize();
void SetMinSize(CORBA::Double theSize);
CORBA::Double GetMinSize();
void SetSecondOrder(CORBA::Boolean theVal);
CORBA::Boolean GetSecondOrder();
void SetOptimize(CORBA::Boolean theVal);
CORBA::Boolean GetOptimize();
void SetFineness(CORBA::Long theFineness);
CORBA::Long GetFineness();
void SetGrowthRate(CORBA::Double theRate);
CORBA::Double GetGrowthRate();
void SetNbSegPerEdge(CORBA::Double theVal);
CORBA::Double GetNbSegPerEdge();
void SetNbSegPerRadius(CORBA::Double theVal);
CORBA::Double GetNbSegPerRadius();
void SetLocalSizeOnShape(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double localSize)
throw (SALOME::SALOME_Exception);
void SetLocalSizeOnEntry(const char* entry, CORBA::Double localSize);
CORBA::Double GetLocalSizeOnEntry(const char* entry);
NETGENPlugin::string_array* GetLocalSizeEntries();
void UnsetLocalSizeOnEntry(const char* entry);
void SetQuadAllowed(CORBA::Boolean theVal);
CORBA::Boolean GetQuadAllowed();
void SetUseSurfaceCurvature(CORBA::Boolean theVal);
CORBA::Boolean GetUseSurfaceCurvature();
void SetFuseEdges(CORBA::Boolean theVal);
CORBA::Boolean GetFuseEdges();
// Get implementation
::NETGENPlugin_Hypothesis* GetImpl();
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
protected:
// to remember whether a parameter is already set (issue 0021364)
enum SettingMethod
{
METH_SetMaxSize = 1,
METH_SetMinSize = 2,
METH_SetSecondOrder = 4,
METH_SetOptimize = 8,
METH_SetFineness = 16,
METH_SetGrowthRate = 32,
METH_SetNbSegPerEdge = 64,
METH_SetNbSegPerRadius = 128,
METH_SetLocalSizeOnEntry = 256,
METH_SetQuadAllowed = METH_SetLocalSizeOnEntry * 2,
METH_SetSurfaceCurvature = METH_SetQuadAllowed * 2,
METH_SetFuseEdges = METH_SetSurfaceCurvature * 2,
METH_LAST = METH_SetFuseEdges
};
int mySetMethodFlags;
// Return true if a parameter is not yet set, else return true if a parameter changes.
// PythonDumping depends on the result of this function.
// Checking only change of a parameter is not enough because then the default values are
// not dumped and if the defaults will change then the behaviour of scripts
// created without dump of the default parameters will also change what is not good.
template<typename T>
bool isToSetParameter(T curValue, T newValue, /*SettingMethod*/int meth)
{
if ( mySetMethodFlags & meth ) // already set, check if a value is changing
return ( curValue != newValue );
else
return ( mySetMethodFlags |= meth ); // == return true
}
public:
// method intended to remove explicit treatment of Netgen hypotheses from
// SMESH_NoteBook to assure backward compatibility after implemeneting
// issue 0021308: Remove hard-coded dependency of the external mesh plugins
virtual int getParamIndex(const TCollection_AsciiString& method, int nbVars) const;
// method used to convert variable parameters stored in an old study
// into myMethod2VarParams. It should return a method name for an index of
// variable parameters. Index is countered from zero
virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
};
#endif

View File

@ -1,52 +1,106 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_Mesher.hxx
// Author : Michael Sazonov (OCN)
// Date : 31/03/2006
// Project : SALOME
// $Header: /home/server/cvs/NETGENPLUGIN/NETGENPLUGIN_SRC/src/NETGENPlugin/NETGENPlugin_Mesher.hxx,v 1.4.2.2 2008/11/27 14:29:44 abd Exp $
//=============================================================================
//
#ifndef _NETGENPlugin_Mesher_HXX_
#define _NETGENPlugin_Mesher_HXX_
#include <TopTools_IndexedMapOfShape.hxx>
#include "NETGENPlugin_Defs.hxx"
#include "StdMeshers_FaceSide.hxx"
#include <map>
class SMESH_Mesh;
#include <StdMeshers_FaceSide.hxx>
#include <SMDS_MeshElement.hxx>
#include <SMESH_Algo.hxx>
#include <SMESH_ProxyMesh.hxx>
namespace nglib {
#include <nglib.h>
}
#include <map>
#include <vector>
#include <set>
class SMESHDS_Mesh;
class SMESH_Comment;
class SMESH_Mesh;
class SMESH_MesherHelper;
class TopoDS_Shape;
// class TopTools_IndexedMapOfShape;
class NETGENPlugin_Hypothesis;
class NETGENPlugin_SimpleHypothesis_2D;
class NETGENPlugin_Internals;
namespace netgen {
class OCCGeometry;
class Mesh;
}
//=============================================================================
/*!
* \brief Struct storing nb of entities in netgen mesh
*/
//=============================================================================
struct NETGENPlugin_ngMeshInfo
{
int _nbNodes, _nbSegments, _nbFaces, _nbVolumes;
char* _copyOfLocalH;
NETGENPlugin_ngMeshInfo( netgen::Mesh* ngMesh=0);
void transferLocalH( netgen::Mesh* fromMesh, netgen::Mesh* toMesh );
void restoreLocalH ( netgen::Mesh* ngMesh);
};
//================================================================================
/*!
* \brief It correctly initializes netgen library at constructor and
* correctly finishes using netgen library at destructor
*/
//================================================================================
struct NETGENPLUGIN_EXPORT NETGENPlugin_NetgenLibWrapper
{
bool _isComputeOk;
nglib::Ng_Mesh * _ngMesh;
NETGENPlugin_NetgenLibWrapper();
~NETGENPlugin_NetgenLibWrapper();
void setMesh( nglib::Ng_Mesh* mesh );
private:
std::string getOutputFileName();
void removeOutputFile();
std::string _outputFileName;
std::streambuf* _coutBuffer; // to re-/store cout.rdbuf()
};
//=============================================================================
/*!
* \brief This class calls the NETGEN mesher of OCC geometry
*/
//=============================================================================
class NETGENPLUGIN_EXPORT NETGENPlugin_Mesher
{
@ -55,37 +109,177 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Mesher
NETGENPlugin_Mesher (SMESH_Mesh* mesh, const TopoDS_Shape& aShape,
const bool isVolume);
~NETGENPlugin_Mesher();
void SetSelfPointer( NETGENPlugin_Mesher ** ptr );
void SetParameters(const NETGENPlugin_Hypothesis* hyp);
void SetParameters(const NETGENPlugin_Hypothesis* hyp);
void SetParameters(const NETGENPlugin_SimpleHypothesis_2D* hyp);
void SetViscousLayers2DAssigned(bool isAssigned) { _isViscousLayers2D = isAssigned; }
bool Compute();
bool Evaluate(MapShapeNbElems& aResMap);
double GetProgress(const SMESH_Algo* holder,
const int * algoProgressTic,
const double * algoProgress) const;
static void PrepareOCCgeometry(netgen::OCCGeometry& occgeom,
const TopoDS_Shape& shape,
SMESH_Mesh& mesh,
std::list< SMESH_subMesh* > * meshedSM=0);
std::list< SMESH_subMesh* > * meshedSM=0,
NETGENPlugin_Internals* internalShapes=0);
static double GetDefaultMinSize(const TopoDS_Shape& shape,
const double maxSize);
static void RestrictLocalSize(netgen::Mesh& ngMesh,
const gp_XYZ& p,
double size,
const bool overrideMinH=true);
static int FillSMesh(const netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
const NETGENPlugin_ngMeshInfo& initState,
SMESH_Mesh& sMesh,
std::vector<const SMDS_MeshNode*>& nodeVec,
SMESH_Comment& comment,
SMESH_MesherHelper* quadHelper=0);
bool FillNgMesh(netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
std::vector<const SMDS_MeshNode*>& nodeVec,
const std::list< SMESH_subMesh* > & meshedSM,
SMESH_MesherHelper* quadHelper=0,
SMESH_ProxyMesh::Ptr proxyMesh=SMESH_ProxyMesh::Ptr());
static void FixIntFaces(const netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
NETGENPlugin_Internals& internalShapes);
static bool FixFaceMesh(const netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
const int faceID);
static void AddIntVerticesInFaces(const netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
std::vector<const SMDS_MeshNode*>& nodeVec,
NETGENPlugin_Internals& internalShapes);
static void AddIntVerticesInSolids(const netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
std::vector<const SMDS_MeshNode*>& nodeVec,
NETGENPlugin_Internals& internalShapes);
static SMESH_ComputeErrorPtr
AddSegmentsToMesh(netgen::Mesh& ngMesh,
netgen::OCCGeometry& geom,
const TSideVector& wires,
SMESH_MesherHelper& helper,
std::vector< const SMDS_MeshNode* > & nodeVec,
const bool overrideMinH=true);
void SetDefaultParameters();
static void RemoveTmpFiles();
protected:
static SMESH_ComputeErrorPtr ReadErrors(const std::vector< const SMDS_MeshNode* >& nodeVec);
bool fillNgMesh(netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
std::vector<SMDS_MeshNode*>& nodeVec,
const std::list< SMESH_subMesh* > & meshedSM);
void defaultParameters();
static void toPython( const netgen::Mesh* ngMesh,
const std::string& pyFile); // debug
private:
SMESH_Mesh* _mesh;
const TopoDS_Shape& _shape;
bool _isVolume;
bool _optimize;
int _fineness;
bool _isViscousLayers2D;
netgen::Mesh* _ngMesh;
netgen::OCCGeometry* _occgeom;
int _curShapeIndex;
volatile int _progressTic;
volatile double _ticTime; // normalized [0,1] compute time per a SMESH_Algo::_progressTic
volatile double _totalTime;
const NETGENPlugin_SimpleHypothesis_2D * _simpleHyp;
std::map< int, std::pair<int,int> > _faceDescriptors;
// a pointer to NETGENPlugin_Mesher* field of the holder, that will be
// nullified at destruction of this
NETGENPlugin_Mesher ** _ptrToMe;
};
//=============================================================================
/*!
* \brief Container of info needed to solve problems with internal shapes.
*
* Issue 0020676. It is made up as a class to be ready to extract from NETGEN
* and put in SMESH as soon as the same solution is needed somewhere else.
* The approach is to precompute internal edges in 2D and internal faces in 3D
* and put their mesh correctly (twice) into netgen mesh.
* In 2D, this class finds internal edges in faces and their vertices.
* In 3D, it additionally finds internal faces, their edges shared with other faces,
* and their vertices shared by several internal edges. Nodes built on the found
* shapes and mesh faces built on the found internal faces are to be doubled in
* netgen mesh to emulate a "crack"
*
* For internal faces a more simple solution is found, which is just to duplicate
* mesh faces on internal geom faces without modeling a "real crack". For this
* reason findBorderElements() is no more used anywhere.
*/
//=============================================================================
class NETGENPLUGIN_EXPORT NETGENPlugin_Internals
{
SMESH_Mesh& _mesh;
bool _is3D;
//2D
std::map<int,int> _e2face;//!<edges and their vertices in faces where they are TopAbs_INTERNAL
std::map<int,std::list<int> > _f2v;//!<faces with internal vertices
// 3D
std::set<int> _intShapes;
std::set<int> _borderFaces; //!< non-internal faces sharing the internal edge
std::map<int,std::list<int> > _s2v;//!<solids with internal vertices
public:
NETGENPlugin_Internals( SMESH_Mesh& mesh, const TopoDS_Shape& shape, bool is3D );
SMESH_Mesh& getMesh() const;
bool isShapeToPrecompute(const TopoDS_Shape& s);
// 2D meshing
// edges
bool hasInternalEdges() const { return !_e2face.empty(); }
bool isInternalEdge( int id ) const { return _e2face.count( id ); }
const std::map<int,int>& getEdgesAndVerticesWithFaces() const { return _e2face; }
void getInternalEdges( TopTools_IndexedMapOfShape& fmap,
TopTools_IndexedMapOfShape& emap,
TopTools_IndexedMapOfShape& vmap,
std::list< SMESH_subMesh* > smToPrecompute[]);
// vertices
bool hasInternalVertexInFace() const { return !_f2v.empty(); }
const std::map<int,std::list<int> >& getFacesWithVertices() const { return _f2v; }
// 3D meshing
// faces
bool hasInternalFaces() const { return !_intShapes.empty(); }
bool isInternalShape( int id ) const { return _intShapes.count( id ); }
void findBorderElements( std::set< const SMDS_MeshElement*, TIDCompare > & borderElems );
bool isBorderFace( int faceID ) const { return _borderFaces.count( faceID ); }
void getInternalFaces( TopTools_IndexedMapOfShape& fmap,
TopTools_IndexedMapOfShape& emap,
std::list< SMESH_subMesh* >& facesSM,
std::list< SMESH_subMesh* >& boundarySM);
// vertices
bool hasInternalVertexInSolid() const { return !_s2v.empty(); }
bool hasInternalVertexInSolid(int soID ) const { return _s2v.count(soID); }
const std::map<int,std::list<int> >& getSolidsWithVertices() const { return _s2v; }
};
#endif

View File

@ -1,30 +1,30 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_NETGEN_2D.hxx
// Author : Michael Sazonov (OCN)
// Date : 20/03/2006
// Project : SALOME
// $Header: /home/server/cvs/NETGENPLUGIN/NETGENPLUGIN_SRC/src/NETGENPlugin/NETGENPlugin_NETGEN_2D.hxx,v 1.4.2.2 2008/11/27 14:29:44 abd Exp $
//=============================================================================
//
#ifndef _NETGENPlugin_NETGEN_2D_HXX_
@ -32,12 +32,10 @@
#include "NETGENPlugin_Defs.hxx"
#include "SMESH_2D_Algo.hxx"
#include "SMESH_Algo.hxx"
#include "SMESH_Mesh.hxx"
#include "StdMeshers_MaxElementVolume.hxx"
#include "SMESH_Exception.hxx"
//class NETGENPlugin_Hypothesis_2D;
class NETGENPlugin_Mesher;
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D: public SMESH_2D_Algo
{
@ -50,10 +48,20 @@ public:
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
const TopoDS_Shape& aShape);
virtual void CancelCompute();
virtual double GetProgress() const;
virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap);
protected:
const SMESHDS_Hypothesis* _hypothesis;
bool _isViscousLayers2D;
NETGENPlugin_Mesher * _mesher;
};
#endif

View File

@ -1,30 +1,30 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_NETGEN_2D3D.hxx
// Author : Michael Sazonov (OCN)
// Date : 20/03/2006
// Project : SALOME
// $Header: /home/server/cvs/NETGENPLUGIN/NETGENPLUGIN_SRC/src/NETGENPlugin/NETGENPlugin_NETGEN_2D3D.hxx,v 1.4.2.2 2008/11/27 14:29:44 abd Exp $
//=============================================================================
//
#ifndef _NETGENPlugin_NETGEN_2D3D_HXX_
@ -32,12 +32,9 @@
#include "NETGENPlugin_Defs.hxx"
#include "SMESH_3D_Algo.hxx"
#include "SMESH_Mesh.hxx"
#include "StdMeshers_MaxElementVolume.hxx"
#include "SMESH_Exception.hxx"
#include <SMESH_Algo.hxx>
//class NETGENPlugin_Hypothesis;
class NETGENPlugin_Mesher;
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D3D: public SMESH_3D_Algo
{
@ -50,10 +47,20 @@ public:
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
const TopoDS_Shape& aShape);
virtual void CancelCompute();
virtual double GetProgress() const;
virtual bool Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap);
protected:
const SMESHDS_Hypothesis* _hypothesis;
NETGENPlugin_Mesher * _mesher;
};
#endif

View File

@ -0,0 +1,59 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// NETGENPlugin : idl implementation
// File : NETGENPlugin_NETGEN_2D3D_i.hxx
// Author : Michael Sazonov (OCN)
// Module : NETGENPlugin
// $Header$
//
#ifndef _NETGENPlugin_NETGEN_2D3D_I_HXX_
#define _NETGENPlugin_NETGEN_2D3D_I_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include "SMESH_3D_Algo_i.hxx"
#include "NETGENPlugin_NETGEN_2D3D.hxx"
// ======================================================
// NETGEN 3d algorithm
// ======================================================
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D3D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_2D3D,
public virtual SMESH_3D_Algo_i
{
public:
// Constructor
NETGENPlugin_NETGEN_2D3D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~NETGENPlugin_NETGEN_2D3D_i();
// Get implementation
::NETGENPlugin_NETGEN_2D3D* GetImpl();
};
#endif

View File

@ -1,24 +1,22 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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.
//
// 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
//
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPlugin_NETGEN_2D_ONLY.hxx
// Project : SALOME
// Author : Edward AGAPOV (OCC)
@ -26,28 +24,12 @@
#ifndef _NETGENPlugin_NETGEN_2D_ONLY_HXX_
#define _NETGENPlugin_NETGEN_2D_ONLY_HXX_
#include "SMESH_2D_Algo.hxx"
#include "SMESH_Mesh.hxx"
/*#define OCCGEOMETRY
#include <occgeom.hpp>
#include <meshing.hpp>//amv*/
#include <SMESH_Algo.hxx>
#include <SMESH_Mesh.hxx>
class StdMeshers_MaxElementArea;
class StdMeshers_LengthFromEdges;
class StdMeshers_QuadranglePreference;
//class NETGENPlugin_Hypothesis;
/*namespace netgen {
class OCCGeometry;
}*/
/*namespace netgen {
class OCCGeometry;
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*);
extern MeshingParameters mparam;
}*/
//using namespace netgen;
class NETGENPlugin_Hypothesis_2D;
/*!
* \brief Mesher generating 2D elements on a geometrical face taking
@ -70,17 +52,20 @@ public:
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
/*static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
OCCGeometry& geom,
const TSideVector& wires,
SMESH_MesherHelper& helper,
vector< const SMDS_MeshNode* > & nodeVec); //amv*/
virtual void CancelCompute();
virtual double GetProgress() const;
virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap);
protected:
const StdMeshers_MaxElementArea* _hypMaxElementArea;
const StdMeshers_LengthFromEdges* _hypLengthFromEdges;
const StdMeshers_QuadranglePreference* _hypQuadranglePreference;
// const NETGENPlugin_Hypothesis* _hypothesis;
const SMESHDS_Hypothesis* _hypQuadranglePreference;
const NETGENPlugin_Hypothesis_2D* _hypParameters;
double _progressByTic;
};
#endif

View File

@ -0,0 +1,53 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : NETGENPlugin_NETGEN_2D_ONLY_i.cxx
// Author : Edward AGAPOV (OCC)
// Module : SMESH
//
#ifndef _NETGENPlugin_NETGEN_2D_ONLY_I_HXX_
#define _NETGENPlugin_NETGEN_2D_ONLY_I_HXX_
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include "SMESH_2D_Algo_i.hxx"
#include "NETGENPlugin_NETGEN_2D_ONLY.hxx"
// ======================================================
// NETGEN 2D algorithm
// ======================================================
class NETGENPlugin_NETGEN_2D_ONLY_i:
public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_2D_ONLY,
public virtual SMESH_2D_Algo_i
{
public:
// Constructor
NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~NETGENPlugin_NETGEN_2D_ONLY_i();
// Get implementation
::NETGENPlugin_NETGEN_2D_ONLY* GetImpl();
};
#endif

View File

@ -0,0 +1,59 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// NETGENPlugin : idl implementation
// File : NETGENPlugin_NETGEN_2D_i.hxx
// Author : Michael Sazonov (OCN)
// Module : NETGENPlugin
// $Header$
//
#ifndef _NETGENPlugin_NETGEN_2D_I_HXX_
#define _NETGENPlugin_NETGEN_2D_I_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include "SMESH_2D_Algo_i.hxx"
#include "NETGENPlugin_NETGEN_2D.hxx"
// ======================================================
// NETGEN 3d algorithm
// ======================================================
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_2D,
public virtual SMESH_2D_Algo_i
{
public:
// Constructor
NETGENPlugin_NETGEN_2D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~NETGENPlugin_NETGEN_2D_i();
// Get implementation
::NETGENPlugin_NETGEN_2D* GetImpl();
};
#endif

View File

@ -1,46 +1,49 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//=============================================================================
// File : NETGENPlugin_NETGEN_3D.hxx
// Moved here from SMESH_NETGEN_3D.hxx
// Created : lundi 27 Janvier 2003
// Author : Nadir BOUHAMOU (CEA)
// Project : SALOME
// $Header: /home/server/cvs/NETGENPLUGIN/NETGENPLUGIN_SRC/src/NETGENPlugin/NETGENPlugin_NETGEN_3D.hxx,v 1.4.2.1 2008/11/27 14:29:45 abd Exp $
//=============================================================================
//
#ifndef _NETGENPlugin_NETGEN_3D_HXX_
#define _NETGENPlugin_NETGEN_3D_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "NETGENPlugin_Mesher.hxx"
#include "SMESH_3D_Algo.hxx"
#include "SMESH_Mesh.hxx"
#include "StdMeshers_MaxElementVolume.hxx"
#include "SMESH_Exception.hxx"
#include "SMESH_Algo.hxx"
#include "Utils_SALOME_Exception.hxx"
class StdMeshers_ViscousLayers;
class StdMeshers_MaxElementVolume;
class NETGENPlugin_Hypothesis;
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_3D: public SMESH_3D_Algo
{
public:
public:
NETGENPlugin_NETGEN_3D(int hypId, int studyId, SMESH_Gen* gen);
virtual ~NETGENPlugin_NETGEN_3D();
@ -49,15 +52,32 @@ public:
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
const TopoDS_Shape& aShape);
virtual bool Compute(SMESH_Mesh& aMesh,
SMESH_MesherHelper* aHelper);
protected:
virtual void CancelCompute();
virtual double GetProgress() const;
virtual bool Evaluate(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
MapShapeNbElems& aResMap);
protected:
bool compute(SMESH_Mesh& mesh,
SMESH_MesherHelper& helper,
vector< const SMDS_MeshNode* >& nodeVec,
nglib::Ng_Mesh* ngMesh);
double _maxElementVolume;
const NETGENPlugin_Hypothesis * _hypParameters;
const StdMeshers_MaxElementVolume* _hypMaxElementVolume;
const StdMeshers_ViscousLayers* _viscousLayersHyp;
double _progressByTic;
};
#endif

View File

@ -0,0 +1,60 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : NETGENPlugin_NETGEN_3D_i.hxx
// Moved here from SMESH_NETGEN_3D_i.hxx
// Author : Nadir Bouhamou CEA
// Module : SMESH
// $Header$
//
#ifndef _NETGENPlugin_NETGEN_3D_I_HXX_
#define _NETGENPlugin_NETGEN_3D_I_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include "SMESH_3D_Algo_i.hxx"
#include "NETGENPlugin_NETGEN_3D.hxx"
// ======================================================
// NETGEN 3d algorithm
// ======================================================
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_3D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_3D,
public virtual SMESH_3D_Algo_i
{
public:
// Constructor
NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~NETGENPlugin_NETGEN_3D_i();
// Get implementation
::NETGENPlugin_NETGEN_3D* GetImpl();
};
#endif

View File

@ -1,24 +1,22 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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.
//
// 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
//
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_2D.hxx
// Author : Edward AGAPOV
@ -31,11 +29,13 @@
#include "NETGENPlugin_Defs.hxx"
#include "SMESH_Hypothesis.hxx"
#include "SMESH_Exception.hxx"
#include "Utils_SALOME_Exception.hxx"
// Simplified parameters of NETGEN
//
using namespace std;
class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_2D: public SMESH_Hypothesis
{
public:
@ -45,7 +45,7 @@ public:
/*!
* Sets <number of segments> value
*/
void SetNumberOfSegments(int nb) throw (SMESH_Exception);
void SetNumberOfSegments(int nb) throw (SALOME_Exception);
/*!
* Returns <number of segments> value.
* Can be zero in case if LocalLength() has been set
@ -55,7 +55,7 @@ public:
/*!
* Sets <segment length> value
*/
void SetLocalLength(double segmentLength) throw (SMESH_Exception);
void SetLocalLength(double segmentLength) throw (SALOME_Exception);
/*!
* Returns <segment length> value.
* Can be zero in case if NumberOfSegments() has been set
@ -78,9 +78,18 @@ public:
*/
double GetMaxElementArea() const { return _area; }
/*!
* Enables/disables generation of quadrangular faces
*/
void SetAllowQuadrangles(bool toAllow);
/*!
* Returns true if generation of quadrangular faces is enabled
*/
bool GetAllowQuadrangles() const;
// Persistence
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
virtual ostream & SaveTo(ostream & save);
virtual istream & LoadFrom(istream & load);
/*!
* \brief Set parameters by mesh
@ -90,7 +99,7 @@ public:
*/
virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
/*!
/*!
* \brief Initialize my parameter values by default parameters.
* \retval bool - true if parameter values have been successfully defined
*/
@ -99,6 +108,7 @@ public:
private:
int _nbSegments;
double _segmentLength, _area;
bool _allowQuad;
};
#endif

View File

@ -0,0 +1,86 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_2D_i.hxx
// Author : Edward AGAPOV
// Project : SALOME
//=============================================================================
//
#ifndef _NETGENPlugin_SimpleHypothesis_2D_i_HXX_
#define _NETGENPlugin_SimpleHypothesis_2D_i_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include "SMESH_Hypothesis_i.hxx"
class SMESH_Gen;
class NETGENPlugin_SimpleHypothesis_2D;
// Simplified NETGEN parameters (2D case)
class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_2D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D,
public virtual SMESH_Hypothesis_i
{
public:
// Constructor
NETGENPlugin_SimpleHypothesis_2D_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~NETGENPlugin_SimpleHypothesis_2D_i();
void SetNumberOfSegments(CORBA::Short nb) throw ( SALOME::SALOME_Exception );
CORBA::Short GetNumberOfSegments();
void SetLocalLength(CORBA::Double segmentLength);
CORBA::Double GetLocalLength();
void LengthFromEdges();
void SetMaxElementArea(CORBA::Double area);
CORBA::Double GetMaxElementArea();
void SetAllowQuadrangles(CORBA::Boolean toAllow);
CORBA::Boolean GetAllowQuadrangles();
// Get implementation
::NETGENPlugin_SimpleHypothesis_2D* GetImpl() const;
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
public:
// method intended to remove explicit treatment of Netgen hypotheses from
// SMESH_NoteBook to assure backward compatibility after implemeneting
// issue 0021308: Remove hard-coded dependency of the external mesh plugins
virtual int getParamIndex(const TCollection_AsciiString& method, int nbVars) const;
// method used to convert variable parameters stored in an old study
// into myMethod2VarParams. It should return a method name for an index of
// variable parameters. Index is countered from zero
virtual std::string getMethodOfParameter(const int paramIndex, int nbVars) const;
};
#endif

View File

@ -1,24 +1,22 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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.
//
// 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
//
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_3D.hxx
// Author : Edward AGAPOV
@ -31,11 +29,13 @@
#include "NETGENPlugin_Defs.hxx"
#include "NETGENPlugin_SimpleHypothesis_2D.hxx"
#include <SMESH_Exception.hxx>
#include <Utils_SALOME_Exception.hxx>
// Simplified parameters of NETGEN
//
using namespace std;
class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_3D: public NETGENPlugin_SimpleHypothesis_2D
{
public:
@ -48,8 +48,8 @@ public:
double GetMaxElementVolume() const { return _volume; }
// Persistence
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
virtual ostream & SaveTo(ostream & save);
virtual istream & LoadFrom(istream & load);
/*!
* \brief Set parameters by mesh

View File

@ -0,0 +1,64 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// NETGENPlugin : C++ implementation
// File : NETGENPlugin_SimpleHypothesis_3D_i.hxx
// Author : Edward AGAPOV
// Project : SALOME
//=============================================================================
//
#ifndef _NETGENPlugin_SimpleHypothesis_3D_i_HXX_
#define _NETGENPlugin_SimpleHypothesis_3D_i_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "NETGENPlugin_SimpleHypothesis_2D_i.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
class SMESH_Gen;
class NETGENPlugin_SimpleHypothesis_3D;
// Simplified NETGEN parameters (3D case)
class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_3D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D,
public virtual NETGENPlugin_SimpleHypothesis_2D_i
{
public:
// Constructor
NETGENPlugin_SimpleHypothesis_3D_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~NETGENPlugin_SimpleHypothesis_3D_i();
void LengthFromFaces();
void SetMaxElementVolume(CORBA::Double value);
CORBA::Double GetMaxElementVolume();
// Get implementation
::NETGENPlugin_SimpleHypothesis_3D* GetImpl();
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
};
#endif

View File

@ -0,0 +1,174 @@
// Copyright (C) 2010-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef _OBJECTPOOL_HXX_
#define _OBJECTPOOL_HXX_
#include <vector>
//#include <stack>
#include <iostream>
namespace
{
// assure deallocation of memory of a vector
template<class Y> void clearVector(std::vector<Y>& v )
{
std::vector<Y> emptyVec; v.swap( emptyVec );
}
}
template<class X> class ObjectPool
{
private:
std::vector<X*> _chunkList;
std::vector<bool> _freeList;
int _nextFree;
int _maxAvail;
int _chunkSize;
int _maxOccupied;
int _nbHoles;
int getNextFree()
{
// Don't iterate on the _freeList if all the "holes"
// are filled. Go straight to the last occupied ID + 1
if ( _nbHoles == 0 )
return std::min(_maxOccupied + 1, _maxAvail);
for (int i = _nextFree; i < _maxAvail; i++)
if (_freeList[i] == true)
{
return i;
break;
}
return _maxAvail;
}
void checkDelete(int chunkId)
{
int i0 = _chunkSize * chunkId;
int i1 = _chunkSize * (chunkId + 1);
for (int i = i0; i < i1; i++)
if (_freeList[i] == false)
return;
std::cerr << "a chunk to delete" << std::endl;
// compactage des vecteurs un peu lourd, pas necessaire
//X* chunk = _chunkList[chunkId];
//delete [] chunk;
}
public:
ObjectPool(int nblk)
{
_chunkSize = nblk;
_nextFree = 0;
_maxAvail = 0;
_maxOccupied = 0;
_nbHoles = 0;
_chunkList.clear();
_freeList.clear();
}
virtual ~ObjectPool()
{
for (size_t i = 0; i < _chunkList.size(); i++)
delete[] _chunkList[i];
}
X* getNew()
{
X *obj = 0;
_nextFree = getNextFree();
if (_nextFree == _maxAvail)
{
X* newChunk = new X[_chunkSize];
_chunkList.push_back(newChunk);
_freeList.insert(_freeList.end(), _chunkSize, true);
_maxAvail += _chunkSize;
_freeList[_nextFree] = false;
obj = newChunk; // &newChunk[0];
}
else
{
int chunkId = _nextFree / _chunkSize;
int rank = _nextFree - chunkId * _chunkSize;
_freeList[_nextFree] = false;
obj = _chunkList[chunkId] + rank; // &_chunkList[chunkId][rank];
}
if (_nextFree < _maxOccupied)
{
_nbHoles-=1;
}
else
{
_maxOccupied = _nextFree;
}
//obj->init();
return obj;
}
void destroy(X* obj)
{
long adrobj = (long) (obj);
for (size_t i = 0; i < _chunkList.size(); i++)
{
X* chunk = _chunkList[i];
long adrmin = (long) (chunk);
if (adrobj < adrmin)
continue;
long adrmax = (long) (chunk + _chunkSize);
if (adrobj >= adrmax)
continue;
int rank = (adrobj - adrmin) / sizeof(X);
int toFree = i * _chunkSize + rank;
_freeList[toFree] = true;
if (toFree < _nextFree)
_nextFree = toFree;
if (toFree < _maxOccupied)
_nbHoles += 1;
//obj->clean();
//checkDelete(i); compactage non fait
break;
}
}
void clear()
{
_nextFree = 0;
_maxAvail = 0;
_maxOccupied = 0;
_nbHoles = 0;
for (size_t i = 0; i < _chunkList.size(); i++)
delete[] _chunkList[i];
clearVector( _chunkList );
clearVector( _freeList );
}
// void destroy(int toFree)
// {
// // no control 0<= toFree < _freeList.size()
// _freeList[toFree] = true;
// if (toFree < _nextFree)
// _nextFree = toFree;
// }
};
#endif

34
src/3rdParty/salomesmesh/inc/OpUtil.hxx vendored Normal file
View File

@ -0,0 +1,34 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// SALOME Utils : general SALOME's definitions and tools
// File : OpUtil.hxx
// Module : SALOME
//
#ifndef _OPUTIL_HXX
#define _OPUTIL_HXX
#include "SALOME_Utils.hxx"
UTILS_EXPORT const char *duplicate(const char * const);
#endif

View File

@ -1,24 +1,22 @@
// MEFISTO : library to compute 2D triangulation from segmented boundaries
//
// Copyright (C) 2006 Laboratoire J.-L. Lions UPMC Paris
// Copyright (C) 2006-2015 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 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, or (at your option) any later version.
//
// 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.
// 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.ann.jussieu.fr/~perronne or email Perronnet@ann.jussieu.fr
// or email Hecht@ann.jussieu.fr
// 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 : Rn.h
// Module : SMESH
@ -172,8 +170,8 @@ public:
bool DansPave( R3 & xyzMin, R3 & xyzMax )
{ return xyzMin.x<=x && x<=xyzMax.x &&
xyzMin.y<=y && y<=xyzMax.y &&
xyzMin.z<=z && z<=xyzMax.z; }
xyzMin.y<=y && y<=xyzMax.y &&
xyzMin.z<=z && z<=xyzMax.z; }
};
//la classe R4

View File

@ -0,0 +1,68 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// SALOME SALOMEDS : data structure of SALOME and sources of Salome data server
// File : SALOMEDS.hxx
// Author : Sergey ANIKIN
// Module : SALOME
// $Header$
//
#ifndef SALOMEDS_HeaderFile
#define SALOMEDS_HeaderFile
#include "SALOMEDS_Defines.hxx"
#include <Utils_Mutex.hxx>
namespace SALOMEDS
{
// PAL8065: san -- Implementation of convenient locker based on simple recursive
// mutex for POSIX platforms.
// This class is to protect SALOMEDS CORBA methods which deal with OCC calls from
// parallel access by several threads
// To protect some method, an instance of Locker class should be created
// on the stack at the beginning of guarded code:
//
// Locker lock;
//
class SALOMEDS_EXPORT Locker : public Utils_Locker
{
public:
Locker();
virtual ~Locker();
private:
static Utils_Mutex MutexDS;
friend void lock();
friend void unlock();
};
// Convenient functions to lock/unlock the global SALOMEDS mutex temporarily.
// In particular, "unlock-dosomething-lock" scheme should be used, when some non-SALOMEDS
// CORBA interface is called (component's engine), to avoid deadlocks in case of
// indirect recursion.
void lock();
void unlock();
};
#endif

View File

@ -0,0 +1,122 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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 : SALOMEDS_Tool.hxx
// Created : Mon Oct 21 16:24:50 2002
// Author : Sergey RUIN
// Project : SALOME
// Module : SALOMEDS
//
#ifndef __SALOMEDS_Tool_H__
#define __SALOMEDS_Tool_H__
#include <string>
#include <list>
#include <SALOMEDS.hxx>
// IDL headers
#ifdef WIN32
# if defined TOOLSDS_EXPORTS
# define TOOLSDS_EXPORT __declspec( dllexport )
# else
# define TOOLSDS_EXPORT __declspec( dllimport )
# endif
#else
# define TOOLSDS_EXPORT
#endif
class TOOLSDS_EXPORT SALOMEDS_Tool
{
public:
// Returns the unique temporary directory, that is defined in SALOME_TMP_DIR if this variable is set
// otherwise return /tmp/something/ for Unix or c:\something\ for WIN32
static std::string GetTmpDir();
// Removes files which are in <theDirectory>, the files for deletion are listed in <theFiles>
// if <IsDirDeleted> is true <theDirectory> is also deleted if it is empty
static void RemoveTemporaryFiles(const std::string& theDirectory,
const SALOMEDS::ListOfFileNames& theFiles,
const bool IsDirDeleted);
// Converts files listed in <theFiles> which are in <theFromDirectory> into a byte sequence TMPFile
static SALOMEDS::TMPFile* PutFilesToStream(const std::string& theFromDirectory,
const SALOMEDS::ListOfFileNames& theFiles,
const int theNamesOnly = 0);
// Converts files listed in <theFiles> which will be named as pointed in the <theFileNames> into a byte sequence TMPFile
static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
const SALOMEDS::ListOfFileNames& theFileNames);
// Converts a byte sequence <theStream> to files and places them in <theToDirectory>
static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
const std::string& theToDirectory,
const int theNamesOnly = 0);
// Returns the name by the path
// for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1"
static std::string GetNameFromPath(const std::string& thePath);
// Returns the directory by the path
// for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "/tmp/aaa"
static std::string GetDirFromPath(const std::string& thePath);
// Retrieves specified flaf from "AttributeFlags" attribute
static bool GetFlag( const int theFlag,
SALOMEDS::Study_var theStudy,
SALOMEDS::SObject_var theObj );
// Sets/Unsets specified flaf from "AttributeFlags" attribute
static bool SetFlag( const int theFlag,
SALOMEDS::Study_var theStudy,
const std::string& theEntry,
const bool theValue );
// Get all children of object. If theObj is null all objects of study are returned
static void GetAllChildren( SALOMEDS::Study_var theStudy,
SALOMEDS::SObject_var theObj,
std::list<SALOMEDS::SObject_var>& theList );
};
#endif

View File

@ -0,0 +1,40 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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 : SALOMEDS_Defines.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
//
#ifndef _SALOMEDS_Defines_HXX_
#define _SALOMEDS_Defines_HXX_
#ifdef WIN32
# if defined SALOMEDS_EXPORTS || defined SalomeDS_EXPORTS
# define SALOMEDS_EXPORT __declspec( dllexport )
# else
# define SALOMEDS_EXPORT __declspec( dllimport )
# endif
#else
# define SALOMEDS_EXPORT
#endif
#endif

View File

@ -0,0 +1,40 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA)
// File : SALOME_Basics.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
// $Header$
//
#ifndef _SALOME_BASICS_HXX_
#define _SALOME_BASICS_HXX_
#ifdef WIN32
# if defined BASICS_EXPORTS || defined SALOMEBasics_EXPORTS
# define BASICS_EXPORT __declspec( dllexport )
# else
# define BASICS_EXPORT __declspec( dllimport )
# endif
#else
# define BASICS_EXPORT
#endif
#endif //_SALOME_BASICS_HXX_

40
src/3rdParty/salomesmesh/inc/SALOME_Utils.hxx vendored Executable file
View File

@ -0,0 +1,40 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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 : SALOME_Utils.hxx
// Author : Alexander A. BORODIN
// Module : SALOME
//
#ifndef _SALOME_UTILS_HXX_
#define _SALOME_UTILS_HXX_
#ifdef WIN32
# if defined UTILS_EXPORTS || defined OpUtil_EXPORTS
# define UTILS_EXPORT __declspec( dllexport )
# else
# define UTILS_EXPORT __declspec( dllimport )
# endif
#else
# define UTILS_EXPORT
#endif
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDSAbs_ElementType.hxx
// Module : SMESH
@ -30,33 +31,40 @@
/// Type (node, edge, face or volume) of elements
///////////////////////////////////////////////////////////////////////////////
enum SMDSAbs_ElementType
{
SMDSAbs_All,
SMDSAbs_Node,
SMDSAbs_Edge,
SMDSAbs_Face,
SMDSAbs_Volume,
SMDSAbs_NbElementTypes
};
{
SMDSAbs_All,
SMDSAbs_Node,
SMDSAbs_Edge,
SMDSAbs_Face,
SMDSAbs_Volume,
SMDSAbs_0DElement,
SMDSAbs_Ball,
SMDSAbs_NbElementTypes
};
/*! enumeration for element geometry type */
enum SMDSAbs_GeometryType
{
// 0D element
SMDSGeom_POINT,
// 1D element
SMDSGeom_EDGE,
// 2D element
SMDSGeom_TRIANGLE,
SMDSGeom_QUADRANGLE,
SMDSGeom_POLYGON,
// 3D element
SMDSGeom_TETRA,
SMDSGeom_PYRAMID,
SMDSGeom_HEXA,
SMDSGeom_PENTA,
SMDSGeom_POLYHEDRA,
};
{
// 0D element
SMDSGeom_POINT,
// 1D element
SMDSGeom_EDGE,
// 2D element
SMDSGeom_TRIANGLE,
SMDSGeom_QUADRANGLE,
SMDSGeom_POLYGON,
// 3D element
SMDSGeom_TETRA,
SMDSGeom_PYRAMID,
SMDSGeom_HEXA,
SMDSGeom_PENTA,
SMDSGeom_HEXAGONAL_PRISM,
SMDSGeom_POLYHEDRA,
// Discrete elements
SMDSGeom_BALL,
//
SMDSGeom_NONE
};
enum SMDSAbs_ElementOrder {
@ -65,4 +73,36 @@ enum SMDSAbs_ElementOrder {
ORDER_QUADRATIC /*! entities of 2nd order */
};
/*!
* Enumeration of entity type used in mesh info array
*/
enum SMDSAbs_EntityType {
SMDSEntity_Node,
SMDSEntity_0D,
SMDSEntity_Edge,
SMDSEntity_Quad_Edge,
SMDSEntity_Triangle,
SMDSEntity_Quad_Triangle,
SMDSEntity_BiQuad_Triangle,
SMDSEntity_Quadrangle,
SMDSEntity_Quad_Quadrangle,
SMDSEntity_BiQuad_Quadrangle,
SMDSEntity_Polygon,
SMDSEntity_Quad_Polygon,
SMDSEntity_Tetra,
SMDSEntity_Quad_Tetra,
SMDSEntity_Pyramid,
SMDSEntity_Quad_Pyramid,
SMDSEntity_Hexa,
SMDSEntity_Quad_Hexa,
SMDSEntity_TriQuad_Hexa,
SMDSEntity_Penta,
SMDSEntity_Quad_Penta,
SMDSEntity_Hexagonal_Prism,
SMDSEntity_Polyhedra,
SMDSEntity_Quad_Polyhedra,
SMDSEntity_Ball,
SMDSEntity_Last
};
#endif

View File

@ -0,0 +1,60 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_BallElement.hxx
// Module : SMESH
//
#ifndef _SMDS_BallElement_HeaderFile
#define _SMDS_BallElement_HeaderFile
#include "SMESH_SMDS.hxx"
#include "SMDS_MeshCell.hxx"
#include <iostream>
class SMDS_EXPORT SMDS_BallElement: public SMDS_MeshCell
{
public:
SMDS_BallElement();
SMDS_BallElement (const SMDS_MeshNode * node, double diameter);
SMDS_BallElement(vtkIdType nodeId, double diameter, SMDS_Mesh* mesh);
void init(vtkIdType nodeId, double diameter, SMDS_Mesh* mesh);
double GetDiameter() const;
void SetDiameter(double diameter);
bool ChangeNode (const SMDS_MeshNode * node);
virtual bool ChangeNodes(const SMDS_MeshNode* nodes[],
const int nbNodes) { return ChangeNode( nodes[0] ); }
virtual void Print (std::ostream & OS) const;
virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Ball; }
virtual vtkIdType GetVtkType() const { return VTK_POLY_VERTEX; }
virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Ball; }
virtual SMDSAbs_GeometryType GetGeomType() const { return SMDSGeom_BALL; }
virtual int NbNodes() const { return 1; }
virtual int NbEdges() const { return 0; }
virtual int NbFaces() const { return 0; }
virtual const SMDS_MeshNode* GetNode (const int ind) const;
protected:
SMDS_ElemIteratorPtr elementsIterator (SMDSAbs_ElementType type) const;
};
#endif

View File

@ -0,0 +1,381 @@
// Copyright (C) 2010-2015 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, or (at your option) any later version.
//
// 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: SMDS_Downward.hxx
// Created: Jun 3, 2010
// Author: prascle
#ifndef SMDS_DOWNWARD_HXX_
#define SMDS_DOWNWARD_HXX_
#include "SMDS_UnstructuredGrid.hxx"
#include <vector>
#include <set>
typedef struct
{
int nodeIds[8]; //!< max number of nodes in a face or edge: quad quad = 8
int nbNodes;
unsigned char vtkType;
} ElemByNodesType; // TODO resize for polyhedrons
typedef struct
{
ElemByNodesType elems[6]; //!< max number of faces in a volume or edges in a face : hexahedron = 6
int nbElems;
} ListElemByNodesType; // TODO resize for polyhedrons
class SMDS_EXPORT DownIdType
{
public:
DownIdType(int a, unsigned char b) :
cellId(a), cellType(b)
{
}
int cellId;
unsigned char cellType;
};
struct DownIdCompare
{
bool operator ()(const DownIdType e1, const DownIdType e2) const
{
if (e1.cellId == e2.cellId)
return (e1.cellType < e2.cellType);
else
return (e1.cellId < e2.cellId);
}
};
class SMDS_EXPORT SMDS_Downward
{
friend class SMDS_UnstructuredGrid;
friend class SMDS_Down2D;
friend class SMDS_Down3D;
public:
virtual int getNumberOfDownCells(int cellId);
virtual const int* getDownCells(int cellId);
virtual const unsigned char* getDownTypes(int cellId);
virtual int getNumberOfUpCells(int cellId) = 0;
virtual const int* getUpCells(int cellId) = 0;
virtual const unsigned char* getUpTypes(int cellId) = 0;
virtual void getNodeIds(int cellId, std::set<int>& nodeSet) = 0;
virtual int getNodes(int cellId, int* nodevec) {return 0; }
virtual void getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes) {};
int getVtkCellId(int cellId)
{
return _vtkCellIds[cellId];
}
int getMaxId()
{
return _maxId;
}
static int getCellDimension(unsigned char cellType);
protected:
SMDS_Downward(SMDS_UnstructuredGrid *grid, int nbDownCells);
~SMDS_Downward();
int addCell(int vtkId = -1);
virtual void initCell(int cellId);
virtual void allocate(int nbElems) = 0;
virtual void compactStorage() = 0;
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType); //!< Id's are downward connectivity id's
virtual void addUpCell(int cellId, int upCellId, unsigned char aType); //!< Id's are downward connectivity id's
virtual int getNodeSet(int cellId, int* nodeSet);
SMDS_UnstructuredGrid* _grid;
int _maxId;
int _nbDownCells; //!< the same number for all cells of a derived class
std::vector<int> _cellIds; //!< growing size: all the down cell id's, size = _maxId * _nbDownCells
std::vector<int> _vtkCellIds; //!< growing size: size = _maxId, either vtkId or -1
std::vector<unsigned char> _cellTypes; //!< fixed size: the same vector for all cells of a derived class
static std::vector<int> _cellDimension; //!< conversion table: type --> dimension
};
class SMDS_EXPORT SMDS_Down1D: public SMDS_Downward
{
friend class SMDS_UnstructuredGrid;
public:
virtual int getNumberOfUpCells(int cellId);
virtual const int* getUpCells(int cellId);
virtual const unsigned char* getUpTypes(int cellId);
virtual void getNodeIds(int cellId, std::set<int>& nodeSet);
virtual int getNodes(int cellId, int* nodevec) { return getNodeSet(cellId, nodevec); }
protected:
SMDS_Down1D(SMDS_UnstructuredGrid *grid, int nbDownCells);
~SMDS_Down1D();
virtual void initCell(int cellId);
virtual void allocate(int nbElems);
virtual void compactStorage();
virtual void addUpCell(int cellId, int upCellId, unsigned char aType); //!< Id's are downward connectivity id's
virtual int getNodeSet(int cellId, int* nodeSet);
void setNodes(int cellId, int vtkId);
void setNodes(int cellId, const int* nodeIds);
int computeVtkCells(int cellId, std::vector<int>& vtkIds);
int computeVtkCells(int* pts, std::vector<int>& vtkIds);
int computeFaces(int cellId, int* vtkIds, int nbcells, int* downFaces, unsigned char* downTypes);
int computeFaces(int* pts, int* vtkIds, int nbcells, int* downFaces, unsigned char* downTypes);
std::vector<std::vector<int> > _upCellIdsVector; //!< the number of faces sharing an edge is not known
std::vector<std::vector<unsigned char> > _upCellTypesVector; //!< the number of faces sharing an edge is not known
std::vector<int> _upCellIds; //!< compacted storage after connectivity calculation
std::vector<unsigned char> _upCellTypes; //!< compacted storage after connectivity calculation
std::vector<int> _upCellIndex; //!< compacted storage after connectivity calculation
};
class SMDS_EXPORT SMDS_Down2D: public SMDS_Downward
{
friend class SMDS_UnstructuredGrid;
friend class SMDS_Down1D;
public:
virtual int getNumberOfUpCells(int cellId);
virtual const int* getUpCells(int cellId);
virtual const unsigned char* getUpTypes(int cellId);
virtual void getNodeIds(int cellId, std::set<int>& nodeSet);
protected:
SMDS_Down2D(SMDS_UnstructuredGrid *grid, int nbDownCells);
~SMDS_Down2D();
virtual void allocate(int nbElems);
virtual void compactStorage();
virtual void addUpCell(int cellId, int upCellId, unsigned char aType);
virtual void computeEdgesWithNodes(int cellId, ListElemByNodesType& facesWithNodes) = 0;
virtual int getNodeSet(int cellId, int* nodeSet);
int computeVolumeIds(int cellId, int* ids);
int computeVolumeIds(ElemByNodesType& faceByNodes, int* ids);
int computeVolumeIdsFromNodesFace(int* nodes, int nbNodes, int* ids);
void setTempNodes(int cellId, int vtkId);
void setTempNodes(int cellId, ElemByNodesType& faceByNodes);
bool isInFace(int cellId, int *pts, int npts);
int FindEdgeByNodes(int cellId, ElemByNodesType& edgeByNodes);
std::vector<int> _upCellIds; //!< 2 volumes max. per face
std::vector<unsigned char> _upCellTypes; //!< 2 volume types per face
std::vector<int> _tempNodes; //!< temporary storage of nodes, until downward connectivity completion
int _nbNodes; //!< number of nodes in a face
};
class SMDS_EXPORT SMDS_Down3D: public SMDS_Downward
{
friend class SMDS_UnstructuredGrid;
public:
virtual int getNumberOfUpCells(int cellId);
virtual const int* getUpCells(int cellId);
virtual const unsigned char* getUpTypes(int cellId);
virtual void getNodeIds(int cellId, std::set<int>& nodeSet);
protected:
SMDS_Down3D(SMDS_UnstructuredGrid *grid, int nbDownCells);
~SMDS_Down3D();
virtual void allocate(int nbElems);
virtual void compactStorage();
virtual void computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes) = 0;
int FindFaceByNodes(int cellId, ElemByNodesType& faceByNodes);
};
class SMDS_EXPORT SMDS_DownEdge: public SMDS_Down1D
{
friend class SMDS_UnstructuredGrid;
public:
protected:
SMDS_DownEdge(SMDS_UnstructuredGrid *grid);
~SMDS_DownEdge();
};
class SMDS_EXPORT SMDS_DownQuadEdge: public SMDS_Down1D
{
friend class SMDS_UnstructuredGrid;
public:
protected:
SMDS_DownQuadEdge(SMDS_UnstructuredGrid *grid);
~SMDS_DownQuadEdge();
};
class SMDS_EXPORT SMDS_DownTriangle: public SMDS_Down2D
{
friend class SMDS_UnstructuredGrid;
public:
protected:
SMDS_DownTriangle(SMDS_UnstructuredGrid *grid);
~SMDS_DownTriangle();
virtual void computeEdgesWithNodes(int cellId, ListElemByNodesType& edgesWithNodes);
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType); //!< Id's are downward connectivity id's
};
class SMDS_EXPORT SMDS_DownQuadTriangle: public SMDS_Down2D
{
friend class SMDS_UnstructuredGrid;
public:
protected:
SMDS_DownQuadTriangle(SMDS_UnstructuredGrid *grid);
~SMDS_DownQuadTriangle();
virtual void computeEdgesWithNodes(int cellId, ListElemByNodesType& edgesWithNodes);
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType); //!< Id's are downward connectivity id's
};
class SMDS_EXPORT SMDS_DownQuadrangle: public SMDS_Down2D
{
friend class SMDS_UnstructuredGrid;
public:
protected:
SMDS_DownQuadrangle(SMDS_UnstructuredGrid *grid);
~SMDS_DownQuadrangle();
virtual void computeEdgesWithNodes(int cellId, ListElemByNodesType& edgesWithNodes);
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType); //!< Id's are downward connectivity id's
};
class SMDS_EXPORT SMDS_DownQuadQuadrangle: public SMDS_Down2D
{
friend class SMDS_UnstructuredGrid;
public:
protected:
SMDS_DownQuadQuadrangle(SMDS_UnstructuredGrid *grid);
~SMDS_DownQuadQuadrangle();
virtual void computeEdgesWithNodes(int cellId, ListElemByNodesType& edgesWithNodes);
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType); //!< Id's are downward connectivity id's
};
//class SMDS_DownPolygon: public SMDS_Down2D
//{
//public:
// SMDS_DownPolygon(SMDS_UnstructuredGrid *grid);
// ~SMDS_DownPolygon();
//protected:
//};
//class SMDS_DownQuadPolygon: public SMDS_Down2D
//{
//public:
// SMDS_DownQuadPolygon(SMDS_UnstructuredGrid *grid);
// ~SMDS_DownQuadPolygon();
//protected:
//};
class SMDS_EXPORT SMDS_DownTetra: public SMDS_Down3D
{
friend class SMDS_UnstructuredGrid;
public:
virtual void getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes);
protected:
SMDS_DownTetra(SMDS_UnstructuredGrid *grid);
~SMDS_DownTetra();
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType);
virtual void computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes);
};
class SMDS_EXPORT SMDS_DownQuadTetra: public SMDS_Down3D
{
friend class SMDS_UnstructuredGrid;
public:
virtual void getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes);
protected:
SMDS_DownQuadTetra(SMDS_UnstructuredGrid *grid);
~SMDS_DownQuadTetra();
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType);
virtual void computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes);
};
class SMDS_EXPORT SMDS_DownPyramid: public SMDS_Down3D
{
friend class SMDS_UnstructuredGrid;
public:
virtual void getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes);
protected:
SMDS_DownPyramid(SMDS_UnstructuredGrid *grid);
~SMDS_DownPyramid();
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType);
virtual void computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes);
};
class SMDS_EXPORT SMDS_DownQuadPyramid: public SMDS_Down3D
{
friend class SMDS_UnstructuredGrid;
public:
virtual void getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes);
protected:
SMDS_DownQuadPyramid(SMDS_UnstructuredGrid *grid);
~SMDS_DownQuadPyramid();
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType);
virtual void computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes);
};
class SMDS_EXPORT SMDS_DownPenta: public SMDS_Down3D
{
friend class SMDS_UnstructuredGrid;
public:
virtual void getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes);
protected:
SMDS_DownPenta(SMDS_UnstructuredGrid *grid);
~SMDS_DownPenta();
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType);
virtual void computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes);
};
class SMDS_EXPORT SMDS_DownQuadPenta: public SMDS_Down3D
{
friend class SMDS_UnstructuredGrid;
public:
virtual void getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes);
protected:
SMDS_DownQuadPenta(SMDS_UnstructuredGrid *grid);
~SMDS_DownQuadPenta();
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType);
virtual void computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes);
};
class SMDS_EXPORT SMDS_DownHexa: public SMDS_Down3D
{
friend class SMDS_UnstructuredGrid;
public:
virtual void getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes);
protected:
SMDS_DownHexa(SMDS_UnstructuredGrid *grid);
~SMDS_DownHexa();
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType);
virtual void computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes);
};
class SMDS_EXPORT SMDS_DownQuadHexa: public SMDS_Down3D
{
friend class SMDS_UnstructuredGrid;
public:
virtual void getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes);
protected:
SMDS_DownQuadHexa(SMDS_UnstructuredGrid *grid);
~SMDS_DownQuadHexa();
virtual void addDownCell(int cellId, int lowCellId, unsigned char aType);
virtual void computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes);
};
//class SMDS_DownPolyhedra: public SMDS_Down3D
//{
//public:
// SMDS_DownPolyhedra(SMDS_UnstructuredGrid *grid);
// ~SMDS_DownPolyhedra();
//protected:
//};
//class SMDS_DownQuadPolyhedra: public SMDS_Down3D
//{
//public:
// SMDS_DownQuadPolyhedra(SMDS_UnstructuredGrid *grid);
// ~SMDS_DownQuadPolyhedra();
//protected:
//};
#endif /* SMDS_DOWNWARD_HXX_ */

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_EdgePosition.hxx
// Module : SMESH
@ -34,15 +35,14 @@ class SMDS_EXPORT SMDS_EdgePosition:public SMDS_Position
{
public:
SMDS_EdgePosition(const int aEdgeId=0, const double aUParam=0);
const virtual double * Coords() const;
SMDS_TypeOfPosition GetTypeOfPosition() const;
void SetUParameter(double aUparam);
double GetUParameter() const;
SMDS_EdgePosition(const double aUParam=0);
SMDS_TypeOfPosition GetTypeOfPosition() const;
void SetUParameter(double aUparam);
double GetUParameter() const;
private:
double myUParameter;
double myUParameter;
};

View File

@ -1,29 +1,30 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshElement.hxx
// Module : SMESH
// Created: 12.01.05 18:02:52
// Author: Michael Sazonov
// Created: 12.01.05 18:02:52
// Author: Michael Sazonov
//
#ifndef SMDS_ElemIterator_HeaderFile
#define SMDS_ElemIterator_HeaderFile
@ -33,6 +34,7 @@
class SMDS_MeshElement;
class SMDS_MeshNode;
class SMDS_Mesh0DElement;
class SMDS_MeshEdge;
class SMDS_MeshFace;
class SMDS_MeshVolume;
@ -43,6 +45,9 @@ typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshElement *> > SMDS_ElemIte
typedef SMDS_Iterator<const SMDS_MeshNode *> SMDS_NodeIterator;
typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshNode *> > SMDS_NodeIteratorPtr;
typedef SMDS_Iterator<const SMDS_Mesh0DElement *> SMDS_0DElementIterator;
typedef boost::shared_ptr<SMDS_Iterator<const SMDS_Mesh0DElement *> > SMDS_0DElementIteratorPtr;
typedef SMDS_Iterator<const SMDS_MeshEdge *> SMDS_EdgeIterator;
typedef boost::shared_ptr<SMDS_Iterator<const SMDS_MeshEdge *> > SMDS_EdgeIteratorPtr;

View File

@ -1,25 +1,26 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// SMESH SMDS : implementation of Salome mesh data structure
//
#ifndef _SMDS_FaceOfEdges_HeaderFile
#define _SMDS_FaceOfEdges_HeaderFile
@ -36,35 +37,30 @@
class SMDS_EXPORT SMDS_FaceOfEdges:public SMDS_MeshFace
{
public:
void Print(std::ostream & OS) const;
SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
void Print(std::ostream & OS) const;
SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
const SMDS_MeshEdge* edge2,
const SMDS_MeshEdge* edge3);
SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
SMDS_FaceOfEdges(const SMDS_MeshEdge* edge1,
const SMDS_MeshEdge* edge2,
const SMDS_MeshEdge* edge3,
const SMDS_MeshEdge* edge4);
SMDSAbs_ElementType GetType() const;
int NbNodes() const;
int NbEdges() const;
int NbFaces() const;
// friend bool operator<(const SMDS_FaceOfEdges& e1, const SMDS_FaceOfEdges& e2);
/*!
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
virtual SMDSAbs_ElementType GetType() const;
virtual SMDSAbs_EntityType GetEntityType() const;
virtual SMDSAbs_GeometryType GetGeomType() const;
virtual bool ChangeNodes(const SMDS_MeshNode* nodes[],
const int nbNodes) {return false;}
virtual int NbNodes() const;
virtual int NbEdges() const;
virtual int NbFaces() const;
virtual const SMDS_MeshNode* GetNode(const int ind) const;
protected:
SMDS_ElemIteratorPtr
elementsIterator(SMDSAbs_ElementType type) const;
virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const;
private:
const SMDS_MeshEdge* myEdges[4];
const SMDS_MeshEdge* myEdges[4];
int myNbEdges;
};

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifndef _SMDS_FaceOfNodes_HeaderFile
@ -35,19 +36,19 @@
class SMDS_EXPORT SMDS_FaceOfNodes:public SMDS_MeshFace
{
public:
void Print(std::ostream & OS) const;
SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
void Print(std::ostream & OS) const;
SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
const SMDS_MeshNode* node2,
const SMDS_MeshNode* node3);
SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
const SMDS_MeshNode* node2,
const SMDS_MeshNode* node3,
const SMDS_MeshNode* node4);
bool ChangeNodes(const SMDS_MeshNode* nodes[],
const int nbNodes);
int NbEdges() const;
int NbFaces() const;
int NbNodes() const;
int NbEdges() const;
int NbFaces() const;
int NbNodes() const;
/*!
* \brief Return node by its index
@ -56,12 +57,15 @@ class SMDS_EXPORT SMDS_FaceOfNodes:public SMDS_MeshFace
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
virtual SMDSAbs_EntityType GetEntityType() const;
virtual SMDSAbs_GeometryType GetGeomType() const;
protected:
SMDS_ElemIteratorPtr
elementsIterator(SMDSAbs_ElementType type) const;
SMDS_ElemIteratorPtr
elementsIterator(SMDSAbs_ElementType type) const;
private:
const SMDS_MeshNode* myNodes[4];
const SMDS_MeshNode* myNodes[4];
int myNbNodes;
};

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_FacePosition.hxx
// Module : SMESH
@ -34,17 +35,16 @@ class SMDS_EXPORT SMDS_FacePosition:public SMDS_Position
{
public:
SMDS_FacePosition(int aFaceId=0, double aUParam=0,
double aVParam=0);
const virtual double * Coords() const;
SMDS_TypeOfPosition GetTypeOfPosition() const;
void SetUParameter(double aUparam);
void SetVParameter(double aVparam);
double GetUParameter() const;
double GetVParameter() const;
SMDS_FacePosition(double aUParam=0, double aVParam=0);
SMDS_TypeOfPosition GetTypeOfPosition() const;
void SetUParameter(double aUparam);
void SetVParameter(double aVparam);
void SetParameters(double aUparam, double aVparam);
double GetUParameter() const;
double GetVParameter() const;
private:
double myUParameter;
double myVParameter;
double myUParameter;
double myVParameter;
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifndef _SMDS_Iterator_HeaderFile
@ -33,18 +34,18 @@
template<typename VALUE> class SMDS_Iterator
{
public:
/// Return true if and only if there are other object in this iterator
virtual bool more()=0;
/// Return true if and only if there are other object in this iterator
virtual bool more()=0;
/// Return the current object and step to the next one
virtual VALUE next()=0;
/// Return the current object and step to the next one
virtual VALUE next()=0;
/// Delete the current element and step to the next one
virtual void remove(){}
/// Delete the current element and step to the next one
virtual void remove(){}
/// Provide virtual destructor just for case if some derived iterator
/// Provide virtual destructor just for case if some derived iterator
/// must have a destructor
virtual ~SMDS_Iterator(){}
virtual ~SMDS_Iterator(){}
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
//
#include "SMESH_SMDS.hxx"
@ -35,22 +36,22 @@ class SMDS_EXPORT SMDS_IteratorOfElements:public SMDS_ElemIterator
/// Create an iterator which look for elements of type type which are linked
/// to the element element. it is the iterator to get connectivity of element
//////////////////////////////////////////////////////////////////////////////
SMDS_IteratorOfElements(const SMDS_MeshElement * element,
SMDS_IteratorOfElements(const SMDS_MeshElement * element,
SMDSAbs_ElementType type,
const SMDS_ElemIteratorPtr& it);
bool more();
const SMDS_MeshElement * next();
bool more();
const SMDS_MeshElement * next();
private:
SMDS_ElemIteratorPtr t2Iterator;
SMDS_ElemIteratorPtr t1Iterator;
SMDSAbs_ElementType myType;
const SMDS_MeshElement * myProxyElement;
const SMDS_MeshElement * myElement;
bool myReverseIteration;
SMDS_ElemIteratorPtr t2Iterator;
SMDS_ElemIteratorPtr t1Iterator;
SMDSAbs_ElementType myType;
const SMDS_MeshElement * myProxyElement;
const SMDS_MeshElement * myElement;
bool myReverseIteration;
std::set<const SMDS_MeshElement*> alreadyReturnedElements;
std::set<const SMDS_MeshElement*>::iterator itAlreadyReturned;
bool subMore();
const SMDS_MeshElement * subNext();
std::set<const SMDS_MeshElement*> alreadyReturnedElements;
std::set<const SMDS_MeshElement*>::iterator itAlreadyReturned;
bool subMore();
const SMDS_MeshElement * subNext();
};

View File

@ -0,0 +1,67 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_IteratorOnIterators.hxx
// Author : Edward AGAPOV (eap)
//
#ifndef SMDS_IteratorOnIterators_HeaderFile
#define SMDS_IteratorOnIterators_HeaderFile
#include "SMDS_Iterator.hxx"
///////////////////////////////////////////////////////////////////////////////
/// SMDS_Iterator iterating over all elements provided by other iterators
///
/// Other iterators must implement SMDS_Iterator iterface and
/// must be provided within a stl-like container
/// BE CAREFUL: iterator pointed value is static_cast'ed to VALUE
///////////////////////////////////////////////////////////////////////////////
template<typename VALUE,
typename CONTAINER_OF_ITERATORS >
class SMDS_IteratorOnIterators : public SMDS_Iterator<VALUE>
{
protected:
CONTAINER_OF_ITERATORS _iterators;
typename CONTAINER_OF_ITERATORS::iterator _beg, _end;
public:
SMDS_IteratorOnIterators(const CONTAINER_OF_ITERATORS& iterators):
_iterators( iterators ), _beg( _iterators.begin()), _end(_iterators.end() )
{
while ( _beg != _end && !(*_beg)->more()) ++_beg;
}
/// Return true iff there are other object in this iterator
virtual bool more() { return _beg != _end && (*_beg)->more(); }
/// Return the current object and step to the next one
virtual VALUE next()
{
VALUE __v = (VALUE)(*_beg)->next();
while ( _beg != _end && !(*_beg)->more())
++_beg;
return __v;
}
};
#endif

View File

@ -0,0 +1,68 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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 : SMDS_LinearEdge.hxx
// Module : SMESH
//
#ifndef _SMDS_LinearEdge_HeaderFile
#define _SMDS_LinearEdge_HeaderFile
#include "SMESH_SMDS.hxx"
#include "SMDS_MeshEdge.hxx"
#include <iostream>
class SMDS_EXPORT SMDS_LinearEdge: public SMDS_MeshEdge
{
public:
SMDS_LinearEdge(const SMDS_MeshNode * node1, const SMDS_MeshNode * node2);
bool ChangeNodes(const SMDS_MeshNode * node1, const SMDS_MeshNode * node2);
void Print(std::ostream & OS) const;
virtual SMDSAbs_EntityType GetEntityType() const
{
return SMDSEntity_Edge;
}
virtual bool ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes)
{
return false;
}
int NbNodes() const;
int NbEdges() const;
friend bool operator<(const SMDS_LinearEdge& e1, const SMDS_LinearEdge& e2);
/*!
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
protected:
SMDS_ElemIteratorPtr
elementsIterator(SMDSAbs_ElementType type) const;
protected:
const SMDS_MeshNode* myNodes[3];
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_Mesh.hxx
// Module : SMESH
@ -29,72 +30,112 @@
#include "SMESH_SMDS.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMDS_MeshCell.hxx"
#include "SMDS_Mesh0DElement.hxx"
#include "SMDS_MeshEdge.hxx"
#include "SMDS_MeshFace.hxx"
#include "SMDS_MeshVolume.hxx"
#include "SMDS_MeshNodeIDFactory.hxx"
#include "SMDS_MeshElementIDFactory.hxx"
#include "SMDS_MeshInfo.hxx"
#include "SMDS_ElemIterator.hxx"
#include <NCollection_Map.hxx>
#include "SMDS_VolumeOfNodes.hxx"
#include "SMDS_VtkEdge.hxx"
#include "SMDS_VtkFace.hxx"
#include "SMDS_VtkVolume.hxx"
#include "ObjectPool.hxx"
#include "SMDS_UnstructuredGrid.hxx"
#include "SMDS_BallElement.hxx"
#include <boost/shared_ptr.hpp>
#include <set>
#include <list>
#include <vector>
#include <vtkSystemIncludes.h>
#include <cassert>
class SMDS_EXPORT SMDS_Mesh:public SMDS_MeshObject{
#include "Utils_SALOME_Exception.hxx"
#define MYASSERT(val) if (!(val)) throw SALOME_Exception(LOCALIZED("assertion not verified"));
class SMDS_EXPORT SMDS_Mesh : public SMDS_MeshObject
{
public:
friend class SMDS_MeshIDFactory;
friend class SMDS_MeshNodeIDFactory;
friend class SMDS_MeshElementIDFactory;
friend class SMDS_MeshVolumeVtkNodes;
friend class SMDS_MeshNode;
SMDS_Mesh();
SMDS_NodeIteratorPtr nodesIterator() const;
SMDS_EdgeIteratorPtr edgesIterator() const;
SMDS_FaceIteratorPtr facesIterator() const;
SMDS_VolumeIteratorPtr volumesIterator() const;
SMDS_ElemIteratorPtr elementsIterator() const;
//! to retreive this SMDS_Mesh instance from its elements (index stored in SMDS_Elements)
static std::vector<SMDS_Mesh*> _meshList;
//! actual nodes coordinates, cells definition and reverse connectivity are stored in a vtkUnstructuredGrid
inline SMDS_UnstructuredGrid* getGrid() {return myGrid; }
inline int getMeshId() {return myMeshId; }
virtual SMDS_NodeIteratorPtr nodesIterator (bool idInceasingOrder=false) const;
virtual SMDS_EdgeIteratorPtr edgesIterator (bool idInceasingOrder=false) const;
virtual SMDS_FaceIteratorPtr facesIterator (bool idInceasingOrder=false) const;
virtual SMDS_VolumeIteratorPtr volumesIterator (bool idInceasingOrder=false) const;
virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type=SMDSAbs_All) const;
virtual SMDS_ElemIteratorPtr elementGeomIterator(SMDSAbs_GeometryType type) const;
virtual SMDS_ElemIteratorPtr elementEntityIterator(SMDSAbs_EntityType type) const;
SMDSAbs_ElementType GetElementType( const int id, const bool iselem ) const;
SMDS_Mesh *AddSubMesh();
virtual SMDS_MeshNode* AddNodeWithID(double x, double y, double z, int ID);
virtual SMDS_MeshNode* AddNode(double x, double y, double z);
virtual SMDS_MeshNode* AddNode (double x, double y, double z);
virtual SMDS_Mesh0DElement* Add0DElementWithID(int n, int ID);
virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * n, int ID);
virtual SMDS_Mesh0DElement* Add0DElement (const SMDS_MeshNode * n);
virtual SMDS_BallElement* AddBallWithID(int n, double diameter, int ID);
virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, int ID);
virtual SMDS_BallElement* AddBall (const SMDS_MeshNode * n, double diameter);
virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int ID);
virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
int ID);
const SMDS_MeshNode * n2,
int ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2);
const SMDS_MeshNode * n2);
// 2d order edge with 3 nodes: n12 - node between n1 and n2
virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID);
virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12,
int ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12);
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3);
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshEdge * e1,
const SMDS_MeshEdge * e2,
@ -116,100 +157,141 @@ public:
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
int n12,int n23,int n31, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31);
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31);
// 2d order triangle of 7 nodes
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
int n12,int n23,int n31, int nCenter, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter,
int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * nCenter);
// 2d order quadrangle
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
int n12,int n23,int n34,int n41, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41);
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41);
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
int n12,int n23,int n34,int n41, int nCenter, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter,
int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * nCenter);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
int n5, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
int n5, int n6, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
int n5, int n6, int n7, int n8, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshFace * f1,
const SMDS_MeshFace * f2,
@ -244,25 +326,55 @@ public:
const SMDS_MeshFace * f5,
const SMDS_MeshFace * f6);
// hexagonal prism
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6,
int n7, int n8, int n9, int n10, int n11, int n12,
int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
const SMDS_MeshNode * n9,
const SMDS_MeshNode * n10,
const SMDS_MeshNode * n11,
const SMDS_MeshNode * n12,
int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
const SMDS_MeshNode * n9,
const SMDS_MeshNode * n10,
const SMDS_MeshNode * n11,
const SMDS_MeshNode * n12);
// 2d order tetrahedron of 10 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
int n12,int n23,int n31,
int n14,int n24,int n34, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n24,
const SMDS_MeshNode * n34,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n24,
const SMDS_MeshNode * n34,
int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
@ -276,24 +388,24 @@ public:
int n15,int n25,int n35,int n45,
int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * n15,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n35,
const SMDS_MeshNode * n45,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * n15,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n35,
const SMDS_MeshNode * n45,
int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
@ -311,27 +423,27 @@ public:
int n14,int n25,int n36,
int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * n45,
const SMDS_MeshNode * n56,
const SMDS_MeshNode * n64,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n36,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
const SMDS_MeshNode * n45,
const SMDS_MeshNode * n56,
const SMDS_MeshNode * n64,
const SMDS_MeshNode * n14,
const SMDS_MeshNode * n25,
const SMDS_MeshNode * n36,
int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
@ -350,34 +462,34 @@ public:
int n15,int n26,int n37,int n48,
int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * n56,
const SMDS_MeshNode * n67,
const SMDS_MeshNode * n78,
const SMDS_MeshNode * n85,
const SMDS_MeshNode * n15,
const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48,
int ID);
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * n56,
const SMDS_MeshNode * n67,
const SMDS_MeshNode * n78,
const SMDS_MeshNode * n85,
const SMDS_MeshNode * n15,
const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48,
int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
@ -391,34 +503,119 @@ public:
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48);
virtual SMDS_MeshFace* AddPolygonalFaceWithID (std::vector<int> nodes_ids,
const int ID);
// 2d oreder Hexahedrons with 27 nodes
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
int n5, int n6, int n7, int n8,
int n12,int n23,int n34,int n41,
int n56,int n67,int n78,int n85,
int n15,int n26,int n37,int n48,
int n1234,int n1256,int n2367,int n3478,
int n1458,int n5678,int nCenter,
int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * n56,
const SMDS_MeshNode * n67,
const SMDS_MeshNode * n78,
const SMDS_MeshNode * n85,
const SMDS_MeshNode * n15,
const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48,
const SMDS_MeshNode * n1234,
const SMDS_MeshNode * n1256,
const SMDS_MeshNode * n2367,
const SMDS_MeshNode * n3478,
const SMDS_MeshNode * n1458,
const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter,
int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n3,
const SMDS_MeshNode * n4,
const SMDS_MeshNode * n5,
const SMDS_MeshNode * n6,
const SMDS_MeshNode * n7,
const SMDS_MeshNode * n8,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41,
const SMDS_MeshNode * n56,
const SMDS_MeshNode * n67,
const SMDS_MeshNode * n78,
const SMDS_MeshNode * n85,
const SMDS_MeshNode * n15,
const SMDS_MeshNode * n26,
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48,
const SMDS_MeshNode * n1234,
const SMDS_MeshNode * n1256,
const SMDS_MeshNode * n2367,
const SMDS_MeshNode * n3478,
const SMDS_MeshNode * n1458,
const SMDS_MeshNode * n5678,
const SMDS_MeshNode * nCenter);
virtual SMDS_MeshFace* AddPolygonalFaceWithID (std::vector<const SMDS_MeshNode*> nodes,
const int ID);
virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<int> & nodes_ids,
const int ID);
virtual SMDS_MeshFace* AddPolygonalFace (std::vector<const SMDS_MeshNode*> nodes);
virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nodes,
const int ID);
virtual SMDS_MeshFace* AddPolygonalFace (const std::vector<const SMDS_MeshNode*> & nodes);
virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<int> & nodes_ids,
const int ID);
virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector<const SMDS_MeshNode*> & nodes,
const int ID);
virtual SMDS_MeshFace* AddQuadPolygonalFace(const std::vector<const SMDS_MeshNode*> & nodes);
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(std::vector<int> nodes_ids,
std::vector<int> quantities,
const int ID);
(const std::vector<int> & nodes_ids,
const std::vector<int> & quantities,
const int ID);
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(std::vector<const SMDS_MeshNode*> nodes,
std::vector<int> quantities,
const int ID);
(const std::vector<const SMDS_MeshNode*> & nodes,
const std::vector<int> & quantities,
const int ID);
virtual SMDS_MeshVolume* AddPolyhedralVolume
(std::vector<const SMDS_MeshNode*> nodes,
std::vector<int> quantities);
(const std::vector<const SMDS_MeshNode*> & nodes,
const std::vector<int> & quantities);
virtual SMDS_MeshVolume* AddVolumeFromVtkIds(const std::vector<vtkIdType>& vtkNodeIds);
virtual SMDS_MeshVolume* AddVolumeFromVtkIdsWithID(const std::vector<vtkIdType>& vtkNodeIds,
const int ID);
virtual SMDS_MeshFace* AddFaceFromVtkIds(const std::vector<vtkIdType>& vtkNodeIds);
virtual SMDS_MeshFace* AddFaceFromVtkIdsWithID(const std::vector<vtkIdType>& vtkNodeIds,
const int ID);
virtual void MoveNode(const SMDS_MeshNode *n, double x, double y, double z);
virtual void RemoveElement(const SMDS_MeshElement * elem,
std::list<const SMDS_MeshElement *>& removedElems,
std::list<const SMDS_MeshElement *>& removedNodes,
bool removenodes = false);
const bool removenodes = false);
virtual void RemoveElement(const SMDS_MeshElement * elem, bool removenodes = false);
virtual void RemoveNode(const SMDS_MeshNode * node);
virtual void Remove0DElement(const SMDS_Mesh0DElement * elem0d);
virtual void RemoveEdge(const SMDS_MeshEdge * edge);
virtual void RemoveFace(const SMDS_MeshFace * face);
virtual void RemoveVolume(const SMDS_MeshVolume * volume);
@ -443,8 +640,12 @@ public:
virtual void Renumber (const bool isNodes, const int startID = 1, const int deltaID = 1);
// Renumber all nodes or elements.
virtual void compactMesh();
const SMDS_MeshNode *FindNode(int idnode) const;
const SMDS_MeshNode *FindNodeVtk(int idnode) const;
const SMDS_Mesh0DElement* Find0DElement(int idnode) const;
const SMDS_BallElement* FindBall(int idnode) const;
const SMDS_MeshEdge *FindEdge(int idnode1, int idnode2) const;
const SMDS_MeshEdge *FindEdge(int idnode1, int idnode2, int idnode3) const;
const SMDS_MeshFace *FindFace(int idnode1, int idnode2, int idnode3) const;
@ -454,6 +655,8 @@ public:
const SMDS_MeshFace *FindFace(int idnode1, int idnode2, int idnode3, int idnode4,
int idnode5, int idnode6, int idnode7, int idnode8) const;
const SMDS_MeshElement *FindElement(int IDelem) const;
static const SMDS_Mesh0DElement* Find0DElement(const SMDS_MeshNode * n);
static const SMDS_BallElement* FindBall(const SMDS_MeshNode * n);
static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2);
static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1,
@ -481,8 +684,11 @@ public:
const SMDS_MeshNode *n7,
const SMDS_MeshNode *n8);
const SMDS_MeshFace *FindFace(std::vector<int> nodes_ids) const;
static const SMDS_MeshFace* FindFace(std::vector<const SMDS_MeshNode *> nodes);
const SMDS_MeshFace *FindFace(const std::vector<int>& nodes_ids) const;
static const SMDS_MeshFace* FindFace(const std::vector<const SMDS_MeshNode *>& nodes);
static const SMDS_MeshElement* FindElement(const std::vector<const SMDS_MeshNode *>& nodes,
const SMDSAbs_ElementType type=SMDSAbs_All,
const bool noMedium=true);
/*!
* \brief Raise an exception if free memory (ram+swap) too low
@ -498,19 +704,23 @@ public:
const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; }
int NbNodes() const;
int NbEdges() const;
int NbFaces() const;
int NbVolumes() const;
int NbSubMesh() const;
virtual int NbNodes() const;
virtual int Nb0DElements() const;
virtual int NbBalls() const;
virtual int NbEdges() const;
virtual int NbFaces() const;
virtual int NbVolumes() const;
virtual int NbSubMesh() const;
void DumpNodes() const;
void Dump0DElements() const;
void DumpEdges() const;
void DumpFaces() const;
void DumpVolumes() const;
void DebugStats() const;
SMDS_Mesh *boundaryFaces();
SMDS_Mesh *boundaryEdges();
virtual ~SMDS_Mesh();
bool hasConstructionEdges();
bool hasConstructionFaces();
bool hasInverseElements();
@ -526,52 +736,127 @@ public:
*/
bool Contains (const SMDS_MeshElement* elem) const;
typedef NCollection_Map<SMDS_MeshNode *> SetOfNodes;
typedef NCollection_Map<SMDS_MeshEdge *> SetOfEdges;
typedef NCollection_Map<SMDS_MeshFace *> SetOfFaces;
typedef NCollection_Map<SMDS_MeshVolume *> SetOfVolumes;
typedef std::vector<SMDS_MeshNode *> SetOfNodes;
typedef std::vector<SMDS_MeshCell *> SetOfCells;
private:
void updateNodeMinMax();
void updateBoundingBox();
double getMaxDim();
int fromVtkToSmds(int vtkid);
void incrementNodesCapacity(int nbNodes);
void incrementCellsCapacity(int nbCells);
void adjustStructure();
void dumpGrid(string ficdump="dumpGrid");
static int chunkSize;
//! low level modification: add, change or remove node or element
inline void setMyModified() { this->myModified = true; }
void Modified();
unsigned long GetMTime() const;
bool isCompacted();
protected:
SMDS_Mesh(SMDS_Mesh * parent);
SMDS_MeshFace * createTriangle(const SMDS_MeshNode * node1,
const SMDS_MeshNode * node2,
const SMDS_MeshNode * node3);
const SMDS_MeshNode * node2,
const SMDS_MeshNode * node3,
int ID);
SMDS_MeshFace * createQuadrangle(const SMDS_MeshNode * node1,
const SMDS_MeshNode * node2,
const SMDS_MeshNode * node3,
const SMDS_MeshNode * node4);
const SMDS_MeshNode * node2,
const SMDS_MeshNode * node3,
const SMDS_MeshNode * node4,
int ID);
SMDS_MeshEdge* FindEdgeOrCreate(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2);
const SMDS_MeshNode * n2);
SMDS_MeshFace* FindFaceOrCreate(const SMDS_MeshNode *n1,
const SMDS_MeshNode *n2,
const SMDS_MeshNode *n3);
const SMDS_MeshNode *n2,
const SMDS_MeshNode *n3);
SMDS_MeshFace* FindFaceOrCreate(const SMDS_MeshNode *n1,
const SMDS_MeshNode *n2,
const SMDS_MeshNode *n3,
const SMDS_MeshNode *n4);
const SMDS_MeshNode *n2,
const SMDS_MeshNode *n3,
const SMDS_MeshNode *n4);
bool registerElement(int ID, SMDS_MeshElement * element);
void addChildrenWithNodes(std::set<const SMDS_MeshElement*>& setOfChildren,
const SMDS_MeshElement * element,
std::set<const SMDS_MeshElement*>& nodes);
const SMDS_MeshElement * element,
std::set<const SMDS_MeshElement*>& nodes);
inline void adjustmyCellsCapacity(int ID)
{
assert(ID >= 0);
myElementIDFactory->adjustMaxId(ID);
if (ID >= myCells.size())
myCells.resize(ID+SMDS_Mesh::chunkSize,0);
}
inline void adjustBoundingBox(double x, double y, double z)
{
if (x > xmax) xmax = x;
else if (x < xmin) xmin = x;
if (y > ymax) ymax = y;
else if (y < ymin) ymin = y;
if (z > zmax) zmax = z;
else if (z < zmin) zmin = z;
}
// Fields PRIVATE
//! index of this SMDS_mesh in the static vector<SMDS_Mesh*> _meshList
int myMeshId;
//! actual nodes coordinates, cells definition and reverse connectivity are stored in a vtkUnstructuredGrid
SMDS_UnstructuredGrid* myGrid;
//! Small objects like SMDS_MeshNode are allocated by chunks to limit memory costs of new
ObjectPool<SMDS_MeshNode>* myNodePool;
//! Small objects like SMDS_VtkVolume are allocated by chunks to limit memory costs of new
ObjectPool<SMDS_VtkVolume>* myVolumePool;
ObjectPool<SMDS_VtkFace>* myFacePool;
ObjectPool<SMDS_VtkEdge>* myEdgePool;
ObjectPool<SMDS_BallElement>* myBallPool;
//! SMDS_MeshNodes refer to vtk nodes (vtk id = index in myNodes),store reference to this mesh, and sub-shape
SetOfNodes myNodes;
SetOfEdges myEdges;
SetOfFaces myFaces;
SetOfVolumes myVolumes;
//! SMDS_MeshCells refer to vtk cells (vtk id != index in myCells),store reference to this mesh, and sub-shape
SetOfCells myCells;
//! a buffer to speed up elements addition by excluding some memory allocation
std::vector<vtkIdType> myNodeIds;
//! for cells only: index = ID in vtkUnstructuredGrid, value = ID for SMDS users
std::vector<int> myCellIdVtkToSmds;
SMDS_Mesh * myParent;
std::list<SMDS_Mesh *> myChildren;
SMDS_MeshElementIDFactory *myNodeIDFactory;
SMDS_MeshNodeIDFactory *myNodeIDFactory;
SMDS_MeshElementIDFactory *myElementIDFactory;
SMDS_MeshInfo myInfo;
//! use a counter to keep track of modifications
unsigned long myModifTime, myCompactTime;
int myNodeMin;
int myNodeMax;
bool myHasConstructionEdges;
bool myHasConstructionFaces;
bool myHasInverseElements;
//! any add, remove or change of node or cell
bool myModified;
double xmin;
double xmax;
double ymin;
double ymax;
double zmin;
double zmax;
};

View File

@ -0,0 +1,55 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_Mesh0DElement.hxx
// Module : SMESH
//
#ifndef _SMDS_Mesh0DElement_HeaderFile
#define _SMDS_Mesh0DElement_HeaderFile
#include "SMESH_SMDS.hxx"
#include "SMDS_MeshCell.hxx"
#include <iostream>
class SMDS_EXPORT SMDS_Mesh0DElement: public SMDS_MeshCell
{
public:
SMDS_Mesh0DElement (const SMDS_MeshNode * node);
virtual bool ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes);
virtual void Print (std::ostream & OS) const;
virtual SMDSAbs_ElementType GetType() const;
virtual vtkIdType GetVtkType() const;
virtual SMDSAbs_EntityType GetEntityType() const {return SMDSEntity_0D;}
virtual SMDSAbs_GeometryType GetGeomType() const { return SMDSGeom_POINT; }
virtual const SMDS_MeshNode* GetNode (const int ind) const;
virtual int NbNodes() const;
virtual int NbEdges() const;
protected:
virtual SMDS_ElemIteratorPtr elementsIterator (SMDSAbs_ElementType type) const;
protected:
const SMDS_MeshNode* myNode;
};
#endif

View File

@ -0,0 +1,83 @@
// Copyright (C) 2010-2015 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, or (at your option) any later version.
//
// 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
//
#ifndef _SMDS_MESHCELL_HXX_
#define _SMDS_MESHCELL_HXX_
#include "SMDS_MeshElement.hxx"
/*!
* \brief Base class for all cells
*/
class SMDS_EXPORT SMDS_MeshCell: public SMDS_MeshElement
{
public:
SMDS_MeshCell();
virtual ~SMDS_MeshCell();
virtual bool ChangeNodes(const SMDS_MeshNode* nodes[], const int nbNodes)= 0;
virtual bool vtkOrder(const SMDS_MeshNode* nodes[], const int nbNodes) {return true; }
static VTKCellType toVtkType (SMDSAbs_EntityType vtkType);
static SMDSAbs_EntityType toSmdsType(VTKCellType vtkType);
static SMDSAbs_ElementType toSmdsType(SMDSAbs_GeometryType geomType);
static SMDSAbs_ElementType toSmdsType(SMDSAbs_EntityType entityType);
static const std::vector<int>& toVtkOrder(VTKCellType vtkType);
static const std::vector<int>& toVtkOrder(SMDSAbs_EntityType smdsType);
static const std::vector<int>& fromVtkOrder(VTKCellType vtkType);
static const std::vector<int>& fromVtkOrder(SMDSAbs_EntityType smdsType);
static const std::vector<int>& reverseSmdsOrder(SMDSAbs_EntityType smdsType,
const size_t nbNodes=0);
static const std::vector<int>& interlacedSmdsOrder(SMDSAbs_EntityType smdsType,
const size_t nbNodes=0);
template< class VECT > // interlacedIDs[i] = smdsIDs[ indices[ i ]]
static void applyInterlace( const std::vector<int>& interlace, VECT & data)
{
if ( interlace.empty() ) return;
VECT tmpData( data.size() );
for ( size_t i = 0; i < data.size(); ++i )
tmpData[i] = data[ interlace[i] ];
data.swap( tmpData );
}
template< class VECT > // interlacedIDs[ indices[ i ]] = smdsIDs[i]
static void applyInterlaceRev( const std::vector<int>& interlace, VECT & data)
{
if ( interlace.empty() ) return;
VECT tmpData( data.size() );
for ( size_t i = 0; i < data.size(); ++i )
tmpData[ interlace[i] ] = data[i];
data.swap( tmpData );
}
static int nbCells;
protected:
inline void exchange(const SMDS_MeshNode* nodes[],int a, int b)
{
const SMDS_MeshNode* noda = nodes[a];
nodes[a] = nodes[b];
nodes[b] = noda;
}
};
#endif

View File

@ -1,24 +1,22 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2010-2015 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, or (at your option) any later version.
//
// 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.
//
// 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
//
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshEdge.hxx
// Module : SMESH
@ -28,37 +26,14 @@
#include "SMESH_SMDS.hxx"
#include "SMDS_MeshElement.hxx"
#include <iostream>
#include "SMDS_MeshCell.hxx"
class SMDS_EXPORT SMDS_MeshEdge:public SMDS_MeshElement
class SMDS_EXPORT SMDS_MeshEdge: public SMDS_MeshCell
{
public:
SMDS_MeshEdge(const SMDS_MeshNode * node1,
const SMDS_MeshNode * node2);
bool ChangeNodes(const SMDS_MeshNode * node1,
const SMDS_MeshNode * node2);
void Print(std::ostream & OS) const;
SMDSAbs_ElementType GetType() const;
int NbNodes() const;
int NbEdges() const;
friend bool operator<(const SMDS_MeshEdge& e1, const SMDS_MeshEdge& e2);
/*!
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
*/
virtual const SMDS_MeshNode* GetNode(const int ind) const;
protected:
SMDS_ElemIteratorPtr
elementsIterator(SMDSAbs_ElementType type) const;
protected:
const SMDS_MeshNode* myNodes[3];
public:
virtual SMDSAbs_ElementType GetType() const;
virtual vtkIdType GetVtkType() const;
virtual SMDSAbs_GeometryType GetGeomType() const { return SMDSGeom_EDGE; }
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshElement.hxx
// Module : SMESH
@ -32,13 +33,22 @@
#include "SMDS_MeshObject.hxx"
#include "SMDS_ElemIterator.hxx"
#include "SMDS_MeshElementIDFactory.hxx"
#include "SMDS_StdIterator.hxx"
#include <vector>
#include <iostream>
#include <vtkType.h>
#include <vtkCellType.h>
//typedef unsigned short UShortType;
typedef short ShortType;
typedef int LongType;
class SMDS_MeshNode;
class SMDS_MeshEdge;
class SMDS_MeshFace;
class SMDS_Mesh;
// ============================================================
/*!
@ -46,6 +56,7 @@ class SMDS_MeshFace;
*/
// ============================================================
class SMDS_EXPORT SMDS_MeshElement:public SMDS_MeshObject
{
public:
@ -54,21 +65,39 @@ public:
SMDS_ElemIteratorPtr edgesIterator() const;
SMDS_ElemIteratorPtr facesIterator() const;
virtual SMDS_ElemIteratorPtr elementsIterator(SMDSAbs_ElementType type) const;
virtual SMDS_ElemIteratorPtr interlacedNodesElemIterator() const;
virtual SMDS_NodeIteratorPtr nodeIterator() const;
virtual SMDS_NodeIteratorPtr interlacedNodesIterator() const;
virtual SMDS_NodeIteratorPtr nodesIteratorToUNV() const;
// std-like iteration on nodes
typedef SMDS_StdIterator< const SMDS_MeshNode*, SMDS_ElemIteratorPtr > iterator;
iterator begin_nodes() const { return iterator( nodesIterator() ); }
iterator end_nodes() const { return iterator(); }
virtual int NbNodes() const;
virtual int NbEdges() const;
virtual int NbFaces() const;
int GetID() const;
inline int GetID() const { return myID; }
///Return the type of the current element
virtual SMDSAbs_ElementType GetType() const = 0;
virtual bool IsPoly() const { return false; };
virtual SMDSAbs_EntityType GetEntityType() const = 0;
virtual SMDSAbs_GeometryType GetGeomType() const = 0;
virtual vtkIdType GetVtkType() const = 0;
virtual bool IsPoly() const { return false; }
virtual bool IsQuadratic() const;
virtual bool IsMediumNode(const SMDS_MeshNode* node) const;
virtual int NbCornerNodes() const;
friend SMDS_EXPORT std::ostream & operator <<(std::ostream & OS, const SMDS_MeshElement *);
friend SMDS_EXPORT bool SMDS_MeshElementIDFactory::BindID(int ID,SMDS_MeshElement*elem);
friend SMDS_EXPORT bool SMDS_MeshElementIDFactory::BindID(int ID,SMDS_MeshElement* elem);
friend class SMDS_Mesh;
friend class SMESHDS_Mesh;
friend class SMESHDS_SubMesh;
friend class SMDS_MeshElementIDFactory;
// ===========================
// Access to nodes by index
@ -112,22 +141,80 @@ public:
* \param node - the node to check
* \retval int - node index within the element, -1 if not found
*/
int GetNodeIndex( const SMDS_MeshNode* node ) const;
virtual int GetNodeIndex( const SMDS_MeshNode* node ) const;
inline ShortType getMeshId() const { return myMeshId; }
inline LongType getshapeId() const { return myShapeId; }
inline int getIdInShape() const { return myIdInShape; }
inline int getVtkId() const { return myVtkID; }
/*!
* \brief Filters of elements, to be used with SMDS_SetIterator
*/
struct Filter
{
virtual bool operator()(const SMDS_MeshElement* e) const = 0;
virtual ~Filter() {}
};
struct NonNullFilter: public Filter
{
bool operator()(const SMDS_MeshElement* e) const { return e; }
};
struct TypeFilter : public Filter
{
SMDSAbs_ElementType _type;
TypeFilter( SMDSAbs_ElementType t = SMDSAbs_NbElementTypes ):_type(t) {}
bool operator()(const SMDS_MeshElement* e) const { return e && e->GetType() == _type; }
};
struct EntityFilter : public Filter
{
SMDSAbs_EntityType _type;
EntityFilter( SMDSAbs_EntityType t = SMDSEntity_Last ):_type(t) {}
bool operator()(const SMDS_MeshElement* e) const { return e && e->GetEntityType() == _type; }
};
struct GeomFilter : public Filter
{
SMDSAbs_GeometryType _type;
GeomFilter( SMDSAbs_GeometryType t = SMDSGeom_NONE ):_type(t) {}
bool operator()(const SMDS_MeshElement* e) const { return e && e->GetGeomType() == _type; }
};
protected:
inline void setId(int id) {myID = id; }
inline void setShapeId(LongType shapeId) {myShapeId = shapeId; }
inline void setIdInShape(int id) { myIdInShape = id; }
inline void setVtkId(int vtkId) { myVtkID = vtkId; }
SMDS_MeshElement(int ID=-1);
SMDS_MeshElement(int id, ShortType meshId, LongType shapeId = 0);
virtual void init(int id = -1, ShortType meshId = -1, LongType shapeId = 0);
virtual void Print(std::ostream & OS) const;
private:
//! Element index in vector SMDS_Mesh::myNodes or SMDS_Mesh::myCells
int myID;
//! index in vtkUnstructuredGrid
int myVtkID;
//! SMDS_Mesh identification in SMESH
ShortType myMeshId;
//! SubShape and SubMesh identification in SMESHDS
LongType myShapeId;
//! Element index in SMESHDS_SubMesh vector
int myIdInShape;
};
// ============================================================
/*!
* \brief Comparator of elements by ID for usage in std containers
*/
// ============================================================
struct TIDTypeCompare {
bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const
{ return e1->GetType() == e2->GetType() ? e1->GetID() < e2->GetID() : e1->GetType() < e2->GetType(); }
};
// WARNING: this comparator makes impossible to store both nodes and elements in the same set
// because there are nodes and elements with the same ID. Use TIDTypeCompare for such containers.
struct TIDCompare {
bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const
{ return e1->GetID() < e2->GetID(); }

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshElementIDFactory.hxx
// Module : SMESH
@ -28,28 +29,28 @@
#include "SMESH_SMDS.hxx"
#include "SMDS_MeshIDFactory.hxx"
#include "SMDS_ElemIterator.hxx"
#include "SMDS_MeshNodeIDFactory.hxx"
#include <NCollection_DataMap.hxx>
#include <vector>
class SMDS_MeshElement;
class SMDS_Mesh;
typedef NCollection_DataMap<int, SMDS_MeshElement *> SMDS_IdElementMap;
class SMDS_EXPORT SMDS_MeshElementIDFactory:public SMDS_MeshIDFactory
class SMDS_EXPORT SMDS_MeshElementIDFactory:public SMDS_MeshNodeIDFactory
{
public:
friend class SMDS_Mesh;
SMDS_MeshElementIDFactory();
bool BindID(int ID, SMDS_MeshElement * elem);
int SetInVtkGrid(SMDS_MeshElement * elem);
SMDS_MeshElement * MeshElement(int ID);
virtual int GetFreeID();
virtual void ReleaseID(int ID);
int GetMaxID() const;
int GetMinID() const;
virtual void ReleaseID(int ID, int vtkId = -1);
SMDS_ElemIteratorPtr elementsIterator() const;
virtual void Clear();
private:
protected:
void updateMinMax() const;
void updateMinMax(int id) const
{
@ -57,9 +58,6 @@ private:
if (id < myMin) myMin = id;
}
SMDS_IdElementMap myIDElements;
mutable int myMin, myMax;
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshFace.hxx
// Module : SMESH
@ -28,12 +29,13 @@
#include "SMESH_SMDS.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshCell.hxx"
class SMDS_EXPORT SMDS_MeshFace:public SMDS_MeshElement
class SMDS_EXPORT SMDS_MeshFace:public SMDS_MeshCell
{
public:
SMDSAbs_ElementType GetType() const;
SMDSAbs_ElementType GetType() const;
virtual vtkIdType GetVtkType() const;
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshGroup.hxx
// Module : SMESH
@ -34,27 +35,28 @@
class SMDS_EXPORT SMDS_MeshGroup:public SMDS_MeshObject
{
public:
SMDS_MeshGroup(const SMDS_Mesh * theMesh,
SMDS_MeshGroup(const SMDS_Mesh * theMesh,
const SMDSAbs_ElementType theType = SMDSAbs_All);
const SMDS_MeshGroup * AddSubGroup
const SMDS_MeshGroup * AddSubGroup
(const SMDSAbs_ElementType theType = SMDSAbs_All);
virtual bool RemoveSubGroup(const SMDS_MeshGroup* theGroup);
virtual bool RemoveFromParent();
virtual bool RemoveSubGroup(const SMDS_MeshGroup* theGroup);
virtual bool RemoveFromParent();
const SMDS_Mesh* GetMesh() const { return myMesh; }
void SetType (const SMDSAbs_ElementType theType);
void Clear();
void Add(const SMDS_MeshElement * theElem);
bool Remove(const SMDS_MeshElement * theElem);
bool IsEmpty() const { return myElements.empty(); }
int Extent() const { return myElements.size(); }
bool Add(const SMDS_MeshElement * theElem);
bool Remove(const SMDS_MeshElement * theElem);
bool IsEmpty() const { return myElements.empty(); }
int Extent() const { return myElements.size(); }
int Tic() const { return myTic; }
int SubGroupsNb() const { return myChildren.size(); }
int SubGroupsNb() const { return myChildren.size(); }
SMDSAbs_ElementType GetType() const { return myType; }
bool Contains(const SMDS_MeshElement * theElem) const;
bool Contains(const SMDS_MeshElement * theElem) const;
void InitIterator() const
{ const_cast<TIterator&>(myIterator) = myElements.begin(); }
@ -73,18 +75,19 @@ class SMDS_EXPORT SMDS_MeshGroup:public SMDS_MeshObject
{ return *(const_cast<TGroupIterator&>(myGroupIterator))++; }
private:
SMDS_MeshGroup(SMDS_MeshGroup* theParent,
SMDS_MeshGroup(SMDS_MeshGroup* theParent,
const SMDSAbs_ElementType theType = SMDSAbs_All);
typedef std::set<const SMDS_MeshElement *>::const_iterator TIterator;
typedef std::list<const SMDS_MeshGroup *>::const_iterator TGroupIterator;
const SMDS_Mesh * myMesh;
SMDSAbs_ElementType myType;
std::set<const SMDS_MeshElement *> myElements;
SMDS_MeshGroup * myParent;
std::list<const SMDS_MeshGroup*> myChildren;
const SMDS_Mesh * myMesh;
SMDSAbs_ElementType myType;
std::set<const SMDS_MeshElement*> myElements; /* - not sorted by ID because it */
SMDS_MeshGroup * myParent; /* can contain deleted elements */
std::list<const SMDS_MeshGroup*> myChildren;
TIterator myIterator;
TGroupIterator myGroupIterator;
int myTic; // to track changes
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshIDFactory.hxx
// Module : SMESH
@ -31,18 +32,25 @@
#include "SMDS_MeshObject.hxx"
#include <set>
class SMDS_Mesh;
class SMDS_EXPORT SMDS_MeshIDFactory:public SMDS_MeshObject
{
public:
virtual int GetFreeID();
virtual void ReleaseID(int ID);
int GetFreeID();
virtual void ReleaseID(int ID, int vtkId = -1);
virtual void Clear();
protected:
SMDS_MeshIDFactory();
int myMaxID;
std::set<int> myPoolOfID;
void SetMesh(SMDS_Mesh *mesh);
SMDS_Mesh* GetMesh();
inline bool isPoolIdEmpty() { return myPoolOfID.empty(); };
virtual void emptyPool(int maxId);
inline void adjustMaxId(int ID) { if (ID > myMaxID) myMaxID = ID;};
protected:
SMDS_MeshIDFactory();
int myMaxID;
std::set<int> myPoolOfID;
SMDS_Mesh *myMesh;
};
#endif

View File

@ -1,24 +1,22 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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.
//
// 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
//
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SMDS_MeshInfo.hxx
// Created : Mon Sep 24 18:32:41 2007
// Author : Edward AGAPOV (eap)
@ -26,6 +24,7 @@
#ifndef SMDS_MeshInfo_HeaderFile
#define SMDS_MeshInfo_HeaderFile
#include <vector>
using namespace std;
#include "SMESH_SMDS.hxx"
@ -37,30 +36,48 @@ class SMDS_EXPORT SMDS_MeshInfo
public:
inline SMDS_MeshInfo();
inline SMDS_MeshInfo& operator=(const SMDS_MeshInfo& other);
inline void Clear();
int NbNodes() const { return myNbNodes; }
inline int NbElements(SMDSAbs_ElementType type=SMDSAbs_All) const;
inline int NbElements(SMDSAbs_EntityType type) const { return NbEntities(type); }
inline int NbElements(SMDSAbs_GeometryType type) const { return NbElementsOfGeom(type); }
inline int NbEntities(SMDSAbs_EntityType type) const;
inline int NbElementsOfGeom(SMDSAbs_GeometryType geom) const;
int NbNodes() const { return myNbNodes; }
int Nb0DElements() const { return myNb0DElements; }
int NbBalls() const { return myNbBalls; }
inline int NbEdges (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbFaces (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbTriangles (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbPolygons() const { return myNbPolygons; }
int NbBiQuadTriangles() const { return myNbBiQuadTriangles; }
int NbBiQuadQuadrangles() const { return myNbBiQuadQuadrangles; }
inline int NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbVolumes (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbTetras (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbHexas (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbTriQuadHexas() const { return myNbTriQuadHexas; }
int NbPolyhedrons() const { return myNbPolyhedrons; }
protected:
inline void addWithPoly(const SMDS_MeshElement* el);
inline void setNb(const SMDSAbs_EntityType geomType, const int nb);
private:
friend class SMDS_Mesh;
// methods to count NOT POLY elements
inline void remove(const SMDS_MeshElement* el);
inline void add (const SMDS_MeshElement* el);
inline int index(SMDSAbs_ElementType type, int nbNodes);
inline int index(SMDSAbs_ElementType type, int nbNodes) const;
// methods to remove elements of ANY kind
inline void RemoveEdge(const SMDS_MeshElement* el);
inline void RemoveFace(const SMDS_MeshElement* el);
@ -68,15 +85,18 @@ private:
int myNbNodes;
int myNb0DElements;
int myNbBalls;
int myNbEdges , myNbQuadEdges ;
int myNbTriangles , myNbQuadTriangles ;
int myNbQuadrangles, myNbQuadQuadrangles;
int myNbPolygons;
int myNbTriangles , myNbQuadTriangles, myNbBiQuadTriangles ;
int myNbQuadrangles, myNbQuadQuadrangles, myNbBiQuadQuadrangles;
int myNbPolygons , myNbQuadPolygons;
int myNbTetras , myNbQuadTetras ;
int myNbHexas , myNbQuadHexas ;
int myNbHexas , myNbQuadHexas, myNbTriQuadHexas;
int myNbPyramids, myNbQuadPyramids;
int myNbPrisms , myNbQuadPrisms ;
int myNbHexPrism;
int myNbPolyhedrons;
std::vector<int*> myNb; // pointers to myNb... fields
@ -84,76 +104,109 @@ private:
};
inline SMDS_MeshInfo::SMDS_MeshInfo():
myNbNodes(0),
myNbNodes (0),
myNb0DElements (0),
myNbBalls (0),
myNbEdges (0), myNbQuadEdges (0),
myNbTriangles (0), myNbQuadTriangles (0),
myNbQuadrangles(0), myNbQuadQuadrangles(0),
myNbPolygons(0),
myNbTetras (0), myNbQuadTetras (0),
myNbHexas (0), myNbQuadHexas (0),
myNbPyramids(0), myNbQuadPyramids(0),
myNbPrisms (0), myNbQuadPrisms (0),
myNbTriangles (0), myNbQuadTriangles (0), myNbBiQuadTriangles(0),
myNbQuadrangles(0), myNbQuadQuadrangles(0), myNbBiQuadQuadrangles(0),
myNbPolygons (0), myNbQuadPolygons (0),
myNbTetras (0), myNbQuadTetras (0),
myNbHexas (0), myNbQuadHexas (0), myNbTriQuadHexas(0),
myNbPyramids (0), myNbQuadPyramids(0),
myNbPrisms (0), myNbQuadPrisms (0),
myNbHexPrism (0),
myNbPolyhedrons(0)
{
// Number of nodes in standard element types
// n v f e
// o o a d
// d l c g
// e e e
// -----------
// 1
// 2 *
// 3 *
// 4 * * *
// Number of nodes in standard element types (. - actual nb, * - after the shift)
// n v f e 0 n b
// o o a d d o a
// d l c g d l
// e e e e l
// s
// ====================
// 0 ------------------ - DON't USE 0!!!
// 1 . * .
// 2 . *
// 3 . . *
// 4 * .
// 5 *
// 6 * *
// 7
// 8 * *
// 9
// 6 * .
// 7 .
// 8 * .
// 9 .
// 10 *
// 11
// 12
// 12 *
// 13 *
// 14
// 15 *
// 16
// 17
// 18
// 19
// 16 *
// 17 *
// 18 *
// 19 *
// 20 *
// 21 *
// 22 *
// 23 *
// 24 *
// 25
// 26
// 27 *
//
// So to have a unique index for each type basing on nb of nodes, we use a shift:
myShift.resize(SMDSAbs_Volume + 1, 0);
myShift[ SMDSAbs_Face ] = +8; // 3->11, 4->12, 6->14, 8->16
myShift[ SMDSAbs_Edge ] = -2; // 2->0, 4->2
myShift.resize(SMDSAbs_NbElementTypes, 0);
myShift[ SMDSAbs_Face ] = +15;// 3->18, 4->19, etc.
myShift[ SMDSAbs_Edge ] = +14;// 2->16, 3->17
myShift[ SMDSAbs_0DElement ] = +2; // 1->3
myShift[ SMDSAbs_Ball ] = +1; // 1->2
myNb.resize( index( SMDSAbs_Volume,27 ) + 1, NULL);
myNb.resize( index( SMDSAbs_Volume,20 ) + 1, NULL);
myNb[ index( SMDSAbs_Node,1 )] = & myNbNodes;
myNb[ index( SMDSAbs_0DElement,1 )] = & myNb0DElements;
myNb[ index( SMDSAbs_Ball,1 )] = & myNbBalls;
myNb[ index( SMDSAbs_Edge,2 )] = & myNbEdges;
myNb[ index( SMDSAbs_Edge,4 )] = & myNbQuadEdges;
myNb[ index( SMDSAbs_Edge,3 )] = & myNbQuadEdges;
myNb[ index( SMDSAbs_Face,3 )] = & myNbTriangles;
myNb[ index( SMDSAbs_Face,4 )] = & myNbQuadrangles;
myNb[ index( SMDSAbs_Face,6 )] = & myNbQuadTriangles;
myNb[ index( SMDSAbs_Face,7 )] = & myNbBiQuadTriangles;
myNb[ index( SMDSAbs_Face,8 )] = & myNbQuadQuadrangles;
myNb[ index( SMDSAbs_Face,9 )] = & myNbBiQuadQuadrangles;
myNb[ index( SMDSAbs_Volume, 4)] = & myNbTetras;
myNb[ index( SMDSAbs_Volume, 5)] = & myNbPyramids;
myNb[ index( SMDSAbs_Volume, 6)] = & myNbPrisms;
myNb[ index( SMDSAbs_Volume, 8)] = & myNbHexas;
myNb[ index( SMDSAbs_Volume, 10)] = & myNbQuadTetras;
myNb[ index( SMDSAbs_Volume, 12)] = & myNbHexPrism;
myNb[ index( SMDSAbs_Volume, 13)] = & myNbQuadPyramids;
myNb[ index( SMDSAbs_Volume, 15)] = & myNbQuadPrisms;
myNb[ index( SMDSAbs_Volume, 20)] = & myNbQuadHexas;
myNb[ index( SMDSAbs_Volume, 27)] = & myNbTriQuadHexas;
}
inline SMDS_MeshInfo& // operator=
SMDS_MeshInfo::operator=(const SMDS_MeshInfo& other)
{ for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=(*other.myNb[i]);
myNbPolygons = other.myNbPolygons;
myNbQuadPolygons = other.myNbQuadPolygons;
myNbPolyhedrons = other.myNbPolyhedrons;
return *this;
}
inline void // Clear
SMDS_MeshInfo::Clear()
{ for ( std::size_t i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0;
myNbPolygons=myNbPolyhedrons=0;
{ for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0;
myNbPolygons=myNbQuadPolygons=myNbPolyhedrons=0;
}
inline int // index
SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes)
SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes) const
{ return nbNodes + myShift[ type ]; }
inline void // remove
@ -164,52 +217,215 @@ inline void // add
SMDS_MeshInfo::add(const SMDS_MeshElement* el)
{ ++(*myNb[ index(el->GetType(), el->NbNodes()) ]); }
inline void // addWithPoly
SMDS_MeshInfo::addWithPoly(const SMDS_MeshElement* el) {
switch ( el->GetEntityType() ) {
case SMDSEntity_Polygon: ++myNbPolygons; break;
case SMDSEntity_Quad_Polygon: ++myNbQuadPolygons; break;
case SMDSEntity_Polyhedra: ++myNbPolyhedrons; break;
default: add(el);
}
}
inline void // RemoveEdge
SMDS_MeshInfo::RemoveEdge(const SMDS_MeshElement* el)
{ if ( el->IsQuadratic() ) --myNbQuadEdges; else --myNbEdges; }
inline void // RemoveFace
SMDS_MeshInfo::RemoveFace(const SMDS_MeshElement* el)
{ if ( el->IsPoly() ) --myNbPolygons; else remove( el ); }
SMDS_MeshInfo::RemoveFace(const SMDS_MeshElement* el) {
switch ( el->GetEntityType() ) {
case SMDSEntity_Polygon: --myNbPolygons; break;
case SMDSEntity_Quad_Polygon: --myNbQuadPolygons; break;
default: remove(el);
}
}
inline void // RemoveVolume
SMDS_MeshInfo::RemoveVolume(const SMDS_MeshElement* el)
{ if ( el->IsPoly() ) --myNbPolyhedrons; else remove( el ); }
inline int // NbEdges
inline int // NbEdges
SMDS_MeshInfo::NbEdges (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbEdges+myNbQuadEdges : order == ORDER_LINEAR ? myNbEdges : myNbQuadEdges; }
inline int // NbFaces
inline int // NbFaces
SMDS_MeshInfo::NbFaces (SMDSAbs_ElementOrder order) const
{ return NbTriangles(order)+NbQuadrangles(order)+(order == ORDER_QUADRATIC ? 0 : myNbPolygons); }
{ return NbTriangles(order)+NbQuadrangles(order)+(order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons ); }
inline int // NbTriangles
inline int // NbTriangles
SMDS_MeshInfo::NbTriangles (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbTriangles+myNbQuadTriangles : order == ORDER_LINEAR ? myNbTriangles : myNbQuadTriangles; }
{ return order == ORDER_ANY ? myNbTriangles+myNbQuadTriangles+myNbBiQuadTriangles : order == ORDER_LINEAR ? myNbTriangles : myNbQuadTriangles+myNbBiQuadTriangles; }
inline int // NbQuadrangles
inline int // NbQuadrangles
SMDS_MeshInfo::NbQuadrangles(SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbQuadrangles+myNbQuadQuadrangles : order == ORDER_LINEAR ? myNbQuadrangles : myNbQuadQuadrangles; }
{ return order == ORDER_ANY ? myNbQuadrangles+myNbQuadQuadrangles+myNbBiQuadQuadrangles : order == ORDER_LINEAR ? myNbQuadrangles : myNbQuadQuadrangles+myNbBiQuadQuadrangles; }
inline int // NbVolumes
inline int // NbPolygons
SMDS_MeshInfo::NbPolygons(SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons; }
inline int // NbVolumes
SMDS_MeshInfo::NbVolumes (SMDSAbs_ElementOrder order) const
{ return NbTetras(order) + NbHexas(order) + NbPyramids(order) + NbPrisms(order) + (order == ORDER_QUADRATIC ? 0 : myNbPolyhedrons); }
{ return NbTetras(order) + NbHexas(order) + NbPyramids(order) + NbPrisms(order) + NbHexPrisms(order) + (order == ORDER_QUADRATIC ? 0 : myNbPolyhedrons); }
inline int // NbTetras
inline int // NbTetras
SMDS_MeshInfo::NbTetras (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbTetras+myNbQuadTetras : order == ORDER_LINEAR ? myNbTetras : myNbQuadTetras; }
inline int // NbHexas
inline int // NbHexas
SMDS_MeshInfo::NbHexas (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbHexas+myNbQuadHexas : order == ORDER_LINEAR ? myNbHexas : myNbQuadHexas; }
{ return order == ORDER_ANY ? myNbHexas+myNbQuadHexas+myNbTriQuadHexas : order == ORDER_LINEAR ? myNbHexas : myNbQuadHexas+myNbTriQuadHexas; }
inline int // NbPyramids
inline int // NbPyramids
SMDS_MeshInfo::NbPyramids(SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbPyramids+myNbQuadPyramids : order == ORDER_LINEAR ? myNbPyramids : myNbQuadPyramids; }
inline int // NbPrisms
inline int // NbPrisms
SMDS_MeshInfo::NbPrisms (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbPrisms+myNbQuadPrisms : order == ORDER_LINEAR ? myNbPrisms : myNbQuadPrisms; }
inline int // NbHexPrisms
SMDS_MeshInfo::NbHexPrisms (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbHexPrism : order == ORDER_LINEAR ? myNbHexPrism : 0; }
inline int // NbElements
SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
{
int nb = 0;
switch (type) {
case SMDSAbs_All:
for ( int i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i];
nb += myNbPolygons + myNbQuadPolygons + myNbPolyhedrons;
break;
case SMDSAbs_Volume:
nb = ( myNbTetras+ myNbPyramids+ myNbPrisms+ myNbHexas+ myNbHexPrism+
myNbQuadTetras+ myNbQuadPyramids+ myNbQuadPrisms+ myNbQuadHexas+ myNbTriQuadHexas+
myNbPolyhedrons );
break;
case SMDSAbs_Face:
nb = ( myNbTriangles+ myNbQuadrangles+
myNbQuadTriangles+ myNbBiQuadTriangles+
myNbQuadQuadrangles+ myNbBiQuadQuadrangles+ myNbPolygons+ myNbQuadPolygons );
break;
case SMDSAbs_Edge:
nb = myNbEdges + myNbQuadEdges;
break;
case SMDSAbs_Node:
nb = myNbNodes;
break;
case SMDSAbs_0DElement:
nb = myNb0DElements;
break;
case SMDSAbs_Ball:
nb = myNbBalls;
break;
default:;
}
return nb;
}
inline int // NbEntities
SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const
{
switch (type) {
case SMDSEntity_Node: return myNbNodes;
case SMDSEntity_Edge: return myNbEdges;
case SMDSEntity_Quad_Edge: return myNbQuadEdges;
case SMDSEntity_Triangle: return myNbTriangles;
case SMDSEntity_Quad_Triangle: return myNbQuadTriangles;
case SMDSEntity_BiQuad_Triangle: return myNbBiQuadTriangles;
case SMDSEntity_Quadrangle: return myNbQuadrangles;
case SMDSEntity_Quad_Quadrangle: return myNbQuadQuadrangles;
case SMDSEntity_BiQuad_Quadrangle:return myNbBiQuadQuadrangles;
case SMDSEntity_Polygon: return myNbPolygons;
case SMDSEntity_Tetra: return myNbTetras;
case SMDSEntity_Quad_Tetra: return myNbQuadTetras;
case SMDSEntity_Pyramid: return myNbPyramids;
case SMDSEntity_Quad_Pyramid: return myNbQuadPyramids;
case SMDSEntity_Hexa: return myNbHexas;
case SMDSEntity_Quad_Hexa: return myNbQuadHexas;
case SMDSEntity_TriQuad_Hexa: return myNbTriQuadHexas;
case SMDSEntity_Penta: return myNbPrisms;
case SMDSEntity_Quad_Penta: return myNbQuadPrisms;
case SMDSEntity_Hexagonal_Prism: return myNbHexPrism;
case SMDSEntity_Polyhedra: return myNbPolyhedrons;
case SMDSEntity_0D: return myNb0DElements;
case SMDSEntity_Ball: return myNbBalls;
case SMDSEntity_Quad_Polygon: return myNbQuadPolygons;
case SMDSEntity_Quad_Polyhedra:
break;
}
return 0;
}
inline int // NbElementsOfGeom
SMDS_MeshInfo::NbElementsOfGeom(SMDSAbs_GeometryType geom) const
{
switch ( geom ) {
// 0D:
case SMDSGeom_POINT: return myNb0DElements;
// 1D:
case SMDSGeom_EDGE: return (myNbEdges +
myNbQuadEdges);
// 2D:
case SMDSGeom_TRIANGLE: return (myNbTriangles +
myNbQuadTriangles +
myNbBiQuadTriangles );
case SMDSGeom_QUADRANGLE: return (myNbQuadrangles +
myNbQuadQuadrangles +
myNbBiQuadQuadrangles );
case SMDSGeom_POLYGON: return (myNbPolygons + myNbQuadPolygons );
// 3D:
case SMDSGeom_TETRA: return (myNbTetras +
myNbQuadTetras);
case SMDSGeom_PYRAMID: return (myNbPyramids +
myNbQuadPyramids);
case SMDSGeom_HEXA: return (myNbHexas +
myNbQuadHexas +
myNbTriQuadHexas);
case SMDSGeom_PENTA: return (myNbPrisms +
myNbQuadPrisms);
case SMDSGeom_HEXAGONAL_PRISM: return myNbHexPrism;
case SMDSGeom_POLYHEDRA: return myNbPolyhedrons;
// Discrete:
case SMDSGeom_BALL: return myNbBalls;
//
case SMDSGeom_NONE:
default:;
}
return 0;
}
inline void // setNb
SMDS_MeshInfo::setNb(const SMDSAbs_EntityType geomType, const int nb)
{
switch (geomType) {
case SMDSEntity_Node: myNbNodes = nb; break;
case SMDSEntity_0D: myNb0DElements = nb; break;
case SMDSEntity_Ball: myNbBalls = nb; break;
case SMDSEntity_BiQuad_Quadrangle:myNbBiQuadQuadrangles = nb; break;
case SMDSEntity_BiQuad_Triangle: myNbBiQuadTriangles = nb; break;
case SMDSEntity_Edge: myNbEdges = nb; break;
case SMDSEntity_Hexa: myNbHexas = nb; break;
case SMDSEntity_Hexagonal_Prism: myNbHexPrism = nb; break;
case SMDSEntity_Penta: myNbPrisms = nb; break;
case SMDSEntity_Polygon: myNbPolygons = nb; break;
case SMDSEntity_Polyhedra: myNbPolyhedrons = nb; break;
case SMDSEntity_Pyramid: myNbPyramids = nb; break;
case SMDSEntity_Quad_Edge: myNbQuadEdges = nb; break;
case SMDSEntity_Quad_Hexa: myNbQuadHexas = nb; break;
case SMDSEntity_Quad_Penta: myNbQuadPrisms = nb; break;
case SMDSEntity_Quad_Pyramid: myNbQuadPyramids = nb; break;
case SMDSEntity_Quad_Quadrangle: myNbQuadQuadrangles = nb; break;
case SMDSEntity_Quad_Tetra: myNbQuadTetras = nb; break;
case SMDSEntity_Quad_Triangle: myNbQuadTriangles = nb; break;
case SMDSEntity_Quadrangle: myNbQuadrangles = nb; break;
case SMDSEntity_Tetra: myNbTetras = nb; break;
case SMDSEntity_TriQuad_Hexa: myNbTriQuadHexas = nb; break;
case SMDSEntity_Triangle: myNbTriangles = nb; break;
case SMDSEntity_Quad_Polygon: myNbQuadPolygons = nb; break;
case SMDSEntity_Quad_Polyhedra:
break;
}
}
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshNode.hxx
// Module : SMESH
@ -30,45 +31,51 @@
#include "SMDS_MeshElement.hxx"
#include "SMDS_Position.hxx"
#include <NCollection_List.hxx>
#include "ObjectPool.hxx"
class SMDS_EXPORT SMDS_MeshNode:public SMDS_MeshElement
class SMDS_EXPORT SMDS_MeshNode: public SMDS_MeshElement
{
public:
friend class SMESHDS_Mesh;
friend class SMDS_Mesh;
friend class ObjectPool<SMDS_MeshNode>;
friend class SMDS_VtkFace;
public:
SMDS_MeshNode(double x, double y, double z);
void Print(std::ostream & OS) const;
double X() const;
double Y() const;
double Z() const;
void AddInverseElement(const SMDS_MeshElement * ME);
void RemoveInverseElement(const SMDS_MeshElement * parent);
void ClearInverseElements();
bool emptyInverseElements();
SMDS_ElemIteratorPtr GetInverseElementIterator(SMDSAbs_ElementType type=SMDSAbs_All) const;
int NbInverseElements(SMDSAbs_ElementType type=SMDSAbs_All) const;
void SetPosition(const SMDS_PositionPtr& aPos);
const SMDS_PositionPtr& GetPosition() const;
SMDSAbs_ElementType GetType() const;
int NbNodes() const;
void setXYZ(double x, double y, double z);
friend bool operator<(const SMDS_MeshNode& e1, const SMDS_MeshNode& e2);
void Print(std::ostream & OS) const;
double X() const; // ! NOT thread safe methods !
double Y() const;
double Z() const;
void GetXYZ(double xyz[3]) const; // thread safe getting coords
SMDS_ElemIteratorPtr GetInverseElementIterator(SMDSAbs_ElementType type=SMDSAbs_All) const;
int NbInverseElements(SMDSAbs_ElementType type=SMDSAbs_All) const;
const SMDS_PositionPtr& GetPosition() const;
virtual SMDSAbs_ElementType GetType() const;
virtual vtkIdType GetVtkType() const;
virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Node;}
virtual SMDSAbs_GeometryType GetGeomType() const { return SMDSGeom_NONE; }
virtual int NbNodes() const;
/*!
* \brief Return node by its index
* \param ind - node index
* \retval const SMDS_MeshNode* - the node
*/
virtual const SMDS_MeshNode* GetNode(const int) const { return this; }
void SetPosition(const SMDS_PositionPtr& aPos);
void setXYZ(double x, double y, double z);
protected:
SMDS_ElemIteratorPtr
elementsIterator(SMDSAbs_ElementType type) const;
static int nbNodes;
private:
double myX, myY, myZ;
SMDS_PositionPtr myPosition;
NCollection_List<const SMDS_MeshElement*> myInverseElements;
protected:
SMDS_MeshNode();
SMDS_MeshNode(int id, int meshId, int shapeId = -1, double x=0, double y=0, double z=0);
virtual ~SMDS_MeshNode();
void init(int id, int meshId, int shapeId = -1, double x=0, double y=0, double z=0);
double* getCoord() const;
void AddInverseElement(const SMDS_MeshElement * ME);
void RemoveInverseElement(const SMDS_MeshElement * parent);
void ClearInverseElements();
bool emptyInverseElements();
SMDS_ElemIteratorPtr
elementsIterator(SMDSAbs_ElementType type) const;
private:
SMDS_PositionPtr myPosition;
};
#endif

View File

@ -0,0 +1,65 @@
// Copyright (C) 2007-2015 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, or (at your option) any later version.
//
// 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 : SMDS_MeshElementIDFactory.hxx
// Module : SMESH
//
#ifndef _SMDS_MeshNodeIDFactory_HeaderFile
#define _SMDS_MeshNodeIDFactory_HeaderFile
#include "SMESH_SMDS.hxx"
#include "SMDS_MeshIDFactory.hxx"
#include "SMDS_ElemIterator.hxx"
#include <vector>
class SMDS_MeshElement;
class SMDS_EXPORT SMDS_MeshNodeIDFactory: public SMDS_MeshIDFactory
{
public:
SMDS_MeshNodeIDFactory();
bool BindID(int ID, SMDS_MeshElement * elem);
SMDS_MeshElement * MeshElement(int ID);
virtual int GetFreeID();
virtual void ReleaseID(int ID, int vtkId = -1);
int GetMaxID() const;
int GetMinID() const;
SMDS_ElemIteratorPtr elementsIterator() const;
virtual void Clear();
virtual void emptyPool(int maxId);
protected:
void updateMinMax() const;
void updateMinMax(int id) const
{
if (id > myMax)
myMax = id;
if (id < myMin)
myMin = id;
}
mutable int myMin, myMax;
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshObject.hxx
// Module : SMESH

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_MeshVolume.hxx
// Module : SMESH
@ -28,12 +29,13 @@
#include "SMESH_SMDS.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshCell.hxx"
class SMDS_EXPORT SMDS_MeshVolume:public SMDS_MeshElement
class SMDS_EXPORT SMDS_MeshVolume:public SMDS_MeshCell
{
public:
SMDSAbs_ElementType GetType() const;
SMDSAbs_ElementType GetType() const;
virtual vtkIdType GetVtkType() const;
};
#endif

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
//
#ifndef _SMDS_PolygonalFaceOfNodes_HeaderFile
@ -37,9 +38,11 @@
class SMDS_EXPORT SMDS_PolygonalFaceOfNodes:public SMDS_MeshFace
{
public:
SMDS_PolygonalFaceOfNodes (std::vector<const SMDS_MeshNode *> nodes);
SMDS_PolygonalFaceOfNodes (const std::vector<const SMDS_MeshNode *>& nodes);
virtual SMDSAbs_ElementType GetType() const;
virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Polygon; }
virtual SMDSAbs_GeometryType GetGeomType() const { return SMDSGeom_POLYGON; }
virtual bool IsPoly() const { return true; };
bool ChangeNodes (std::vector<const SMDS_MeshNode *> nodes);

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_PolyhedralVolumeOfNodes.hxx
// Module : SMESH
@ -39,6 +40,7 @@ class SMDS_EXPORT SMDS_PolyhedralVolumeOfNodes:public SMDS_VolumeOfNodes
//virtual ~SMDS_PolyhedralVolumeOfNodes();
virtual SMDSAbs_ElementType GetType() const;
virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Polyhedra; }
virtual bool IsPoly() const { return true; };
bool ChangeNodes (const std::vector<const SMDS_MeshNode *> & nodes,

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_Position.hxx
// Module : SMESH
@ -32,24 +33,19 @@
#include <boost/shared_ptr.hpp>
class SMDS_Position;
typedef boost::shared_ptr<SMDS_Position> SMDS_PositionPtr;
//typedef boost::shared_ptr<SMDS_Position> SMDS_PositionPtr;
typedef SMDS_Position* SMDS_PositionPtr;
class SMDS_EXPORT SMDS_Position
{
public:
const virtual double * Coords() const = 0;
virtual SMDS_TypeOfPosition GetTypeOfPosition() const = 0;
virtual int GetDim() const;
void SetShapeId(int aShapeId);
int GetShapeId() const;
virtual ~SMDS_Position() {}
virtual SMDS_TypeOfPosition GetTypeOfPosition() const = 0;
virtual int GetDim() const;
virtual ~SMDS_Position() {}
protected:
SMDS_Position(int aShapeId);
private:
int myShapeId;
SMDS_Position();
};

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_QuadraticEdge.hxx
// Module : SMESH
@ -28,10 +29,10 @@
#include "SMESH_SMDS.hxx"
#include "SMDS_MeshEdge.hxx"
#include "SMDS_LinearEdge.hxx"
#include <iostream>
class SMDS_EXPORT SMDS_QuadraticEdge: public SMDS_MeshEdge
class SMDS_EXPORT SMDS_QuadraticEdge: public SMDS_LinearEdge
{
public:
@ -47,14 +48,14 @@ public:
int NbNodes() const;
virtual SMDSAbs_EntityType GetEntityType() const { return SMDSEntity_Quad_Edge; }
virtual bool IsQuadratic() const { return true; }
virtual bool IsMediumNode(const SMDS_MeshNode* node) const;
SMDS_NodeIteratorPtr interlacedNodesIterator() const;
SMDS_ElemIteratorPtr interlacedNodesElemIterator() const;
protected:
SMDS_ElemIteratorPtr
elementsIterator(SMDSAbs_ElementType type) const;

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_QuadraticVolumeOfNodes.hxx
// Module : SMESH
@ -49,6 +50,7 @@ public:
const SMDS_MeshNode * n34,
const SMDS_MeshNode * n41);
virtual SMDSAbs_EntityType GetEntityType() const;
virtual bool IsQuadratic() const { return true; }
virtual bool IsMediumNode(const SMDS_MeshNode* node) const;
@ -64,8 +66,6 @@ public:
SMDS_NodeIteratorPtr interlacedNodesIterator() const;
SMDS_ElemIteratorPtr interlacedNodesElemIterator() const;
/*!
* \brief Return node by its index
* \param ind - node index

View File

@ -1,24 +1,25 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (C) 2007-2015 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
// 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 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, or (at your option) any later version.
//
// 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.
// 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
// 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
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDS_QuadraticVolumeOfNodes.hxx
// Module : SMESH
@ -99,6 +100,7 @@ public:
const SMDS_MeshNode * n37,
const SMDS_MeshNode * n48);
virtual SMDSAbs_EntityType GetEntityType() const;
virtual bool IsQuadratic() const { return true; }
virtual bool IsMediumNode(const SMDS_MeshNode* node) const;

Some files were not shown because too many files have changed in this diff Show More