2005-08-11 10:04:55 +06:00
|
|
|
#include <Standard_Stream.hxx>
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2005-08-11 10:04:55 +06:00
|
|
|
#include <GEOM_IOperations.hxx>
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
#include "utilities.h"
|
2005-08-11 10:04:55 +06:00
|
|
|
#include <OpUtil.hxx>
|
|
|
|
#include <Utils_ExceptHandlers.hxx>
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
#include <TDataStd_TreeNode.hxx>
|
|
|
|
#include <TDataStd_ChildNodeIterator.hxx>
|
|
|
|
#include <TDF_TagSource.hxx>
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
* default constructor:
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
GEOM_IOperations::GEOM_IOperations(GEOM_Engine* theEngine, int theDocID)
|
|
|
|
: _engine(theEngine), _docID(theDocID)
|
|
|
|
{
|
|
|
|
_solver = new GEOM_Solver(theEngine);
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
* destructor
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
GEOM_IOperations::~GEOM_IOperations()
|
|
|
|
{
|
|
|
|
delete _solver;
|
|
|
|
MESSAGE("GEOM_IOperations::~GEOM_IOperations");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
* StartOperation
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
void GEOM_IOperations::StartOperation()
|
|
|
|
{
|
|
|
|
Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
|
|
|
|
if(aDoc->GetUndoLimit() > 0)
|
|
|
|
aDoc->NewCommand();
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
* FinishOperation
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
void GEOM_IOperations::FinishOperation()
|
|
|
|
{
|
|
|
|
Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
|
|
|
|
if(aDoc->GetUndoLimit() > 0)
|
|
|
|
aDoc->CommitCommand();
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
* AbortOperation
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
void GEOM_IOperations::AbortOperation()
|
|
|
|
{
|
|
|
|
Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
|
|
|
|
aDoc->AbortCommand();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
/*!
|
|
|
|
* IsDone
|
|
|
|
*/
|
|
|
|
//=============================================================================
|
|
|
|
bool GEOM_IOperations::IsDone()
|
|
|
|
{
|
|
|
|
return (_errorCode == OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
|