Salome HOME
bos #20256: [CEA 18523] Porting SMESH to int 64 bits
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPlugin_Hypothesis.hxx
index 705dc72b8ca0fde385733345d01c402fe22c9d40..134a51db1a2b33cd2bd2402ac0323589b2e0f969 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -36,6 +36,7 @@
 #include <cstring>
 #include <sstream>
 #include <utilities.h>
+#include <smIdType.hxx>
 #include "BLSURFPlugin_Attractor.hxx"
 
 //  Parameters for work of MG-CADSurf
@@ -189,10 +190,10 @@ public:
   void SetJacobianRectification( bool allowRectification );
   bool GetJacobianRectification();
 
-  void SetMaxNumberOfPointsPerPatch( int nb ) throw (std::invalid_argument);
+  void SetMaxNumberOfPointsPerPatch( int nb );
   int  GetMaxNumberOfPointsPerPatch();
 
-  void SetMaxNumberOfThreads( int nb ) throw (std::invalid_argument);
+  void SetMaxNumberOfThreads( int nb );
   int  GetMaxNumberOfThreads();
 
   void SetRespectGeometry( bool toRespect );
@@ -207,26 +208,33 @@ public:
   void SetDebug( bool isDebug );
   bool GetDebug();
 
-  void SetPeriodicTolerance( double tol ) throw (std::invalid_argument);
+  void SetPeriodicTolerance( double tol );
   double GetPeriodicTolerance();
 
-  void SetRequiredEntities( const std::string& howToTreat ) throw (std::invalid_argument);
+  void SetRequiredEntities( const std::string& howToTreat );
   std::string GetRequiredEntities();
 
-  void SetSewingTolerance( double tol ) throw (std::invalid_argument);
+  void SetSewingTolerance( double tol );
   double GetSewingTolerance();
 
-  void SetTags( const std::string& howToTreat ) throw (std::invalid_argument);
+  void SetTags( const std::string& howToTreat );
   std::string GetTags();
 
   // Hyper-patches
   typedef std::set< int > THyperPatchTags;
   typedef std::vector< THyperPatchTags > THyperPatchList;
-
-  void SetHyperPatches(const THyperPatchList& hpl);
-  const THyperPatchList& GetHyperPatches() const { return _hyperPatchList; }
+  typedef std::set< std::string > THyperPatchEntries;
+  typedef std::vector< THyperPatchEntries > THyperPatchEntriesList;
+
+  void SetHyperPatches(const THyperPatchList& hpl, bool notifyMesh=true);
+  void SetHyperPatches(const THyperPatchEntriesList& hpl);
+  void SetHyperPatchIDsByEntry( const TopoDS_Shape&                          mainShape,
+                                const std::map< std::string, TopoDS_Shape >& entryToShape);
+  const THyperPatchList&        GetHyperPatches() const { return _hyperPatchList; }
+  const THyperPatchEntriesList& GetHyperPatchEntries() const { return _hyperPatchEntriesList; }
   static int GetHyperPatchTag( int faceTag, const BLSURFPlugin_Hypothesis* hyp, int* iPatch=0 );
 
+
   void SetPreCADMergeEdges(bool theVal);
   bool GetPreCADMergeEdges() const { return _preCADMergeEdges; }
 
@@ -365,7 +373,7 @@ public:
   // Map Vertex entry / Enforced vertex
   typedef std::map< TEntry, TEnfVertex* > TEnfVertexEntryEnfVertexMap;
 
-  typedef std::map< TEnfGroupName, std::set<int> > TGroupNameNodeIDMap;
+  typedef std::map< TEnfGroupName, std::set<smIdType> > TGroupNameNodeIDMap;
   /* TODO GROUPS
   // Map Group Name / List of enforced vertices
   typedef std::map< TEnfGroupName , TEnfVertexList > TGroupNameEnfVertexListMap;
@@ -380,17 +388,17 @@ public:
 
   bool                  SetEnforcedVertex(TEntry theFaceEntry, TEnfName theVertexName, TEntry theVertexEntry, TEnfGroupName theGroupName,
                                           double x = 0.0, double y = 0.0, double z = 0.0);
-  TEnfVertexList        GetEnfVertexList(const TEntry& theFaceEntry) throw (std::invalid_argument);
-  TEnfVertexCoordsList  GetEnfVertexCoordsList(const TEntry& theFaceEntry) throw (std::invalid_argument);
-  TEntryList            GetEnfVertexEntryList (const TEntry& theFaceEntry) throw (std::invalid_argument);
-  TEnfVertex*           GetEnfVertex(TEnfVertexCoords coords) throw (std::invalid_argument);
-  TEnfVertex*           GetEnfVertex(const TEntry& theEnfVertexEntry) throw (std::invalid_argument);
-  void                  AddEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID);
-  std::set<int>         GetEnfVertexNodeIDs(TEnfGroupName theGroupName) throw (std::invalid_argument);
-  void                  RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID) throw (std::invalid_argument);
+  TEnfVertexList        GetEnfVertexList(const TEntry& theFaceEntry);
+  TEnfVertexCoordsList  GetEnfVertexCoordsList(const TEntry& theFaceEntry);
+  TEntryList            GetEnfVertexEntryList (const TEntry& theFaceEntry);
+  TEnfVertex*           GetEnfVertex(TEnfVertexCoords coords);
+  TEnfVertex*           GetEnfVertex(const TEntry& theEnfVertexEntry);
+  void                  AddEnfVertexNodeID(TEnfGroupName theGroupName,smIdType theNodeID);
+  std::set<smIdType>    GetEnfVertexNodeIDs(TEnfGroupName theGroupName);
+  void                  RemoveEnfVertexNodeID(TEnfGroupName theGroupName,smIdType theNodeID);
   
-  bool ClearEnforcedVertex(const TEntry& theFaceEntry, double x = 0.0, double y = 0.0, double z = 0.0, const TEntry& theVertexEntry="") throw (std::invalid_argument);
-  bool ClearEnforcedVertices(const TEntry& theFaceEntry) throw (std::invalid_argument);
+  bool ClearEnforcedVertex(const TEntry& theFaceEntry, double x = 0.0, double y = 0.0, double z = 0.0, const TEntry& theVertexEntry="");
+  bool ClearEnforcedVertices(const TEntry& theFaceEntry);
 
   void ClearAllEnforcedVertices();
   void AddEnforcedVertex( const TEntry& theFaceEntry, TEnfVertex * theEnfVertex );
@@ -424,7 +432,7 @@ public:
    * \brief Internal enforced vertices
    */
   void SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices);
-  const bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; }
+  bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; }
   static bool GetInternalEnforcedVertexAllFaces( const BLSURFPlugin_Hypothesis* hyp );
   void SetInternalEnforcedVertexAllFacesGroup(TEnfGroupName theGroupName);
   const TEnfGroupName _GetInternalEnforcedVertexAllFacesGroup() const { return _enforcedInternalVerticesAllFacesGroup; }
@@ -539,11 +547,11 @@ public:
   typedef std::set< std::string >              TOptionNames;
 
   void SetOptionValue(const std::string& optionName,
-                      const std::string& optionValue) throw (std::invalid_argument);
+                      const std::string& optionValue);
   void SetPreCADOptionValue(const std::string& optionName,
-                            const std::string& optionValue) throw (std::invalid_argument);
-  std::string GetOptionValue(const std::string& optionName, bool* isDefault=0) const throw (std::invalid_argument);
-  std::string GetPreCADOptionValue(const std::string& optionName, bool* isDefault=0) const throw (std::invalid_argument);
+                            const std::string& optionValue);
+  std::string GetOptionValue(const std::string& optionName, bool* isDefault=0) const;
+  std::string GetPreCADOptionValue(const std::string& optionName, bool* isDefault=0) const;
   void ClearOption(const std::string& optionName);
   void ClearPreCADOption(const std::string& optionName);
   TOptionValues        GetOptionValues()       const;
@@ -555,9 +563,9 @@ public:
   std::string GetOption(const std::string& optionName) const;
   std::string GetPreCADOption(const std::string& optionName) const;
 
-  static bool  ToBool(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
-  static double ToDbl(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
-  static int    ToInt(const std::string& str, bool* isOk=0) throw (std::invalid_argument);
+  static bool  ToBool(const std::string& str, bool* isOk=0);
+  static double ToDbl(const std::string& str, bool* isOk=0);
+  static int    ToInt(const std::string& str, bool* isOk=0);
 
   /*!
     * Sets the file for export resulting mesh in GMF format
@@ -657,11 +665,12 @@ private:
   TPreCadPeriodicityVector _preCadFacesPeriodicityVector;
   TPreCadPeriodicityVector _preCadEdgesPeriodicityVector;
 
-  TFacesPeriodicityVector _facesPeriodicityVector;
-  TEdgesPeriodicityVector _edgesPeriodicityVector;
+  TFacesPeriodicityVector    _facesPeriodicityVector;
+  TEdgesPeriodicityVector    _edgesPeriodicityVector;
   TVerticesPeriodicityVector _verticesPeriodicityVector;
 
-  THyperPatchList _hyperPatchList;
+  THyperPatchList        _hyperPatchList;
+  THyperPatchEntriesList _hyperPatchEntriesList;
 
   // Called by SaveTo to store content of _preCadFacesPeriodicityVector and _preCadEdgesPeriodicityVector
   void SavePreCADPeriodicity(std::ostream & save, const char* shapeType);