2022-05-05 16:51:12 +03:00
// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
2009-02-17 05:27:49 +00:00
//
2012-08-09 10:03:55 +00:00
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
2003-07-10 10:13:42 +00:00
//
2012-08-09 10:03:55 +00:00
// 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
2014-02-20 16:25:37 +04:00
// version 2.1 of the License, or (at your option) any later version.
2003-07-10 10:13:42 +00:00
//
2012-08-09 10:03:55 +00:00
// 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.
2003-07-10 10:13:42 +00:00
//
2012-08-09 10:03:55 +00:00
// 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
2003-07-10 10:13:42 +00:00
//
2012-08-09 10:03:55 +00:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2009-02-17 05:27:49 +00:00
//
2012-08-09 10:03:55 +00:00
2003-07-10 10:13:42 +00:00
// File : SMESH_Mesh.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
2009-02-17 05:27:49 +00:00
//
2003-05-19 13:18:36 +00:00
# ifndef _SMESH_MESH_HXX_
# define _SMESH_MESH_HXX_
2008-03-07 07:47:05 +00:00
# include "SMESH_SMESH.hxx"
2004-12-01 10:48:31 +00:00
# include "SMDSAbs_ElementType.hxx"
2012-10-08 11:56:59 +00:00
# include "SMESH_ComputeError.hxx"
# include "SMESH_Controls.hxx"
# include "SMESH_Hypothesis.hxx"
2023-03-09 16:32:55 +01:00
# include "SMESH_subMesh.hxx"
2016-06-29 20:53:22 +03:00
# include "SMDS_Iterator.hxx"
2003-05-19 13:18:36 +00:00
2004-12-17 11:07:35 +00:00
# include "Utils_SALOME_Exception.hxx"
2003-05-19 13:18:36 +00:00
# include <TopoDS_Shape.hxx>
2004-06-18 08:55:35 +00:00
# include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
2016-02-24 16:46:43 +03:00
# include <TopTools_ListOfShape.hxx>
2003-05-19 13:18:36 +00:00
2021-04-26 21:53:20 +02:00
# include "MEDCouplingMemArray.hxx"
2003-05-19 13:18:36 +00:00
# include <map>
2012-08-09 10:03:55 +00:00
# include <list>
2016-06-30 10:57:53 +03:00
# include <vector>
2019-12-17 22:19:00 +03:00
# include <ostream>
2022-10-10 10:54:28 +02:00
2023-03-28 08:46:24 +02:00
# ifndef WIN32
2022-10-21 15:03:25 +02:00
# include <boost/filesystem.hpp>
# include <boost/asio/thread_pool.hpp>
# endif
# include <boost/thread.hpp>
2013-10-18 13:29:00 +00:00
# ifdef WIN32
2012-08-09 10:03:55 +00:00
# pragma warning(disable:4251) // Warning DLL Interface ...
# pragma warning(disable:4290) // Warning Exception ...
# endif
2003-05-19 13:18:36 +00:00
2016-06-29 20:53:22 +03:00
class SMESHDS_Command ;
2008-03-07 07:47:05 +00:00
class SMESHDS_Document ;
2016-06-29 20:53:22 +03:00
class SMESHDS_GroupBase ;
class SMESHDS_Hypothesis ;
class SMESHDS_Mesh ;
class SMESH_Gen ;
2004-06-18 08:55:35 +00:00
class SMESH_Group ;
2005-02-04 10:54:26 +00:00
class SMESH_HypoFilter ;
2016-06-29 20:53:22 +03:00
class SMESH_subMesh ;
2008-03-07 07:47:05 +00:00
class TopoDS_Solid ;
2004-12-17 11:07:35 +00:00
2021-04-26 21:53:20 +02:00
class DriverMED_W_SMESHDS_Mesh ;
2023-03-09 16:32:55 +01:00
typedef std : : set < int > TSetOfInt ;
2012-08-09 10:03:55 +00:00
typedef std : : list < int > TListOfInt ;
typedef std : : list < TListOfInt > TListOfListOfInt ;
2008-03-07 07:47:05 +00:00
class SMESH_EXPORT SMESH_Mesh
2003-05-19 13:18:36 +00:00
{
2014-09-09 18:12:47 +04:00
public :
SMESH_Mesh ( int theLocalId ,
2012-08-09 10:03:55 +00:00
SMESH_Gen * theGen ,
bool theIsEmbeddedMode ,
SMESHDS_Document * theDocument ) ;
2014-09-09 18:12:47 +04:00
2004-12-01 10:48:31 +00:00
virtual ~ SMESH_Mesh ( ) ;
2014-09-09 18:12:47 +04:00
2008-03-07 07:47:05 +00:00
/*!
* \ brief Set geometry to be meshed
*/
2004-12-01 10:48:31 +00:00
void ShapeToMesh ( const TopoDS_Shape & aShape ) ;
2008-03-07 07:47:05 +00:00
/*!
* \ brief Return geometry to be meshed . ( It may be a PseudoShape ( ) ! )
*/
TopoDS_Shape GetShapeToMesh ( ) const ;
/*!
* \ brief Return true if there is a geometry to be meshed , not PseudoShape ( )
*/
bool HasShapeToMesh ( ) const { return _isShapeToMesh ; }
2019-12-27 16:22:48 +03:00
void UndefShapeToMesh ( ) { _isShapeToMesh = false ; }
2009-02-17 05:27:49 +00:00
/*!
* \ brief Return diagonal size of bounding box of shape to mesh .
*/
double GetShapeDiagonalSize ( ) const ;
/*!
* \ brief Return diagonal size of bounding box of a shape .
*/
static double GetShapeDiagonalSize ( const TopoDS_Shape & aShape ) ;
2008-03-07 07:47:05 +00:00
/*!
* \ brief Return a solid which is returned by GetShapeToMesh ( ) if
* a real geometry to be meshed was not set
*/
static const TopoDS_Solid & PseudoShape ( ) ;
2012-08-09 10:03:55 +00:00
/*!
* \ brief Load mesh from study file
*/
void Load ( ) ;
2009-02-17 05:27:49 +00:00
/*!
* \ brief Remove all nodes and elements
*/
void Clear ( ) ;
/*!
* \ brief Remove all nodes and elements of indicated shape
*/
void ClearSubMesh ( const int theShapeId ) ;
2008-03-07 07:47:05 +00:00
2004-12-01 10:48:31 +00:00
/*!
* consult DriverMED_R_SMESHDS_Mesh : : ReadStatus for returned value
*/
2012-08-09 10:03:55 +00:00
int UNVToMesh ( const char * theFileName ) ;
2004-12-01 10:48:31 +00:00
int MEDToMesh ( const char * theFileName , const char * theMeshName ) ;
2022-10-21 15:03:25 +02:00
2017-03-14 15:43:27 +03:00
std : : string STLToMesh ( const char * theFileName ) ;
2003-09-04 09:21:41 +00:00
2012-08-09 10:03:55 +00:00
int CGNSToMesh ( const char * theFileName , const int theMeshIndex , std : : string & theMeshName ) ;
2022-10-21 15:03:25 +02:00
2012-12-13 11:41:29 +00:00
SMESH_ComputeErrorPtr GMFToMesh ( const char * theFileName ,
bool theMakeRequiredGroups = true ) ;
2012-10-08 11:56:59 +00:00
2004-12-01 10:48:31 +00:00
SMESH_Hypothesis : : Hypothesis_Status
2020-08-21 08:05:05 +03:00
AddHypothesis ( const TopoDS_Shape & aSubShape , int anHypId , std : : string * error = 0 ) ;
2022-10-21 15:03:25 +02:00
2004-12-01 10:48:31 +00:00
SMESH_Hypothesis : : Hypothesis_Status
2020-08-21 08:05:05 +03:00
RemoveHypothesis ( const TopoDS_Shape & aSubShape , int anHypId ) ;
2022-10-21 15:03:25 +02:00
2008-03-07 07:47:05 +00:00
const std : : list < const SMESHDS_Hypothesis * > &
2020-08-21 08:05:05 +03:00
GetHypothesisList ( const TopoDS_Shape & aSubShape ) const ;
2005-02-04 10:54:26 +00:00
const SMESH_Hypothesis * GetHypothesis ( const TopoDS_Shape & aSubShape ,
const SMESH_HypoFilter & aFilter ,
2009-02-17 05:27:49 +00:00
const bool andAncestors ,
TopoDS_Shape * assignedTo = 0 ) const ;
2022-10-21 15:03:25 +02:00
2008-03-07 07:47:05 +00:00
int GetHypotheses ( const TopoDS_Shape & aSubShape ,
const SMESH_HypoFilter & aFilter ,
2013-05-27 14:01:40 +00:00
std : : list < const SMESHDS_Hypothesis * > & aHypList ,
const bool andAncestors ,
std : : list < TopoDS_Shape > * assignedTo = 0 ) const ;
2005-02-04 10:54:26 +00:00
2014-07-23 20:04:21 +04:00
const SMESH_Hypothesis * GetHypothesis ( const SMESH_subMesh * aSubMesh ,
const SMESH_HypoFilter & aFilter ,
const bool andAncestors ,
TopoDS_Shape * assignedTo = 0 ) const ;
2022-10-21 15:03:25 +02:00
2014-07-23 20:04:21 +04:00
int GetHypotheses ( const SMESH_subMesh * aSubMesh ,
const SMESH_HypoFilter & aFilter ,
std : : list < const SMESHDS_Hypothesis * > & aHypList ,
const bool andAncestors ,
std : : list < TopoDS_Shape > * assignedTo = 0 ) const ;
2013-07-03 16:10:31 +00:00
SMESH_Hypothesis * GetHypothesis ( const int aHypID ) const ;
2020-08-21 08:05:05 +03:00
const std : : list < SMESHDS_Command * > & GetLog ( ) ;
2022-10-21 15:03:25 +02:00
2020-08-21 08:05:05 +03:00
void ClearLog ( ) ;
2022-10-21 15:03:25 +02:00
2012-08-09 10:03:55 +00:00
int GetId ( ) const { return _id ; }
2022-10-21 15:03:25 +02:00
2012-08-09 10:03:55 +00:00
bool MeshExists ( int meshId ) const ;
2022-10-21 15:03:25 +02:00
2015-05-08 18:49:31 +03:00
SMESH_Mesh * FindMesh ( int meshId ) const ;
2021-07-22 14:10:49 +03:00
SMESHDS_Mesh * GetMeshDS ( ) { return _meshDS ; }
2015-05-08 18:49:31 +03:00
2021-07-22 14:10:49 +03:00
const SMESHDS_Mesh * GetMeshDS ( ) const { return _meshDS ; }
2022-10-21 15:03:25 +02:00
2012-08-09 10:03:55 +00:00
SMESH_Gen * GetGen ( ) { return _gen ; }
2020-08-21 08:05:05 +03:00
SMESH_subMesh * GetSubMesh ( const TopoDS_Shape & aSubShape ) ;
2022-10-21 15:03:25 +02:00
2020-08-21 08:05:05 +03:00
SMESH_subMesh * GetSubMeshContaining ( const TopoDS_Shape & aSubShape ) const ;
2022-10-21 15:03:25 +02:00
2020-08-21 08:05:05 +03:00
SMESH_subMesh * GetSubMeshContaining ( const int aShapeID ) const ;
2008-03-07 07:47:05 +00:00
/*!
* \ brief Return submeshes of groups containing the given subshape
*/
2020-08-21 08:05:05 +03:00
std : : list < SMESH_subMesh * > GetGroupSubMeshesContaining ( const TopoDS_Shape & shape ) const ;
2008-03-07 07:47:05 +00:00
/*!
* \ brief Say all submeshes that theChangedHyp has been modified
*/
2006-03-13 15:29:49 +00:00
void NotifySubMeshesHypothesisModification ( const SMESH_Hypothesis * theChangedHyp ) ;
2014-07-22 16:40:10 +04:00
// const std::list < SMESH_subMesh * >&
// GetSubMeshUsingHypothesis(SMESHDS_Hypothesis * anHyp) throw(SALOME_Exception);
2008-03-07 07:47:05 +00:00
/*!
* \ brief Return True if anHyp is used to mesh aSubShape
*/
2006-03-13 15:29:49 +00:00
bool IsUsedHypothesis ( SMESHDS_Hypothesis * anHyp ,
2012-08-09 10:03:55 +00:00
const SMESH_subMesh * aSubMesh ) ;
2008-03-07 07:47:05 +00:00
/*!
2017-03-02 19:51:35 +03:00
* \ brief check if a hypothesis allowing notconform mesh is present
2008-03-07 07:47:05 +00:00
*/
2004-12-01 10:48:31 +00:00
bool IsNotConformAllowed ( ) const ;
2022-10-21 15:03:25 +02:00
2004-12-01 10:48:31 +00:00
bool IsMainShape ( const TopoDS_Shape & theShape ) const ;
2020-10-09 11:44:21 +03:00
TopoDS_Shape GetShapeByEntry ( const std : : string & entry ) const ;
2008-03-07 07:47:05 +00:00
/*!
* \ brief Return list of ancestors of theSubShape in the order
2017-03-02 19:51:35 +03:00
* that lower dimension shapes come first
2008-03-07 07:47:05 +00:00
*/
2005-02-04 10:54:26 +00:00
const TopTools_ListOfShape & GetAncestors ( const TopoDS_Shape & theSubShape ) const ;
2006-03-13 15:29:49 +00:00
2020-08-21 08:05:05 +03:00
void SetAutoColor ( bool theAutoColor ) ;
2008-03-07 07:47:05 +00:00
2020-08-21 08:05:05 +03:00
bool GetAutoColor ( ) ;
2008-03-07 07:47:05 +00:00
2012-08-09 10:03:55 +00:00
/*!
* \ brief Set the flag meaning that the mesh has been edited " manually " .
* It is to set to false after Clear ( ) and to set to true by MeshEditor
*/
void SetIsModified ( bool isModified ) ;
bool GetIsModified ( ) const { return _isModified ; }
/*!
* \ brief Return true if the mesh has been edited since a total re - compute
* and those modifications may prevent successful partial re - compute .
* As a side effect reset _isModified flag if mesh is empty
*/
bool HasModificationsToDiscard ( ) const ;
2018-07-10 17:41:10 +03:00
/*!
* \ brief Return true if all sub - meshes are computed OK - to update an icon
*/
bool IsComputedOK ( ) ;
2008-03-07 07:47:05 +00:00
/*!
* \ brief Return data map of descendant to ancestor shapes
*/
typedef TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap ;
const TAncestorMap & GetAncestorMap ( ) const { return _mapAncestors ; }
2021-03-17 17:11:57 +03:00
2008-03-07 07:47:05 +00:00
/*!
* \ brief Check group names for duplications .
* Consider maximum group name length stored in MED file
2006-03-13 15:29:49 +00:00
*/
bool HasDuplicatedGroupNamesMED ( ) ;
2021-03-17 17:11:57 +03:00
/*!
* \ brief Exception thrown by Export * ( ) in case if a mesh is too large for export
* due to limitation of a format
*/
struct TooLargeForExport : public std : : runtime_error
{
TooLargeForExport ( const char * format ) : runtime_error ( format ) { }
} ;
2021-07-22 14:10:49 +03:00
MEDCoupling : : MCAuto < MEDCoupling : : DataArrayByte >
ExportMEDCoupling ( const char * theMeshName = NULL ,
bool theAutoGroups = true ,
const SMESHDS_Mesh * theMeshPart = 0 ,
bool theAutoDimension = false ,
bool theAddODOnVertices = false ,
double theZTolerance = - 1. ,
bool theSaveNumbers = true ) ;
2021-04-26 21:53:20 +02:00
2018-11-22 19:29:38 +03:00
void ExportMED ( const char * theFile ,
const char * theMeshName = NULL ,
bool theAutoGroups = true ,
2018-10-09 15:06:17 +02:00
int theVersion = - 1 ,
2013-06-05 15:13:53 +00:00
const SMESHDS_Mesh * theMeshPart = 0 ,
2014-03-05 19:37:55 +04:00
bool theAutoDimension = false ,
2017-02-15 19:34:55 +03:00
bool theAddODOnVertices = false ,
2018-11-22 19:29:38 +03:00
double theZTolerance = - 1. ,
2021-10-20 14:48:04 +03:00
bool theSaveNumbers = true ) ;
2005-01-20 06:25:54 +00:00
2012-08-09 10:03:55 +00:00
void ExportDAT ( const char * file ,
2021-07-22 14:10:49 +03:00
const SMESHDS_Mesh * meshPart = 0 ,
const bool renumber = true ) ;
2012-08-09 10:03:55 +00:00
void ExportUNV ( const char * file ,
2021-07-22 14:10:49 +03:00
const SMESHDS_Mesh * meshPart = 0 ,
const bool renumber = true ) ;
2012-08-09 10:03:55 +00:00
void ExportSTL ( const char * file ,
const bool isascii ,
2017-03-14 15:43:27 +03:00
const char * name = 0 ,
2020-08-21 08:05:05 +03:00
const SMESHDS_Mesh * meshPart = 0 ) ;
2012-08-09 10:03:55 +00:00
void ExportCGNS ( const char * file ,
2015-05-06 14:30:51 +03:00
const SMESHDS_Mesh * mesh ,
2017-08-25 16:45:03 +03:00
const char * meshName = 0 ,
const bool groupElemsByType = false ) ;
2012-10-08 11:56:59 +00:00
void ExportGMF ( const char * file ,
2012-12-13 11:41:29 +00:00
const SMESHDS_Mesh * mesh ,
bool withRequiredGroups = true ) ;
2013-07-03 16:10:31 +00:00
double GetComputeProgress ( ) const ;
2022-10-21 15:03:25 +02:00
2021-03-17 17:11:57 +03:00
smIdType NbNodes ( ) const ;
smIdType Nb0DElements ( ) const ;
smIdType NbBalls ( ) const ;
2022-10-21 15:03:25 +02:00
2021-03-17 17:11:57 +03:00
smIdType NbEdges ( SMDSAbs_ElementOrder order = ORDER_ANY ) const ;
2022-10-21 15:03:25 +02:00
2021-03-17 17:11:57 +03:00
smIdType NbFaces ( SMDSAbs_ElementOrder order = ORDER_ANY ) const ;
smIdType NbTriangles ( SMDSAbs_ElementOrder order = ORDER_ANY ) const ;
smIdType NbQuadrangles ( SMDSAbs_ElementOrder order = ORDER_ANY ) const ;
smIdType NbBiQuadQuadrangles ( ) const ;
smIdType NbBiQuadTriangles ( ) const ;
smIdType NbPolygons ( SMDSAbs_ElementOrder order = ORDER_ANY ) const ;
2022-10-21 15:03:25 +02:00
2021-03-17 17:11:57 +03:00
smIdType NbVolumes ( SMDSAbs_ElementOrder order = ORDER_ANY ) const ;
smIdType NbTetras ( SMDSAbs_ElementOrder order = ORDER_ANY ) const ;
smIdType NbHexas ( SMDSAbs_ElementOrder order = ORDER_ANY ) const ;
smIdType NbTriQuadraticHexas ( ) const ;
smIdType NbPyramids ( SMDSAbs_ElementOrder order = ORDER_ANY ) const ;
smIdType NbPrisms ( SMDSAbs_ElementOrder order = ORDER_ANY ) const ;
smIdType NbQuadPrisms ( ) const ;
smIdType NbBiQuadPrisms ( ) const ;
smIdType NbHexagonalPrisms ( ) const ;
smIdType NbPolyhedrons ( ) const ;
2022-10-21 15:03:25 +02:00
2021-03-17 17:11:57 +03:00
smIdType NbSubMesh ( ) const ;
2022-10-21 15:03:25 +02:00
2021-03-17 17:11:57 +03:00
size_t NbGroup ( ) const { return _mapGroup . size ( ) ; }
2012-08-09 10:03:55 +00:00
2015-02-25 20:07:02 +03:00
int NbMeshes ( ) const ; // nb meshes in the Study
2004-12-01 10:48:31 +00:00
SMESH_Group * AddGroup ( const SMDSAbs_ElementType theType ,
2012-08-09 10:03:55 +00:00
const char * theName ,
2019-01-17 15:53:49 +03:00
const int theId = - 1 ,
const TopoDS_Shape & theShape = TopoDS_Shape ( ) ,
const SMESH_PredicatePtr & thePredicate = SMESH_PredicatePtr ( ) ) ;
2012-10-08 11:56:59 +00:00
2020-08-21 08:05:05 +03:00
SMESH_Group * AddGroup ( SMESHDS_GroupBase * groupDS ) ;
2012-10-08 11:56:59 +00:00
2008-03-07 07:47:05 +00:00
typedef boost : : shared_ptr < SMDS_Iterator < SMESH_Group * > > GroupIteratorPtr ;
GroupIteratorPtr GetGroups ( ) const ;
2022-10-21 15:03:25 +02:00
2008-03-07 07:47:05 +00:00
std : : list < int > GetGroupIds ( ) const ;
2022-10-21 15:03:25 +02:00
2019-01-17 15:53:49 +03:00
SMESH_Group * GetGroup ( const int theGroupID ) const ;
2004-12-17 11:07:35 +00:00
2012-08-09 10:03:55 +00:00
bool RemoveGroup ( const int theGroupID ) ;
2004-12-17 11:07:35 +00:00
2009-02-17 05:27:49 +00:00
SMESH_Group * ConvertToStandalone ( int theGroupID ) ;
2005-01-21 14:11:17 +00:00
2012-08-09 10:03:55 +00:00
struct TCallUp // callback from SMESH to SMESH_I level
{
2020-01-10 14:33:42 +03:00
virtual void RemoveGroup ( const int theGroupID ) = 0 ;
virtual void HypothesisModified ( int hypID , bool updateIcons ) = 0 ;
virtual void Load ( ) = 0 ;
virtual bool IsLoaded ( ) = 0 ;
2020-10-09 11:44:21 +03:00
virtual TopoDS_Shape GetShapeByEntry ( const std : : string & entry ) = 0 ;
2012-08-09 10:03:55 +00:00
virtual ~ TCallUp ( ) { }
} ;
void SetCallUp ( TCallUp * upCaller ) ;
bool SynchronizeGroups ( ) ;
2021-03-17 17:11:57 +03:00
SMDSAbs_ElementType GetElementType ( const smIdType id , const bool iselem ) ;
2004-12-17 11:07:35 +00:00
2012-08-09 10:03:55 +00:00
void ClearMeshOrder ( ) ;
void SetMeshOrder ( const TListOfListOfInt & theOrder ) ;
const TListOfListOfInt & GetMeshOrder ( ) const ;
2012-10-08 11:56:59 +00:00
// sort submeshes according to stored mesh order
2014-07-22 16:40:10 +04:00
bool SortByMeshOrder ( std : : vector < SMESH_subMesh * > & theListToSort ) const ;
2012-08-09 10:03:55 +00:00
2012-10-08 11:56:59 +00:00
// return true if given order of sub-meshes is OK
bool IsOrderOK ( const SMESH_subMesh * smBefore ,
const SMESH_subMesh * smAfter ) const ;
2019-12-17 22:19:00 +03:00
std : : ostream & Dump ( std : : ostream & save ) ;
2022-10-21 15:03:25 +02:00
// Parallel computation functions
2023-03-09 16:32:55 +01:00
virtual void Lock ( ) { } ;
virtual void Unlock ( ) { } ;
2022-10-21 15:03:25 +02:00
2023-03-09 16:32:55 +01:00
virtual int GetNbThreads ( ) { return 0 ; } ;
virtual void SetNbThreads ( long nbThreads ) { ( void ) nbThreads ; } ;
2022-10-21 15:03:25 +02:00
2023-03-09 16:32:55 +01:00
virtual void InitPoolThreads ( ) { std : : cout < < " Should not pass here: InitPoolThread " < < std : : endl ; } ;
virtual void DeletePoolThreads ( ) { std : : cout < < " Should not pass here: DeletePoolThread " < < std : : endl ; } ;
virtual void wait ( ) { std : : cout < < " Should not pass here: wait " < < std : : endl ; } ;
2022-10-21 15:03:25 +02:00
2023-03-09 16:32:55 +01:00
virtual bool IsParallel ( ) { std : : cout < < " Should not pass here: IsParallel " < < std : : endl ; return false ; } ;
2022-10-21 15:03:25 +02:00
2023-03-28 08:46:24 +02:00
# ifndef WIN32
2023-03-09 16:32:55 +01:00
virtual boost : : filesystem : : path GetTmpFolder ( ) { return " " ; } ;
virtual boost : : asio : : thread_pool * GetPool ( ) { return NULL ; } ;
2023-03-28 08:45:16 +02:00
# endif
2022-10-21 15:03:25 +02:00
2023-03-09 16:32:55 +01:00
virtual bool ComputeSubMeshes (
SMESH_Gen * gen ,
SMESH_Mesh & aMesh ,
const TopoDS_Shape & aShape ,
const : : MeshDimension aDim ,
TSetOfInt * aShapesId /*=0*/ ,
TopTools_IndexedMapOfShape * allowedSubShapes ,
SMESH_subMesh : : compute_event & computeEvent ,
const bool includeSelf ,
const bool complexShapeFirst ,
const bool aShapeOnly ) { ( void ) gen ; ( void ) aMesh ; ( void ) aShape ; ( void ) aDim ; ( void ) aShapesId ; ( void ) allowedSubShapes ; ( void ) computeEvent ; ( void ) includeSelf ; ( void ) complexShapeFirst ; ( void ) aShapeOnly ; std : : cout < < " Should not pass here: computesubmesh " < < std : : endl ; return false ; } ;
2022-10-21 15:03:25 +02:00
2004-12-17 11:07:35 +00:00
private :
2012-08-09 10:03:55 +00:00
2021-07-22 14:10:49 +03:00
void exportMEDCommmon ( DriverMED_W_SMESHDS_Mesh & myWriter ,
const char * theMeshName ,
bool theAutoGroups ,
const SMESHDS_Mesh * meshPart ,
bool theAutoDimension ,
bool theAddODOnVertices ,
double theZTolerance ,
2021-10-20 14:48:04 +03:00
bool theSaveNumbers ) ;
2021-07-22 14:10:49 +03:00
private :
2012-08-09 10:03:55 +00:00
void fillAncestorsMap ( const TopoDS_Shape & theShape ) ;
2014-07-22 16:40:10 +04:00
void getAncestorsSubMeshes ( const TopoDS_Shape & theSubShape ,
std : : vector < SMESH_subMesh * > & theSubMeshes ) const ;
2022-10-21 15:03:25 +02:00
2008-03-07 07:47:05 +00:00
protected :
2005-01-26 08:35:00 +00:00
int _id ; // id given by creator (unique within the creator instance)
int _groupId ; // id generator for group objects
2012-08-09 10:03:55 +00:00
int _nbSubShapes ; // initial nb of subshapes in the shape to mesh
2005-01-26 08:35:00 +00:00
bool _isShapeToMesh ; // set to true when a shape is given (only once)
2021-07-22 14:10:49 +03:00
SMESHDS_Document * _document ;
SMESHDS_Mesh * _meshDS ;
2012-08-09 10:03:55 +00:00
SMESH_Gen * _gen ;
2014-07-22 16:40:10 +04:00
std : : map < int , SMESH_Group * > _mapGroup ;
class SubMeshHolder ;
SubMeshHolder * _subMeshHolder ;
2022-10-21 15:03:25 +02:00
2008-03-07 07:47:05 +00:00
bool _isAutoColor ;
2012-08-09 10:03:55 +00:00
bool _isModified ; //!< modified since last total re-compute, issue 0020693
2009-02-17 05:27:49 +00:00
double _shapeDiagonal ; //!< diagonal size of bounding box of shape to mesh
2022-10-21 15:03:25 +02:00
2004-12-01 10:48:31 +00:00
TopTools_IndexedDataMapOfShapeListOfShape _mapAncestors ;
2004-12-17 11:07:35 +00:00
2014-07-22 16:40:10 +04:00
mutable std : : vector < SMESH_subMesh * > _ancestorSubMeshes ; // to speed up GetHypothes[ei]s()
2021-07-22 14:10:49 +03:00
TListOfListOfInt _subMeshOrder ;
2012-08-09 10:03:55 +00:00
// Struct calling methods at CORBA API implementation level, used to
2014-07-22 16:40:10 +04:00
// 1) make an upper level (SMESH_I) be consistent with a lower one (SMESH)
// when group removal is invoked by hyp modification (issue 0020918)
2012-08-09 10:03:55 +00:00
// 2) to forget not loaded mesh data at hyp modification
TCallUp * _callUp ;
2022-10-21 15:03:25 +02:00
// Mutex for multhitreading write in SMESH_Mesh
2023-03-28 08:46:24 +02:00
# ifndef WIN32
2022-10-21 15:03:25 +02:00
boost : : mutex _my_lock ;
# endif
2023-03-09 16:32:55 +01:00
int _NbThreads = - 1 ;
2022-10-21 15:03:25 +02:00
2008-03-07 07:47:05 +00:00
protected :
2012-08-09 10:03:55 +00:00
SMESH_Mesh ( ) ;
2008-03-07 07:47:05 +00:00
SMESH_Mesh ( const SMESH_Mesh & ) { } ;
2003-05-19 13:18:36 +00:00
} ;
# endif