mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-09 20:13:07 +05:00
Avoid including of SALOMEDS classes; fix pb with objects deletion
This commit is contained in:
parent
4fbd5fabf5
commit
131a4abe50
@ -87,8 +87,6 @@
|
||||
using namespace std;
|
||||
|
||||
#include "SALOMEDSClient.hxx"
|
||||
#include "SALOMEDS_SObject.hxx"
|
||||
#include "SALOMEDS_Study.hxx"
|
||||
|
||||
|
||||
//=======================================================================
|
||||
@ -578,7 +576,8 @@ void GEOMBase::ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList, GEOM::stri
|
||||
listIOR.length(nbSel);
|
||||
int j=0;
|
||||
SALOME_ListIteratorOfListIO It(aList);
|
||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
|
||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
|
||||
( SUIT_Session::session()->activeApplication()->activeStudy() );
|
||||
if ( !appStudy ) return;
|
||||
_PTR(Study) aStudy = appStudy->studyDS();
|
||||
|
||||
@ -589,8 +588,10 @@ void GEOMBase::ConvertListOfIOInListOfIOR(const SALOME_ListIO& aList, GEOM::stri
|
||||
_PTR(GenericAttribute) anAttr;
|
||||
if (obj && obj->FindAttribute(anAttr, "AttributeIOR")) {
|
||||
_PTR(AttributeIOR) anIOR (anAttr);
|
||||
CORBA::Object_var theObj = dynamic_cast<SALOMEDS_Study*>(aStudy.get())->ConvertIORToObject(anIOR->Value());
|
||||
if(theObj->_is_a("IDL:GEOM/GEOM_Object:1.0")) {
|
||||
//CORBA::Object_var theObj = dynamic_cast<SALOMEDS_Study*>
|
||||
// (aStudy.get())->ConvertIORToObject(anIOR->Value());
|
||||
CORBA::Object_var theObj = GeometryGUI::ClientSObjectToObject(obj);
|
||||
if (!CORBA::is_nil(theObj) && theObj->_is_a("IDL:GEOM/GEOM_Object:1.0")) {
|
||||
listIOR[j] = CORBA::string_dup(anIOR->Value().c_str());
|
||||
j++;
|
||||
}
|
||||
@ -614,7 +615,8 @@ GEOM::GEOM_Object_ptr GEOMBase::ConvertIOinGEOMObject( const Handle(SALOME_Inter
|
||||
{
|
||||
const char* anEntry = theIO->getEntry();
|
||||
|
||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
|
||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
|
||||
( SUIT_Session::session()->activeApplication()->activeStudy() );
|
||||
if ( !appStudy ) return GEOM::GEOM_Object::_nil();
|
||||
_PTR(Study) aStudy = appStudy->studyDS();
|
||||
|
||||
@ -622,7 +624,7 @@ GEOM::GEOM_Object_ptr GEOMBase::ConvertIOinGEOMObject( const Handle(SALOME_Inter
|
||||
|
||||
if (aSObj)
|
||||
{
|
||||
aReturnObject = GEOM::GEOM_Object::_narrow( dynamic_cast<SALOMEDS_SObject*>(aSObj.get())->GetObject() );
|
||||
aReturnObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObj));
|
||||
theResult = !CORBA::is_nil( aReturnObject );
|
||||
}
|
||||
}
|
||||
@ -655,7 +657,7 @@ void GEOMBase::ConvertListOfIOInListOfGO( const SALOME_ListIO& theList,
|
||||
if ( aSObj )
|
||||
{
|
||||
GEOM::GEOM_Object_var aGeomObj =
|
||||
GEOM::GEOM_Object::_narrow(dynamic_cast<SALOMEDS_SObject*>(aSObj.get())->GetObject());
|
||||
GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObj));
|
||||
if ( !CORBA::is_nil( aGeomObj ) && ( !theShapesOnly || IsShape( aGeomObj ) ) )
|
||||
theListGO[ j++ ] = aGeomObj;
|
||||
}
|
||||
|
@ -59,10 +59,6 @@
|
||||
using namespace std;
|
||||
|
||||
#include <SALOMEDSClient.hxx>
|
||||
#include <SALOMEDS_SObject.hxx>
|
||||
#include <SALOMEDS_Study.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
//================================================================
|
||||
@ -210,7 +206,8 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object,
|
||||
getDisplayer()->SetToActivate( true );
|
||||
|
||||
string entry = getEntry( object );
|
||||
getDisplayer()->Redisplay( new SALOME_InteractiveObject( entry.c_str(), "GEOM", strdup( GEOMBase::GetName( object ) ) ), false );
|
||||
getDisplayer()->Redisplay(new SALOME_InteractiveObject
|
||||
(entry.c_str(), "GEOM", strdup(GEOMBase::GetName(object))), false);
|
||||
}
|
||||
|
||||
if ( withChildren ) {
|
||||
@ -221,7 +218,8 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object,
|
||||
if ( aSObj ) {
|
||||
_PTR(ChildIterator) anIt ( aStudy->NewChildIterator( aSObj ) );
|
||||
for ( anIt->InitEx( true ); anIt->More(); anIt->Next() ) {
|
||||
GEOM::GEOM_Object_var aChild = GEOM::GEOM_Object::_narrow( dynamic_cast<SALOMEDS_SObject*>(anIt->Value().get())->GetObject() );
|
||||
GEOM::GEOM_Object_var aChild = GEOM::GEOM_Object::_narrow
|
||||
(GeometryGUI::ClientSObjectToObject(anIt->Value()));
|
||||
if ( !CORBA::is_nil( aChild ) ) {
|
||||
if ( !aChild->_is_nil() ) {
|
||||
string entry = getEntry( aChild );
|
||||
@ -409,7 +407,8 @@ void GEOMBase_Helper::activate( const int theType )
|
||||
_PTR(SObject) aRefSO;
|
||||
if ( !aSO->ReferencedObject( aRefSO ) )
|
||||
{
|
||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow( dynamic_cast<SALOMEDS_SObject*>(aSO.get())->GetObject() );
|
||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow
|
||||
(GeometryGUI::ClientSObjectToObject(aSO));
|
||||
if ( !anObj->_is_nil() && anObj->GetType() == theType )
|
||||
aList.Append( new SALOME_InteractiveObject( aSO->GetID().c_str(), "GEOM", aSO->GetName().c_str()) );
|
||||
}
|
||||
@ -498,7 +497,8 @@ void GEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* theN
|
||||
|
||||
GEOM::GEOM_Object_ptr aFatherObj = getFather( theObj );
|
||||
|
||||
getGeomEngine()->AddInStudy( dynamic_cast<SALOMEDS_Study*>(aStudy.get())->GetStudy(), theObj, theName, aFatherObj );
|
||||
getGeomEngine()->AddInStudy(GeometryGUI::ClientStudyToStudy(aStudy),
|
||||
theObj, theName, aFatherObj);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
|
@ -66,6 +66,6 @@ LIB_SERVER_IDL =
|
||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome
|
||||
|
||||
LDFLAGS += -L$(KERNEL_ROOT_DIR)/lib/salome -L$(GUI_ROOT_DIR)/lib/salome $(CAS_LDPATH) -lDlgRef -lGEOM -lsuit -lOCCViewer -lVTKViewer -lSalomeDS -lTKPrim
|
||||
LDFLAGS += -L$(KERNEL_ROOT_DIR)/lib/salome -L$(GUI_ROOT_DIR)/lib/salome $(CAS_LDPATH) -lDlgRef -lGEOM -lsuit -lOCCViewer -lVTKViewer -lTKPrim
|
||||
|
||||
@CONCLUDE@
|
||||
|
@ -1,12 +1,13 @@
|
||||
#include <OCCViewer_ViewModel.h>
|
||||
|
||||
#include "GEOMGUI_Selection.h"
|
||||
|
||||
#include "GeometryGUI.h"
|
||||
#include "GEOM_Displayer.h"
|
||||
#include "GEOMImpl_Types.hxx"
|
||||
|
||||
#include <SalomeApp_DataOwner.h>
|
||||
#include <SalomeApp_Study.h>
|
||||
|
||||
#include <OCCViewer_ViewModel.h>
|
||||
|
||||
#include <SUIT_Session.h>
|
||||
#include <SUIT_ViewWindow.h>
|
||||
#include <SUIT_ViewManager.h>
|
||||
@ -14,22 +15,27 @@
|
||||
|
||||
#include <SALOMEDSClient_SObject.hxx>
|
||||
#include <SALOMEDSClient_Study.hxx>
|
||||
#include <SALOMEDS_SObject.hxx>
|
||||
|
||||
#include <SALOME_Prs.h>
|
||||
#include <SALOME_InteractiveObject.hxx>
|
||||
|
||||
#include <SOCC_Prs.h>
|
||||
#include <SVTK_Prs.h>
|
||||
#include <SALOME_Actor.h>
|
||||
#include <vtkActorCollection.h>
|
||||
|
||||
#include <OCCViewer_ViewModel.h>
|
||||
#include <VTKViewer_ViewModel.h>
|
||||
|
||||
#include "GEOMImpl_Types.hxx"
|
||||
|
||||
// OCCT Includes
|
||||
#include <AIS.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_ListOfInteractive.hxx>
|
||||
|
||||
// VTK Includes
|
||||
#include <vtkActorCollection.h>
|
||||
|
||||
GEOMGUI_Selection::GEOMGUI_Selection()
|
||||
{
|
||||
}
|
||||
@ -165,11 +171,10 @@ GEOM::GEOM_Object_ptr GEOMGUI_Selection::getObject( const int index ) const
|
||||
if (study && !anEntry.isNull()) {
|
||||
_PTR(SObject) aSO (study->FindObjectID(anEntry.latin1()));
|
||||
if (aSO) {
|
||||
SALOMEDS_SObject* aDSObj = dynamic_cast<SALOMEDS_SObject*>( aSO.get() );
|
||||
return GEOM::GEOM_Object::_narrow( aDSObj->GetObject() );
|
||||
CORBA::Object_var anObj = GeometryGUI::ClientSObjectToObject(aSO);
|
||||
return GEOM::GEOM_Object::_narrow(anObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
return GEOM::GEOM_Object::_nil();
|
||||
}
|
||||
|
||||
|
@ -26,10 +26,9 @@
|
||||
// Module : GEOM
|
||||
// $Header$
|
||||
|
||||
#include <SOCC_ViewModel.h>
|
||||
|
||||
#include "GEOM_Displayer.h"
|
||||
#include "GEOMImpl_Types.hxx"
|
||||
|
||||
#include "GeometryGUI.h"
|
||||
|
||||
#include "GEOM_TypeFilter.h"
|
||||
#include "GEOM_EdgeFilter.h"
|
||||
@ -38,8 +37,9 @@
|
||||
#include "GEOM_LogicalFilter.h"
|
||||
#include "GEOM_OCCFilter.h"
|
||||
|
||||
#include "GEOM_AssemblyBuilder.h"
|
||||
#include "GEOM_Actor.h"
|
||||
#include "GEOM_AssemblyBuilder.h"
|
||||
#include "GEOM_AISShape.hxx"
|
||||
#include "GEOM_AISTrihedron.hxx"
|
||||
#include "GEOM_VTKTrihedron.hxx"
|
||||
|
||||
@ -56,37 +56,42 @@
|
||||
#include <SalomeApp_Tools.h>
|
||||
|
||||
#include <SALOME_ListIteratorOfListIO.hxx>
|
||||
#include <SALOMEDSClient.hxx>
|
||||
#include <SALOMEDS_SObject.hxx>
|
||||
#include <SALOMEDSClient_SObject.hxx>
|
||||
|
||||
#include <SOCC_Prs.h>
|
||||
#include <SOCC_ViewModel.h>
|
||||
|
||||
#include <SVTK_Prs.h>
|
||||
#include <SVTK_ViewModel.h>
|
||||
|
||||
#include <SALOMEDSClient.hxx>
|
||||
#include <SALOMEDSClient_SObject.hxx>
|
||||
|
||||
// OCCT Includes
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_ListIteratorOfListOfInteractive.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <StdSelect_TypeOfEdge.hxx>
|
||||
#include <StdSelect_TypeOfFace.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Axis2Placement.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
||||
|
||||
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
|
||||
|
||||
#include <GeometryGUI.h>
|
||||
#include <GEOM_AISShape.hxx>
|
||||
#include <AIS_ListIteratorOfListOfInteractive.hxx>
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <Prs3d_PointAspect.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <Geom_Axis2Placement.hxx>
|
||||
#include <StdSelect_TypeOfEdge.hxx>
|
||||
#include <StdSelect_TypeOfFace.hxx>
|
||||
// VTK Includes
|
||||
#include <vtkActorCollection.h>
|
||||
|
||||
// STL Includes
|
||||
#include <cstring>
|
||||
|
||||
// CORBA Headers
|
||||
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
|
||||
|
||||
#include "GEOMImpl_Types.hxx"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//================================================================
|
||||
@ -825,7 +830,7 @@ SALOME_Prs* GEOM_Displayer::buildPresentation( const Handle(SALOME_InteractiveOb
|
||||
if ( SO )
|
||||
{
|
||||
// get CORBA reference to data object
|
||||
CORBA::Object_var object = dynamic_cast<SALOMEDS_SObject*>(SO.get())->GetObject();
|
||||
CORBA::Object_var object = GeometryGUI::ClientSObjectToObject(SO);
|
||||
if ( !CORBA::is_nil( object ) )
|
||||
{
|
||||
// downcast to GEOM object
|
||||
|
@ -82,6 +82,40 @@ bool GeometryGUI::InitGeomGen()
|
||||
return true;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : ClientSObjectToObject
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
CORBA::Object_var GeometryGUI::ClientSObjectToObject (_PTR(SObject) theSObject)
|
||||
{
|
||||
_PTR(GenericAttribute) anAttr;
|
||||
CORBA::Object_var anObj;
|
||||
try {
|
||||
std::string aValue = theSObject->GetIOR();
|
||||
if (strcmp(aValue.c_str(), "") != 0) {
|
||||
CORBA::ORB_ptr anORB = SalomeApp_Application::orb();
|
||||
anObj = anORB->string_to_object(aValue.c_str());
|
||||
}
|
||||
} catch(...) {
|
||||
INFOS("ClientSObjectToObject - Unknown exception was occured!!!");
|
||||
}
|
||||
return anObj._retn();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : ClientStudyToStudy
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
SALOMEDS::Study_var GeometryGUI::ClientStudyToStudy (_PTR(Study) theStudy)
|
||||
{
|
||||
SALOME_NamingService *aNamingService = SalomeApp_Application::namingService();
|
||||
CORBA::Object_var aSMObject = aNamingService->Resolve("/myStudyManager");
|
||||
SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject);
|
||||
int aStudyID = theStudy->StudyId();
|
||||
SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID(aStudyID);
|
||||
return aDSStudy._retn();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// class : CustomItem
|
||||
// purpose : Set Font to a text.
|
||||
|
@ -34,9 +34,18 @@
|
||||
#include "GEOMGUI.h"
|
||||
#include "GEOM_Client.hxx"
|
||||
#include "SALOME_InteractiveObject.hxx"
|
||||
|
||||
#include "SALOMEDSClient.hxx"
|
||||
|
||||
// QT Includes
|
||||
#include <qmap.h>
|
||||
|
||||
#include "gp_Ax3.hxx"
|
||||
// OCCT Includes
|
||||
#include <gp_Ax3.hxx>
|
||||
|
||||
// IDL headers
|
||||
#include "SALOMEconfig.h"
|
||||
#include CORBA_CLIENT_HEADER(SALOMEDS)
|
||||
|
||||
#ifdef WNT
|
||||
#include <SALOME_WNT.hxx>
|
||||
@ -75,6 +84,9 @@ public:
|
||||
|
||||
static GEOM::GEOM_Gen_var GetGeomGen() { return myComponentGeom; }
|
||||
|
||||
static CORBA::Object_var ClientSObjectToObject (_PTR(SObject) theSObject);
|
||||
static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy);
|
||||
|
||||
GEOM_Client& GetShapeReader() { return myShapeReader; }
|
||||
Standard_CString& GetFatherior() { return myFatherior; }
|
||||
//void SetState( const int state ) { myState = state; }
|
||||
@ -137,10 +149,13 @@ protected:
|
||||
|
||||
private:
|
||||
GEOMGUI* getLibrary( const QString& libraryName );
|
||||
void createGeomAction( const int id, const QString& po_id, const QString& icon_id = QString(""), const int key = 0, const bool toggle = false );
|
||||
void createGeomAction( const int id, const QString& po_id,
|
||||
const QString& icon_id = QString(""),
|
||||
const int key = 0, const bool toggle = false );
|
||||
void createPopupItem( const int, const QString& clients, const QString& types,
|
||||
const bool isSingle = false, const int isVisible = -1,
|
||||
const bool isExpandAll = false, const bool isOCC = false, const int parentId = -1 );
|
||||
const bool isExpandAll = false, const bool isOCC = false,
|
||||
const int parentId = -1 );
|
||||
|
||||
private:
|
||||
static GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine
|
||||
@ -158,4 +173,3 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -59,8 +59,6 @@
|
||||
#include "utilities.h"
|
||||
|
||||
#include "SALOMEDSClient.hxx"
|
||||
#include "SALOMEDS_SObject.hxx"
|
||||
#include "SALOMEDS_Study.hxx"
|
||||
|
||||
// OCCT Includes
|
||||
#include <TopExp_Explorer.hxx>
|
||||
|
@ -73,6 +73,6 @@ LIB_SERVER_IDL =
|
||||
CPPFLAGS += $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) -I$(KERNEL_ROOT_DIR)/include/salome -I$(GUI_ROOT_DIR)/include/salome
|
||||
CXXFLAGS += $(BOOST_CPPFLAGS) -I$(KERNEL_ROOT_DIR)/include/salome -I$(GUI_ROOT_DIR)/include/salome
|
||||
|
||||
LDFLAGS += -lGEOMFiltersSelection -L$(KERNEL_ROOT_DIR)/lib/salome -L$(GUI_ROOT_DIR)/lib/salome -lOCCViewer -lVTKViewer -lSalomeApp -lCAM -lGEOMClient -lSOCC -lSVTK -lGEOMObject -lToolsGUI -lSalomeDS -lEvent
|
||||
LDFLAGS += -lGEOMFiltersSelection -L$(KERNEL_ROOT_DIR)/lib/salome -L$(GUI_ROOT_DIR)/lib/salome -lOCCViewer -lVTKViewer -lSalomeApp -lCAM -lGEOMClient -lSOCC -lSVTK -lGEOMObject -lToolsGUI -lEvent
|
||||
|
||||
@CONCLUDE@
|
||||
|
@ -27,6 +27,7 @@
|
||||
// $Header$
|
||||
|
||||
#include "GEOMToolsGUI.h"
|
||||
|
||||
#include "GeometryGUI.h"
|
||||
#include "GEOM_Actor.h"
|
||||
#include "GEOMBase.h"
|
||||
@ -49,20 +50,19 @@
|
||||
#include <SALOME_ListIteratorOfListIO.hxx>
|
||||
#include <SALOME_Prs.h>
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
// QT Includes
|
||||
#include <qapplication.h>
|
||||
#include <qmap.h>
|
||||
|
||||
#include "utilities.h"
|
||||
// OCCT Includes
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
using namespace std;
|
||||
|
||||
typedef QMap<QString, QString> FilterMap;
|
||||
|
||||
#include <SALOMEDS_SObject.hxx>
|
||||
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function : getFileName
|
||||
// purpose : Selection of a file name for Import/Export. Returns also
|
||||
@ -300,8 +300,8 @@ void GEOMToolsGUI::OnEditDelete()
|
||||
if ( !strcmp( obj->GetIOR().c_str(), geomIOR ) )
|
||||
continue;
|
||||
|
||||
// iterate through all childres of obj, find IOR attributes on children and remove shapes that
|
||||
// correspond to these IORs
|
||||
// iterate through all children of obj, find IOR attributes on children
|
||||
// and remove shapes that correspond to these IORs
|
||||
for (_PTR(ChildIterator) it (aStudy->NewChildIterator(obj)); it->More(); it->Next()) {
|
||||
_PTR(SObject) child (it->Value());
|
||||
if (child->FindAttribute(anAttr, "AttributeIOR")) {
|
||||
@ -311,14 +311,15 @@ void GEOMToolsGUI::OnEditDelete()
|
||||
const TCollection_AsciiString ASCior ((char*)anIOR->Value().c_str());
|
||||
getGeometryGUI()->GetShapeReader().RemoveShapeFromBuffer(ASCior);
|
||||
|
||||
for ( view = views.first(); view; view = views.next() ) {
|
||||
CORBA::Object_var corbaObj = (dynamic_cast<SALOMEDS_SObject*>(child.get()))->GetObject();
|
||||
CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(child);
|
||||
GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow(corbaObj);
|
||||
if ( !CORBA::is_nil( geomObj ) )
|
||||
if (!CORBA::is_nil(geomObj)) {
|
||||
for (view = views.first(); view; view = views.next()) {
|
||||
disp->Erase(geomObj, true, view);
|
||||
}
|
||||
}
|
||||
} // for ( childres of obj )
|
||||
}
|
||||
} // for ( children of obj )
|
||||
|
||||
// Erase main graphical object
|
||||
for ( view = views.first(); view; view = views.next() )
|
||||
@ -331,14 +332,14 @@ void GEOMToolsGUI::OnEditDelete()
|
||||
getGeometryGUI()->GetShapeReader().RemoveShapeFromBuffer( ASCIor );
|
||||
}
|
||||
|
||||
// Remove objects from Study
|
||||
aStudyBuilder->RemoveObject( obj );
|
||||
|
||||
CORBA::Object_var corbaObj = (dynamic_cast<SALOMEDS_SObject*>(obj.get()))->GetObject();
|
||||
CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(obj);
|
||||
GEOM::GEOM_Object_var geomObj = GEOM::GEOM_Object::_narrow( corbaObj );
|
||||
if ( !CORBA::is_nil( geomObj ) )
|
||||
GeometryGUI::GetGeomGen()->RemoveObject( geomObj );
|
||||
|
||||
// Remove objects from Study
|
||||
aStudyBuilder->RemoveObject( obj );
|
||||
|
||||
//deleted = true;
|
||||
} // MAIN LOOP of selected
|
||||
|
||||
@ -463,7 +464,9 @@ bool GEOMToolsGUI::Import()
|
||||
if ( !anObj->_is_nil() && aInsOp->IsDone() ) {
|
||||
anObj->SetName( GEOMBase::GetDefaultName( QObject::tr( "GEOM_IMPORT" ) ).latin1() );
|
||||
QString aPublishObjName = GEOMBase::GetDefaultName( SUIT_Tools::file( file, /*withExten=*/true ));
|
||||
GeometryGUI::GetGeomGen()->PublishInStudy(dynamic_cast<SALOMEDS_Study*>(aStudy.get())->GetStudy(),
|
||||
|
||||
SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy(aStudy);
|
||||
GeometryGUI::GetGeomGen()->PublishInStudy(aDSStudy,
|
||||
SALOMEDS::SObject::_nil(),
|
||||
anObj,
|
||||
aPublishObjName);
|
||||
|
@ -32,9 +32,9 @@
|
||||
#include "GEOMGUI.h"
|
||||
|
||||
#include <SALOMEDSClient.hxx>
|
||||
#include <SALOMEDS_Study.hxx>
|
||||
#include <SALOME_ListIO.hxx>
|
||||
|
||||
#include <CORBA.h>
|
||||
|
||||
//=================================================================================
|
||||
// class : GEOMToolsGUI
|
||||
|
@ -29,13 +29,15 @@
|
||||
#include <PythonConsole_PyConsole.h>
|
||||
|
||||
#include "GEOMToolsGUI.h"
|
||||
|
||||
#include "GeometryGUI.h"
|
||||
#include "GEOM_Actor.h"
|
||||
#include "GEOMBase.h"
|
||||
#include "GEOMToolsGUI_TransparencyDlg.h"
|
||||
#include "GEOMToolsGUI_NbIsosDlg.h" // Method ISOS adjustement
|
||||
#include "GEOMToolsGUI_NameDlg.h"
|
||||
|
||||
#include "GEOM_Actor.h"
|
||||
#include "GEOMBase.h"
|
||||
|
||||
#include <SALOME_ListIO.hxx>
|
||||
#include <SALOME_ListIteratorOfListIO.hxx>
|
||||
|
||||
@ -59,11 +61,17 @@
|
||||
#include <SalomeApp_Study.h>
|
||||
#include <SalomeApp_Module.h>
|
||||
|
||||
#include "SALOMEDSClient.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
// OCCT Includes
|
||||
#include <AIS_Drawer.hxx>
|
||||
#include <AIS_ListOfInteractive.hxx>
|
||||
#include <AIS_ListIteratorOfListOfInteractive.hxx>
|
||||
#include <Prs3d_IsoAspect.hxx>
|
||||
|
||||
// VTK Includes
|
||||
#include <vtkBMPReader.h>
|
||||
#include <vtkTexture.h>
|
||||
#include <vtkTextureMapToPlane.h>
|
||||
@ -71,19 +79,14 @@
|
||||
#include <vtkDataSetMapper.h>
|
||||
#include <vtkRenderer.h>
|
||||
|
||||
// QT Includes
|
||||
#include <qfileinfo.h>
|
||||
#include <qcolordialog.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qapplication.h>
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "SALOMEDSClient.hxx"
|
||||
#include "SALOMEDS_Study.hxx"
|
||||
|
||||
|
||||
|
||||
void GEOMToolsGUI::OnSettingsColor()
|
||||
{
|
||||
|
@ -829,6 +829,7 @@ GEOM::GEOM_Object_ptr GEOM_Gen_i::GetObject(CORBA::Long theStudyID, const char*
|
||||
GEOM::GEOM_Object_var obj;
|
||||
Handle(GEOM_Object) handle_object = _impl->GetObject(theStudyID, (char*)theEntry);
|
||||
if (handle_object.IsNull()) return NULL;
|
||||
|
||||
TCollection_AsciiString stringIOR = handle_object->GetIOR();
|
||||
if (stringIOR.Length() > 1) {
|
||||
CORBA::Object_var corba_object = _orb->string_to_object(stringIOR.ToCString());
|
||||
@ -862,4 +863,3 @@ extern "C"
|
||||
return myGEOM_Gen_i->getId();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,16 +6,14 @@
|
||||
// IDL headers
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||
#include CORBA_SERVER_HEADER(SALOMEDS)
|
||||
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
|
||||
|
||||
#include CORBA_CLIENT_HEADER(SALOMEDS)
|
||||
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
|
||||
|
||||
|
||||
#include "SALOME_Component_i.hxx"
|
||||
|
||||
#include "SALOME_NamingService.hxx"
|
||||
|
||||
//#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
|
||||
|
||||
#include "GEOM_IBasicOperations_i.hh"
|
||||
#include "GEOM_ITransformOperations_i.hh"
|
||||
#include "GEOM_I3DPrimOperations_i.hh"
|
||||
@ -29,6 +27,8 @@
|
||||
#include "GEOM_IMeasureOperations_i.hh"
|
||||
#include "GEOM_IGroupOperations_i.hh"
|
||||
|
||||
//#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
|
||||
|
||||
|
||||
//=====================================================================
|
||||
// GEOM_Gen_i : class definition
|
||||
@ -40,6 +40,7 @@ class GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual public Engines_Comp
|
||||
//-----------------------------------------------------------------------//
|
||||
// Constructor / Destructor //
|
||||
//-----------------------------------------------------------------------//
|
||||
|
||||
// constructor to be called for servant creation.
|
||||
GEOM_Gen_i();
|
||||
GEOM_Gen_i(CORBA::ORB_ptr orb,
|
||||
@ -103,8 +104,13 @@ class GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual public Engines_Comp
|
||||
CORBA::Long theObjectID,
|
||||
SALOMEDS::SObject_ptr theObject);
|
||||
|
||||
//Adds theObject in the study with a name = theName, if theFather is not null the object is placed under theFather
|
||||
SALOMEDS::SObject_ptr AddInStudy(SALOMEDS::Study_ptr theStudy, GEOM::GEOM_Object_ptr theObject, const char* theName, GEOM::GEOM_Object_ptr theFather);
|
||||
/*! \brief Adds theObject in the study with a name = theName, if
|
||||
* theFather is not null the object is placed under theFather
|
||||
*/
|
||||
SALOMEDS::SObject_ptr AddInStudy (SALOMEDS::Study_ptr theStudy,
|
||||
GEOM::GEOM_Object_ptr theObject,
|
||||
const char* theName,
|
||||
GEOM::GEOM_Object_ptr theFather);
|
||||
|
||||
//-----------------------------------------------------------------------//
|
||||
// Transaction methods //
|
||||
@ -169,7 +175,8 @@ class GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual public Engines_Comp
|
||||
throw (SALOME::SALOME_Exception);
|
||||
|
||||
//Adds a new sub shape
|
||||
virtual GEOM::GEOM_Object_ptr AddSubShape(GEOM::GEOM_Object_ptr theMainShape, const GEOM::ListOfLong& theIndices);
|
||||
virtual GEOM::GEOM_Object_ptr AddSubShape (GEOM::GEOM_Object_ptr theMainShape,
|
||||
const GEOM::ListOfLong& theIndices);
|
||||
|
||||
virtual void RemoveObject(GEOM::GEOM_Object_ptr theObject);
|
||||
|
||||
@ -185,9 +192,10 @@ class GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual public Engines_Comp
|
||||
|
||||
GEOM::string_array* GetAllDumpNames();
|
||||
|
||||
//********************************************************************************************************//
|
||||
// Internal methods
|
||||
//********************************************************************************************************//
|
||||
//-----------------------------------------------------------------------//
|
||||
// Internal methods //
|
||||
//-----------------------------------------------------------------------//
|
||||
|
||||
virtual GEOM::GEOM_Object_ptr GetObject(CORBA::Long theStudyID, const char* theEntry);
|
||||
|
||||
private:
|
||||
@ -195,7 +203,6 @@ class GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual public Engines_Comp
|
||||
::GEOMImpl_Gen* _impl;
|
||||
SALOME_NamingService * name_service;
|
||||
char * _name;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -282,9 +282,10 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSplineInterpolation
|
||||
* MakeSketcher
|
||||
*/
|
||||
//=============================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcher (const char* theCommand, const GEOM::ListOfDouble& theWorkingPlane)
|
||||
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcher
|
||||
(const char* theCommand, const GEOM::ListOfDouble& theWorkingPlane)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_nil();
|
||||
|
||||
//Set a not done flag
|
||||
GetOperations()->SetNotDone();
|
||||
@ -297,9 +298,10 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcher (const char* theCom
|
||||
|
||||
// Make Sketcher
|
||||
Handle(GEOM_Object) anObject =
|
||||
GetOperations()->MakeSketcher(theCommand, aWorkingPlane);
|
||||
GetOperations()->MakeSketcher(strdup(theCommand), aWorkingPlane);
|
||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
return aGEOMObject._retn();
|
||||
//return aGEOMObject._retn();
|
||||
return GEOM::GEOM_Object::_nil();
|
||||
|
||||
return GetObject(anObject);
|
||||
}
|
||||
@ -310,9 +312,10 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcher (const char* theCom
|
||||
* MakeSketcherOnPlane
|
||||
*/
|
||||
//=============================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcherOnPlane (const char* theCommand, GEOM::GEOM_Object_ptr theWorkingPlane)
|
||||
GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcherOnPlane
|
||||
(const char* theCommand, GEOM::GEOM_Object_ptr theWorkingPlane)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_nil();
|
||||
|
||||
//Set a not done flag
|
||||
GetOperations()->SetNotDone();
|
||||
@ -322,7 +325,7 @@ GEOM::GEOM_Object_ptr GEOM_ICurvesOperations_i::MakeSketcherOnPlane (const char*
|
||||
|
||||
// Make Sketcher
|
||||
Handle(GEOM_Object) anObject =
|
||||
GetOperations()->MakeSketcherOnPlane(theCommand, aWorkingPlane);
|
||||
GetOperations()->MakeSketcherOnPlane(strdup(theCommand), aWorkingPlane);
|
||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
return aGEOMObject._retn();
|
||||
|
||||
|
@ -4,12 +4,13 @@
|
||||
|
||||
|
||||
#include <SALOMEconfig.h>
|
||||
|
||||
#include CORBA_SERVER_HEADER(SALOMEDS)
|
||||
#include CORBA_CLIENT_HEADER(SALOMEDS)
|
||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||
|
||||
#include "SALOME_GenericObj_i.hh"
|
||||
|
||||
#include "GEOM_Object.hxx"
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
class GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public virtual SALOME::GenericObj_i
|
||||
|
@ -54,9 +54,11 @@ LIB_SRC = \
|
||||
GEOM_Gen_i.cc \
|
||||
GEOM_DumpPython.cc
|
||||
|
||||
# SALOME_Component.idl
|
||||
LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl #\
|
||||
#SALOME_Exception.idl SALOME_GenericObj.idl
|
||||
|
||||
LIB_SERVER_IDL = SALOME_Component.idl SALOMEDS.idl SALOME_Exception.idl \
|
||||
GEOM_Gen.idl SALOME_GenericObj.idl
|
||||
LIB_SERVER_IDL = GEOM_Gen.idl
|
||||
|
||||
# Executables targets
|
||||
BIN =
|
||||
@ -84,7 +86,9 @@ EXPORT_HEADERS = GEOM_Object_i.hh \
|
||||
# additionnal information to compil and link file
|
||||
CPPFLAGS += $(OCC_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
CXXFLAGS += $(OCC_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
|
||||
LDFLAGS += -lTOOLSDS -lSalomeNS -lSalomeContainer -lGEOMArchimede -lGEOMbasic -lGEOMimpl $(CAS_LDPATH) -lTKIGES -lTKSTEP -lTKFillet -lTKOffset -lGEOMSketcher -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeGenericObj
|
||||
LDFLAGS += -lGEOMArchimede -lGEOMbasic -lGEOMimpl -lGEOMSketcher \
|
||||
$(CAS_LDPATH) -lTKIGES -lTKSTEP -lTKFillet -lTKOffset \
|
||||
-L${KERNEL_ROOT_DIR}/lib/salome -lSalomeNS -lSalomeContainer -lSalomeGenericObj
|
||||
|
||||
# additional file to be cleaned
|
||||
MOSTLYCLEAN =
|
||||
@ -92,4 +96,3 @@ CLEAN =
|
||||
DISTCLEAN =
|
||||
|
||||
@CONCLUDE@
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user