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 SetJacobianRectification( CORBA::Boolean allowRectification );
142 CORBA::Boolean GetJacobianRectification();
144 void SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
145 CORBA::Long GetMaxNumberOfPointsPerPatch();
147 void SetRespectGeometry( CORBA::Boolean toRespect );
148 CORBA::Boolean GetRespectGeometry();
150 void SetTinyEdgesAvoidSurfaceIntersections( CORBA::Boolean toAvoidIntersection );
151 CORBA::Boolean GetTinyEdgesAvoidSurfaceIntersections();
153 void SetClosedGeometry( CORBA::Boolean isClosed );
154 CORBA::Boolean GetClosedGeometry();
156 void SetDebug( CORBA::Boolean isDebug );
159 void SetPeriodicTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
160 double GetPeriodicTolerance() throw (SALOME::SALOME_Exception);
162 void SetRequiredEntities( const char* howToTreat ) throw (SALOME::SALOME_Exception);
163 char* GetRequiredEntities();
165 void SetSewingTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
166 CORBA::Double GetSewingTolerance() throw (SALOME::SALOME_Exception);
168 void SetTags( const char* howToTreat ) throw (SALOME::SALOME_Exception);
171 void SetHyperPatches(const BLSURFPlugin::THyperPatchList& hpl);
172 BLSURFPlugin::THyperPatchList* GetHyperPatches();
174 void SetPreCADMergeEdges(CORBA::Boolean theValue);
175 CORBA::Boolean GetPreCADMergeEdges();
177 void SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue);
178 CORBA::Boolean GetPreCADRemoveDuplicateCADFaces();
180 void SetPreCADProcess3DTopology(CORBA::Boolean theValue);
181 CORBA::Boolean GetPreCADProcess3DTopology();
183 void SetPreCADDiscardInput(CORBA::Boolean theValue);
184 CORBA::Boolean GetPreCADDiscardInput();
186 void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
187 void SetPreCADOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
188 char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
189 char* GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
191 void UnsetOption(const char* optionName);
192 void UnsetPreCADOption(const char* optionName);
194 BLSURFPlugin::string_array* GetOptionValues();
195 BLSURFPlugin::string_array* GetPreCADOptionValues();
196 BLSURFPlugin::string_array* GetAdvancedOptionValues();
198 void SetOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
199 void SetPreCADOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
200 void SetAdvancedOptionValues(const BLSURFPlugin::string_array& options);
201 void SetAdvancedOption(const char* optionsAndValues) throw (SALOME::SALOME_Exception);
203 void AddOption(const char* optionName, const char* optionValue);
204 void AddPreCADOption(const char* optionName, const char* optionValue);
205 char* GetOption(const char* optionName);
206 char* GetPreCADOption(const char* optionName);
208 void SetSizeMapEntry(const char* entry, const char* sizeMap) throw (SALOME::SALOME_Exception);
210 void SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap) throw (SALOME::SALOME_Exception);
212 char* GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
214 void UnsetEntry(const char* entry);
216 BLSURFPlugin::string_array* GetSizeMapEntries();
218 void SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps) throw (SALOME::SALOME_Exception);
220 void SetSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) throw (SALOME::SALOME_Exception);
222 void SetConstantSizeMap(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap);
224 void UnsetSizeMap(GEOM::GEOM_Object_ptr GeomObj);
226 void ClearSizeMaps();
228 void SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor);
230 void UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj);
232 void SetAttractorEntry(const char* entry, const char* attractor) throw (SALOME::SALOME_Exception);
234 char* GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception);
236 BLSURFPlugin::string_array* GetAttractorEntries();
240 * Set/get/unset an attractor on a face
243 void SetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj, GEOM::GEOM_Object_ptr Attractor, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius );
245 void UnsetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj,
246 GEOM::GEOM_Object_ptr theAttractor);
248 void UnsetAttractorEntry(const char* entry, const char* attractor);
249 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);
251 BLSURFPlugin::TAttParamsMap* GetAttractorParams();
255 void SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap);
257 void UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj);
259 void SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) throw (SALOME::SALOME_Exception);
261 char* GetCustomSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
263 BLSURFPlugin::string_array* GetCustomSizeMapEntries();
266 ///////////////////////
267 // ENFORCED VERTEXES //
268 ///////////////////////
270 BLSURFPlugin::TFaceEntryEnfVertexListMap* GetAllEnforcedVerticesByFace();
271 BLSURFPlugin::TEnfVertexList* GetAllEnforcedVertices();
273 BLSURFPlugin::TFaceEntryCoordsListMap* GetAllCoordsByFace();
274 BLSURFPlugin::TCoordsEnfVertexMap* GetAllEnforcedVerticesByCoords();
276 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* GetAllEnfVertexEntriesByFace();
277 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* GetAllEnforcedVerticesByEnfVertexEntry();
279 void ClearAllEnforcedVertices();
282 * Set/get/unset an enforced vertex on geom object
285 bool SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
286 throw (SALOME::SALOME_Exception);
287 bool SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
288 throw (SALOME::SALOME_Exception);
289 bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
290 throw (SALOME::SALOME_Exception);
291 bool SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
292 throw (SALOME::SALOME_Exception);
293 bool SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
294 throw (SALOME::SALOME_Exception);
295 bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
296 throw (SALOME::SALOME_Exception);
298 BLSURFPlugin::TEnfVertexList* GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
300 bool UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
301 throw (SALOME::SALOME_Exception);
302 bool UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
303 throw (SALOME::SALOME_Exception);
304 bool UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
307 bool AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
308 throw (SALOME::SALOME_Exception);
309 bool AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
310 throw (SALOME::SALOME_Exception);
311 bool AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
312 throw (SALOME::SALOME_Exception);
313 bool AddEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
314 throw (SALOME::SALOME_Exception);
315 bool AddEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
316 throw (SALOME::SALOME_Exception);
317 bool AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
318 throw (SALOME::SALOME_Exception);
320 bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z)
321 throw (SALOME::SALOME_Exception);
322 bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex)
323 throw (SALOME::SALOME_Exception);
324 bool RemoveEnforcedVertices() throw (SALOME::SALOME_Exception);
327 * Set/get/unset an enforced vertex on geom object given by entry
329 bool SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
330 const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "")
331 throw (SALOME::SALOME_Exception);
333 BLSURFPlugin::TEnfVertexList* GetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
335 bool UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z,
336 const char* theVertexEntry = "") throw (SALOME::SALOME_Exception);
337 bool UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
340 * To add internal vertices as enforced vertices
342 void SetInternalEnforcedVertexAllFaces(CORBA::Boolean toEnforceInternalVertices);
343 CORBA::Boolean GetInternalEnforcedVertexAllFaces();
344 void SetInternalEnforcedVertexAllFacesGroup(const char* groupName = "");
345 char* GetInternalEnforcedVertexAllFacesGroup();
347 // Enable internal enforced vertices on specific face if requested by user
348 // void SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) throw (SALOME::SALOME_Exception);
349 // void SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
350 // void SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
351 // CORBA::Boolean GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
352 // CORBA::Boolean GetInternalEnforcedVertexEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
354 ///////////////////////
356 ///////////////////////
358 void ClearPreCadPeriodicityVectors();
360 BLSURFPlugin::TPeriodicityList* GetPreCadFacesPeriodicityVector();
361 BLSURFPlugin::TPeriodicityList* GetPreCadEdgesPeriodicityVector();
363 BLSURFPlugin::TPeriodicityList* PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector);
365 void AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
366 throw (SALOME::SALOME_Exception);
368 void AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
369 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
370 throw (SALOME::SALOME_Exception);
372 void AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
373 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
374 throw (SALOME::SALOME_Exception);
376 void AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
377 throw (SALOME::SALOME_Exception);
379 void AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
380 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
381 throw (SALOME::SALOME_Exception);
383 void AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
384 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
385 throw (SALOME::SALOME_Exception);
387 ///////////////////////
390 * Sets the file for export resulting mesh in GMF format
392 // void SetGMFFile(const char* theFileName, CORBA::Boolean isBinary);
393 void SetGMFFile(const char* theFileName);
395 // CORBA::Boolean GetGMFFileMode();
397 // Get implementation
398 ::BLSURFPlugin_Hypothesis* GetImpl();
400 // Verify whether hypothesis supports given entity type
401 CORBA::Boolean IsDimSupported(SMESH::Dimension type);
405 // Obsolete methods - To be removed in V7
407 void SetPhyMin(CORBA::Double theMinSize);
408 CORBA::Double GetPhyMin();
409 void SetPhyMax(CORBA::Double theMaxSize);
410 CORBA::Double GetPhyMax();
411 void SetGeoMin(CORBA::Double theMinSize);
412 CORBA::Double GetGeoMin();
413 void SetGeoMax(CORBA::Double theMaxSize);
414 CORBA::Double GetGeoMax();
415 void SetAngleMeshS(CORBA::Double angle);
416 CORBA::Double GetAngleMeshS();
417 void SetAngleMeshC(CORBA::Double angle);
418 CORBA::Double GetAngleMeshC();
419 void SetDecimesh(CORBA::Boolean toIgnoreEdges);
420 CORBA::Boolean GetDecimesh();
421 void SetPreCADRemoveNanoEdges(CORBA::Boolean toRemoveNanoEdges);
422 CORBA::Boolean GetPreCADRemoveNanoEdges();
423 void SetPreCADEpsNano(CORBA::Double epsNano);
424 CORBA::Double GetPreCADEpsNano();
427 ///////////////////////
429 ///////////////////////
430 std::string ShapeTypeToString(GEOM::shape_type theShapeType);
431 void CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType);
432 void CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std::vector<GEOM::shape_type> theShapeTypes);
433 std::string PublishIfNeeded(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType, std::string prefix);
434 std::string FormatVerticesEntries(std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);