-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include <vtkActorCollection.h>
#include <vtkProperty.h>
+#include <Basics_OCCTVersion.hxx>
// CORBA Headers
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
else if ( !myName.empty() ) {
// workaround to allow selection of temporary objects
static int tempId = 0;
- anIO = new SALOME_InteractiveObject( QString( "TEMP_%1" ).arg( tempId++ ).toLatin1().data(), "GEOM", myName.c_str() );
+ anIO = new SALOME_InteractiveObject( QString( "TEMP_%1" ).arg( tempId++ ).toUtf8().data(), "GEOM", myName.c_str() );
AISShape->setIO( anIO );
AISShape->SetOwner( anIO );
}
else if ( !myName.empty() ) {
// workaround to allow selection of temporary objects
static int tempId = 0;
- anIO = new SALOME_InteractiveObject( QString( "TEMP_VTK_%1" ).arg( tempId++ ).toLatin1().data(), "GEOM", myName.c_str() );
+ anIO = new SALOME_InteractiveObject( QString( "TEMP_VTK_%1" ).arg( tempId++ ).toUtf8().data(), "GEOM", myName.c_str() );
actor->setIO( anIO );
}
if ( prs )
{
Handle( SALOME_InteractiveObject ) theIO = new SALOME_InteractiveObject();
- theIO->setEntry( entry.toLatin1().constData() );
+ theIO->setEntry( entry.toUtf8().constData() );
if ( !theIO.IsNull() )
{
// set interactive object
if (prs)
{
Handle(SALOME_InteractiveObject) theIO = new SALOME_InteractiveObject();
- theIO->setEntry(entry.toLatin1().constData());
+ theIO->setEntry(entry.toUtf8().constData());
if (!theIO.IsNull())
{
// set interactive object
if ( theModes.Contains( GEOM_ALLOBJECTS ) )
return;
- SUIT_SelectionFilter* aFilter;
- if ( theModes.Extent() == 1 )
- {
- int aMode = TColStd_MapIteratorOfMapOfInteger( theModes ).Key();
-
- if ( aMode == GEOM_COMPOUNDFILTER )
- aFilter = getComplexFilter( theSubShapes );
- else
- aFilter = getFilter( aMode );
- }
- else if ( theModes.Extent() > 1 )
+ SUIT_SelectionFilter* aFilter = NULL;
+ if ( theModes.Extent() > 0 )
{
TColStd_MapOfInteger aTopAbsModes;
TColStd_MapIteratorOfMapOfInteger anIter( theModes );
int aMode = anIter.Key();
if ( aMode == GEOM_COMPOUNDFILTER )
aFilter = getComplexFilter( theSubShapes );
+ if ( aMode == GEOM_COMPOUND ) {
+ // always add COMPSOLID filter together with COMPOUND filter
+ aFilter = new GEOM_TypeFilter( getStudy(), TopAbs_COMPSOLID, true );
+ aListOfFilters.append( aFilter );
+
+ // add the COMPOUND filter itself
+ aFilter = getFilter( aMode );
+ }
else
aFilter = getFilter( aMode );
aListOfFilters.append( aFilter );
}
- aFilter = new GEOM_LogicalFilter( aListOfFilters, GEOM_LogicalFilter::LO_OR );
+ if (aListOfFilters.size() > 1)
+ aFilter = new GEOM_LogicalFilter( aListOfFilters, GEOM_LogicalFilter::LO_OR );
}
else
return;
Handle(AIS_InteractiveContext) ic = vf->getAISContext();
if ( !ic.IsNull() )
{
+#if OCC_VERSION_LARGE <= 0x07030000
if ( ic->HasOpenedContext() )
ic->CloseAllContexts(Standard_True);
+#else
+ ic->Deactivate();
+ ic->Activate( 0 );
+#endif
}
}
}
bool GEOM_Displayer::canBeDisplayed( const QString& entry, const QString& viewer_type ) const
{
- _PTR(SObject) anObj = getStudy()->studyDS()->FindObjectID( (const char*)entry.toLatin1() );
+ _PTR(SObject) anObj = getStudy()->studyDS()->FindObjectID( (const char*)entry.toUtf8() );
GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(anObj)); // enable displaying of GEOM objects
GEOM::GEOM_FieldStep_var aFieldStepObj = GEOM::GEOM_FieldStep::_narrow(GeometryGUI::ClientSObjectToObject(anObj)); // enable displaying of GEOM field steps
GEOM::GEOM_Gen_var aCompObj = GEOM::GEOM_Gen::_narrow(GeometryGUI::ClientSObjectToObject(anObj)); // enable displaying of whole GEOM component
if(l_obj)
foreach ( view, views ) {
Handle(SALOME_InteractiveObject) anIO =
- new SALOME_InteractiveObject(qPrintable(l_obj->entry()), "GEOM", "");
+ new SALOME_InteractiveObject(qUtf8Printable(l_obj->entry()), "GEOM", "");
Erase(anIO, false, false, view);
}
}