1 // Copyright (C) 2007-2010 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
23 // File : SMESH_Filter.idl
24 // Author : Alexey Petrov, OCC
26 #ifndef _SMESH_FILTER_IDL_
27 #define _SMESH_FILTER_IDL_
29 #include "SALOME_Exception.idl"
30 #include "SALOME_GenericObj.idl"
31 #include "GEOM_Gen.idl"
32 #include "SMESH_Mesh.idl"
38 * Enumeration of functor types
50 FT_MaxElementLength2D,
51 FT_MaxElementLength3D,
63 FT_BelongToGenSurface,
80 * Parameters of a reclangle of histogram
82 struct HistogramRectangle
88 typedef sequence<HistogramRectangle> Histogram;
91 * Base interface for all functors ( i.e. numerical functors and predicates )
93 interface Functor: SALOME::GenericObj
95 void SetMesh( in SMESH_Mesh theMesh );
96 FunctorType GetFunctorType();
97 ElementType GetElementType();
103 * Numerical functors are intended for calculating value by Id of mesh entity
105 interface NumericalFunctor: Functor
107 double GetValue( in long theElementId );
109 Histogram GetHistogram( in short nbIntervals );
112 * Set precision for calculation. It is a position after point which is
113 * used to functor value after calculation.
115 void SetPrecision( in long thePrecision );
118 interface MinimumAngle : NumericalFunctor{};
119 interface AspectRatio : NumericalFunctor{};
120 interface AspectRatio3D : NumericalFunctor{};
121 interface Warping : NumericalFunctor{};
122 interface Taper : NumericalFunctor{};
123 interface Skew : NumericalFunctor{};
124 interface Area : NumericalFunctor{};
125 interface Volume3D : NumericalFunctor{};
126 interface MaxElementLength2D : NumericalFunctor{};
127 interface MaxElementLength3D : NumericalFunctor{};
128 interface Length : NumericalFunctor{};
129 interface Length2D : NumericalFunctor
136 typedef sequence<Value> Values;
139 interface MultiConnection : NumericalFunctor{};
140 interface MultiConnection2D : NumericalFunctor
148 typedef sequence<Value> Values;
153 * Predicates are intended for verification of criteria,
154 * must return bool value by mesh id
156 interface Predicate: Functor
158 boolean IsSatisfy( in long thEntityId );
162 * Logical functor (predicate) "Bad Oriented Volume".
163 * Verify whether a mesh volume is incorrectly oriented from
164 * the point of view of MED convention
166 interface BadOrientedVolume: Predicate {};
169 * Logical functor (predicate) "Belong To Geometry".
170 * Verify whether mesh element or node belong to pointed Geom Object
172 interface BelongToGeom: Predicate
174 void SetGeom( in GEOM::GEOM_Object theGeom );
175 void SetElementType( in ElementType theType );
177 /*! The tolerance is used only if there is no submesh on the shape
179 void SetTolerance( in double theToler );
180 double GetTolerance();
182 void SetShapeName( in string theName );
183 void SetShape( in string theID, in string theName );
184 string GetShapeName();
189 * Logical functor (predicate) "Belong To Surface".
190 * Base interface for "belong to plane" and "belong to cylinder"
191 * and "Belong To Generic Surface" interfaces
193 interface BelongToSurface: Predicate
195 void SetTolerance( in double theToler );
196 double GetTolerance();
197 void SetShapeName( in string theName, in ElementType theType );
198 void SetShape( in string theID, in string theName, in ElementType theType );
199 string GetShapeName();
202 * Limit surface extent to bounding box of boundaries (edges)
203 * in surface parametric space. Boundaries are ignored by default
205 void SetUseBoundaries( in boolean theUseBndRestrictions );
206 boolean GetUseBoundaries();
210 * Logical functor (predicate) "Belong To Plane".
211 * Verify whether mesh element lie on pointed Geom planar object
213 interface BelongToPlane: BelongToSurface
215 void SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
219 * Logical functor (predicate) "Belong To Cylinder".
220 * Verify whether mesh element lie on pointed Geom cylindrical object
222 interface BelongToCylinder: BelongToSurface
224 void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
228 * Logical functor (predicate) "Belong To Generic Surface".
229 * Verify whether mesh element lie in pointed Geom cylindrical object
231 interface BelongToGenSurface: BelongToSurface
233 void SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
237 * Logical functor (predicate) "Lying On Geometry".
238 * Verify whether mesh element or node lying or partially lying on the pointed Geom Object
240 interface LyingOnGeom: Predicate
242 void SetGeom( in GEOM::GEOM_Object theGeom );
243 void SetElementType( in ElementType theType );
245 /*! The tolerance is used only if there is no submesh on the shape
247 void SetTolerance( in double theToler );
248 double GetTolerance();
250 void SetShapeName( in string theName );
251 void SetShape( in string theID, in string theName );
252 string GetShapeName();
257 * Logical functor (predicate) "Free borders".
258 * Verify whether 1D mesh element is free ( i.e. connected to one face only )
260 interface FreeBorders: Predicate{};
263 * Logical functor (predicate) "Free edges".
264 * Verify whether 2D mesh element has free edges( i.e. edges connected to one face only )
266 interface FreeEdges: Predicate
273 typedef sequence<Border> Borders;
274 Borders GetBorders();
278 * Logical functor (predicate) "Free nodes".
279 * Verify whether mesh has free nodes( i.e. nodes are not connected to any element )
281 interface FreeNodes: Predicate{};
284 * Logical functor (predicate) "Free faces".
285 * Verify whether 2D mesh element is free ( i.e. connected to one volume only )
287 interface FreeFaces: Predicate{};
290 * Abstract logical functor (predicate) "RangeOfIds".
291 * Verify whether an Entity Id belongs to defined sequence of id's
293 interface RangeOfIds: Predicate
295 void SetRange( in long_array theIds );
296 boolean SetRangeStr( in string theRange );
297 string GetRangeStr();
299 void SetElementType( in ElementType theType );
303 * Comparator. Predicate for compare value calculated
304 * by numerical functor with threshold value
306 interface Comparator: Predicate
308 void SetMargin( in double theValue );
309 void SetNumFunctor( in NumericalFunctor theFunct );
312 interface LessThan: Comparator{};
313 interface MoreThan: Comparator{};
314 interface EqualTo : Comparator
316 void SetTolerance( in double theToler );
317 double GetTolerance();
321 * Logical predicates are intended for compose predicates using boolean operations
323 interface Logical: Predicate{};
325 interface LogicalNOT: Logical
327 void SetPredicate(in Predicate thePredicate);
330 interface LogicalBinary: Logical
332 void SetPredicate1( in Predicate thePredicate );
333 void SetPredicate2( in Predicate thePredicate );
336 interface LogicalAND: LogicalBinary{};
337 interface LogicalOR : LogicalBinary{};
340 * Logical functor (predicate) "Is element Linear or Quadratic".
341 * Verify whether a mesh element is linear
343 interface LinearOrQuadratic: Predicate {
344 void SetElementType( in ElementType theType );
348 * Functor "Group Color"
349 * Returns color of group to which mesh element belongs to
351 interface GroupColor : Predicate{
352 void SetElementType( in ElementType theType );
353 void SetColorStr( in string theColor );
354 string GetColorStr();
358 * Functor "Element geometry type"
359 * Returns is element has indicated geometry type
361 interface ElemGeomType : Predicate{
362 void SetElementType ( in ElementType theType );
363 void SetGeometryType( in GeometryType theType );
369 interface Filter: SALOME::GenericObj, SMESH_IDSource
372 * Structure containing information about one criterion
373 * Type - FT_Taper, FT_Skew ...
374 * Compare - FT_LessThan, FT_MoreThan, FT_EqualTo
375 * Threshold - threshold value
376 * UnaryOp - unary logical operation: FT_LogicalNOT or FT_Undefined
377 * BinaryOp - binary logical operation FT_LogicalAND, FT_LogicalOR or
378 * (FT_Undefined must be for the last criterion)
379 * ThresholdStr - Threshold value defined as string. Used for:
380 * 1. Diaposon of identifiers. Example: "1,2,3,5-10,12,27-29"
381 * 2. BelongToGeom predicate for storing name of shape
382 * 3. GroupColor predicate for storing group color "0.2;0;0.5"
383 * ThresholdID - One more threshold value defined as string. Used for:
384 * 1. BelongToGeom predicate for storing id of shape
385 * Tolerance - Tolerance is used for comparators (EqualTo comparision) and for
386 * "Belong to plane" and "Belong to cylinder" predicates
387 * TypeOfElement - type of element SMESH::NODE, SMESH::FACE (used by BelongToGeom predicate only)
388 * Precision - Precision of numerical functors
400 ElementType TypeOfElement;
404 typedef sequence<Criterion> Criteria;
406 void SetPredicate( in Predicate thePredicate );
407 void SetMesh( in SMESH_Mesh theMesh );
409 long_array GetElementsId( in SMESH_Mesh theMesh );
410 ElementType GetElementType();
411 Predicate GetPredicate();
413 boolean GetCriteria( out Criteria theCriteria );
414 boolean SetCriteria( in Criteria theCriteria );
419 * Interface for working with library of filters
421 interface FilterLibrary : SALOME::GenericObj
424 * Copy filter from library by name (new filter is created)
426 Filter Copy( in string theFilterName );
429 * Methods for editing library
431 boolean Add ( in string theFilterName, in Filter theFilter );
432 boolean AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
433 boolean Delete ( in string theFilterName );
434 boolean Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
437 * Save library on disk
440 boolean SaveAs( in string aFileName );
445 boolean IsPresent( in string aFilterName );
446 long NbFilters( in ElementType aType );
447 string_array GetNames( in ElementType aType );
448 string_array GetAllNames();
449 void SetFileName( in string aFilterName );
450 string GetFileName();
455 * Interface of Filter manager
457 interface FilterManager: SALOME::GenericObj
460 * Create numerical functors
462 MinimumAngle CreateMinimumAngle();
463 AspectRatio CreateAspectRatio();
464 AspectRatio3D CreateAspectRatio3D();
465 Warping CreateWarping();
469 Volume3D CreateVolume3D();
470 MaxElementLength2D CreateMaxElementLength2D();
471 MaxElementLength3D CreateMaxElementLength3D();
472 Length CreateLength();
473 Length2D CreateLength2D();
474 MultiConnection CreateMultiConnection();
475 MultiConnection2D CreateMultiConnection2D();
478 * Create logical functors ( predicates )
480 BelongToGeom CreateBelongToGeom();
481 BelongToPlane CreateBelongToPlane();
482 BelongToCylinder CreateBelongToCylinder();
483 BelongToGenSurface CreateBelongToGenSurface();
485 LyingOnGeom CreateLyingOnGeom();
487 FreeBorders CreateFreeBorders();
488 FreeEdges CreateFreeEdges();
489 FreeNodes CreateFreeNodes();
490 FreeFaces CreateFreeFaces();
492 RangeOfIds CreateRangeOfIds();
494 BadOrientedVolume CreateBadOrientedVolume();
495 LinearOrQuadratic CreateLinearOrQuadratic();
497 GroupColor CreateGroupColor();
498 ElemGeomType CreateElemGeomType();
501 * Create comparators ( predicates )
503 LessThan CreateLessThan();
504 MoreThan CreateMoreThan();
505 EqualTo CreateEqualTo();
508 * Create boolean operations ( predicates )
510 LogicalNOT CreateLogicalNOT();
511 LogicalAND CreateLogicalAND();
512 LogicalOR CreateLogicalOR();
517 Filter CreateFilter();
520 * Load filter library. If libary does not exist it is created
522 FilterLibrary LoadLibrary( in string aFileName );
527 FilterLibrary CreateLibrary();
532 boolean DeleteLibrary( in string aFileName );