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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_Filter_i.hxx
25 // Author : Alexey Petrov, OCC
28 #ifndef _SMESH_FILTER_I_HXX_
29 #define _SMESH_FILTER_I_HXX_
31 #include <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(SMESH_Filter)
34 #include <LDOM_Document.hxx>
35 #include <TopoDS_Shape.hxx>
37 #include "SALOME_GenericObj_i.hh"
38 #include "SMESH_ControlsDef.hxx"
50 Description : Predicate for verifying whether entiy belong to
51 specified geometrical support
53 class BelongToGeom: public virtual Predicate
58 virtual void SetMesh( SMDS_Mesh* theMesh );
59 virtual void SetGeom( const TopoDS_Shape& theShape );
61 virtual bool IsSatisfy( long theElementId );
63 virtual void SetType( SMDSAbs_ElementType theType );
64 virtual SMDSAbs_ElementType GetType() const;
66 TopoDS_Shape GetShape();
67 SMESHDS_Mesh* GetMeshDS();
71 SMESHDS_Mesh* myMeshDS;
72 SMDSAbs_ElementType myType;
74 typedef boost::shared_ptr<BelongToGeom> BelongToGeomPtr;
78 Description : Predicate for verifying whether entiy lying or partially lying on
79 specified geometrical support
81 class LyingOnGeom: public virtual Predicate
86 virtual void SetMesh( SMDS_Mesh* theMesh );
87 virtual void SetGeom( const TopoDS_Shape& theShape );
89 virtual bool IsSatisfy( long theElementId );
91 virtual void SetType( SMDSAbs_ElementType theType );
92 virtual SMDSAbs_ElementType GetType() const;
94 TopoDS_Shape GetShape();
95 SMESHDS_Mesh* GetMeshDS();
97 virtual bool Contains( SMESHDS_Mesh* theMeshDS,
98 const TopoDS_Shape& theShape,
99 const SMDS_MeshElement* theElem,
100 TopAbs_ShapeEnum theFindShapeEnum,
101 TopAbs_ShapeEnum theAvoidShapeEnum = TopAbs_SHAPE );
103 TopoDS_Shape myShape;
104 SMESHDS_Mesh* myMeshDS;
105 SMDSAbs_ElementType myType;
107 typedef boost::shared_ptr<LyingOnGeom> LyingOnGeomPtr;
116 Description : An abstact class for all functors
118 class Functor_i: public virtual POA_SMESH::Functor,
119 public virtual SALOME::GenericObj_i
122 void SetMesh( SMESH_Mesh_ptr theMesh );
123 Controls::FunctorPtr GetFunctor(){ return myFunctorPtr;}
124 ElementType GetElementType();
129 Controls::FunctorPtr myFunctorPtr;
134 Class : NumericalFunctor_i
135 Description : Base class for numerical functors
137 class NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor,
138 public virtual Functor_i
141 CORBA::Double GetValue( CORBA::Long theElementId );
142 void SetPrecision( CORBA::Long thePrecision );
143 CORBA::Long GetPrecision();
144 Controls::NumericalFunctorPtr GetNumericalFunctor();
147 Controls::NumericalFunctorPtr myNumericalFunctorPtr;
152 Class : SMESH_MinimumAngleFunct
153 Description : Functor for calculation of minimum angle
155 class MinimumAngle_i: public virtual POA_SMESH::MinimumAngle,
156 public virtual NumericalFunctor_i
160 FunctorType GetFunctorType();
165 Class : AspectRatio_i
166 Description : Functor for calculating aspect ratio
168 class AspectRatio_i: public virtual POA_SMESH::AspectRatio,
169 public virtual NumericalFunctor_i
173 FunctorType GetFunctorType();
178 Class : AspectRatio3D_i
179 Description : Functor for calculating aspect ratio for 3D
181 class AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D,
182 public virtual NumericalFunctor_i
186 FunctorType GetFunctorType();
192 Description : Functor for calculating warping
194 class Warping_i: public virtual POA_SMESH::Warping,
195 public virtual NumericalFunctor_i
199 FunctorType GetFunctorType();
205 Description : Functor for calculating taper
207 class Taper_i: public virtual POA_SMESH::Taper,
208 public virtual NumericalFunctor_i
212 FunctorType GetFunctorType();
218 Description : Functor for calculating skew in degrees
220 class Skew_i: public virtual POA_SMESH::Skew,
221 public virtual NumericalFunctor_i
225 FunctorType GetFunctorType();
231 Description : Functor for calculating area
233 class Area_i: public virtual POA_SMESH::Area,
234 public virtual NumericalFunctor_i
238 FunctorType GetFunctorType();
244 Description : Functor for calculating length of edge
246 class Length_i: public virtual POA_SMESH::Length,
247 public virtual NumericalFunctor_i
251 FunctorType GetFunctorType();
256 Description : Functor for calculating length of edge
258 class Length2D_i: public virtual POA_SMESH::Length2D,
259 public virtual NumericalFunctor_i
263 SMESH::Length2D::Values* GetValues();
264 FunctorType GetFunctorType();
267 Controls::Length2DPtr myLength2DPtr;
272 Class : MultiConnection_i
273 Description : Functor for calculating number of faces conneted to the edge
275 class MultiConnection_i: public virtual POA_SMESH::MultiConnection,
276 public virtual NumericalFunctor_i
280 FunctorType GetFunctorType();
284 Class : MultiConnection2D_i
285 Description : Functor for calculating number of faces conneted to the edge
287 class MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D,
288 public virtual NumericalFunctor_i
291 MultiConnection2D_i();
292 SMESH::MultiConnection2D::Values* GetValues();
293 FunctorType GetFunctorType();
296 Controls::MultiConnection2DPtr myMulticonnection2DPtr;
305 Description : Base class for all predicates
307 class Predicate_i: public virtual POA_SMESH::Predicate,
308 public virtual Functor_i
311 CORBA::Boolean IsSatisfy( CORBA::Long theElementId );
312 Controls::PredicatePtr GetPredicate();
315 Controls::PredicatePtr myPredicatePtr;
320 Class : BadOrientedVolume_i
321 Description : Verify whether a mesh volume is incorrectly oriented from
322 the point of view of MED convention
324 class BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume,
325 public virtual Predicate_i
328 BadOrientedVolume_i();
329 FunctorType GetFunctorType();
333 Class : BelongToGeom_i
334 Description : Predicate for selection on geometrical support
336 class BelongToGeom_i: public virtual POA_SMESH::BelongToGeom,
337 public virtual Predicate_i
341 virtual ~BelongToGeom_i();
343 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
344 void SetElementType( ElementType theType );
345 FunctorType GetFunctorType();
347 void SetGeom( const TopoDS_Shape& theShape );
349 void SetShapeName( const char* theName );
350 void SetShape( const char* theID, const char* theName );
351 char* GetShapeName();
355 Controls::BelongToGeomPtr myBelongToGeomPtr;
361 Class : BelongToSurface_i
362 Description : Verify whether mesh element lie in pointed Geom planar object
364 class BelongToSurface_i: public virtual POA_SMESH::BelongToSurface,
365 public virtual Predicate_i
368 BelongToSurface_i( const Handle(Standard_Type)& );
369 virtual ~BelongToSurface_i();
371 void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
373 void SetShapeName( const char* theName, ElementType theType );
374 void SetShape( const char* theID, const char* theName, ElementType theType );
375 char* GetShapeName();
378 void SetTolerance( CORBA::Double );
379 CORBA::Double GetTolerance();
382 Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
385 Handle(Standard_Type) mySurfaceType;
389 Class : BelongToPlane_i
390 Description : Verify whether mesh element lie in pointed Geom planar object
392 class BelongToPlane_i: public virtual POA_SMESH::BelongToPlane,
393 public virtual BelongToSurface_i
397 void SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
398 FunctorType GetFunctorType();
402 Class : BelongToCylinder_i
403 Description : Verify whether mesh element lie in pointed Geom cylindrical object
405 class BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder,
406 public virtual BelongToSurface_i
409 BelongToCylinder_i();
410 void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
411 FunctorType GetFunctorType();
415 Class : LyingOnGeom_i
416 Description : Predicate for selection on geometrical support(lying or partially lying)
418 class LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom,
419 public virtual Predicate_i
423 virtual ~LyingOnGeom_i();
425 void SetGeom( GEOM::GEOM_Object_ptr theGeom );
426 void SetElementType( ElementType theType );
427 FunctorType GetFunctorType();
429 void SetGeom( const TopoDS_Shape& theShape );
431 void SetShapeName( const char* theName );
432 void SetShape( const char* theID, const char* theName );
433 char* GetShapeName();
437 Controls::LyingOnGeomPtr myLyingOnGeomPtr;
443 Class : FreeBorders_i
444 Description : Predicate for free borders
446 class FreeBorders_i: public virtual POA_SMESH::FreeBorders,
447 public virtual Predicate_i
451 FunctorType GetFunctorType();
457 Description : Predicate for free edges
459 class FreeEdges_i: public virtual POA_SMESH::FreeEdges,
460 public virtual Predicate_i
464 SMESH::FreeEdges::Borders* GetBorders();
465 FunctorType GetFunctorType();
468 Controls::FreeEdgesPtr myFreeEdgesPtr;
474 Description : Predicate for Range of Ids
476 class RangeOfIds_i: public virtual POA_SMESH::RangeOfIds,
477 public virtual Predicate_i
481 void SetRange( const SMESH::long_array& theIds );
482 CORBA::Boolean SetRangeStr( const char* theRange );
485 void SetElementType( ElementType theType );
486 FunctorType GetFunctorType();
489 Controls::RangeOfIdsPtr myRangeOfIdsPtr;
494 Description : Base class for comparators
496 class Comparator_i: public virtual POA_SMESH::Comparator,
497 public virtual Predicate_i
500 virtual ~Comparator_i();
502 virtual void SetMargin( CORBA::Double );
503 virtual void SetNumFunctor( NumericalFunctor_ptr );
505 Controls::ComparatorPtr GetComparator();
506 NumericalFunctor_i* GetNumFunctor_i();
507 CORBA::Double GetMargin();
512 Controls::ComparatorPtr myComparatorPtr;
513 NumericalFunctor_i* myNumericalFunctor;
519 Description : Comparator "<"
521 class LessThan_i: public virtual POA_SMESH::LessThan,
522 public virtual Comparator_i
526 FunctorType GetFunctorType();
532 Description : Comparator ">"
534 class MoreThan_i: public virtual POA_SMESH::MoreThan,
535 public virtual Comparator_i
539 FunctorType GetFunctorType();
545 Description : Comparator "="
547 class EqualTo_i: public virtual POA_SMESH::EqualTo,
548 public virtual Comparator_i
552 virtual void SetTolerance( CORBA::Double );
553 CORBA::Double GetTolerance();
554 FunctorType GetFunctorType();
557 Controls::EqualToPtr myEqualToPtr;
563 Description : Logical NOT predicate
565 class LogicalNOT_i: public virtual POA_SMESH::LogicalNOT,
566 public virtual Predicate_i
570 virtual ~LogicalNOT_i();
572 virtual void SetPredicate( Predicate_ptr );
573 Predicate_i* GetPredicate_i();
574 FunctorType GetFunctorType();
577 Controls::LogicalNOTPtr myLogicalNOTPtr;
578 Predicate_i* myPredicate;
583 Class : LogicalBinary_i
584 Description : Base class for binary logical predicate
586 class LogicalBinary_i: public virtual POA_SMESH::LogicalBinary,
587 public virtual Predicate_i
590 virtual ~LogicalBinary_i();
591 virtual void SetMesh( SMESH_Mesh_ptr theMesh );
592 virtual void SetPredicate1( Predicate_ptr );
593 virtual void SetPredicate2( Predicate_ptr );
595 Controls::LogicalBinaryPtr GetLogicalBinary();
596 Predicate_i* GetPredicate1_i();
597 Predicate_i* GetPredicate2_i();
602 Controls::LogicalBinaryPtr myLogicalBinaryPtr;
603 Predicate_i* myPredicate1;
604 Predicate_i* myPredicate2;
610 Description : Logical AND
612 class LogicalAND_i: public virtual POA_SMESH::LogicalAND,
613 public virtual LogicalBinary_i
617 FunctorType GetFunctorType();
623 Description : Logical OR
625 class LogicalOR_i: public virtual POA_SMESH::LogicalOR,
626 public virtual LogicalBinary_i
630 FunctorType GetFunctorType();
637 class Filter_i: public virtual POA_SMESH::Filter,
638 public virtual SALOME::GenericObj_i
644 void SetPredicate( Predicate_ptr );
645 void SetMesh( SMESH_Mesh_ptr );
647 long_array* GetElementsId( SMESH_Mesh_ptr );
648 ElementType GetElementType();
650 CORBA::Boolean GetCriteria( SMESH::Filter::Criteria_out theCriteria );
651 CORBA::Boolean SetCriteria( const SMESH::Filter::Criteria& theCriteria );
653 Predicate_ptr GetPredicate();
654 Predicate_i* GetPredicate_i();
657 Controls::Filter myFilter;
658 Predicate_i* myPredicate;
665 class FilterLibrary_i: public virtual POA_SMESH::FilterLibrary,
666 public virtual SALOME::GenericObj_i
669 FilterLibrary_i( const char* theFileName );
673 Filter_ptr Copy( const char* theFilterName );
675 CORBA::Boolean Add ( const char* theFilterName, Filter_ptr theFilter );
676 CORBA::Boolean AddEmpty( const char* theFilterName, ElementType theType );
677 CORBA::Boolean Delete ( const char* theFilterName );
678 CORBA::Boolean Replace ( const char* theFilterName,
679 const char* theNewName,
680 Filter_ptr theFilter );
682 CORBA::Boolean Save();
683 CORBA::Boolean SaveAs( const char* aFileName );
685 CORBA::Boolean IsPresent( const char* aFilterName );
686 CORBA::Long NbFilters( ElementType );
687 string_array* GetNames( ElementType );
688 string_array* GetAllNames();
689 void SetFileName( const char* theFileName );
695 FilterManager_var myFilterMgr;
703 class FilterManager_i: public virtual POA_SMESH::FilterManager,
704 public virtual SALOME::GenericObj_i
708 MinimumAngle_ptr CreateMinimumAngle();
709 AspectRatio_ptr CreateAspectRatio();
710 AspectRatio3D_ptr CreateAspectRatio3D();
711 Warping_ptr CreateWarping();
712 Taper_ptr CreateTaper();
713 Skew_ptr CreateSkew();
714 Area_ptr CreateArea();
715 Length_ptr CreateLength();
716 Length2D_ptr CreateLength2D();
717 MultiConnection_ptr CreateMultiConnection();
718 MultiConnection2D_ptr CreateMultiConnection2D();
720 BelongToGeom_ptr CreateBelongToGeom();
721 BelongToPlane_ptr CreateBelongToPlane();
722 BelongToCylinder_ptr CreateBelongToCylinder();
724 LyingOnGeom_ptr CreateLyingOnGeom();
726 FreeBorders_ptr CreateFreeBorders();
727 FreeEdges_ptr CreateFreeEdges();
729 RangeOfIds_ptr CreateRangeOfIds();
731 BadOrientedVolume_ptr CreateBadOrientedVolume();
733 LessThan_ptr CreateLessThan();
734 MoreThan_ptr CreateMoreThan();
735 EqualTo_ptr CreateEqualTo();
737 LogicalNOT_ptr CreateLogicalNOT();
738 LogicalAND_ptr CreateLogicalAND();
739 LogicalOR_ptr CreateLogicalOR();
741 Filter_ptr CreateFilter();
743 FilterLibrary_ptr LoadLibrary( const char* aFileName );
744 FilterLibrary_ptr CreateLibrary();
745 CORBA::Boolean DeleteLibrary( const char* aFileName );