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