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,
69 FT_OverConstrainedVolume,
70 FT_OverConstrainedFace,
84 * Parameters of a reclangle of histogram
86 struct HistogramRectangle
92 typedef sequence<HistogramRectangle> Histogram;
96 * Base interface for all functors ( i.e. numerical functors and predicates )
98 interface Functor: SALOME::GenericObj
100 void SetMesh( in SMESH_Mesh theMesh );
101 FunctorType GetFunctorType();
102 ElementType GetElementType();
106 * Numerical functors are intended for calculating value by Id of mesh entity
108 interface NumericalFunctor: Functor
110 double GetValue( in long theElementId );
112 Histogram GetHistogram( in short nbIntervals );
115 * Set precision for calculation. It is a position after point which is
116 * used to functor value after calculation.
118 void SetPrecision( in long thePrecision );
121 interface MinimumAngle : NumericalFunctor{};
122 interface AspectRatio : NumericalFunctor{};
123 interface AspectRatio3D : NumericalFunctor{};
124 interface Warping : NumericalFunctor{};
125 interface Taper : NumericalFunctor{};
126 interface Skew : NumericalFunctor{};
127 interface Area : NumericalFunctor{};
128 interface Volume3D : NumericalFunctor{};
129 interface MaxElementLength2D : NumericalFunctor{};
130 interface MaxElementLength3D : NumericalFunctor{};
131 interface Length : NumericalFunctor{};
132 interface Length2D : NumericalFunctor
139 typedef sequence<Value> Values;
142 interface MultiConnection : NumericalFunctor{};
143 interface MultiConnection2D : NumericalFunctor
151 typedef sequence<Value> Values;
157 * Predicates are intended for verification of criteria,
158 * must return bool value by mesh id
160 interface Predicate: Functor
162 boolean IsSatisfy( in long thEntityId );
166 * Logical functor (predicate) "Bad Oriented Volume".
167 * Verify whether a mesh volume is incorrectly oriented from
168 * the point of view of MED convention
170 interface BadOrientedVolume: Predicate {};
173 * Logical functor (predicate) "Volumes with bare border".
174 * Verify whether a mesh volume has a free facet without a mesh face on it
176 interface BareBorderVolume: Predicate {};
178 * Logical functor (predicate) "Faces with bare border".
179 * Verify whether a mesh face has a side not shared with another face
180 * and without a mesh edge on it
182 interface BareBorderFace: Predicate {};
185 * Logical functor (predicate) "Over-constrained Volume"
186 * Verify whether a mesh volume has only one facet shared with other volumes
188 interface OverConstrainedVolume: Predicate {};
190 * Logical functor (predicate) "Over-constrained Face".
191 * Verify whether a mesh face has only one border shared with other faces
193 interface OverConstrainedFace: Predicate {};
196 * Logical functor (predicate) "Belong To Geometry".
197 * Verify whether mesh element or node belong to pointed Geom Object
199 interface BelongToGeom: Predicate
201 void SetGeom( in GEOM::GEOM_Object theGeom );
202 void SetElementType( in ElementType theType );
204 /*! The tolerance is used only if there is no submesh on the shape
206 void SetTolerance( in double theToler );
207 double GetTolerance();
209 void SetShapeName( in string theName );
210 void SetShape( in string theID, in string theName );
211 string GetShapeName();
216 * Logical functor (predicate) "Belong To Surface".
217 * Base interface for "belong to plane" and "belong to cylinder"
218 * and "Belong To Generic Surface" interfaces
220 interface BelongToSurface: Predicate
222 void SetTolerance( in double theToler );
223 double GetTolerance();
224 void SetShapeName( in string theName, in ElementType theType );
225 void SetShape( in string theID, in string theName, in ElementType theType );
226 string GetShapeName();
229 * Limit surface extent to bounding box of boundaries (edges)
230 * in surface parametric space. Boundaries are ignored by default
232 void SetUseBoundaries( in boolean theUseBndRestrictions );
233 boolean GetUseBoundaries();
237 * Logical functor (predicate) "Belong To Plane".
238 * Verify whether mesh element lie on pointed Geom planar object
240 interface BelongToPlane: BelongToSurface
242 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
246 * Logical functor (predicate) "Belong To Cylinder".
247 * Verify whether mesh element lie on pointed Geom cylindrical object
249 interface BelongToCylinder: BelongToSurface
251 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
255 * Logical functor (predicate) "Belong To Generic Surface".
256 * Verify whether mesh element lie in pointed Geom cylindrical object
258 interface BelongToGenSurface: BelongToSurface
260 void SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
264 * Logical functor (predicate) "Lying On Geometry".
265 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
267 interface LyingOnGeom: Predicate
269 void SetGeom( in GEOM::GEOM_Object theGeom );
270 void SetElementType( in ElementType theType );
272 /*! The tolerance is used only if there is no submesh on the shape
274 void SetTolerance( in double theToler );
275 double GetTolerance();
277 void SetShapeName( in string theName );
278 void SetShape( in string theID, in string theName );
279 string GetShapeName();
284 * Logical functor (predicate) "Free borders".
285 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
287 interface FreeBorders: Predicate{};
290 * Logical functor (predicate) "Free edges".
291 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
293 interface FreeEdges: Predicate
300 typedef sequence<Border> Borders;
301 Borders GetBorders();
305 * Logical functor (predicate) "Free nodes".
306 * Verify whether mesh has free nodes( i.e. nodes are not connected to any element )
308 interface FreeNodes: Predicate{};
311 * Logical functor (predicate) "Free faces".
312 * Verify whether 2D mesh element is free ( i.e. connected to one volume only )
314 interface FreeFaces: Predicate{};
317 * Abstract logical functor (predicate) "RangeOfIds".
318 * Verify whether an Entity Id belongs to defined sequence of id's
320 interface RangeOfIds: Predicate
322 void SetRange( in long_array theIds );
323 boolean SetRangeStr( in string theRange );
324 string GetRangeStr();
326 void SetElementType( in ElementType theType );
330 * Comparator. Predicate for compare value calculated
331 * by numerical functor with threshold value
333 interface Comparator: Predicate
335 void SetMargin( in double theValue );
336 void SetNumFunctor( in NumericalFunctor theFunct );
339 interface LessThan: Comparator{};
340 interface MoreThan: Comparator{};
341 interface EqualTo : Comparator
343 void SetTolerance( in double theToler );
344 double GetTolerance();
348 * Logical predicates are intended for compose predicates using boolean operations
350 interface Logical: Predicate{};
352 interface LogicalNOT: Logical
354 void SetPredicate(in Predicate thePredicate);
357 interface LogicalBinary: Logical
359 void SetPredicate1( in Predicate thePredicate );
360 void SetPredicate2( in Predicate thePredicate );
363 interface LogicalAND: LogicalBinary{};
364 interface LogicalOR : LogicalBinary{};
367 * Logical functor (predicate) "Is element Linear or Quadratic".
368 * Verify whether a mesh element is linear
370 interface LinearOrQuadratic: Predicate {
371 void SetElementType( in ElementType theType );
375 * Functor "Group Color"
376 * Returns color of group to which mesh element belongs to
378 interface GroupColor : Predicate{
379 void SetElementType( in ElementType theType );
380 void SetColorStr( in string theColor );
381 string GetColorStr();
385 * Functor "Element geometry type"
386 * Returns is element has indicated geometry type
388 interface ElemGeomType : Predicate{
389 void SetElementType ( in ElementType theType );
390 void SetGeometryType( in GeometryType theType );
396 interface Filter: SALOME::GenericObj, SMESH_IDSource
399 * Structure containing information about one criterion
400 * Type - FT_Taper, FT_Skew ...
401 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
402 * Threshold - threshold value
403 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
404 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
405 * (FT_Undefined must be for the last criterion)
406 * ThresholdStr - Threshold value defined as string. Used for:
407 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
408 * 2. BelongToGeom predicate for storing name of shape
409 * 3. GroupColor predicate for storing group color "0.2;0;0.5"
410 * ThresholdID - One more threshold value defined as string. Used for:
411 * 1. BelongToGeom predicate for storing id of shape
412 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
413 * "Belong to plane" and "Belong to cylinder" predicates
414 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
415 * Precision - Precision of numerical functors
427 ElementType TypeOfElement;
431 typedef sequence<Criterion> Criteria;
433 void SetPredicate( in Predicate thePredicate );
434 void SetMesh( in SMESH_Mesh theMesh );
436 long_array GetElementsId( in SMESH_Mesh theMesh );
437 ElementType GetElementType();
438 Predicate GetPredicate();
440 boolean GetCriteria( out Criteria theCriteria );
441 boolean SetCriteria( in Criteria theCriteria );
446 * Interface for working with library of filters
448 interface FilterLibrary : SALOME::GenericObj
451 * Copy filter from library by name (new filter is created)
453 Filter Copy( in string theFilterName );
456 * Methods for editing library
458 boolean Add ( in string theFilterName, in Filter theFilter );
459 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
460 boolean Delete ( in string theFilterName );
461 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
464 * Save library on disk
467 boolean SaveAs( in string aFileName );
472 boolean IsPresent( in string aFilterName );
473 long NbFilters( in ElementType aType );
474 string_array GetNames( in ElementType aType );
475 string_array GetAllNames();
476 void SetFileName( in string aFilterName );
477 string GetFileName();
482 * Interface of Filter manager
484 interface FilterManager: SALOME::GenericObj
487 * Create numerical functors
489 MinimumAngle CreateMinimumAngle();
490 AspectRatio CreateAspectRatio();
491 AspectRatio3D CreateAspectRatio3D();
492 Warping CreateWarping();
496 Volume3D CreateVolume3D();
497 MaxElementLength2D CreateMaxElementLength2D();
498 MaxElementLength3D CreateMaxElementLength3D();
499 Length CreateLength();
500 Length2D CreateLength2D();
501 MultiConnection CreateMultiConnection();
502 MultiConnection2D CreateMultiConnection2D();
505 * Create logical functors ( predicates )
507 BelongToGeom CreateBelongToGeom();
508 BelongToPlane CreateBelongToPlane();
509 BelongToCylinder CreateBelongToCylinder();
510 BelongToGenSurface CreateBelongToGenSurface();
512 LyingOnGeom CreateLyingOnGeom();
514 FreeBorders CreateFreeBorders();
515 FreeEdges CreateFreeEdges();
516 FreeNodes CreateFreeNodes();
517 FreeFaces CreateFreeFaces();
519 RangeOfIds CreateRangeOfIds();
521 BadOrientedVolume CreateBadOrientedVolume();
522 BareBorderVolume CreateBareBorderVolume();
523 BareBorderFace CreateBareBorderFace();
524 OverConstrainedVolume CreateOverConstrainedVolume();
525 OverConstrainedFace CreateOverConstrainedFace();
526 LinearOrQuadratic CreateLinearOrQuadratic();
528 GroupColor CreateGroupColor();
529 ElemGeomType CreateElemGeomType();
532 * Create comparators ( predicates )
534 LessThan CreateLessThan();
535 MoreThan CreateMoreThan();
536 EqualTo CreateEqualTo();
539 * Create boolean operations ( predicates )
541 LogicalNOT CreateLogicalNOT();
542 LogicalAND CreateLogicalAND();
543 LogicalOR CreateLogicalOR();
548 Filter CreateFilter();
551 * Load filter library. If libary does not exist it is created
553 FilterLibrary LoadLibrary( in string aFileName );
558 FilterLibrary CreateLibrary();
563 boolean DeleteLibrary( in string aFileName );