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 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 string GetShapeName();
177 * Logical functor (predicate) "Belong To Plane".
178 * Verify whether mesh element lie in pointed Geom planar object
180 interface BelongToPlane: BelongToSurface
182 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
186 * Logical functor (predicate) "Belong To Culinder".
187 * Verify whether mesh element lie in pointed Geom cylindrical object
189 interface BelongToCylinder: BelongToSurface
191 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
195 * Logical functor (predicate) "Lying On Geometry".
196 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
198 interface LyingOnGeom: Predicate
200 void SetGeom( in GEOM::GEOM_Object theGeom );
201 void SetElementType( in ElementType theType );
203 void SetShapeName( in string theName );
204 string GetShapeName();
208 * Logical functor (predicate) "Free borders".
209 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
211 interface FreeBorders: Predicate{};
214 * Logical functor (predicate) "Free edges".
215 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
217 interface FreeEdges: Predicate
225 typedef sequence<Border> Borders;
226 Borders GetBorders();
231 * Abstract logical functor (predicate) "RangeOfIds".
232 * Verify whether an Entity Id belongs to defined sequence of id's
234 interface RangeOfIds: Predicate
236 void SetRange( in long_array theIds );
237 boolean SetRangeStr( in string theRange );
238 string GetRangeStr();
240 void SetElementType( in ElementType theType );
244 * Comparator. Predicate for compare value calculated
245 * by numerical functor with threshold value
247 interface Comparator: Predicate
249 void SetMargin( in double theValue );
250 void SetNumFunctor( in NumericalFunctor theFunct );
253 interface LessThan: Comparator{};
254 interface MoreThan: Comparator{};
255 interface EqualTo : Comparator
257 void SetTolerance( in double theToler );
258 double GetTolerance();
262 * Logical predicates are intended for compose predicates using boolean operations
264 interface Logical: Predicate{};
266 interface LogicalNOT: Logical
268 void SetPredicate(in Predicate thePredicate);
271 interface LogicalBinary: Logical
273 void SetPredicate1( in Predicate thePredicate );
274 void SetPredicate2( in Predicate thePredicate );
277 interface LogicalAND: LogicalBinary{};
278 interface LogicalOR : LogicalBinary{};
283 interface Filter: SALOME::GenericObj, SMESH_IDSource
286 * Structure containing information about one criterion
287 * Type - FT_Taper, FT_Skew ...
288 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
289 * Threshold - threshold value
290 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
291 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
292 * (FT_Undefined must be for the last criterion)
293 * ThresholdStr - Threshold value defined as string. Used for:
294 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
295 * 2. BelongToGeom predicate for storing name of shape
296 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
297 * "Belong to plane" and "Belong to cylinder" predicates
298 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
299 * Precision - Precision of numerical functors
310 ElementType TypeOfElement;
314 typedef sequence<Criterion> Criteria;
316 void SetPredicate( in Predicate thePredicate );
317 void SetMesh( in SMESH_Mesh theMesh );
319 long_array GetElementsId( in SMESH_Mesh theMesh );
320 ElementType GetElementType();
321 Predicate GetPredicate();
323 boolean GetCriteria( out Criteria theCriteria );
324 boolean SetCriteria( in Criteria theCriteria );
329 * Interface for working with library of filters
331 interface FilterLibrary : SALOME::GenericObj
334 * Copy filter from library by name (new filter is created)
336 Filter Copy( in string theFilterName );
339 * Methods for editing library
341 boolean Add ( in string theFilterName, in Filter theFilter );
342 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
343 boolean Delete ( in string theFilterName );
344 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
347 * Save library on disk
350 boolean SaveAs( in string aFileName );
355 boolean IsPresent( in string aFilterName );
356 long NbFilters( in ElementType aType );
357 string_array GetNames( in ElementType aType );
358 string_array GetAllNames();
359 void SetFileName( in string aFilterName );
360 string GetFileName();
365 * Interface of Filter manager
367 interface FilterManager: SALOME::GenericObj
370 * Create numerical functors
372 MinimumAngle CreateMinimumAngle();
373 AspectRatio CreateAspectRatio();
374 AspectRatio3D CreateAspectRatio3D();
375 Warping CreateWarping();
379 Volume3D CreateVolume3D();
380 Length CreateLength();
381 Length2D CreateLength2D();
382 MultiConnection CreateMultiConnection();
383 MultiConnection2D CreateMultiConnection2D();
386 * Create logical functors ( predicates )
388 BelongToGeom CreateBelongToGeom();
389 BelongToPlane CreateBelongToPlane();
390 BelongToCylinder CreateBelongToCylinder();
392 LyingOnGeom CreateLyingOnGeom();
394 FreeBorders CreateFreeBorders();
395 FreeEdges CreateFreeEdges();
397 RangeOfIds CreateRangeOfIds();
399 BadOrientedVolume CreateBadOrientedVolume();
402 * Create comparators ( predicates )
404 LessThan CreateLessThan();
405 MoreThan CreateMoreThan();
406 EqualTo CreateEqualTo();
409 * Create boolean operations ( predicates )
411 LogicalNOT CreateLogicalNOT();
412 LogicalAND CreateLogicalAND();
413 LogicalOR CreateLogicalOR();
418 Filter CreateFilter();
421 * Load filter library. If libary does not exist it is created
423 FilterLibrary LoadLibrary( in string aFileName );
428 FilterLibrary CreateLibrary();
433 boolean DeleteLibrary( in string aFileName );