X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Group_i.hxx;h=676a27ed68e0386b43c0299841053a81f4884101;hp=dcb441057e0399e8978bae67fc1392c0474c78c4;hb=refs%2Ftags%2FV9_7_0a1;hpb=bd4e115a78b52e3fbc016e5e30bb0e19b2a9e7d6 diff --git a/src/SMESH_I/SMESH_Group_i.hxx b/src/SMESH_I/SMESH_Group_i.hxx index dcb441057..676a27ed6 100644 --- a/src/SMESH_I/SMESH_Group_i.hxx +++ b/src/SMESH_I/SMESH_Group_i.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -48,7 +48,8 @@ class SMESH_PreMeshInfo; // =========== class SMESH_I_EXPORT SMESH_GroupBase_i: public virtual POA_SMESH::SMESH_GroupBase, - public virtual SALOME::GenericObj_i + public virtual SALOME::GenericObj_i, + public SMESH::NotifyerAndWaiter // defined in SMESH_Filter_i.hxx { public: SMESH_GroupBase_i(PortableServer::POA_ptr thePOA, @@ -60,27 +61,31 @@ class SMESH_I_EXPORT SMESH_GroupBase_i: void SetName(const char* name); char* GetName(); SMESH::ElementType GetType(); - CORBA::Long Size(); + SMESH::smIdType Size(); CORBA::Boolean IsEmpty(); - CORBA::Boolean Contains(CORBA::Long elem_id); - CORBA::Long GetID(CORBA::Long elem_index); - SMESH::long_array* GetListOfID(); - SMESH::long_array* GetNodeIDs(); - CORBA::Long GetNumberOfNodes(); + CORBA::Boolean Contains(SMESH::smIdType elem_id); + SMESH::smIdType GetID(SMESH::smIdType elem_index); + SMESH::smIdType_array* GetListOfID(); + SMESH::smIdType_array* GetNodeIDs(); + SMESH::smIdType GetNumberOfNodes(); CORBA::Boolean IsNodeInfoAvailable(); // for gui virtual SMESH::SMESH_Mesh_ptr GetMesh(); /*! - * Returns statistic of mesh elements - * Result array of number enityties + * Returns number of mesh elements of each \a EntityType + * Result array of number of elements per \a EntityType * Inherited from SMESH_IDSource */ - virtual SMESH::long_array* GetMeshInfo(); - - // Inherited from SMESH_IDSource interface - virtual SMESH::long_array* GetIDs(); - + virtual SMESH::smIdType_array* GetMeshInfo(); + /*! + * Returns number of mesh elements of each \a ElementType + */ + virtual SMESH::smIdType_array* GetNbElementsByType(); + /*! + * Returns a sequence of all element IDs + */ + virtual SMESH::smIdType_array* GetIDs(); /*! * Returns types of elements it contains * Inherited from SMESH_IDSource interface @@ -91,6 +96,17 @@ class SMESH_I_EXPORT SMESH_GroupBase_i: * happen if mesh data is not yet fully loaded from the file of study. */ virtual bool IsMeshInfoCorrect(); + /*! + * Returns mesh unstructed grid information. + */ + virtual SALOMEDS::TMPFile* GetVtkUgStream(); + + /*! + * Returns \c true if \c this group depends on the \a other via + * FT_BelongToMeshGroup predicate or vice versa + */ + virtual CORBA::Boolean IsInDependency( SMESH::SMESH_GroupBase_ptr other ); + // Internal C++ interface int GetLocalID() const { return myLocalID; } @@ -110,14 +126,14 @@ protected: SMESH_PreMeshInfo* myPreMeshInfo; // mesh info before full loading from study file friend class SMESH_PreMeshInfo; + int myNbNodes, myGroupDSTic; + private: SMESH_Mesh_i* myMeshServant; int myLocalID; void changeLocalId(int localId) { myLocalID = localId; } friend class SMESH_Mesh_i; - - int myNbNodes, myGroupDSTic; }; // ====== @@ -134,13 +150,13 @@ class SMESH_I_EXPORT SMESH_Group_i: const int theLocalID ); // CORBA interface implementation void Clear(); - CORBA::Long Add( const SMESH::long_array& theIDs ); - CORBA::Long Remove( const SMESH::long_array& theIDs ); + SMESH::smIdType Add( const SMESH::smIdType_array& theIDs ); + SMESH::smIdType Remove( const SMESH::smIdType_array& theIDs ); - CORBA::Long AddByPredicate( SMESH::Predicate_ptr thePredicate ); - CORBA::Long RemoveByPredicate( SMESH::Predicate_ptr thePredicate ); + SMESH::smIdType AddByPredicate( SMESH::Predicate_ptr thePredicate ); + SMESH::smIdType RemoveByPredicate( SMESH::Predicate_ptr thePredicate ); - CORBA::Long AddFrom( SMESH::SMESH_IDSource_ptr theSource ); + SMESH::smIdType AddFrom( SMESH::SMESH_IDSource_ptr theSource ); }; // ========================= @@ -160,13 +176,12 @@ class SMESH_I_EXPORT SMESH_GroupOnGeom_i: }; // ========================= -// Group deined by filter +// Group denied by filter // ========================= class SMESH_I_EXPORT SMESH_GroupOnFilter_i: public virtual POA_SMESH::SMESH_GroupOnFilter, - public SMESH_GroupBase_i, - public SMESH::Filter_i::TPredicateChangeWaiter + public SMESH_GroupBase_i { public: SMESH_GroupOnFilter_i( PortableServer::POA_ptr thePOA, @@ -183,9 +198,15 @@ class SMESH_I_EXPORT SMESH_GroupOnFilter_i: // CORBA interface implementation void SetFilter(SMESH::Filter_ptr theFilter); SMESH::Filter_ptr GetFilter(); + virtual CORBA::Boolean IsUpToDate(); + virtual SMESH::smIdType_array* GetListOfID(); + virtual SMESH::smIdType_array* GetMeshInfo(); + //! @return false in two cases: 1) if mesh not loaded and GetMeshInfo() returns + //! incorrect information 2) mesh loaded but group contents is not computed. + virtual bool IsMeshInfoCorrect(); - // method of SMESH::Filter_i::TPredicateChangeWaiter - virtual void PredicateChanged(); + // method of SMESH::NotifyerAndWaiter to update self when myFilter changes + virtual void OnBaseObjModified(NotifyerAndWaiter* filter, bool); private: SMESH::Filter_var myFilter;