1 // Copyright (C) 2007-2008 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
22 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
23 // File : SMESH_Filter_i.hxx
24 // Author : Alexey Petrov, OCC
27 #ifndef _SMESH_FILTER_I_HXX_
28 #define _SMESH_FILTER_I_HXX_
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_Filter)
35 #include <LDOM_Document.hxx>
36 #include <TopoDS_Shape.hxx>
38 #include "SALOME_GenericObj_i.hh"
39 #include "SMESH_ControlsDef.hxx"
51 Description : Predicate for verifying whether entiy belong to
52 specified geometrical support
54 class SMESH_I_EXPORT BelongToGeom: public virtual Predicate
59 virtual void SetMesh( const SMDS_Mesh* theMesh );
60 virtual void SetGeom( const TopoDS_Shape& theShape );
62 virtual bool IsSatisfy( long theElementId );
64 virtual void SetType( SMDSAbs_ElementType theType );
65 virtual SMDSAbs_ElementType GetType() const;
67 TopoDS_Shape GetShape();
68 const SMESHDS_Mesh* GetMeshDS() const;
70 void SetTolerance( double );
71 double GetTolerance();
77 const SMESHDS_Mesh* myMeshDS;
78 SMDSAbs_ElementType myType;
80 double myTolerance; // only if myIsSubshape == false
81 Controls::ElementsOnShapePtr myElementsOnShapePtr; // only if myIsSubshape == false
83 typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
87 Description : Predicate for verifying whether entiy lying or partially lying on
88 specified geometrical support
90 class SMESH_I_EXPORT LyingOnGeom: public virtual Predicate
95 virtual void SetMesh( const SMDS_Mesh* theMesh );
96 virtual void SetGeom( const TopoDS_Shape& theShape );
98 virtual bool IsSatisfy( long theElementId );
100 virtual void SetType( SMDSAbs_ElementType theType );
101 virtual SMDSAbs_ElementType GetType() const;
103 TopoDS_Shape GetShape();
104 const SMESHDS_Mesh* GetMeshDS() const;
106 void SetTolerance( double );
107 double GetTolerance();
109 virtual bool Contains( const SMESHDS_Mesh* theMeshDS,
110 const TopoDS_Shape& theShape,
111 const SMDS_MeshElement* theElem,
112 TopAbs_ShapeEnum theFindShapeEnum,
113 TopAbs_ShapeEnum theAvoidShapeEnum = TopAbs_SHAPE );
117 TopoDS_Shape myShape;
118 const SMESHDS_Mesh* myMeshDS;
119 SMDSAbs_ElementType myType;
121 double myTolerance; // only if myIsSubshape == false
122 Controls::ElementsOnShapePtr myElementsOnShapePtr; // only if myIsSubshape == false
124 typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
133 Description : An abstact class for all functors
135 class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
136 public virtual SALOME::GenericObj_i
139 void SetMesh( SMESH_Mesh_ptr theMesh );
140 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
141 ElementType GetElementType();
147 Controls::FunctorPtr myFunctorPtr;
151 Class : NumericalFunctor_i
152 Description : Base class for numerical functors
154 class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
155 public virtual Functor_i
158 CORBA::Double GetValue( CORBA::Long theElementId );
159 void SetPrecision( CORBA::Long thePrecision );
160 CORBA::Long GetPrecision();
161 Controls::NumericalFunctorPtr GetNumericalFunctor();
164 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
169 Class : SMESH_MinimumAngleFunct
170 Description : Functor for calculation of minimum angle
172 class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
173 public virtual NumericalFunctor_i
177 FunctorType GetFunctorType();
182 Class : AspectRatio_i
183 Description : Functor for calculating aspect ratio
185 class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
186 public virtual NumericalFunctor_i
190 FunctorType GetFunctorType();
195 Class : AspectRatio3D_i
196 Description : Functor for calculating aspect ratio for 3D
198 class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
199 public virtual NumericalFunctor_i
203 FunctorType GetFunctorType();
209 Description : Functor for calculating warping
211 class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
212 public virtual NumericalFunctor_i
216 FunctorType GetFunctorType();
222 Description : Functor for calculating taper
224 class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
225 public virtual NumericalFunctor_i
229 FunctorType GetFunctorType();
235 Description : Functor for calculating skew in degrees
237 class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
238 public virtual NumericalFunctor_i
242 FunctorType GetFunctorType();
248 Description : Functor for calculating area
250 class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
251 public virtual NumericalFunctor_i
255 FunctorType GetFunctorType();
261 Description : Functor for calculating volume of 3D element
263 class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
264 public virtual NumericalFunctor_i
268 FunctorType GetFunctorType();
274 Description : Functor for calculating length of edge
276 class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
277 public virtual NumericalFunctor_i
281 FunctorType GetFunctorType();
286 Description : Functor for calculating length of edge
288 class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
289 public virtual NumericalFunctor_i
293 SMESH::Length2D::Values* GetValues();
294 FunctorType GetFunctorType();
297 Controls::Length2DPtr myLength2DPtr;
302 Class : MultiConnection_i
303 Description : Functor for calculating number of faces conneted to the edge
305 class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
306 public virtual NumericalFunctor_i
310 FunctorType GetFunctorType();
314 Class : MultiConnection2D_i
315 Description : Functor for calculating number of faces conneted to the edge
317 class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
318 public virtual NumericalFunctor_i
321 MultiConnection2D_i();
322 SMESH::MultiConnection2D::Values* GetValues();
323 FunctorType GetFunctorType();
326 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
335 Description : Base class for all predicates
337 class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
338 public virtual Functor_i
341 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
342 Controls::PredicatePtr GetPredicate();
345 Controls::PredicatePtr myPredicatePtr;
350 Class : BadOrientedVolume_i
351 Description : Verify whether a mesh volume is incorrectly oriented from
352 the point of view of MED convention
354 class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
355 public virtual Predicate_i
358 BadOrientedVolume_i();
359 FunctorType GetFunctorType();
363 Class : BelongToGeom_i
364 Description : Predicate for selection on geometrical support
366 class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
367 public virtual Predicate_i
371 virtual ~BelongToGeom_i();
373 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
374 void SetElementType( ElementType theType );
375 FunctorType GetFunctorType();
377 void SetGeom( const TopoDS_Shape& theShape );
379 void SetShapeName( const char* theName );
380 void SetShape( const char* theID, const char* theName );
381 char* GetShapeName();
384 void SetTolerance( CORBA::Double );
385 CORBA::Double GetTolerance();
388 Controls::BelongToGeomPtr myBelongToGeomPtr;
394 Class : BelongToSurface_i
395 Description : Verify whether mesh element lie in pointed Geom planar object
397 class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
398 public virtual Predicate_i
401 BelongToSurface_i( const Handle(Standard_Type)& );
402 virtual ~BelongToSurface_i();
404 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
406 void SetShapeName( const char* theName, ElementType theType );
407 void SetShape( const char* theID, const char* theName, ElementType theType );
408 char* GetShapeName();
411 void SetTolerance( CORBA::Double );
412 CORBA::Double GetTolerance();
414 void SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
415 CORBA::Boolean GetUseBoundaries();
418 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
421 Handle(Standard_Type) mySurfaceType;
425 Class : BelongToPlane_i
426 Description : Verify whether mesh element lie in pointed Geom planar object
428 class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
429 public virtual BelongToSurface_i
433 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
434 FunctorType GetFunctorType();
438 Class : BelongToCylinder_i
439 Description : Verify whether mesh element lie in pointed Geom cylindrical object
441 class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
442 public virtual BelongToSurface_i
445 BelongToCylinder_i();
446 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
447 FunctorType GetFunctorType();
451 Class : BelongToGenSurface_i
452 Description : Verify whether mesh element lie on pointed Geom surfasic object
454 class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
455 public virtual BelongToSurface_i
458 BelongToGenSurface_i();
459 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
460 FunctorType GetFunctorType();
464 Class : LyingOnGeom_i
465 Description : Predicate for selection on geometrical support(lying or partially lying)
467 class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
468 public virtual Predicate_i
472 virtual ~LyingOnGeom_i();
474 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
475 void SetElementType( ElementType theType );
476 FunctorType GetFunctorType();
478 void SetGeom( const TopoDS_Shape& theShape );
480 void SetShapeName( const char* theName );
481 void SetShape( const char* theID, const char* theName );
482 char* GetShapeName();
485 void SetTolerance( CORBA::Double );
486 CORBA::Double GetTolerance();
489 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
495 Class : FreeBorders_i
496 Description : Predicate for free borders
498 class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
499 public virtual Predicate_i
503 FunctorType GetFunctorType();
509 Description : Predicate for free edges
511 class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
512 public virtual Predicate_i
516 SMESH::FreeEdges::Borders* GetBorders();
517 FunctorType GetFunctorType();
520 Controls::FreeEdgesPtr myFreeEdgesPtr;
526 Description : Predicate for free faces
528 class SMESH_I_EXPORT FreeFaces_i: public virtual POA_SMESH::FreeFaces,
529 public virtual Predicate_i
533 FunctorType GetFunctorType();
539 Description : Predicate for free nodes
541 class SMESH_I_EXPORT FreeNodes_i: public virtual POA_SMESH::FreeNodes,
542 public virtual Predicate_i
546 FunctorType GetFunctorType();
552 Description : Predicate for Range of Ids
554 class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
555 public virtual Predicate_i
559 void SetRange( const SMESH::long_array& theIds );
560 CORBA::Boolean SetRangeStr( const char* theRange );
563 void SetElementType( ElementType theType );
564 FunctorType GetFunctorType();
567 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
571 Class : LinearOrQuadratic_i
572 Description : Verify whether a mesh element is linear
574 class SMESH_I_EXPORT LinearOrQuadratic_i: public virtual POA_SMESH::LinearOrQuadratic,
575 public virtual Predicate_i
578 LinearOrQuadratic_i();
579 FunctorType GetFunctorType();
580 void SetElementType( ElementType theType );
583 Controls::LinearOrQuadraticPtr myLinearOrQuadraticPtr;
588 Description : Functor for check color of group to whic mesh element belongs to
590 class SMESH_I_EXPORT GroupColor_i: public virtual POA_SMESH::GroupColor,
591 public virtual Predicate_i
595 FunctorType GetFunctorType();
597 void SetElementType( ElementType theType );
598 void SetColorStr( const char* theColor );
602 Controls::GroupColorPtr myGroupColorPtr;
606 Class : ElemGeomType_i
607 Description : Functor for check element geometry type
609 class SMESH_I_EXPORT ElemGeomType_i: public virtual POA_SMESH::ElemGeomType,
610 public virtual Predicate_i
614 FunctorType GetFunctorType();
616 void SetElementType ( ElementType theType );
617 void SetGeometryType( GeometryType theType );
618 GeometryType GetGeometryType() const;
621 Controls::ElemGeomTypePtr myElemGeomTypePtr;
626 Description : Base class for comparators
628 class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
629 public virtual Predicate_i
632 virtual ~Comparator_i();
634 virtual void SetMargin( CORBA::Double );
635 virtual void SetNumFunctor( NumericalFunctor_ptr );
637 Controls::ComparatorPtr GetComparator();
638 NumericalFunctor_i* GetNumFunctor_i();
639 CORBA::Double GetMargin();
644 Controls::ComparatorPtr myComparatorPtr;
645 NumericalFunctor_i* myNumericalFunctor;
651 Description : Comparator "<"
653 class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
654 public virtual Comparator_i
658 FunctorType GetFunctorType();
664 Description : Comparator ">"
666 class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
667 public virtual Comparator_i
671 FunctorType GetFunctorType();
677 Description : Comparator "="
679 class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
680 public virtual Comparator_i
684 virtual void SetTolerance( CORBA::Double );
685 CORBA::Double GetTolerance();
686 FunctorType GetFunctorType();
689 Controls::EqualToPtr myEqualToPtr;
695 Description : Logical NOT predicate
697 class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
698 public virtual Predicate_i
702 virtual ~LogicalNOT_i();
704 virtual void SetPredicate( Predicate_ptr );
705 Predicate_i* GetPredicate_i();
706 FunctorType GetFunctorType();
709 Controls::LogicalNOTPtr myLogicalNOTPtr;
710 Predicate_i* myPredicate;
715 Class : LogicalBinary_i
716 Description : Base class for binary logical predicate
718 class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
719 public virtual Predicate_i
722 virtual ~LogicalBinary_i();
723 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
724 virtual void SetPredicate1( Predicate_ptr );
725 virtual void SetPredicate2( Predicate_ptr );
727 Controls::LogicalBinaryPtr GetLogicalBinary();
728 Predicate_i* GetPredicate1_i();
729 Predicate_i* GetPredicate2_i();
734 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
735 Predicate_i* myPredicate1;
736 Predicate_i* myPredicate2;
742 Description : Logical AND
744 class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
745 public virtual LogicalBinary_i
749 FunctorType GetFunctorType();
755 Description : Logical OR
757 class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
758 public virtual LogicalBinary_i
762 FunctorType GetFunctorType();
769 class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
770 public virtual SALOME::GenericObj_i
778 SetPredicate( Predicate_ptr );
782 SetMesh( SMESH_Mesh_ptr );
794 GetElementsId( Predicate_i*,
796 Controls::Filter::TIdSequence& );
799 GetElementsId( Predicate_i*,
801 Controls::Filter::TIdSequence& );
805 GetElementsId( SMESH_Mesh_ptr );
813 GetCriteria( SMESH::Filter::Criteria_out theCriteria );
817 SetCriteria( const SMESH::Filter::Criteria& theCriteria );
823 Predicate_i* GetPredicate_i();
826 Controls::Filter myFilter;
827 Predicate_i* myPredicate;
828 SMESH_Mesh_var myMesh;
835 class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
836 public virtual SALOME::GenericObj_i
839 FilterLibrary_i( const char* theFileName );
843 Filter_ptr Copy( const char* theFilterName );
845 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
846 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
847 CORBA::Boolean Delete ( const char* theFilterName );
848 CORBA::Boolean Replace ( const char* theFilterName,
849 const char* theNewName,
850 Filter_ptr theFilter );
852 CORBA::Boolean Save();
853 CORBA::Boolean SaveAs( const char* aFileName );
855 CORBA::Boolean IsPresent( const char* aFilterName );
856 CORBA::Long NbFilters( ElementType );
857 string_array* GetNames( ElementType );
858 string_array* GetAllNames();
859 void SetFileName( const char* theFileName );
865 FilterManager_var myFilterMgr;
873 class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
874 public virtual SALOME::GenericObj_i
880 MinimumAngle_ptr CreateMinimumAngle();
881 AspectRatio_ptr CreateAspectRatio();
882 AspectRatio3D_ptr CreateAspectRatio3D();
883 Warping_ptr CreateWarping();
884 Taper_ptr CreateTaper();
885 Skew_ptr CreateSkew();
886 Area_ptr CreateArea();
887 Volume3D_ptr CreateVolume3D();
888 Length_ptr CreateLength();
889 Length2D_ptr CreateLength2D();
890 MultiConnection_ptr CreateMultiConnection();
891 MultiConnection2D_ptr CreateMultiConnection2D();
893 BelongToGeom_ptr CreateBelongToGeom();
894 BelongToPlane_ptr CreateBelongToPlane();
895 BelongToCylinder_ptr CreateBelongToCylinder();
896 BelongToGenSurface_ptr CreateBelongToGenSurface();
898 LyingOnGeom_ptr CreateLyingOnGeom();
900 FreeBorders_ptr CreateFreeBorders();
901 FreeEdges_ptr CreateFreeEdges();
902 FreeNodes_ptr CreateFreeNodes();
903 FreeFaces_ptr CreateFreeFaces();
905 RangeOfIds_ptr CreateRangeOfIds();
907 BadOrientedVolume_ptr CreateBadOrientedVolume();
908 LinearOrQuadratic_ptr CreateLinearOrQuadratic();
910 GroupColor_ptr CreateGroupColor();
912 ElemGeomType_ptr CreateElemGeomType();
914 LessThan_ptr CreateLessThan();
915 MoreThan_ptr CreateMoreThan();
916 EqualTo_ptr CreateEqualTo();
918 LogicalNOT_ptr CreateLogicalNOT();
919 LogicalAND_ptr CreateLogicalAND();
920 LogicalOR_ptr CreateLogicalOR();
922 Filter_ptr CreateFilter();
924 FilterLibrary_ptr LoadLibrary( const char* aFileName );
925 FilterLibrary_ptr CreateLibrary();
926 CORBA::Boolean DeleteLibrary( const char* aFileName );
931 GetPredicate( SMESH::Predicate_ptr thePredicate );