1 // Copyright (C) 2007-2016 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,
48 ::SMESH_Gen* theGenImpl,
51 virtual ~BLSURFPlugin_Hypothesis_i();
53 void SetPhysicalMesh(CORBA::Long theValue);
54 CORBA::Long GetPhysicalMesh();
56 void SetGeometricMesh(CORBA::Long theValue);
57 CORBA::Long GetGeometricMesh();
59 void SetPhySize(CORBA::Double theValue);
60 void SetPhySizeRel(CORBA::Double theValue);
61 CORBA::Double GetPhySize();
62 CORBA::Boolean IsPhySizeRel();
64 void SetMinSize(CORBA::Double theMinSize);
65 void SetMinSizeRel(CORBA::Double theMinSize);
66 CORBA::Double GetMinSize();
67 CORBA::Boolean IsMinSizeRel();
69 void SetMaxSize(CORBA::Double theMaxSize);
70 void SetMaxSizeRel(CORBA::Double theMaxSize);
71 CORBA::Double GetMaxSize();
72 CORBA::Boolean IsMaxSizeRel();
74 void SetUseGradation(CORBA::Boolean theValue);
75 CORBA::Boolean GetUseGradation();
76 void SetGradation(CORBA::Double theValue);
77 CORBA::Double GetGradation();
79 void SetUseVolumeGradation(CORBA::Boolean theValue);
80 CORBA::Boolean GetUseVolumeGradation();
81 void SetVolumeGradation(CORBA::Double theValue);
82 CORBA::Double GetVolumeGradation();
84 void SetQuadAllowed(CORBA::Boolean theValue);
85 CORBA::Boolean GetQuadAllowed();
87 void SetAngleMesh(CORBA::Double theValue);
88 CORBA::Double GetAngleMesh();
90 void SetChordalError(CORBA::Double distance);
91 CORBA::Double GetChordalError();
93 void SetAnisotropic(CORBA::Boolean anisotropic);
94 CORBA::Boolean GetAnisotropic();
96 void SetAnisotropicRatio(CORBA::Double ratio);
97 CORBA::Double GetAnisotropicRatio();
99 void SetRemoveTinyEdges(CORBA::Boolean remove);
100 CORBA::Boolean GetRemoveTinyEdges();
102 void SetTinyEdgeLength(CORBA::Double length);
103 CORBA::Double GetTinyEdgeLength();
105 void SetOptimiseTinyEdges(CORBA::Boolean toOptimise);
106 CORBA::Boolean GetOptimiseTinyEdges();
108 void SetTinyEdgeOptimisationLength(CORBA::Double length);
109 CORBA::Double GetTinyEdgeOptimisationLength();
111 void SetCorrectSurfaceIntersection(CORBA::Boolean toOptimise);
112 CORBA::Boolean GetCorrectSurfaceIntersection();
114 void SetCorrectSurfaceIntersectionMaxCost(CORBA::Double maxCost);
115 CORBA::Double GetCorrectSurfaceIntersectionMaxCost();
117 void SetBadElementRemoval(CORBA::Boolean remove);
118 CORBA::Boolean GetBadElementRemoval();
120 void SetBadElementAspectRatio(CORBA::Double ratio);
121 CORBA::Double GetBadElementAspectRatio();
123 void SetOptimizeMesh(CORBA::Boolean optimize);
124 CORBA::Boolean GetOptimizeMesh();
126 void SetQuadraticMesh(CORBA::Boolean quadratic);
127 CORBA::Boolean GetQuadraticMesh();
129 void SetTopology(CORBA::Long theValue);
130 CORBA::Long GetTopology();
132 void SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception);
133 CORBA::Short GetVerbosity();
135 void SetEnforceCadEdgesSize( CORBA::Boolean toEnforce );
136 CORBA::Boolean GetEnforceCadEdgesSize();
138 void SetJacobianRectificationRespectGeometry( CORBA::Boolean allowRectification );
139 CORBA::Boolean GetJacobianRectificationRespectGeometry();
141 void SetUseDeprecatedPatchMesher( CORBA::Boolean useDeprecatedPatchMesher );
142 CORBA::Boolean GetUseDeprecatedPatchMesher();
144 void SetJacobianRectification( CORBA::Boolean allowRectification );
145 CORBA::Boolean GetJacobianRectification();
147 void SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
148 CORBA::Long GetMaxNumberOfPointsPerPatch();
150 void SetMaxNumberOfThreads( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
151 CORBA::Long GetMaxNumberOfThreads();
153 void SetRespectGeometry( CORBA::Boolean toRespect );
154 CORBA::Boolean GetRespectGeometry();
156 void SetTinyEdgesAvoidSurfaceIntersections( CORBA::Boolean toAvoidIntersection );
157 CORBA::Boolean GetTinyEdgesAvoidSurfaceIntersections();
159 void SetClosedGeometry( CORBA::Boolean isClosed );
160 CORBA::Boolean GetClosedGeometry();
162 void SetDebug( CORBA::Boolean isDebug );
165 void SetPeriodicTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
166 double GetPeriodicTolerance() throw (SALOME::SALOME_Exception);
168 void SetRequiredEntities( const char* howToTreat ) throw (SALOME::SALOME_Exception);
169 char* GetRequiredEntities();
171 void SetSewingTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
172 CORBA::Double GetSewingTolerance() throw (SALOME::SALOME_Exception);
174 void SetTags( const char* howToTreat ) throw (SALOME::SALOME_Exception);
177 void SetHyperPatches(const BLSURFPlugin::THyperPatchList& hpl);
178 BLSURFPlugin::THyperPatchList* GetHyperPatches();
180 void SetPreCADMergeEdges(CORBA::Boolean theValue);
181 CORBA::Boolean GetPreCADMergeEdges();
183 void SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue);
184 CORBA::Boolean GetPreCADRemoveDuplicateCADFaces();
186 void SetPreCADProcess3DTopology(CORBA::Boolean theValue);
187 CORBA::Boolean GetPreCADProcess3DTopology();
189 void SetPreCADDiscardInput(CORBA::Boolean theValue);
190 CORBA::Boolean GetPreCADDiscardInput();
192 void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
193 void SetPreCADOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
194 char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
195 char* GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
197 void UnsetOption(const char* optionName);
198 void UnsetPreCADOption(const char* optionName);
200 BLSURFPlugin::string_array* GetOptionValues();
201 BLSURFPlugin::string_array* GetPreCADOptionValues();
202 BLSURFPlugin::string_array* GetAdvancedOptionValues();
204 void SetOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
205 void SetPreCADOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
206 void SetAdvancedOptionValues(const BLSURFPlugin::string_array& options);
207 void SetAdvancedOption(const char* optionsAndValues) throw (SALOME::SALOME_Exception);
209 void AddOption(const char* optionName, const char* optionValue);
210 void AddPreCADOption(const char* optionName, const char* optionValue);
211 char* GetOption(const char* optionName);
212 char* GetPreCADOption(const char* optionName);
214 void SetSizeMapEntry(const char* entry, const char* sizeMap) throw (SALOME::SALOME_Exception);
216 void SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap) throw (SALOME::SALOME_Exception);
218 char* GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
220 void UnsetEntry(const char* entry);
222 BLSURFPlugin::string_array* GetSizeMapEntries();
224 void SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps) throw (SALOME::SALOME_Exception);
226 void SetSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) throw (SALOME::SALOME_Exception);
228 void SetConstantSizeMap(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap);
230 void UnsetSizeMap(GEOM::GEOM_Object_ptr GeomObj);
232 void ClearSizeMaps();
234 void SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor);
236 void UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj);
238 void SetAttractorEntry(const char* entry, const char* attractor) throw (SALOME::SALOME_Exception);
240 char* GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception);
242 BLSURFPlugin::string_array* GetAttractorEntries();
246 * Set/get/unset an attractor on a face
249 void SetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj, GEOM::GEOM_Object_ptr Attractor, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius );
251 void UnsetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj,
252 GEOM::GEOM_Object_ptr theAttractor);
254 void UnsetAttractorEntry(const char* entry, const char* attractor);
255 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);
257 BLSURFPlugin::TAttParamsMap* GetAttractorParams();
261 void SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap);
263 void UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj);
265 void SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) throw (SALOME::SALOME_Exception);
267 char* GetCustomSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
269 BLSURFPlugin::string_array* GetCustomSizeMapEntries();
272 ///////////////////////
273 // ENFORCED VERTEXES //
274 ///////////////////////
276 BLSURFPlugin::TFaceEntryEnfVertexListMap* GetAllEnforcedVerticesByFace();
277 BLSURFPlugin::TEnfVertexList* GetAllEnforcedVertices();
279 BLSURFPlugin::TFaceEntryCoordsListMap* GetAllCoordsByFace();
280 BLSURFPlugin::TCoordsEnfVertexMap* GetAllEnforcedVerticesByCoords();
282 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* GetAllEnfVertexEntriesByFace();
283 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* GetAllEnforcedVerticesByEnfVertexEntry();
285 void ClearAllEnforcedVertices();
288 * Set/get/unset an enforced vertex on geom object
291 bool SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
292 throw (SALOME::SALOME_Exception);
293 bool SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
294 throw (SALOME::SALOME_Exception);
295 bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
296 throw (SALOME::SALOME_Exception);
297 bool SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
298 throw (SALOME::SALOME_Exception);
299 bool SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
300 throw (SALOME::SALOME_Exception);
301 bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
302 throw (SALOME::SALOME_Exception);
304 BLSURFPlugin::TEnfVertexList* GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
306 bool UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
307 throw (SALOME::SALOME_Exception);
308 bool UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
309 throw (SALOME::SALOME_Exception);
310 bool UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
313 bool AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
314 throw (SALOME::SALOME_Exception);
315 bool AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
316 throw (SALOME::SALOME_Exception);
317 bool AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
318 throw (SALOME::SALOME_Exception);
319 bool AddEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
320 throw (SALOME::SALOME_Exception);
321 bool AddEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
322 throw (SALOME::SALOME_Exception);
323 bool AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
324 throw (SALOME::SALOME_Exception);
326 bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
327 throw (SALOME::SALOME_Exception);
328 bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
329 throw (SALOME::SALOME_Exception);
330 bool RemoveEnforcedVertices() throw (SALOME::SALOME_Exception);
333 * Set/get/unset an enforced vertex on geom object given by entry
335 bool SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
336 const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "")
337 throw (SALOME::SALOME_Exception);
339 BLSURFPlugin::TEnfVertexList* GetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
341 bool UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z,
342 const char* theVertexEntry = "") throw (SALOME::SALOME_Exception);
343 bool UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
346 * To add internal vertices as enforced vertices
348 void SetInternalEnforcedVertexAllFaces(CORBA::Boolean toEnforceInternalVertices);
349 CORBA::Boolean GetInternalEnforcedVertexAllFaces();
350 void SetInternalEnforcedVertexAllFacesGroup(const char* groupName = "");
351 char* GetInternalEnforcedVertexAllFacesGroup();
353 // Enable internal enforced vertices on specific face if requested by user
354 // void SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) throw (SALOME::SALOME_Exception);
355 // void SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
356 // void SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
357 // CORBA::Boolean GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
358 // CORBA::Boolean GetInternalEnforcedVertexEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
360 ///////////////////////
362 ///////////////////////
364 void ClearPreCadPeriodicityVectors();
366 BLSURFPlugin::TPeriodicityList* GetPreCadFacesPeriodicityVector();
367 BLSURFPlugin::TPeriodicityList* GetPreCadEdgesPeriodicityVector();
369 BLSURFPlugin::TPeriodicityList* PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector);
371 void AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
372 throw (SALOME::SALOME_Exception);
374 void AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
375 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
376 throw (SALOME::SALOME_Exception);
378 void AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
379 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
380 throw (SALOME::SALOME_Exception);
382 void AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
383 throw (SALOME::SALOME_Exception);
385 void AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
386 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
387 throw (SALOME::SALOME_Exception);
389 void AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
390 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
391 throw (SALOME::SALOME_Exception);
393 ///////////////////////
396 * Sets the file for export resulting mesh in GMF format
398 // void SetGMFFile(const char* theFileName, CORBA::Boolean isBinary);
399 void SetGMFFile(const char* theFileName);
401 // CORBA::Boolean GetGMFFileMode();
403 // Get implementation
404 ::BLSURFPlugin_Hypothesis* GetImpl();
406 // Verify whether hypothesis supports given entity type
407 CORBA::Boolean IsDimSupported(SMESH::Dimension type);
411 // Obsolete methods - To be removed in V7
413 void SetPhyMin(CORBA::Double theMinSize);
414 CORBA::Double GetPhyMin();
415 void SetPhyMax(CORBA::Double theMaxSize);
416 CORBA::Double GetPhyMax();
417 void SetGeoMin(CORBA::Double theMinSize);
418 CORBA::Double GetGeoMin();
419 void SetGeoMax(CORBA::Double theMaxSize);
420 CORBA::Double GetGeoMax();
421 void SetAngleMeshS(CORBA::Double angle);
422 CORBA::Double GetAngleMeshS();
423 void SetAngleMeshC(CORBA::Double angle);
424 CORBA::Double GetAngleMeshC();
425 void SetDecimesh(CORBA::Boolean toIgnoreEdges);
426 CORBA::Boolean GetDecimesh();
427 void SetPreCADRemoveNanoEdges(CORBA::Boolean toRemoveNanoEdges);
428 CORBA::Boolean GetPreCADRemoveNanoEdges();
429 void SetPreCADEpsNano(CORBA::Double epsNano);
430 CORBA::Double GetPreCADEpsNano();
433 ///////////////////////
435 ///////////////////////
436 std::string ShapeTypeToString(GEOM::shape_type theShapeType);
437 void CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType);
438 void CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std::vector<GEOM::shape_type> theShapeTypes);
439 std::string PublishIfNeeded(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType, std::string prefix);
440 std::string FormatVerticesEntries(std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);