1 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
3 // Copyright (C) 2003 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
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;
73 const SMESHDS_Mesh* myMeshDS;
74 SMDSAbs_ElementType myType;
76 typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
80 Description : Predicate for verifying whether entiy lying or partially lying on
81 specified geometrical support
83 class SMESH_I_EXPORT LyingOnGeom: public virtual Predicate
88 virtual void SetMesh( const SMDS_Mesh* theMesh );
89 virtual void SetGeom( const TopoDS_Shape& theShape );
91 virtual bool IsSatisfy( long theElementId );
93 virtual void SetType( SMDSAbs_ElementType theType );
94 virtual SMDSAbs_ElementType GetType() const;
96 TopoDS_Shape GetShape();
97 const SMESHDS_Mesh* GetMeshDS() const;
99 virtual bool Contains( const SMESHDS_Mesh* theMeshDS,
100 const TopoDS_Shape& theShape,
101 const SMDS_MeshElement* theElem,
102 TopAbs_ShapeEnum theFindShapeEnum,
103 TopAbs_ShapeEnum theAvoidShapeEnum = TopAbs_SHAPE );
105 TopoDS_Shape myShape;
106 const SMESHDS_Mesh* myMeshDS;
107 SMDSAbs_ElementType myType;
109 typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
118 Description : An abstact class for all functors
120 class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor,
121 public virtual SALOME::GenericObj_i
124 void SetMesh( SMESH_Mesh_ptr theMesh );
125 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
126 ElementType GetElementType();
132 Controls::FunctorPtr myFunctorPtr;
136 Class : NumericalFunctor_i
137 Description : Base class for numerical functors
139 class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
140 public virtual Functor_i
143 CORBA::Double GetValue( CORBA::Long theElementId );
144 void SetPrecision( CORBA::Long thePrecision );
145 CORBA::Long GetPrecision();
146 Controls::NumericalFunctorPtr GetNumericalFunctor();
149 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
154 Class : SMESH_MinimumAngleFunct
155 Description : Functor for calculation of minimum angle
157 class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
158 public virtual NumericalFunctor_i
162 FunctorType GetFunctorType();
167 Class : AspectRatio_i
168 Description : Functor for calculating aspect ratio
170 class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio,
171 public virtual NumericalFunctor_i
175 FunctorType GetFunctorType();
180 Class : AspectRatio3D_i
181 Description : Functor for calculating aspect ratio for 3D
183 class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
184 public virtual NumericalFunctor_i
188 FunctorType GetFunctorType();
194 Description : Functor for calculating warping
196 class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping,
197 public virtual NumericalFunctor_i
201 FunctorType GetFunctorType();
207 Description : Functor for calculating taper
209 class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper,
210 public virtual NumericalFunctor_i
214 FunctorType GetFunctorType();
220 Description : Functor for calculating skew in degrees
222 class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew,
223 public virtual NumericalFunctor_i
227 FunctorType GetFunctorType();
233 Description : Functor for calculating area
235 class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area,
236 public virtual NumericalFunctor_i
240 FunctorType GetFunctorType();
246 Description : Functor for calculating volume of 3D element
248 class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D,
249 public virtual NumericalFunctor_i
253 FunctorType GetFunctorType();
259 Description : Functor for calculating length of edge
261 class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length,
262 public virtual NumericalFunctor_i
266 FunctorType GetFunctorType();
271 Description : Functor for calculating length of edge
273 class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D,
274 public virtual NumericalFunctor_i
278 SMESH::Length2D::Values* GetValues();
279 FunctorType GetFunctorType();
282 Controls::Length2DPtr myLength2DPtr;
287 Class : MultiConnection_i
288 Description : Functor for calculating number of faces conneted to the edge
290 class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection,
291 public virtual NumericalFunctor_i
295 FunctorType GetFunctorType();
299 Class : MultiConnection2D_i
300 Description : Functor for calculating number of faces conneted to the edge
302 class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
303 public virtual NumericalFunctor_i
306 MultiConnection2D_i();
307 SMESH::MultiConnection2D::Values* GetValues();
308 FunctorType GetFunctorType();
311 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
320 Description : Base class for all predicates
322 class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate,
323 public virtual Functor_i
326 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
327 Controls::PredicatePtr GetPredicate();
330 Controls::PredicatePtr myPredicatePtr;
335 Class : BadOrientedVolume_i
336 Description : Verify whether a mesh volume is incorrectly oriented from
337 the point of view of MED convention
339 class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
340 public virtual Predicate_i
343 BadOrientedVolume_i();
344 FunctorType GetFunctorType();
348 Class : BelongToGeom_i
349 Description : Predicate for selection on geometrical support
351 class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
352 public virtual Predicate_i
356 virtual ~BelongToGeom_i();
358 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
359 void SetElementType( ElementType theType );
360 FunctorType GetFunctorType();
362 void SetGeom( const TopoDS_Shape& theShape );
364 void SetShapeName( const char* theName );
365 void SetShape( const char* theID, const char* theName );
366 char* GetShapeName();
370 Controls::BelongToGeomPtr myBelongToGeomPtr;
376 Class : BelongToSurface_i
377 Description : Verify whether mesh element lie in pointed Geom planar object
379 class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
380 public virtual Predicate_i
383 BelongToSurface_i( const Handle(Standard_Type)& );
384 virtual ~BelongToSurface_i();
386 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
388 void SetShapeName( const char* theName, ElementType theType );
389 void SetShape( const char* theID, const char* theName, ElementType theType );
390 char* GetShapeName();
393 void SetTolerance( CORBA::Double );
394 CORBA::Double GetTolerance();
397 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
400 Handle(Standard_Type) mySurfaceType;
404 Class : BelongToPlane_i
405 Description : Verify whether mesh element lie in pointed Geom planar object
407 class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
408 public virtual BelongToSurface_i
412 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
413 FunctorType GetFunctorType();
417 Class : BelongToCylinder_i
418 Description : Verify whether mesh element lie in pointed Geom cylindrical object
420 class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
421 public virtual BelongToSurface_i
424 BelongToCylinder_i();
425 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
426 FunctorType GetFunctorType();
430 Class : LyingOnGeom_i
431 Description : Predicate for selection on geometrical support(lying or partially lying)
433 class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
434 public virtual Predicate_i
438 virtual ~LyingOnGeom_i();
440 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
441 void SetElementType( ElementType theType );
442 FunctorType GetFunctorType();
444 void SetGeom( const TopoDS_Shape& theShape );
446 void SetShapeName( const char* theName );
447 void SetShape( const char* theID, const char* theName );
448 char* GetShapeName();
452 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
458 Class : FreeBorders_i
459 Description : Predicate for free borders
461 class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
462 public virtual Predicate_i
466 FunctorType GetFunctorType();
472 Description : Predicate for free edges
474 class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
475 public virtual Predicate_i
479 SMESH::FreeEdges::Borders* GetBorders();
480 FunctorType GetFunctorType();
483 Controls::FreeEdgesPtr myFreeEdgesPtr;
489 Description : Predicate for Range of Ids
491 class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
492 public virtual Predicate_i
496 void SetRange( const SMESH::long_array& theIds );
497 CORBA::Boolean SetRangeStr( const char* theRange );
500 void SetElementType( ElementType theType );
501 FunctorType GetFunctorType();
504 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
509 Description : Base class for comparators
511 class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
512 public virtual Predicate_i
515 virtual ~Comparator_i();
517 virtual void SetMargin( CORBA::Double );
518 virtual void SetNumFunctor( NumericalFunctor_ptr );
520 Controls::ComparatorPtr GetComparator();
521 NumericalFunctor_i* GetNumFunctor_i();
522 CORBA::Double GetMargin();
527 Controls::ComparatorPtr myComparatorPtr;
528 NumericalFunctor_i* myNumericalFunctor;
534 Description : Comparator "<"
536 class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
537 public virtual Comparator_i
541 FunctorType GetFunctorType();
547 Description : Comparator ">"
549 class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
550 public virtual Comparator_i
554 FunctorType GetFunctorType();
560 Description : Comparator "="
562 class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
563 public virtual Comparator_i
567 virtual void SetTolerance( CORBA::Double );
568 CORBA::Double GetTolerance();
569 FunctorType GetFunctorType();
572 Controls::EqualToPtr myEqualToPtr;
578 Description : Logical NOT predicate
580 class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
581 public virtual Predicate_i
585 virtual ~LogicalNOT_i();
587 virtual void SetPredicate( Predicate_ptr );
588 Predicate_i* GetPredicate_i();
589 FunctorType GetFunctorType();
592 Controls::LogicalNOTPtr myLogicalNOTPtr;
593 Predicate_i* myPredicate;
598 Class : LogicalBinary_i
599 Description : Base class for binary logical predicate
601 class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
602 public virtual Predicate_i
605 virtual ~LogicalBinary_i();
606 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
607 virtual void SetPredicate1( Predicate_ptr );
608 virtual void SetPredicate2( Predicate_ptr );
610 Controls::LogicalBinaryPtr GetLogicalBinary();
611 Predicate_i* GetPredicate1_i();
612 Predicate_i* GetPredicate2_i();
617 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
618 Predicate_i* myPredicate1;
619 Predicate_i* myPredicate2;
625 Description : Logical AND
627 class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
628 public virtual LogicalBinary_i
632 FunctorType GetFunctorType();
638 Description : Logical OR
640 class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
641 public virtual LogicalBinary_i
645 FunctorType GetFunctorType();
652 class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
653 public virtual SALOME::GenericObj_i
661 SetPredicate( Predicate_ptr );
665 SetMesh( SMESH_Mesh_ptr );
673 GetElementsId( Predicate_i*,
675 Controls::Filter::TIdSequence& );
678 GetElementsId( Predicate_i*,
680 Controls::Filter::TIdSequence& );
684 GetElementsId( SMESH_Mesh_ptr );
692 GetCriteria( SMESH::Filter::Criteria_out theCriteria );
696 SetCriteria( const SMESH::Filter::Criteria& theCriteria );
702 Predicate_i* GetPredicate_i();
705 Controls::Filter myFilter;
706 Predicate_i* myPredicate;
707 SMESH_Mesh_var myMesh;
714 class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
715 public virtual SALOME::GenericObj_i
718 FilterLibrary_i( const char* theFileName );
722 Filter_ptr Copy( const char* theFilterName );
724 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
725 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
726 CORBA::Boolean Delete ( const char* theFilterName );
727 CORBA::Boolean Replace ( const char* theFilterName,
728 const char* theNewName,
729 Filter_ptr theFilter );
731 CORBA::Boolean Save();
732 CORBA::Boolean SaveAs( const char* aFileName );
734 CORBA::Boolean IsPresent( const char* aFilterName );
735 CORBA::Long NbFilters( ElementType );
736 string_array* GetNames( ElementType );
737 string_array* GetAllNames();
738 void SetFileName( const char* theFileName );
744 FilterManager_var myFilterMgr;
752 class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
753 public virtual SALOME::GenericObj_i
759 MinimumAngle_ptr CreateMinimumAngle();
760 AspectRatio_ptr CreateAspectRatio();
761 AspectRatio3D_ptr CreateAspectRatio3D();
762 Warping_ptr CreateWarping();
763 Taper_ptr CreateTaper();
764 Skew_ptr CreateSkew();
765 Area_ptr CreateArea();
766 Volume3D_ptr CreateVolume3D();
767 Length_ptr CreateLength();
768 Length2D_ptr CreateLength2D();
769 MultiConnection_ptr CreateMultiConnection();
770 MultiConnection2D_ptr CreateMultiConnection2D();
772 BelongToGeom_ptr CreateBelongToGeom();
773 BelongToPlane_ptr CreateBelongToPlane();
774 BelongToCylinder_ptr CreateBelongToCylinder();
776 LyingOnGeom_ptr CreateLyingOnGeom();
778 FreeBorders_ptr CreateFreeBorders();
779 FreeEdges_ptr CreateFreeEdges();
781 RangeOfIds_ptr CreateRangeOfIds();
783 BadOrientedVolume_ptr CreateBadOrientedVolume();
785 LessThan_ptr CreateLessThan();
786 MoreThan_ptr CreateMoreThan();
787 EqualTo_ptr CreateEqualTo();
789 LogicalNOT_ptr CreateLogicalNOT();
790 LogicalAND_ptr CreateLogicalAND();
791 LogicalOR_ptr CreateLogicalOR();
793 Filter_ptr CreateFilter();
795 FilterLibrary_ptr LoadLibrary( const char* aFileName );
796 FilterLibrary_ptr CreateLibrary();
797 CORBA::Boolean DeleteLibrary( const char* aFileName );
802 GetPredicate( SMESH::Predicate_ptr thePredicate );