#include "GEOM_Operation.h"
#include "GEOMBase.h"
#include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(BREPPlugin)
+typedef GEOM::GenericObjPtr<GEOM::IBREPOperations> BREPOpPtr;
+
//=======================================================================
// function : BREPPlugin_GUI()
// purpose : Constructor
SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "BREPPluginEngine" );
- GEOM::IBREPOperations_var brepOp = GEOM::IBREPOperations::_narrow( op );
- if ( CORBA::is_nil( brepOp ) ) return false;
+ BREPOpPtr brepOp = GEOM::IBREPOperations::_narrow( op );
+ if ( brepOp.isNull() ) return false;
QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
tr( "BREP_FILES" ),
foreach( QString fileName, fileNames )
{
SUIT_OverrideCursor wc;
- GEOM_Operation transaction( app, brepOp.in() );
+ GEOM_Operation transaction( app, brepOp.get() );
try
{
entryList.append( so->GetID() );
transaction.commit();
GEOM_Displayer( study ).Display( main.in() );
+ main->UnRegister();
}
else
{
SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "BREPPluginEngine" );
- GEOM::IBREPOperations_var brepOp = GEOM::IBREPOperations::_narrow( op );
- if ( CORBA::is_nil( brepOp ) ) return false;
+ BREPOpPtr brepOp = GEOM::IBREPOperations::_narrow( op );
+ if ( brepOp.isNull() ) return false;
LightApp_SelectionMgr* sm = app->selectionMgr();
if ( !sm ) return false;
SUIT_OverrideCursor wc;
- GEOM_Operation transaction( app, brepOp.in() );
+ GEOM_Operation transaction( app, brepOp.get() );
try
{
#include "GEOM_Operation.h"
#include "GEOMBase.h"
#include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(IGESPlugin)
+typedef GEOM::GenericObjPtr<GEOM::IIGESOperations> IGESOpPtr;
+
//=======================================================================
// function : IGESPlugin_GUI()
// purpose : Constructor
SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "IGESPluginEngine" );
- GEOM::IIGESOperations_var igesOp = GEOM::IIGESOperations::_narrow( op );
- if ( CORBA::is_nil( igesOp ) ) return false;
+ IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op );
+ if ( igesOp.isNull() ) return false;
QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
tr( "IGES_FILES" ),
{
QString fileName = fileNames.at( i );
SUIT_OverrideCursor wc;
- GEOM_Operation transaction( app, igesOp.in() );
+ GEOM_Operation transaction( app, igesOp.get() );
bool ignoreUnits = false;
try
entryList.append( so->GetID() );
transaction.commit();
GEOM_Displayer( study ).Display( main.in() );
+ main->UnRegister();
}
else
{
SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "IGESPluginEngine" );
- GEOM::IIGESOperations_var igesOp = GEOM::IIGESOperations::_narrow( op );
- if ( CORBA::is_nil( igesOp ) ) return false;
+ IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op );
+ if ( igesOp.isNull() ) return false;
LightApp_SelectionMgr* sm = app->selectionMgr();
if ( !sm ) return false;
SUIT_OverrideCursor wc;
- GEOM_Operation transaction( app, igesOp.in() );
+ GEOM_Operation transaction( app, igesOp.get() );
try
{
#include "GEOM_Operation.h"
#include "GEOMBase.h"
#include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(STEPPlugin)
+typedef GEOM::GenericObjPtr<GEOM::ISTEPOperations> STEPOpPtr;
+
//=======================================================================
// function : STEPPlugin_GUI()
// purpose : Constructor
SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STEPPluginEngine" );
- GEOM::ISTEPOperations_var stepOp = GEOM::ISTEPOperations::_narrow( op );
- if ( CORBA::is_nil( stepOp ) ) return false;
+ STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op );
+ if ( stepOp.isNull() ) return false;
QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
tr( "STEP_FILES" ),
{
QString fileName = fileNames.at( i );
SUIT_OverrideCursor wc;
- GEOM_Operation transaction( app, stepOp.in() );
+ GEOM_Operation transaction( app, stepOp.get() );
bool ignoreUnits = false;
try
}
transaction.commit();
GEOM_Displayer( study ).Display( main.in() );
+ main->UnRegister();
}
else
{
SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STEPPluginEngine" );
- GEOM::ISTEPOperations_var stepOp = GEOM::ISTEPOperations::_narrow( op );
- if ( CORBA::is_nil( stepOp ) ) return false;
+ STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op );
+ if ( stepOp.isNull() ) return false;
LightApp_SelectionMgr* sm = app->selectionMgr();
if ( !sm ) return false;
SUIT_OverrideCursor wc;
- GEOM_Operation transaction( app, stepOp.in() );
+ GEOM_Operation transaction( app, stepOp.get() );
try
{
#include "GEOM_Operation.h"
#include "GEOMBase.h"
#include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(STLPlugin)
+typedef GEOM::GenericObjPtr<GEOM::ISTLOperations> STLOpPtr;
+
//=======================================================================
// function : STLPlugin_GUI()
// purpose : Constructor
SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" );
- GEOM::ISTLOperations_var stlOp = GEOM::ISTLOperations::_narrow( op );
- if ( CORBA::is_nil( stlOp ) ) return false;
+ STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
+ if ( stlOp.isNull() ) return false;
QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
tr( "STL_FILES" ),
foreach( QString fileName, fileNames )
{
SUIT_OverrideCursor wc;
- GEOM_Operation transaction( app, stlOp.in() );
+ GEOM_Operation transaction( app, stlOp.get() );
try
{
entryList.append( so->GetID() );
transaction.commit();
GEOM_Displayer( study ).Display( main.in() );
+ main->UnRegister();
}
else
{
SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" );
- GEOM::ISTLOperations_var stlOp = GEOM::ISTLOperations::_narrow( op );
- if ( CORBA::is_nil( stlOp ) ) return false;
+ STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
+ if ( stlOp.isNull() ) return false;
LightApp_SelectionMgr* sm = app->selectionMgr();
if ( !sm ) return false;
SUIT_OverrideCursor wc;
- GEOM_Operation transaction( app, stlOp.in() );
+ GEOM_Operation transaction( app, stlOp.get() );
try
{
#include "GEOM_Operation.h"
#include "GEOMBase.h"
#include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(VTKPlugin)
+typedef GEOM::GenericObjPtr<GEOM::IVTKOperations> VTKOpPtr;
+
//=======================================================================
// function : VTKPlugin_GUI()
// purpose : Constructor
SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "VTKPluginEngine" );
- GEOM::IVTKOperations_var stlOp = GEOM::IVTKOperations::_narrow( op );
- if ( CORBA::is_nil( stlOp ) ) return false;
+ VTKOpPtr vtkOp = GEOM::IVTKOperations::_narrow( op );
+ if ( vtkOp.isNull() ) return false;
LightApp_SelectionMgr* sm = app->selectionMgr();
if ( !sm ) return false;
SUIT_OverrideCursor wc;
- GEOM_Operation transaction( app, stlOp.in() );
+ GEOM_Operation transaction( app, vtkOp.get() );
try
{
app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
transaction.start();
- stlOp->ExportVTK( obj, fileName.toUtf8().constData(), deflection );
+ vtkOp->ExportVTK( obj, fileName.toUtf8().constData(), deflection );
- if ( stlOp->IsDone() )
+ if ( vtkOp->IsDone() )
{
transaction.commit();
}
transaction.abort();
SUIT_MessageBox::critical( parent,
tr( "GEOM_ERROR" ),
- tr( "GEOM_PRP_ABORT" ) + "\n" + tr( stlOp->GetErrorCode() ) );
+ tr( "GEOM_PRP_ABORT" ) + "\n" + tr( vtkOp->GetErrorCode() ) );
return false;
}
}
{
QStringList anEntryList;
anEntryList << addInStudy(m_mainShape, m_mainShape->GetName());
+ m_mainShape->UnRegister();
for (int i = 0; i < subShapes->length(); i++)
{
addInStudy(subShapes[i].in(), subShapes[i]->GetName());
+ subShapes[i]->UnRegister();
}
for (int i = 0; i < groups->length(); i++)
{
addInStudy(groups[i].in(), groups[i]->GetName());
+ groups[i]->UnRegister();
}
for (int i = 0; i < fields->length(); i++)
{
SALOMEDS::SObject_var aSO =
getGeomEngine()->AddInStudy(aStudyDS, theField, theField->GetName(), theFather);
+ theField->UnRegister();
QString anEntry;
if ( !aSO->_is_nil() ) {
QString stepName = (tr("XAOPLUGIN_STEP") + " %1 %2").arg( step->GetID() ).arg( step->GetStamp() );
SALOMEDS::SObject_wrap aSOField =
getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), theField );
+ step->UnRegister();
}
aSO->UnRegister();