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
76 * Base interface for all functors ( i.e. numerical functors and predicates )
78 interface Functor: SALOME::GenericObj
80 void SetMesh( in SMESH_Mesh theMesh );
81 FunctorType GetFunctorType();
82 ElementType GetElementType();
88 * Numerical functors are intended for calculating value by Id of mesh entity
90 interface NumericalFunctor: Functor
92 double GetValue( in long theElementId );
95 * Set precision for calculation. It is a position after point which is
96 * used to functor value after calculation.
98 void SetPrecision( in long thePrecision );
101 interface MinimumAngle : NumericalFunctor{};
102 interface AspectRatio : NumericalFunctor{};
103 interface AspectRatio3D : NumericalFunctor{};
104 interface Warping : NumericalFunctor{};
105 interface Taper : NumericalFunctor{};
106 interface Skew : NumericalFunctor{};
107 interface Area : NumericalFunctor{};
108 interface Length : NumericalFunctor{};
109 interface Length2D : NumericalFunctor
116 typedef sequence<Value> Values;
119 interface MultiConnection : NumericalFunctor{};
120 interface MultiConnection2D : NumericalFunctor
128 typedef sequence<Value> Values;
133 * Predicates are intended for verification of criteria,
134 * must return bool value by mesh id
136 interface Predicate: Functor
138 boolean IsSatisfy( in long thEntityId );
142 * Logical functor (predicate) "Bad Oriented Volume".
143 * Verify whether a mesh volume is incorrectly oriented from
144 * the point of view of MED convention
146 interface BadOrientedVolume: Predicate {};
149 * Logical functor (predicate) "Belong To Geometry".
150 * Verify whether mesh element or node belong to pointed Geom Object
152 interface BelongToGeom: Predicate
154 void SetGeom( in GEOM::GEOM_Object theGeom );
155 void SetElementType( in ElementType theType );
157 void SetShapeName( in string theName );
158 void SetShape( in string theID, in string theName );
159 string GetShapeName();
164 * Logical functor (predicate) "Belong To Surface".
165 * Base interface for "belong to plane" and "belong to cylinder interfaces"
167 interface BelongToSurface: Predicate
169 void SetTolerance( in double theToler );
170 double GetTolerance();
171 void SetShapeName( in string theName, in ElementType theType );
172 void SetShape( in string theID, in string theName, in ElementType theType );
173 string GetShapeName();
179 * Logical functor (predicate) "Belong To Plane".
180 * Verify whether mesh element lie in pointed Geom planar object
182 interface BelongToPlane: BelongToSurface
184 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
188 * Logical functor (predicate) "Belong To Culinder".
189 * Verify whether mesh element lie in pointed Geom cylindrical object
191 interface BelongToCylinder: BelongToSurface
193 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
197 * Logical functor (predicate) "Lying On Geometry".
198 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
200 interface LyingOnGeom: Predicate
202 void SetGeom( in GEOM::GEOM_Object theGeom );
203 void SetElementType( in ElementType theType );
205 void SetShapeName( in string theName );
206 void SetShape( in string theID, in string theName );
207 string GetShapeName();
212 * Logical functor (predicate) "Free borders".
213 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
215 interface FreeBorders: Predicate{};
218 * Logical functor (predicate) "Free edges".
219 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
221 interface FreeEdges: Predicate
229 typedef sequence<Border> Borders;
230 Borders GetBorders();
235 * Abstract logical functor (predicate) "RangeOfIds".
236 * Verify whether an Entity Id belongs to defined sequence of id's
238 interface RangeOfIds: Predicate
240 void SetRange( in long_array theIds );
241 boolean SetRangeStr( in string theRange );
242 string GetRangeStr();
244 void SetElementType( in ElementType theType );
248 * Comparator. Predicate for compare value calculated
249 * by numerical functor with threshold value
251 interface Comparator: Predicate
253 void SetMargin( in double theValue );
254 void SetNumFunctor( in NumericalFunctor theFunct );
257 interface LessThan: Comparator{};
258 interface MoreThan: Comparator{};
259 interface EqualTo : Comparator
261 void SetTolerance( in double theToler );
262 double GetTolerance();
266 * Logical predicates are intended for compose predicates using boolean operations
268 interface Logical: Predicate{};
270 interface LogicalNOT: Logical
272 void SetPredicate(in Predicate thePredicate);
275 interface LogicalBinary: Logical
277 void SetPredicate1( in Predicate thePredicate );
278 void SetPredicate2( in Predicate thePredicate );
281 interface LogicalAND: LogicalBinary{};
282 interface LogicalOR : LogicalBinary{};
287 interface Filter: SALOME::GenericObj
290 * Structure containing information about one criterion
291 * Type - FT_Taper, FT_Skew ...
292 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
293 * Threshold - threshold value
294 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
295 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
296 * (FT_Undefined must be for the last criterion)
297 * ThresholdStr - Threshold value defined as string. Used for:
298 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
299 * 2. BelongToGeom predicate for storing name of shape
300 * ThresholdID - One more threshold value defined as string. Used for:
301 * 1. BelongToGeom predicate for storing id of shape
302 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
303 * "Belong to plane" and "Belong to cylinder" predicates
304 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
305 * Precision - Precision of numerical functors
317 ElementType TypeOfElement;
321 typedef sequence<Criterion> Criteria;
323 void SetPredicate( in Predicate thePredicate );
324 long_array GetElementsId( in SMESH_Mesh theMesh );
325 ElementType GetElementType();
326 Predicate GetPredicate();
328 boolean GetCriteria( out Criteria theCriteria );
329 boolean SetCriteria( in Criteria theCriteria );
334 * Interface for working with library of filters
336 interface FilterLibrary : SALOME::GenericObj
339 * Copy filter from library by name (new filter is created)
341 Filter Copy( in string theFilterName );
344 * Methods for editing library
346 boolean Add ( in string theFilterName, in Filter theFilter );
347 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
348 boolean Delete ( in string theFilterName );
349 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
352 * Save library on disk
355 boolean SaveAs( in string aFileName );
360 boolean IsPresent( in string aFilterName );
361 long NbFilters( in ElementType aType );
362 string_array GetNames( in ElementType aType );
363 string_array GetAllNames();
364 void SetFileName( in string aFilterName );
365 string GetFileName();
370 * Interface of Filter manager
372 interface FilterManager: SALOME::GenericObj
375 * Create numerical functors
377 MinimumAngle CreateMinimumAngle();
378 AspectRatio CreateAspectRatio();
379 AspectRatio3D CreateAspectRatio3D();
380 Warping CreateWarping();
384 Length CreateLength();
385 Length2D CreateLength2D();
386 MultiConnection CreateMultiConnection();
387 MultiConnection2D CreateMultiConnection2D();
390 * Create logical functors ( predicates )
392 BelongToGeom CreateBelongToGeom();
393 BelongToPlane CreateBelongToPlane();
394 BelongToCylinder CreateBelongToCylinder();
396 LyingOnGeom CreateLyingOnGeom();
398 FreeBorders CreateFreeBorders();
399 FreeEdges CreateFreeEdges();
401 RangeOfIds CreateRangeOfIds();
403 BadOrientedVolume CreateBadOrientedVolume();
406 * Create comparators ( predicates )
408 LessThan CreateLessThan();
409 MoreThan CreateMoreThan();
410 EqualTo CreateEqualTo();
413 * Create boolean operations ( predicates )
415 LogicalNOT CreateLogicalNOT();
416 LogicalAND CreateLogicalAND();
417 LogicalOR CreateLogicalOR();
422 Filter CreateFilter();
425 * Load filter library. If libary does not exist it is created
427 FilterLibrary LoadLibrary( in string aFileName );
432 FilterLibrary CreateLibrary();
437 boolean DeleteLibrary( in string aFileName );