Back to index

salome-smesh  6.5.0
SMESH_Filter.idl
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : SMESH_Filter.idl
00024 //  Author : Alexey Petrov, OCC
00025 //
00026 #ifndef _SMESH_FILTER_IDL_
00027 #define _SMESH_FILTER_IDL_
00028 
00029 #include "SALOME_Exception.idl"
00030 #include "SALOME_GenericObj.idl"
00031 #include "GEOM_Gen.idl"
00032 #include "SMESH_Mesh.idl"
00033 
00034 module SMESH
00035 {
00036 
00040   enum FunctorType
00041   {
00042     FT_AspectRatio,
00043     FT_AspectRatio3D,
00044     FT_Warping,   
00045     FT_MinimumAngle,
00046     FT_Taper,       
00047     FT_Skew,         
00048     FT_Area,          
00049     FT_Volume3D,          
00050     FT_MaxElementLength2D,
00051     FT_MaxElementLength3D,
00052     FT_FreeBorders,
00053     FT_FreeEdges,
00054     FT_FreeNodes,
00055     FT_FreeFaces,
00056     FT_EqualNodes,
00057     FT_EqualEdges,
00058     FT_EqualFaces,
00059     FT_EqualVolumes,
00060     FT_MultiConnection,
00061     FT_MultiConnection2D,
00062     FT_Length,
00063     FT_Length2D,
00064     FT_BelongToGeom,
00065     FT_BelongToPlane,
00066     FT_BelongToCylinder,
00067     FT_BelongToGenSurface,
00068     FT_LyingOnGeom,
00069     FT_RangeOfIds,
00070     FT_BadOrientedVolume,
00071     FT_BareBorderVolume,
00072     FT_BareBorderFace,
00073     FT_OverConstrainedVolume,
00074     FT_OverConstrainedFace,
00075     FT_LinearOrQuadratic,
00076     FT_GroupColor,
00077     FT_ElemGeomType,
00078     FT_CoplanarFaces,
00079     FT_LessThan,
00080     FT_MoreThan,
00081     FT_EqualTo,
00082     FT_LogicalNOT,
00083     FT_LogicalAND,
00084     FT_LogicalOR,
00085     FT_Undefined
00086   };
00087 
00091   struct HistogramRectangle
00092   {
00093     long nbEvents;
00094     double min;
00095     double max;
00096   };
00097   typedef sequence<HistogramRectangle> Histogram;
00098 
00099 
00103   interface Functor: SALOME::GenericObj
00104   {
00105     void            SetMesh( in SMESH_Mesh theMesh );
00106     FunctorType     GetFunctorType();
00107     ElementType     GetElementType();
00108   };
00109 
00113   interface NumericalFunctor: Functor
00114   {
00115     double GetValue( in long theElementId );
00116 
00117     Histogram GetHistogram( in short nbIntervals );
00118 
00123     void   SetPrecision( in long thePrecision );
00124     long   GetPrecision();
00125   };
00126   interface MinimumAngle    : NumericalFunctor{};
00127   interface AspectRatio     : NumericalFunctor{};
00128   interface AspectRatio3D   : NumericalFunctor{};
00129   interface Warping         : NumericalFunctor{};
00130   interface Taper           : NumericalFunctor{};
00131   interface Skew            : NumericalFunctor{};
00132   interface Area            : NumericalFunctor{};
00133   interface Volume3D        : NumericalFunctor{};
00134   interface MaxElementLength2D : NumericalFunctor{};
00135   interface MaxElementLength3D : NumericalFunctor{};
00136   interface Length          : NumericalFunctor{};
00137   interface Length2D        : NumericalFunctor
00138   {
00139     struct Value
00140     {
00141       double myLength;
00142       long myPnt1, myPnt2;
00143     };
00144     typedef sequence<Value> Values;
00145     Values GetValues();
00146   };
00147   interface MultiConnection   : NumericalFunctor{};
00148   interface MultiConnection2D : NumericalFunctor
00149   {
00150     struct Value
00151     {
00152       long myNbConnects;
00153       long myPnt1, myPnt2;
00154     };
00155     
00156     typedef sequence<Value> Values;
00157     Values GetValues();
00158   };
00159   
00160 
00165   interface Predicate: Functor
00166   {
00167     boolean IsSatisfy( in long thEntityId );
00168   };
00169 
00175   interface BadOrientedVolume: Predicate {};
00176 
00181   interface BareBorderVolume: Predicate {};
00187   interface BareBorderFace: Predicate {};
00188 
00193   interface OverConstrainedVolume: Predicate {};
00198   interface OverConstrainedFace: Predicate {};
00199 
00204   interface EqualNodes: Predicate 
00205   {
00206     void    SetTolerance( in double theToler );
00207     double  GetTolerance();
00208   };
00213   interface EqualEdges: Predicate {};
00218   interface EqualFaces: Predicate {};
00223   interface EqualVolumes: Predicate {};
00224 
00229   interface BelongToGeom: Predicate
00230   {
00231     void SetGeom( in GEOM::GEOM_Object theGeom );
00232     void SetElementType( in ElementType theType );
00233 
00236     void    SetTolerance( in double theToler );
00237     double  GetTolerance();
00238 
00239     void   SetShapeName( in string theName );
00240     void   SetShape( in string theID, in string theName );
00241     string GetShapeName();
00242     string GetShapeID();
00243   };
00244 
00250   interface BelongToSurface: Predicate
00251   {
00252     void    SetTolerance( in double theToler );
00253     double  GetTolerance();
00254     void    SetShapeName( in string theName, in ElementType theType );
00255     void    SetShape( in string theID, in string theName, in ElementType theType );
00256     string  GetShapeName();
00257     string  GetShapeID();
00262     void    SetUseBoundaries( in boolean theUseBndRestrictions );
00263     boolean GetUseBoundaries();
00264   };
00265 
00270   interface BelongToPlane: BelongToSurface
00271   {
00272     void   SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
00273   };
00274 
00279   interface BelongToCylinder: BelongToSurface
00280   {
00281     void   SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
00282   };
00283 
00288   interface BelongToGenSurface: BelongToSurface
00289   {
00290     void   SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
00291   };
00292 
00297   interface LyingOnGeom: Predicate
00298   {
00299     void SetGeom( in GEOM::GEOM_Object theGeom );
00300     void SetElementType( in ElementType theType );
00301 
00304     void    SetTolerance( in double theToler );
00305     double  GetTolerance();
00306 
00307     void   SetShapeName( in string theName );
00308     void   SetShape( in string theID, in string theName );
00309     string GetShapeName();    
00310     string GetShapeID(); 
00311   };
00312  
00317   interface FreeBorders: Predicate{};
00318 
00323   interface FreeEdges: Predicate
00324   {
00325     struct Border
00326     {
00327       long myElemId;
00328       long myPnt1, myPnt2;
00329     };
00330     typedef sequence<Border> Borders;
00331     Borders GetBorders();
00332   };
00333 
00338   interface FreeNodes: Predicate{};
00339  
00344   interface FreeFaces: Predicate{};
00345 
00350   interface RangeOfIds: Predicate
00351   {
00352     void            SetRange( in long_array theIds );
00353     boolean         SetRangeStr( in string theRange );
00354     string          GetRangeStr();
00355 
00356     void            SetElementType( in ElementType theType );
00357   };
00358 
00363   interface Comparator: Predicate
00364   {
00365     void    SetMargin( in double theValue );
00366     void    SetNumFunctor( in NumericalFunctor theFunct );
00367     double  GetMargin();
00368   };
00369   interface LessThan: Comparator{};
00370   interface MoreThan: Comparator{};
00371   interface EqualTo : Comparator
00372   {
00373     void    SetTolerance( in double theToler );
00374     double  GetTolerance();
00375   };
00376 
00380   interface Logical: Predicate{};
00381 
00382   interface LogicalNOT: Logical
00383   {
00384     void SetPredicate(in Predicate thePredicate);
00385   };
00386 
00387   interface LogicalBinary: Logical
00388 {
00389     void SetPredicate1( in Predicate thePredicate );
00390     void SetPredicate2( in Predicate thePredicate );
00391   };
00392 
00393   interface LogicalAND: LogicalBinary{};
00394   interface LogicalOR : LogicalBinary{};
00395 
00400   interface LinearOrQuadratic: Predicate {
00401     void            SetElementType( in ElementType theType );
00402   };
00403 
00408   interface GroupColor : Predicate{
00409     void            SetElementType( in ElementType theType );
00410     void            SetColorStr( in string theColor );
00411     string          GetColorStr();
00412   };
00413 
00418   interface ElemGeomType : Predicate{
00419     void            SetElementType ( in ElementType  theType );
00420     void            SetGeometryType( in GeometryType theType );
00421   };
00422 
00428   interface CoplanarFaces : Predicate{
00429     void            SetFace ( in long theFaceID );
00430     void            SetTolerance( in double theToler );
00431   };
00432 
00436   interface Filter: SALOME::GenericObj, SMESH_IDSource
00437   {
00457     struct Criterion
00458     {
00459       long        Type;
00460       long        Compare;
00461       double      Threshold;
00462       string      ThresholdStr;
00463       string      ThresholdID;
00464       long        UnaryOp;
00465       long        BinaryOp;
00466       double      Tolerance;
00467       ElementType TypeOfElement;
00468       long        Precision;
00469     };
00470 
00471     typedef sequence<Criterion> Criteria;
00472 
00473     void          SetPredicate( in Predicate thePredicate );
00474     void          SetMesh( in SMESH_Mesh theMesh );
00475 
00476     long_array    GetElementsId( in SMESH_Mesh theMesh );
00477     ElementType   GetElementType();
00478     Predicate     GetPredicate();
00479 
00480     boolean       GetCriteria( out Criteria theCriteria );
00481     boolean       SetCriteria( in Criteria theCriteria );
00482   };
00483 
00484 
00488   interface FilterLibrary : SALOME::GenericObj
00489   {
00493     Filter        Copy( in string theFilterName );
00494 
00498     boolean       Add     ( in string theFilterName, in Filter theFilter );
00499     boolean       AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
00500     boolean       Delete  ( in string theFilterName );
00501     boolean       Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
00502 
00506     boolean       Save();
00507     boolean       SaveAs( in string aFileName );
00508 
00512     boolean       IsPresent( in string aFilterName );
00513     long          NbFilters( in ElementType aType );
00514     string_array  GetNames( in ElementType aType );
00515     string_array  GetAllNames();
00516     void          SetFileName( in string aFilterName );
00517     string        GetFileName();
00518   };
00519 
00520 
00524   interface FilterManager: SALOME::GenericObj
00525   {
00529     MinimumAngle      CreateMinimumAngle();
00530     AspectRatio       CreateAspectRatio();
00531     AspectRatio3D     CreateAspectRatio3D();
00532     Warping           CreateWarping();
00533     Taper             CreateTaper();
00534     Skew              CreateSkew();
00535     Area              CreateArea();
00536     Volume3D          CreateVolume3D();
00537     MaxElementLength2D CreateMaxElementLength2D();
00538     MaxElementLength3D CreateMaxElementLength3D();
00539     Length            CreateLength();
00540     Length2D          CreateLength2D();
00541     MultiConnection   CreateMultiConnection();
00542     MultiConnection2D CreateMultiConnection2D();
00543 
00547     BelongToGeom      CreateBelongToGeom();
00548     BelongToPlane     CreateBelongToPlane();
00549     BelongToCylinder  CreateBelongToCylinder();
00550     BelongToGenSurface CreateBelongToGenSurface();
00551 
00552     LyingOnGeom       CreateLyingOnGeom();
00553 
00554     FreeBorders       CreateFreeBorders();
00555     FreeEdges         CreateFreeEdges();
00556     FreeNodes         CreateFreeNodes();
00557     FreeFaces         CreateFreeFaces();
00558 
00559     EqualNodes        CreateEqualNodes();
00560     EqualEdges        CreateEqualEdges();
00561     EqualFaces        CreateEqualFaces();
00562     EqualVolumes      CreateEqualVolumes();
00563 
00564     RangeOfIds        CreateRangeOfIds();
00565 
00566     BadOrientedVolume CreateBadOrientedVolume();
00567     BareBorderVolume  CreateBareBorderVolume();
00568     BareBorderFace    CreateBareBorderFace();
00569     OverConstrainedVolume CreateOverConstrainedVolume();
00570     OverConstrainedFace   CreateOverConstrainedFace();
00571     LinearOrQuadratic CreateLinearOrQuadratic();
00572 
00573     GroupColor        CreateGroupColor();
00574     ElemGeomType      CreateElemGeomType();
00575     CoplanarFaces     CreateCoplanarFaces();
00576 
00580     LessThan          CreateLessThan();
00581     MoreThan          CreateMoreThan();
00582     EqualTo           CreateEqualTo();
00583 
00587     LogicalNOT        CreateLogicalNOT();
00588     LogicalAND        CreateLogicalAND();
00589     LogicalOR         CreateLogicalOR();
00590 
00594     Filter            CreateFilter();
00595 
00599     FilterLibrary     LoadLibrary( in string aFileName );
00600 
00604     FilterLibrary     CreateLibrary();
00605 
00609     boolean           DeleteLibrary( in string aFileName );
00610   };
00611 };
00612 
00613 
00614 #endif