1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : SMESH_Filter.idl
23 // Author : Alexey Petrov, OCC
25 #ifndef _SMESH_FILTER_IDL_
26 #define _SMESH_FILTER_IDL_
28 #include "SALOME_Exception.idl"
29 #include "SALOME_GenericObj.idl"
30 #include "SMESH_Mesh.idl"
35 interface GEOM_Object;
43 * Enumeration of functor types
77 * Base interface for all functors ( i.e. numerical functors and predicates )
79 interface Functor: SALOME::GenericObj
81 void SetMesh( in SMESH_Mesh theMesh );
82 FunctorType GetFunctorType();
83 ElementType GetElementType();
89 * Numerical functors are intended for calculating value by Id of mesh entity
91 interface NumericalFunctor: Functor
93 double GetValue( in long theElementId );
96 * Set precision for calculation. It is a position after point which is
97 * used to functor value after calculation.
99 void SetPrecision( in long thePrecision );
102 interface MinimumAngle : NumericalFunctor{};
103 interface AspectRatio : NumericalFunctor{};
104 interface AspectRatio3D : NumericalFunctor{};
105 interface Warping : NumericalFunctor{};
106 interface Taper : NumericalFunctor{};
107 interface Skew : NumericalFunctor{};
108 interface Area : NumericalFunctor{};
109 interface Volume3D : NumericalFunctor{};
110 interface Length : NumericalFunctor{};
111 interface Length2D : NumericalFunctor
118 typedef sequence<Value> Values;
121 interface MultiConnection : NumericalFunctor{};
122 interface MultiConnection2D : NumericalFunctor
130 typedef sequence<Value> Values;
135 * Predicates are intended for verification of criteria,
136 * must return bool value by mesh id
138 interface Predicate: Functor
140 boolean IsSatisfy( in long thEntityId );
144 * Logical functor (predicate) "Bad Oriented Volume".
145 * Verify whether a mesh volume is incorrectly oriented from
146 * the point of view of MED convention
148 interface BadOrientedVolume: Predicate {};
151 * Logical functor (predicate) "Belong To Geometry".
152 * Verify whether mesh element or node belong to pointed Geom Object
154 interface BelongToGeom: Predicate
156 void SetGeom( in GEOM::GEOM_Object theGeom );
157 void SetElementType( in ElementType theType );
159 void SetShapeName( in string theName );
160 void SetShape( in string theID, in string theName );
161 string GetShapeName();
166 * Logical functor (predicate) "Belong To Surface".
167 * Base interface for "belong to plane" and "belong to cylinder interfaces"
169 interface BelongToSurface: Predicate
171 void SetTolerance( in double theToler );
172 double GetTolerance();
173 void SetShapeName( in string theName, in ElementType theType );
174 void SetShape( in string theID, in string theName, in ElementType theType );
175 string GetShapeName();
181 * Logical functor (predicate) "Belong To Plane".
182 * Verify whether mesh element lie in pointed Geom planar object
184 interface BelongToPlane: BelongToSurface
186 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
190 * Logical functor (predicate) "Belong To Culinder".
191 * Verify whether mesh element lie in pointed Geom cylindrical object
193 interface BelongToCylinder: BelongToSurface
195 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
199 * Logical functor (predicate) "Lying On Geometry".
200 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
202 interface LyingOnGeom: Predicate
204 void SetGeom( in GEOM::GEOM_Object theGeom );
205 void SetElementType( in ElementType theType );
207 void SetShapeName( in string theName );
208 void SetShape( in string theID, in string theName );
209 string GetShapeName();
214 * Logical functor (predicate) "Free borders".
215 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
217 interface FreeBorders: Predicate{};
220 * Logical functor (predicate) "Free edges".
221 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
223 interface FreeEdges: Predicate
231 typedef sequence<Border> Borders;
232 Borders GetBorders();
237 * Abstract logical functor (predicate) "RangeOfIds".
238 * Verify whether an Entity Id belongs to defined sequence of id's
240 interface RangeOfIds: Predicate
242 void SetRange( in long_array theIds );
243 boolean SetRangeStr( in string theRange );
244 string GetRangeStr();
246 void SetElementType( in ElementType theType );
250 * Comparator. Predicate for compare value calculated
251 * by numerical functor with threshold value
253 interface Comparator: Predicate
255 void SetMargin( in double theValue );
256 void SetNumFunctor( in NumericalFunctor theFunct );
259 interface LessThan: Comparator{};
260 interface MoreThan: Comparator{};
261 interface EqualTo : Comparator
263 void SetTolerance( in double theToler );
264 double GetTolerance();
268 * Logical predicates are intended for compose predicates using boolean operations
270 interface Logical: Predicate{};
272 interface LogicalNOT: Logical
274 void SetPredicate(in Predicate thePredicate);
277 interface LogicalBinary: Logical
279 void SetPredicate1( in Predicate thePredicate );
280 void SetPredicate2( in Predicate thePredicate );
283 interface LogicalAND: LogicalBinary{};
284 interface LogicalOR : LogicalBinary{};
289 interface Filter: SALOME::GenericObj, SMESH_IDSource
292 * Structure containing information about one criterion
293 * Type - FT_Taper, FT_Skew ...
294 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
295 * Threshold - threshold value
296 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
297 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
298 * (FT_Undefined must be for the last criterion)
299 * ThresholdStr - Threshold value defined as string. Used for:
300 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
301 * 2. BelongToGeom predicate for storing name of shape
302 * ThresholdID - One more threshold value defined as string. Used for:
303 * 1. BelongToGeom predicate for storing id of shape
304 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
305 * "Belong to plane" and "Belong to cylinder" predicates
306 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
307 * Precision - Precision of numerical functors
319 ElementType TypeOfElement;
323 typedef sequence<Criterion> Criteria;
325 void SetPredicate( in Predicate thePredicate );
326 void SetMesh( in SMESH_Mesh theMesh );
328 long_array GetElementsId( in SMESH_Mesh theMesh );
329 ElementType GetElementType();
330 Predicate GetPredicate();
332 boolean GetCriteria( out Criteria theCriteria );
333 boolean SetCriteria( in Criteria theCriteria );
338 * Interface for working with library of filters
340 interface FilterLibrary : SALOME::GenericObj
343 * Copy filter from library by name (new filter is created)
345 Filter Copy( in string theFilterName );
348 * Methods for editing library
350 boolean Add ( in string theFilterName, in Filter theFilter );
351 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
352 boolean Delete ( in string theFilterName );
353 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
356 * Save library on disk
359 boolean SaveAs( in string aFileName );
364 boolean IsPresent( in string aFilterName );
365 long NbFilters( in ElementType aType );
366 string_array GetNames( in ElementType aType );
367 string_array GetAllNames();
368 void SetFileName( in string aFilterName );
369 string GetFileName();
374 * Interface of Filter manager
376 interface FilterManager: SALOME::GenericObj
379 * Create numerical functors
381 MinimumAngle CreateMinimumAngle();
382 AspectRatio CreateAspectRatio();
383 AspectRatio3D CreateAspectRatio3D();
384 Warping CreateWarping();
388 Volume3D CreateVolume3D();
389 Length CreateLength();
390 Length2D CreateLength2D();
391 MultiConnection CreateMultiConnection();
392 MultiConnection2D CreateMultiConnection2D();
395 * Create logical functors ( predicates )
397 BelongToGeom CreateBelongToGeom();
398 BelongToPlane CreateBelongToPlane();
399 BelongToCylinder CreateBelongToCylinder();
401 LyingOnGeom CreateLyingOnGeom();
403 FreeBorders CreateFreeBorders();
404 FreeEdges CreateFreeEdges();
406 RangeOfIds CreateRangeOfIds();
408 BadOrientedVolume CreateBadOrientedVolume();
411 * Create comparators ( predicates )
413 LessThan CreateLessThan();
414 MoreThan CreateMoreThan();
415 EqualTo CreateEqualTo();
418 * Create boolean operations ( predicates )
420 LogicalNOT CreateLogicalNOT();
421 LogicalAND CreateLogicalAND();
422 LogicalOR CreateLogicalOR();
427 Filter CreateFilter();
430 * Load filter library. If libary does not exist it is created
432 FilterLibrary LoadLibrary( in string aFileName );
437 FilterLibrary CreateLibrary();
442 boolean DeleteLibrary( in string aFileName );