idl/SMESH_Filter.idl

Go to the documentation of this file.
00001 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00002 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
00003 // 
00004 //  This library is free software; you can redistribute it and/or 
00005 //  modify it under the terms of the GNU Lesser General Public 
00006 //  License as published by the Free Software Foundation; either 
00007 //  version 2.1 of the License. 
00008 // 
00009 //  This library is distributed in the hope that it will be useful, 
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00012 //  Lesser General Public License for more details. 
00013 // 
00014 //  You should have received a copy of the GNU Lesser General Public 
00015 //  License along with this library; if not, write to the Free Software 
00016 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
00017 // 
00018 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 //
00020 //
00021 //
00022 //  File   : SMESH_Filter.idl
00023 //  Author : Alexey Petrov, OCC
00024 
00025 #ifndef _SMESH_FILTER_IDL_
00026 #define _SMESH_FILTER_IDL_
00027 
00028 #include "SALOME_Exception.idl"
00029 #include "SALOME_GenericObj.idl"
00030 #include "GEOM_Gen.idl"
00031 #include "SMESH_Mesh.idl"
00032 
00033 module SMESH
00034 {
00035 
00039   enum FunctorType
00040   {
00041     FT_AspectRatio,
00042     FT_AspectRatio3D,
00043     FT_Warping,   
00044     FT_MinimumAngle,
00045     FT_Taper,       
00046     FT_Skew,         
00047     FT_Area,          
00048     FT_Volume3D,          
00049     FT_FreeBorders,
00050     FT_FreeEdges,
00051     FT_MultiConnection,
00052     FT_MultiConnection2D,
00053     FT_Length,
00054     FT_Length2D,
00055     FT_BelongToGeom,
00056     FT_BelongToPlane,
00057     FT_BelongToCylinder,
00058     FT_BelongToGenSurface,
00059     FT_LyingOnGeom,
00060     FT_RangeOfIds,
00061     FT_BadOrientedVolume,
00062     FT_LessThan,
00063     FT_MoreThan,
00064     FT_EqualTo,
00065     FT_LogicalNOT,
00066     FT_LogicalAND,
00067     FT_LogicalOR,
00068     FT_Undefined
00069   };
00070 
00074   interface Functor: SALOME::GenericObj
00075   {
00076     void            SetMesh( in SMESH_Mesh theMesh );
00077     FunctorType     GetFunctorType();
00078     ElementType     GetElementType();
00079   };
00080 
00081 
00082 
00086   interface NumericalFunctor: Functor
00087   {
00088     double GetValue( in long theElementId );
00089 
00094     void   SetPrecision( in long thePrecision );
00095     long   GetPrecision();
00096   };
00097   interface MinimumAngle    : NumericalFunctor{};
00098   interface AspectRatio     : NumericalFunctor{};
00099   interface AspectRatio3D   : NumericalFunctor{};
00100   interface Warping         : NumericalFunctor{};
00101   interface Taper           : NumericalFunctor{};
00102   interface Skew            : NumericalFunctor{};
00103   interface Area            : NumericalFunctor{};
00104   interface Volume3D        : NumericalFunctor{};
00105   interface Length          : NumericalFunctor{};
00106   interface Length2D        : NumericalFunctor
00107   {
00108     struct Value
00109     {
00110       double myLength;
00111       long myPnt1, myPnt2;
00112     };
00113     typedef sequence<Value> Values;
00114     Values GetValues();
00115   };
00116   interface MultiConnection   : NumericalFunctor{};
00117   interface MultiConnection2D : NumericalFunctor
00118   {
00119     struct Value
00120     {
00121       long myNbConnects;
00122       long myPnt1, myPnt2;
00123     };
00124     
00125     typedef sequence<Value> Values;
00126     Values GetValues();
00127   };
00128 
00133   interface Predicate: Functor
00134   {
00135     boolean IsSatisfy( in long thEntityId );
00136   };
00137 
00143   interface BadOrientedVolume: Predicate {};
00144 
00149   interface BelongToGeom: Predicate
00150   {
00151     void SetGeom( in GEOM::GEOM_Object theGeom );
00152     void SetElementType( in ElementType theType );
00153 
00154     void   SetShapeName( in string theName );
00155     void   SetShape( in string theID, in string theName );
00156     string GetShapeName();
00157     string GetShapeID();
00158   };
00159 
00165   interface BelongToSurface: Predicate
00166   {
00167     void    SetTolerance( in double theToler );
00168     double  GetTolerance();
00169     void    SetShapeName( in string theName, in ElementType theType );
00170     void    SetShape( in string theID, in string theName, in ElementType theType );
00171     string  GetShapeName();
00172     string  GetShapeID();
00177     void    SetUseBoundaries( in boolean theUseBndRestrictions );
00178     boolean GetUseBoundaries();
00179   };
00180 
00185   interface BelongToPlane: BelongToSurface
00186   {
00187     void   SetPlane( in GEOM::GEOM_Object theGeom, in ElementType theType );
00188   };
00189 
00194   interface BelongToCylinder: BelongToSurface
00195   {
00196     void   SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
00197   };
00198 
00203   interface BelongToGenSurface: BelongToSurface
00204   {
00205     void   SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
00206   };
00207 
00212   interface LyingOnGeom: Predicate
00213   {
00214     void SetGeom( in GEOM::GEOM_Object theGeom );
00215     void SetElementType( in ElementType theType );
00216 
00217     void   SetShapeName( in string theName );
00218     void   SetShape( in string theID, in string theName );
00219     string GetShapeName();    
00220     string GetShapeID(); 
00221   };
00222  
00227   interface FreeBorders: Predicate{};
00228 
00233   interface FreeEdges: Predicate
00234 
00235   {
00236     struct Border
00237     {
00238       long myElemId;
00239       long myPnt1, myPnt2;
00240     };
00241     typedef sequence<Border> Borders;
00242     Borders GetBorders();
00243   };
00244 
00245 
00250   interface RangeOfIds: Predicate
00251   {
00252     void            SetRange( in long_array theIds );
00253     boolean         SetRangeStr( in string theRange );
00254     string          GetRangeStr();
00255 
00256     void            SetElementType( in ElementType theType );
00257   };
00258 
00263   interface Comparator: Predicate
00264   {
00265     void    SetMargin( in double theValue );
00266     void    SetNumFunctor( in NumericalFunctor theFunct );
00267     double  GetMargin();
00268   };
00269   interface LessThan: Comparator{};
00270   interface MoreThan: Comparator{};
00271   interface EqualTo : Comparator
00272   {
00273     void    SetTolerance( in double theToler );
00274     double  GetTolerance();
00275   };
00276 
00280   interface Logical: Predicate{};
00281 
00282   interface LogicalNOT: Logical
00283   {
00284     void SetPredicate(in Predicate thePredicate);
00285   };
00286 
00287   interface LogicalBinary: Logical
00288 {
00289     void SetPredicate1( in Predicate thePredicate );
00290     void SetPredicate2( in Predicate thePredicate );
00291   };
00292 
00293   interface LogicalAND: LogicalBinary{};
00294   interface LogicalOR : LogicalBinary{};
00295 
00299   interface Filter: SALOME::GenericObj, SMESH_IDSource
00300   {
00319     struct Criterion
00320     {
00321       long        Type;
00322       long        Compare;
00323       double      Threshold;
00324       string      ThresholdStr;
00325       string      ThresholdID;
00326       long        UnaryOp;
00327       long        BinaryOp;
00328       double      Tolerance;
00329       ElementType TypeOfElement;
00330       long        Precision;
00331     };
00332 
00333     typedef sequence<Criterion> Criteria;
00334 
00335     void          SetPredicate( in Predicate thePredicate );
00336     void          SetMesh( in SMESH_Mesh theMesh );
00337 
00338     long_array    GetElementsId( in SMESH_Mesh theMesh );
00339     ElementType   GetElementType();
00340     Predicate     GetPredicate();
00341 
00342     boolean       GetCriteria( out Criteria theCriteria );
00343     boolean       SetCriteria( in Criteria theCriteria );
00344   };
00345 
00346 
00350   interface FilterLibrary : SALOME::GenericObj
00351   {
00355     Filter        Copy( in string theFilterName );
00356 
00360     boolean       Add     ( in string theFilterName, in Filter theFilter );
00361     boolean       AddEmpty( in string theFilterName, in ElementType theType ); // add empty filter
00362     boolean       Delete  ( in string theFilterName );
00363     boolean       Replace ( in string theFilterName, in string theNewName, in Filter theFilter );
00364 
00368     boolean       Save();
00369     boolean       SaveAs( in string aFileName );
00370 
00374     boolean       IsPresent( in string aFilterName );
00375     long          NbFilters( in ElementType aType );
00376     string_array  GetNames( in ElementType aType );
00377     string_array  GetAllNames();
00378     void          SetFileName( in string aFilterName );
00379     string        GetFileName();
00380   };
00381 
00382 
00386   interface FilterManager: SALOME::GenericObj
00387   {
00391     MinimumAngle      CreateMinimumAngle();
00392     AspectRatio       CreateAspectRatio();
00393     AspectRatio3D     CreateAspectRatio3D();
00394     Warping           CreateWarping();
00395     Taper             CreateTaper();
00396     Skew              CreateSkew();
00397     Area              CreateArea();
00398     Volume3D          CreateVolume3D();
00399     Length            CreateLength();
00400     Length2D          CreateLength2D();
00401     MultiConnection   CreateMultiConnection();
00402     MultiConnection2D CreateMultiConnection2D();
00403 
00407     BelongToGeom      CreateBelongToGeom();
00408     BelongToPlane     CreateBelongToPlane();
00409     BelongToCylinder  CreateBelongToCylinder();
00410     BelongToGenSurface CreateBelongToGenSurface();
00411 
00412     LyingOnGeom       CreateLyingOnGeom();
00413 
00414     FreeBorders       CreateFreeBorders();
00415     FreeEdges         CreateFreeEdges();
00416 
00417     RangeOfIds        CreateRangeOfIds();
00418 
00419     BadOrientedVolume CreateBadOrientedVolume();
00420 
00424     LessThan          CreateLessThan();
00425     MoreThan          CreateMoreThan();
00426     EqualTo           CreateEqualTo();
00427 
00431     LogicalNOT        CreateLogicalNOT();
00432     LogicalAND        CreateLogicalAND();
00433     LogicalOR         CreateLogicalOR();
00434 
00438     Filter            CreateFilter();
00439 
00443     FilterLibrary     LoadLibrary( in string aFileName );
00444 
00448     FilterLibrary     CreateLibrary();
00449 
00453     boolean           DeleteLibrary( in string aFileName );
00454   };
00455 };
00456 
00457 
00458 #endif