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"
33 #include "GEOM_Gen.idl"
40 * Enumeration of functor types
74 * Base interface for all functors ( i.e. numerical functors and predicates )
76 interface Functor: SALOME::GenericObj
78 void SetMesh( in SMESH_Mesh theMesh );
79 FunctorType GetFunctorType();
80 ElementType GetElementType();
86 * Numerical functors are intended for calculating value by Id of mesh entity
88 interface NumericalFunctor: Functor
90 double GetValue( in long theElementId );
93 * Set precision for calculation. It is a position after point which is
94 * used to functor value after calculation.
96 void SetPrecision( in long thePrecision );
99 interface MinimumAngle : NumericalFunctor{};
100 interface AspectRatio : NumericalFunctor{};
101 interface AspectRatio3D : NumericalFunctor{};
102 interface Warping : NumericalFunctor{};
103 interface Taper : NumericalFunctor{};
104 interface Skew : NumericalFunctor{};
105 interface Area : NumericalFunctor{};
106 interface Volume3D : NumericalFunctor{};
107 interface Length : NumericalFunctor{};
108 interface Length2D : NumericalFunctor
115 typedef sequence<Value> Values;
118 interface MultiConnection : NumericalFunctor{};
119 interface MultiConnection2D : NumericalFunctor
127 typedef sequence<Value> Values;
132 * Predicates are intended for verification of criteria,
133 * must return bool value by mesh id
135 interface Predicate: Functor
137 boolean IsSatisfy( in long thEntityId );
141 * Logical functor (predicate) "Bad Oriented Volume".
142 * Verify whether a mesh volume is incorrectly oriented from
143 * the point of view of MED convention
145 interface BadOrientedVolume: Predicate {};
148 * Logical functor (predicate) "Belong To Geometry".
149 * Verify whether mesh element or node belong to pointed Geom Object
151 interface BelongToGeom: Predicate
153 void SetGeom( in GEOM::GEOM_Object theGeom );
154 void SetElementType( in ElementType theType );
156 void SetShapeName( in string theName );
157 void SetShape( in string theID, in string theName );
158 string GetShapeName();
163 * Logical functor (predicate) "Belong To Surface".
164 * Base interface for "belong to plane" and "belong to cylinder interfaces"
166 interface BelongToSurface: Predicate
168 void SetTolerance( in double theToler );
169 double GetTolerance();
170 void SetShapeName( in string theName, in ElementType theType );
171 void SetShape( in string theID, in string theName, in ElementType theType );
172 string GetShapeName();
178 * Logical functor (predicate) "Belong To Plane".
179 * Verify whether mesh element lie in pointed Geom planar object
181 interface BelongToPlane: BelongToSurface
183 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
187 * Logical functor (predicate) "Belong To Culinder".
188 * Verify whether mesh element lie in pointed Geom cylindrical object
190 interface BelongToCylinder: BelongToSurface
192 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
196 * Logical functor (predicate) "Lying On Geometry".
197 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
199 interface LyingOnGeom: Predicate
201 void SetGeom( in GEOM::GEOM_Object theGeom );
202 void SetElementType( in ElementType theType );
204 void SetShapeName( in string theName );
205 void SetShape( in string theID, in string theName );
206 string GetShapeName();
211 * Logical functor (predicate) "Free borders".
212 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
214 interface FreeBorders: Predicate{};
217 * Logical functor (predicate) "Free edges".
218 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
220 interface FreeEdges: Predicate
228 typedef sequence<Border> Borders;
229 Borders GetBorders();
234 * Abstract logical functor (predicate) "RangeOfIds".
235 * Verify whether an Entity Id belongs to defined sequence of id's
237 interface RangeOfIds: Predicate
239 void SetRange( in long_array theIds );
240 boolean SetRangeStr( in string theRange );
241 string GetRangeStr();
243 void SetElementType( in ElementType theType );
247 * Comparator. Predicate for compare value calculated
248 * by numerical functor with threshold value
250 interface Comparator: Predicate
252 void SetMargin( in double theValue );
253 void SetNumFunctor( in NumericalFunctor theFunct );
256 interface LessThan: Comparator{};
257 interface MoreThan: Comparator{};
258 interface EqualTo : Comparator
260 void SetTolerance( in double theToler );
261 double GetTolerance();
265 * Logical predicates are intended for compose predicates using boolean operations
267 interface Logical: Predicate{};
269 interface LogicalNOT: Logical
271 void SetPredicate(in Predicate thePredicate);
274 interface LogicalBinary: Logical
276 void SetPredicate1( in Predicate thePredicate );
277 void SetPredicate2( in Predicate thePredicate );
280 interface LogicalAND: LogicalBinary{};
281 interface LogicalOR : LogicalBinary{};
286 interface Filter: SALOME::GenericObj, SMESH_IDSource
289 * Structure containing information about one criterion
290 * Type - FT_Taper, FT_Skew ...
291 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
292 * Threshold - threshold value
293 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
294 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
295 * (FT_Undefined must be for the last criterion)
296 * ThresholdStr - Threshold value defined as string. Used for:
297 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
298 * 2. BelongToGeom predicate for storing name of shape
299 * ThresholdID - One more threshold value defined as string. Used for:
300 * 1. BelongToGeom predicate for storing id of shape
301 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
302 * "Belong to plane" and "Belong to cylinder" predicates
303 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
304 * Precision - Precision of numerical functors
316 ElementType TypeOfElement;
320 typedef sequence<Criterion> Criteria;
322 void SetPredicate( in Predicate thePredicate );
323 void SetMesh( in SMESH_Mesh theMesh );
325 long_array GetElementsId( in SMESH_Mesh theMesh );
326 ElementType GetElementType();
327 Predicate GetPredicate();
329 boolean GetCriteria( out Criteria theCriteria );
330 boolean SetCriteria( in Criteria theCriteria );
335 * Interface for working with library of filters
337 interface FilterLibrary : SALOME::GenericObj
340 * Copy filter from library by name (new filter is created)
342 Filter Copy( in string theFilterName );
345 * Methods for editing library
347 boolean Add ( in string theFilterName, in Filter theFilter );
348 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
349 boolean Delete ( in string theFilterName );
350 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
353 * Save library on disk
356 boolean SaveAs( in string aFileName );
361 boolean IsPresent( in string aFilterName );
362 long NbFilters( in ElementType aType );
363 string_array GetNames( in ElementType aType );
364 string_array GetAllNames();
365 void SetFileName( in string aFilterName );
366 string GetFileName();
371 * Interface of Filter manager
373 interface FilterManager: SALOME::GenericObj
376 * Create numerical functors
378 MinimumAngle CreateMinimumAngle();
379 AspectRatio CreateAspectRatio();
380 AspectRatio3D CreateAspectRatio3D();
381 Warping CreateWarping();
385 Volume3D CreateVolume3D();
386 Length CreateLength();
387 Length2D CreateLength2D();
388 MultiConnection CreateMultiConnection();
389 MultiConnection2D CreateMultiConnection2D();
392 * Create logical functors ( predicates )
394 BelongToGeom CreateBelongToGeom();
395 BelongToPlane CreateBelongToPlane();
396 BelongToCylinder CreateBelongToCylinder();
398 LyingOnGeom CreateLyingOnGeom();
400 FreeBorders CreateFreeBorders();
401 FreeEdges CreateFreeEdges();
403 RangeOfIds CreateRangeOfIds();
405 BadOrientedVolume CreateBadOrientedVolume();
408 * Create comparators ( predicates )
410 LessThan CreateLessThan();
411 MoreThan CreateMoreThan();
412 EqualTo CreateEqualTo();
415 * Create boolean operations ( predicates )
417 LogicalNOT CreateLogicalNOT();
418 LogicalAND CreateLogicalAND();
419 LogicalOR CreateLogicalOR();
424 Filter CreateFilter();
427 * Load filter library. If libary does not exist it is created
429 FilterLibrary LoadLibrary( in string aFileName );
434 FilterLibrary CreateLibrary();
439 boolean DeleteLibrary( in string aFileName );