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 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
24 // File : SMESH_Filter_i.hxx
25 // Author : Alexey Petrov, OCC
28 #ifndef _SMESH_FILTER_I_HXX_
29 #define _SMESH_FILTER_I_HXX_
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SMESH_Filter)
36 #include <LDOM_Document.hxx>
37 #include <TopoDS_Shape.hxx>
39 #include "SALOME_GenericObj_i.hh"
40 #include "SMESH_ControlsDef.hxx"
52 Description : Predicate for verifying whether entiy belong to
53 specified geometrical support
55 class SMESH_I_EXPORT BelongToGeom: public virtual Predicate
60 virtual void SetMesh( const SMDS_Mesh* theMesh );
61 virtual void SetGeom( const TopoDS_Shape& theShape );
63 virtual bool IsSatisfy( long theElementId );
65 virtual void SetType( SMDSAbs_ElementType theType );
66 virtual SMDSAbs_ElementType GetType() const;
68 TopoDS_Shape GetShape();
69 const SMESHDS_Mesh* GetMeshDS() const;
71 void SetTolerance( double );
72 double GetTolerance();
78 const SMESHDS_Mesh* myMeshDS;
79 SMDSAbs_ElementType myType;
81 double myTolerance; // only if myIsSubshape == false
82 Controls::ElementsOnShapePtr myElementsOnShapePtr; // only if myIsSubshape == false
84 typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
88 Description : Predicate for verifying whether entiy lying or partially lying on
89 specified geometrical support
91 class SMESH_I_EXPORT LyingOnGeom: public virtual Predicate
96 virtual void SetMesh( const SMDS_Mesh* theMesh );
97 virtual void SetGeom( const TopoDS_Shape& theShape );
99 virtual bool IsSatisfy( long theElementId );
101 virtual void SetType( SMDSAbs_ElementType theType );
102 virtual SMDSAbs_ElementType GetType() const;
104 TopoDS_Shape GetShape();
105 const SMESHDS_Mesh* GetMeshDS() const;
107 void SetTolerance( double );
108 double GetTolerance();
110 virtual bool Contains( const SMESHDS_Mesh* theMeshDS,
111 const TopoDS_Shape& theShape,
112 const SMDS_MeshElement* theElem,
113 TopAbs_ShapeEnum theFindShapeEnum,
114 TopAbs_ShapeEnum theAvoidShapeEnum = TopAbs_SHAPE );
118 TopoDS_Shape myShape;
119 const SMESHDS_Mesh* myMeshDS;
120 SMDSAbs_ElementType myType;
122 double myTolerance; // only if myIsSubshape == false
123 Controls::ElementsOnShapePtr myElementsOnShapePtr; // only if myIsSubshape == false
125 typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
134 Description : An abstact class for all functors
136 class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
137 public virtual SALOME::GenericObj_i
140 void SetMesh( SMESH_Mesh_ptr theMesh );
141 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
142 ElementType GetElementType();
148 Controls::FunctorPtr myFunctorPtr;
152 Class : NumericalFunctor_i
153 Description : Base class for numerical functors
155 class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
156 public virtual Functor_i
159 CORBA::Double GetValue( CORBA::Long theElementId );
160 void SetPrecision( CORBA::Long thePrecision );
161 CORBA::Long GetPrecision();
162 Controls::NumericalFunctorPtr GetNumericalFunctor();
165 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
170 Class : SMESH_MinimumAngleFunct
171 Description : Functor for calculation of minimum angle
173 class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
174 public virtual NumericalFunctor_i
178 FunctorType GetFunctorType();
183 Class : AspectRatio_i
184 Description : Functor for calculating aspect ratio
186 class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
187 public virtual NumericalFunctor_i
191 FunctorType GetFunctorType();
196 Class : AspectRatio3D_i
197 Description : Functor for calculating aspect ratio for 3D
199 class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
200 public virtual NumericalFunctor_i
204 FunctorType GetFunctorType();
210 Description : Functor for calculating warping
212 class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
213 public virtual NumericalFunctor_i
217 FunctorType GetFunctorType();
223 Description : Functor for calculating taper
225 class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
226 public virtual NumericalFunctor_i
230 FunctorType GetFunctorType();
236 Description : Functor for calculating skew in degrees
238 class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
239 public virtual NumericalFunctor_i
243 FunctorType GetFunctorType();
249 Description : Functor for calculating area
251 class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
252 public virtual NumericalFunctor_i
256 FunctorType GetFunctorType();
262 Description : Functor for calculating volume of 3D element
264 class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
265 public virtual NumericalFunctor_i
269 FunctorType GetFunctorType();
275 Description : Functor for calculating length of edge
277 class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
278 public virtual NumericalFunctor_i
282 FunctorType GetFunctorType();
287 Description : Functor for calculating length of edge
289 class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
290 public virtual NumericalFunctor_i
294 SMESH::Length2D::Values* GetValues();
295 FunctorType GetFunctorType();
298 Controls::Length2DPtr myLength2DPtr;
303 Class : MultiConnection_i
304 Description : Functor for calculating number of faces conneted to the edge
306 class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
307 public virtual NumericalFunctor_i
311 FunctorType GetFunctorType();
315 Class : MultiConnection2D_i
316 Description : Functor for calculating number of faces conneted to the edge
318 class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
319 public virtual NumericalFunctor_i
322 MultiConnection2D_i();
323 SMESH::MultiConnection2D::Values* GetValues();
324 FunctorType GetFunctorType();
327 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
336 Description : Base class for all predicates
338 class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
339 public virtual Functor_i
342 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
343 Controls::PredicatePtr GetPredicate();
346 Controls::PredicatePtr myPredicatePtr;
351 Class : BadOrientedVolume_i
352 Description : Verify whether a mesh volume is incorrectly oriented from
353 the point of view of MED convention
355 class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
356 public virtual Predicate_i
359 BadOrientedVolume_i();
360 FunctorType GetFunctorType();
364 Class : BelongToGeom_i
365 Description : Predicate for selection on geometrical support
367 class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
368 public virtual Predicate_i
372 virtual ~BelongToGeom_i();
374 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
375 void SetElementType( ElementType theType );
376 FunctorType GetFunctorType();
378 void SetGeom( const TopoDS_Shape& theShape );
380 void SetShapeName( const char* theName );
381 void SetShape( const char* theID, const char* theName );
382 char* GetShapeName();
385 void SetTolerance( CORBA::Double );
386 CORBA::Double GetTolerance();
389 Controls::BelongToGeomPtr myBelongToGeomPtr;
395 Class : BelongToSurface_i
396 Description : Verify whether mesh element lie in pointed Geom planar object
398 class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
399 public virtual Predicate_i
402 BelongToSurface_i( const Handle(Standard_Type)& );
403 virtual ~BelongToSurface_i();
405 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
407 void SetShapeName( const char* theName, ElementType theType );
408 void SetShape( const char* theID, const char* theName, ElementType theType );
409 char* GetShapeName();
412 void SetTolerance( CORBA::Double );
413 CORBA::Double GetTolerance();
415 void SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
416 CORBA::Boolean GetUseBoundaries();
419 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
422 Handle(Standard_Type) mySurfaceType;
426 Class : BelongToPlane_i
427 Description : Verify whether mesh element lie in pointed Geom planar object
429 class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
430 public virtual BelongToSurface_i
434 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
435 FunctorType GetFunctorType();
439 Class : BelongToCylinder_i
440 Description : Verify whether mesh element lie in pointed Geom cylindrical object
442 class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
443 public virtual BelongToSurface_i
446 BelongToCylinder_i();
447 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
448 FunctorType GetFunctorType();
452 Class : BelongToGenSurface_i
453 Description : Verify whether mesh element lie on pointed Geom surfasic object
455 class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
456 public virtual BelongToSurface_i
459 BelongToGenSurface_i();
460 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
461 FunctorType GetFunctorType();
465 Class : LyingOnGeom_i
466 Description : Predicate for selection on geometrical support(lying or partially lying)
468 class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
469 public virtual Predicate_i
473 virtual ~LyingOnGeom_i();
475 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
476 void SetElementType( ElementType theType );
477 FunctorType GetFunctorType();
479 void SetGeom( const TopoDS_Shape& theShape );
481 void SetShapeName( const char* theName );
482 void SetShape( const char* theID, const char* theName );
483 char* GetShapeName();
486 void SetTolerance( CORBA::Double );
487 CORBA::Double GetTolerance();
490 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
496 Class : FreeBorders_i
497 Description : Predicate for free borders
499 class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
500 public virtual Predicate_i
504 FunctorType GetFunctorType();
510 Description : Predicate for free edges
512 class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
513 public virtual Predicate_i
517 SMESH::FreeEdges::Borders* GetBorders();
518 FunctorType GetFunctorType();
521 Controls::FreeEdgesPtr myFreeEdgesPtr;
527 Description : Predicate for free faces
529 class SMESH_I_EXPORT FreeFaces_i: public virtual POA_SMESH::FreeFaces,
530 public virtual Predicate_i
534 FunctorType GetFunctorType();
540 Description : Predicate for free nodes
542 class SMESH_I_EXPORT FreeNodes_i: public virtual POA_SMESH::FreeNodes,
543 public virtual Predicate_i
547 FunctorType GetFunctorType();
553 Description : Predicate for Range of Ids
555 class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
556 public virtual Predicate_i
560 void SetRange( const SMESH::long_array& theIds );
561 CORBA::Boolean SetRangeStr( const char* theRange );
564 void SetElementType( ElementType theType );
565 FunctorType GetFunctorType();
568 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
572 Class : LinearOrQuadratic_i
573 Description : Verify whether a mesh element is linear
575 class SMESH_I_EXPORT LinearOrQuadratic_i: public virtual POA_SMESH::LinearOrQuadratic,
576 public virtual Predicate_i
579 LinearOrQuadratic_i();
580 FunctorType GetFunctorType();
581 void SetElementType( ElementType theType );
584 Controls::LinearOrQuadraticPtr myLinearOrQuadraticPtr;
589 Description : Functor for check color of group to whic mesh element belongs to
591 class SMESH_I_EXPORT GroupColor_i: public virtual POA_SMESH::GroupColor,
592 public virtual Predicate_i
596 FunctorType GetFunctorType();
598 void SetElementType( ElementType theType );
599 void SetColorStr( const char* theColor );
603 Controls::GroupColorPtr myGroupColorPtr;
607 Class : ElemGeomType_i
608 Description : Functor for check element geometry type
610 class SMESH_I_EXPORT ElemGeomType_i: public virtual POA_SMESH::ElemGeomType,
611 public virtual Predicate_i
615 FunctorType GetFunctorType();
617 void SetElementType ( ElementType theType );
618 void SetGeometryType( GeometryType theType );
619 GeometryType GetGeometryType() const;
622 Controls::ElemGeomTypePtr myElemGeomTypePtr;
627 Description : Base class for comparators
629 class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
630 public virtual Predicate_i
633 virtual ~Comparator_i();
635 virtual void SetMargin( CORBA::Double );
636 virtual void SetNumFunctor( NumericalFunctor_ptr );
638 Controls::ComparatorPtr GetComparator();
639 NumericalFunctor_i* GetNumFunctor_i();
640 CORBA::Double GetMargin();
645 Controls::ComparatorPtr myComparatorPtr;
646 NumericalFunctor_i* myNumericalFunctor;
652 Description : Comparator "<"
654 class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
655 public virtual Comparator_i
659 FunctorType GetFunctorType();
665 Description : Comparator ">"
667 class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
668 public virtual Comparator_i
672 FunctorType GetFunctorType();
678 Description : Comparator "="
680 class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
681 public virtual Comparator_i
685 virtual void SetTolerance( CORBA::Double );
686 CORBA::Double GetTolerance();
687 FunctorType GetFunctorType();
690 Controls::EqualToPtr myEqualToPtr;
696 Description : Logical NOT predicate
698 class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
699 public virtual Predicate_i
703 virtual ~LogicalNOT_i();
705 virtual void SetPredicate( Predicate_ptr );
706 Predicate_i* GetPredicate_i();
707 FunctorType GetFunctorType();
710 Controls::LogicalNOTPtr myLogicalNOTPtr;
711 Predicate_i* myPredicate;
716 Class : LogicalBinary_i
717 Description : Base class for binary logical predicate
719 class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
720 public virtual Predicate_i
723 virtual ~LogicalBinary_i();
724 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
725 virtual void SetPredicate1( Predicate_ptr );
726 virtual void SetPredicate2( Predicate_ptr );
728 Controls::LogicalBinaryPtr GetLogicalBinary();
729 Predicate_i* GetPredicate1_i();
730 Predicate_i* GetPredicate2_i();
735 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
736 Predicate_i* myPredicate1;
737 Predicate_i* myPredicate2;
743 Description : Logical AND
745 class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
746 public virtual LogicalBinary_i
750 FunctorType GetFunctorType();
756 Description : Logical OR
758 class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
759 public virtual LogicalBinary_i
763 FunctorType GetFunctorType();
770 class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
771 public virtual SALOME::GenericObj_i
779 SetPredicate( Predicate_ptr );
783 SetMesh( SMESH_Mesh_ptr );
795 GetElementsId( Predicate_i*,
797 Controls::Filter::TIdSequence& );
800 GetElementsId( Predicate_i*,
802 Controls::Filter::TIdSequence& );
806 GetElementsId( SMESH_Mesh_ptr );
814 GetCriteria( SMESH::Filter::Criteria_out theCriteria );
818 SetCriteria( const SMESH::Filter::Criteria& theCriteria );
824 Predicate_i* GetPredicate_i();
827 Controls::Filter myFilter;
828 Predicate_i* myPredicate;
829 SMESH_Mesh_var myMesh;
836 class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
837 public virtual SALOME::GenericObj_i
840 FilterLibrary_i( const char* theFileName );
844 Filter_ptr Copy( const char* theFilterName );
846 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
847 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
848 CORBA::Boolean Delete ( const char* theFilterName );
849 CORBA::Boolean Replace ( const char* theFilterName,
850 const char* theNewName,
851 Filter_ptr theFilter );
853 CORBA::Boolean Save();
854 CORBA::Boolean SaveAs( const char* aFileName );
856 CORBA::Boolean IsPresent( const char* aFilterName );
857 CORBA::Long NbFilters( ElementType );
858 string_array* GetNames( ElementType );
859 string_array* GetAllNames();
860 void SetFileName( const char* theFileName );
866 FilterManager_var myFilterMgr;
874 class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
875 public virtual SALOME::GenericObj_i
881 MinimumAngle_ptr CreateMinimumAngle();
882 AspectRatio_ptr CreateAspectRatio();
883 AspectRatio3D_ptr CreateAspectRatio3D();
884 Warping_ptr CreateWarping();
885 Taper_ptr CreateTaper();
886 Skew_ptr CreateSkew();
887 Area_ptr CreateArea();
888 Volume3D_ptr CreateVolume3D();
889 Length_ptr CreateLength();
890 Length2D_ptr CreateLength2D();
891 MultiConnection_ptr CreateMultiConnection();
892 MultiConnection2D_ptr CreateMultiConnection2D();
894 BelongToGeom_ptr CreateBelongToGeom();
895 BelongToPlane_ptr CreateBelongToPlane();
896 BelongToCylinder_ptr CreateBelongToCylinder();
897 BelongToGenSurface_ptr CreateBelongToGenSurface();
899 LyingOnGeom_ptr CreateLyingOnGeom();
901 FreeBorders_ptr CreateFreeBorders();
902 FreeEdges_ptr CreateFreeEdges();
903 FreeNodes_ptr CreateFreeNodes();
904 FreeFaces_ptr CreateFreeFaces();
906 RangeOfIds_ptr CreateRangeOfIds();
908 BadOrientedVolume_ptr CreateBadOrientedVolume();
909 LinearOrQuadratic_ptr CreateLinearOrQuadratic();
911 GroupColor_ptr CreateGroupColor();
913 ElemGeomType_ptr CreateElemGeomType();
915 LessThan_ptr CreateLessThan();
916 MoreThan_ptr CreateMoreThan();
917 EqualTo_ptr CreateEqualTo();
919 LogicalNOT_ptr CreateLogicalNOT();
920 LogicalAND_ptr CreateLogicalAND();
921 LogicalOR_ptr CreateLogicalOR();
923 Filter_ptr CreateFilter();
925 FilterLibrary_ptr LoadLibrary( const char* aFileName );
926 FilterLibrary_ptr CreateLibrary();
927 CORBA::Boolean DeleteLibrary( const char* aFileName );
932 GetPredicate( SMESH::Predicate_ptr thePredicate );