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.salome-platform.org/ or email : webmaster.salome@opencascade.com
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 "GEOM_Gen.idl"
31 #include "SMESH_Mesh.idl"
37 * Enumeration of functor types
58 FT_BelongToGenSurface,
72 * Base interface for all functors ( i.e. numerical functors and predicates )
74 interface Functor: SALOME::GenericObj
76 void SetMesh( in SMESH_Mesh theMesh );
77 FunctorType GetFunctorType();
78 ElementType GetElementType();
84 * Numerical functors are intended for calculating value by Id of mesh entity
86 interface NumericalFunctor: Functor
88 double GetValue( in long theElementId );
91 * Set precision for calculation. It is a position after point which is
92 * used to functor value after calculation.
94 void SetPrecision( in long thePrecision );
97 interface MinimumAngle : NumericalFunctor{};
98 interface AspectRatio : NumericalFunctor{};
99 interface AspectRatio3D : NumericalFunctor{};
100 interface Warping : NumericalFunctor{};
101 interface Taper : NumericalFunctor{};
102 interface Skew : NumericalFunctor{};
103 interface Area : NumericalFunctor{};
104 interface Volume3D : NumericalFunctor{};
105 interface Length : NumericalFunctor{};
106 interface Length2D : NumericalFunctor
113 typedef sequence<Value> Values;
116 interface MultiConnection : NumericalFunctor{};
117 interface MultiConnection2D : NumericalFunctor
125 typedef sequence<Value> Values;
130 * Predicates are intended for verification of criteria,
131 * must return bool value by mesh id
133 interface Predicate: Functor
135 boolean IsSatisfy( in long thEntityId );
139 * Logical functor (predicate) "Bad Oriented Volume".
140 * Verify whether a mesh volume is incorrectly oriented from
141 * the point of view of MED convention
143 interface BadOrientedVolume: Predicate {};
146 * Logical functor (predicate) "Belong To Geometry".
147 * Verify whether mesh element or node belong to pointed Geom Object
149 interface BelongToGeom: Predicate
151 void SetGeom( in GEOM::GEOM_Object theGeom );
152 void SetElementType( in ElementType theType );
154 void SetShapeName( in string theName );
155 void SetShape( in string theID, in string theName );
156 string GetShapeName();
161 * Logical functor (predicate) "Belong To Surface".
162 * Base interface for "belong to plane" and "belong to cylinder"
163 * and "Belong To Generic Surface" interfaces
165 interface BelongToSurface: Predicate
167 void SetTolerance( in double theToler );
168 double GetTolerance();
169 void SetShapeName( in string theName, in ElementType theType );
170 void SetShape( in string theID, in string theName, in ElementType theType );
171 string GetShapeName();
174 * Limit surface extent to bounding box of boundaries (edges)
175 * in surface parametric space. Boundaries are ignored by default
177 void SetUseBoundaries( in boolean theUseBndRestrictions );
178 boolean GetUseBoundaries();
182 * Logical functor (predicate) "Belong To Plane".
183 * Verify whether mesh element lie on pointed Geom planar object
185 interface BelongToPlane: BelongToSurface
187 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
191 * Logical functor (predicate) "Belong To Cylinder".
192 * Verify whether mesh element lie on pointed Geom cylindrical object
194 interface BelongToCylinder: BelongToSurface
196 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
200 * Logical functor (predicate) "Belong To Generic Surface".
201 * Verify whether mesh element lie in pointed Geom cylindrical object
203 interface BelongToGenSurface: BelongToSurface
205 void SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
209 * Logical functor (predicate) "Lying On Geometry".
210 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
212 interface LyingOnGeom: Predicate
214 void SetGeom( in GEOM::GEOM_Object theGeom );
215 void SetElementType( in ElementType theType );
217 void SetShapeName( in string theName );
218 void SetShape( in string theID, in string theName );
219 string GetShapeName();
224 * Logical functor (predicate) "Free borders".
225 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
227 interface FreeBorders: Predicate{};
230 * Logical functor (predicate) "Free edges".
231 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
233 interface FreeEdges: Predicate
241 typedef sequence<Border> Borders;
242 Borders GetBorders();
247 * Abstract logical functor (predicate) "RangeOfIds".
248 * Verify whether an Entity Id belongs to defined sequence of id's
250 interface RangeOfIds: Predicate
252 void SetRange( in long_array theIds );
253 boolean SetRangeStr( in string theRange );
254 string GetRangeStr();
256 void SetElementType( in ElementType theType );
260 * Comparator. Predicate for compare value calculated
261 * by numerical functor with threshold value
263 interface Comparator: Predicate
265 void SetMargin( in double theValue );
266 void SetNumFunctor( in NumericalFunctor theFunct );
269 interface LessThan: Comparator{};
270 interface MoreThan: Comparator{};
271 interface EqualTo : Comparator
273 void SetTolerance( in double theToler );
274 double GetTolerance();
278 * Logical predicates are intended for compose predicates using boolean operations
280 interface Logical: Predicate{};
282 interface LogicalNOT: Logical
284 void SetPredicate(in Predicate thePredicate);
287 interface LogicalBinary: Logical
289 void SetPredicate1( in Predicate thePredicate );
290 void SetPredicate2( in Predicate thePredicate );
293 interface LogicalAND: LogicalBinary{};
294 interface LogicalOR : LogicalBinary{};
299 interface Filter: SALOME::GenericObj, SMESH_IDSource
302 * Structure containing information about one criterion
303 * Type - FT_Taper, FT_Skew ...
304 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
305 * Threshold - threshold value
306 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
307 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
308 * (FT_Undefined must be for the last criterion)
309 * ThresholdStr - Threshold value defined as string. Used for:
310 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
311 * 2. BelongToGeom predicate for storing name of shape
312 * ThresholdID - One more threshold value defined as string. Used for:
313 * 1. BelongToGeom predicate for storing id of shape
314 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
315 * "Belong to plane" and "Belong to cylinder" predicates
316 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
317 * Precision - Precision of numerical functors
329 ElementType TypeOfElement;
333 typedef sequence<Criterion> Criteria;
335 void SetPredicate( in Predicate thePredicate );
336 void SetMesh( in SMESH_Mesh theMesh );
338 long_array GetElementsId( in SMESH_Mesh theMesh );
339 ElementType GetElementType();
340 Predicate GetPredicate();
342 boolean GetCriteria( out Criteria theCriteria );
343 boolean SetCriteria( in Criteria theCriteria );
348 * Interface for working with library of filters
350 interface FilterLibrary : SALOME::GenericObj
353 * Copy filter from library by name (new filter is created)
355 Filter Copy( in string theFilterName );
358 * Methods for editing library
360 boolean Add ( in string theFilterName, in Filter theFilter );
361 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
362 boolean Delete ( in string theFilterName );
363 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
366 * Save library on disk
369 boolean SaveAs( in string aFileName );
374 boolean IsPresent( in string aFilterName );
375 long NbFilters( in ElementType aType );
376 string_array GetNames( in ElementType aType );
377 string_array GetAllNames();
378 void SetFileName( in string aFilterName );
379 string GetFileName();
384 * Interface of Filter manager
386 interface FilterManager: SALOME::GenericObj
389 * Create numerical functors
391 MinimumAngle CreateMinimumAngle();
392 AspectRatio CreateAspectRatio();
393 AspectRatio3D CreateAspectRatio3D();
394 Warping CreateWarping();
398 Volume3D CreateVolume3D();
399 Length CreateLength();
400 Length2D CreateLength2D();
401 MultiConnection CreateMultiConnection();
402 MultiConnection2D CreateMultiConnection2D();
405 * Create logical functors ( predicates )
407 BelongToGeom CreateBelongToGeom();
408 BelongToPlane CreateBelongToPlane();
409 BelongToCylinder CreateBelongToCylinder();
410 BelongToGenSurface CreateBelongToGenSurface();
412 LyingOnGeom CreateLyingOnGeom();
414 FreeBorders CreateFreeBorders();
415 FreeEdges CreateFreeEdges();
417 RangeOfIds CreateRangeOfIds();
419 BadOrientedVolume CreateBadOrientedVolume();
422 * Create comparators ( predicates )
424 LessThan CreateLessThan();
425 MoreThan CreateMoreThan();
426 EqualTo CreateEqualTo();
429 * Create boolean operations ( predicates )
431 LogicalNOT CreateLogicalNOT();
432 LogicalAND CreateLogicalAND();
433 LogicalOR CreateLogicalOR();
438 Filter CreateFilter();
441 * Load filter library. If libary does not exist it is created
443 FilterLibrary LoadLibrary( in string aFileName );
448 FilterLibrary CreateLibrary();
453 boolean DeleteLibrary( in string aFileName );