Salome HOME
projects
/
modules
/
geom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[bos #35160][EDF](2023-T1) Keyboard shortcuts.
[modules/geom.git]
/
src
/
GEOMBase
/
GEOMBase.cxx
diff --git
a/src/GEOMBase/GEOMBase.cxx
b/src/GEOMBase/GEOMBase.cxx
index 847240088261e15c92a1f2bdef7e72dbe804f6f7..7ab1fa15263328c61026fd9020bfd205c2e33959 100644
(file)
--- a/
src/GEOMBase/GEOMBase.cxx
+++ b/
src/GEOMBase/GEOMBase.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
16 CEA/DEN, EDF R&D
, OPEN CASCADE
+// Copyright (C) 2007-20
24 CEA, EDF
, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-307,7
+307,7
@@
Handle(GEOM_AISShape) GEOMBase::ConvertIORinGEOMAISShape(const QString& IOR, boo
if ( it.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
Handle(GEOM_AISShape) sh = Handle(GEOM_AISShape)::DownCast( it.Value() );
if ( !sh.IsNull() && sh->hasIO() ) {
if ( it.Value()->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
Handle(GEOM_AISShape) sh = Handle(GEOM_AISShape)::DownCast( it.Value() );
if ( !sh.IsNull() && sh->hasIO() ) {
- Handle(SALOME_InteractiveObject) IO =
Handle(SALOME_InteractiveObject)::DownCast( sh->getIO()
);
+ Handle(SALOME_InteractiveObject) IO =
sh->getIO(
);
if ( !IO.IsNull() && IO->hasEntry() && obj->GetID() == IO->getEntry() )
shape = sh;
}
if ( !IO.IsNull() && IO->hasEntry() && obj->GetID() == IO->getEntry() )
shape = sh;
}
@@
-354,7
+354,7
@@
GEOM_Actor* GEOMBase::ConvertIORinGEOMActor(const QString& IOR, bool onlyInActiv
if ( a->IsA( "GEOM_Actor" ) ) {
GEOM_Actor* ga = GEOM_Actor::SafeDownCast( a );
if ( ga && ga->hasIO() ) {
if ( a->IsA( "GEOM_Actor" ) ) {
GEOM_Actor* ga = GEOM_Actor::SafeDownCast( a );
if ( ga && ga->hasIO() ) {
- Handle(SALOME_InteractiveObject) IO =
Handle(SALOME_InteractiveObject)::DownCast( ga->getIO()
);
+ Handle(SALOME_InteractiveObject) IO =
ga->getIO(
);
if ( !IO.IsNull() && IO->hasEntry() && obj->GetID() == IO->getEntry() )
actor = ga;
}
if ( !IO.IsNull() && IO->hasEntry() && obj->GetID() == IO->getEntry() )
actor = ga;
}
@@
-374,7
+374,7
@@
GEOM_Actor* GEOMBase::ConvertIORinGEOMActor(const QString& IOR, bool onlyInActiv
// purpose :
//=======================================================================
Handle(AIS_InteractiveObject) GEOMBase::GetAIS( const Handle(SALOME_InteractiveObject)& IO,
// purpose :
//=======================================================================
Handle(AIS_InteractiveObject) GEOMBase::GetAIS( const Handle(SALOME_InteractiveObject)& IO,
- bool onlyInActiveView, bool
onlyGeom
)
+ bool onlyInActiveView, bool
/*onlyGeom*/
)
{
Handle(AIS_InteractiveObject) aisObject;
{
Handle(AIS_InteractiveObject) aisObject;
@@
-450,12
+450,11
@@
GEOM::GEOM_Object_ptr GEOMBase::ConvertIOinGEOMObject( const Handle(SALOME_Inter
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
if ( study ) {
_PTR(Study) studyDS = study->studyDS();
SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
if ( study ) {
_PTR(Study) studyDS = study->studyDS();
- _PTR(SObject) obj( studyDS->FindObjectID( IO->getEntry() ) );
- if ( obj ) {
- CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( obj );
- if ( !CORBA::is_nil( corbaObj ) )
+ _PTR(SObject) obj = studyDS->FindObjectID( IO->getEntry() );
+ if ( GeometryGUI::IsInGeomComponent( obj )) {
+ CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( obj );
object = GEOM::GEOM_Object::_narrow( corbaObj );
object = GEOM::GEOM_Object::_narrow( corbaObj );
- }
+
}
}
}
return object._retn();
}
}
return object._retn();
@@
-489,7
+488,6
@@
void GEOMBase::ConvertListOfIOInListOfGO( const SALOME_ListIO& IObjects,
}
}
}
}
-
//=================================================================================
// function : CreateArrowForLinearEdge()
// purpose : Create a cone topology to be used to display an arrow in the middle
//=================================================================================
// function : CreateArrowForLinearEdge()
// purpose : Create a cone topology to be used to display an arrow in the middle
@@
-526,7
+524,7
@@
TopoDS_Shape GEOMBase::CreateArrowForLinearEdge( const TopoDS_Shape& shape )
}
}
}
}
}
}
- catch ( Standard_Failure ) {
+ catch ( Standard_Failure
&
) {
// OCC failures are hard to catch in GUI.
// This is because of the position for #include <Standard_ErrorHandler.hxx> that is very critical to find
// in SALOME environment : compilation error !
// OCC failures are hard to catch in GUI.
// This is because of the position for #include <Standard_ErrorHandler.hxx> that is very critical to find
// in SALOME environment : compilation error !
@@
-626,7
+624,7
@@
bool GEOMBase::SelectionByNameInDialogs( QWidget* widget, const QString& objectU
/* Create a SALOME_InteractiveObject with a SALOME::SObject */
Handle(SALOME_InteractiveObject) IO = new SALOME_InteractiveObject( listSO[0]->GetID().c_str(),
"GEOM",
/* Create a SALOME_InteractiveObject with a SALOME::SObject */
Handle(SALOME_InteractiveObject) IO = new SALOME_InteractiveObject( listSO[0]->GetID().c_str(),
"GEOM",
- objectUserName.to
Latin1
().constData() );
+ objectUserName.to
Utf8
().constData() );
/* Add as a selected object */
/* Clear any previous selection : */
/* Add as a selected object */
/* Clear any previous selection : */
@@
-710,7
+708,7
@@
void GEOMBase::ShowErrorMessage( const QString& errorCode, const QString& commen
if ( !errorCode.isEmpty() )
text << QObject::tr( errorCode.toLatin1().constData() );
if ( !comment.isEmpty() )
if ( !errorCode.isEmpty() )
text << QObject::tr( errorCode.toLatin1().constData() );
if ( !comment.isEmpty() )
- text << QObject::tr( comment.to
Latin1
().constData() );
+ text << QObject::tr( comment.to
Utf8
().constData() );
SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
QObject::tr( "GEOM_ERROR" ),
SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(),
QObject::tr( "GEOM_ERROR" ),
@@
-747,7
+745,10
@@
bool GEOMBase::GetShape( GEOM::GEOM_Object_ptr object, TopoDS_Shape& shape, cons
if ( !CORBA::is_nil( object ) ) {
TopAbs_ShapeEnum stype = (TopAbs_ShapeEnum)( object->GetShapeType() );
if ( type == TopAbs_SHAPE || type == stype )
if ( !CORBA::is_nil( object ) ) {
TopAbs_ShapeEnum stype = (TopAbs_ShapeEnum)( object->GetShapeType() );
if ( type == TopAbs_SHAPE || type == stype )
- shape = GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), object );
+ {
+ GEOM::GEOM_Gen_var gen = object->GetGen();
+ shape = GEOM_Client::get_client().GetShape( gen, object );
+ }
}
return !shape.IsNull();
}
}
return !shape.IsNull();
}
@@
-869,8
+870,7
@@
void GEOMBase::PublishSubObject( GEOM::GEOM_Object_ptr object, const QString& na
QString fatherEntry = GetEntry( father );
if ( entry.isEmpty() && !CORBA::is_nil( father ) && !fatherEntry.isEmpty() ) {
QString aName = !name.isEmpty() ? name : GetName( object );
QString fatherEntry = GetEntry( father );
if ( entry.isEmpty() && !CORBA::is_nil( father ) && !fatherEntry.isEmpty() ) {
QString aName = !name.isEmpty() ? name : GetName( object );
- GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ),
- object, aName.toLatin1().data(), father.in() );
+ GeometryGUI::GetGeomGen()->AddInStudy( object, aName.toUtf8().data(), father.in() );
}
}
}
}
}
}