// Concatenate( [mesh1, ...], ... )
// CreateHypothesis( theHypType, theLibName )
// Compute( mesh, geom )
- // CheckCompute( mesh, isDone )
+ // CheckCompute( mesh )
// Evaluate( mesh, geom )
// mesh creation
TCollection_AsciiString method = theCommand->GetMethod();
if ( id_mesh != myMeshes.end() ) {
theCommand->SetObject( meshID );
theCommand->RemoveArgs();
- std::cout << "command: " << theCommand->GetString() << std::endl;
id_mesh->second->Process( theCommand );
id_mesh->second->AddProcessedCmd( theCommand );
- std::cout << "command processed: " << theCommand->GetString() << std::endl;
return;
}
}
- // smeshgen.CheckCompute( mesh, isDone ) --> mesh.CheckCompute(isDone)
+ // smeshgen.CheckCompute( mesh ) --> mesh.CheckCompute()
if ( method == "CheckCompute" )
{
const _pyID& meshID = theCommand->GetArg( 1 );
if ( id_mesh != myMeshes.end() ) {
theCommand->SetObject( meshID );
theCommand->RemoveArgs();
- theCommand->SetArg(1, "isDone");
id_mesh->second->Process( theCommand );
id_mesh->second->AddProcessedCmd( theCommand );
return;
}
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
{
* The creation reason is that smeshBuilder.py commands defining hypotheses encapsulate
* several SMESH engine method calls. As well, the dependencies between smeshBuilder.py
* classes differ from ones between corresponding SMESH IDL interfaces.
- *
+ *
* Everything here is for internal usage by SMESH_2smeshpy::ConvertScript()
* declared in SMESH_PythonDump.hxx
*/
std::list< Handle(_pyMesh) > myChildMeshes; // depending on me
bool myGeomNotInStudy;
Handle(_pyCommand) myLastComputeCmd;
+ Handle(_pyCommand) myLastCheckCmd;
public:
_pyMesh(const Handle(_pyCommand) creationCmd);
_pyMesh(const Handle(_pyCommand) theCreationCmd, const _pyID & id);
DEFINE_STANDARD_RTTIEXT(_pyMesh,_pyObject)
};
-#undef _pyMesh_ACCESS_METHOD
+#undef _pyMesh_ACCESS_METHOD
// -------------------------------------------------------------------------------------
/*!
*/
void CreateGroupServants();
- /*!
- * \brief Return true if all sub-meshes are computed OK - to update an icon
- */
- bool IsComputedOK();
// ====================================
// SMESH_Mesh interface (continuation)
// ====================================
+ /*!
+ * \brief Return true if all sub-meshes are computed OK - to update an icon
+ */
+ CORBA::Boolean IsComputedOK();
/*!
* \brief Return groups cantained in _mapGroups by their IDs