#include "SMESH_SMESHDS.hxx"
#include "SMDS_Mesh.hxx"
+#include "SMESH_Utils.hxx"
+#include "SMESH_RegularGrid.hxx"
#include "SMESHDS_SubMesh.hxx"
+#include <Basics_OCCTVersion.hxx>
+
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopoDS_Shape.hxx>
* So this functionality implement on new NCollection_DataMap technology
*/
#include <NCollection_DataMap.hxx>
-#include "SMESHDS_DataMapOfShape.hxx"
typedef std::list<const SMESHDS_Hypothesis*> THypList;
+
+struct SMESHDS_Hasher
+{
+#if OCC_VERSION_LARGE < 0x07080000
+ static inline Standard_Boolean IsEqual(const TopoDS_Shape& S1,
+ const TopoDS_Shape& S2)
+ {
+ return S1.IsSame(S2);
+ }
+ static inline Standard_Integer HashCode(const TopoDS_Shape& S,
+ const Standard_Integer Upper)
+ {
+ return ::HashCode( S, Upper);
+ }
+#else
+ bool operator()(const TopoDS_Shape& S1, const TopoDS_Shape& S2) const
+ {
+ // for the purpose of ShapeToHypothesis map we don't consider shapes orientation
+ return S1.IsSame(S2);
+ }
+ size_t operator()(const TopoDS_Shape& S) const
+ {
+ return std::hash<TopoDS_Shape>{}(S);
+ }
+#endif
+};
+
typedef NCollection_DataMap< TopoDS_Shape, THypList, SMESHDS_Hasher > ShapeToHypothesis;
class SMESHDS_GroupBase;
void CleanDownWardConnectivity();
void BuildDownWardConnectivity(bool withEdges);
+ virtual void SetStructuredGrid( const TopoDS_Shape & shape, const int nx, const int ny, const int nz = 1 );
+ virtual void SetNodeOnStructuredGrid( const TopoDS_Shape & shape, const std::shared_ptr<gp_Pnt>& P, const int iIndex, const int jIndex, const int kIndex = 0 );
+ virtual void SetNodeOnStructuredGrid( const TopoDS_Shape & shape, const SMDS_MeshNode* point, const int iIndex, const int jIndex, const int kIndex = 0 );
+ virtual void SetNodeOnStructuredGrid( const TopoDS_Shape & shape, const SMDS_MeshNode* point, const int index );
+ virtual bool HasStructuredGridFilled( const TopoDS_Shape & shape ) const;
+ virtual bool HasSomeStructuredGridFilled() const;
+ virtual const std::shared_ptr<SMESHUtils::SMESH_RegularGrid>& GetTheGrid( const TopoDS_Shape & shape );
~SMESHDS_Mesh();
private:
int add( const SMDS_MeshElement* elem, SMESHDS_SubMesh* subMesh );
SMESHDS_SubMesh* getSubmesh( const TopoDS_Shape & shape);
+
+ // Index the regular grid associated to the mesh in the geometry index
+ NCollection_DataMap<int,std::shared_ptr<SMESHUtils::SMESH_RegularGrid>> myRegularGrid;
};