Salome HOME
Container servant hold information about SSL mode or not
[modules/geom.git] / src / EntityGUI / EntityGUI_FieldDlg.cxx
index 4113d18452b635e89b63d9fba2fa82206dc56c6b..f5ef57845895f5c8ef4f0126902f7642059a230d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2020  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
@@ -344,7 +344,7 @@ void EntityGUI_FieldDlg::Delegate::setModelData( QWidget* editor,
 
 void EntityGUI_FieldDlg::Delegate::updateEditorGeometry( QWidget* editor,
                                                          const QStyleOptionViewItem& option, 
-                                                         const QModelIndex& index ) const
+                                                         const QModelIndex& /*index*/ ) const
 {
   editor->setGeometry( option.rect );
 }
@@ -393,7 +393,7 @@ EntityGUI_FieldDlg::StepTable::StepTable (int stepID, int dataType,
     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++ ]));
@@ -407,7 +407,7 @@ EntityGUI_FieldDlg::StepTable::StepTable (int stepID, int dataType,
     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++ ]));
@@ -420,7 +420,7 @@ EntityGUI_FieldDlg::StepTable::StepTable (int stepID, int dataType,
     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++ ]));
@@ -432,7 +432,7 @@ EntityGUI_FieldDlg::StepTable::StepTable (int stepID, int dataType,
     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() ));
@@ -1054,7 +1054,7 @@ void EntityGUI_FieldDlg::Init()
 // function : enterEvent()
 // purpose  :
 //=================================================================================
-void EntityGUI_FieldDlg::enterEvent(QEvent* e)
+void EntityGUI_FieldDlg::enterEvent(QEvent*)
 {
   if (!buttonCancel()->isEnabled())
     ActivateThisDialog();
@@ -1413,7 +1413,7 @@ void EntityGUI_FieldDlg::showCurStep()
       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
@@ -1478,6 +1478,7 @@ int EntityGUI_FieldDlg::getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMa
         _PTR(Study) aStudy = appStudy->studyDS();
 
         _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;
@@ -1627,7 +1628,7 @@ void EntityGUI_FieldDlg::updateDims(int curDim)
 //=================================================================================
 void EntityGUI_FieldDlg::activateSelection()
 {
-  bool isApply = ((QPushButton*)sender() == buttonApply());
+  //bool isApply = ((QPushButton*)sender() == buttonApply());
   if(!isApplyAndClose())
     erasePreview(false);
 
@@ -1773,20 +1774,21 @@ void EntityGUI_FieldDlg::highlightSubShapes()
     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);