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();
396 void SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
397 CORBA::Boolean GetUseBoundaries();
400 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
403 Handle(Standard_Type) mySurfaceType;
407 Class : BelongToPlane_i
408 Description : Verify whether mesh element lie in pointed Geom planar object
410 class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
411 public virtual BelongToSurface_i
415 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
416 FunctorType GetFunctorType();
420 Class : BelongToCylinder_i
421 Description : Verify whether mesh element lie in pointed Geom cylindrical object
423 class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
424 public virtual BelongToSurface_i
427 BelongToCylinder_i();
428 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
429 FunctorType GetFunctorType();
433 Class : BelongToGenSurface_i
434 Description : Verify whether mesh element lie on pointed Geom surfasic object
436 class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
437 public virtual BelongToSurface_i
440 BelongToGenSurface_i();
441 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
442 FunctorType GetFunctorType();
446 Class : LyingOnGeom_i
447 Description : Predicate for selection on geometrical support(lying or partially lying)
449 class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
450 public virtual Predicate_i
454 virtual ~LyingOnGeom_i();
456 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
457 void SetElementType( ElementType theType );
458 FunctorType GetFunctorType();
460 void SetGeom( const TopoDS_Shape& theShape );
462 void SetShapeName( const char* theName );
463 void SetShape( const char* theID, const char* theName );
464 char* GetShapeName();
468 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
474 Class : FreeBorders_i
475 Description : Predicate for free borders
477 class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders,
478 public virtual Predicate_i
482 FunctorType GetFunctorType();
488 Description : Predicate for free edges
490 class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges,
491 public virtual Predicate_i
495 SMESH::FreeEdges::Borders* GetBorders();
496 FunctorType GetFunctorType();
499 Controls::FreeEdgesPtr myFreeEdgesPtr;
505 Description : Predicate for Range of Ids
507 class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
508 public virtual Predicate_i
512 void SetRange( const SMESH::long_array& theIds );
513 CORBA::Boolean SetRangeStr( const char* theRange );
516 void SetElementType( ElementType theType );
517 FunctorType GetFunctorType();
520 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
525 Description : Base class for comparators
527 class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator,
528 public virtual Predicate_i
531 virtual ~Comparator_i();
533 virtual void SetMargin( CORBA::Double );
534 virtual void SetNumFunctor( NumericalFunctor_ptr );
536 Controls::ComparatorPtr GetComparator();
537 NumericalFunctor_i* GetNumFunctor_i();
538 CORBA::Double GetMargin();
543 Controls::ComparatorPtr myComparatorPtr;
544 NumericalFunctor_i* myNumericalFunctor;
550 Description : Comparator "<"
552 class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan,
553 public virtual Comparator_i
557 FunctorType GetFunctorType();
563 Description : Comparator ">"
565 class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan,
566 public virtual Comparator_i
570 FunctorType GetFunctorType();
576 Description : Comparator "="
578 class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo,
579 public virtual Comparator_i
583 virtual void SetTolerance( CORBA::Double );
584 CORBA::Double GetTolerance();
585 FunctorType GetFunctorType();
588 Controls::EqualToPtr myEqualToPtr;
594 Description : Logical NOT predicate
596 class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
597 public virtual Predicate_i
601 virtual ~LogicalNOT_i();
603 virtual void SetPredicate( Predicate_ptr );
604 Predicate_i* GetPredicate_i();
605 FunctorType GetFunctorType();
608 Controls::LogicalNOTPtr myLogicalNOTPtr;
609 Predicate_i* myPredicate;
614 Class : LogicalBinary_i
615 Description : Base class for binary logical predicate
617 class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
618 public virtual Predicate_i
621 virtual ~LogicalBinary_i();
622 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
623 virtual void SetPredicate1( Predicate_ptr );
624 virtual void SetPredicate2( Predicate_ptr );
626 Controls::LogicalBinaryPtr GetLogicalBinary();
627 Predicate_i* GetPredicate1_i();
628 Predicate_i* GetPredicate2_i();
633 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
634 Predicate_i* myPredicate1;
635 Predicate_i* myPredicate2;
641 Description : Logical AND
643 class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND,
644 public virtual LogicalBinary_i
648 FunctorType GetFunctorType();
654 Description : Logical OR
656 class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR,
657 public virtual LogicalBinary_i
661 FunctorType GetFunctorType();
668 class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter,
669 public virtual SALOME::GenericObj_i
677 SetPredicate( Predicate_ptr );
681 SetMesh( SMESH_Mesh_ptr );
689 GetElementsId( Predicate_i*,
691 Controls::Filter::TIdSequence& );
694 GetElementsId( Predicate_i*,
696 Controls::Filter::TIdSequence& );
700 GetElementsId( SMESH_Mesh_ptr );
708 GetCriteria( SMESH::Filter::Criteria_out theCriteria );
712 SetCriteria( const SMESH::Filter::Criteria& theCriteria );
718 Predicate_i* GetPredicate_i();
721 Controls::Filter myFilter;
722 Predicate_i* myPredicate;
723 SMESH_Mesh_var myMesh;
730 class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
731 public virtual SALOME::GenericObj_i
734 FilterLibrary_i( const char* theFileName );
738 Filter_ptr Copy( const char* theFilterName );
740 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
741 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
742 CORBA::Boolean Delete ( const char* theFilterName );
743 CORBA::Boolean Replace ( const char* theFilterName,
744 const char* theNewName,
745 Filter_ptr theFilter );
747 CORBA::Boolean Save();
748 CORBA::Boolean SaveAs( const char* aFileName );
750 CORBA::Boolean IsPresent( const char* aFilterName );
751 CORBA::Long NbFilters( ElementType );
752 string_array* GetNames( ElementType );
753 string_array* GetAllNames();
754 void SetFileName( const char* theFileName );
760 FilterManager_var myFilterMgr;
768 class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager,
769 public virtual SALOME::GenericObj_i
775 MinimumAngle_ptr CreateMinimumAngle();
776 AspectRatio_ptr CreateAspectRatio();
777 AspectRatio3D_ptr CreateAspectRatio3D();
778 Warping_ptr CreateWarping();
779 Taper_ptr CreateTaper();
780 Skew_ptr CreateSkew();
781 Area_ptr CreateArea();
782 Volume3D_ptr CreateVolume3D();
783 Length_ptr CreateLength();
784 Length2D_ptr CreateLength2D();
785 MultiConnection_ptr CreateMultiConnection();
786 MultiConnection2D_ptr CreateMultiConnection2D();
788 BelongToGeom_ptr CreateBelongToGeom();
789 BelongToPlane_ptr CreateBelongToPlane();
790 BelongToCylinder_ptr CreateBelongToCylinder();
791 BelongToGenSurface_ptr CreateBelongToGenSurface();
793 LyingOnGeom_ptr CreateLyingOnGeom();
795 FreeBorders_ptr CreateFreeBorders();
796 FreeEdges_ptr CreateFreeEdges();
798 RangeOfIds_ptr CreateRangeOfIds();
800 BadOrientedVolume_ptr CreateBadOrientedVolume();
802 LessThan_ptr CreateLessThan();
803 MoreThan_ptr CreateMoreThan();
804 EqualTo_ptr CreateEqualTo();
806 LogicalNOT_ptr CreateLogicalNOT();
807 LogicalAND_ptr CreateLogicalAND();
808 LogicalOR_ptr CreateLogicalOR();
810 Filter_ptr CreateFilter();
812 FilterLibrary_ptr LoadLibrary( const char* aFileName );
813 FilterLibrary_ptr CreateLibrary();
814 CORBA::Boolean DeleteLibrary( const char* aFileName );
819 GetPredicate( SMESH::Predicate_ptr thePredicate );