1 // Copyright (C) 2007-2019 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 // File : BLSURFPlugin_Hypothesis.hxx
22 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
23 // Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
26 #ifndef _BLSURFPlugin_Hypothesis_i_HXX_
27 #define _BLSURFPlugin_Hypothesis_i_HXX_
29 #include <SALOMEconfig.h>
30 #include CORBA_SERVER_HEADER(BLSURFPlugin_Algorithm)
32 #include "SMESH_Hypothesis_i.hxx"
33 #include "BLSURFPlugin_Hypothesis.hxx"
38 // BLSURFPlugin parameters hypothesis
40 class BLSURFPlugin_Hypothesis_i:
41 public virtual POA_BLSURFPlugin::BLSURFPlugin_Hypothesis,
42 public virtual SMESH_Hypothesis_i
46 BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA,
47 ::SMESH_Gen* theGenImpl,
50 virtual ~BLSURFPlugin_Hypothesis_i();
52 void SetPhysicalMesh(CORBA::Long theValue);
53 CORBA::Long GetPhysicalMesh();
55 void SetGeometricMesh(CORBA::Long theValue);
56 CORBA::Long GetGeometricMesh();
58 void SetPhySize(CORBA::Double theValue);
59 void SetPhySizeRel(CORBA::Double theValue);
60 CORBA::Double GetPhySize();
61 CORBA::Boolean IsPhySizeRel();
63 void SetMinSize(CORBA::Double theMinSize);
64 void SetMinSizeRel(CORBA::Double theMinSize);
65 CORBA::Double GetMinSize();
66 CORBA::Boolean IsMinSizeRel();
68 void SetMaxSize(CORBA::Double theMaxSize);
69 void SetMaxSizeRel(CORBA::Double theMaxSize);
70 CORBA::Double GetMaxSize();
71 CORBA::Boolean IsMaxSizeRel();
73 void SetUseGradation(CORBA::Boolean theValue);
74 CORBA::Boolean GetUseGradation();
75 void SetGradation(CORBA::Double theValue);
76 CORBA::Double GetGradation();
78 void SetUseVolumeGradation(CORBA::Boolean theValue);
79 CORBA::Boolean GetUseVolumeGradation();
80 void SetVolumeGradation(CORBA::Double theValue);
81 CORBA::Double GetVolumeGradation();
83 void SetQuadAllowed(CORBA::Boolean theValue);
85 void SetElementType(CORBA::Long theValue);
86 CORBA::Long GetElementType();
88 void SetAngleMesh(CORBA::Double theValue);
89 CORBA::Double GetAngleMesh();
91 void SetChordalError(CORBA::Double distance);
92 CORBA::Double GetChordalError();
94 void SetAnisotropic(CORBA::Boolean anisotropic);
95 CORBA::Boolean GetAnisotropic();
97 void SetAnisotropicRatio(CORBA::Double ratio);
98 CORBA::Double GetAnisotropicRatio();
100 void SetRemoveTinyEdges(CORBA::Boolean remove);
101 CORBA::Boolean GetRemoveTinyEdges();
103 void SetTinyEdgeLength(CORBA::Double length);
104 CORBA::Double GetTinyEdgeLength();
106 void SetOptimiseTinyEdges(CORBA::Boolean toOptimise);
107 CORBA::Boolean GetOptimiseTinyEdges();
109 void SetTinyEdgeOptimisationLength(CORBA::Double length);
110 CORBA::Double GetTinyEdgeOptimisationLength();
112 void SetCorrectSurfaceIntersection(CORBA::Boolean toOptimise);
113 CORBA::Boolean GetCorrectSurfaceIntersection();
115 void SetCorrectSurfaceIntersectionMaxCost(CORBA::Double maxCost);
116 CORBA::Double GetCorrectSurfaceIntersectionMaxCost();
118 void SetBadElementRemoval(CORBA::Boolean remove);
119 CORBA::Boolean GetBadElementRemoval();
121 void SetBadElementAspectRatio(CORBA::Double ratio);
122 CORBA::Double GetBadElementAspectRatio();
124 void SetOptimizeMesh(CORBA::Boolean optimize);
125 CORBA::Boolean GetOptimizeMesh();
127 void SetQuadraticMesh(CORBA::Boolean quadratic);
128 CORBA::Boolean GetQuadraticMesh();
130 void SetTopology(CORBA::Long theValue);
131 CORBA::Long GetTopology();
135 * Activate/deactivate surface proximity computation
137 void SetSurfaceProximity( CORBA::Boolean toUse );
138 CORBA::Boolean GetSurfaceProximity();
141 * Set number of surface element layers to be generated due to surface proximity
143 void SetNbSurfaceProximityLayers( CORBA::Short nbLayers );
144 CORBA::Short GetNbSurfaceProximityLayers();
147 * Set coefficient by which size of element refined due to surface proximity is increased
149 void SetSurfaceProximityRatio( CORBA::Double ratio );
150 CORBA::Double GetSurfaceProximityRatio();
153 * Activate/deactivate volume proximity computation
155 void SetVolumeProximity( CORBA::Boolean toUse );
156 CORBA::Boolean GetVolumeProximity();
159 * Set number of surface element layers to be generated due to volume proximity
161 void SetNbVolumeProximityLayers( CORBA::Short nbLayers );
162 CORBA::Short GetNbVolumeProximityLayers();
165 * Set coefficient by which size of element refined due to volume proximity is increased
167 void SetVolumeProximityRatio( CORBA::Double ratio );
168 CORBA::Double GetVolumeProximityRatio();
171 void SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception);
172 CORBA::Short GetVerbosity();
174 void SetEnforceCadEdgesSize( CORBA::Boolean toEnforce );
175 CORBA::Boolean GetEnforceCadEdgesSize();
177 void SetJacobianRectificationRespectGeometry( CORBA::Boolean allowRectification );
178 CORBA::Boolean GetJacobianRectificationRespectGeometry();
180 void SetUseDeprecatedPatchMesher( CORBA::Boolean useDeprecatedPatchMesher );
181 CORBA::Boolean GetUseDeprecatedPatchMesher();
183 void SetJacobianRectification( CORBA::Boolean allowRectification );
184 CORBA::Boolean GetJacobianRectification();
186 void SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
187 CORBA::Long GetMaxNumberOfPointsPerPatch();
189 void SetMaxNumberOfThreads( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
190 CORBA::Long GetMaxNumberOfThreads();
192 void SetRespectGeometry( CORBA::Boolean toRespect );
193 CORBA::Boolean GetRespectGeometry();
195 void SetTinyEdgesAvoidSurfaceIntersections( CORBA::Boolean toAvoidIntersection );
196 CORBA::Boolean GetTinyEdgesAvoidSurfaceIntersections();
198 void SetClosedGeometry( CORBA::Boolean isClosed );
199 CORBA::Boolean GetClosedGeometry();
201 void SetDebug( CORBA::Boolean isDebug );
204 void SetPeriodicTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
205 double GetPeriodicTolerance() throw (SALOME::SALOME_Exception);
207 void SetRequiredEntities( const char* howToTreat ) throw (SALOME::SALOME_Exception);
208 char* GetRequiredEntities();
210 void SetSewingTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
211 CORBA::Double GetSewingTolerance() throw (SALOME::SALOME_Exception);
213 void SetTags( const char* howToTreat ) throw (SALOME::SALOME_Exception);
216 void SetHyperPatches(const BLSURFPlugin::THyperPatchList& hpl);
217 BLSURFPlugin::THyperPatchList* GetHyperPatches();
219 void SetPreCADMergeEdges(CORBA::Boolean theValue);
220 CORBA::Boolean GetPreCADMergeEdges();
222 void SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue);
223 CORBA::Boolean GetPreCADRemoveDuplicateCADFaces();
225 void SetPreCADProcess3DTopology(CORBA::Boolean theValue);
226 CORBA::Boolean GetPreCADProcess3DTopology();
228 void SetPreCADDiscardInput(CORBA::Boolean theValue);
229 CORBA::Boolean GetPreCADDiscardInput();
231 void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
232 void SetPreCADOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
233 char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
234 char* GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
236 void UnsetOption(const char* optionName);
237 void UnsetPreCADOption(const char* optionName);
239 BLSURFPlugin::string_array* GetOptionValues();
240 BLSURFPlugin::string_array* GetPreCADOptionValues();
241 BLSURFPlugin::string_array* GetAdvancedOptionValues();
243 void SetOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
244 void SetPreCADOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
245 void SetAdvancedOptionValues(const BLSURFPlugin::string_array& options);
246 void SetAdvancedOption(const char* optionsAndValues) throw (SALOME::SALOME_Exception);
248 void AddOption(const char* optionName, const char* optionValue);
249 void AddPreCADOption(const char* optionName, const char* optionValue);
250 char* GetOption(const char* optionName);
251 char* GetPreCADOption(const char* optionName);
253 void SetSizeMapEntry(const char* entry, const char* sizeMap) throw (SALOME::SALOME_Exception);
255 void SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap) throw (SALOME::SALOME_Exception);
257 char* GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
259 void UnsetEntry(const char* entry);
261 BLSURFPlugin::string_array* GetSizeMapEntries();
263 void SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps) throw (SALOME::SALOME_Exception);
265 void SetSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) throw (SALOME::SALOME_Exception);
267 void SetConstantSizeMap(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap);
269 void UnsetSizeMap(GEOM::GEOM_Object_ptr GeomObj);
271 void ClearSizeMaps();
273 void SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor);
275 void UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj);
277 void SetAttractorEntry(const char* entry, const char* attractor) throw (SALOME::SALOME_Exception);
279 char* GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception);
281 BLSURFPlugin::string_array* GetAttractorEntries();
285 * Set/get/unset an attractor on a face
288 void SetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj, GEOM::GEOM_Object_ptr Attractor, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius );
290 void UnsetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj,
291 GEOM::GEOM_Object_ptr theAttractor);
293 void UnsetAttractorEntry(const char* entry, const char* attractor);
294 void SetClassAttractorEntry(const char* entry, const char* att_entry, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius) throw (SALOME::SALOME_Exception);
296 BLSURFPlugin::TAttParamsMap* GetAttractorParams();
300 void SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap);
302 void UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj);
304 void SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) throw (SALOME::SALOME_Exception);
306 char* GetCustomSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
308 BLSURFPlugin::string_array* GetCustomSizeMapEntries();
311 ///////////////////////
312 // ENFORCED VERTEXES //
313 ///////////////////////
315 BLSURFPlugin::TFaceEntryEnfVertexListMap* GetAllEnforcedVerticesByFace();
316 BLSURFPlugin::TEnfVertexList* GetAllEnforcedVertices();
318 BLSURFPlugin::TFaceEntryCoordsListMap* GetAllCoordsByFace();
319 BLSURFPlugin::TCoordsEnfVertexMap* GetAllEnforcedVerticesByCoords();
321 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* GetAllEnfVertexEntriesByFace();
322 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* GetAllEnforcedVerticesByEnfVertexEntry();
324 void ClearAllEnforcedVertices();
327 * Set/get/unset an enforced vertex on geom object
330 bool SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
331 throw (SALOME::SALOME_Exception);
332 bool SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
333 throw (SALOME::SALOME_Exception);
334 bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
335 throw (SALOME::SALOME_Exception);
336 bool SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
337 throw (SALOME::SALOME_Exception);
338 bool SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
339 throw (SALOME::SALOME_Exception);
340 bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
341 throw (SALOME::SALOME_Exception);
343 BLSURFPlugin::TEnfVertexList* GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
345 bool UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
346 throw (SALOME::SALOME_Exception);
347 bool UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
348 throw (SALOME::SALOME_Exception);
349 bool UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
352 bool AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
353 throw (SALOME::SALOME_Exception);
354 bool AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
355 throw (SALOME::SALOME_Exception);
356 bool AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
357 throw (SALOME::SALOME_Exception);
358 bool AddEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
359 throw (SALOME::SALOME_Exception);
360 bool AddEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
361 throw (SALOME::SALOME_Exception);
362 bool AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
363 throw (SALOME::SALOME_Exception);
365 bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
366 throw (SALOME::SALOME_Exception);
367 bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
368 throw (SALOME::SALOME_Exception);
369 bool RemoveEnforcedVertices() throw (SALOME::SALOME_Exception);
372 * Set/get/unset an enforced vertex on geom object given by entry
374 bool SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
375 const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "")
376 throw (SALOME::SALOME_Exception);
378 BLSURFPlugin::TEnfVertexList* GetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
380 bool UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z,
381 const char* theVertexEntry = "") throw (SALOME::SALOME_Exception);
382 bool UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
385 * To add internal vertices as enforced vertices
387 void SetInternalEnforcedVertexAllFaces(CORBA::Boolean toEnforceInternalVertices);
388 CORBA::Boolean GetInternalEnforcedVertexAllFaces();
389 void SetInternalEnforcedVertexAllFacesGroup(const char* groupName = "");
390 char* GetInternalEnforcedVertexAllFacesGroup();
392 // Enable internal enforced vertices on specific face if requested by user
393 // void SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) throw (SALOME::SALOME_Exception);
394 // void SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
395 // void SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
396 // CORBA::Boolean GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
397 // CORBA::Boolean GetInternalEnforcedVertexEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
399 ///////////////////////
401 ///////////////////////
403 void ClearPreCadPeriodicityVectors();
405 BLSURFPlugin::TPeriodicityList* GetPreCadFacesPeriodicityVector();
406 BLSURFPlugin::TPeriodicityList* GetPreCadEdgesPeriodicityVector();
408 BLSURFPlugin::TPeriodicityList* PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector);
410 void AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
411 throw (SALOME::SALOME_Exception);
413 void AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
414 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
415 throw (SALOME::SALOME_Exception);
417 void AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
418 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
419 throw (SALOME::SALOME_Exception);
421 void AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
422 throw (SALOME::SALOME_Exception);
424 void AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
425 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
426 throw (SALOME::SALOME_Exception);
428 void AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
429 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
430 throw (SALOME::SALOME_Exception);
432 ///////////////////////
435 * Sets the file for export resulting mesh in GMF format
437 // void SetGMFFile(const char* theFileName, CORBA::Boolean isBinary);
438 void SetGMFFile(const char* theFileName);
440 // CORBA::Boolean GetGMFFileMode();
442 // Get implementation
443 ::BLSURFPlugin_Hypothesis* GetImpl();
445 // Verify whether hypothesis supports given entity type
446 CORBA::Boolean IsDimSupported(SMESH::Dimension type);
450 // Methods for copying mesh definition to other geometry
452 // Return geometry this hypothesis depends on. Return false if there is no geometry parameter
453 virtual bool getObjectsDependOn( std::vector< std::string > & entryArray,
454 std::vector< int > & subIDArray ) const;
456 // Set new geometry instead of that returned by getObjectsDependOn()
457 virtual bool setObjectsDependOn( std::vector< std::string > & entryArray,
458 std::vector< int > & subIDArray );
460 ///////////////////////
462 ///////////////////////
463 std::string ShapeTypeToString(GEOM::shape_type theShapeType);
464 void CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType);
465 void CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std::vector<GEOM::shape_type> theShapeTypes);
466 std::string PublishIfNeeded(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType, std::string prefix);
467 std::string FormatVerticesEntries(std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);