-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 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
void EntityGUI_FieldDlg::Delegate::updateEditorGeometry( QWidget* editor,
const QStyleOptionViewItem& option,
- const QModelIndex& index ) const
+ const QModelIndex& /*index*/ ) const
{
editor->setGeometry( option.rect );
}
if ( !bs->_is_nil() )
{
GEOM::short_array_var vals = bs->GetValues();
- if ( vals->length() == nbRows * nbComps )
+ if ( (int)vals->length() == nbRows * nbComps )
for ( int iV = 0, iR = 0; iR < nbRows; ++iR )
for ( int iC = 1; iC < nbColumns; ++iC )
setItem( iR, iC, new CheckItem( vals[ iV++ ]));
if ( !is->_is_nil() )
{
GEOM::ListOfLong_var vals = is->GetValues();
- if ( vals->length() == nbRows * nbComps )
+ if ( (int)vals->length() == nbRows * nbComps )
for ( int iV = 0, iR = 0; iR < nbRows; ++iR )
for ( int iC = 1; iC < nbColumns; ++iC )
setItem( iR, iC, new IntSpinItem( vals[ iV++ ]));
if ( !ds->_is_nil() )
{
GEOM::ListOfDouble_var vals = ds->GetValues();
- if ( vals->length() == nbRows * nbComps )
+ if ( (int)vals->length() == nbRows * nbComps )
for ( int iV = 0, iR = 0; iR < nbRows; ++iR )
for ( int iC = 1; iC < nbColumns; ++iC )
setItem( iR, iC, new DoubleSpinItem( vals[ iV++ ]));
if ( !ss->_is_nil() )
{
GEOM::string_array_var vals = ss->GetValues();
- if ( vals->length() == nbRows * nbComps )
+ if ( (int)vals->length() == nbRows * nbComps )
for ( int iV = 0, iR = 0; iR < nbRows; ++iR )
for ( int iC = 1; iC < nbColumns; ++iC )
setItem( iR, iC, new QTableWidgetItem( vals[ iV++ ].in() ));
vals->length( nbRows * nbComps );
for ( int iV = 0, iR = 0; iR < nbRows; ++iR )
for ( int iC = 1; iC < nbColumns; ++iC )
- vals[ iV++ ] = item( iR, iC )->text().toLatin1().constData();
+ vals[ iV++ ] = item( iR, iC )->text().toUtf8().constData();
ss->SetValues( vals );
}
}
// function : enterEvent()
// purpose :
//=================================================================================
-void EntityGUI_FieldDlg::enterEvent(QEvent* e)
+void EntityGUI_FieldDlg::enterEvent(QEvent*)
{
if (!buttonCancel()->isEnabled())
ActivateThisDialog();
if ( !myIsCreation && !myField->_is_nil() )
{
GEOM::string_array_var compNames = myField->GetComponents();
- for ( int iC = 0; iC < compNames->length(); ++iC )
+ for ( int iC = 0; iC < (int)compNames->length(); ++iC )
headers << compNames[ iC ].in();
}
else
if (!appStudy) return 0;
_PTR(Study) aStudy = appStudy->studyDS();
- _PTR(SObject) aSObj (aStudy->FindObjectID(anEntry.toLatin1().constData()));
+ _PTR(SObject) aSObj (aStudy->FindObjectID(anEntry.toUtf8().constData()));
+ if ( ! GeometryGUI::IsInGeomComponent( aSObj )) continue;
GEOM::GEOM_Object_var aGeomObj =
GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObj));
TopoDS_Shape aShape;
//=================================================================================
void EntityGUI_FieldDlg::activateSelection()
{
- bool isApply = ((QPushButton*)sender() == buttonApply());
+ //bool isApply = ((QPushButton*)sender() == buttonApply());
if(!isApplyAndClose())
erasePreview(false);
TopoDS_Shape aSubShape = myShapeMap( index );
QString anEntry = QString( "TEMP_" ) + aMainEntry.in() + QString("_%1").arg(index);
Handle(SALOME_InteractiveObject) io =
- new SALOME_InteractiveObject(anEntry.toLatin1(), "GEOM", "TEMP_IO");
+ new SALOME_InteractiveObject(anEntry.toUtf8(), "GEOM", "TEMP_IO");
aDisplayer->SetColor( aCol );
SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView);
if (aPrs) {
SALOME_ListIO aSelList;
// To highlight the selected sub-shape in Object Browser, if it's already published under the main shape
- GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations(getStudyId());
+ GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations();
QMap<int, QString> childsMap;
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
if (appStudy) {
CORBA::String_var aMainEntry = myShape->GetStudyEntry();
_PTR(SObject) aSObj = aStudy->FindObjectID( aMainEntry.in() );
_PTR(ChildIterator) anIt = aStudy->NewChildIterator(aSObj);
- for (anIt->InitEx(true); anIt->More(); anIt->Next()) {
- GEOM::GEOM_Object_var aChild =
- GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(anIt->Value()));
- if (!CORBA::is_nil(aChild)) {
- int index = aLocOp->GetSubShapeIndex(myShape, aChild);
- if ( anIds.Contains( index )) {
- CORBA::String_var aChildEntry = aChild->GetStudyEntry();
- //childsMap.insert(index, aChildEntry.in());
+ if ( GeometryGUI::IsInGeomComponent( aSObj ))
+ for (anIt->InitEx(true); anIt->More(); anIt->Next()) {
+ GEOM::GEOM_Object_var aChild =
+ GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(anIt->Value()));
+ if (!CORBA::is_nil(aChild)) {
+ int index = aLocOp->GetSubShapeIndex(myShape, aChild);
+ if ( anIds.Contains( index )) {
+ CORBA::String_var aChildEntry = aChild->GetStudyEntry();
+ //childsMap.insert(index, aChildEntry.in());
Handle(SALOME_InteractiveObject) tmpIO =
new SALOME_InteractiveObject( aChildEntry.in(), "GEOM", "TEMP_IO");
aSelList.Append(tmpIO);
+ }
}
}
- }
}
AIS_ListIteratorOfListOfInteractive ite (List);
if (anIds.Contains(anIndex)) {
aSelList.Append(anIO);
// if (childsMap.contains (anIndex)) {
- // Handle(SALOME_InteractiveObject) tmpIO = new SALOME_InteractiveObject(childsMap.value(anIndex).toLatin1().constData(), "GEOM", "TEMP_IO");
+ // Handle(SALOME_InteractiveObject) tmpIO = new SALOME_InteractiveObject(childsMap.value(anIndex).toUtf8().constData(), "GEOM", "TEMP_IO");
// aSelList.Append(tmpIO);
// }
}
//=================================================================================
GEOM::GEOM_IOperations_ptr EntityGUI_FieldDlg::createOperation()
{
- return getGeomEngine()->GetIFieldOperations(getStudyId());
+ return getGeomEngine()->GetIFieldOperations();
}
#define RETURN_WITH_MSG(a, b) \
//=================================================================================
bool EntityGUI_FieldDlg::execute()
{
- SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy( getStudy()->studyDS() );
+ SALOMEDS::Study_var aStudyDS = GeometryGUI::getStudyServant();
SALOMEDS::StudyBuilder_var aBuilder = aStudyDS->NewBuilder();
QString aName = getNewObjectName().trimmed();
GEOM::string_array_var compNames = new GEOM::string_array();
compNames->length( nbComps );
for ( int iC = 0; iC < nbComps; ++iC )
- compNames[ iC ] = columnNames[ iC+1 ].toLatin1().constData();
+ compNames[ iC ] = columnNames[ iC+1 ].toUtf8().constData();
GEOM::GEOM_IFieldOperations_var anOper = GEOM::GEOM_IFieldOperations::_narrow(getOperation());
myField = anOper->CreateField( myShape,
- aName.toLatin1().constData(),
+ aName.toUtf8().constData(),
GEOM::field_data_type( getDataType() ),
CORBA::Short( getDim() ),
compNames );
return false;
SALOMEDS::SObject_wrap aSO =
- getGeomEngine()->AddInStudy( aStudyDS, myField, aName.toLatin1().constData(), myShape );
+ getGeomEngine()->AddInStudy( myField, aName.toUtf8().constData(), myShape );
if ( !aSO->_is_nil() ) {
myField->UnRegister();
CORBA::String_var entry = aSO->GetID();
}
else // update field name
{
- myField->SetName( aName.toLatin1().constData() );
+ myField->SetName( aName.toUtf8().constData() );
CORBA::String_var entry = myField->GetStudyEntry();
if ( entry.in() ) {
SALOMEDS::SObject_wrap SO = aStudyDS->FindObjectID( entry.in() );
if ( !SO->_is_nil() ) {
- aBuilder->SetName(SO, aName.toLatin1().constData());
+ aBuilder->SetName(SO, aName.toUtf8().constData());
}
}
}
step = myField->AddStep( tbl->getStepID(), tbl->getStamp() );
SALOMEDS::SObject_wrap aSO =
- getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), myField );
+ getGeomEngine()->AddInStudy( step, stepName.toUtf8().constData(), myField );
if ( /*!myIsCreation &&*/ !aSO->_is_nil() ) {
step->UnRegister();
CORBA::String_var entry = aSO->GetID();
if ( entry.in() ) {
SALOMEDS::SObject_wrap SO = aStudyDS->FindObjectID( entry.in() );
if ( !SO->_is_nil() )
- aBuilder->SetName( SO, stepName.toLatin1().constData() );
+ aBuilder->SetName( SO, stepName.toUtf8().constData() );
}
}