-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019 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 <GEOM_Constants.h>
#include <GEOM_Displayer.h>
-#include <Basics_OCCTVersion.hxx>
-
#include <QtxComboBox.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <QButtonGroup>
#include <QGridLayout>
if ( type > GEOM::MT_NONE && type < GEOM::MT_USER ) {
myTypeGroup->button( 0 )->setChecked( true );
myWGStack->setCurrentIndex( 0 );
- myStdTypeCombo->setCurrentIndex( (int)type - 1 );
-#ifdef WNT
+ myStdTypeCombo->setCurrentId( (int)type );
+#ifdef WIN32
int asize = max( (int)GEOM::MS_10, min( (int)GEOM::MS_70, (int)size ) );
#else
int asize = std::max( (int)GEOM::MS_10, std::min( (int)GEOM::MS_70, (int)size ) );
#endif
- myStdScaleCombo->setCurrentIndex( asize-1 );
+ myStdScaleCombo->setCurrentId( asize );
}
}
GEOM::marker_type GEOMToolsGUI_MarkerDlg::getMarkerType() const
{
- return myWGStack->currentIndex() == 0 ? (GEOM::marker_type)myStdTypeCombo->currentId() : GEOM::MT_USER;
+ return myWGStack->currentIndex() == 0 ? (GEOM::marker_type)myStdTypeCombo->currentId().toInt() : GEOM::MT_USER;
}
GEOM::marker_size GEOMToolsGUI_MarkerDlg::getStandardMarkerScale() const
{
- return myWGStack->currentIndex() == 0 ? (GEOM::marker_size)myStdScaleCombo->currentId() : GEOM::MS_NONE;
+ return myWGStack->currentIndex() == 0 ? (GEOM::marker_size)myStdScaleCombo->currentId().toInt() : GEOM::MS_NONE;
}
int GEOMToolsGUI_MarkerDlg::getCustomMarkerID() const
{
- return myWGStack->currentIndex() == 1 ? myCustomTypeCombo->currentId() : 0;
+ return myWGStack->currentIndex() == 1 ? myCustomTypeCombo->currentId().toInt() : 0;
}
void GEOMToolsGUI_MarkerDlg::accept()
}
}
}
- GEOM_Displayer displayer( getStudy() );
+ GEOM_Displayer displayer;
displayer.Redisplay( selected, true );
selMgr->setSelectedObjects( selected );
}
// ---
GEOM::GEOM_Gen_var engine = GeometryGUI::GetGeomGen();
- myOperation = engine->GetIInsertOperations( getStudy()->id() );
+ myOperation = engine->GetIInsertOperations();
GEOM::ListOfLong_var ids = myOperation->GetAllTextures();
for ( int i = 0; i < ids->length(); i++ )
addTexture( ids[i] );
if ( id > 0 && myCustomTypeCombo->index( id ) == -1 ) {
int tWidth, tHeight;
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
- Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(getStudy(), id, tWidth, tHeight);
-#else
- Handle(Graphic3d_HArray1OfBytes) texture = GeometryGUI::getTexture(getStudy(), id, tWidth, tHeight);
-#endif
+ Handle(TColStd_HArray1OfByte) texture = GeometryGUI::getTexture(id, tWidth, tHeight);
if ( !texture.IsNull() && texture->Length() == tWidth*tHeight/8 ) {
QImage image( tWidth, tHeight, QImage::Format_Mono );
filters << tr( "Texture files (*.dat)" ) << tr( "All files (*)" );
QString aFileName = SUIT_Session::session()->activeApplication()->getFileName( true, QString(), filters.join( ";;" ), tr( "LOAD_TEXTURE_TLT" ), this );
if ( !aFileName.isEmpty() ) {
- addTexture( myOperation->LoadTexture( aFileName.toLatin1().constData() ), true );
+ addTexture( myOperation->LoadTexture( aFileName.toUtf8().constData() ), true );
}
}