+ void SetUseVolumeGradation(bool toUse);
+ bool GetUseVolumeGradation() const { return _useVolumeGradation; }
+ void SetVolumeGradation(double theGradation);
+ double GetVolumeGradation() const { return _volumeGradation; }
+
+ void SetElementType(ElementType theElementType);
+ ElementType GetElementType() const { return _elementType; }
+
+ void SetAngleMesh(double theAngle);
+ double GetAngleMesh() const { return _angleMesh; }
+
+ void SetChordalError(double theDistance);
+ double GetChordalError() const { return _chordalError; }
+
+ void SetAnisotropic(bool theVal);
+ bool GetAnisotropic() const { return _anisotropic; }
+
+ void SetAnisotropicRatio(double theVal);
+ double GetAnisotropicRatio() const { return _anisotropicRatio; }
+
+ void SetRemoveTinyEdges(bool theVal);
+ bool GetRemoveTinyEdges() const { return _removeTinyEdges; }
+
+ void SetTinyEdgeLength(double theVal);
+ double GetTinyEdgeLength() const { return _tinyEdgeLength; }
+
+ void SetOptimiseTinyEdges(bool theVal);
+ bool GetOptimiseTinyEdges() const { return _optimiseTinyEdges; }
+
+ void SetTinyEdgeOptimisationLength(double theVal);
+ double GetTinyEdgeOptimisationLength() const { return _tinyEdgeOptimisationLength; }
+
+ void SetCorrectSurfaceIntersection(bool theVal);
+ bool GetCorrectSurfaceIntersection() const { return _correctSurfaceIntersec; }
+
+ void SetCorrectSurfaceIntersectionMaxCost(double theVal);
+ double GetCorrectSurfaceIntersectionMaxCost() const { return _corrSurfaceIntersCost; }
+
+ void SetBadElementRemoval(bool theVal);
+ bool GetBadElementRemoval() const { return _badElementRemoval; }
+
+ void SetBadElementAspectRatio(double theVal);
+ double GetBadElementAspectRatio() const { return _badElementAspectRatio; }
+
+ void SetOptimizeMesh(bool theVal);
+ bool GetOptimizeMesh() const { return _optimizeMesh; }
+
+ void SetQuadraticMesh(bool theVal);
+ bool GetQuadraticMesh() const { return _quadraticMesh; }
+
+ void SetTopology(Topology theTopology);
+ Topology GetTopology() const { return _topology; }
+
+ bool GetUseSurfaceProximity() const { return _useSurfaceProximity; }
+ void SetUseSurfaceProximity( bool toUse );
+
+ int GetNbSurfaceProximityLayers() const { return _nbSurfaceProximityLayers; }
+ void SetNbSurfaceProximityLayers( int nbLayers );
+
+ double GetSurfaceProximityRatio() const { return _surfaceProximityRatio; }
+ void SetSurfaceProximityRatio( double ratio );
+
+ bool GetUseVolumeProximity() const { return _useVolumeProximity; }
+ void SetUseVolumeProximity( bool toUse );
+
+ int GetNbVolumeProximityLayers() const { return _nbVolumeProximityLayers; }
+ void SetNbVolumeProximityLayers( int nbLayers );
+
+ double GetVolumeProximityRatio() const { return _volumeProximityRatio; }
+ void SetVolumeProximityRatio( double ratio );
+
+ void SetVerbosity(int theVal);
+ int GetVerbosity() const { return _verb; }
+
+ void ClearEntry(const std::string& entry, const char * attEntry = 0);
+ void ClearSizeMaps();
+
+ void SetEnforceCadEdgesSize( bool toEnforce );
+ bool GetEnforceCadEdgesSize();
+
+ void SetJacobianRectificationRespectGeometry( bool allowRectification );
+ bool GetJacobianRectificationRespectGeometry();
+
+ void SetUseDeprecatedPatchMesher( bool useDeprecatedPatchMesher );
+ bool GetUseDeprecatedPatchMesher();
+
+ void SetJacobianRectification( bool allowRectification );
+ bool GetJacobianRectification();
+
+ void SetMaxNumberOfPointsPerPatch( int nb );
+ int GetMaxNumberOfPointsPerPatch();
+
+ void SetMaxNumberOfThreads( int nb );
+ int GetMaxNumberOfThreads();
+
+ void SetRespectGeometry( bool toRespect );
+ bool GetRespectGeometry();
+
+ void SetTinyEdgesAvoidSurfaceIntersections( bool toAvoidIntersection );
+ bool GetTinyEdgesAvoidSurfaceIntersections();
+
+ void SetClosedGeometry( bool isClosed );
+ bool GetClosedGeometry();
+
+ void SetDebug( bool isDebug );
+ bool GetDebug();
+
+ void SetPeriodicTolerance( double tol );
+ double GetPeriodicTolerance();
+
+ void SetRequiredEntities( const std::string& howToTreat );
+ std::string GetRequiredEntities();
+
+ void SetSewingTolerance( double tol );
+ double GetSewingTolerance();
+
+ void SetTags( const std::string& howToTreat );
+ std::string GetTags();
+
+ // Hyper-patches
+ typedef std::set< int > THyperPatchTags;
+ typedef std::vector< THyperPatchTags > THyperPatchList;
+ 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 );
+
+ // Enforced mesh
+ struct EnforcedMesh
+ {
+ int _meshID; // persistent mesh ID
+ int _subID; // either persistent group ID or sub-shape ID for sub-mesh
+ EnforcedMeshType _type; /* specify what _subID means:
+ - nothing for ENFORCED_MESH
+ - group ID for ENFORCED_GROUP
+ - sub-shape ID for ENFORCED_SUBMESH */
+ std::string _groupName; // name of a group to add mesh edges to
+
+ bool operator==(const EnforcedMesh& em ) const
+ {
+ return ( _meshID == em._meshID && _subID == em._subID &&
+ _type == em._type && _groupName == em._groupName );
+ }
+ };
+
+ void SetEnforcedMeshes( std::vector< EnforcedMesh > & enforcedMeshes );
+ const std::vector< EnforcedMesh > & GetEnforcedMeshes() const { return _enforcedMeshes; }
+ SMDS_ElemIteratorPtr GetEnforcedSegments( const EnforcedMesh& enfMesh,
+ SMESH_Mesh* & mesh ) const;
+
+
+ void SetPreCADMergeEdges(bool theVal);
+ bool GetPreCADMergeEdges() const { return _preCADMergeEdges; }
+
+ void SetPreCADRemoveDuplicateCADFaces(bool theVal);
+ bool GetPreCADRemoveDuplicateCADFaces() const { return _preCADRemoveDuplicateCADFaces; }
+
+ void SetPreCADProcess3DTopology(bool theVal);
+ bool GetPreCADProcess3DTopology() const { return _preCADProcess3DTopology; }
+
+ void SetPreCADDiscardInput(bool theVal);
+ bool GetPreCADDiscardInput() const { return _preCADDiscardInput; }
+
+ static bool HasPreCADOptions(const BLSURFPlugin_Hypothesis* hyp);
+
+ typedef std::map<std::string,std::string> TSizeMap;
+
+ void SetSizeMapEntry(const std::string& entry,const std::string& sizeMap );
+ std::string GetSizeMapEntry(const std::string& entry);
+ const TSizeMap& _GetSizeMapEntries() const { return _sizeMap; }
+ /*!
+ * \brief Return the size maps
+ */
+ static TSizeMap GetSizeMapEntries(const BLSURFPlugin_Hypothesis* hyp);
+
+
+ void SetAttractorEntry(const std::string& entry,const std::string& attractor );
+ std::string GetAttractorEntry(const std::string& entry);
+ const TSizeMap& _GetAttractorEntries() const { return _attractors; };
+ /*!
+ * \brief Return the attractors
+ */
+ static TSizeMap GetAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
+
+
+/*
+ void SetCustomSizeMapEntry(const std::string& entry,const std::string& sizeMap );
+ std::string GetCustomSizeMapEntry(const std::string& entry);
+ void UnsetCustomSizeMap(const std::string& entry);
+ const TSizeMap& GetCustomSizeMapEntries() const { return _customSizeMap; }
+ */
+
+ typedef std::multimap< std::string, BLSURFPlugin_Attractor* > TAttractorMap;
+ typedef std::map< std::string, std::vector<double> > TParamsMap; //TODO ?? finir
+
+ void SetClassAttractorEntry(const std::string& entry, const std::string& att_entry, double StartSize, double EndSize, double ActionRadius, double ConstantRadius);
+ std::string GetClassAttractorEntry(const std::string& entry);
+ const TAttractorMap& _GetClassAttractorEntries() const { return _classAttractors; }
+ /*!
+ * \brief Return the attractors entries
+ */
+ static TAttractorMap GetClassAttractorEntries(const BLSURFPlugin_Hypothesis* hyp);
+
+ /*!
+ * To set/get/unset an enforced vertex
+ */
+ // Name
+ typedef std::string TEnfName;
+ // Entry
+ typedef std::string TEntry;
+ // List of entries
+ typedef std::set<TEntry> TEntryList;
+ // Group name
+ typedef std::string TEnfGroupName;
+ // Coordinates
+ typedef std::vector<double> TEnfVertexCoords;
+ typedef std::set< TEnfVertexCoords > TEnfVertexCoordsList;
+
+ // Enforced vertex
+ struct TEnfVertex {
+ TEnfName name;
+ TEntry geomEntry;
+ TEnfVertexCoords coords;
+ TEnfGroupName grpName;
+ TEntryList faceEntries;
+ TopoDS_Vertex vertex;
+ };
+
+ struct CompareEnfVertices
+ {
+ bool operator () (const TEnfVertex* e1, const TEnfVertex* e2) const {
+ if (e1 && e2) {
+ if (e1->coords.size() && e2->coords.size())
+ return (e1->coords < e2->coords);
+ else
+ return (e1->geomEntry < e2->geomEntry);
+ }
+ return false;
+ }
+ };
+
+ // PreCad Face and Edge periodicity
+ struct TPreCadPeriodicity {
+ TEntry shape1Entry;
+ TEntry shape2Entry;
+ std::vector<std::string> theSourceVerticesEntries;
+ std::vector<std::string> theTargetVerticesEntries;
+ };
+
+ // Edge periodicity
+ struct TEdgePeriodicity {
+ TEntry theFace1Entry;
+ TEntry theEdge1Entry;
+ TEntry theFace2Entry;
+ TEntry theEdge2Entry;
+ int edge_orientation;
+ };
+
+ // Vertex periodicity
+ struct TVertexPeriodicity {
+ TEntry theEdge1Entry;
+ TEntry theVertex1Entry;
+ TEntry theEdge2Entry;
+ TEntry theVertex2Entry;
+ };
+
+ typedef std::pair< TEntry, TEntry > TFacesPeriodicity;
+
+ // List of enforced vertices
+ typedef std::set< TEnfVertex*, CompareEnfVertices > TEnfVertexList;
+
+ // Map Face Entry / List of enforced vertices
+ typedef std::map< TEntry, TEnfVertexList > TFaceEntryEnfVertexListMap;
+
+ // List of Face Entry with internal enforced vertices activated
+ typedef std::set< TEntry > TFaceEntryInternalVerticesList;
+
+ // Map Face Entry / List of coords
+ typedef std::map< TEntry, TEnfVertexCoordsList > TFaceEntryCoordsListMap;
+
+ // Map Face Entry / List of Vertex entry
+ typedef std::map< TEntry, TEntryList > TFaceEntryEnfVertexEntryListMap;
+
+ // Map Coords / Enforced vertex
+ typedef std::map< TEnfVertexCoords, TEnfVertex* > TCoordsEnfVertexMap;
+
+ // Map Vertex entry / Enforced vertex
+ typedef std::map< TEntry, TEnfVertex* > TEnfVertexEntryEnfVertexMap;
+
+ typedef std::map< TEnfGroupName, std::set<smIdType> > TGroupNameNodeIDMap;
+ /* TODO GROUPS
+ // Map Group Name / List of enforced vertices
+ typedef std::map< TEnfGroupName , TEnfVertexList > TGroupNameEnfVertexListMap;
+ */
+
+ // Vector of pairs of entries
+ typedef std::vector< TPreCadPeriodicity > TPreCadPeriodicityVector;
+ typedef std::vector< TFacesPeriodicity > TFacesPeriodicityVector;
+ typedef std::vector< TEdgePeriodicity > TEdgesPeriodicityVector;
+ typedef std::vector< TVertexPeriodicity > TVerticesPeriodicityVector;
+
+
+ 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);
+ 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="");
+ bool ClearEnforcedVertices(const TEntry& theFaceEntry);
+
+ void ClearAllEnforcedVertices();
+ void AddEnforcedVertex( const TEntry& theFaceEntry, TEnfVertex * theEnfVertex );
+
+ const TFaceEntryEnfVertexListMap& _GetAllEnforcedVerticesByFace() const { return _faceEntryEnfVertexListMap; }
+ const TEnfVertexList& _GetAllEnforcedVertices() const { return _enfVertexList; }
+
+ const TFaceEntryCoordsListMap& _GetAllCoordsByFace() const { return _faceEntryCoordsListMap; }
+ const TCoordsEnfVertexMap& _GetAllEnforcedVerticesByCoords() const { return _coordsEnfVertexMap; }
+
+ const TFaceEntryEnfVertexEntryListMap& _GetAllEnfVertexEntriesByFace() const { return _faceEntryEnfVertexEntryListMap; }
+ const TEnfVertexEntryEnfVertexMap& _GetAllEnforcedVerticesByEnfVertexEntry() const { return _enfVertexEntryEnfVertexMap; }
+
+// TODO GROUPS
+// const TEnfVertexGroupNameMap _GetEnforcedVertexGroupNameMap() const { return _enfVertexGroupNameMap; }
+
+
+ /*!
+ * \brief Return the enforced vertices
+ */
+ static TFaceEntryEnfVertexListMap GetAllEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
+ static TEnfVertexList GetAllEnforcedVertices(const BLSURFPlugin_Hypothesis* hyp);
+
+ static TFaceEntryCoordsListMap GetAllCoordsByFace(const BLSURFPlugin_Hypothesis* hyp);
+ static TCoordsEnfVertexMap GetAllEnforcedVerticesByCoords(const BLSURFPlugin_Hypothesis* hyp);
+
+ static TFaceEntryEnfVertexEntryListMap GetAllEnfVertexEntriesByFace(const BLSURFPlugin_Hypothesis* hyp);
+ static TEnfVertexEntryEnfVertexMap GetAllEnforcedVerticesByEnfVertexEntry(const BLSURFPlugin_Hypothesis* hyp);
+
+ /*!
+ * \brief Internal enforced vertices
+ */
+ void SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices);
+ bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; }
+ static bool GetInternalEnforcedVertexAllFaces( const BLSURFPlugin_Hypothesis* hyp );
+ void SetInternalEnforcedVertexAllFacesGroup(TEnfGroupName theGroupName);
+ const TEnfGroupName _GetInternalEnforcedVertexAllFacesGroup() const { return _enforcedInternalVerticesAllFacesGroup; }
+ static TEnfGroupName GetInternalEnforcedVertexAllFacesGroup( const BLSURFPlugin_Hypothesis* hyp );
+
+// Enable internal enforced vertices on specific face if requested by user
+// static TFaceEntryInternalVerticesList GetDefaultFaceEntryInternalVerticesMap() { return TFaceEntryInternalVerticesList(); }
+// const TFaceEntryInternalVerticesList _GetAllInternalEnforcedVerticesByFace() const { return _faceEntryInternalVerticesList; }
+// static TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesByFace(const BLSURFPlugin_Hypothesis* hyp);
+// void SetInternalEnforcedVertex(TEntry theFaceEntry, bool toEnforceInternalVertices, TEnfGroupName theGroupName);
+// bool GetInternalEnforcedVertex(const TEntry& theFaceEntry);
+
+ static PhysicalMesh GetDefaultPhysicalMesh() { return PhysicalGlobalSize; }
+ static GeometricMesh GetDefaultGeometricMesh() { return GeometricalGlobalSize; }
+ static double GetDefaultPhySize(double diagonal, double bbSegmentation);
+ static double GetDefaultPhySize() { return undefinedDouble(); }
+ static bool GetDefaultPhySizeRel() { return false; }
+ static double GetDefaultMinSize(double diagonal);
+ static double GetDefaultMinSize() { return undefinedDouble(); }
+ static bool GetDefaultMinSizeRel() { return false; }
+ static double GetDefaultMaxSize(double diagonal);
+ static double GetDefaultMaxSize() { return undefinedDouble(); }
+ static bool GetDefaultMaxSizeRel() { return false; }
+ static bool GetDefaultUseGradation() { return true; }
+ static double GetDefaultGradation() { return 1.3; }
+ static bool GetDefaultUseVolumeGradation() { return false; }
+ static double GetDefaultVolumeGradation() { return 2; }
+ static ElementType GetDefaultElementType() { return Triangles; }
+ static double GetDefaultAngleMesh() { return 8.0; }
+ static bool GetDefaultUseSurfaceProximity() { return false; }
+ static int GetDefaultNbSurfaceProximityLayers() { return 1; }
+ static double GetDefaultSurfaceProximityRatio() { return 1.; }
+ static bool GetDefaultUseVolumeProximity() { return false; }
+ static int GetDefaultNbVolumeProximityLayers() { return 1; }
+ static double GetDefaultVolumeProximityRatio() { return 1.; }