// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// File : SMESH_Pattern.hxx
// Created : Mon Aug 2 10:30:00 2004
// Author : Edward AGAPOV (eap)
+using namespace std;
+
#ifndef SMESH_Pattern_HeaderFile
#define SMESH_Pattern_HeaderFile
+#include "SMESH_SMESH.hxx"
+
#include <vector>
#include <list>
#include <map>
// of 6 faces.
//
-class SMESH_Pattern {
+class SMESH_EXPORT SMESH_Pattern {
public:
SMESH_Pattern ();
bool Load (SMESH_Mesh* theMesh,
const TopoDS_Face& theFace,
- bool theProject);
+ bool theProject = false);
// Create a pattern from the mesh built on <theFace>.
// <theProject>==true makes override nodes positions
// on <theFace> computed by mesher
// the loaded pattern to <theFace>. The first key-point
// will be mapped into <theNodeIndexOnKeyPoint1>-th node
- bool Apply (std::set<const SMDS_MeshFace*>& theFaces,
+ bool Apply (SMESH_Mesh* theMesh,
+ const SMDS_MeshFace* theFace,
+ const TopoDS_Shape& theSurface,
+ const int theNodeIndexOnKeyPoint1,
+ const bool theReverse);
+ // Compute nodes coordinates applying
+ // the loaded pattern to <theFace>. The first key-point
+ // will be mapped into <theNodeIndexOnKeyPoint1>-th node
+
+ bool Apply (SMESH_Mesh* theMesh,
+ std::set<const SMDS_MeshFace*>& theFaces,
const int theNodeIndexOnKeyPoint1,
const bool theReverse);
// Compute nodes coordinates applying
// Create nodes and elements in <theMesh> using nodes
// coordinates computed by either of Apply...() methods
-
+ // ----------
// Inquiries
+ // ----------
enum ErrorCode {
ERR_OK,
// Load(face)
ERR_LOADF_NARROW_FACE, // too narrow face
ERR_LOADF_CLOSED_FACE, // closed face
+ ERR_LOADF_CANT_PROJECT, // impossible to project nodes
// Load(volume)
ERR_LOADV_BAD_SHAPE, // volume is not a brick of 6 faces
ERR_LOADV_COMPUTE_PARAMS, // cant compute point parameters
void DumpPoints() const;
// Debug
+ // -----------------------------
+ // Utilities for advanced usage
+ // -----------------------------
- private:
+ TopoDS_Shape GetSubShape( const int i ) const {
+ if ( i < 1 || i > myShapeIDMap.Extent() ) return TopoDS_Shape();
+ return myShapeIDMap( i );
+ }
+ // Return a shape from myShapeIDMap where shapes are indexed so that first go
+ // ordered vertices, then ordered edge, then faces and maybe a shell
+
+private:
// private methods
struct TPoint {