[bos #43370] Swich Composite Side to Wire Discretization. Fixed calling base class clear() for childs of SMDS_ElementHolder. Added debug output, removed redundant output, added GroupOnGeom cleaning placeholder.

This commit is contained in:
Konstantin Leontev 2024-11-08 13:53:59 +00:00
parent e60bcaf4a9
commit f33241e70b
7 changed files with 38 additions and 3 deletions

View File

@ -28,6 +28,7 @@
#include "SMESH_SMDS.hxx" #include "SMESH_SMDS.hxx"
#include "SMDS_ElemIterator.hxx" #include "SMDS_ElemIterator.hxx"
#include "utilities.h"
#include <smIdType.hxx> #include <smIdType.hxx>
#include <vtkType.h> #include <vtkType.h>
@ -70,7 +71,10 @@ class SMDS_EXPORT SMDS_ElementHolder
virtual void compact() = 0; virtual void compact() = 0;
//!< allow the descendant treat its elements before mesh clearing //!< allow the descendant treat its elements before mesh clearing
virtual void clear() {} virtual void clear()
{
MESSAGE("SMDS_ElementHolder::clear() is not implemented");
}
SMDS_Mesh* myMesh; SMDS_Mesh* myMesh;

View File

@ -1562,6 +1562,10 @@ bool SMESH_subMesh::ComputeStateEngine(compute_event event)
try { try {
OCC_CATCH_SIGNALS; OCC_CATCH_SIGNALS;
TopExp_Explorer subS(shape, _subShape.ShapeType());
const int subMeshId = _father->GetSubMesh(subS.Current())->GetId();
MESSAGE("Compute submesh " << subMeshId << " with algo " << algo->GetName());
algo->InitComputeError(); algo->InitComputeError();
MemoryReserve aMemoryReserve; MemoryReserve aMemoryReserve;

View File

@ -162,3 +162,13 @@ int SMESHDS_GroupOnGeom::GetTic() const
return GetMesh()->GetMTime(); return GetMesh()->GetMTime();
} }
//================================================================================
/*!
* \brief Clear the group content
*/
//================================================================================
void SMESHDS_GroupOnGeom::Clear()
{
resetIterator();
}

View File

@ -55,6 +55,8 @@ class SMESHDS_EXPORT SMESHDS_GroupOnGeom: public SMESHDS_GroupBase
virtual int GetTic() const; virtual int GetTic() const;
virtual void Clear();
private: private:
TopoDS_Shape myShape; TopoDS_Shape myShape;

View File

@ -36,6 +36,7 @@
#include "SMESHDS_GroupOnGeom.hxx" #include "SMESHDS_GroupOnGeom.hxx"
#include "SMESHDS_Script.hxx" #include "SMESHDS_Script.hxx"
#include "SMESHDS_TSubMeshHolder.hxx" #include "SMESHDS_TSubMeshHolder.hxx"
#include "SMESHDS_GroupOnFilter.hxx"
// #include <BRep_Tool.hxx> // #include <BRep_Tool.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
@ -1050,8 +1051,23 @@ void SMESHDS_Mesh::ClearMesh()
g->Clear(); g->Clear();
g->SetType( groupType ); g->SetType( groupType );
} }
else if (SMESHDS_GroupOnFilter* g = dynamic_cast<SMESHDS_GroupOnFilter*>(*group))
{
MESSAGE("Clearing SMESHDS_GroupOnFilter");
// TODO: clear filter
(*group)->Extent(); // to free cached elements in GroupOnFilter's
}
else if (SMESHDS_GroupOnGeom* g = dynamic_cast<SMESHDS_GroupOnGeom*>(*group))
{
SMDSAbs_ElementType groupType = g->GetType();
MESSAGE("Clearing SMESHDS_GroupOnGeom, type: " << groupType);
g->Clear();
}
else else
{ {
MESSAGE("Clearing of unknown group type. Does nothing.");
(*group)->Extent(); // to free cached elements in GroupOnFilter's (*group)->Extent(); // to free cached elements in GroupOnFilter's
} }
} }

View File

@ -86,6 +86,7 @@ class SMESHDS_EXPORT SMESHDS_SubMesh : public SMDS_ElementHolder
virtual void tmpClear(); virtual void tmpClear();
virtual void add( const SMDS_MeshElement* element ); virtual void add( const SMDS_MeshElement* element );
virtual void compact() {} virtual void compact() {}
virtual void clear() override { Clear(); }
private: private:

View File

@ -3483,7 +3483,6 @@ void SMESH_Mesh_i::onHypothesisModified(int theHypID, bool theUpdateIcons)
void SMESH_Mesh_i::SetImpl(::SMESH_Mesh * impl) void SMESH_Mesh_i::SetImpl(::SMESH_Mesh * impl)
{ {
MESSAGE("SMESH_Mesh_i::SetImpl");
_impl = impl; _impl = impl;
if ( _impl ) if ( _impl )
_impl->SetCallUp( new TCallUp_i(this)); _impl->SetCallUp( new TCallUp_i(this));
@ -3497,7 +3496,6 @@ void SMESH_Mesh_i::SetImpl(::SMESH_Mesh * impl)
::SMESH_Mesh & SMESH_Mesh_i::GetImpl() ::SMESH_Mesh & SMESH_Mesh_i::GetImpl()
{ {
MESSAGE("SMESH_Mesh_i::GetImpl()");
return *_impl; return *_impl;
} }