<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theObject</inParameter-name>
<inParameter-type>GEOM/GEOM_BaseObject</inParameter-type>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theObject</inParameter-name>
<inParameter-type>GEOM/GEOM_Object</inParameter-type>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theObject</inParameter-name>
<inParameter-type>GEOM/GEOM_Object</inParameter-type>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theSObject</inParameter-name>
<inParameter-type>SObject</inParameter-type>
<service-version>@SALOMEGEOM_VERSION@</service-version>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
- <inParameter-list>
- <inParameter>
- <inParameter-name>theStudyEntry</inParameter-name>
- <inParameter-type>string</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
- </inParameter-list>
+ <inParameter-list></inParameter-list>
<outParameter-list>
<outParameter>
<outParameter-name>return</outParameter-name>
<service-comment>unknown</service-comment>
<service-by-default>0</service-by-default>
<inParameter-list>
- <inParameter>
- <inParameter-name>theStudy</inParameter-name>
- <inParameter-type>Study</inParameter-type>
- <inParameter-comment>unknown</inParameter-comment>
- </inParameter>
<inParameter>
<inParameter-name>theObject</inParameter-name>
<inParameter-type>CORBA/Object</inParameter-type>
* Constructor
*/
//=============================================================================
-AdvancedEngine_IOperations::AdvancedEngine_IOperations(GEOM_Engine* theEngine, int theDocID) :
- GEOM_IOperations(theEngine, theDocID)
+AdvancedEngine_IOperations::AdvancedEngine_IOperations(GEOM_Engine* theEngine) :
+ GEOM_IOperations(theEngine)
{
MESSAGE("AdvancedEngine_IOperations::AdvancedEngine_IOperations");
- myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID());
- myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine(), GetDocID());
- myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
- myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine(), GetDocID());
- myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine(), GetDocID());
- my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine(), GetDocID());
- myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine(), GetDocID());
- myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine(), GetDocID());
- myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
+ myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine());
+ myBooleanOperations = new GEOMImpl_IBooleanOperations(GetEngine());
+ myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine());
+ myTransformOperations = new GEOMImpl_ITransformOperations(GetEngine());
+ myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine());
+ my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine());
+ myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine());
+ myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine());
+ myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine());
}
//=============================================================================
// Get faces that are laying on conical faces.
if (aConicalFaces.IsEmpty() == Standard_False) {
Handle(GEOM_Object) aCone =
- GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ GetEngine()->AddObject(GEOM_TSHAPE);
Handle(GEOM_Function) aFunction =
aCone->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC);
TopTools_ListIteratorOfListOfShape aFIter(aConicalFaces);
MESSAGE("AdvancedEngine_IOperations::MakePipeTShape");
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_BASIC);
{
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
/////////////////
// TSHAPE CODE
/////////////////
{
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_CHAMFER);
if (aFunction.IsNull()) return NULL;
{
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_CHAMFER);
if (aFunction.IsNull()) return NULL;
{
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_FILLET);
if (aFunction.IsNull()) return NULL;
{
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_TSHAPE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_TSHAPE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_PipeTShapeDriver::GetID(), TSHAPE_FILLET);
if (aFunction.IsNull()) return NULL;
return NULL;
}
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDDISK);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_DividedDiskDriver::GetID(), DIVIDEDDISK_R_RATIO);
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDDISK);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDDISK);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_DividedDiskDriver::GetID(), DIVIDEDDISK_R_VECTOR_PNT);
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_DIVIDEDCYLINDER);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_DIVIDEDCYLINDER);
Handle(GEOM_Object) aBaseShape = MakeDividedDisk(theR, 67.0, 1, thePattern);
aBaseShape->GetLastFunction()->SetDescription(""); // Erase dump of MakeDividedDisk
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_SMOOTHINGSURFACE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_SMOOTHINGSURFACE);
//Add a new shape function with parameters
Handle(GEOM_Function) aFunction = aShape->AddFunction(AdvancedEngine_SmoothingSurfaceDriver::GetID(), SMOOTHINGSURFACE_LPOINTS);
bool fuse);
public:
- AdvancedEngine_IOperations(GEOM_Engine* theEngine, int theDocID);
+ AdvancedEngine_IOperations(GEOM_Engine* theEngine);
~AdvancedEngine_IOperations();
Handle(TColStd_HSequenceOfTransient)
{
Unexpect aCatch(SALOME_SalomeException);
MESSAGE( "AdvancedEngine_OperationsCreator::Create" );
- _operation = new AdvancedEngine_IOperations( theGenImpl );
- return new AdvancedEngine_IOperations_i( thePOA, theEngine, _operation );
+ return new AdvancedEngine_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
}
-AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::get()
+AdvancedEngine_IOperations* AdvancedEngine_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
{
+ if( !_operation )
+ _operation = new AdvancedEngine_IOperations( theGenImpl );
return _operation;
}
::GEOMImpl_Gen* theGenImpl);
private:
- static AdvancedEngine_IOperations* get();
+ static AdvancedEngine_IOperations* get(::GEOMImpl_Gen* theGenImpl);
private:
- static AdvancedEngine_IOperations*_operation;
+ static AdvancedEngine_IOperations* _operation;
};
#endif
// function : restoreSubShapes
// purpose :
//=================================================================================
-void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void AdvancedGUI_PipeTShapeDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
SALOMEDS::GenericAttribute_var anAttr;
if (!theSObject->FindAttribute(anAttr, "AttributeIOR"))
ObjectList::iterator it = pipeTShapeGroupObjects.begin();
for (int i = 0; it != pipeTShapeGroupObjects.end(); it++, i++) {
- getGeomEngine()->AddInStudy(theStudy, (*it), tr((*it)->GetName()).toStdString().c_str(), theFather);
+ getGeomEngine()->AddInStudy((*it), tr((*it)->GetName()).toStdString().c_str(), theFather);
}
}
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
- virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+ virtual void restoreSubShapes (SALOMEDS::SObject_ptr);
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
entryList.append( so->GetID() );
transaction.commit();
- GEOM_Displayer( study ).Display( main.in() );
+ GEOM_Displayer().Display( main.in() );
main->UnRegister();
}
else
*/
//=============================================================================
bool
-BREPPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+BREPPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine() );
aPluginOperations->ExportBREP( theOriginal, theFileName );
return true;
}
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-BREPPlugin_IECallBack::Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+BREPPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ BREPPlugin_IOperations* aPluginOperations = BREPPlugin_OperationsCreator::get( GetEngine() );
return aPluginOperations->ImportBREP( theFileName );
}
BREPPlugin_IECallBack();
~BREPPlugin_IECallBack();
- bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName );
+ bool Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName );
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
};
#endif
* Constructor
*/
//=============================================================================
-BREPPlugin_IOperations::BREPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+BREPPlugin_IOperations::BREPPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "BREPPlugin_IOperations::BREPPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( BREPPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
if( theFileName.IsEmpty() ) return NULL;
//Add a new result object
- Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT );
//Add an Import function
Handle(GEOM_Function) aFunction =
class BREPPLUGINENGINE_EXPORT BREPPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- BREPPlugin_IOperations( GEOM_Engine*, int );
+ BREPPlugin_IOperations( GEOM_Engine* );
~BREPPlugin_IOperations();
void ExportBREP( const Handle(GEOM_Object),
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "BREPPlugin_OperationsCreator::Create" );
- _operation = new BREPPlugin_IOperations( theGenImpl );
- return new BREPPlugin_IOperations_i( thePOA, theEngine, _operation );
+ return new BREPPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
}
-BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get()
+BREPPlugin_IOperations* BREPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
{
+ if( !_operation )
+ _operation = new BREPPlugin_IOperations( theGenImpl );
return _operation;
}
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl );
private:
- static BREPPlugin_IOperations* get();
+ static BREPPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
private:
- static BREPPlugin_IOperations* _operation;
+ static BREPPlugin_IOperations* _operation;
friend class BREPPlugin_IECallBack;
};
// function : restoreSubShapes
// purpose :
//=================================================================================
-void BooleanGUI_Dialog::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void BooleanGUI_Dialog::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame
/*theInheritFirstArg=*/myOperation == BooleanGUI::CUT,
mainFrame()->CheckBoxAddPrefix->isChecked()); // ? false
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual void addSubshapesToStudy();
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
// function : restoreSubShapes
// purpose :
//=================================================================================
-void BuildGUI_CompoundDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject )
+void BuildGUI_CompoundDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
{
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GEOM::FSM_GetSame
/*theInheritFirstArg=*/false,
mainFrame()->CheckBoxAddPrefix->isChecked() );
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- GEOM_Displayer disp( appStudy );
+ GEOM_Displayer disp;
OCCViewer_ViewManager* anOCCVM = ( OCCViewer_ViewManager* ) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
SALOME_ListIO aSelList;
aSelMgr->selectedObjects( aSelList );
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- GEOM_Displayer disp( appStudy );
+ GEOM_Displayer disp;
OCCViewer_ViewManager* anOCCVM = (OCCViewer_ViewManager*) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
SalomeApp_Application* app = getGeometryGUI()->getApp();
if (!app) return false;
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !appStudy ) return false;
-
LightApp_SelectionMgr *Sel = app->selectionMgr();
SALOME_ListIO selected;
Sel->selectedObjects( selected );
break;
}
Sel->setSelectedObjects( selected );
- GEOM_Displayer( appStudy ).UpdateColorScale();
+ GEOM_Displayer().UpdateColorScale();
return true;
}
}
anIter->Next();
}
- GEOM_Displayer( appStudy ).Display( listIO, true );
+ GEOM_Displayer().Display( listIO, true );
}
//=====================================================================================
if ( app ) {
SUIT_ViewWindow* vw = app->desktop()->activeWindow();
if ( vw ) {
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
SUIT_ViewManager* vman = vw->getViewManager();
if ( vman->getType() == OCCViewer_Viewer::Type() ||
vman->getType() == SVTK_Viewer::Type() ) {
- GEOM_Displayer( appStudy ).EraseAll(true);
+ GEOM_Displayer().EraseAll(true);
}
}
}
SalomeApp_Application* app = getGeometryGUI()->getApp();
if (!app) return;
- SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
- if (!anActiveStudy) return;
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
+ if (!aStudy) return;
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
if (!aSelMgr) return;
for (; It.More(); It.Next()) {
Handle(SALOME_InteractiveObject) anIObject = It.Value();
if (anIObject->hasEntry()) {
- _PTR(SObject) SO (anActiveStudy->studyDS()->FindObjectID(anIObject->getEntry()));
+ _PTR(SObject) SO (aStudy->studyDS()->FindObjectID(anIObject->getEntry()));
if (SO) {
_PTR(SComponent) SC (SO->GetFatherComponent());
if (QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str())) {
// if component is selected, pass it
}
else {
- _PTR(ChildIterator) anIter (anActiveStudy->studyDS()->NewChildIterator(SO));
+ _PTR(ChildIterator) anIter (aStudy->studyDS()->NewChildIterator(SO));
anIter->InitEx(true);
while (anIter->More()) {
_PTR(SObject) valSO (anIter->Value());
}
}
}
- GEOM_Displayer(anActiveStudy).Display(listIO, true);
+ GEOM_Displayer().Display(listIO, true);
}
//=====================================================================================
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
- SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !anActiveStudy ) return;
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ if ( !aStudy ) return;
//get SalomeApp selection manager
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
for( ;It.More();It.Next() ) {
Handle(SALOME_InteractiveObject) anIObject = It.Value();
if ( anIObject->hasEntry() ) {
- _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
+ _PTR(SObject) SO ( aStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
_PTR(SComponent) SC ( SO->GetFatherComponent() );
// if component is selected
listIO.Clear();
- _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
+ _PTR(ChildIterator) anIter ( aStudy->studyDS()->NewChildIterator( SO ) );
anIter->InitEx( true );
while( anIter->More() ) {
_PTR(SObject) valSO ( anIter->Value() );
listIO.Append( anIObject );
}
}
- GEOM_Displayer( anActiveStudy ).Display( listIO, true );
+ GEOM_Displayer().Display( listIO, true );
}
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return;
- SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !anActiveStudy ) return;
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+ if ( !aStudy ) return;
//get SalomeApp selection manager
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
for( ; It.More(); It.Next() ) {
Handle(SALOME_InteractiveObject) anIObject = It.Value();
if ( anIObject->hasEntry() ) {
- _PTR(SObject) SO ( anActiveStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
+ _PTR(SObject) SO ( aStudy->studyDS()->FindObjectID( anIObject->getEntry() ) );
if ( SO && QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str()) ) {
_PTR(SComponent) SC ( SO->GetFatherComponent() );
// if component is selected
listIO.Clear();
- _PTR(ChildIterator) anIter ( anActiveStudy->studyDS()->NewChildIterator( SO ) );
+ _PTR(ChildIterator) anIter ( aStudy->studyDS()->NewChildIterator( SO ) );
anIter->InitEx( true );
while( anIter->More() ) {
_PTR(SObject) valSO ( anIter->Value() );
if(viewWindow->getViewManager()->getType() == SVTK_Viewer::Type())
aIsForced = false;
- GEOM_Displayer(anActiveStudy).Erase( listIO, aIsForced);
+ GEOM_Displayer().Erase( listIO, aIsForced);
getGeometryGUI()->getApp()->selectionMgr()->clearSelected();
}
SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
if ( !aStudy ) return;
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
int mgrId = viewWindow->getViewManager()->getGlobalId();
if ( !viewWindow )
viewWindow = app->desktop()->activeWindow();
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
viewWindow->setProperty( "VectorsMode", mode );
if ( !viewWindow )
viewWindow = app->desktop()->activeWindow();
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
viewWindow->setProperty( "VerticesMode", mode );
viewWindow->setProperty( "NameMode", mode );
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
int aMgrId = viewWindow->getViewManager()->getGlobalId();
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
int mgrId = viewWindow->getViewManager()->getGlobalId();
OCCT_IMPLEMENT_STANDARD_RTTIEXT(GEOM_BaseDriver,TFunction_Driver);
-//================================================================================
-/*!
- * Returns document id
- */
-//================================================================================
-int GEOM_BaseDriver::GetDocID() const
-{
- int docId = 0;
- if (!Label().IsNull()) {
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(Label().Data());
- docId = GEOM_Engine::GetEngine()->GetDocID(aDoc);
- }
- return docId;
-}
-
//================================================================================
/*!
* \brief Returns a name of creation operation and names and values of creation parameters
class GEOM_BaseDriver : public TFunction_Driver
{
public:
- // Returns document id
- Standard_EXPORT int GetDocID() const;
// Returns a name of creation operation and names and values of creation parameters
// (Use AddParam() methods declared below to fill params vector while implementing
TCollection_AsciiString anEntry;
TDF_Tool::Entry(theLabel, anEntry);
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(theLabel.Data());
- if(aDoc.IsNull()) return NULL;
-
- Handle(TDataStd_Integer) anID;
- if(!aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) return NULL;
-
GEOM_Engine* anEngine = GEOM_Engine::GetEngine();
if(anEngine == NULL) return NULL;
- return anEngine->GetObject(anID->Get(), anEntry.ToCString());
+ return anEngine->GetObject(anEntry.ToCString());
}
//=============================================================================
*/
//=============================================================================
GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry)
- : _label(theEntry), _ior(""), _docID(-1)
+ : _label(theEntry), _ior("")
{
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
- if(!aDoc.IsNull()) {
- Handle(TDataStd_Integer) anID;
- if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get();
- }
-
if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
_root = TDataStd_TreeNode::Set(theEntry);
}
*/
//=============================================================================
GEOM_BaseObject::GEOM_BaseObject(const TDF_Label& theEntry, int theType)
-: _label(theEntry), _ior(""), _docID(-1)
+: _label(theEntry), _ior("")
{
- Handle(TDocStd_Document) aDoc = TDocStd_Owner::GetDocument(_label.Data());
- if(!aDoc.IsNull()) {
- Handle(TDataStd_Integer) anID;
- if(aDoc->Main().FindAttribute(TDataStd_Integer::GetID(), anID)) _docID = anID->Get();
- }
-
theEntry.ForgetAllAttributes(Standard_True);
if(!theEntry.FindAttribute(TDataStd_TreeNode::GetDefaultTreeID(), _root))
TDataStd_Integer::Set(aTicLabel, aTic + 1);
}
-
-//=============================================================================
-/*!
- * GetDocID
- */
-//=============================================================================
-int GEOM_BaseObject::GetDocID()
-{
- return _docID;
-}
-
//=============================================================================
/*!
* SetName
Standard_EXPORT void SetTic(int theTic);
Standard_EXPORT void IncrementTic();
- //Returns an ID of the OCAF document where this GEOM_BaseObject is stored
- Standard_EXPORT int GetDocID();
-
//Sets a name of this GEOM_BaseObject
Standard_EXPORT void SetName(const char* theName);
TDF_Label _label;
TCollection_AsciiString _ior;
TCollection_AsciiString _parameters;
- int _docID;
public:
OCCT_DEFINE_STANDARD_RTTIEXT(GEOM_BaseObject,Standard_Transient)
static TCollection_AsciiString BuildIDFromObject(Handle(GEOM_BaseObject)& theObject)
{
- TCollection_AsciiString anID(theObject->GetDocID()), anEntry;
+ TCollection_AsciiString anEntry;
TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- anID+=(TCollection_AsciiString("_")+anEntry);
- return anID;
-}
-
-static TCollection_AsciiString BuildID(Standard_Integer theDocID, const char* theEntry)
-{
- TCollection_AsciiString anID(theDocID);
- anID+=(TCollection_AsciiString("_")+theEntry);
- return anID;
-}
-
-static Standard_Integer ExtractDocID(TCollection_AsciiString& theID)
-{
- TCollection_AsciiString aDocID = theID.Token("_");
- if(aDocID.Length() < 1) return -1;
- return aDocID.IntegerValue();
+ return anEntry;
}
bool ProcessFunction(Handle(GEOM_Function)& theFunction,
Standard_Integer& objectCounter,
Resource_DataMapOfAsciiStringAsciiString& aNameToEntry);
-void AddObjectColors (int theDocID,
- TCollection_AsciiString& theScript,
+void AddObjectColors (TCollection_AsciiString& theScript,
const TSting2ObjDataMap& theEntry2ObjData);
-void AddTextures (int theDocID, TCollection_AsciiString& theScript);
+void AddTextures (TCollection_AsciiString& theScript);
void PublishObject (TObjectData& theObjectData,
TSting2ObjDataMap& theEntry2ObjData,
for(objit = objs.begin(); objit != objs.end(); ++objit)
RemoveObject(*objit);
- //Close all documents not closed
- TColStd_DataMapIteratorOfDataMapOfIntegerTransient anItr (_mapIDDocument);
- for (; anItr.More(); anItr.Next())
- {
- Close(anItr.Key());
- anItr.Initialize( _mapIDDocument ); // anItr becomes invalid at _mapIDDocument.UnBind(docId)
- }
- _mapIDDocument.Clear();
+ //Close document
+ Close();
_objects.Clear();
}
* GetDocument
*/
//=============================================================================
-Handle(TDocStd_Document) GEOM_Engine::GetDocument(int theDocID, bool force)
+Handle(TDocStd_Document) GEOM_Engine::GetDocument(bool force)
{
Handle(TDocStd_Document) aDoc;
- if(_mapIDDocument.IsBound(theDocID)) {
- aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
+ if (_document) {
+ aDoc = _document;
}
else if (force) {
#if OCC_VERSION_MAJOR > 6
_OCAFApp->NewDocument("SALOME_GEOM", aDoc);
#endif
aDoc->SetUndoLimit(_UndoLimit);
- _mapIDDocument.Bind(theDocID, aDoc);
- TDataStd_Integer::Set(aDoc->Main(), theDocID);
+ _document = aDoc;
}
return aDoc;
}
-//=============================================================================
-/*!
- * GetDocID
- */
-//=============================================================================
-int GEOM_Engine::GetDocID(Handle(TDocStd_Document) theDocument)
-{
- if (theDocument.IsNull()) return -1;
- TColStd_DataMapIteratorOfDataMapOfIntegerTransient anItr (_mapIDDocument);
- for (; anItr.More(); anItr.Next())
- if (anItr.Value() == theDocument) return anItr.Key();
-
- return -1;
-}
-
//=============================================================================
/*!
* GetObject
*/
//=============================================================================
-Handle(GEOM_BaseObject) GEOM_Engine::GetObject(int theDocID, const char* theEntry, bool force)
+Handle(GEOM_BaseObject) GEOM_Engine::GetObject(const char* theEntry, bool force)
{
Handle(GEOM_BaseObject) anObject;
- TCollection_AsciiString anID = BuildID(theDocID, theEntry);
-
- if (_objects.IsBound(anID)) {
- anObject = Handle(GEOM_BaseObject)::DownCast(_objects(anID));
+ if (_objects.IsBound(theEntry)) {
+ anObject = Handle(GEOM_BaseObject)::DownCast(_objects(theEntry));
}
else if (force) {
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID, force);
+ Handle(TDocStd_Document) aDoc = GetDocument(force);
if ( !aDoc.IsNull()) {
TDF_Label aLabel;
TDF_Tool::Label(aDoc->Main().Data(), theEntry, aLabel, Standard_True);
case GEOM_FIELD_STEP_OBJTYPE: anObject = new GEOM_FieldStep(aLabel); break;
default: anObject = new GEOM_Object (aLabel);
}
- _objects.Bind(anID, anObject);
+ _objects.Bind(theEntry, anObject);
}
}
}
*/
//=============================================================================
-Handle(GEOM_BaseObject) GEOM_Engine::AddBaseObject(int theDocID, int theType)
+Handle(GEOM_BaseObject) GEOM_Engine::AddBaseObject(int theType)
{
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = GetDocument();
Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
// NPAL18604: use existing label to decrease memory usage,
// if this label has been freed (object deleted)
bool useExisting = false;
TDF_Label aChild;
- if (_freeLabels.find(theDocID) != _freeLabels.end()) {
- std::list<TDF_Label>& aFreeLabels = _freeLabels[theDocID];
- if (!aFreeLabels.empty()) {
- useExisting = true;
- aChild = aFreeLabels.front();
- aFreeLabels.pop_front();
- }
+ if (!_freeLabels.empty()) {
+ useExisting = true;
+ aChild = _freeLabels.front();
+ _freeLabels.pop_front();
}
if (!useExisting) {
// create new label
*/
//================================================================================
-Handle(GEOM_Object) GEOM_Engine::AddObject(int theDocID, int theType)
+Handle(GEOM_Object) GEOM_Engine::AddObject(int theType)
{
- return Handle(GEOM_Object)::DownCast( AddBaseObject(theDocID, theType) );
+ return Handle(GEOM_Object)::DownCast( AddBaseObject(theType) );
}
//=============================================================================
{
if (theMainShape.IsNull() || theIndices.IsNull()) return NULL;
- Handle(TDocStd_Document) aDoc = GetDocument(theMainShape->GetDocID());
+ Handle(TDocStd_Document) aDoc = GetDocument();
Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
// NPAL18604: use existing label to decrease memory usage,
// if this label has been freed (object deleted)
bool useExisting = false;
- TDF_Label aChild;
- int aDocID = theMainShape->GetDocID();
- if (_freeLabels.find(aDocID) != _freeLabels.end()) {
- std::list<TDF_Label>& aFreeLabels = _freeLabels[aDocID];
- if (!aFreeLabels.empty()) {
- useExisting = true;
- aChild = aFreeLabels.front();
- aFreeLabels.pop_front();
- }
+ TDF_Label aChild;;
+ if (!_freeLabels.empty()) {
+ useExisting = true;
+ aChild = _freeLabels.front();
+ _freeLabels.pop_front();
}
if (!useExisting) {
// create new label
{
if (theObject.IsNull()) return false;
- int aDocID = theObject->GetDocID();
- if(!_mapIDDocument.IsBound(aDocID))
+ if(!_document)
return false; // document is closed...
//Remove an object from the map of available objects
aLabel.ForgetAllAttributes(Standard_True);
// Remember the label to reuse it then
- std::list<TDF_Label>& aFreeLabels = _freeLabels[aDocID];
- if ( aFreeLabels.empty() || aFreeLabels.back() != aLabel )
- aFreeLabels.push_back(aLabel);
+ if ( _freeLabels.empty() || _freeLabels.back() != aLabel )
+ _freeLabels.push_back(aLabel);
// we can't explicitely delete theObject. At least prevent its functioning
// as an alive object when aLabel is reused for a new object
theObject->_label = aLabel.Root();
theObject->_ior.Clear();
- theObject->_parameters.Clear();
- theObject->_docID = -1;
+ theObject->_parameters.Clear();;
theObject.Nullify();
* Undo
*/
//=============================================================================
-void GEOM_Engine::Undo(int theDocID)
+void GEOM_Engine::Undo()
{
- GetDocument(theDocID)->Undo();
+ GetDocument()->Undo();
}
//=============================================================================
* Redo
*/
//=============================================================================
-void GEOM_Engine::Redo(int theDocID)
+void GEOM_Engine::Redo()
{
- GetDocument(theDocID)->Redo();
+ GetDocument()->Redo();
}
//=============================================================================
* Save
*/
//=============================================================================
-bool GEOM_Engine::Save(int theDocID, const char* theFileName)
+bool GEOM_Engine::Save(const char* theFileName)
{
- if(!_mapIDDocument.IsBound(theDocID)) return false;
- Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
+ if(!_document) return false;
- _OCAFApp->SaveAs(aDoc, theFileName);
+ _OCAFApp->SaveAs(_document, theFileName);
return true;
}
* Load
*/
//=============================================================================
-bool GEOM_Engine::Load(int theDocID, const char* theFileName)
+bool GEOM_Engine::Load(const char* theFileName)
{
Handle(TDocStd_Document) aDoc;
if (_OCAFApp->Open(theFileName, aDoc) != PCDM_RS_OK) {
aDoc->SetUndoLimit(_UndoLimit);
- if(_mapIDDocument.IsBound(theDocID)) _mapIDDocument.UnBind(theDocID);
- _mapIDDocument.Bind(theDocID, aDoc);
-
- TDataStd_Integer::Set(aDoc->Main(), theDocID);
+ _document = aDoc;
return true;
}
* Close
*/
//=============================================================================
-void GEOM_Engine::Close(int theDocID)
+void GEOM_Engine::Close()
{
- if (_mapIDDocument.IsBound(theDocID)) {
- Handle(TDocStd_Document) aDoc = Handle(TDocStd_Document)::DownCast(_mapIDDocument(theDocID));
-
- //Remove all GEOM Objects associated to the given document
- TColStd_SequenceOfAsciiString aSeq;
+ if (_document) {
+ //Remove all GEOM Objects associated to the document
GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It (_objects);
- for (; It.More(); It.Next()) {
- TCollection_AsciiString anObjID (It.Key());
- Standard_Integer anID = ExtractDocID(anObjID);
- if (theDocID == anID) aSeq.Append(It.Key());
- }
- for (Standard_Integer i=1; i<=aSeq.Length(); i++) _objects.UnBind(aSeq.Value(i));
+ for (; It.More(); It.Next())
+ _objects.UnBind(It.Key());
- // Forget free labels for this document
- TFreeLabelsList::iterator anIt = _freeLabels.find(theDocID);
- if (anIt != _freeLabels.end()) {
- _freeLabels.erase(anIt);
- }
+ // Forget free labels for document
+ _freeLabels.clear();
- _mapIDDocument.UnBind(theDocID);
- _OCAFApp->Close(aDoc);
- aDoc.Nullify();
+ _OCAFApp->Close(_document);
+ _document.Nullify();
}
}
* DumpPython
*/
//=============================================================================
-TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
- std::vector<TObjectData>& theObjectData,
+TCollection_AsciiString GEOM_Engine::DumpPython(std::vector<TObjectData>& theObjectData,
TVariablesList theVariables,
bool isPublished,
bool isMultiFile,
Kernel_Utils::Localizer loc;
TCollection_AsciiString aScript;
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = GetDocument();
if (aDoc.IsNull())
{
aScript += "\n\tgeompy = geomBuilder.New(theStudy)\n";
- AddTextures(theDocID, aScript);
+ AddTextures(aScript);
Standard_Integer posToInsertGlobalVars = aScript.Length() + 1;
aScript += aFuncScript;
// ouv : NPAL12872
- AddObjectColors( theDocID, aScript, aEntry2ObjData );
+ AddObjectColors(aScript, aEntry2ObjData );
// Make script to publish in study
TSting2ObjDataPtrMap::iterator aStEntry2ObjDataPtrIt;
#define TEXTURE_LABEL_HEIGHT 4
#define TEXTURE_LABEL_DATA 5
-int GEOM_Engine::addTexture(int theDocID, int theWidth, int theHeight,
+int GEOM_Engine::addTexture(int theWidth, int theHeight,
const Handle(TColStd_HArray1OfByte)& theTexture,
const TCollection_AsciiString& theFileName)
{
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = GetDocument();
Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main());
// NPAL18604: use existing label to decrease memory usage,
// if this label has been freed (object deleted)
bool useExisting = false;
TDF_Label aChild;
- if (_freeLabels.find(theDocID) != _freeLabels.end()) {
- std::list<TDF_Label>& aFreeLabels = _freeLabels[theDocID];
- if (!aFreeLabels.empty()) {
- useExisting = true;
- aChild = aFreeLabels.front();
- aFreeLabels.pop_front();
- }
+ if (!_freeLabels.empty()) {
+ useExisting = true;
+ aChild = _freeLabels.front();
+ _freeLabels.pop_front();
}
if (!useExisting) {
// create new label
return aTextureID;
}
-Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theDocID, int theTextureID,
+Handle(TColStd_HArray1OfByte) GEOM_Engine::getTexture(int theTextureID,
int& theWidth, int& theHeight,
TCollection_AsciiString& theFileName)
{
Handle(TColStd_HArray1OfByte) anArray;
theWidth = theHeight = 0;
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = GetDocument();
TDF_ChildIterator anIterator(aDoc->Main(), Standard_True);
bool found = false;
return anArray;
}
-std::list<int> GEOM_Engine::getAllTextures(int theDocID)
+std::list<int> GEOM_Engine::getAllTextures()
{
std::list<int> id_list;
- Handle(TDocStd_Document) aDoc = GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = GetDocument();
TDF_ChildIterator anIterator(aDoc->Main(), Standard_True);
for (; anIterator.More(); anIterator.Next()) {
return id_list;
}
-void GEOM_Engine::DocumentModified(const int theDocId, const bool isModified)
-{
- if (isModified) _mapModifiedDocs.Add(theDocId);
- else _mapModifiedDocs.Remove(theDocId);
-}
-
-bool GEOM_Engine::DocumentModified(const int theDocId)
-{
- return _mapModifiedDocs.Contains(theDocId);
-}
-
//===========================================================================
// Internal functions
//===========================================================================
* AddObjectColors: Add color to objects
*/
//=============================================================================
-void AddObjectColors (int theDocID,
- TCollection_AsciiString& theScript,
+void AddObjectColors (TCollection_AsciiString& theScript,
const TSting2ObjDataMap& theEntry2ObjData)
{
GEOM_Engine* engine = GEOM_Engine::GetEngine();
- Handle(TDocStd_Document) aDoc = engine->GetDocument(theDocID);
+ Handle(TDocStd_Document) aDoc = engine->GetDocument();
TSting2ObjDataMap::const_iterator anEntryToNameIt;
for (anEntryToNameIt = theEntry2ObjData.begin();
return stream;
}
-void AddTextures (int theDocID, TCollection_AsciiString& theScript)
+void AddTextures (TCollection_AsciiString& theScript)
{
GEOM_Engine* engine = GEOM_Engine::GetEngine();
- std::list<int> allTextures = engine->getAllTextures(theDocID);
+ std::list<int> allTextures = engine->getAllTextures();
std::list<int>::const_iterator it;
if (allTextures.size() > 0) {
Standard_Integer aWidth, aHeight;
TCollection_AsciiString aFileName;
Handle(TColStd_HArray1OfByte) aTexture =
- engine->getTexture(theDocID, *it, aWidth, aHeight, aFileName);
+ engine->getTexture(*it, aWidth, aHeight, aFileName);
if (aWidth > 0 && aHeight > 0 && !aTexture.IsNull() && aTexture->Length() > 0 ) {
TCollection_AsciiString aCommand = "\n\t";
aCommand += "texture_map["; aCommand += *it; aCommand += "] = ";
Standard_EXPORT static GEOM_Engine* GetEngine();
//Returns the OCAF document by its ID, if document doesn't exists it will be created
- Standard_EXPORT Handle(TDocStd_Document) GetDocument(int theDocID, bool force=true);
-
- //Returns the ID of the given OCAF document
- Standard_EXPORT int GetDocID(Handle(TDocStd_Document) theDocument);
+ Standard_EXPORT Handle(TDocStd_Document) GetDocument(bool force=true);
//Returns the OCAF appliaction
Standard_EXPORT Handle(TDocStd_Application) GetApplication() { return _OCAFApp; }
//Returns a pointer to GEOM_BaseObject defined by a document and the entry
- Standard_EXPORT Handle(GEOM_BaseObject) GetObject(int theDocID,
- const char* theEntry,
+ Standard_EXPORT Handle(GEOM_BaseObject) GetObject(const char* theEntry,
bool force=true);
//Adds a new object of the type theType in the OCAF document
- Standard_EXPORT Handle(GEOM_BaseObject) AddBaseObject(int theDocID, int theType);
+ Standard_EXPORT Handle(GEOM_BaseObject) AddBaseObject(int theType);
//Adds a new object of the type theType in the OCAF document
- Standard_EXPORT Handle(GEOM_Object) AddObject(int theDocID, int theType);
+ Standard_EXPORT Handle(GEOM_Object) AddObject(int theType);
//Removes the object from the OCAF document
Standard_EXPORT bool RemoveObject(Handle(GEOM_BaseObject)& theObject);
- //Saves the OCAF document with ID = theDocID with file with name theFileName
- Standard_EXPORT bool Save(int theDocID, const char* theFileName);
+ //Saves the OCAF document with file with name theFileName
+ Standard_EXPORT bool Save(const char* theFileName);
- //Loads the OCAF document into the application and assigns to it an ID = theDocID
- Standard_EXPORT bool Load(int theDocID, const char* theFileName);
+ //Loads the OCAF document into the application
+ Standard_EXPORT bool Load(const char* theFileName);
- //Closes the document with ID = theDocID
- Standard_EXPORT void Close(int theDocID);
+ //Closes the document
+ Standard_EXPORT void Close();
//Sets the number of Undos (default value = 10)
Standard_EXPORT void SetUndoLimit(int theLimit) { _UndoLimit = theLimit; }
- //Applies an Undo to document with ID = theDocID
- Standard_EXPORT void Undo(int theDocID);
+ //Applies an Undo to document
+ Standard_EXPORT void Undo();
- //Applies an Redo to document with ID = theDocID
- Standard_EXPORT void Redo(int theDocID);
+ //Applies an Redo to document
+ Standard_EXPORT void Redo();
//Adds a new sub-shape object of the MainShape object
Standard_EXPORT Handle(GEOM_Object) AddSubShape(Handle(GEOM_Object) theMainShape,
Handle(TColStd_HArray1OfInteger) theIndices,
bool isStandaloneOperation = false);
- Standard_EXPORT TCollection_AsciiString DumpPython(int theDocID,
- std::vector<TObjectData>& theObjectData,
+ Standard_EXPORT TCollection_AsciiString DumpPython(std::vector<TObjectData>& theObjectData,
TVariablesList theVariables,
bool isPublished,
bool isMultiFile,
Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) GetAllDumpNames() const;
- Standard_EXPORT int addTexture(int theDocID, int theWidth, int theHeight,
+ Standard_EXPORT int addTexture(int theWidth, int theHeight,
const Handle(TColStd_HArray1OfByte)& theTexture,
const TCollection_AsciiString& theFileName = "");
- Standard_EXPORT Handle(TColStd_HArray1OfByte) getTexture(int theDocID, int theTextureID,
+ Standard_EXPORT Handle(TColStd_HArray1OfByte) getTexture(int theTextureID,
int& theWidth, int& theHeight,
TCollection_AsciiString& theFileName);
- Standard_EXPORT std::list<int> getAllTextures(int theDocID);
+ Standard_EXPORT std::list<int> getAllTextures();
static const Standard_GUID& GetTextureGUID();
const TCollection_AsciiString& anEntry,
Resource_DataMapOfAsciiStringAsciiString& aNameToEntry);
- Standard_EXPORT void DocumentModified(const int theDocId, const bool isModified);
-
- Standard_EXPORT bool DocumentModified(const int theDocId);
-
protected:
Standard_EXPORT static void SetEngine(GEOM_Engine* theEngine);
private:
Handle(GEOM_Application) _OCAFApp;
- TColStd_DataMapOfIntegerTransient _mapIDDocument;
- TColStd_MapOfInteger _mapModifiedDocs; // keeps the identifiers of the modified document ids
+ Handle(TDocStd_Document) _document;
int _UndoLimit;
GEOM_DataMapOfAsciiStringTransient _objects;
Resource_DataMapOfAsciiStringAsciiString _studyEntry2NameMap;
- TFreeLabelsList _freeLabels;
+ std::list<TDF_Label> _freeLabels;
};
#endif
if(anEngine == NULL) return NULL;
step = Handle(GEOM_FieldStep)::DownCast
- ( anEngine->AddBaseObject( GetDocID(),GEOM_FIELD_STEP_OBJTYPE ));
+ ( anEngine->AddBaseObject( GEOM_FIELD_STEP_OBJTYPE ));
if ( step.IsNull())
return step;
*/
//=============================================================================
-GEOM_IOperations::GEOM_IOperations(GEOM_Engine* theEngine, int theDocID)
-: _engine(theEngine), _docID(theDocID)
+GEOM_IOperations::GEOM_IOperations(GEOM_Engine* theEngine)
+: _engine(theEngine)
{
_solver = new GEOM_Solver(theEngine);
}
//=============================================================================
void GEOM_IOperations::StartOperation()
{
- Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
+ Handle(TDocStd_Document) aDoc = _engine->GetDocument();
if(aDoc->GetUndoLimit() > 0)
aDoc->NewCommand();
}
//=============================================================================
void GEOM_IOperations::FinishOperation()
{
- Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
+ Handle(TDocStd_Document) aDoc = _engine->GetDocument();
if(aDoc->GetUndoLimit() > 0)
aDoc->CommitCommand();
- _engine->DocumentModified(_docID, true);
}
//=============================================================================
//=============================================================================
void GEOM_IOperations::AbortOperation()
{
- Handle(TDocStd_Document) aDoc = _engine->GetDocument(_docID);
+ Handle(TDocStd_Document) aDoc = _engine->GetDocument();
aDoc->AbortCommand();
}
class GEOM_IOperations
{
public:
- Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOM_IOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOM_IOperations();
//Starts a new operation (opens a tansaction)
//Return a pointer to Solver associated with this operation interface
Standard_EXPORT GEOM_Solver* GetSolver() { return _solver; }
- //Returns an ID of the OCAF document where this operation stores the data
- Standard_EXPORT int GetDocID() { return _docID; }
-
private:
TCollection_AsciiString _errorCode;
GEOM_Engine* _engine;
GEOM_Solver* _solver;
- int _docID;
};
* Update
*/
//=============================================================================
-bool GEOM_Solver::Update(int theDocID, TDF_LabelSequence& theSeq)
+bool GEOM_Solver::Update(TDF_LabelSequence& theSeq)
{
return false;
}
Standard_EXPORT GEOM_Solver(GEOM_Engine* theEngine) :_engine(theEngine) {}
Standard_EXPORT ~GEOM_Solver() {}
- //Update the values of all GEOM_Object in the document theDocID, theSeq will contain a list of touched labels
+ //Update the values of all GEOM_Object in the document, theSeq will contain a list of touched labels
//Note: not Implemented
- Standard_EXPORT bool Update(int theDocID, TDF_LabelSequence& theSeq);
+ Standard_EXPORT bool Update(TDF_LabelSequence& theSeq);
//Updates a value of theObject, theSeq will contain a list of touched labels
//Note: not implemented
GEOM_Displayer* GEOMBase_Helper::getDisplayer()
{
if ( !myDisplayer )
- myDisplayer = new GEOM_Displayer( getStudy() );
+ myDisplayer = new GEOM_Displayer();
return myDisplayer;
}
#include <QHash>
GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app )
- : myDisplayer(NULL)
{
myStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- myDisplayer = GEOM_Displayer( myStudy );
+ myDisplayer = GEOM_Displayer();
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
myVisibleIcon = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
* Constructor
*/
//=================================================================
-GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st )
+GEOM_Displayer::GEOM_Displayer()
{
- if( st )
- myApp = dynamic_cast<SalomeApp_Application*>( st->application() );
- else
- myApp = 0;
+ SUIT_Session* session = SUIT_Session::session();
+ myApp = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
/* Shading Color */
- SUIT_Session* session = SUIT_Session::session();
SUIT_ResourceMgr* resMgr = session->resourceMgr();
QColor col = resMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) );
int aMgrId = !anIO.IsNull() ? getViewManagerId( myViewFrame ) : -1;
// get presentation properties
- PropMap propMap = getObjectProperties( study, entry, myViewFrame );
+ PropMap propMap = getObjectProperties( entry, myViewFrame );
// Temporary staff: vertex must be infinite for correct visualization
AISShape->SetInfiniteState( myShape.Infinite() ); // || myShape.ShapeType() == TopAbs_VERTEX // VSR: 05/04/2010: Fix 20668 (Fit All for points & lines)
aImagePath = GetTexture().c_str();
if ( ! entry.isEmpty() ) {
// check that study is active
- SalomeApp_Study* study = getActiveStudy();
+ SalomeApp_Study* study = getStudy();
if ( study ) {
// Store the texture in object properties for next displays
study->setObjectProperty( aMgrId, entry, GEOM::propertyName( GEOM::Texture ), QString( GetTexture().c_str() ) );
study->setObjectProperty( aMgrId, entry, GEOM::propertyName( GEOM::DisplayMode ), 3 );
// Update propeties map
- propMap = getObjectProperties( study, entry, myViewFrame );
+ propMap = getObjectProperties( entry, myViewFrame );
}
}
}
int textureId = aList[0].toInt();
Standard_Integer aWidth, aHeight;
Handle(TColStd_HArray1OfByte) aTexture =
- GeometryGUI::getTexture( study, textureId, aWidth, aHeight );
+ GeometryGUI::getTexture( textureId, aWidth, aHeight );
if ( !aTexture.IsNull() ) {
Handle(Prs3d_PointAspect) aTextureAspect =
new Prs3d_PointAspect( HasColor() ?
int aMgrId = !anIO.IsNull() ? getViewManagerId( myViewFrame ) : -1;
// get presentation properties
- PropMap propMap = getObjectProperties( study, entry, myViewFrame );
+ PropMap propMap = getObjectProperties( entry, myViewFrame );
QColor c;
/////////////////////////////////////////////////////////////////////////
// set interactive object
setIO( theIO );
// Find SOBject (because shape should be published previously)
- SUIT_Session* session = SUIT_Session::session();
- SUIT_Application* app = session->activeApplication();
- if ( app )
+ if ( getStudy() )
{
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( study )
+ _PTR(SObject) SO ( getStudy()->studyDS()->FindObjectID( theIO->getEntry() ) );
+ if ( SO )
{
- _PTR(SObject) SO ( study->studyDS()->FindObjectID( theIO->getEntry() ) );
- if ( SO )
+ // get CORBA reference to data object
+ CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO);
+ if ( !CORBA::is_nil( object ) )
{
- // get CORBA reference to data object
- CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO);
- if ( !CORBA::is_nil( object ) )
+ // downcast to GEOM base object
+ GEOM::GEOM_BaseObject_var GeomBaseObject = GEOM::GEOM_BaseObject::_narrow( object );
+ if ( !GeomBaseObject->_is_nil() )
{
- // downcast to GEOM base object
- GEOM::GEOM_BaseObject_var GeomBaseObject = GEOM::GEOM_BaseObject::_narrow( object );
- if ( !GeomBaseObject->_is_nil() )
- {
- myType = GeomBaseObject->GetType();
+ myType = GeomBaseObject->GetType();
- // downcast to GEOM object
- GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject );
- if ( myType == GEOM_FIELD_STEP )
+ // downcast to GEOM object
+ GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( GeomBaseObject );
+ if ( myType == GEOM_FIELD_STEP )
+ {
+ // get the GEOM object from the field's shape
+ GEOM::GEOM_FieldStep_var GeomFieldStep = GEOM::GEOM_FieldStep::_narrow( GeomBaseObject );
+ if ( !GeomFieldStep->_is_nil() )
{
- // get the GEOM object from the field's shape
- GEOM::GEOM_FieldStep_var GeomFieldStep = GEOM::GEOM_FieldStep::_narrow( GeomBaseObject );
- if ( !GeomFieldStep->_is_nil() )
- {
- GEOM::GEOM_Field_var GeomField = GeomFieldStep->GetField();
- if ( !GeomField->_is_nil() )
- GeomObject = GeomField->GetShape();
- }
-
- // read the field step information
- readFieldStepInfo( GeomFieldStep );
+ GEOM::GEOM_Field_var GeomField = GeomFieldStep->GetField();
+ if ( !GeomField->_is_nil() )
+ GeomObject = GeomField->GetShape();
}
- if ( !GeomObject->_is_nil() )
- {
- theIO->setName( GeomObject->GetName() );
- // finally set shape
- setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) );
- }
+ // read the field step information
+ readFieldStepInfo( GeomFieldStep );
+ }
+
+ if ( !GeomObject->_is_nil() )
+ {
+ theIO->setName( GeomObject->GetName() );
+ // finally set shape
+ setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) );
}
}
}
return aSColor;
}
-PropMap GEOM_Displayer::getObjectProperties( SalomeApp_Study* study,
- const QString& entry,
+PropMap GEOM_Displayer::getObjectProperties( const QString& entry,
SALOME_View* view )
{
// get default properties for the explicitly specified default view type
PropMap propMap = GEOM_Displayer::getDefaultPropertyMap();
- if ( study && view ) {
+ if ( getStudy() && view ) {
SUIT_ViewModel* viewModel = dynamic_cast<SUIT_ViewModel*>( view );
SUIT_ViewManager* viewMgr = ( viewModel != 0 ) ? viewModel->getViewManager() : 0;
int viewId = ( viewMgr != 0 ) ? viewMgr->getGlobalId() : -1;
if ( viewModel && viewId != -1 ) {
// get properties from the study
- PropMap storedMap = study->getObjectProperties( viewId, entry );
+ PropMap storedMap = getStudy()->getObjectProperties( viewId, entry );
// overwrite default properties from stored ones (that are specified)
for ( int prop = GEOM::Visibility; prop <= GEOM::LastProperty; prop++ ) {
if ( storedMap.contains( GEOM::propertyName( (GEOM::Property)prop ) ) )
if ( !entry.isEmpty() ) {
// get CORBA reference to geom object
- _PTR(SObject) SO( study->studyDS()->FindObjectID( entry.toStdString() ) );
+ _PTR(SObject) SO( getStudy()->studyDS()->FindObjectID( entry.toStdString() ) );
if ( SO ) {
CORBA::Object_var object = GeometryGUI::ClientSObjectToObject( SO );
if ( !CORBA::is_nil( object ) ) {
void GEOM_Displayer::EraseWithChildren(const Handle(SALOME_InteractiveObject)& theIO,
- const bool eraseOnlyChildren) {
- SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
- if ( !app )
- return;
-
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !appStudy )
- return;
-
- LightApp_DataObject* parent = appStudy->findObjectByEntry(theIO->getEntry());
+ const bool eraseOnlyChildren)
+{
+ LightApp_DataObject* parent = getStudy()->findObjectByEntry(theIO->getEntry());
if( !parent)
return;
// Erase from all views
QList<SALOME_View*> views;
SALOME_View* view;
- ViewManagerList vmans = app->viewManagers();
+ ViewManagerList vmans = myApp->viewManagers();
SUIT_ViewManager* vman;
foreach ( vman, vmans ) {
SUIT_ViewModel* vmod = vman->getViewModel();
void GEOM_Displayer::UpdateColorScale( const bool theIsRedisplayFieldSteps, const bool updateViewer )
{
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
- if( !aStudy )
- return;
-
SOCC_Viewer* aViewModel = dynamic_cast<SOCC_Viewer*>( GetActiveView() );
if( !aViewModel )
return;
if( theIsRedisplayFieldSteps )
{
- _PTR(Study) aStudyDS = aStudy->studyDS();
+ _PTR(Study) aStudyDS = getStudy()->studyDS();
QList<SUIT_ViewManager*> vmList;
myApp->viewManagers( vmList );
for( QList<SUIT_ViewManager*>::Iterator vmIt = vmList.begin(); vmIt != vmList.end(); vmIt++ )
{
if( SUIT_ViewManager* aViewManager = *vmIt )
{
- const ObjMap& anObjects = aStudy->getObjectProperties( aViewManager->getGlobalId() );
+ const ObjMap& anObjects = getStudy()->getObjectProperties( aViewManager->getGlobalId() );
for( ObjMap::ConstIterator objIt = anObjects.begin(); objIt != anObjects.end(); objIt++ )
{
_PTR(SObject) aSObj( aStudyDS->FindObjectID( objIt.key().toLatin1().constData() ) );
public:
/* Constructor */
- GEOM_Displayer( SalomeApp_Study* app );
+ GEOM_Displayer();
/* Destructor */
virtual ~GEOM_Displayer();
void updateActorProperties( GEOM_Actor*, bool );
void updateDimensions( const Handle(SALOME_InteractiveObject)&, SALOME_OCCPrs*, const gp_Ax3& );
- PropMap getObjectProperties( SalomeApp_Study*, const QString&, SALOME_View* = 0 );
+ PropMap getObjectProperties( const QString&, SALOME_View* = 0 );
PropMap getDefaultPropertyMap();
/* Methods for reading the field step information */
SalomeApp_Study* appStudy = dynamic_cast< SalomeApp_Study* >( getApp()->activeStudy() );
if (!appStudy) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
void GeometryGUI::updateFieldColorScale()
{
- if( SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) )
- {
- GEOM_Displayer aDisplayer( aStudy );
- aDisplayer.UpdateColorScale();
- }
+ GEOM_Displayer aDisplayer;
+ aDisplayer.UpdateColorScale();
}
QString GeometryGUI::engineIOR() const
param == QString("scalar_bar_height") ||
param == QString("scalar_bar_text_height") ||
param == QString("scalar_bar_nb_intervals")) {
- if( SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) )
- {
- GEOM_Displayer aDisplayer( aStudy );
- bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals");
- aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true );
- }
+ GEOM_Displayer aDisplayer;
+ bool anIsRedisplayFieldSteps = param == QString("scalar_bar_nb_intervals");
+ aDisplayer.UpdateColorScale( anIsRedisplayFieldSteps, true );
}
else if ( param == QString("dimensions_color") ||
param == QString("dimensions_line_width") ||
return;
}
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
- if ( !aStudy )
- {
- return;
- }
-
- GEOM_Displayer aDisplayer( aStudy );
+ GEOM_Displayer aDisplayer;
ViewManagerList aVMs;
anApp->viewManagers( OCCViewer_Viewer::Type(), aVMs );
LightApp_Displayer* GeometryGUI::displayer()
{
if ( !myDisplayer )
- myDisplayer = new GEOM_Displayer( dynamic_cast<SalomeApp_Study*>( getApp()->activeStudy() ) );
+ myDisplayer = new GEOM_Displayer();
return myDisplayer;
}
bool isMode = false;
SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
SUIT_ViewWindow* viewWindow = app->desktop()->activeWindow();
- GEOM_Displayer displayer( aStudy );
+ GEOM_Displayer displayer;
int aMgrId = viewWindow->getViewManager()->getGlobalId();
SALOME_View* window = displayer.GetActiveView();
TCollection_AsciiString asciiIOR( (char *)IOR.in() );
GEOM_Client::get_client().RemoveShapeFromBuffer( asciiIOR );
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
- if ( !appStudy )
- return;
+ SalomeApp_Application* app =
+ dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication());
+ SalomeApp_Study* appStudy = app ? dynamic_cast<SalomeApp_Study*>( app->activeStudy() ) : 0;
- _PTR(Study) aStudy = appStudy->studyDS();
+ if (!appStudy)
+ return;
+
+ _PTR(Study) aStudy = appStudy->studyDS();
if ( !aStudy )
return;
if (aFileName.IsEmpty() || aFormatName.IsEmpty() || aLibName.IsEmpty())
return 0;
- if( !GEOMImpl_IECallBack::GetCallBack( aFormatName )->Export( GetDocID(), obj, aFileName, aFormatName ) );
+ if( !GEOMImpl_IECallBack::GetCallBack( aFormatName )->Export( obj, aFileName, aFormatName ) );
return 0;
#if OCC_VERSION_MAJOR < 7
GEOMImpl_Gen::GEOMImpl_Gen()
{
MESSAGE("GEOMImpl_Gen::GEOMImpl_Gen");
- _mapOfBasicOperations.clear();
// Basic elements
TFunction_DriverTable::Get()->AddDriver(GEOMImpl_PointDriver::GetID(), new GEOMImpl_PointDriver());
{
MESSAGE("GEOMImpl_Gen::~GEOMImpl_Gen");
- std::map<int, GEOMImpl_IBasicOperations*>::iterator aBasicIter = _mapOfBasicOperations.begin();
- for (; aBasicIter != _mapOfBasicOperations.end(); aBasicIter++)
- delete (*aBasicIter).second;
-
- std::map<int, GEOMImpl_ITransformOperations*>::iterator aTransformIter = _mapOfTransformOperations.begin();
- for (; aTransformIter != _mapOfTransformOperations.end(); aTransformIter++)
- delete (*aTransformIter).second;
-
- std::map<int, GEOMImpl_I3DPrimOperations*>::iterator a3DPrimIter = _mapOf3DPrimOperations.begin();
- for (; a3DPrimIter != _mapOf3DPrimOperations.end(); a3DPrimIter++)
- delete (*a3DPrimIter).second;
-
- std::map<int, GEOMImpl_IShapesOperations*>::iterator aShapesIter = _mapOfShapesOperations.begin();
- for (; aShapesIter != _mapOfShapesOperations.end(); aShapesIter++)
- delete (*aShapesIter).second;
-
- std::map<int, GEOMImpl_IBlocksOperations*>::iterator aBlocksIter = _mapOfBlocksOperations.begin();
- for (; aBlocksIter != _mapOfBlocksOperations.end(); aBlocksIter++)
- delete (*aBlocksIter).second;
-
- std::map<int, GEOMImpl_IBooleanOperations*>::iterator aBooleanIter = _mapOfBooleanOperations.begin();
- for (; aBooleanIter != _mapOfBooleanOperations.end(); aBooleanIter++)
- delete (*aBooleanIter).second;
-
- std::map<int, GEOMImpl_IHealingOperations*>::iterator aHealingIter = _mapOfHealingOperations.begin();
- for (; aHealingIter != _mapOfHealingOperations.end(); aHealingIter++)
- delete (*aHealingIter).second;
-
- std::map<int, GEOMImpl_ICurvesOperations*>::iterator aCurvesIter = _mapOfCurvesOperations.begin();
- for (; aCurvesIter != _mapOfCurvesOperations.end(); aCurvesIter++)
- delete (*aCurvesIter).second;
-
- std::map<int, GEOMImpl_ILocalOperations*>::iterator aLocalIter = _mapOfLocalOperations.begin();
- for (; aLocalIter != _mapOfLocalOperations.end(); aLocalIter++)
- delete (*aLocalIter).second;
-
- std::map<int, GEOMImpl_IInsertOperations*>::iterator aInsertIter = _mapOfInsertOperations.begin();
- for (; aInsertIter != _mapOfInsertOperations.end(); aInsertIter++)
- delete (*aInsertIter).second;
-
- std::map<int, GEOMImpl_IMeasureOperations*>::iterator aMeasureIter = _mapOfMeasureOperations.begin();
- for (; aMeasureIter != _mapOfMeasureOperations.end(); aMeasureIter++)
- delete (*aMeasureIter).second;
-
- std::map<int, GEOMImpl_IGroupOperations*>::iterator aGroupIter = _mapOfGroupOperations.begin();
- for (; aGroupIter != _mapOfGroupOperations.end(); aGroupIter++)
- delete (*aGroupIter).second;
-
- std::map<int, GEOMImpl_IFieldOperations*>::iterator aFieldIter = _mapOfFieldOperations.begin();
- for (; aFieldIter != _mapOfFieldOperations.end(); aFieldIter++)
- delete (*aFieldIter).second;
+ delete _BasicOperations;
+ delete _TransformOperations;
+ delete _3DPrimOperations;
+ delete _ShapesOperations;
+ delete _BlocksOperations;
+ delete _BooleanOperations;
+ delete _HealingOperations;
+ delete _CurvesOperations;
+ delete _LocalOperations;
+ delete _InsertOperations;
+ delete _MeasureOperations;
+ delete _GroupOperations;
+ delete _FieldOperations;
}
//=============================================================================
* GetIBasicOperations
*/
//=============================================================================
-GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations(int theDocID)
+GEOMImpl_IBasicOperations* GEOMImpl_Gen::GetIBasicOperations()
{
- if(_mapOfBasicOperations.find(theDocID) == _mapOfBasicOperations.end()) {
- _mapOfBasicOperations[theDocID] = new GEOMImpl_IBasicOperations(this, theDocID);
- }
-
- return _mapOfBasicOperations[theDocID];
+ return _BasicOperations;
}
//=============================================================================
* GetITransformOperations
*/
//=============================================================================
-GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations(int theDocID)
+GEOMImpl_ITransformOperations* GEOMImpl_Gen::GetITransformOperations()
{
- if(_mapOfTransformOperations.find(theDocID) == _mapOfTransformOperations.end()) {
- _mapOfTransformOperations[theDocID] = new GEOMImpl_ITransformOperations(this, theDocID);
- }
-
- return _mapOfTransformOperations[theDocID];
+ return _TransformOperations;
}
//=============================================================================
* GetIBooleanOperations
*/
//=============================================================================
-GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations(int theDocID)
+GEOMImpl_IBooleanOperations* GEOMImpl_Gen::GetIBooleanOperations()
{
- if(_mapOfBooleanOperations.find(theDocID) == _mapOfBooleanOperations.end()) {
- _mapOfBooleanOperations[theDocID] = new GEOMImpl_IBooleanOperations(this, theDocID);
- }
-
- return _mapOfBooleanOperations[theDocID];
+ return _BooleanOperations;
}
//=============================================================================
* GetIHealingOperations
*/
//=============================================================================
-GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations(int theDocID)
+GEOMImpl_IHealingOperations* GEOMImpl_Gen::GetIHealingOperations()
{
- if(_mapOfHealingOperations.find(theDocID) == _mapOfHealingOperations.end()) {
- _mapOfHealingOperations[theDocID] = new GEOMImpl_IHealingOperations(this, theDocID);
- }
-
- return _mapOfHealingOperations[theDocID];
+ return _HealingOperations;
}
//=============================================================================
* GetI3DPrimOperations
*/
//=============================================================================
-GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations(int theDocID)
+GEOMImpl_I3DPrimOperations* GEOMImpl_Gen::GetI3DPrimOperations()
{
- if(_mapOf3DPrimOperations.find(theDocID) == _mapOf3DPrimOperations.end()) {
- _mapOf3DPrimOperations[theDocID] = new GEOMImpl_I3DPrimOperations(this, theDocID);
- }
-
- return _mapOf3DPrimOperations[theDocID];
+ return _3DPrimOperations;
}
//=============================================================================
* GetIShapesOperations
*/
//=============================================================================
-GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations(int theDocID)
+GEOMImpl_IShapesOperations* GEOMImpl_Gen::GetIShapesOperations()
{
- if(_mapOfShapesOperations.find(theDocID) == _mapOfShapesOperations.end()) {
- _mapOfShapesOperations[theDocID] = new GEOMImpl_IShapesOperations(this, theDocID);
- }
-
- return _mapOfShapesOperations[theDocID];
+ return _ShapesOperations;
}
//=============================================================================
* GetIBlocksOperations
*/
//=============================================================================
-GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations(int theDocID)
+GEOMImpl_IBlocksOperations* GEOMImpl_Gen::GetIBlocksOperations()
{
- if(_mapOfBlocksOperations.find(theDocID) == _mapOfBlocksOperations.end()) {
- _mapOfBlocksOperations[theDocID] = new GEOMImpl_IBlocksOperations(this, theDocID);
- }
-
- return _mapOfBlocksOperations[theDocID];
+ return _BlocksOperations;
}
//=============================================================================
* GetICurvesOperations
*/
//=============================================================================
-GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations(int theDocID)
+GEOMImpl_ICurvesOperations* GEOMImpl_Gen::GetICurvesOperations()
{
- if(_mapOfCurvesOperations.find(theDocID) == _mapOfCurvesOperations.end()) {
- _mapOfCurvesOperations[theDocID] = new GEOMImpl_ICurvesOperations(this, theDocID);
- }
-
- return _mapOfCurvesOperations[theDocID];
+ return _CurvesOperations;
}
//=============================================================================
* GetILocalOperations
*/
//=============================================================================
-GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations(int theDocID)
+GEOMImpl_ILocalOperations* GEOMImpl_Gen::GetILocalOperations()
{
- if(_mapOfLocalOperations.find(theDocID) == _mapOfLocalOperations.end()) {
- _mapOfLocalOperations[theDocID] = new GEOMImpl_ILocalOperations(this, theDocID);
- }
-
- return _mapOfLocalOperations[theDocID];
+ return _LocalOperations;
}
//=============================================================================
* GetIInsertOperations
*/
//=============================================================================
-GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations(int theDocID)
+GEOMImpl_IInsertOperations* GEOMImpl_Gen::GetIInsertOperations()
{
- if(_mapOfInsertOperations.find(theDocID) == _mapOfInsertOperations.end()) {
- _mapOfInsertOperations[theDocID] = new GEOMImpl_IInsertOperations(this, theDocID);
- }
-
- return _mapOfInsertOperations[theDocID];
+ return _InsertOperations;
}
//=============================================================================
* GetIMeasureOperations
*/
//=============================================================================
-GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations(int theDocID)
+GEOMImpl_IMeasureOperations* GEOMImpl_Gen::GetIMeasureOperations()
{
- if(_mapOfMeasureOperations.find(theDocID) == _mapOfMeasureOperations.end()) {
- _mapOfMeasureOperations[theDocID] = new GEOMImpl_IMeasureOperations(this, theDocID);
- }
-
- return _mapOfMeasureOperations[theDocID];
+ return _MeasureOperations;
}
//=============================================================================
* GetIGroupOperations
*/
//=============================================================================
-GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations(int theDocID)
+GEOMImpl_IGroupOperations* GEOMImpl_Gen::GetIGroupOperations()
{
- if(_mapOfGroupOperations.find(theDocID) == _mapOfGroupOperations.end()) {
- _mapOfGroupOperations[theDocID] = new GEOMImpl_IGroupOperations(this, theDocID);
- }
-
- return _mapOfGroupOperations[theDocID];
+ return _GroupOperations;
}
//=============================================================================
* GetIFieldOperations
*/
//=============================================================================
-GEOMImpl_IFieldOperations* GEOMImpl_Gen::GetIFieldOperations(int theDocID)
+GEOMImpl_IFieldOperations* GEOMImpl_Gen::GetIFieldOperations()
{
- if(_mapOfFieldOperations.find(theDocID) == _mapOfFieldOperations.end()) {
- _mapOfFieldOperations[theDocID] = new GEOMImpl_IFieldOperations(this, theDocID);
- }
-
- return _mapOfFieldOperations[theDocID];
+ return _FieldOperations;
}
GEOMImpl_Gen();
~GEOMImpl_Gen();
- GEOMImpl_IBasicOperations* GetIBasicOperations(int theDocID);
+ GEOMImpl_IBasicOperations* GetIBasicOperations();
- GEOMImpl_ITransformOperations* GetITransformOperations(int theDocID);
+ GEOMImpl_ITransformOperations* GetITransformOperations();
- GEOMImpl_I3DPrimOperations* GetI3DPrimOperations(int theDocID);
+ GEOMImpl_I3DPrimOperations* GetI3DPrimOperations();
- GEOMImpl_IShapesOperations* GetIShapesOperations(int theDocID);
+ GEOMImpl_IShapesOperations* GetIShapesOperations();
- GEOMImpl_IBlocksOperations* GetIBlocksOperations(int theDocID);
+ GEOMImpl_IBlocksOperations* GetIBlocksOperations();
- GEOMImpl_IMeasureOperations* GetIMeasureOperations(int theDocID);
+ GEOMImpl_IMeasureOperations* GetIMeasureOperations();
- GEOMImpl_IBooleanOperations* GetIBooleanOperations(int theDocID);
+ GEOMImpl_IBooleanOperations* GetIBooleanOperations();
- GEOMImpl_ICurvesOperations* GetICurvesOperations(int theDocID);
+ GEOMImpl_ICurvesOperations* GetICurvesOperations();
- GEOMImpl_ILocalOperations* GetILocalOperations(int theDocID);
+ GEOMImpl_ILocalOperations* GetILocalOperations();
- GEOMImpl_IInsertOperations* GetIInsertOperations(int theDocID);
+ GEOMImpl_IInsertOperations* GetIInsertOperations();
- GEOMImpl_IHealingOperations* GetIHealingOperations(int theDocID);
+ GEOMImpl_IHealingOperations* GetIHealingOperations();
- GEOMImpl_IGroupOperations* GetIGroupOperations(int theDocID);
+ GEOMImpl_IGroupOperations* GetIGroupOperations();
- GEOMImpl_IFieldOperations* GetIFieldOperations(int theDocID);
+ GEOMImpl_IFieldOperations* GetIFieldOperations();
private:
- std::map <int, GEOMImpl_IBasicOperations*> _mapOfBasicOperations;
- std::map <int, GEOMImpl_ITransformOperations*> _mapOfTransformOperations;
- std::map <int, GEOMImpl_I3DPrimOperations*> _mapOf3DPrimOperations;
- std::map <int, GEOMImpl_IShapesOperations*> _mapOfShapesOperations;
- std::map <int, GEOMImpl_IBlocksOperations*> _mapOfBlocksOperations;
- std::map <int, GEOMImpl_IBooleanOperations*> _mapOfBooleanOperations;
- std::map <int, GEOMImpl_IHealingOperations*> _mapOfHealingOperations;
- std::map <int, GEOMImpl_ICurvesOperations*> _mapOfCurvesOperations;
- std::map <int, GEOMImpl_ILocalOperations*> _mapOfLocalOperations;
- std::map <int, GEOMImpl_IInsertOperations*> _mapOfInsertOperations;
- std::map <int, GEOMImpl_IMeasureOperations*> _mapOfMeasureOperations;
- std::map <int, GEOMImpl_IGroupOperations*> _mapOfGroupOperations;
- std::map <int, GEOMImpl_IFieldOperations*> _mapOfFieldOperations;
+ GEOMImpl_IBasicOperations* _BasicOperations;
+ GEOMImpl_ITransformOperations* _TransformOperations;
+ GEOMImpl_I3DPrimOperations* _3DPrimOperations;
+ GEOMImpl_IShapesOperations* _ShapesOperations;
+ GEOMImpl_IBlocksOperations* _BlocksOperations;
+ GEOMImpl_IBooleanOperations* _BooleanOperations;
+ GEOMImpl_IHealingOperations* _HealingOperations;
+ GEOMImpl_ICurvesOperations* _CurvesOperations;
+ GEOMImpl_ILocalOperations* _LocalOperations;
+ GEOMImpl_IInsertOperations* _InsertOperations;
+ GEOMImpl_IMeasureOperations* _MeasureOperations;
+ GEOMImpl_IGroupOperations* _GroupOperations;
+ GEOMImpl_IFieldOperations* _FieldOperations;
};
#endif
* constructor:
*/
//=============================================================================
-GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations");
- myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
+ myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine());
}
//=============================================================================
SetErrorCode(KO);
//Add a new Box object
- Handle(GEOM_Object) aBox = GetEngine()->AddObject(GetDocID(), GEOM_BOX);
+ Handle(GEOM_Object) aBox = GetEngine()->AddObject(GEOM_BOX);
//Add a new Box function with DX_DY_DZ parameters
Handle(GEOM_Function) aFunction = aBox->AddFunction(GEOMImpl_BoxDriver::GetID(), BOX_DX_DY_DZ);
if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
//Add a new Box object
- Handle(GEOM_Object) aBox = GetEngine()->AddObject(GetDocID(), GEOM_BOX);
+ Handle(GEOM_Object) aBox = GetEngine()->AddObject(GEOM_BOX);
//Add a new Box function for creation a box relatively to two points
Handle(GEOM_Function) aFunction = aBox->AddFunction(GEOMImpl_BoxDriver::GetID(), BOX_TWO_PNT);
if (theH == 0 || theW == 0) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Box function for creation a box relatively to two points
Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_H_W);
if (theObj.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Box function for creation a box relatively to two points
Handle(GEOM_Function) aFunction = aFace->AddFunction(GEOMImpl_FaceDriver::GetID(), FACE_OBJ_H_W);
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Disk object
- Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE);
//Add a new Disk function for creation a disk relatively to point and vector
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Disk object
- Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE);
//Add a new Disk function for creation a disk relatively to three points
Handle(GEOM_Function) aFunction =
if (theR == 0 ) return NULL;
//Add a new Disk object
- Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aDisk = GetEngine()->AddObject(GEOM_FACE);
//Add a new Box function for creation a box relatively to two points
Handle(GEOM_Function) aFunction = aDisk->AddFunction(GEOMImpl_DiskDriver::GetID(), DISK_R);
SetErrorCode(KO);
//Add a new Cylinder object
- Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER);
//Add a new Cylinder function with R and H parameters
Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H);
SetErrorCode(KO);
//Add a new Cylinder object
- Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER);
//Add a new Cylinder function with R and H parameters
Handle(GEOM_Function) aFunction = aCylinder->AddFunction(GEOMImpl_CylinderDriver::GetID(), CYLINDER_R_H_A);
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Cylinder object
- Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER);
//Add a new Cylinder function for creation a cylinder relatively to point and vector
Handle(GEOM_Function) aFunction =
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Cylinder object
- Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GetDocID(), GEOM_CYLINDER);
+ Handle(GEOM_Object) aCylinder = GetEngine()->AddObject(GEOM_CYLINDER);
//Add a new Cylinder function for creation a cylinder relatively to point and vector
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Cone object
- Handle(GEOM_Object) aCone = GetEngine()->AddObject(GetDocID(), GEOM_CONE);
+ Handle(GEOM_Object) aCone = GetEngine()->AddObject(GEOM_CONE);
//Add a new Cone function with R and H parameters
Handle(GEOM_Function) aFunction =
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Cone object
- Handle(GEOM_Object) aCone = GetEngine()->AddObject(GetDocID(), GEOM_CONE);
+ Handle(GEOM_Object) aCone = GetEngine()->AddObject(GEOM_CONE);
//Add a new Cone function for creation a cone relatively to point and vector
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Sphere object
- Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GetDocID(), GEOM_SPHERE);
+ Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GEOM_SPHERE);
//Add a new Sphere function with R parameter
Handle(GEOM_Function) aFunction = aSphere->AddFunction(GEOMImpl_SphereDriver::GetID(), SPHERE_R);
if (thePnt.IsNull()) return NULL;
//Add a new Point object
- Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GetDocID(), GEOM_SPHERE);
+ Handle(GEOM_Object) aSphere = GetEngine()->AddObject(GEOM_SPHERE);
//Add a new Sphere function for creation a sphere relatively to point
Handle(GEOM_Function) aFunction = aSphere->AddFunction(GEOMImpl_SphereDriver::GetID(), SPHERE_PNT_R);
SetErrorCode(KO);
//Add a new Torus object
- Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_TORUS);
+ Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_TORUS);
//Add a new Torus function
Handle(GEOM_Function) aFunction =
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Torus object
- Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_TORUS);
+ Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_TORUS);
//Add a new Torus function
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || theVec.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism relatively to vector
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || theVec.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism relatively to vector
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism relatively to two points
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || thePoint1.IsNull() || thePoint2.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism relatively to two points
Handle(GEOM_Function) aFunction =
if (theBase.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism by DXDYDZ
Handle(GEOM_Function) aFunction =
if (theBase.IsNull()) return NULL;
//Add a new Prism object
- Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GetDocID(), GEOM_PRISM);
+ Handle(GEOM_Object) aPrism = GetEngine()->AddObject(GEOM_PRISM);
//Add a new Prism function for creation a Prism by DXDYDZ
Handle(GEOM_Function) aFunction =
if ( theFuse )
{
//Add a new Extruded Boss object
- aPrism = GetEngine()->AddObject(GetDocID(), GEOM_EXTRUDED_BOSS);
+ aPrism = GetEngine()->AddObject(GEOM_EXTRUDED_BOSS);
}
else
{
//Add a new Extruded Cut object
- aPrism = GetEngine()->AddObject(GetDocID(), GEOM_EXTRUDED_CUT);
+ aPrism = GetEngine()->AddObject(GEOM_EXTRUDED_CUT);
}
//Add a new Prism function for the creation of a Draft Prism feature
if (theBase.IsNull() || thePath.IsNull()) return NULL;
//Add a new Pipe object
- Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+ Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GEOM_PIPE);
//Add a new Pipe function
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || theAxis.IsNull()) return NULL;
//Add a new Revolution object
- Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION);
+ Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GEOM_REVOLUTION);
//Add a new Revolution function for creation a revolution relatively to axis
Handle(GEOM_Function) aFunction =
if (theBase.IsNull() || theAxis.IsNull()) return NULL;
//Add a new Revolution object
- Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GetDocID(), GEOM_REVOLUTION);
+ Handle(GEOM_Object) aRevolution = GetEngine()->AddObject(GEOM_REVOLUTION);
//Add a new Revolution function for creation a revolution relatively to axis
Handle(GEOM_Function) aFunction =
return NULL;
}
//Add a new Filling object
- Handle(GEOM_Object) aFilling = GetEngine()->AddObject(GetDocID(), GEOM_FILLING);
+ Handle(GEOM_Object) aFilling = GetEngine()->AddObject(GEOM_FILLING);
//Add a new Filling function for creation a filling from a compound
Handle(GEOM_Function) aFunction = aFilling->AddFunction(GEOMImpl_FillingDriver::GetID(), BASIC_FILLING);
return anObj;
//Add a new ThruSections object
- Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GetDocID(), GEOM_THRUSECTIONS);
+ Handle(GEOM_Object) aThruSect = GetEngine()->AddObject(GEOM_THRUSECTIONS);
//Add a new ThruSections function
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
- Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+ Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE);
//Add a new Pipe function
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
- Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+ Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE);
//Add a new Pipe function
Standard_Integer nbLocs = (theLocations.IsNull() ? 0 :theLocations->Length());
//Add a new Pipe object
- Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+ Handle(GEOM_Object) aPipeDS = GetEngine()->AddObject(GEOM_PIPE);
//Add a new Pipe function
if (theBase.IsNull() || thePath.IsNull() || theVec.IsNull()) return NULL;
//Add a new Pipe object
- Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GetDocID(), GEOM_PIPE);
+ Handle(GEOM_Object) aPipe = GetEngine()->AddObject(GEOM_PIPE);
//Add a new Pipe function
Handle(GEOM_Function) aFunction =
if (isCopy)
{
//Add a new Copy object
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_OffsetDriver::GetID(), OFFSET_THICKENING_COPY);
}
else
if (theShape.IsNull() || theBase1.IsNull() || theBase2.IsNull()) return NULL;
// Add a new Path object
- Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH);
+ Handle(GEOM_Object) aPath = GetEngine()->AddObject(GEOM_PIPE_PATH);
// Add a new Path function
Handle(GEOM_Function) aFunction =
return NULL;
// Add a new Path object
- Handle(GEOM_Object) aPath = GetEngine()->AddObject(GetDocID(), GEOM_PIPE_PATH);
+ Handle(GEOM_Object) aPath = GetEngine()->AddObject(GEOM_PIPE_PATH);
// Add a new Path function
Handle(GEOM_Function) aFunction =
class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_I3DPrimOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_I3DPrimOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_I3DPrimOperations();
Standard_EXPORT Handle(GEOM_Object) MakeBoxDXDYDZ (double theDX, double theDY, double theDZ);
* constructor
*/
//=============================================================================
-GEOMImpl_IBaseIEOperations::GEOMImpl_IBaseIEOperations(GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IBaseIEOperations::GEOMImpl_IBaseIEOperations(GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
- myGroupOperations = new GEOMImpl_IGroupOperations( GetEngine(), GetDocID() );
- myFieldOperations = new GEOMImpl_IFieldOperations( GetEngine(), GetDocID() );
- myShapesOperations = new GEOMImpl_IShapesOperations( GetEngine(), GetDocID() );
+ myGroupOperations = new GEOMImpl_IGroupOperations( GetEngine() );
+ myFieldOperations = new GEOMImpl_IFieldOperations( GetEngine() );
+ myShapesOperations = new GEOMImpl_IShapesOperations( GetEngine() );
}
//=============================================================================
class GEOMImpl_IBaseIEOperations : public GEOM_IOperations
{
public:
- Standard_EXPORT GEOMImpl_IBaseIEOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IBaseIEOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IBaseIEOperations();
protected:
* constructor:
*/
//=============================================================================
-GEOMImpl_IBasicOperations::GEOMImpl_IBasicOperations(GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IBasicOperations::GEOMImpl_IBasicOperations(GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IBasicOperations::GEOMImpl_IBasicOperations");
}
SetErrorCode(KO);
//Add a new Point object
- Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+ Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT);
//Add a new Point function with XYZ parameters
Handle(GEOM_Function) aFunction =
if (theReference.IsNull()) return NULL;
//Add a new Point object
- Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+ Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT);
//Add a new Point function for creation a point relativley another point
Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_XYZ_REF);
if (theGeomObj.IsNull()) return NULL;
//Add a new Point object
- Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+ Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT);
//Add a new Point function for creation a point relativley another point
int fType = POINT_CURVE_PAR;
if (theLine1.IsNull() || theLine2.IsNull()) return NULL;
//Add a new Point object
- Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+ Handle(GEOM_Object) aPoint = GetEngine()->AddObject(GEOM_POINT);
//Add a new Point function for creation a point relativley another point
Handle(GEOM_Function) aFunction = aPoint->AddFunction(GEOMImpl_PointDriver::GetID(), POINT_LINES_INTERSECTION);
if (theCurve.IsNull()) return NULL;
//Add a new Vector object
- Handle(GEOM_Object) aVec = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
+ Handle(GEOM_Object) aVec = GetEngine()->AddObject(GEOM_VECTOR);
//Add a new Point function for creation a point relativley another point
Handle(GEOM_Function) aFunction = aVec->AddFunction(GEOMImpl_VectorDriver::GetID(), VECTOR_TANGENT_CURVE_PAR);
SetErrorCode(KO);
//Add a new Vector object
- Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
+ Handle(GEOM_Object) aVector = GetEngine()->AddObject(GEOM_VECTOR);
//Add a new Vector function with DXDYDZ parameters
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
//Add a new Vector object
- Handle(GEOM_Object) aVector = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
+ Handle(GEOM_Object) aVector = GetEngine()->AddObject(GEOM_VECTOR);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
if (thePnt.IsNull() || theDir.IsNull()) return NULL;
//Add a new Line object
- Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
+ Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE);
//Add a new Line function
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
//Add a new Line object
- Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
+ Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE);
//Add a new Line function
Handle(GEOM_Function) aFunction =
if (theFace1.IsNull() || theFace2.IsNull()) return NULL;
//Add a new Line object
- Handle(GEOM_Object) aLine = GetEngine()->AddObject(GetDocID(), GEOM_LINE);
+ Handle(GEOM_Object) aLine = GetEngine()->AddObject(GEOM_LINE);
//Add a new Line function
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
if (theFace.IsNull()) return NULL;
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
if (theVec1.IsNull() || theVec2.IsNull()) return NULL;
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Marker object
- Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
+ Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER);
//Add a new Marker function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Marker object
- Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
+ Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER);
//Add a new Marker function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Marker object
- Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GetDocID(), GEOM_MARKER);
+ Handle(GEOM_Object) aMarker = GetEngine()->AddObject(GEOM_MARKER);
//Add a new Marker function
Handle(GEOM_Function) aFunction =
if (theFace.IsNull()) return NULL;
//Add a new Plane object
- Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GetDocID(), GEOM_PLANE);
+ Handle(GEOM_Object) aPlane = GetEngine()->AddObject(GEOM_PLANE);
//Add a new Plane function
Handle(GEOM_Function) aFunction =
class GEOMImpl_IBasicOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IBasicOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IBasicOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IBasicOperations();
// Point
* constructor:
*/
//=============================================================================
-GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IBlocksOperations::GEOMImpl_IBlocksOperations");
}
theEdge3.IsNull() || theEdge4.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Face function
Handle(GEOM_Function) aFunction =
if (theEdge1.IsNull() || theEdge2.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Face function
Handle(GEOM_Function) aFunction =
thePnt3.IsNull() || thePnt4.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Face function
Handle(GEOM_Function) aFunction =
theFace5.IsNull() || theFace6.IsNull()) return NULL;
//Add a new Solid object
- Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GetDocID(), GEOM_BLOCK);
+ Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GEOM_BLOCK);
//Add a new Block function
Handle(GEOM_Function) aFunction =
if (theFace1.IsNull() || theFace2.IsNull()) return NULL;
//Add a new Solid object
- Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GetDocID(), GEOM_BLOCK);
+ Handle(GEOM_Object) aBlock = GetEngine()->AddObject(GEOM_BLOCK);
//Add a new Block function
Handle(GEOM_Function) aFunction =
if (theCompound.IsNull()) return NULL;
//Add a new object
- Handle(GEOM_Object) aBlockComp = GetEngine()->AddObject(GetDocID(), GEOM_COMPOUND);
+ Handle(GEOM_Object) aBlockComp = GetEngine()->AddObject(GEOM_COMPOUND);
//Add a new BlocksComp function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be fixed
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IBlocksOperations();
// Creation of blocks and block faces
* constructor:
*/
//=============================================================================
-GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IBooleanOperations::GEOMImpl_IBooleanOperations");
}
if (theShape1.IsNull() || theShape2.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+ Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
//Add a new Boolean function
Handle(GEOM_Function) aFunction;
if (theShape1.IsNull() || theShape2.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+ Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
//Add a new Boolean function
Handle(GEOM_Function) aFunction =
if (theShapes.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+ Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
//Add a new Boolean function
Handle(GEOM_Function) aFunction =
if (theShapes.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+ Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
//Add a new Boolean function
Handle(GEOM_Function) aFunction =
if (theShapes.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
+ Handle(GEOM_Object) aBool = GetEngine()->AddObject(GEOM_BOOLEAN);
//Add a new Boolean function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Partition object
- Handle(GEOM_Object) aPartition = GetEngine()->AddObject(GetDocID(), GEOM_PARTITION);
+ Handle(GEOM_Object) aPartition = GetEngine()->AddObject(GEOM_PARTITION);
//Add a new Partition function
Handle(GEOM_Function) aFunction;
if (theShape.IsNull() || thePlane.IsNull()) return NULL;
//Add a new Boolean object
- Handle(GEOM_Object) aPart = GetEngine()->AddObject(GetDocID(), GEOM_PARTITION);
+ Handle(GEOM_Object) aPart = GetEngine()->AddObject(GEOM_PARTITION);
//Add a new Partition function
Handle(GEOM_Function) aFunction =
class GEOMImpl_IBooleanOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IBooleanOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IBooleanOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IBooleanOperations();
Standard_EXPORT Handle(GEOM_Object) MakeBoolean
* constructor:
*/
//=============================================================================
-GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_ICurvesOperations::GEOMImpl_ICurvesOperations");
}
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Circle object
- Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE);
+ Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE);
//Add a new Circle function for creation a circle relatively to three points
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Circle object
- Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE);
+ Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE);
//Add a new Circle function for creation a circle relatively to center and 2 points
Handle(GEOM_Function) aFunction =
//if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Circle object
- Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GetDocID(), GEOM_CIRCLE);
+ Handle(GEOM_Object) aCircle = GetEngine()->AddObject(GEOM_CIRCLE);
//Add a new Circle function for creation a circle relatively to point and vector
Handle(GEOM_Function) aFunction =
//if (thePnt.IsNull() || theVec.IsNull()) return NULL;
//Add a new Ellipse object
- Handle(GEOM_Object) anEll = GetEngine()->AddObject(GetDocID(), GEOM_ELLIPSE);
+ Handle(GEOM_Object) anEll = GetEngine()->AddObject(GEOM_ELLIPSE);
//Add a new Ellipse function
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Circle Arc object
- Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_CIRC_ARC);
+ Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_CIRC_ARC);
//Add a new Circle Arc function
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Circle Arc object
- Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_CIRC_ARC);
+ Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_CIRC_ARC);
//Add a new Circle Arc function
Handle(GEOM_Function) aFunction =
if (thePnt1.IsNull() || thePnt2.IsNull() || thePnt3.IsNull()) return NULL;
//Add a new Circle Arc object
- Handle(GEOM_Object) anArc = GetEngine()->AddObject(GetDocID(), GEOM_ELLIPSE_ARC);
+ Handle(GEOM_Object) anArc = GetEngine()->AddObject(GEOM_ELLIPSE_ARC);
//Add a new Circle Arc function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Polyline object
- Handle(GEOM_Object) aPolyline = GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE);
+ Handle(GEOM_Object) aPolyline = GetEngine()->AddObject(GEOM_POLYLINE);
//Add a new Polyline function for creation a polyline relatively to points set
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Spline object
- Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
+ Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE);
//Add a new Spline function for creation a bezier curve relatively to points set
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Spline object
- Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
+ Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE);
//Add a new Spline function for interpolation type
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Spline object
- Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
+ Handle(GEOM_Object) aSpline = GetEngine()->AddObject(GEOM_SPLINE);
//Add a new Spline function for interpolation type
Handle(GEOM_Function) aFunction =
switch(theCurveType) {
case Polyline: {
//Add a new Polyline object
- aCurve = GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE);
+ aCurve = GetEngine()->AddObject(GEOM_POLYLINE);
//Add a new Polyline function for creation a polyline relatively to points set
aFunction = aCurve->AddFunction(GEOMImpl_PolylineDriver::GetID(), POLYLINE_POINTS);
}
case Bezier: {
//Add a new Spline object
- aCurve = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
+ aCurve = GetEngine()->AddObject(GEOM_SPLINE);
//Add a new Spline function for creation a bezier curve relatively to points set
aFunction =
aCurve->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_BEZIER);
}
case Interpolation: {
//Add a new Spline object
- aCurve = GetEngine()->AddObject(GetDocID(), GEOM_SPLINE);
+ aCurve = GetEngine()->AddObject(GEOM_SPLINE);
//Add a new Spline function for creation a bezier curve relatively to points set
aFunction = aCurve->AddFunction(GEOMImpl_SplineDriver::GetID(), SPLINE_INTERPOLATION);
if (!theCommand || strcmp(theCommand, "") == 0) return NULL;
//Add a new Sketcher object
- Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_SKETCHER);
+ Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_SKETCHER);
//Add a new Sketcher function
Handle(GEOM_Function) aFunction =
if (!theCommand || strcmp(theCommand, "") == 0) return NULL;
//Add a new Sketcher object
- Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_SKETCHER);
+ Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_SKETCHER);
//Add a new Sketcher function
Handle(GEOM_Function) aFunction =
if (!theCommand || strcmp(theCommand, "") == 0) return NULL;
//Add a new Sketcher object
- Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GetDocID(), GEOM_3DSKETCHER);
+ Handle(GEOM_Object) aSketcher = GetEngine()->AddObject(GEOM_3DSKETCHER);
//Add a new Sketcher function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Sketcher object
- Handle(GEOM_Object) a3DSketcher = GetEngine()->AddObject(GetDocID(), GEOM_3DSKETCHER);
+ Handle(GEOM_Object) a3DSketcher = GetEngine()->AddObject(GEOM_3DSKETCHER);
//Add a new Sketcher function
Handle(GEOM_Function) aFunction =
//Add a new Spline object
Handle(GEOM_Object) anIsoline =
- GetEngine()->AddObject(GetDocID(), GEOM_ISOLINE);
+ GetEngine()->AddObject(GEOM_ISOLINE);
//Add a new Spline function for interpolation type
Handle(GEOM_Function) aFunction =
// Add a new Polyline object
Handle(GEOM_Object) aResult =
- GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE2D);
+ GetEngine()->AddObject(GEOM_POLYLINE2D);
Handle(GEOM_Function) aFunction = aResult->AddFunction
(GEOMImpl_PolylineDriver::GetID(), POLYLINE2D_PLN_COORDS);
//Add a new Polyline object
Handle(GEOM_Object) aResult =
- GetEngine()->AddObject(GetDocID(), GEOM_POLYLINE2D);
+ GetEngine()->AddObject(GEOM_POLYLINE2D);
Handle(GEOM_Function) aFunction = aResult->AddFunction
(GEOMImpl_PolylineDriver::GetID(), POLYLINE2D_PLN_OBJECT);
enum CurveType { Polyline, Bezier, Interpolation };
- Standard_EXPORT GEOMImpl_ICurvesOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_ICurvesOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_ICurvesOperations();
Standard_EXPORT Handle(GEOM_Object) MakeCircleThreePnt (Handle(GEOM_Object) thePnt1,
* Export
*/
//=============================================================================
-bool GEOMImpl_IECallBack::Export( int /*theDocId*/,
- const Handle(GEOM_Object) /*theOriginal*/,
+bool GEOMImpl_IECallBack::Export( const Handle(GEOM_Object) /*theOriginal*/,
const TCollection_AsciiString& /*theFileName*/,
const TCollection_AsciiString& /*theFormatName*/ )
{
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-GEOMImpl_IECallBack::Import( int /*theDocId*/,
- const TCollection_AsciiString& /*theFormatName*/,
+GEOMImpl_IECallBack::Import( const TCollection_AsciiString& /*theFormatName*/,
const TCollection_AsciiString& /*theFileName*/ )
{
return NULL;
*/
//=============================================================================
TCollection_AsciiString
-GEOMImpl_IECallBack::ReadValue( int /*theDocId*/,
- const TCollection_AsciiString& /*theFileName*/,
+GEOMImpl_IECallBack::ReadValue( const TCollection_AsciiString& /*theFileName*/,
const TCollection_AsciiString& /*theFormatName*/,
const TCollection_AsciiString& /*theParameterName*/ )
{
Standard_EXPORT GEOMImpl_IECallBack();
Standard_EXPORT ~GEOMImpl_IECallBack();
- Standard_EXPORT virtual bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
+ Standard_EXPORT virtual bool Export( const Handle(GEOM_Object) theOriginal,
const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName );
Standard_EXPORT virtual
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
Standard_EXPORT virtual
- TCollection_AsciiString ReadValue( int theDocId,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theParameterName );
+ TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName );
Standard_EXPORT static void Register( const TCollection_AsciiString& theFormatName, GEOMImpl_IECallBack* theCallBack );
* constructor:
*/
//=============================================================================
-GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IFieldOperations::GEOMImpl_IFieldOperations");
}
// make a field
Handle(GEOM_Field) aField = Handle(GEOM_Field)::DownCast
- ( GetEngine()->AddBaseObject( GetDocID(), GEOM_FIELD ));
+ ( GetEngine()->AddBaseObject( GEOM_FIELD ));
// set field data
aField->Init( theShape, theName, theType, theDimension, theComponentNames );
for (; anIt.More(); anIt.Next()) {
TCollection_ExtendedString& anEntry = anIt.Value();
anEntry.ToUTF8CString( (Standard_PCharacter&) pentry );
- Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), entry, false);
+ Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(entry, false);
nbFields += ( !anObj.IsNull() && anObj->IsKind(STANDARD_TYPE(GEOM_Field)) );
}
for (; anIt.More(); anIt.Next()) {
TCollection_ExtendedString& anEntry = anIt.Value();
anEntry.ToUTF8CString( (Standard_PCharacter&) pentry );
- Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), entry, false);
+ Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(entry, false);
if ( !anObj.IsNull() && anObj->IsKind(STANDARD_TYPE(GEOM_Field)) )
{
Handle(GEOM_Field) field = Handle(GEOM_Field)::DownCast( anObj );
for (; anIt.More(); anIt.Next()) {
TCollection_ExtendedString& anEntry = anIt.Value();
anEntry.ToUTF8CString( (Standard_PCharacter&) pentry );
- field = Handle(GEOM_Field)::DownCast( GetEngine()->GetObject( GetDocID(), entry, false ));
+ field = Handle(GEOM_Field)::DownCast( GetEngine()->GetObject( entry, false ));
if ( !field.IsNull() && field->GetName() == theName ) {
SetErrorCode(OK);
break;
class GEOMImpl_IFieldOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IFieldOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IFieldOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IFieldOperations();
Standard_EXPORT Handle(GEOM_Field)
* constructor:
*/
//=============================================================================
-GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IGroupOperations::GEOMImpl_IGroupOperations");
}
class GEOMImpl_IGroupOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IGroupOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IGroupOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IGroupOperations();
Standard_EXPORT Handle(GEOM_Object) CreateGroup(Handle(GEOM_Object) theMainShape, TopAbs_ShapeEnum theShapeType);
* constructor:
*/
//=============================================================================
-GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
myModifStats = new ShHealOper_ModifStats;
MESSAGE("GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations");
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SHAPE_PROCESS);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY);
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), SUPPRESS_FACES);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), CLOSE_CONTOUR);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), REMOVE_INT_WIRES);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), FILL_HOLES);
}
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
int aFunctionType = (isAllowNonManifold ? SEWING_NON_MANIFOLD : SEWING);
}
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY);
//Add the function
Handle(GEOM_Function)
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE);
}
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GEOM_COPY );
//Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE_BY_POINT);
if (theWire.IsNull()) return NULL;
// Add a new object
- Handle(GEOM_Object) aRes = GetEngine()->AddObject(GetDocID(), theWire->GetType());
+ Handle(GEOM_Object) aRes = GetEngine()->AddObject(theWire->GetType());
// Add a new function
Handle(GEOM_Function) aFunction;
TopExp_Explorer anExp;
for ( anExp.Init( aClosed, TopAbs_WIRE ); anExp.More(); anExp.Next() )
{
- anObj = GetEngine()->AddObject( GetDocID(), GEOM_FREE_BOUNDS );
+ anObj = GetEngine()->AddObject( GEOM_FREE_BOUNDS );
aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF );
TopoDS_Shape aValueShape = anExp.Current();
aFunction->SetValue( aValueShape );
}
for ( anExp.Init( anOpen, TopAbs_WIRE ); anExp.More(); anExp.Next() )
{
- anObj = GetEngine()->AddObject( GetDocID(), GEOM_FREE_BOUNDS );
+ anObj = GetEngine()->AddObject( GEOM_FREE_BOUNDS );
aFunction = anObj->AddFunction( GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF );
TopoDS_Shape aValueShape = anExp.Current();
aFunction->SetValue( aValueShape );
return NULL; //There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GEOM_COPY);
if (theObject->GetType() == GEOM_VECTOR) { // Mantis issue 21066
//Add the function
return NULL; // There is no function which creates an object to be processed
// Add a new object
- Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(theObject->GetType());
// Add the function
aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), LIMIT_TOLERANCE);
class GEOMImpl_IHealingOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IHealingOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IHealingOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IHealingOperations();
// Apply Shape Processing to the selected Object
* constructor
*/
//=============================================================================
-GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations");
- myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID());
- myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
- myFieldOperations = new GEOMImpl_IFieldOperations(GetEngine(), GetDocID());
+ myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine());
+ myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine());
+ myFieldOperations = new GEOMImpl_IFieldOperations(GetEngine());
}
//=============================================================================
if (theOriginal.IsNull()) return NULL;
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a Copy function for creation a copy object
Handle(GEOM_Function) aFunction = aCopy->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITH_REF);
if (theOriginal.IsNull()) return;
- if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( GetDocID(), theOriginal, theFileName, theFormatName ) )
+ if ( !GEOMImpl_IECallBack::GetCallBack( theFormatName )->Export( theOriginal, theFileName, theFormatName ) )
return;
SetErrorCode(OK);
}
if (theFileName.IsEmpty() || theFormatName.IsEmpty()) return NULL;
Handle(TColStd_HSequenceOfTransient) aSeq =
- GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( GetDocID(), theFormatName, theFileName );
+ GEOMImpl_IECallBack::GetCallBack( theFormatName )->Import( theFormatName, theFileName );
SetErrorCode(OK);
return aSeq;
}
TCollection_AsciiString aValue;
if (theFileName.IsEmpty() || theFormatName.IsEmpty() || theParameterName.IsEmpty()) return aValue;
- aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( GetDocID(), theFileName, theFormatName, theParameterName );
+ aValue = GEOMImpl_IECallBack::GetCallBack( theFormatName )->ReadValue( theFileName, theFormatName, theParameterName );
SetErrorCode(OK);
return aValue;
SetErrorCode(KO);
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) result = GetEngine()->AddObject(GEOM_COPY);
//Add a Copy function
Handle(GEOM_Function) aFunction = result->AddFunction(GEOMImpl_CopyDriver::GetID(), COPY_WITHOUT_REF);
for (i = 1, bdit = bytedata.begin(); bdit != bytedata.end(); ++bdit, ++i)
aTexture->SetValue(i, (Standard_Byte)(*bdit));
- int aTextureId = GetEngine()->addTexture(GetDocID(), lenbytes*8, lines.size(), aTexture, theTextureFile);
+ int aTextureId = GetEngine()->addTexture(lenbytes*8, lines.size(), aTexture, theTextureFile);
if (aTextureId > 0) SetErrorCode(OK);
return aTextureId;
}
const Handle(TColStd_HArray1OfByte)& theTexture)
{
SetErrorCode(KO);
- int aTextureId = GetEngine()->addTexture(GetDocID(), theWidth, theHeight, theTexture);
+ int aTextureId = GetEngine()->addTexture(theWidth, theHeight, theTexture);
if (aTextureId > 0) SetErrorCode(OK);
return aTextureId;
}
if (theTextureId <= 0)
return aTexture;
- aTexture = GetEngine()->getTexture(GetDocID(), theTextureId, theWidth, theHeight, aFileName);
+ aTexture = GetEngine()->getTexture(theTextureId, theWidth, theHeight, aFileName);
if (theWidth > 0 && theHeight > 0 && aTexture->Length() > 0) SetErrorCode(OK);
std::list<int> GEOMImpl_IInsertOperations::GetAllTextures()
{
SetErrorCode(KO);
- std::list<int> id_list = GetEngine()->getAllTextures(GetDocID());
+ std::list<int> id_list = GetEngine()->getAllTextures();
SetErrorCode(OK);
return id_list;
}
//Add a new Transfer Data object object
Handle(GEOM_Object) aTDObj =
- GetEngine()->AddObject(GetDocID(), GEOM_TRANSFER_DATA);
+ GetEngine()->AddObject(GEOM_TRANSFER_DATA);
//Add a Transfer Data function for created object
Handle(GEOM_Function) aFunction =
long myMaxNumber;
};
- Standard_EXPORT GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IInsertOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IInsertOperations();
* constructor:
*/
//=============================================================================
-GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_ILocalOperations::GEOMImpl_ILocalOperations");
}
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET);
+ Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET);
+ Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET);
+ Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET);
+ Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GetDocID(), GEOM_FILLET);
+ Handle(GEOM_Object) aFillet = GetEngine()->AddObject(GEOM_FILLET);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_2D);
+ Handle(GEOM_Object) aFillet2D = GetEngine()->AddObject(GEOM_FILLET_2D);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Fillet object
- Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GetDocID(), GEOM_FILLET_1D);
+ Handle(GEOM_Object) aFillet1D = GetEngine()->AddObject(GEOM_FILLET_1D);
//Add a new Fillet function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Chamfer object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_CHAMFER);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_CHAMFER);
//Add a new Chamfer function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new Archimede object
- Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GetDocID(), GEOM_ARCHIMEDE);
+ Handle(GEOM_Object) aChamfer = GetEngine()->AddObject(GEOM_ARCHIMEDE);
//Add a new Archimede function
Handle(GEOM_Function) aFunction = aChamfer->AddFunction(GEOMImpl_ArchimedeDriver::GetID(), ARCHIMEDE_TYPE);
if (aGen) {
GEOMImpl_IShapesOperations* anIShapesOperations =
- aGen->GetIShapesOperations(GetDocID());
+ aGen->GetIShapesOperations();
anInd = anIShapesOperations->GetSubShapeIndex(theShape, theSubShape);
SetErrorCode(anIShapesOperations->GetErrorCode());
}
class GEOMImpl_ILocalOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_ILocalOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_ILocalOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_ILocalOperations();
Standard_EXPORT Handle(GEOM_Object) MakeFilletAll (Handle(GEOM_Object) theShape, double theR);
* Constructor
*/
//=============================================================================
-GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IMeasureOperations::GEOMImpl_IMeasureOperations");
}
if (theShape.IsNull()) return NULL;
//Add a new CentreOfMass object
- Handle(GEOM_Object) aCDG = GetEngine()->AddObject(GetDocID(), GEOM_CDG);
+ Handle(GEOM_Object) aCDG = GetEngine()->AddObject(GEOM_CDG);
//Add a new CentreOfMass function
Handle(GEOM_Function) aFunction =
if (aRefShape.IsNull()) return NULL;
//Add a new Vertex object
- Handle(GEOM_Object) aVertex = GetEngine()->AddObject(GetDocID(), GEOM_POINT);
+ Handle(GEOM_Object) aVertex = GetEngine()->AddObject(GEOM_POINT);
//Add a function
Handle(GEOM_Function) aFunction =
if (theFace.IsNull()) return NULL;
//Add a new Normale object
- Handle(GEOM_Object) aNorm = GetEngine()->AddObject(GetDocID(), GEOM_VECTOR);
+ Handle(GEOM_Object) aNorm = GetEngine()->AddObject(GEOM_VECTOR);
//Add a new Normale function
Handle(GEOM_Function) aFunction =
if (theShape.IsNull()) return NULL;
//Add a new BoundingBox object
- Handle(GEOM_Object) aBnd = GetEngine()->AddObject(GetDocID(), GEOM_BOX);
+ Handle(GEOM_Object) aBnd = GetEngine()->AddObject(GEOM_BOX);
//Add a new BoundingBox function
const int aType = (precise ? BND_BOX_MEASURE_PRECISE : BND_BOX_MEASURE);
class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
public:
- Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IMeasureOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IMeasureOperations();
enum ShapeKind {
* constructor:
*/
//=============================================================================
-GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_IShapesOperations::GEOMImpl_IShapesOperations");
}
if (thePnt1.IsNull() || thePnt2.IsNull()) return NULL;
//Add a new Edge object
- Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
+ Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
if (theRefCurve.IsNull()) return NULL;
//Add a new Edge object
- Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
+ Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
if (theWire.IsNull()) return NULL;
//Add a new Edge object
- Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
+ Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GEOM_EDGE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aWire = GetEngine()->AddObject(GetDocID(), GEOM_WIRE);
+ Handle(GEOM_Object) aWire = GetEngine()->AddObject(GEOM_WIRE);
//Add a new function
Handle(GEOM_Function) aFunction =
if (theWire.IsNull()) return NULL;
//Add a new Face object
- Handle(GEOM_Object) aFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Shape function for creation of a face from a wire
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FACE);
//Add a new function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FACE);
//Add a new function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FILLING);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(GEOM_FILLING);
//Add a new function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), theObjectType);
+ Handle(GEOM_Object) aShape = GetEngine()->AddObject(theObjectType);
//Add a new function
Handle(GEOM_Function) aFunction =
SetErrorCode(KO);
//Add a new object
- Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID);
+ Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GEOM_SOLID);
//Add a new function
Handle(GEOM_Function) aFunction =
}
//Add a new Glued object
- Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
+ Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED);
//Add a new Glue function
Handle(GEOM_Function) aFunction;
}
//Add a new Glued object
- Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
+ Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED);
//Add a new Glue function
Handle(GEOM_Function) aFunction;
}
//Add a new Glued object
- Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
+ Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED);
//Add a new Glue function
Handle(GEOM_Function) aFunction;
return NULL;
}
//Add a new Glued object
- Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
+ Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GEOM_GLUED);
//Add a new Glue function
Handle(GEOM_Function) aFunction;
Standard_Integer aStrLen = anEntry.LengthOfCString();
char* anEntryStr = new char[aStrLen+1];
anEntry.ToUTF8CString(anEntryStr);
- Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(GetDocID(), anEntryStr, false);
+ Handle(GEOM_BaseObject) anObj = GetEngine()->GetObject(anEntryStr, false);
if (!anObj.IsNull() ) {
bool isGroup = anObj->IsKind(STANDARD_TYPE(GEOM_Object)) && anObj->GetType() == GEOM_GROUP;
bool isSubShape = anObj->IsKind(STANDARD_TYPE(GEOM_Object)) && anObj->GetType() != GEOM_GROUP;
//anObj = GetEngine()->AddSubShape(theShape, anArray);
{
- anObj = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE);
+ anObj = GetEngine()->AddObject(GEOM_SUBSHAPE);
Handle(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1);
if (aFunction.IsNull()) return aSeq;
anArray = new TColStd_HArray1OfInteger(1,1);
anArray->SetValue(1, id);
- anObj = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE);
+ anObj = GetEngine()->AddObject(GEOM_SUBSHAPE);
if (!anObj.IsNull()) {
Handle(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1);
if (aFunction.IsNull()) return aSeq;
/*
//Add a new reversed object
- Handle(GEOM_Object) aReversed = GetEngine()->AddObject(GetDocID(), theShape->GetType());
+ Handle(GEOM_Object) aReversed = GetEngine()->AddObject(theShape->GetType());
//Add a new Revese function
Handle(GEOM_Function) aFunction;
if (aGen) {
GEOMImpl_IHealingOperations* anIHealingOperations =
- aGen->GetIHealingOperations(GetDocID());
+ aGen->GetIHealingOperations();
aReversed = anIHealingOperations->ChangeOrientationCopy(theShape);
SetErrorCode(anIHealingOperations->GetErrorCode());
}
}
//Add a new result object
- Handle(GEOM_Object) aRes = GetEngine()->AddObject(GetDocID(), GEOM_SHAPES_ON_SHAPE);
+ Handle(GEOM_Object) aRes = GetEngine()->AddObject(GEOM_SHAPES_ON_SHAPE);
Handle(GEOM_Function) aFunction =
aRes->AddFunction(GEOMImpl_ShapeDriver::GetID(), SHAPES_ON_SHAPE);
aFunction->SetValue(aCompound);
//Add a new Result object
Handle(GEOM_Object) aResult =
- GetEngine()->AddObject(GetDocID(), GEOM_EXTRACTION);
+ GetEngine()->AddObject(GEOM_EXTRACTION);
//Add a new Extraction function
Handle(GEOM_Function) aFunction =
}
//Add a new Edge object
- Handle(GEOM_Object) aResEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
+ Handle(GEOM_Object) aResEdge = GetEngine()->AddObject(GEOM_EDGE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
}
//Add a new Face object
- Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
}
//Add a new Face object
- Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+ Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GEOM_FACE);
//Add a new Vector function
Handle(GEOM_Function) aFunction =
std::list<Standard_Integer> indices; ///< Shape indices touched by this type of modification.
};
- Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_IShapesOperations();
Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1,
*/
//=============================================================================
-GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations (GEOM_Engine* theEngine, int theDocID)
-: GEOM_IOperations(theEngine, theDocID)
+GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations (GEOM_Engine* theEngine)
+: GEOM_IOperations(theEngine)
{
MESSAGE("GEOMImpl_ITransformOperations::GEOMImpl_ITransformOperations");
}
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a translate function
Handle(GEOM_Function) aFunction =
//Add a translate function
if (theCopy) {
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_TranslateDriver::GetID(), TRANSLATE_VECTOR_DISTANCE);
}
else {
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a translate function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a mirror function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a mirror function
Handle(GEOM_Function) aFunction =
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a mirror function
Handle(GEOM_Function) aFunction =
if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be offset
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a new Offset function
Handle(GEOM_Function) aFunction =
else
{
//Add a new Projection object
- aCopy = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+ aCopy = GetEngine()->AddObject(GEOM_PROJECTION);
//Add a Projection function
Handle(GEOM_Function) aFunction =
}
//Add a new Projection object
- thePointOnEdge = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+ thePointOnEdge = GetEngine()->AddObject(GEOM_PROJECTION);
//Add a Projection function
Handle(GEOM_Function) aFunction = thePointOnEdge->AddFunction
if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be scaled
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a scale function
Handle(GEOM_Function) aFunction =
Handle(GEOM_Object) aCopy; //Add a new Copy object
Handle(GEOM_Function) aFunction;
if (doCopy) {
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_ScaleDriver::GetID(), SCALE_SHAPE_AXES_COPY);
}
else {
if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be set in position
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a position function
Standard_Integer aType = POSITION_SHAPE_COPY;
Handle(GEOM_Object) aCopy;
if (theCopy) {
- aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ aCopy = GetEngine()->AddObject(theObject->GetType());
aFunction = aCopy->AddFunction(GEOMImpl_PositionDriver::GetID(), POSITION_ALONG_PATH);
}
else
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_COPY);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D_STEP);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(theObject->GetType());
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_2D);
if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be rotated
//Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
//Add a rotate function
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_THREE_POINTS_COPY);
if (aSampleFunc.IsNull()) return NULL; // There is no function which creates a sample object
// Add a new Copy object
- Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GEOM_COPY);
// Add a transform function (depends on theSample function)
Handle(GEOM_Function) aFunction =
//Add a new Projection object
Handle(GEOM_Object) aResult =
- GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+ GetEngine()->AddObject(GEOM_PROJECTION);
//Add a Projection function
Handle(GEOM_Function) aFunction = aResult->AddFunction
class GEOMImpl_ITransformOperations : public GEOM_IOperations
{
public:
- Standard_EXPORT GEOMImpl_ITransformOperations(GEOM_Engine* theEngine, int theDocID);
+ Standard_EXPORT GEOMImpl_ITransformOperations(GEOM_Engine* theEngine);
Standard_EXPORT ~GEOMImpl_ITransformOperations();
Standard_EXPORT Handle(GEOM_Object) TranslateTwoPoints (Handle(GEOM_Object) theObject,
return 0;
Handle(TColStd_HSequenceOfTransient) aSeq =
- GEOMImpl_IECallBack::GetCallBack( aFormatName )->Import( GetDocID(), aFormatName, aFileName );
+ GEOMImpl_IECallBack::GetCallBack( aFormatName )->Import( aFormatName, aFileName );
if( aSeq.IsNull() )
return 0;
}
_PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder());
- GEOM_Displayer* disp = new GEOM_Displayer( appStudy );
+ GEOM_Displayer* disp = new GEOM_Displayer();
if ( isComponentSelected ) {
// GEOM component is selected: delete all objects recursively
{
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if ( app ) {
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- GEOM_Displayer aDisp (appStudy);
+ GEOM_Displayer aDisp;
aDisp.GlobalSelection();
getGeometryGUI()->setLocalSelectionMode(GEOM_ALLOBJECTS);
}
QList<SALOMEDS::Color> aReservedColors;
- GEOM_Displayer displayer ( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
// get active view
SALOME_View* window = displayer.GetActiveView();
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
{
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
if ( app ) {
- SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- GEOM_Displayer aDisp (appStudy);
+ GEOM_Displayer aDisp;
aDisp.GlobalSelection(mode);
getGeometryGUI()->setLocalSelectionMode(mode);
}
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
aSelMgr->selectedObjects( selected );
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
SalomeApp_Study* appStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
if ( !appStudy ) return;
- GEOM_Displayer displayer( appStudy );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
if ( selected.IsEmpty() ) return;
- GEOM_Displayer displayer( study );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
}
}
}
- GEOM_Displayer displayer( getStudy() );
+ GEOM_Displayer displayer;
displayer.Redisplay( selected, true );
selMgr->setSelectedObjects( selected );
}
// ---
GEOM::GEOM_Gen_var engine = GeometryGUI::GetGeomGen();
- myOperation = engine->GetIInsertOperations( getStudy()->id() );
+ myOperation = engine->GetIInsertOperations();
GEOM::ListOfLong_var ids = myOperation->GetAllTextures();
for ( int i = 0; i < ids->length(); i++ )
addTexture( ids[i] );
if ( id > 0 && myCustomTypeCombo->index( id ) == -1 ) {
int tWidth, tHeight;
- Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(getStudy(), id, tWidth, tHeight);
+ Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(id, tWidth, tHeight);
if ( !texture.IsNull() && texture->Length() == tWidth*tHeight/8 ) {
QImage image( tWidth, tHeight, QImage::Format_Mono );
if ( appStudy ) {
_PTR(Study) aStudy = appStudy->studyDS();
if ( aStudy ) {
- GEOM_Displayer displayer ( appStudy );
- QTreeWidgetItemIterator it( myTreeWidget );
- while ( *it ) {
- QString entry = myEntryToItem.key( *it );
- _PTR(SObject) SO ( aStudy->FindObjectID( qPrintable( entry ) ) );
- if ( SO ) {
- GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) );
- if ( CORBA::is_nil( aGeomObject ) ) continue;
- if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) {
- Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" );
- displayer.Erase( io );
+ GEOM_Displayer displayer;
+ QTreeWidgetItemIterator it( myTreeWidget );
+ while ( *it ) {
+ QString entry = myEntryToItem.key( *it );
+ _PTR(SObject) SO ( aStudy->FindObjectID( qPrintable( entry ) ) );
+ if ( SO ) {
+ GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) );
+ if ( CORBA::is_nil( aGeomObject ) ) continue;
+ if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) {
+ Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" );
+ displayer.Erase( io );
+ }
+ }
+ ++it;
}
- }
- ++it;
- }
- displayer.UpdateViewer();
+ displayer.UpdateViewer();
}
}
}
if ( !SO ) return;
GEOM::GEOM_Object_var aGeomObject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( SO ) );
if ( CORBA::is_nil( aGeomObject ) ) return;
- GEOM_Displayer displayer ( appStudy );
+ GEOM_Displayer displayer;
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( aGeomObject->GetStudyEntry(), "GEOM", "" );
if ( displayer.IsDisplayed( aGeomObject->GetStudyEntry() ) ) {
#include <QMessageBox>
GEOMToolsGUI_ReduceStudyDlg::GEOMToolsGUI_ReduceStudyDlg( QWidget* parent )
-:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
-myDisplayer(NULL)
+:QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
{
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
myVisible = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
if ( !myApp ) return;
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
myStudy = study->studyDS();
- myDisplayer = GEOM_Displayer( study );
+ myDisplayer = GEOM_Displayer();
setWindowTitle( tr( "GEOM_REDUCE_STUDY_TITLE" ) );
setAttribute(Qt::WA_DeleteOnClose);
//purpose :
//=======================================================================
-Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
- CORBA::Boolean isPublished,
- CORBA::Boolean isMultiFile,
+Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Boolean isPublished,
+ CORBA::Boolean isMultiFile,
CORBA::Boolean& isValidScript)
{
- SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow(theStudy);
+ SALOMEDS::Study_var aStudy = GetStudy();
if(CORBA::is_nil(aStudy))
return new Engines::TMPFile(0);
HANDLE_NAMESPACE(GEOM_Object) shape = _impl->GetShape();
if ( !shape.IsNull() )
{
- GEOM::GEOM_BaseObject_var obj = _engine->GetObject( shape->GetDocID(),
- shape->GetEntryString().ToCString());
+ GEOM::GEOM_BaseObject_var obj = _engine->GetObject( shape->GetEntryString().ToCString());
shapeVar = GEOM::GEOM_Object::_narrow( obj );
}
return shapeVar._retn();
HANDLE_NAMESPACE(GEOM_FieldStep) step = _impl->AddStep( stepID, stamp );
if ( !step.IsNull() )
{
- GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetDocID(),
- step->GetEntryString().ToCString());
+ GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetEntryString().ToCString());
stepVar = GEOM::GEOM_FieldStep::_narrow( obj );
}
return stepVar._retn();
HANDLE_NAMESPACE(GEOM_FieldStep) step = _impl->GetStep(stepID);
if ( !step.IsNull() )
{
- GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetDocID(),
- step->GetEntryString().ToCString());
+ GEOM::GEOM_BaseObject_var obj = _engine->GetObject( step->GetEntryString().ToCString());
stepVar = GEOM::GEOM_FieldStep::_narrow( obj );
}
return stepVar._retn();
HANDLE_NAMESPACE(GEOM_Field) field = _impl->GetField();
if ( !field.IsNull() )
{
- GEOM::GEOM_BaseObject_var obj = _engine->GetObject( field->GetDocID(),
- field->GetEntryString().ToCString());
+ GEOM::GEOM_BaseObject_var obj = _engine->GetObject( field->GetEntryString().ToCString());
fieldVar = GEOM::GEOM_Field::_narrow( obj );
}
return fieldVar._retn();
// : Used when a study is loaded
// : The IOR (IORName) of object created is returned
//============================================================================
-char* GEOM_Gen_i::LocalPersistentIDToIOR(const char* aLocalPersistentID,
+char* GEOM_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
+ const char* aLocalPersistentID,
CORBA::Boolean isMultiFile,
CORBA::Boolean isASCII)
{
{
TCollection_AsciiString anEntry;
TDF_Tool::Entry(anObject->GetEntry(), anEntry);
- GEOM::GEOM_BaseObject_var obj = GetObject(anObject->GetDocID(), anEntry.ToCString());
+ GEOM::GEOM_BaseObject_var obj = GetObject(anEntry.ToCString());
CORBA::String_var aPersRefString = _orb->object_to_string(obj);
return CORBA::string_dup(aPersRefString);
//Set NoteBook variables used in the object creation
TCollection_AsciiString aVars;
CORBA::String_var aString=aBaseObj->GetParameters();
- SALOMEDS::ListOfListOfStrings_var aSections = theStudy->ParseVariables(aString);
+ SALOMEDS::ListOfListOfStrings_var aSections = aStudy->ParseVariables(aString);
for(int i = 0, n = aSections->length(); i < n; i++) {
SALOMEDS::ListOfStrings aListOfVars = aSections[i];
for(int j = 0, m = aListOfVars.length(); j < m; j++) {
Standard_Integer anIndex = anIndices.FindIndex(aValue);
//anArray->SetValue(1, anIndex);
GOp->AddObject(GrObj,anIndex);
- //anObj = GEOM_Engine::GetEngine()->AddObject(aMainShape->GetDocID(), GEOM_SUBSHAPE);
+ //anObj = GEOM_Engine::GetEngine()->AddObject(GEOM_SUBSHAPE);
//if (anObj.IsNull()) continue;
//HANDLE_NAMESPACE(GEOM_Function) aFunction = anObj->AddFunction(GEOM_Object::GetSubShapeID(), 1);
//if (aFunction.IsNull()) continue;
//SALOMEDS::SObject_var aResultSO;
//TCollection_AsciiString anEntry;
//TDF_Tool::Entry(anObj->GetEntry(),anEntry);
- //GEOM::GEOM_Object_var aGObj = GetObject(anObj->GetDocID(), anEntry.ToCString());
- //AddInStudy(theStudy, aGObj._retn(), SeqN.Value(i).ToCString(), GrObj);
+ //GEOM::GEOM_Object_var aGObj = GetObject(anEntry.ToCString());
+ //AddInStudy(aGObj._retn(), SeqN.Value(i).ToCString(), GrObj);
}
}
}
// function : Close()
// purpose :
//============================================================================
-void GEOM_Gen_i::Close()
+void GEOM_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent)
{
_impl->Close();
}
TCollection_AsciiString anEntry;
TDF_Tool::Entry(anObj->GetEntry(), anEntry);
- GEOM::GEOM_BaseObject_var obj = GetObject(anObj->GetDocID(), anEntry.ToCString());
+ GEOM::GEOM_BaseObject_var obj = GetObject(anEntry.ToCString());
//Set the study entry of the published GEOM_Object
obj->SetStudyEntry(aNewSO->GetID());
{
SALOMEDS::SObject_var aResultSO;
SALOMEDS::Study_var aStudy = GetStudy();
- if(theObject->_is_nil() || theStudy->_is_nil()) return aResultSO;
+ if(theObject->_is_nil() || aStudy->_is_nil()) return aResultSO;
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
CORBA::String_var IOR;
// find SObject in the study if it is already published
CORBA::String_var anIORo = _orb->object_to_string(theObject);
- SALOMEDS::SObject_var aSO = theStudy->FindObjectIOR(anIORo.in());
+ SALOMEDS::SObject_var aSO = GetStudy()->FindObjectIOR(anIORo.in());
//PTv, IMP 0020001, The salome object <aSO>
// is not obligatory in case of invokation from script
// if (CORBA::is_nil(aSO))
TCollection_AsciiString anEntry;
TDF_Tool::Entry(anObject->GetEntry(), anEntry);
- return GEOM::GEOM_Object::_narrow( GetObject(anObject->GetDocID(), anEntry.ToCString()));
+ return GEOM::GEOM_Object::_narrow( GetObject(anEntry.ToCString()));
}
//=============================================================================
if (theObject.IsNull()) return GO._retn();
TCollection_AsciiString anEntry;
TDF_Tool::Entry(theObject->GetEntry(), anEntry);
- GO = _engine->GetObject(theObject->GetDocID(), (char*) anEntry.ToCString());
+ GO = _engine->GetObject((char*) anEntry.ToCString());
return GO._retn();
}
{
TCollection_AsciiString anEntry = anIt.Value();
HANDLE_NAMESPACE(GEOM_BaseObject) anObj =
- GEOM_Engine::GetEngine()->GetObject( _impl->GetDocID(), anEntry.ToCString(), false );
+ GEOM_Engine::GetEngine()->GetObject( anEntry.ToCString(), false );
if ( anObj.IsNull() ) continue;
TCollection_AsciiString aSubName = anObj->GetName();
"""
# Example: see GEOM_TestAll.py
try:
- aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
+ aSObject = self.AddInStudy(aShape, aName, None)
if aSObject and aName: aSObject.SetAttrString("AttributeName", aName)
if doRestoreSubShapes:
- self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
+ self.RestoreSubShapesSO(aSObject, theArgs,
theFindMethod, theInheritFirstArg, True )
except:
print "addToStudy() failed"
list of published sub-shapes
"""
# Example: see GEOM_TestAll.py
- return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
+ return self.RestoreSubShapesO(theObject, theArgs,
theFindMethod, theInheritFirstArg, theAddPrefix)
## Publish sub-shapes, standing for arguments and sub-shapes of arguments
{}
virtual void Execute()
{
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if ( !app ) return;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !study ) return;
-
Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.c_str(), "GEOM", "" );
- GEOM_Displayer( study ).Display( io, myUpdateViewer );
+ GEOM_Displayer().Display( io, myUpdateViewer );
}
};
{}
virtual void Execute()
{
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if ( !app ) return;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !study ) return;
-
Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( myEntry.c_str(), "GEOM", "" );
- GEOM_Displayer( study ).Erase( io, true, myUpdateViewer );
+ GEOM_Displayer().Erase( io, true, myUpdateViewer );
}
};
{}
virtual void Execute()
{
- SUIT_Application* app = SUIT_Session::session()->activeApplication();
- if ( !app ) return;
-
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
- if ( !study ) return;
-
- GEOM_Displayer( study ).UpdateViewer();
+ GEOM_Displayer().UpdateViewer();
}
};
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
if ( !study ) return;
- GEOM_Displayer displayer( study );
+ GEOM_Displayer displayer;
SALOME_View* window = displayer.GetActiveView();
if ( !window ) return;
// purpose : virtual method to restore tree of argument's sub-shapes under
// the resulting shape. Redefined from GEOMBase_Helper class.
//=================================================================================
-void GenerationGUI_PipeDlg::restoreSubShapes
- (SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject)
+void GenerationGUI_PipeDlg::restoreSubShapes(SALOMEDS::SObject_ptr theSObject)
{
QCheckBox *aGenGroupCheck = NULL;
QLineEdit *aPrefixEdit = NULL;
}
aName += tr((*it)->GetName());
- getGeomEngine()->AddInStudy(theStudy, (*it).get(),
- aName.toStdString().c_str(), aFather);
+ getGeomEngine()->AddInStudy((*it).get(), aName.toStdString().c_str(), aFather);
}
}
}
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
virtual bool extractPrefix() const;
- virtual void restoreSubShapes
- (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+ virtual void restoreSubShapes(SALOMEDS::SObject_ptr);
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !study ) return false;
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "IGESPluginEngine" );
IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op );
entryList.append( so->GetID() );
transaction.commit();
- GEOM_Displayer( study ).Display( main.in() );
+ GEOM_Displayer().Display( main.in() );
main->UnRegister();
}
else
* Export
*/
//=============================================================================
-bool IGESPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+bool IGESPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() );
TCollection_AsciiString aVersion = ( theFormatName == "IGES_5_3" ) ? "5.3" : "5.1";
aPluginOperations->ExportIGES( theOriginal, theFileName, aVersion );
return true;
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-IGESPlugin_IECallBack::Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+IGESPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() );
bool anIsIgnoreUnits = ( theFormatName == "IGES_SCALE" ) ? true : false;
return aPluginOperations->ImportIGES( theFileName, anIsIgnoreUnits );
}
*/
//=============================================================================
TCollection_AsciiString
-IGESPlugin_IECallBack::ReadValue( int theDocId,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theParameterName )
+IGESPlugin_IECallBack::ReadValue( const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName )
{
- IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ IGESPlugin_IOperations* aPluginOperations = IGESPlugin_OperationsCreator::get( GetEngine() );
return aPluginOperations->ReadValue( theFileName, theParameterName );
}
IGESPlugin_IECallBack();
~IGESPlugin_IECallBack();
- bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
+ bool Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName );
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
- TCollection_AsciiString ReadValue( int theDocId,
- const TCollection_AsciiString& theFileName,
+ TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName,
const TCollection_AsciiString& theParameterName );
};
* Constructor
*/
//=============================================================================
-IGESPlugin_IOperations::IGESPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+IGESPlugin_IOperations::IGESPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "IGESPlugin_IOperations::IGESPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( IGESPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
if( theFileName.IsEmpty() ) return NULL;
//Add a new result object
- Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT );
//Add an Import function
Handle(GEOM_Function) aFunction =
class IGESPLUGINENGINE_EXPORT IGESPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- IGESPlugin_IOperations( GEOM_Engine*, int );
+ IGESPlugin_IOperations( GEOM_Engine* );
~IGESPlugin_IOperations();
void ExportIGES( const Handle(GEOM_Object),
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "IGESPlugin_OperationsCreator::Create" );
- _operation = new IGESPlugin_IOperations( theGenImpl );
- return new IGESPlugin_IOperations_i( thePOA, theEngine, _operation );
+ return new IGESPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
}
-IGESPlugin_IOperations* IGESPlugin_OperationsCreator::get()
+IGESPlugin_IOperations* IGESPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
{
+ if( !_operation )
+ _operation = new IGESPlugin_IOperations( theGenImpl );
return _operation;
}
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl );
private:
- static IGESPlugin_IOperations* get();
+ static IGESPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
private:
- IGESPlugin_IOperations* _operation;
+ static IGESPlugin_IOperations* _operation;
friend class IGESPlugin_IECallBack;
};
return;
}
- SalomeApp_Study* anActiveStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
- if ( !anActiveStudy )
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
+ if ( !aStudy )
{
return;
}
SUIT_OverrideCursor wc;
- GEOMGUI_DimensionProperty aDimensions( anActiveStudy, anIObject->getEntry() );
+ GEOMGUI_DimensionProperty aDimensions( aStudy, anIObject->getEntry() );
for ( int anIt = 0; anIt < aDimensions.GetNumber(); ++anIt )
{
aDimensions.SetVisible( anIt, theIsVisible );
}
- aDimensions.SaveToAttribute( anActiveStudy, anIObject->getEntry() );
+ aDimensions.SaveToAttribute( aStudy, anIObject->getEntry() );
- GEOM_Displayer( anActiveStudy ).Redisplay( anIObject, true );
+ GEOM_Displayer().Redisplay( anIObject, true );
}
//=======================================================================
GEOM_Displayer* MeasureGUI_Skeleton::getDisplayer()
{
if ( !myDisplayer )
- myDisplayer = new GEOM_Displayer( getStudy() );
+ myDisplayer = new GEOM_Displayer();
return myDisplayer;
}
// function : restoreSubShapes
// purpose :
//=================================================================================
-void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject )
+void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
{
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory,
/*theInheritFirstArg=*/myListShapes.length() == 1 && myListTools.length() == 0,
mainFrame()->CheckBoxAddPrefix->isChecked() ); // ? false
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
GEOM_Displayer* RepairGUI_FreeFacesDlg::getDisplayer()
{
if ( !myDisplayer )
- myDisplayer = new GEOM_Displayer( getStudy() );
+ myDisplayer = new GEOM_Displayer();
return myDisplayer;
}
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_GlueDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void RepairGUI_GlueDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
GEOM::find_shape_method aFindMethod = GEOM::FSM_GetInPlace;
aFindMethod = GEOM::FSM_GetInPlaceByHistory;
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
aFindMethod, /*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
}
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
- virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+ virtual void restoreSubShapes (SALOMEDS::SObject_ptr);
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_LimitToleranceDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void RepairGUI_LimitToleranceDlg::restoreSubShapes(SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
GEOM::FSM_GetInPlace, /*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
}
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
- virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+ virtual void restoreSubShapes (SALOMEDS::SObject_ptr);
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_RemoveExtraEdgesDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject )
+void RepairGUI_RemoveExtraEdgesDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
{
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked() );
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_RemoveWebsDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void RepairGUI_RemoveWebsDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
- virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+ virtual void restoreSubShapes (SALOMEDS::SObject_ptr);
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_SuppressFacesDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void RepairGUI_SuppressFacesDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void RepairGUI_UnionFacesDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject )
+void RepairGUI_UnionFacesDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
{
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_GetInPlace, // ? GetInPlaceByHistory
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked() );
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !study ) return false;
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STEPPluginEngine" );
STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op );
GeometryGUI::GetGeomGen()->AddInStudy( group, grpName.in(), main );
}
transaction.commit();
- GEOM_Displayer( study ).Display( main.in() );
+ GEOM_Displayer().Display( main.in() );
main->UnRegister();
}
else
*/
//=============================================================================
bool
-STEPPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+STEPPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() );
const STEPPlugin_IOperations::LengthUnit aUnit = STEPPlugin_IOperations::LengthUnit_Meter;
aPluginOperations->ExportSTEP( theOriginal, theFileName, aUnit );
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-STEPPlugin_IECallBack::Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+STEPPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() );
bool anIsIgnoreUnits = ( theFormatName == "STEP_SCALE" ) ? true : false;
return aPluginOperations->ImportSTEP( theFileName, anIsIgnoreUnits, false );
}
*/
//=============================================================================
TCollection_AsciiString
-STEPPlugin_IECallBack::ReadValue( int theDocId,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theParameterName )
+STEPPlugin_IECallBack::ReadValue( const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theParameterName )
{
- STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine() );
return aPluginOperations->ReadValue( theFileName, theParameterName );
}
STEPPlugin_IECallBack();
~STEPPlugin_IECallBack();
- bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
+ bool Export( const Handle(GEOM_Object) theOriginal,
const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName );
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
- TCollection_AsciiString ReadValue( int theDocId,
- const TCollection_AsciiString& theFileName,
+ TCollection_AsciiString ReadValue( const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName,
const TCollection_AsciiString& theParameterName );
};
* Constructor
*/
//=============================================================================
-STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+STEPPlugin_IOperations::STEPPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "STEPPlugin_IOperations::STEPPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( STEPPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
if( theFileName.IsEmpty() ) return NULL;
//Add a new result object
- Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT );
//Add an Import function
Handle(GEOM_Function) aFunction =
public:
- STEPPlugin_IOperations( GEOM_Engine*, int );
+ STEPPlugin_IOperations( GEOM_Engine* );
~STEPPlugin_IOperations();
void ExportSTEP( const Handle(GEOM_Object),
// OCCT includes
#include <TFunction_DriverTable.hxx>
+STEPPlugin_IOperations* STEPPlugin_OperationsCreator::_operation;
+
STEPPlugin_OperationsCreator::STEPPlugin_OperationsCreator()
{
// Register drivers
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "STEPPlugin_OperationsCreator::Create" );
- STEPPlugin_IOperations* anOperation = new STEPPlugin_IOperations( theGenImpl );
- return new STEPPlugin_IOperations_i( thePOA, theEngine, anOperation );
+ return new STEPPlugin_IOperations_i( thePOA, theEngine, get(theGenImpl) );
+}
+
+STEPPlugin_IOperations* STEPPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
+{
+ if( !_operation )
+ _operation = new STEPPlugin_IOperations( theGenImpl );
+ return _operation;
}
GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl );
+private:
+ static STEPPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
+private:
+ static STEPPlugin_IOperations* _operation;
friend class STEPPlugin_IECallBack;
};
{
SalomeApp_Application* app = getGeometryGUI()->getApp();
if ( !app ) return false;
- SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*> ( app->activeStudy() );
- if ( !study ) return false;
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( "STLPluginEngine" );
STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
entryList.append( so->GetID() );
transaction.commit();
- GEOM_Displayer( study ).Display( main.in() );
+ GEOM_Displayer().Display( main.in() );
main->UnRegister();
}
else
*/
//=============================================================================
bool
-STLPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+STLPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine() );
bool anIsASCII = ( theFormatName == "STL_Bin") ? false : true;
const double aDeflection = 0.001;
const bool anIsRelative = true;
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-STLPlugin_IECallBack::Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+STLPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ STLPlugin_IOperations* aPluginOperations = STLPlugin_OperationsCreator::get( GetEngine() );
return aPluginOperations->ImportSTL( theFileName );
}
STLPlugin_IECallBack();
~STLPlugin_IECallBack();
- virtual bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName );
+ virtual bool Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName );
virtual
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
};
#endif
* Constructor
*/
//=============================================================================
-STLPlugin_IOperations::STLPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+STLPlugin_IOperations::STLPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "STLPlugin_IOperations::STLPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( STLPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
if( theFileName.IsEmpty() ) return NULL;
//Add a new result object
- Handle(GEOM_Object) anImported = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT );
+ Handle(GEOM_Object) anImported = GetEngine()->AddObject( GEOM_IMPORT );
//Add an Import function
Handle(GEOM_Function) aFunction =
class STLPLUGINENGINE_EXPORT STLPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- STLPlugin_IOperations( GEOM_Engine*, int );
+ STLPlugin_IOperations( GEOM_Engine* );
~STLPlugin_IOperations();
void ExportSTL( const Handle(GEOM_Object),
// OCCT includes
#include <TFunction_DriverTable.hxx>
+STLPlugin_IOperations* STLPlugin_OperationsCreator::_operation;
+
STLPlugin_OperationsCreator::STLPlugin_OperationsCreator()
{
// Register drivers
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "STLPlugin_OperationsCreator::Create" );
- STLPlugin_IOperations* anOperation = new STLPlugin_IOperations( theGenImpl );
- return new STLPlugin_IOperations_i( thePOA, theEngine, anOperation );
+ return new STLPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
+}
+
+STLPlugin_IOperations* STLPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
+{
+ if( !_operation )
+ _operation = new STLPlugin_IOperations( theGenImpl );
+ return _operation;
}
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl );
+private:
+ static STLPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
+
+private:
+ static STLPlugin_IOperations* _operation;
+
friend class STLPlugin_IECallBack;
};
break;
case GEOMOp::OpReimport: // RELOAD IMPORTED SHAPE
{
- SalomeApp_Study* anAppStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
-
GEOM::GEOM_ITransformOperations_var anOp =
- GeometryGUI::GetGeomGen()->GetITransformOperations(anAppStudy->id());
+ GeometryGUI::GetGeomGen()->GetITransformOperations();
if (anOp->_is_nil()) return false;
- GEOM_Displayer aDisp (anAppStudy);
+ GEOM_Displayer aDisp;
SUIT_Desktop* desk = app->desktop();
QList<SUIT_ViewWindow*> wnds = desk->windows();
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_MirrorDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_MirrorDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// we pass here the first operation argument (object) through the list of arguments
GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
anArgs->length(1);
anArgs[0] = myBase.copy();
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+ getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
/*theFindMethod=*/GEOM::FSM_MultiTransformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// we pass here the first operation argument (object) through the list of arguments
GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
anArgs->length(1);
anArgs[0] = myBase.copy();
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+ getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
/*theFindMethod=*/GEOM::FSM_MultiTransformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_OffsetDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject )
+void TransformationGUI_OffsetDlg::restoreSubShapes( SALOMEDS::SObject_ptr theSObject )
{
if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO( theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked() );
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_PositionDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_PositionDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual GEOM::GEOM_IOperations_ptr createOperation();
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual void addSubshapesToStudy();
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_RotationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// we pass here the first operation argument (object) through the list of arguments
GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
anArgs->length(1);
anArgs[0] = myCurrObject.copy();
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+ getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_ScaleDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_ScaleDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// empty list of arguments means that all arguments should be restored
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(),
+ getGeomEngine()->RestoreSubShapesSO(theSObject, GEOM::ListOfGO(),
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
// function : restoreSubShapes
// purpose :
//=================================================================================
-void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject)
+void TransformationGUI_TranslationDlg::restoreSubShapes (SALOMEDS::SObject_ptr theSObject)
{
if (mainFrame()->CheckBoxRestoreSS->isChecked()) {
// we pass here the first operation argument (object) through the list of arguments
GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO;
anArgs->length(1);
anArgs[0] = myCurrObject.copy();
- getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
+ getGeomEngine()->RestoreSubShapesSO(theSObject, anArgs,
/*theFindMethod=*/GEOM::FSM_Transformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
virtual bool isValid( QString& );
virtual bool execute( ObjectList& );
virtual void addSubshapesToStudy();
- virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+ virtual void restoreSubShapes( SALOMEDS::SObject_ptr );
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
private:
#include "GeometryGUI.h"
#include "GEOM_Operation.h"
#include "GEOMBase.h"
-#include "GEOM_Displayer.h"
#include "GEOM_GenericObjPtr.h"
#include <SALOMEconfig.h>
* Export
*/
//=============================================================================
-bool VTKPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+bool VTKPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- VTKPlugin_IOperations* aPluginOperations = VTKPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ VTKPlugin_IOperations* aPluginOperations = VTKPlugin_OperationsCreator::get( GetEngine() );
const double aDeflection = 0.001;
aPluginOperations->ExportVTK( theOriginal, theFileName, aDeflection );
return true;
VTKPlugin_IECallBack();
~VTKPlugin_IECallBack();
- bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName );
+ bool Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName );
};
#endif
* Constructor
*/
//=============================================================================
-VTKPlugin_IOperations::VTKPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+VTKPlugin_IOperations::VTKPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "VTKPlugin_IOperations::VTKPlugin_IOperations" );
}
if( aRefFunction.IsNull() ) return; //There is no function which creates an object to be exported
//Add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject( GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject( GEOM_IMPORT);
//Add an Export function
Handle(GEOM_Function) aFunction = result->AddFunction( VTKPlugin_ExportDriver::GetID(), EXPORT_SHAPE );
class VTKPLUGINENGINE_EXPORT VTKPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- VTKPlugin_IOperations( GEOM_Engine*, int );
+ VTKPlugin_IOperations( GEOM_Engine* );
~VTKPlugin_IOperations();
void ExportVTK( const Handle(GEOM_Object),
// OCCT includes
#include <TFunction_DriverTable.hxx>
+VTKPlugin_IOperations* VTKPlugin_OperationsCreator::_operation;
+
VTKPlugin_OperationsCreator::VTKPlugin_OperationsCreator()
{
// Register drivers
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "VTKPlugin_OperationsCreator::Create" );
- VTKPlugin_IOperations* anOperation = new VTKPlugin_IOperations( theGenImpl );
- return new VTKPlugin_IOperations_i( thePOA, theEngine, anOperation );
+ return new VTKPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
+}
+
+VTKPlugin_IOperations* VTKPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
+{
+ if( !_operation )
+ _operation = new VTKPlugin_IOperations( theGenImpl );
+ return _operation;
}
GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl );
+private:
+ static VTKPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
+
+private:
+ static VTKPlugin_IOperations* _operation;
friend class VTKPlugin_IECallBack;
};
*/
//=============================================================================
bool
-XAOPlugin_IECallBack::Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName )
+XAOPlugin_IECallBack::Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName )
{
- XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine(), theDocId );
- GEOMImpl_IShapesOperations* aShapesOperations = GetEngine()->GetIShapesOperations( theDocId );
+ XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine() );
+ GEOMImpl_IShapesOperations* aShapesOperations = GetEngine()->GetIShapesOperations();
Handle(TColStd_HSequenceOfTransient) groups = aShapesOperations->GetExistingSubObjects( theOriginal, GEOMImpl_IShapesOperations::Groups );
Handle(TColStd_HSequenceOfTransient) fields = aShapesOperations->GetExistingSubObjects( theOriginal, GEOMImpl_IShapesOperations::Fields );
*/
//=============================================================================
Handle(TColStd_HSequenceOfTransient)
-XAOPlugin_IECallBack::Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName )
+XAOPlugin_IECallBack::Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName )
{
- XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine(), theDocId );
+ XAOPlugin_IOperations* aPluginOperations = XAOPlugin_OperationsCreator::get( GetEngine() );
Handle(TColStd_HSequenceOfTransient) result = new TColStd_HSequenceOfTransient();
Handle(TColStd_HSequenceOfTransient) subshapes = new TColStd_HSequenceOfTransient();
XAOPlugin_IECallBack();
~XAOPlugin_IECallBack();
- virtual bool Export( int theDocId,
- const Handle(GEOM_Object) theOriginal,
- const TCollection_AsciiString& theFileName,
- const TCollection_AsciiString& theFormatName );
+ virtual bool Export( const Handle(GEOM_Object) theOriginal,
+ const TCollection_AsciiString& theFileName,
+ const TCollection_AsciiString& theFormatName );
virtual
- Handle(TColStd_HSequenceOfTransient) Import( int theDocId,
- const TCollection_AsciiString& theFormatName,
- const TCollection_AsciiString& theFileName );
+ Handle(TColStd_HSequenceOfTransient) Import( const TCollection_AsciiString& theFormatName,
+ const TCollection_AsciiString& theFileName );
};
#endif
* Constructor
*/
//=============================================================================
-XAOPlugin_IOperations::XAOPlugin_IOperations( GEOM_Engine* theEngine, int theDocID )
-: GEOMImpl_IBaseIEOperations( theEngine, theDocID )
+XAOPlugin_IOperations::XAOPlugin_IOperations( GEOM_Engine* theEngine )
+: GEOMImpl_IBaseIEOperations( theEngine )
{
MESSAGE( "XAOPlugin_IOperations::XAOPlugin_IOperations" );
}
if (lastFunction.IsNull()) return false;
// add a new result object
- Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT);
+ Handle(GEOM_Object) result = GetEngine()->AddObject(GEOM_IMPORT);
// add an Export function
Handle(GEOM_Function) exportFunction = result->AddFunction(XAOPlugin_Driver::GetID(), EXPORT_SHAPE);
anArray = new TColStd_HArray1OfInteger(1, 1);
anArray->SetValue(1, iref);
- subShape = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE);
+ subShape = GetEngine()->AddObject(GEOM_SUBSHAPE);
Handle(GEOM_Function) aFunction = subShape->AddFunction(GEOM_Object::GetSubShapeID(), 1);
if (aFunction.IsNull())
return;
}
// create the shape
- shape = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT);
+ shape = GetEngine()->AddObject(GEOM_IMPORT);
Handle(GEOM_Function) function = shape->AddFunction(XAOPlugin_Driver::GetID(), IMPORT_SHAPE);
if (function.IsNull()) return false;
if (function->GetDriverGUID() != XAOPlugin_Driver::GetID()) return false;
class XAOPLUGINENGINE_EXPORT XAOPlugin_IOperations: public GEOMImpl_IBaseIEOperations
{
public:
- XAOPlugin_IOperations( GEOM_Engine*, int );
+ XAOPlugin_IOperations( GEOM_Engine* );
~XAOPlugin_IOperations();
bool ExportXAO( Handle(GEOM_Object) shape,
// OCCT includes
#include <TFunction_DriverTable.hxx>
+XAOPlugin_IOperations* XAOPlugin_OperationsCreator::_operation;
+
XAOPlugin_OperationsCreator::XAOPlugin_OperationsCreator()
{
// Register drivers
{
Unexpect aCatch( SALOME_SalomeException );
MESSAGE( "XAOPlugin_OperationsCreator::Create" );
- XAOPlugin_IOperations* anOperation = new XAOPlugin_IOperations( theGenImpl );
- return new XAOPlugin_IOperations_i( thePOA, theEngine, anOperation );
+ return new XAOPlugin_IOperations_i( thePOA, theEngine, get( theGenImpl ) );
+}
+
+XAOPlugin_IOperations* XAOPlugin_OperationsCreator::get( ::GEOMImpl_Gen* theGenImpl )
+{
+ if( !_operation )
+ _operation = new XAOPlugin_IOperations( theGenImpl );
+ return _operation;
}
GEOM_IOperations_i* Create( PortableServer::POA_ptr thePOA,
GEOM::GEOM_Gen_ptr theEngine,
::GEOMImpl_Gen* theGenImpl );
+private:
+ static XAOPlugin_IOperations* get(::GEOMImpl_Gen* theGenImpl);
+
+private:
+ static XAOPlugin_IOperations* _operation;
friend class XAOPlugin_IECallBack;
};