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: public virtual POA_BLSURFPlugin::BLSURFPlugin_Hypothesis,
41 public virtual SMESH_Hypothesis_i {
44 BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA, ::SMESH_Gen* theGenImpl);
46 virtual ~BLSURFPlugin_Hypothesis_i();
48 void SetPhysicalMesh(CORBA::Long theValue);
49 CORBA::Long GetPhysicalMesh();
51 void SetGeometricMesh(CORBA::Long theValue);
52 CORBA::Long GetGeometricMesh();
54 void SetPhySize(CORBA::Double theValue);
55 void SetPhySizeRel(CORBA::Double theValue);
56 CORBA::Double GetPhySize();
57 CORBA::Boolean IsPhySizeRel();
59 void SetMinSize(CORBA::Double theMinSize);
60 void SetMinSizeRel(CORBA::Double theMinSize);
61 CORBA::Double GetMinSize();
62 CORBA::Boolean IsMinSizeRel();
64 void SetMaxSize(CORBA::Double theMaxSize);
65 void SetMaxSizeRel(CORBA::Double theMaxSize);
66 CORBA::Double GetMaxSize();
67 CORBA::Boolean IsMaxSizeRel();
69 void SetUseGradation(CORBA::Boolean theValue);
70 CORBA::Boolean GetUseGradation();
71 void SetGradation(CORBA::Double theValue);
72 CORBA::Double GetGradation();
74 void SetUseVolumeGradation(CORBA::Boolean theValue);
75 CORBA::Boolean GetUseVolumeGradation();
76 void SetVolumeGradation(CORBA::Double theValue);
77 CORBA::Double GetVolumeGradation();
79 void SetQuadAllowed(CORBA::Boolean theValue);
80 CORBA::Boolean GetQuadAllowed();
82 void SetAngleMesh(CORBA::Double theValue);
83 CORBA::Double GetAngleMesh();
85 void SetChordalError(CORBA::Double distance);
86 CORBA::Double GetChordalError();
88 void SetAnisotropic(CORBA::Boolean anisotropic);
89 CORBA::Boolean GetAnisotropic();
91 void SetAnisotropicRatio(CORBA::Double ratio);
92 CORBA::Double GetAnisotropicRatio();
94 void SetRemoveTinyEdges(CORBA::Boolean remove);
95 CORBA::Boolean GetRemoveTinyEdges();
97 void SetTinyEdgeLength(CORBA::Double length);
98 CORBA::Double GetTinyEdgeLength();
100 void SetOptimiseTinyEdges(CORBA::Boolean toOptimise);
101 CORBA::Boolean GetOptimiseTinyEdges();
103 void SetTinyEdgeOptimisationLength(CORBA::Double length);
104 CORBA::Double GetTinyEdgeOptimisationLength();
106 void SetCorrectSurfaceIntersection(CORBA::Boolean toOptimise);
107 CORBA::Boolean GetCorrectSurfaceIntersection();
109 void SetCorrectSurfaceIntersectionMaxCost(CORBA::Double maxCost);
110 CORBA::Double GetCorrectSurfaceIntersectionMaxCost();
112 void SetBadElementRemoval(CORBA::Boolean remove);
113 CORBA::Boolean GetBadElementRemoval();
115 void SetBadElementAspectRatio(CORBA::Double ratio);
116 CORBA::Double GetBadElementAspectRatio();
118 void SetOptimizeMesh(CORBA::Boolean optimize);
119 CORBA::Boolean GetOptimizeMesh();
121 void SetQuadraticMesh(CORBA::Boolean quadratic);
122 CORBA::Boolean GetQuadraticMesh();
124 void SetTopology(CORBA::Long theValue);
125 CORBA::Long GetTopology();
127 void SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception);
128 CORBA::Short GetVerbosity();
130 void SetEnforceCadEdgesSize( CORBA::Boolean toEnforce );
131 CORBA::Boolean GetEnforceCadEdgesSize();
133 void SetJacobianRectificationRespectGeometry( CORBA::Boolean allowRectification );
134 CORBA::Boolean GetJacobianRectificationRespectGeometry();
136 void SetJacobianRectification( CORBA::Boolean allowRectification );
137 CORBA::Boolean GetJacobianRectification();
139 void SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
140 CORBA::Long GetMaxNumberOfPointsPerPatch();
142 void SetRespectGeometry( CORBA::Boolean toRespect );
143 CORBA::Boolean GetRespectGeometry();
145 void SetTinyEdgesAvoidSurfaceIntersections( CORBA::Boolean toAvoidIntersection );
146 CORBA::Boolean GetTinyEdgesAvoidSurfaceIntersections();
148 void SetClosedGeometry( CORBA::Boolean isClosed );
149 CORBA::Boolean GetClosedGeometry();
151 void SetDebug( CORBA::Boolean isDebug );
154 void SetPeriodicTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
155 double GetPeriodicTolerance() throw (SALOME::SALOME_Exception);
157 void SetRequiredEntities( const char* howToTreat ) throw (SALOME::SALOME_Exception);
158 char* GetRequiredEntities();
160 void SetSewingTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
161 CORBA::Double GetSewingTolerance() throw (SALOME::SALOME_Exception);
163 void SetTags( const char* howToTreat ) throw (SALOME::SALOME_Exception);
166 void SetPreCADMergeEdges(CORBA::Boolean theValue);
167 CORBA::Boolean GetPreCADMergeEdges();
169 void SetPreCADRemoveTinyUVEdges(CORBA::Boolean theValue);
170 CORBA::Boolean GetPreCADRemoveTinyUVEdges();
172 void SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue);
173 CORBA::Boolean GetPreCADRemoveDuplicateCADFaces();
175 void SetPreCADProcess3DTopology(CORBA::Boolean theValue);
176 CORBA::Boolean GetPreCADProcess3DTopology();
178 void SetPreCADDiscardInput(CORBA::Boolean theValue);
179 CORBA::Boolean GetPreCADDiscardInput();
181 void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
182 void SetPreCADOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
183 char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
184 char* GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
186 void UnsetOption(const char* optionName);
187 void UnsetPreCADOption(const char* optionName);
189 BLSURFPlugin::string_array* GetOptionValues();
190 BLSURFPlugin::string_array* GetPreCADOptionValues();
191 BLSURFPlugin::string_array* GetAdvancedOptionValues();
193 void SetOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
194 void SetPreCADOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
195 void SetAdvancedOptionValues(const BLSURFPlugin::string_array& options);
196 void SetAdvancedOption(const char* optionsAndValues) throw (SALOME::SALOME_Exception);
198 void AddOption(const char* optionName, const char* optionValue);
199 void AddPreCADOption(const char* optionName, const char* optionValue);
200 char* GetOption(const char* optionName);
201 char* GetPreCADOption(const char* optionName);
203 void SetSizeMapEntry(const char* entry, const char* sizeMap) throw (SALOME::SALOME_Exception);
205 void SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap) throw (SALOME::SALOME_Exception);
207 char* GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
209 void UnsetEntry(const char* entry);
211 BLSURFPlugin::string_array* GetSizeMapEntries();
213 void SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps) throw (SALOME::SALOME_Exception);
215 void SetSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) throw (SALOME::SALOME_Exception);
217 void SetConstantSizeMap(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap);
219 void UnsetSizeMap(GEOM::GEOM_Object_ptr GeomObj);
221 void ClearSizeMaps();
223 void SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor);
225 void UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj);
227 void SetAttractorEntry(const char* entry, const char* attractor) throw (SALOME::SALOME_Exception);
229 char* GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception);
231 BLSURFPlugin::string_array* GetAttractorEntries();
235 * Set/get/unset an attractor on a face
238 void SetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj, GEOM::GEOM_Object_ptr Attractor, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius );
240 void UnsetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj,
241 GEOM::GEOM_Object_ptr theAttractor);
243 void UnsetAttractorEntry(const char* entry, const char* attractor);
244 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);
246 BLSURFPlugin::TAttParamsMap* GetAttractorParams();
250 void SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap);
252 void UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj);
254 void SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) throw (SALOME::SALOME_Exception);
256 char* GetCustomSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
258 BLSURFPlugin::string_array* GetCustomSizeMapEntries();
261 ///////////////////////
262 // ENFORCED VERTEXES //
263 ///////////////////////
265 BLSURFPlugin::TFaceEntryEnfVertexListMap* GetAllEnforcedVerticesByFace();
266 BLSURFPlugin::TEnfVertexList* GetAllEnforcedVertices();
268 BLSURFPlugin::TFaceEntryCoordsListMap* GetAllCoordsByFace();
269 BLSURFPlugin::TCoordsEnfVertexMap* GetAllEnforcedVerticesByCoords();
271 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* GetAllEnfVertexEntriesByFace();
272 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* GetAllEnforcedVerticesByEnfVertexEntry();
274 void ClearAllEnforcedVertices();
277 * Set/get/unset an enforced vertex on geom object
279 bool SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
280 throw (SALOME::SALOME_Exception);
281 bool SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
282 throw (SALOME::SALOME_Exception);
283 bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
284 throw (SALOME::SALOME_Exception);
285 bool SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
286 throw (SALOME::SALOME_Exception);
287 bool SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
288 throw (SALOME::SALOME_Exception);
289 bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
290 throw (SALOME::SALOME_Exception);
292 BLSURFPlugin::TEnfVertexList* GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
294 bool UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
295 throw (SALOME::SALOME_Exception);
296 bool UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
297 throw (SALOME::SALOME_Exception);
298 bool UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
301 * Set/get/unset an enforced vertex on geom object given by entry
303 bool SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
304 const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "")
305 throw (SALOME::SALOME_Exception);
307 BLSURFPlugin::TEnfVertexList* GetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
309 bool UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z,
310 const char* theVertexEntry = "") throw (SALOME::SALOME_Exception);
311 bool UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
314 * To add internal vertices as enforced vertices
316 void SetInternalEnforcedVertexAllFaces(CORBA::Boolean toEnforceInternalVertices);
317 CORBA::Boolean GetInternalEnforcedVertexAllFaces();
318 void SetInternalEnforcedVertexAllFacesGroup(const char* groupName = "");
319 char* GetInternalEnforcedVertexAllFacesGroup();
321 // Enable internal enforced vertices on specific face if requested by user
322 // void SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) throw (SALOME::SALOME_Exception);
323 // void SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
324 // void SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
325 // CORBA::Boolean GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
326 // CORBA::Boolean GetInternalEnforcedVertexEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
328 ///////////////////////
330 ///////////////////////
332 void ClearPreCadPeriodicityVectors();
334 BLSURFPlugin::TPeriodicityList* GetPreCadFacesPeriodicityVector();
335 BLSURFPlugin::TPeriodicityList* GetPreCadEdgesPeriodicityVector();
337 BLSURFPlugin::TPeriodicityList* PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector);
339 void AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
340 throw (SALOME::SALOME_Exception);
342 void AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
343 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
344 throw (SALOME::SALOME_Exception);
346 void AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
347 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
348 throw (SALOME::SALOME_Exception);
350 void AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
351 throw (SALOME::SALOME_Exception);
353 void AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
354 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
355 throw (SALOME::SALOME_Exception);
357 void AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
358 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
359 throw (SALOME::SALOME_Exception);
361 ///////////////////////
364 * Sets the file for export resulting mesh in GMF format
366 // void SetGMFFile(const char* theFileName, CORBA::Boolean isBinary);
367 void SetGMFFile(const char* theFileName);
369 // CORBA::Boolean GetGMFFileMode();
371 // Get implementation
372 ::BLSURFPlugin_Hypothesis* GetImpl();
374 // Verify whether hypothesis supports given entity type
375 CORBA::Boolean IsDimSupported(SMESH::Dimension type);
379 // Obsolete methods - To be removed in V7
381 void SetPhyMin(CORBA::Double theMinSize);
382 CORBA::Double GetPhyMin();
383 void SetPhyMax(CORBA::Double theMaxSize);
384 CORBA::Double GetPhyMax();
385 void SetGeoMin(CORBA::Double theMinSize);
386 CORBA::Double GetGeoMin();
387 void SetGeoMax(CORBA::Double theMaxSize);
388 CORBA::Double GetGeoMax();
389 void SetAngleMeshS(CORBA::Double angle);
390 CORBA::Double GetAngleMeshS();
391 void SetAngleMeshC(CORBA::Double angle);
392 CORBA::Double GetAngleMeshC();
393 void SetDecimesh(CORBA::Boolean toIgnoreEdges);
394 CORBA::Boolean GetDecimesh();
395 void SetPreCADRemoveNanoEdges(CORBA::Boolean toRemoveNanoEdges);
396 CORBA::Boolean GetPreCADRemoveNanoEdges();
397 void SetPreCADEpsNano(CORBA::Double epsNano);
398 CORBA::Double GetPreCADEpsNano();
401 ///////////////////////
403 ///////////////////////
404 std::string ShapeTypeToString(GEOM::shape_type theShapeType);
405 void CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType);
406 void CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std::vector<GEOM::shape_type> theShapeTypes);
407 std::string PublishIfNeeded(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType, std::string prefix);
408 std::string FormatVerticesEntries(std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);