1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // 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
60 FT_BelongToGenSurface,
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 /*! The tolerance is used only if there is no submesh on the shape
161 void SetTolerance( in double theToler );
162 double GetTolerance();
164 void SetShapeName( in string theName );
165 void SetShape( in string theID, in string theName );
166 string GetShapeName();
171 * Logical functor (predicate) "Belong To Surface".
172 * Base interface for "belong to plane" and "belong to cylinder"
173 * and "Belong To Generic Surface" interfaces
175 interface BelongToSurface: Predicate
177 void SetTolerance( in double theToler );
178 double GetTolerance();
179 void SetShapeName( in string theName, in ElementType theType );
180 void SetShape( in string theID, in string theName, in ElementType theType );
181 string GetShapeName();
184 * Limit surface extent to bounding box of boundaries (edges)
185 * in surface parametric space. Boundaries are ignored by default
187 void SetUseBoundaries( in boolean theUseBndRestrictions );
188 boolean GetUseBoundaries();
192 * Logical functor (predicate) "Belong To Plane".
193 * Verify whether mesh element lie on pointed Geom planar object
195 interface BelongToPlane: BelongToSurface
197 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
201 * Logical functor (predicate) "Belong To Cylinder".
202 * Verify whether mesh element lie on pointed Geom cylindrical object
204 interface BelongToCylinder: BelongToSurface
206 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
210 * Logical functor (predicate) "Belong To Generic Surface".
211 * Verify whether mesh element lie in pointed Geom cylindrical object
213 interface BelongToGenSurface: BelongToSurface
215 void SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
219 * Logical functor (predicate) "Lying On Geometry".
220 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
222 interface LyingOnGeom: Predicate
224 void SetGeom( in GEOM::GEOM_Object theGeom );
225 void SetElementType( in ElementType theType );
227 /*! The tolerance is used only if there is no submesh on the shape
229 void SetTolerance( in double theToler );
230 double GetTolerance();
232 void SetShapeName( in string theName );
233 void SetShape( in string theID, in string theName );
234 string GetShapeName();
239 * Logical functor (predicate) "Free borders".
240 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
242 interface FreeBorders: Predicate{};
245 * Logical functor (predicate) "Free edges".
246 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
248 interface FreeEdges: Predicate
255 typedef sequence<Border> Borders;
256 Borders GetBorders();
260 * Logical functor (predicate) "Free nodes".
261 * Verify whether mesh has free nodes( i.e. nodes are not connected to any element )
263 interface FreeNodes: Predicate{};
266 * Logical functor (predicate) "Free faces".
267 * Verify whether 2D mesh element is free ( i.e. connected to one volume only )
269 interface FreeFaces: Predicate{};
272 * Abstract logical functor (predicate) "RangeOfIds".
273 * Verify whether an Entity Id belongs to defined sequence of id's
275 interface RangeOfIds: Predicate
277 void SetRange( in long_array theIds );
278 boolean SetRangeStr( in string theRange );
279 string GetRangeStr();
281 void SetElementType( in ElementType theType );
285 * Comparator. Predicate for compare value calculated
286 * by numerical functor with threshold value
288 interface Comparator: Predicate
290 void SetMargin( in double theValue );
291 void SetNumFunctor( in NumericalFunctor theFunct );
294 interface LessThan: Comparator{};
295 interface MoreThan: Comparator{};
296 interface EqualTo : Comparator
298 void SetTolerance( in double theToler );
299 double GetTolerance();
303 * Logical predicates are intended for compose predicates using boolean operations
305 interface Logical: Predicate{};
307 interface LogicalNOT: Logical
309 void SetPredicate(in Predicate thePredicate);
312 interface LogicalBinary: Logical
314 void SetPredicate1( in Predicate thePredicate );
315 void SetPredicate2( in Predicate thePredicate );
318 interface LogicalAND: LogicalBinary{};
319 interface LogicalOR : LogicalBinary{};
322 * Logical functor (predicate) "Is element Linear or Quadratic".
323 * Verify whether a mesh element is linear
325 interface LinearOrQuadratic: Predicate {
326 void SetElementType( in ElementType theType );
330 * Functor "Group Color"
331 * Returns color of group to which mesh element belongs to
333 interface GroupColor : Predicate{
334 void SetElementType( in ElementType theType );
335 void SetColorStr( in string theColor );
336 string GetColorStr();
340 * Functor "Element geometry type"
341 * Returns is element has indicated geometry type
343 interface ElemGeomType : Predicate{
344 void SetElementType ( in ElementType theType );
345 void SetGeometryType( in GeometryType theType );
351 interface Filter: SALOME::GenericObj, SMESH_IDSource
354 * Structure containing information about one criterion
355 * Type - FT_Taper, FT_Skew ...
356 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
357 * Threshold - threshold value
358 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
359 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
360 * (FT_Undefined must be for the last criterion)
361 * ThresholdStr - Threshold value defined as string. Used for:
362 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
363 * 2. BelongToGeom predicate for storing name of shape
364 * 3. GroupColor predicate for storing group color "0.2;0;0.5"
365 * ThresholdID - One more threshold value defined as string. Used for:
366 * 1. BelongToGeom predicate for storing id of shape
367 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
368 * "Belong to plane" and "Belong to cylinder" predicates
369 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
370 * Precision - Precision of numerical functors
382 ElementType TypeOfElement;
386 typedef sequence<Criterion> Criteria;
388 void SetPredicate( in Predicate thePredicate );
389 void SetMesh( in SMESH_Mesh theMesh );
391 long_array GetElementsId( in SMESH_Mesh theMesh );
392 ElementType GetElementType();
393 Predicate GetPredicate();
395 boolean GetCriteria( out Criteria theCriteria );
396 boolean SetCriteria( in Criteria theCriteria );
401 * Interface for working with library of filters
403 interface FilterLibrary : SALOME::GenericObj
406 * Copy filter from library by name (new filter is created)
408 Filter Copy( in string theFilterName );
411 * Methods for editing library
413 boolean Add ( in string theFilterName, in Filter theFilter );
414 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
415 boolean Delete ( in string theFilterName );
416 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
419 * Save library on disk
422 boolean SaveAs( in string aFileName );
427 boolean IsPresent( in string aFilterName );
428 long NbFilters( in ElementType aType );
429 string_array GetNames( in ElementType aType );
430 string_array GetAllNames();
431 void SetFileName( in string aFilterName );
432 string GetFileName();
437 * Interface of Filter manager
439 interface FilterManager: SALOME::GenericObj
442 * Create numerical functors
444 MinimumAngle CreateMinimumAngle();
445 AspectRatio CreateAspectRatio();
446 AspectRatio3D CreateAspectRatio3D();
447 Warping CreateWarping();
451 Volume3D CreateVolume3D();
452 Length CreateLength();
453 Length2D CreateLength2D();
454 MultiConnection CreateMultiConnection();
455 MultiConnection2D CreateMultiConnection2D();
458 * Create logical functors ( predicates )
460 BelongToGeom CreateBelongToGeom();
461 BelongToPlane CreateBelongToPlane();
462 BelongToCylinder CreateBelongToCylinder();
463 BelongToGenSurface CreateBelongToGenSurface();
465 LyingOnGeom CreateLyingOnGeom();
467 FreeBorders CreateFreeBorders();
468 FreeEdges CreateFreeEdges();
469 FreeNodes CreateFreeNodes();
470 FreeFaces CreateFreeFaces();
472 RangeOfIds CreateRangeOfIds();
474 BadOrientedVolume CreateBadOrientedVolume();
475 LinearOrQuadratic CreateLinearOrQuadratic();
477 GroupColor CreateGroupColor();
478 ElemGeomType CreateElemGeomType();
481 * Create comparators ( predicates )
483 LessThan CreateLessThan();
484 MoreThan CreateMoreThan();
485 EqualTo CreateEqualTo();
488 * Create boolean operations ( predicates )
490 LogicalNOT CreateLogicalNOT();
491 LogicalAND CreateLogicalAND();
492 LogicalOR CreateLogicalOR();
497 Filter CreateFilter();
500 * Load filter library. If libary does not exist it is created
502 FilterLibrary LoadLibrary( in string aFileName );
507 FilterLibrary CreateLibrary();
512 boolean DeleteLibrary( in string aFileName );