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 SMESH::Histogram* GetHistogram(CORBA::Short nbIntervals);
161 void SetPrecision( CORBA::Long thePrecision );
162 CORBA::Long GetPrecision();
163 Controls::NumericalFunctorPtr GetNumericalFunctor();
166 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
171 Class : SMESH_MinimumAngleFunct
172 Description : Functor for calculation of minimum angle
174 class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
175 public virtual NumericalFunctor_i
179 FunctorType GetFunctorType();
184 Class : AspectRatio_i
185 Description : Functor for calculating aspect ratio
187 class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
188 public virtual NumericalFunctor_i
192 FunctorType GetFunctorType();
197 Class : AspectRatio3D_i
198 Description : Functor for calculating aspect ratio for 3D
200 class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
201 public virtual NumericalFunctor_i
205 FunctorType GetFunctorType();
211 Description : Functor for calculating warping
213 class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
214 public virtual NumericalFunctor_i
218 FunctorType GetFunctorType();
224 Description : Functor for calculating taper
226 class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
227 public virtual NumericalFunctor_i
231 FunctorType GetFunctorType();
237 Description : Functor for calculating skew in degrees
239 class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
240 public virtual NumericalFunctor_i
244 FunctorType GetFunctorType();
250 Description : Functor for calculating area
252 class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
253 public virtual NumericalFunctor_i
257 FunctorType GetFunctorType();
263 Description : Functor for calculating volume of 3D element
265 class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
266 public virtual NumericalFunctor_i
270 FunctorType GetFunctorType();
276 Description : Functor for calculating length of edge
278 class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
279 public virtual NumericalFunctor_i
283 FunctorType GetFunctorType();
288 Description : Functor for calculating length of edge
290 class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
291 public virtual NumericalFunctor_i
295 SMESH::Length2D::Values* GetValues();
296 FunctorType GetFunctorType();
299 Controls::Length2DPtr myLength2DPtr;
304 Class : MultiConnection_i
305 Description : Functor for calculating number of faces conneted to the edge
307 class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
308 public virtual NumericalFunctor_i
312 FunctorType GetFunctorType();
316 Class : MultiConnection2D_i
317 Description : Functor for calculating number of faces conneted to the edge
319 class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
320 public virtual NumericalFunctor_i
323 MultiConnection2D_i();
324 SMESH::MultiConnection2D::Values* GetValues();
325 FunctorType GetFunctorType();
328 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
337 Description : Base class for all predicates
339 class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
340 public virtual Functor_i
343 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
344 Controls::PredicatePtr GetPredicate();
347 Controls::PredicatePtr myPredicatePtr;
352 Class : BadOrientedVolume_i
353 Description : Verify whether a mesh volume is incorrectly oriented from
354 the point of view of MED convention
356 class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
357 public virtual Predicate_i
360 BadOrientedVolume_i();
361 FunctorType GetFunctorType();
365 Class : BelongToGeom_i
366 Description : Predicate for selection on geometrical support
368 class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
369 public virtual Predicate_i
373 virtual ~BelongToGeom_i();
375 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
376 void SetElementType( ElementType theType );
377 FunctorType GetFunctorType();
379 void SetGeom( const TopoDS_Shape& theShape );
381 void SetShapeName( const char* theName );
382 void SetShape( const char* theID, const char* theName );
383 char* GetShapeName();
386 void SetTolerance( CORBA::Double );
387 CORBA::Double GetTolerance();
390 Controls::BelongToGeomPtr myBelongToGeomPtr;
396 Class : BelongToSurface_i
397 Description : Verify whether mesh element lie in pointed Geom planar object
399 class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
400 public virtual Predicate_i
403 BelongToSurface_i( const Handle(Standard_Type)& );
404 virtual ~BelongToSurface_i();
406 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
408 void SetShapeName( const char* theName, ElementType theType );
409 void SetShape( const char* theID, const char* theName, ElementType theType );
410 char* GetShapeName();
413 void SetTolerance( CORBA::Double );
414 CORBA::Double GetTolerance();
416 void SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
417 CORBA::Boolean GetUseBoundaries();
420 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
423 Handle(Standard_Type) mySurfaceType;
427 Class : BelongToPlane_i
428 Description : Verify whether mesh element lie in pointed Geom planar object
430 class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
431 public virtual BelongToSurface_i
435 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
436 FunctorType GetFunctorType();
440 Class : BelongToCylinder_i
441 Description : Verify whether mesh element lie in pointed Geom cylindrical object
443 class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
444 public virtual BelongToSurface_i
447 BelongToCylinder_i();
448 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
449 FunctorType GetFunctorType();
453 Class : BelongToGenSurface_i
454 Description : Verify whether mesh element lie on pointed Geom surfasic object
456 class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
457 public virtual BelongToSurface_i
460 BelongToGenSurface_i();
461 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
462 FunctorType GetFunctorType();
466 Class : LyingOnGeom_i
467 Description : Predicate for selection on geometrical support(lying or partially lying)
469 class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
470 public virtual Predicate_i
474 virtual ~LyingOnGeom_i();
476 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
477 void SetElementType( ElementType theType );
478 FunctorType GetFunctorType();
480 void SetGeom( const TopoDS_Shape& theShape );
482 void SetShapeName( const char* theName );
483 void SetShape( const char* theID, const char* theName );
484 char* GetShapeName();
487 void SetTolerance( CORBA::Double );
488 CORBA::Double GetTolerance();
491 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
497 Class : FreeBorders_i
498 Description : Predicate for free borders
500 class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
501 public virtual Predicate_i
505 FunctorType GetFunctorType();
511 Description : Predicate for free edges
513 class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
514 public virtual Predicate_i
518 SMESH::FreeEdges::Borders* GetBorders();
519 FunctorType GetFunctorType();
522 Controls::FreeEdgesPtr myFreeEdgesPtr;
528 Description : Predicate for free faces
530 class SMESH_I_EXPORT FreeFaces_i: public virtual POA_SMESH::FreeFaces,
531 public virtual Predicate_i
535 FunctorType GetFunctorType();
541 Description : Predicate for free nodes
543 class SMESH_I_EXPORT FreeNodes_i: public virtual POA_SMESH::FreeNodes,
544 public virtual Predicate_i
548 FunctorType GetFunctorType();
554 Description : Predicate for Range of Ids
556 class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
557 public virtual Predicate_i
561 void SetRange( const SMESH::long_array& theIds );
562 CORBA::Boolean SetRangeStr( const char* theRange );
565 void SetElementType( ElementType theType );
566 FunctorType GetFunctorType();
569 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
573 Class : LinearOrQuadratic_i
574 Description : Verify whether a mesh element is linear
576 class SMESH_I_EXPORT LinearOrQuadratic_i: public virtual POA_SMESH::LinearOrQuadratic,
577 public virtual Predicate_i
580 LinearOrQuadratic_i();
581 FunctorType GetFunctorType();
582 void SetElementType( ElementType theType );
585 Controls::LinearOrQuadraticPtr myLinearOrQuadraticPtr;
590 Description : Functor for check color of group to whic mesh element belongs to
592 class SMESH_I_EXPORT GroupColor_i: public virtual POA_SMESH::GroupColor,
593 public virtual Predicate_i
597 FunctorType GetFunctorType();
599 void SetElementType( ElementType theType );
600 void SetColorStr( const char* theColor );
604 Controls::GroupColorPtr myGroupColorPtr;
608 Class : ElemGeomType_i
609 Description : Functor for check element geometry type
611 class SMESH_I_EXPORT ElemGeomType_i: public virtual POA_SMESH::ElemGeomType,
612 public virtual Predicate_i
616 FunctorType GetFunctorType();
618 void SetElementType ( ElementType theType );
619 void SetGeometryType( GeometryType theType );
620 GeometryType GetGeometryType() const;
623 Controls::ElemGeomTypePtr myElemGeomTypePtr;
628 Description : Base class for comparators
630 class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
631 public virtual Predicate_i
634 virtual ~Comparator_i();
636 virtual void SetMargin( CORBA::Double );
637 virtual void SetNumFunctor( NumericalFunctor_ptr );
639 Controls::ComparatorPtr GetComparator();
640 NumericalFunctor_i* GetNumFunctor_i();
641 CORBA::Double GetMargin();
646 Controls::ComparatorPtr myComparatorPtr;
647 NumericalFunctor_i* myNumericalFunctor;
653 Description : Comparator "<"
655 class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
656 public virtual Comparator_i
660 FunctorType GetFunctorType();
666 Description : Comparator ">"
668 class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
669 public virtual Comparator_i
673 FunctorType GetFunctorType();
679 Description : Comparator "="
681 class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
682 public virtual Comparator_i
686 virtual void SetTolerance( CORBA::Double );
687 CORBA::Double GetTolerance();
688 FunctorType GetFunctorType();
691 Controls::EqualToPtr myEqualToPtr;
697 Description : Logical NOT predicate
699 class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
700 public virtual Predicate_i
704 virtual ~LogicalNOT_i();
706 virtual void SetPredicate( Predicate_ptr );
707 Predicate_i* GetPredicate_i();
708 FunctorType GetFunctorType();
711 Controls::LogicalNOTPtr myLogicalNOTPtr;
712 Predicate_i* myPredicate;
717 Class : LogicalBinary_i
718 Description : Base class for binary logical predicate
720 class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
721 public virtual Predicate_i
724 virtual ~LogicalBinary_i();
725 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
726 virtual void SetPredicate1( Predicate_ptr );
727 virtual void SetPredicate2( Predicate_ptr );
729 Controls::LogicalBinaryPtr GetLogicalBinary();
730 Predicate_i* GetPredicate1_i();
731 Predicate_i* GetPredicate2_i();
736 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
737 Predicate_i* myPredicate1;
738 Predicate_i* myPredicate2;
744 Description : Logical AND
746 class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
747 public virtual LogicalBinary_i
751 FunctorType GetFunctorType();
757 Description : Logical OR
759 class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
760 public virtual LogicalBinary_i
764 FunctorType GetFunctorType();
771 class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
772 public virtual SALOME::GenericObj_i
780 SetPredicate( Predicate_ptr );
784 SetMesh( SMESH_Mesh_ptr );
795 SMESH::array_of_ElementType*
800 GetElementsId( Predicate_i*,
802 Controls::Filter::TIdSequence& );
805 GetElementsId( Predicate_i*,
807 Controls::Filter::TIdSequence& );
811 GetElementsId( SMESH_Mesh_ptr );
819 GetCriteria( SMESH::Filter::Criteria_out theCriteria );
823 SetCriteria( const SMESH::Filter::Criteria& theCriteria );
829 Predicate_i* GetPredicate_i();
832 Controls::Filter myFilter;
833 Predicate_i* myPredicate;
834 SMESH_Mesh_var myMesh;
841 class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
842 public virtual SALOME::GenericObj_i
845 FilterLibrary_i( const char* theFileName );
849 Filter_ptr Copy( const char* theFilterName );
851 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
852 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
853 CORBA::Boolean Delete ( const char* theFilterName );
854 CORBA::Boolean Replace ( const char* theFilterName,
855 const char* theNewName,
856 Filter_ptr theFilter );
858 CORBA::Boolean Save();
859 CORBA::Boolean SaveAs( const char* aFileName );
861 CORBA::Boolean IsPresent( const char* aFilterName );
862 CORBA::Long NbFilters( ElementType );
863 string_array* GetNames( ElementType );
864 string_array* GetAllNames();
865 void SetFileName( const char* theFileName );
871 FilterManager_var myFilterMgr;
879 class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
880 public virtual SALOME::GenericObj_i
886 MinimumAngle_ptr CreateMinimumAngle();
887 AspectRatio_ptr CreateAspectRatio();
888 AspectRatio3D_ptr CreateAspectRatio3D();
889 Warping_ptr CreateWarping();
890 Taper_ptr CreateTaper();
891 Skew_ptr CreateSkew();
892 Area_ptr CreateArea();
893 Volume3D_ptr CreateVolume3D();
894 Length_ptr CreateLength();
895 Length2D_ptr CreateLength2D();
896 MultiConnection_ptr CreateMultiConnection();
897 MultiConnection2D_ptr CreateMultiConnection2D();
899 BelongToGeom_ptr CreateBelongToGeom();
900 BelongToPlane_ptr CreateBelongToPlane();
901 BelongToCylinder_ptr CreateBelongToCylinder();
902 BelongToGenSurface_ptr CreateBelongToGenSurface();
904 LyingOnGeom_ptr CreateLyingOnGeom();
906 FreeBorders_ptr CreateFreeBorders();
907 FreeEdges_ptr CreateFreeEdges();
908 FreeNodes_ptr CreateFreeNodes();
909 FreeFaces_ptr CreateFreeFaces();
911 RangeOfIds_ptr CreateRangeOfIds();
913 BadOrientedVolume_ptr CreateBadOrientedVolume();
914 LinearOrQuadratic_ptr CreateLinearOrQuadratic();
916 GroupColor_ptr CreateGroupColor();
918 ElemGeomType_ptr CreateElemGeomType();
920 LessThan_ptr CreateLessThan();
921 MoreThan_ptr CreateMoreThan();
922 EqualTo_ptr CreateEqualTo();
924 LogicalNOT_ptr CreateLogicalNOT();
925 LogicalAND_ptr CreateLogicalAND();
926 LogicalOR_ptr CreateLogicalOR();
928 Filter_ptr CreateFilter();
930 FilterLibrary_ptr LoadLibrary( const char* aFileName );
931 FilterLibrary_ptr CreateLibrary();
932 CORBA::Boolean DeleteLibrary( const char* aFileName );
937 GetPredicate( SMESH::Predicate_ptr thePredicate );