From ed5bf36e412b872debf78915d9c54c4dcb93bdb5 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 3 Jul 2013 16:06:14 +0000 Subject: [PATCH] 1) 0020976: EDF 1471 SMESH: New ergonomy to display quality controls + static CORBA::Long* GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, int& nbIds ); + virtual SMESH::long_array* GetNbElementsByType(); --- src/SMESH_I/SMESH_MeshEditor_i.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index d157a2c49..25750af0e 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -721,6 +721,14 @@ struct SMESH_MeshEditor_i::_IDSource : public POA_SMESH::SMESH_IDSource SMESH::SMESH_Mesh_ptr _mesh; SMESH::long_array* GetIDs() { return new SMESH::long_array( _ids ); } SMESH::long_array* GetMeshInfo() { return 0; } + SMESH::long_array* GetNbElementsByType() + { + SMESH::long_array_var aRes = new SMESH::long_array(); + aRes->length(SMESH::NB_ELEMENT_TYPES); + for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) + aRes[ i ] = ( i == _type ) ? _ids.length() : 0; + return aRes._retn(); + } SMESH::SMESH_Mesh_ptr GetMesh() { return SMESH::SMESH_Mesh::_duplicate( _mesh ); } bool IsMeshInfoCorrect() { return true; } SMESH::array_of_ElementType* GetTypes() @@ -756,6 +764,18 @@ bool SMESH_MeshEditor_i::IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSourc return SMESH::DownCast( idSource ); } +CORBA::Long* SMESH_MeshEditor_i::GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, + int& nbIds) +{ + if ( _IDSource* tmpIdSource = SMESH::DownCast( idSource )) + { + nbIds = (int) tmpIdSource->_ids.length(); + return & tmpIdSource->_ids[0]; + } + nbIds = 0; + return 0; +} + void SMESH_MeshEditor_i::deleteAuxIDSources() { std::list< _IDSource* >::iterator idSrcIt = myAuxIDSources.begin(); -- 2.39.2