Version: 8.3.0
BLSURFPlugin_Hypothesis_i.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 // ---
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)
24 // ---
25 //
26 #ifndef _BLSURFPlugin_Hypothesis_i_HXX_
27 #define _BLSURFPlugin_Hypothesis_i_HXX_
28 
29 #include <SALOMEconfig.h>
30 #include CORBA_SERVER_HEADER(BLSURFPlugin_Algorithm)
31 
32 #include "SMESH_Hypothesis_i.hxx"
34 
35 class SMESH_Gen;
36 class GEOM_Object;
37 
38 // BLSURFPlugin parameters hypothesis
39 
41  public virtual POA_BLSURFPlugin::BLSURFPlugin_Hypothesis,
42  public virtual SMESH_Hypothesis_i
43 {
44 public:
45  // Constructor
46  BLSURFPlugin_Hypothesis_i(PortableServer::POA_ptr thePOA,
47  int theStudyId,
48  ::SMESH_Gen* theGenImpl,
49  bool theHasGEOM);
50  // Destructor
52 
53  void SetPhysicalMesh(CORBA::Long theValue);
54  CORBA::Long GetPhysicalMesh();
55 
56  void SetGeometricMesh(CORBA::Long theValue);
57  CORBA::Long GetGeometricMesh();
58 
59  void SetPhySize(CORBA::Double theValue);
60  void SetPhySizeRel(CORBA::Double theValue);
61  CORBA::Double GetPhySize();
62  CORBA::Boolean IsPhySizeRel();
63 
64  void SetMinSize(CORBA::Double theMinSize);
65  void SetMinSizeRel(CORBA::Double theMinSize);
66  CORBA::Double GetMinSize();
67  CORBA::Boolean IsMinSizeRel();
68 
69  void SetMaxSize(CORBA::Double theMaxSize);
70  void SetMaxSizeRel(CORBA::Double theMaxSize);
71  CORBA::Double GetMaxSize();
72  CORBA::Boolean IsMaxSizeRel();
73 
74  void SetUseGradation(CORBA::Boolean theValue);
75  CORBA::Boolean GetUseGradation();
76  void SetGradation(CORBA::Double theValue);
77  CORBA::Double GetGradation();
78 
79  void SetUseVolumeGradation(CORBA::Boolean theValue);
80  CORBA::Boolean GetUseVolumeGradation();
81  void SetVolumeGradation(CORBA::Double theValue);
82  CORBA::Double GetVolumeGradation();
83 
84  void SetQuadAllowed(CORBA::Boolean theValue);
85  CORBA::Boolean GetQuadAllowed();
86 
87  void SetAngleMesh(CORBA::Double theValue);
88  CORBA::Double GetAngleMesh();
89 
90  void SetChordalError(CORBA::Double distance);
91  CORBA::Double GetChordalError();
92 
93  void SetAnisotropic(CORBA::Boolean anisotropic);
94  CORBA::Boolean GetAnisotropic();
95 
96  void SetAnisotropicRatio(CORBA::Double ratio);
97  CORBA::Double GetAnisotropicRatio();
98 
99  void SetRemoveTinyEdges(CORBA::Boolean remove);
100  CORBA::Boolean GetRemoveTinyEdges();
101 
102  void SetTinyEdgeLength(CORBA::Double length);
103  CORBA::Double GetTinyEdgeLength();
104 
105  void SetOptimiseTinyEdges(CORBA::Boolean toOptimise);
106  CORBA::Boolean GetOptimiseTinyEdges();
107 
108  void SetTinyEdgeOptimisationLength(CORBA::Double length);
109  CORBA::Double GetTinyEdgeOptimisationLength();
110 
111  void SetCorrectSurfaceIntersection(CORBA::Boolean toOptimise);
112  CORBA::Boolean GetCorrectSurfaceIntersection();
113 
114  void SetCorrectSurfaceIntersectionMaxCost(CORBA::Double maxCost);
115  CORBA::Double GetCorrectSurfaceIntersectionMaxCost();
116 
117  void SetBadElementRemoval(CORBA::Boolean remove);
118  CORBA::Boolean GetBadElementRemoval();
119 
120  void SetBadElementAspectRatio(CORBA::Double ratio);
121  CORBA::Double GetBadElementAspectRatio();
122 
123  void SetOptimizeMesh(CORBA::Boolean optimize);
124  CORBA::Boolean GetOptimizeMesh();
125 
126  void SetQuadraticMesh(CORBA::Boolean quadratic);
127  CORBA::Boolean GetQuadraticMesh();
128 
129  void SetTopology(CORBA::Long theValue);
130  CORBA::Long GetTopology();
131 
132  void SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception);
133  CORBA::Short GetVerbosity();
134 
135  void SetEnforceCadEdgesSize( CORBA::Boolean toEnforce );
136  CORBA::Boolean GetEnforceCadEdgesSize();
137 
138  void SetJacobianRectificationRespectGeometry( CORBA::Boolean allowRectification );
140 
141  void SetUseDeprecatedPatchMesher( CORBA::Boolean useDeprecatedPatchMesher );
142  CORBA::Boolean GetUseDeprecatedPatchMesher();
143 
144  void SetJacobianRectification( CORBA::Boolean allowRectification );
145  CORBA::Boolean GetJacobianRectification();
146 
147  void SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
148  CORBA::Long GetMaxNumberOfPointsPerPatch();
149 
150  void SetMaxNumberOfThreads( CORBA::Long nb ) throw (SALOME::SALOME_Exception);
151  CORBA::Long GetMaxNumberOfThreads();
152 
153  void SetRespectGeometry( CORBA::Boolean toRespect );
154  CORBA::Boolean GetRespectGeometry();
155 
156  void SetTinyEdgesAvoidSurfaceIntersections( CORBA::Boolean toAvoidIntersection );
157  CORBA::Boolean GetTinyEdgesAvoidSurfaceIntersections();
158 
159  void SetClosedGeometry( CORBA::Boolean isClosed );
160  CORBA::Boolean GetClosedGeometry();
161 
162  void SetDebug( CORBA::Boolean isDebug );
163  bool GetDebug();
164 
165  void SetPeriodicTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
166  double GetPeriodicTolerance() throw (SALOME::SALOME_Exception);
167 
168  void SetRequiredEntities( const char* howToTreat ) throw (SALOME::SALOME_Exception);
169  char* GetRequiredEntities();
170 
171  void SetSewingTolerance( CORBA::Double tol ) throw (SALOME::SALOME_Exception);
172  CORBA::Double GetSewingTolerance() throw (SALOME::SALOME_Exception);
173 
174  void SetTags( const char* howToTreat ) throw (SALOME::SALOME_Exception);
175  char* GetTags();
176 
179 
180  void SetPreCADMergeEdges(CORBA::Boolean theValue);
181  CORBA::Boolean GetPreCADMergeEdges();
182 
183  void SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue);
184  CORBA::Boolean GetPreCADRemoveDuplicateCADFaces();
185 
186  void SetPreCADProcess3DTopology(CORBA::Boolean theValue);
187  CORBA::Boolean GetPreCADProcess3DTopology();
188 
189  void SetPreCADDiscardInput(CORBA::Boolean theValue);
190  CORBA::Boolean GetPreCADDiscardInput();
191 
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);
196 
197  void UnsetOption(const char* optionName);
198  void UnsetPreCADOption(const char* optionName);
199 
203 
204  void SetOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
205  void SetPreCADOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
207  void SetAdvancedOption(const char* optionsAndValues) throw (SALOME::SALOME_Exception);
208 
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);
213 
214  void SetSizeMapEntry(const char* entry, const char* sizeMap) throw (SALOME::SALOME_Exception);
215 
216  void SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap) throw (SALOME::SALOME_Exception);
217 
218  char* GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
219 
220  void UnsetEntry(const char* entry);
221 
223 
224  void SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps) throw (SALOME::SALOME_Exception);
225 
226  void SetSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) throw (SALOME::SALOME_Exception);
227 
228  void SetConstantSizeMap(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap);
229 
230  void UnsetSizeMap(GEOM::GEOM_Object_ptr GeomObj);
231 
232  void ClearSizeMaps();
233 
234  void SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor);
235 
236  void UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj);
237 
238  void SetAttractorEntry(const char* entry, const char* attractor) throw (SALOME::SALOME_Exception);
239 
240  char* GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception);
241 
243 
244 
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 );
250 
251  void UnsetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj,
252  GEOM::GEOM_Object_ptr theAttractor);
253 
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);
256 
258 
259 
260  /*
261  void SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap);
262 
263  void UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj);
264 
265  void SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) throw (SALOME::SALOME_Exception);
266 
267  char* GetCustomSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
268 
269  BLSURFPlugin::string_array* GetCustomSizeMapEntries();
270  */
271 
273  // ENFORCED VERTEXES //
275 
278 
281 
284 
286 
290  // OBSOLETE
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);
303 
304  BLSURFPlugin::TEnfVertexList* GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
305 
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);
311 
312  // NEW - no face
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);
325 
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);
331 
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);
338 
339  BLSURFPlugin::TEnfVertexList* GetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
340 
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);
344 
348  void SetInternalEnforcedVertexAllFaces(CORBA::Boolean toEnforceInternalVertices);
349  CORBA::Boolean GetInternalEnforcedVertexAllFaces();
350  void SetInternalEnforcedVertexAllFacesGroup(const char* groupName = "");
352 
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);
359 
361  // PERIODICITY //
363 
365 
368 
370 
371  void AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
372  throw (SALOME::SALOME_Exception);
373 
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);
377 
378  void AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
379  const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
380  throw (SALOME::SALOME_Exception);
381 
382  void AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
383  throw (SALOME::SALOME_Exception);
384 
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);
388 
389  void AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
390  const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
391  throw (SALOME::SALOME_Exception);
392 
394 
398 // void SetGMFFile(const char* theFileName, CORBA::Boolean isBinary);
399  void SetGMFFile(const char* theFileName);
400  char* GetGMFFile();
401 // CORBA::Boolean GetGMFFileMode();
402 
403  // Get implementation
405 
406  // Verify whether hypothesis supports given entity type
407  CORBA::Boolean IsDimSupported(SMESH::Dimension type);
408 
409 
410  //
411  // Obsolete methods - To be removed in V7
412  //
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();
431 
432 private:
434  // PERIODICITY //
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);
441 
442 };
443 
444 #endif