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"
32 #include "GEOM_Gen.idl"
39 * Enumeration of functor types
73 * Base interface for all functors ( i.e. numerical functors and predicates )
75 interface Functor: SALOME::GenericObj
77 void SetMesh( in SMESH_Mesh theMesh );
78 FunctorType GetFunctorType();
79 ElementType GetElementType();
85 * Numerical functors are intended for calculating value by Id of mesh entity
87 interface NumericalFunctor: Functor
89 double GetValue( in long theElementId );
92 * Set precision for calculation. It is a position after point which is
93 * used to functor value after calculation.
95 void SetPrecision( in long thePrecision );
98 interface MinimumAngle : NumericalFunctor{};
99 interface AspectRatio : NumericalFunctor{};
100 interface AspectRatio3D : NumericalFunctor{};
101 interface Warping : NumericalFunctor{};
102 interface Taper : NumericalFunctor{};
103 interface Skew : NumericalFunctor{};
104 interface Area : NumericalFunctor{};
105 interface Volume3D : NumericalFunctor{};
106 interface Length : NumericalFunctor{};
107 interface Length2D : NumericalFunctor
114 typedef sequence<Value> Values;
117 interface MultiConnection : NumericalFunctor{};
118 interface MultiConnection2D : NumericalFunctor
126 typedef sequence<Value> Values;
131 * Predicates are intended for verification of criteria,
132 * must return bool value by mesh id
134 interface Predicate: Functor
136 boolean IsSatisfy( in long thEntityId );
140 * Logical functor (predicate) "Bad Oriented Volume".
141 * Verify whether a mesh volume is incorrectly oriented from
142 * the point of view of MED convention
144 interface BadOrientedVolume: Predicate {};
147 * Logical functor (predicate) "Belong To Geometry".
148 * Verify whether mesh element or node belong to pointed Geom Object
150 interface BelongToGeom: Predicate
152 void SetGeom( in GEOM::GEOM_Object theGeom );
153 void SetElementType( in ElementType theType );
155 void SetShapeName( in string theName );
156 void SetShape( in string theID, in string theName );
157 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 void SetShape( in string theID, in string theName, in ElementType theType );
171 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 void SetShape( in string theID, in string theName );
205 string GetShapeName();
210 * Logical functor (predicate) "Free borders".
211 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
213 interface FreeBorders: Predicate{};
216 * Logical functor (predicate) "Free edges".
217 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
219 interface FreeEdges: Predicate
227 typedef sequence<Border> Borders;
228 Borders GetBorders();
233 * Abstract logical functor (predicate) "RangeOfIds".
234 * Verify whether an Entity Id belongs to defined sequence of id's
236 interface RangeOfIds: Predicate
238 void SetRange( in long_array theIds );
239 boolean SetRangeStr( in string theRange );
240 string GetRangeStr();
242 void SetElementType( in ElementType theType );
246 * Comparator. Predicate for compare value calculated
247 * by numerical functor with threshold value
249 interface Comparator: Predicate
251 void SetMargin( in double theValue );
252 void SetNumFunctor( in NumericalFunctor theFunct );
255 interface LessThan: Comparator{};
256 interface MoreThan: Comparator{};
257 interface EqualTo : Comparator
259 void SetTolerance( in double theToler );
260 double GetTolerance();
264 * Logical predicates are intended for compose predicates using boolean operations
266 interface Logical: Predicate{};
268 interface LogicalNOT: Logical
270 void SetPredicate(in Predicate thePredicate);
273 interface LogicalBinary: Logical
275 void SetPredicate1( in Predicate thePredicate );
276 void SetPredicate2( in Predicate thePredicate );
279 interface LogicalAND: LogicalBinary{};
280 interface LogicalOR : LogicalBinary{};
285 interface Filter: SALOME::GenericObj, SMESH_IDSource
288 * Structure containing information about one criterion
289 * Type - FT_Taper, FT_Skew ...
290 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
291 * Threshold - threshold value
292 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
293 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
294 * (FT_Undefined must be for the last criterion)
295 * ThresholdStr - Threshold value defined as string. Used for:
296 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
297 * 2. BelongToGeom predicate for storing name of shape
298 * ThresholdID - One more threshold value defined as string. Used for:
299 * 1. BelongToGeom predicate for storing id of shape
300 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
301 * "Belong to plane" and "Belong to cylinder" predicates
302 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
303 * Precision - Precision of numerical functors
315 ElementType TypeOfElement;
319 typedef sequence<Criterion> Criteria;
321 void SetPredicate( in Predicate thePredicate );
322 void SetMesh( in SMESH_Mesh theMesh );
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 Volume3D CreateVolume3D();
385 Length CreateLength();
386 Length2D CreateLength2D();
387 MultiConnection CreateMultiConnection();
388 MultiConnection2D CreateMultiConnection2D();
391 * Create logical functors ( predicates )
393 BelongToGeom CreateBelongToGeom();
394 BelongToPlane CreateBelongToPlane();
395 BelongToCylinder CreateBelongToCylinder();
397 LyingOnGeom CreateLyingOnGeom();
399 FreeBorders CreateFreeBorders();
400 FreeEdges CreateFreeEdges();
402 RangeOfIds CreateRangeOfIds();
404 BadOrientedVolume CreateBadOrientedVolume();
407 * Create comparators ( predicates )
409 LessThan CreateLessThan();
410 MoreThan CreateMoreThan();
411 EqualTo CreateEqualTo();
414 * Create boolean operations ( predicates )
416 LogicalNOT CreateLogicalNOT();
417 LogicalAND CreateLogicalAND();
418 LogicalOR CreateLogicalOR();
423 Filter CreateFilter();
426 * Load filter library. If libary does not exist it is created
428 FilterLibrary LoadLibrary( in string aFileName );
433 FilterLibrary CreateLibrary();
438 boolean DeleteLibrary( in string aFileName );