1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : SMESH_Filter.idl
24 // Author : Alexey Petrov, OCC
26 #ifndef _SMESH_FILTER_IDL_
27 #define _SMESH_FILTER_IDL_
29 #include "SALOME_Exception.idl"
30 #include "SALOME_GenericObj.idl"
31 #include "GEOM_Gen.idl"
32 #include "SMESH_Mesh.idl"
38 * Enumeration of functor types
50 FT_MaxElementLength2D,
51 FT_MaxElementLength3D,
63 FT_BelongToGenSurface,
82 * Parameters of a reclangle of histogram
84 struct HistogramRectangle
90 typedef sequence<HistogramRectangle> Histogram;
94 * Base interface for all functors ( i.e. numerical functors and predicates )
96 interface Functor: SALOME::GenericObj
98 void SetMesh( in SMESH_Mesh theMesh );
99 FunctorType GetFunctorType();
100 ElementType GetElementType();
104 * Numerical functors are intended for calculating value by Id of mesh entity
106 interface NumericalFunctor: Functor
108 double GetValue( in long theElementId );
110 Histogram GetHistogram( in short nbIntervals );
113 * Set precision for calculation. It is a position after point which is
114 * used to functor value after calculation.
116 void SetPrecision( in long thePrecision );
119 interface MinimumAngle : NumericalFunctor{};
120 interface AspectRatio : NumericalFunctor{};
121 interface AspectRatio3D : NumericalFunctor{};
122 interface Warping : NumericalFunctor{};
123 interface Taper : NumericalFunctor{};
124 interface Skew : NumericalFunctor{};
125 interface Area : NumericalFunctor{};
126 interface Volume3D : NumericalFunctor{};
127 interface MaxElementLength2D : NumericalFunctor{};
128 interface MaxElementLength3D : NumericalFunctor{};
129 interface Length : NumericalFunctor{};
130 interface Length2D : NumericalFunctor
137 typedef sequence<Value> Values;
140 interface MultiConnection : NumericalFunctor{};
141 interface MultiConnection2D : NumericalFunctor
149 typedef sequence<Value> Values;
155 * Predicates are intended for verification of criteria,
156 * must return bool value by mesh id
158 interface Predicate: Functor
160 boolean IsSatisfy( in long thEntityId );
164 * Logical functor (predicate) "Bad Oriented Volume".
165 * Verify whether a mesh volume is incorrectly oriented from
166 * the point of view of MED convention
168 interface BadOrientedVolume: Predicate {};
171 * Logical functor (predicate) "Volumes with bare border" and "Faces with bare border".
172 * Verify whether a mesh volume has a free facet without a mesh face on it
174 interface BareBorderVolume: Predicate {};
176 * Logical functor (predicate) "Faces with bare border".
177 * Verify whether a mesh face has a side not shared with another face
178 * and without a mesh edge on it
180 interface BareBorderFace: Predicate {};
183 * Logical functor (predicate) "Belong To Geometry".
184 * Verify whether mesh element or node belong to pointed Geom Object
186 interface BelongToGeom: Predicate
188 void SetGeom( in GEOM::GEOM_Object theGeom );
189 void SetElementType( in ElementType theType );
191 /*! The tolerance is used only if there is no submesh on the shape
193 void SetTolerance( in double theToler );
194 double GetTolerance();
196 void SetShapeName( in string theName );
197 void SetShape( in string theID, in string theName );
198 string GetShapeName();
203 * Logical functor (predicate) "Belong To Surface".
204 * Base interface for "belong to plane" and "belong to cylinder"
205 * and "Belong To Generic Surface" interfaces
207 interface BelongToSurface: Predicate
209 void SetTolerance( in double theToler );
210 double GetTolerance();
211 void SetShapeName( in string theName, in ElementType theType );
212 void SetShape( in string theID, in string theName, in ElementType theType );
213 string GetShapeName();
216 * Limit surface extent to bounding box of boundaries (edges)
217 * in surface parametric space. Boundaries are ignored by default
219 void SetUseBoundaries( in boolean theUseBndRestrictions );
220 boolean GetUseBoundaries();
224 * Logical functor (predicate) "Belong To Plane".
225 * Verify whether mesh element lie on pointed Geom planar object
227 interface BelongToPlane: BelongToSurface
229 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
233 * Logical functor (predicate) "Belong To Cylinder".
234 * Verify whether mesh element lie on pointed Geom cylindrical object
236 interface BelongToCylinder: BelongToSurface
238 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
242 * Logical functor (predicate) "Belong To Generic Surface".
243 * Verify whether mesh element lie in pointed Geom cylindrical object
245 interface BelongToGenSurface: BelongToSurface
247 void SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
251 * Logical functor (predicate) "Lying On Geometry".
252 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
254 interface LyingOnGeom: Predicate
256 void SetGeom( in GEOM::GEOM_Object theGeom );
257 void SetElementType( in ElementType theType );
259 /*! The tolerance is used only if there is no submesh on the shape
261 void SetTolerance( in double theToler );
262 double GetTolerance();
264 void SetShapeName( in string theName );
265 void SetShape( in string theID, in string theName );
266 string GetShapeName();
271 * Logical functor (predicate) "Free borders".
272 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
274 interface FreeBorders: Predicate{};
277 * Logical functor (predicate) "Free edges".
278 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
280 interface FreeEdges: Predicate
287 typedef sequence<Border> Borders;
288 Borders GetBorders();
292 * Logical functor (predicate) "Free nodes".
293 * Verify whether mesh has free nodes( i.e. nodes are not connected to any element )
295 interface FreeNodes: Predicate{};
298 * Logical functor (predicate) "Free faces".
299 * Verify whether 2D mesh element is free ( i.e. connected to one volume only )
301 interface FreeFaces: Predicate{};
304 * Abstract logical functor (predicate) "RangeOfIds".
305 * Verify whether an Entity Id belongs to defined sequence of id's
307 interface RangeOfIds: Predicate
309 void SetRange( in long_array theIds );
310 boolean SetRangeStr( in string theRange );
311 string GetRangeStr();
313 void SetElementType( in ElementType theType );
317 * Comparator. Predicate for compare value calculated
318 * by numerical functor with threshold value
320 interface Comparator: Predicate
322 void SetMargin( in double theValue );
323 void SetNumFunctor( in NumericalFunctor theFunct );
326 interface LessThan: Comparator{};
327 interface MoreThan: Comparator{};
328 interface EqualTo : Comparator
330 void SetTolerance( in double theToler );
331 double GetTolerance();
335 * Logical predicates are intended for compose predicates using boolean operations
337 interface Logical: Predicate{};
339 interface LogicalNOT: Logical
341 void SetPredicate(in Predicate thePredicate);
344 interface LogicalBinary: Logical
346 void SetPredicate1( in Predicate thePredicate );
347 void SetPredicate2( in Predicate thePredicate );
350 interface LogicalAND: LogicalBinary{};
351 interface LogicalOR : LogicalBinary{};
354 * Logical functor (predicate) "Is element Linear or Quadratic".
355 * Verify whether a mesh element is linear
357 interface LinearOrQuadratic: Predicate {
358 void SetElementType( in ElementType theType );
362 * Functor "Group Color"
363 * Returns color of group to which mesh element belongs to
365 interface GroupColor : Predicate{
366 void SetElementType( in ElementType theType );
367 void SetColorStr( in string theColor );
368 string GetColorStr();
372 * Functor "Element geometry type"
373 * Returns is element has indicated geometry type
375 interface ElemGeomType : Predicate{
376 void SetElementType ( in ElementType theType );
377 void SetGeometryType( in GeometryType theType );
383 interface Filter: SALOME::GenericObj, SMESH_IDSource
386 * Structure containing information about one criterion
387 * Type - FT_Taper, FT_Skew ...
388 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
389 * Threshold - threshold value
390 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
391 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
392 * (FT_Undefined must be for the last criterion)
393 * ThresholdStr - Threshold value defined as string. Used for:
394 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
395 * 2. BelongToGeom predicate for storing name of shape
396 * 3. GroupColor predicate for storing group color "0.2;0;0.5"
397 * ThresholdID - One more threshold value defined as string. Used for:
398 * 1. BelongToGeom predicate for storing id of shape
399 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
400 * "Belong to plane" and "Belong to cylinder" predicates
401 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
402 * Precision - Precision of numerical functors
414 ElementType TypeOfElement;
418 typedef sequence<Criterion> Criteria;
420 void SetPredicate( in Predicate thePredicate );
421 void SetMesh( in SMESH_Mesh theMesh );
423 long_array GetElementsId( in SMESH_Mesh theMesh );
424 ElementType GetElementType();
425 Predicate GetPredicate();
427 boolean GetCriteria( out Criteria theCriteria );
428 boolean SetCriteria( in Criteria theCriteria );
433 * Interface for working with library of filters
435 interface FilterLibrary : SALOME::GenericObj
438 * Copy filter from library by name (new filter is created)
440 Filter Copy( in string theFilterName );
443 * Methods for editing library
445 boolean Add ( in string theFilterName, in Filter theFilter );
446 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
447 boolean Delete ( in string theFilterName );
448 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
451 * Save library on disk
454 boolean SaveAs( in string aFileName );
459 boolean IsPresent( in string aFilterName );
460 long NbFilters( in ElementType aType );
461 string_array GetNames( in ElementType aType );
462 string_array GetAllNames();
463 void SetFileName( in string aFilterName );
464 string GetFileName();
469 * Interface of Filter manager
471 interface FilterManager: SALOME::GenericObj
474 * Create numerical functors
476 MinimumAngle CreateMinimumAngle();
477 AspectRatio CreateAspectRatio();
478 AspectRatio3D CreateAspectRatio3D();
479 Warping CreateWarping();
483 Volume3D CreateVolume3D();
484 MaxElementLength2D CreateMaxElementLength2D();
485 MaxElementLength3D CreateMaxElementLength3D();
486 Length CreateLength();
487 Length2D CreateLength2D();
488 MultiConnection CreateMultiConnection();
489 MultiConnection2D CreateMultiConnection2D();
492 * Create logical functors ( predicates )
494 BelongToGeom CreateBelongToGeom();
495 BelongToPlane CreateBelongToPlane();
496 BelongToCylinder CreateBelongToCylinder();
497 BelongToGenSurface CreateBelongToGenSurface();
499 LyingOnGeom CreateLyingOnGeom();
501 FreeBorders CreateFreeBorders();
502 FreeEdges CreateFreeEdges();
503 FreeNodes CreateFreeNodes();
504 FreeFaces CreateFreeFaces();
506 RangeOfIds CreateRangeOfIds();
508 BadOrientedVolume CreateBadOrientedVolume();
509 BareBorderVolume CreateBareBorderVolume();
510 BareBorderFace CreateBareBorderFace();
511 LinearOrQuadratic CreateLinearOrQuadratic();
513 GroupColor CreateGroupColor();
514 ElemGeomType CreateElemGeomType();
517 * Create comparators ( predicates )
519 LessThan CreateLessThan();
520 MoreThan CreateMoreThan();
521 EqualTo CreateEqualTo();
524 * Create boolean operations ( predicates )
526 LogicalNOT CreateLogicalNOT();
527 LogicalAND CreateLogicalAND();
528 LogicalOR CreateLogicalOR();
533 Filter CreateFilter();
536 * Load filter library. If libary does not exist it is created
538 FilterLibrary LoadLibrary( in string aFileName );
543 FilterLibrary CreateLibrary();
548 boolean DeleteLibrary( in string aFileName );