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, int theStudyId, ::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 SetGradation(CORBA::Double theValue);
70 CORBA::Double GetGradation();
72 void SetQuadAllowed(CORBA::Boolean theValue);
73 CORBA::Boolean GetQuadAllowed();
75 void SetAngleMesh(CORBA::Double theValue);
76 CORBA::Double GetAngleMesh();
78 void SetChordalError(CORBA::Double distance);
79 CORBA::Double GetChordalError();
81 void SetAnisotropic(CORBA::Boolean anisotropic);
82 CORBA::Boolean GetAnisotropic();
84 void SetAnisotropicRatio(CORBA::Double ratio);
85 CORBA::Double GetAnisotropicRatio();
87 void SetRemoveTinyEdges(CORBA::Boolean remove);
88 CORBA::Boolean GetRemoveTinyEdges();
90 void SetTinyEdgeLength(CORBA::Double length);
91 CORBA::Double GetTinyEdgeLength();
93 void SetBadElementRemoval(CORBA::Boolean remove);
94 CORBA::Boolean GetBadElementRemoval();
96 void SetBadElementAspectRatio(CORBA::Double ratio);
97 CORBA::Double GetBadElementAspectRatio();
99 void SetOptimizeMesh(CORBA::Boolean optimize);
100 CORBA::Boolean GetOptimizeMesh();
102 void SetQuadraticMesh(CORBA::Boolean quadratic);
103 CORBA::Boolean GetQuadraticMesh();
105 void SetTopology(CORBA::Long theValue);
106 CORBA::Long GetTopology();
108 void SetVerbosity(CORBA::Short theVal) throw (SALOME::SALOME_Exception);
109 CORBA::Short GetVerbosity();
111 void SetPreCADMergeEdges(CORBA::Boolean theValue);
112 CORBA::Boolean GetPreCADMergeEdges();
114 void SetPreCADRemoveTinyUVEdges(CORBA::Boolean theValue);
115 CORBA::Boolean GetPreCADRemoveTinyUVEdges();
117 void SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue);
118 CORBA::Boolean GetPreCADRemoveDuplicateCADFaces();
120 void SetPreCADProcess3DTopology(CORBA::Boolean theValue);
121 CORBA::Boolean GetPreCADProcess3DTopology();
123 void SetPreCADDiscardInput(CORBA::Boolean theValue);
124 CORBA::Boolean GetPreCADDiscardInput();
126 void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
127 void SetPreCADOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
128 char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
129 char* GetPreCADOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
131 void UnsetOption(const char* optionName);
132 void UnsetPreCADOption(const char* optionName);
134 BLSURFPlugin::string_array* GetOptionValues();
135 BLSURFPlugin::string_array* GetPreCADOptionValues();
137 void SetOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
138 void SetPreCADOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception);
140 void AddOption(const char* optionName, const char* optionValue);
141 void AddPreCADOption(const char* optionName, const char* optionValue);
142 char* GetOption(const char* optionName);
143 char* GetPreCADOption(const char* optionName);
145 void SetSizeMapEntry(const char* entry, const char* sizeMap) throw (SALOME::SALOME_Exception);
147 void SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap) throw (SALOME::SALOME_Exception);
149 char* GetSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
151 void UnsetEntry(const char* entry);
153 BLSURFPlugin::string_array* GetSizeMapEntries();
155 void SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps) throw (SALOME::SALOME_Exception);
157 void SetSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) throw (SALOME::SALOME_Exception);
159 void SetConstantSizeMap(GEOM::GEOM_Object_ptr GeomObj, CORBA::Double sizeMap);
161 void UnsetSizeMap(GEOM::GEOM_Object_ptr GeomObj);
163 void ClearSizeMaps();
165 void SetAttractor(GEOM::GEOM_Object_ptr GeomObj, const char* attractor);
167 void UnsetAttractor(GEOM::GEOM_Object_ptr GeomObj);
169 void SetAttractorEntry(const char* entry, const char* attractor) throw (SALOME::SALOME_Exception);
171 char* GetAttractorEntry(const char* entry) throw (SALOME::SALOME_Exception);
173 BLSURFPlugin::string_array* GetAttractorEntries();
177 * Set/get/unset an attractor on a face
180 void SetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj, GEOM::GEOM_Object_ptr Attractor, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius );
182 void UnsetAttractorGeom(GEOM::GEOM_Object_ptr GeomObj,
183 GEOM::GEOM_Object_ptr theAttractor);
185 void UnsetAttractorEntry(const char* entry, const char* attractor);
186 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);
188 BLSURFPlugin::TAttParamsMap* GetAttractorParams();
192 void SetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap);
194 void UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj);
196 void SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) throw (SALOME::SALOME_Exception);
198 char* GetCustomSizeMapEntry(const char* entry) throw (SALOME::SALOME_Exception);
200 BLSURFPlugin::string_array* GetCustomSizeMapEntries();
203 ///////////////////////
204 // ENFORCED VERTEXES //
205 ///////////////////////
207 BLSURFPlugin::TFaceEntryEnfVertexListMap* GetAllEnforcedVerticesByFace();
208 BLSURFPlugin::TEnfVertexList* GetAllEnforcedVertices();
210 BLSURFPlugin::TFaceEntryCoordsListMap* GetAllCoordsByFace();
211 BLSURFPlugin::TCoordsEnfVertexMap* GetAllEnforcedVerticesByCoords();
213 BLSURFPlugin::TFaceEntryEnfVertexEntryListMap* GetAllEnfVertexEntriesByFace();
214 BLSURFPlugin::TEnfVertexEntryEnfVertexMap* GetAllEnforcedVerticesByEnfVertexEntry();
216 void ClearAllEnforcedVertices();
219 * Set/get/unset an enforced vertex on geom object
221 bool SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
222 throw (SALOME::SALOME_Exception);
223 bool SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName)
224 throw (SALOME::SALOME_Exception);
225 bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
226 throw (SALOME::SALOME_Exception);
227 bool SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName)
228 throw (SALOME::SALOME_Exception);
229 bool SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName)
230 throw (SALOME::SALOME_Exception);
231 bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName)
232 throw (SALOME::SALOME_Exception);
234 BLSURFPlugin::TEnfVertexList* GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
236 bool UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z)
237 throw (SALOME::SALOME_Exception);
238 bool UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex)
239 throw (SALOME::SALOME_Exception);
240 bool UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
243 * Set/get/unset an enforced vertex on geom object given by entry
245 bool SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
246 const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "")
247 throw (SALOME::SALOME_Exception);
249 BLSURFPlugin::TEnfVertexList* GetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
251 bool UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z,
252 const char* theVertexEntry = "") throw (SALOME::SALOME_Exception);
253 bool UnsetEnforcedVerticesEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
256 * To add internal vertices as enforced vertices
258 void SetInternalEnforcedVertexAllFaces(CORBA::Boolean toEnforceInternalVertices);
259 CORBA::Boolean GetInternalEnforcedVertexAllFaces();
260 void SetInternalEnforcedVertexAllFacesGroup(const char* groupName = "");
261 char* GetInternalEnforcedVertexAllFacesGroup();
263 // Enable internal enforced vertices on specific face if requested by user
264 // void SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) throw (SALOME::SALOME_Exception);
265 // void SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
266 // void SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") throw (SALOME::SALOME_Exception);
267 // CORBA::Boolean GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) throw (SALOME::SALOME_Exception);
268 // CORBA::Boolean GetInternalEnforcedVertexEntry(const char* theFaceEntry) throw (SALOME::SALOME_Exception);
270 ///////////////////////
272 ///////////////////////
274 void ClearPreCadPeriodicityVectors();
276 BLSURFPlugin::TPeriodicityList* GetPreCadFacesPeriodicityVector();
277 BLSURFPlugin::TPeriodicityList* GetPreCadEdgesPeriodicityVector();
279 BLSURFPlugin::TPeriodicityList* PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector);
281 void AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2)
282 throw (SALOME::SALOME_Exception);
284 void AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2,
285 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
286 throw (SALOME::SALOME_Exception);
288 void AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry,
289 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
290 throw (SALOME::SALOME_Exception);
292 void AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2)
293 throw (SALOME::SALOME_Exception);
295 void AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2,
296 const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices)
297 throw (SALOME::SALOME_Exception);
299 void AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry,
300 const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries)
301 throw (SALOME::SALOME_Exception);
303 ///////////////////////
306 * Sets the file for export resulting mesh in GMF format
308 // void SetGMFFile(const char* theFileName, CORBA::Boolean isBinary);
309 void SetGMFFile(const char* theFileName);
311 // CORBA::Boolean GetGMFFileMode();
313 // Get implementation
314 ::BLSURFPlugin_Hypothesis* GetImpl();
316 // Verify whether hypothesis supports given entity type
317 CORBA::Boolean IsDimSupported(SMESH::Dimension type);
321 // Obsolete methods - To be removed in V7
323 void SetPhyMin(CORBA::Double theMinSize);
324 CORBA::Double GetPhyMin();
325 void SetPhyMax(CORBA::Double theMaxSize);
326 CORBA::Double GetPhyMax();
327 void SetGeoMin(CORBA::Double theMinSize);
328 CORBA::Double GetGeoMin();
329 void SetGeoMax(CORBA::Double theMaxSize);
330 CORBA::Double GetGeoMax();
331 void SetAngleMeshS(CORBA::Double angle);
332 CORBA::Double GetAngleMeshS();
333 void SetAngleMeshC(CORBA::Double angle);
334 CORBA::Double GetAngleMeshC();
335 void SetDecimesh(CORBA::Boolean toIgnoreEdges);
336 CORBA::Boolean GetDecimesh();
337 void SetPreCADRemoveNanoEdges(CORBA::Boolean toRemoveNanoEdges);
338 CORBA::Boolean GetPreCADRemoveNanoEdges();
339 void SetPreCADEpsNano(CORBA::Double epsNano);
340 CORBA::Double GetPreCADEpsNano();
343 ///////////////////////
345 ///////////////////////
346 std::string ShapeTypeToString(GEOM::shape_type theShapeType);
347 void CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType);
348 void CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std::vector<GEOM::shape_type> theShapeTypes);
349 std::string PublishIfNeeded(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType, std::string prefix);
350 std::string FormatVerticesEntries(std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);