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,
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);
84 CORBA::Boolean GetQuadAllowed();
86 void SetAngleMesh(CORBA::Double theValue);
87 CORBA::Double GetAngleMesh();
89 void SetChordalError(CORBA::Double distance);
90 CORBA::Double GetChordalError();
92 void SetAnisotropic(CORBA::Boolean anisotropic);
93 CORBA::Boolean GetAnisotropic();
95 void SetAnisotropicRatio(CORBA::Double ratio);
96 CORBA::Double GetAnisotropicRatio();
98 void SetRemoveTinyEdges(CORBA::Boolean remove);
99 CORBA::Boolean GetRemoveTinyEdges();
101 void SetTinyEdgeLength(CORBA::Double length);
102 CORBA::Double GetTinyEdgeLength();
104 void SetOptimiseTinyEdges(CORBA::Boolean toOptimise);
105 CORBA::Boolean GetOptimiseTinyEdges();
107 void SetTinyEdgeOptimisationLength(CORBA::Double length);
108 CORBA::Double GetTinyEdgeOptimisationLength();
110 void SetCorrectSurfaceIntersection(CORBA::Boolean toOptimise);
111 CORBA::Boolean GetCorrectSurfaceIntersection();
113 void SetCorrectSurfaceIntersectionMaxCost(CORBA::Double maxCost);
114 CORBA::Double GetCorrectSurfaceIntersectionMaxCost();
116 void SetBadElementRemoval(CORBA::Boolean remove);
117 CORBA::Boolean GetBadElementRemoval();
119 void SetBadElementAspectRatio(CORBA::Double ratio);
120 CORBA::Double GetBadElementAspectRatio();
122 void SetOptimizeMesh(CORBA::Boolean optimize);
123 CORBA::Boolean GetOptimizeMesh();
125 void SetQuadraticMesh(CORBA::Boolean quadratic);
126 CORBA::Boolean GetQuadraticMesh();
128 void SetTopology(CORBA::Long theValue);
129 CORBA::Long GetTopology();
131 void SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception);
132 CORBA::Short GetVerbosity();
134 void SetEnforceCadEdgesSize( CORBA::Boolean toEnforce );
135 CORBA::Boolean GetEnforceCadEdgesSize();
137 void SetJacobianRectificationRespectGeometry( CORBA::Boolean allowRectification );
138 CORBA::Boolean GetJacobianRectificationRespectGeometry();
140 void SetUseDeprecatedPatchMesher( CORBA::Boolean useDeprecatedPatchMesher );
141 CORBA::Boolean GetUseDeprecatedPatchMesher();
143 void SetJacobianRectification( CORBA::Boolean allowRectification );
144 CORBA::Boolean GetJacobianRectification();
146 void SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
147 CORBA::Long GetMaxNumberOfPointsPerPatch();
149 void SetMaxNumberOfThreads( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
150 CORBA::Long GetMaxNumberOfThreads();
152 void SetRespectGeometry( CORBA::Boolean toRespect );
153 CORBA::Boolean GetRespectGeometry();
155 void SetTinyEdgesAvoidSurfaceIntersections( CORBA::Boolean toAvoidIntersection );
156 CORBA::Boolean GetTinyEdgesAvoidSurfaceIntersections();
158 void SetClosedGeometry( CORBA::Boolean isClosed );
159 CORBA::Boolean GetClosedGeometry();
161 void SetDebug( CORBA::Boolean isDebug );
164 void SetPeriodicTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
165 double GetPeriodicTolerance() throw (SALOME::SALOME_Exception);
167 void SetRequiredEntities( const char* howToTreat ) throw (SALOME::SALOME_Exception);
168 char* GetRequiredEntities();
170 void SetSewingTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
171 CORBA::Double GetSewingTolerance() throw (SALOME::SALOME_Exception);
173 void SetTags( const char* howToTreat ) throw (SALOME::SALOME_Exception);
176 void SetHyperPatches(const BLSURFPlugin::THyperPatchList& hpl);
177 BLSURFPlugin::THyperPatchList* GetHyperPatches();
179 void SetPreCADMergeEdges(CORBA::Boolean theValue);
180 CORBA::Boolean GetPreCADMergeEdges();
182 void SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue);
183 CORBA::Boolean GetPreCADRemoveDuplicateCADFaces();
185 void SetPreCADProcess3DTopology(CORBA::Boolean theValue);
186 CORBA::Boolean GetPreCADProcess3DTopology();
188 void SetPreCADDiscardInput(CORBA::Boolean theValue);
189 CORBA::Boolean GetPreCADDiscardInput();
191 void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
192 void SetPreCADOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
193 char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
194 char* GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
196 void UnsetOption(const char* optionName);
197 void UnsetPreCADOption(const char* optionName);
199 BLSURFPlugin::string_array* GetOptionValues();
200 BLSURFPlugin::string_array* GetPreCADOptionValues();
201 BLSURFPlugin::string_array* GetAdvancedOptionValues();
203 void SetOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
204 void SetPreCADOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
205 void SetAdvancedOptionValues(const BLSURFPlugin::string_array& options);
206 void SetAdvancedOption(const char* optionsAndValues) throw (SALOME::SALOME_Exception);
208 void AddOption(const char* optionName, const char* optionValue);
209 void AddPreCADOption(const char* optionName, const char* optionValue);
210 char* GetOption(const char* optionName);
211 char* GetPreCADOption(const char* optionName);
213 void SetSizeMapEntry(const char* entry, const char* sizeMap) throw (SALOME::SALOME_Exception);
215 void SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap) throw (SALOME::SALOME_Exception);
217 char* GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
219 void UnsetEntry(const char* entry);
221 BLSURFPlugin::string_array* GetSizeMapEntries();
223 void SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps) throw (SALOME::SALOME_Exception);
225 void SetSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) throw (SALOME::SALOME_Exception);
227 void SetConstantSizeMap(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap);
229 void UnsetSizeMap(GEOM::GEOM_Object_ptr GeomObj);
231 void ClearSizeMaps();
233 void SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor);
235 void UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj);
237 void SetAttractorEntry(const char* entry, const char* attractor) throw (SALOME::SALOME_Exception);
239 char* GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception);
241 BLSURFPlugin::string_array* GetAttractorEntries();
245 * Set/get/unset an attractor on a face
248 void SetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj, GEOM::GEOM_Object_ptr Attractor, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius );
250 void UnsetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj,
251 GEOM::GEOM_Object_ptr theAttractor);
253 void UnsetAttractorEntry(const char* entry, const char* attractor);
254 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);
256 BLSURFPlugin::TAttParamsMap* GetAttractorParams();
260 void SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap);
262 void UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj);
264 void SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) throw (SALOME::SALOME_Exception);
266 char* GetCustomSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
268 BLSURFPlugin::string_array* GetCustomSizeMapEntries();
271 ///////////////////////
272 // ENFORCED VERTEXES //
273 ///////////////////////
275 BLSURFPlugin::TFaceEntryEnfVertexListMap* GetAllEnforcedVerticesByFace();
276 BLSURFPlugin::TEnfVertexList* GetAllEnforcedVertices();
278 BLSURFPlugin::TFaceEntryCoordsListMap* GetAllCoordsByFace();
279 BLSURFPlugin::TCoordsEnfVertexMap* GetAllEnforcedVerticesByCoords();
281 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* GetAllEnfVertexEntriesByFace();
282 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* GetAllEnforcedVerticesByEnfVertexEntry();
284 void ClearAllEnforcedVertices();
287 * Set/get/unset an enforced vertex on geom object
290 bool SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
291 throw (SALOME::SALOME_Exception);
292 bool SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
293 throw (SALOME::SALOME_Exception);
294 bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
295 throw (SALOME::SALOME_Exception);
296 bool SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
297 throw (SALOME::SALOME_Exception);
298 bool SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
299 throw (SALOME::SALOME_Exception);
300 bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
301 throw (SALOME::SALOME_Exception);
303 BLSURFPlugin::TEnfVertexList* GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
305 bool UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
306 throw (SALOME::SALOME_Exception);
307 bool UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
308 throw (SALOME::SALOME_Exception);
309 bool UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
312 bool AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
313 throw (SALOME::SALOME_Exception);
314 bool AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
315 throw (SALOME::SALOME_Exception);
316 bool AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
317 throw (SALOME::SALOME_Exception);
318 bool AddEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
319 throw (SALOME::SALOME_Exception);
320 bool AddEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
321 throw (SALOME::SALOME_Exception);
322 bool AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
323 throw (SALOME::SALOME_Exception);
325 bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
326 throw (SALOME::SALOME_Exception);
327 bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
328 throw (SALOME::SALOME_Exception);
329 bool RemoveEnforcedVertices() throw (SALOME::SALOME_Exception);
332 * Set/get/unset an enforced vertex on geom object given by entry
334 bool SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
335 const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "")
336 throw (SALOME::SALOME_Exception);
338 BLSURFPlugin::TEnfVertexList* GetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
340 bool UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z,
341 const char* theVertexEntry = "") throw (SALOME::SALOME_Exception);
342 bool UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
345 * To add internal vertices as enforced vertices
347 void SetInternalEnforcedVertexAllFaces(CORBA::Boolean toEnforceInternalVertices);
348 CORBA::Boolean GetInternalEnforcedVertexAllFaces();
349 void SetInternalEnforcedVertexAllFacesGroup(const char* groupName = "");
350 char* GetInternalEnforcedVertexAllFacesGroup();
352 // Enable internal enforced vertices on specific face if requested by user
353 // void SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) throw (SALOME::SALOME_Exception);
354 // void SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
355 // void SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
356 // CORBA::Boolean GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
357 // CORBA::Boolean GetInternalEnforcedVertexEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
359 ///////////////////////
361 ///////////////////////
363 void ClearPreCadPeriodicityVectors();
365 BLSURFPlugin::TPeriodicityList* GetPreCadFacesPeriodicityVector();
366 BLSURFPlugin::TPeriodicityList* GetPreCadEdgesPeriodicityVector();
368 BLSURFPlugin::TPeriodicityList* PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector);
370 void AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
371 throw (SALOME::SALOME_Exception);
373 void AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
374 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
375 throw (SALOME::SALOME_Exception);
377 void AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
378 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
379 throw (SALOME::SALOME_Exception);
381 void AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
382 throw (SALOME::SALOME_Exception);
384 void AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
385 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
386 throw (SALOME::SALOME_Exception);
388 void AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
389 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
390 throw (SALOME::SALOME_Exception);
392 ///////////////////////
395 * Sets the file for export resulting mesh in GMF format
397 // void SetGMFFile(const char* theFileName, CORBA::Boolean isBinary);
398 void SetGMFFile(const char* theFileName);
400 // CORBA::Boolean GetGMFFileMode();
402 // Get implementation
403 ::BLSURFPlugin_Hypothesis* GetImpl();
405 // Verify whether hypothesis supports given entity type
406 CORBA::Boolean IsDimSupported(SMESH::Dimension type);
410 // Obsolete methods - To be removed in V7
412 void SetPhyMin(CORBA::Double theMinSize);
413 CORBA::Double GetPhyMin();
414 void SetPhyMax(CORBA::Double theMaxSize);
415 CORBA::Double GetPhyMax();
416 void SetGeoMin(CORBA::Double theMinSize);
417 CORBA::Double GetGeoMin();
418 void SetGeoMax(CORBA::Double theMaxSize);
419 CORBA::Double GetGeoMax();
420 void SetAngleMeshS(CORBA::Double angle);
421 CORBA::Double GetAngleMeshS();
422 void SetAngleMeshC(CORBA::Double angle);
423 CORBA::Double GetAngleMeshC();
424 void SetDecimesh(CORBA::Boolean toIgnoreEdges);
425 CORBA::Boolean GetDecimesh();
426 void SetPreCADRemoveNanoEdges(CORBA::Boolean toRemoveNanoEdges);
427 CORBA::Boolean GetPreCADRemoveNanoEdges();
428 void SetPreCADEpsNano(CORBA::Double epsNano);
429 CORBA::Double GetPreCADEpsNano();
432 ///////////////////////
434 ///////////////////////
435 std::string ShapeTypeToString(GEOM::shape_type theShapeType);
436 void CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType);
437 void CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std::vector<GEOM::shape_type> theShapeTypes);
438 std::string PublishIfNeeded(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType, std::string prefix);
439 std::string FormatVerticesEntries(std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);