-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "LightApp_Application.h"
#include "SUIT_SelectionMgr.h"
-#include <SPlot2d_ViewModel.h>
-
-#include <SALOME_ListIO.hxx>
+#ifndef DISABLE_SALOMEOBJECT
+ #include <SALOME_ListIO.hxx>
+ #ifndef DISABLE_PLOT2DVIEWER
+ #include <SPlot2d_ViewModel.h>
+ #endif
+#endif
/*!
Constructor
: SUIT_Selector( mgr, v ),
myViewer(v)
{
- if ( v )
+ if ( v ) {
connect( v, SIGNAL( legendSelected( const QString& ) ), this, SLOT( onSelectionChanged( const QString& ) ) );
connect( v, SIGNAL( clearSelected() ), this, SLOT( onClearSelected( ) ) );
+ }
}
/*!
*/
void LightApp_Plot2dSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const
{
- if( !myCurEntry.isNull() )
- theList.append( new LightApp_DataOwner( new SALOME_InteractiveObject(qPrintable(myCurEntry),"","") ) );
+ if( !myCurEntry.isNull() ) {
+#ifndef DISABLE_SALOMEOBJECT
+ theList.append( new LightApp_DataOwner( new SALOME_InteractiveObject(qUtf8Printable(myCurEntry),"","") ) );
+#else
+ theList.append( new LightApp_DataOwner( myCurEntry ) );
+#endif
+ }
}
/*!Sets selection.*/
void LightApp_Plot2dSelector::setSelection( const SUIT_DataOwnerPtrList& theList )
{
+#ifndef DISABLE_SALOMEOBJECT
SALOME_ListIO anIOList;
for ( SUIT_DataOwnerPtrList::const_iterator it = theList.begin(); it != theList.end(); ++it ) {
const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*it).operator->() );
if ( owner ) {
if( !owner->IO().IsNull() ) {
- anIOList.Append(owner->IO());
- } else if ( !owner->entry().isEmpty() ) {
- anIOList.Append( new SALOME_InteractiveObject(qPrintable(owner->entry()),"","") );
+ anIOList.Append(owner->IO());
+ }
+ else if ( !owner->entry().isEmpty() ) {
+ anIOList.Append( new SALOME_InteractiveObject(qUtf8Printable(owner->entry()),"","") );
}
}
}
if(v)
v->setObjectsSelected(anIOList);
+#endif
}
/*!On selection changed.*/