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 string GetShapeName();
162 * Logical functor (predicate) "Belong To Surface".
163 * Base interface for "belong to plane" and "belong to cylinder interfaces"
165 interface BelongToSurface: Predicate
167 void SetTolerance( in double theToler );
168 double GetTolerance();
169 void SetShapeName( in string theName, in ElementType theType );
170 string GetShapeName();
175 * Logical functor (predicate) "Belong To Plane".
176 * Verify whether mesh element lie in pointed Geom planar object
178 interface BelongToPlane: BelongToSurface
180 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
184 * Logical functor (predicate) "Belong To Culinder".
185 * Verify whether mesh element lie in pointed Geom cylindrical object
187 interface BelongToCylinder: BelongToSurface
189 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
193 * Logical functor (predicate) "Lying On Geometry".
194 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
196 interface LyingOnGeom: Predicate
198 void SetGeom( in GEOM::GEOM_Object theGeom );
199 void SetElementType( in ElementType theType );
201 void SetShapeName( in string theName );
202 string GetShapeName();
206 * Logical functor (predicate) "Free borders".
207 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
209 interface FreeBorders: Predicate{};
212 * Logical functor (predicate) "Free edges".
213 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
215 interface FreeEdges: Predicate
223 typedef sequence<Border> Borders;
224 Borders GetBorders();
229 * Abstract logical functor (predicate) "RangeOfIds".
230 * Verify whether an Entity Id belongs to defined sequence of id's
232 interface RangeOfIds: Predicate
234 void SetRange( in long_array theIds );
235 boolean SetRangeStr( in string theRange );
236 string GetRangeStr();
238 void SetElementType( in ElementType theType );
242 * Comparator. Predicate for compare value calculated
243 * by numerical functor with threshold value
245 interface Comparator: Predicate
247 void SetMargin( in double theValue );
248 void SetNumFunctor( in NumericalFunctor theFunct );
251 interface LessThan: Comparator{};
252 interface MoreThan: Comparator{};
253 interface EqualTo : Comparator
255 void SetTolerance( in double theToler );
256 double GetTolerance();
260 * Logical predicates are intended for compose predicates using boolean operations
262 interface Logical: Predicate{};
264 interface LogicalNOT: Logical
266 void SetPredicate(in Predicate thePredicate);
269 interface LogicalBinary: Logical
271 void SetPredicate1( in Predicate thePredicate );
272 void SetPredicate2( in Predicate thePredicate );
275 interface LogicalAND: LogicalBinary{};
276 interface LogicalOR : LogicalBinary{};
281 interface Filter: SALOME::GenericObj
284 * Structure containing information about one criterion
285 * Type - FT_Taper, FT_Skew ...
286 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
287 * Threshold - threshold value
288 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
289 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
290 * (FT_Undefined must be for the last criterion)
291 * ThresholdStr - Threshold value defined as string. Used for:
292 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
293 * 2. BelongToGeom predicate for storing name of shape
294 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
295 * "Belong to plane" and "Belong to cylinder" predicates
296 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
297 * Precision - Precision of numerical functors
308 ElementType TypeOfElement;
312 typedef sequence<Criterion> Criteria;
314 void SetPredicate( in Predicate thePredicate );
315 long_array GetElementsId( in SMESH_Mesh theMesh );
316 ElementType GetElementType();
317 Predicate GetPredicate();
319 boolean GetCriteria( out Criteria theCriteria );
320 boolean SetCriteria( in Criteria theCriteria );
325 * Interface for working with library of filters
327 interface FilterLibrary : SALOME::GenericObj
330 * Copy filter from library by name (new filter is created)
332 Filter Copy( in string theFilterName );
335 * Methods for editing library
337 boolean Add ( in string theFilterName, in Filter theFilter );
338 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
339 boolean Delete ( in string theFilterName );
340 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
343 * Save library on disk
346 boolean SaveAs( in string aFileName );
351 boolean IsPresent( in string aFilterName );
352 long NbFilters( in ElementType aType );
353 string_array GetNames( in ElementType aType );
354 string_array GetAllNames();
355 void SetFileName( in string aFilterName );
356 string GetFileName();
361 * Interface of Filter manager
363 interface FilterManager: SALOME::GenericObj
366 * Create numerical functors
368 MinimumAngle CreateMinimumAngle();
369 AspectRatio CreateAspectRatio();
370 AspectRatio3D CreateAspectRatio3D();
371 Warping CreateWarping();
375 Length CreateLength();
376 Length2D CreateLength2D();
377 MultiConnection CreateMultiConnection();
378 MultiConnection2D CreateMultiConnection2D();
381 * Create logical functors ( predicates )
383 BelongToGeom CreateBelongToGeom();
384 BelongToPlane CreateBelongToPlane();
385 BelongToCylinder CreateBelongToCylinder();
387 LyingOnGeom CreateLyingOnGeom();
389 FreeBorders CreateFreeBorders();
390 FreeEdges CreateFreeEdges();
392 RangeOfIds CreateRangeOfIds();
394 BadOrientedVolume CreateBadOrientedVolume();
397 * Create comparators ( predicates )
399 LessThan CreateLessThan();
400 MoreThan CreateMoreThan();
401 EqualTo CreateEqualTo();
404 * Create boolean operations ( predicates )
406 LogicalNOT CreateLogicalNOT();
407 LogicalAND CreateLogicalAND();
408 LogicalOR CreateLogicalOR();
413 Filter CreateFilter();
416 * Load filter library. If libary does not exist it is created
418 FilterLibrary LoadLibrary( in string aFileName );
423 FilterLibrary CreateLibrary();
428 boolean DeleteLibrary( in string aFileName );