+ 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;
+
+ // 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; }
+
+