-// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// - FT_Deflection2D = 22
// v 9.3.0: FT_Undefined == 50, new items:
// - FT_Length3D = 22
+ // v 9.12.0: FT_Undefined == 51, new items:
+ // - FT_ScaledJacobian = 8
+ // v 9.12.0: FT_Undefined == 52, new items:
+ // - FT_Warping3D = 4
//
// It's necessary to continue recording this history and to fill
// undef2newItems (see below) accordingly.
undef2newItems[ 48 ].push_back( 22 );
undef2newItems[ 49 ].push_back( 22 );
undef2newItems[ 50 ].push_back( 22 );
+ undef2newItems[ 51 ].push_back( 8 );
+ undef2newItems[ 52 ].push_back( 4 );
ASSERT( undef2newItems.rbegin()->first == SMESH::FT_Undefined );
}
if ( objID == this->GetID() || objID == SMESH_2smeshpy::GenName())
{
this->Process( aCommand );
+
//addFilterUser( aCommand, theGen ); // protect filters from clearing
return aCommand;
}
meshID = aCommand->GetResultValue();
else if ( method == "MakeBoundaryMesh")
meshID = aCommand->GetResultValue(1);
- else if ( method == "MakeBoundaryElements")
+ else if ( method == "MakeBoundaryElements" || method == "MakeBoundaryOfEachElement" )
meshID = aCommand->GetResultValue(2);
if ( method.Search("MakeGroups") != -1 ||
groups = aCommand->GetResultValue();
else if ( method == "MakeBoundaryMesh" )
groups = aCommand->GetResultValue(2);
- else if ( method == "MakeBoundaryElements")
+ else if ( method == "MakeBoundaryElements" || method == "MakeBoundaryOfEachElement" )
groups = aCommand->GetResultValue(3);
else if ( method == "Create0DElementsOnAllNodes" &&
aCommand->GetArg(2).Length() > 2 ) // group name != ''
// Concatenate( [mesh1, ...], ... )
// CreateHypothesis( theHypType, theLibName )
// Compute( mesh, geom )
+ // CheckCompute( mesh )
// Evaluate( mesh, geom )
// mesh creation
TCollection_AsciiString method = theCommand->GetMethod();
}
}
+ // smeshgen.CheckCompute( mesh ) --> mesh.CheckCompute()
+ if ( method == "CheckCompute" )
+ {
+ const _pyID& meshID = theCommand->GetArg( 1 );
+ map< _pyID, Handle(_pyMesh) >::iterator id_mesh = myMeshes.find( meshID );
+ if ( id_mesh != myMeshes.end() ) {
+ theCommand->SetObject( meshID );
+ theCommand->RemoveArgs();
+ id_mesh->second->Process( theCommand );
+ id_mesh->second->AddProcessedCmd( theCommand );
+ return;
+ }
+ }
+
+
// smeshgen.Evaluate( mesh, geom ) --> mesh.Evaluate(geom)
if ( method == "Evaluate" )
{
}
else if ( theCreationCmd->GetMethod().Search("MakeMesh") != -1 ||
theCreationCmd->GetMethod() == "MakeBoundaryMesh" ||
- theCreationCmd->GetMethod() == "MakeBoundaryElements" )
+ theCreationCmd->GetMethod() == "MakeBoundaryElements" ||
+ theCreationCmd->GetMethod() == "MakeBoundaryOfEachElement" )
{
// this mesh depends on a source mesh
// (theCreationCmd is already Process()ed by _pyMeshEditor)
}
Flush();
}
+ // in snapshot mode, clear the previous CheckCompute()
+ else if ( method == "CheckCompute" )
+ {
+ if ( !theGen->IsToKeepAllCommands() ) // !historical
+ {
+ if ( !myLastCheckCmd.IsNull() )
+ {
+ // check if the previously computed mesh has been edited,
+ // if so then we do not clear the previous Compute()
+ bool toClear = true;
+ list< Handle(_pyMeshEditor)>::iterator e = myEditors.begin();
+ for ( ; e != myEditors.end() && toClear; ++e )
+ {
+ list< Handle(_pyCommand)>& cmds = (*e)->GetProcessedCmds();
+ list< Handle(_pyCommand) >::reverse_iterator cmd = cmds.rbegin();
+ if ( cmd != cmds.rend() &&
+ (*cmd)->GetOrderNb() > myLastCheckCmd->GetOrderNb() )
+ toClear = false;
+ }
+ if ( toClear )
+ myLastCheckCmd->Clear();
+ }
+ myLastCheckCmd = theCommand;
+ }
+ }
// ----------------------------------------------------------------------
else if ( method == "Clear" ) // in snapshot mode, clear all previous commands
{
"GetElemNode","IsMediumNode","IsMediumNodeOfAnyElem","ElemNbEdges","ElemNbFaces",
"GetElemFaceNodes", "GetFaceNormal", "FindElementByNodes",
"IsPoly","IsQuadratic","BaryCenter","GetHypothesisList", "SetAutoColor", "GetAutoColor",
- "Clear", "ConvertToStandalone", "GetMeshOrder", "SetMeshOrder"
+ "Clear", "ConvertToStandalone", "GetMeshOrder", "SetMeshOrder",
+ "SetNbThreads", "CheckCompute"
,"" }; // <- mark of end
sameMethods.Insert( names );
}
"GetLastCreatedElems", "FaceGroupsSeparatedByEdges",
"MirrorMakeMesh","MirrorObjectMakeMesh","TranslateMakeMesh","TranslateObjectMakeMesh",
"Scale","ScaleMakeMesh","RotateMakeMesh","RotateObjectMakeMesh","MakeBoundaryMesh",
- "MakeBoundaryElements", "SplitVolumesIntoTetra","SplitHexahedraIntoPrisms",
+ "MakeBoundaryElements", "MakeBoundaryOfEachElement", "SplitVolumesIntoTetra","SplitHexahedraIntoPrisms",
"DoubleElements","DoubleNodes","DoubleNode","DoubleNodeGroup","DoubleNodeGroups",
"DoubleNodeElem","DoubleNodeElemInRegion","DoubleNodeElemGroup","AffectedElemGroupsInRegion",
"DoubleNodeElemGroupInRegion","DoubleNodeElemGroups","DoubleNodeElemGroupsInRegion",
//================================================================================
/*!
- * \brief Return true if a setting parameter command ha been used to compute mesh
+ * \brief Return true if a setting parameter command has been used to compute mesh
*/
//================================================================================