]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
fix highlight: int instead of size_t in OCC_Selector. Look for other similar errors...
authorPaul RASCLE <paul.rascle@openfields.fr>
Sun, 13 Sep 2020 20:32:29 +0000 (22:32 +0200)
committerYOANN AUDOUIN <B61570@dsp0851742.postes.calibre.edf.fr>
Fri, 30 Oct 2020 16:08:09 +0000 (17:08 +0100)
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_Module.h
src/HYDROGUI/HYDROGUI_OCCSelector.cxx
src/HYDROGUI/HYDROGUI_ShapeLandCoverMap.cxx
src/HYDROGUI/HYDROGUI_VisualStateOp.cxx

index 90f5aee873c499cb0603423aca3984b06f09ee56..99a67e8de14b66e303983f72b4d5aabae1ecb798 100644 (file)
@@ -75,7 +75,7 @@
 #include <HYDROData_ShapesGroup.h>
 #endif
 
-//#define _DEVDEBUG_
+#define _DEVDEBUG_
 #include "HYDRO_trace.hxx"
 
 static HYDROData_SequenceOfObjects myCopyingObjects;
@@ -653,7 +653,7 @@ Handle(HYDROData_Entity) HYDROGUI_DataModel::objectByEntry( const QString& theEn
   QString anEntry = theEntry;
   if( anEntry.indexOf( "_" ) != -1 ) // reference object
     anEntry = anEntry.section( "_", -1 );
-
+  //DEBTRACE("objectByEntry: " << anEntry.toStdString() << " kind: " << theObjectKind);
   Handle(HYDROData_Document) aDocument = getDocument();
   if( !aDocument.IsNull() )
   {
@@ -664,8 +664,12 @@ Handle(HYDROData_Entity) HYDROGUI_DataModel::objectByEntry( const QString& theEn
       if( !anObject.IsNull() )
       {
         QString anEntryRef = HYDROGUI_DataObject::dataObjectEntry( anObject );
+        //DEBTRACE("  anEntryRef " << anEntryRef.toStdString());
         if( anEntryRef == anEntry )
+        {
+          //DEBTRACE("  found!");
           return anObject;
+        }
       }
     }
   }
index 5eafac6457d5775e6a8310d294909a6e8be70c3e..5ce22f7cc2f0bced5a424833fd4f7fa2f820a48d 100755 (executable)
@@ -1028,7 +1028,7 @@ void HYDROGUI_Module::preferencesChanged( const QString& theSection, const QStri
       ViewManagerMap::const_iterator it = myViewManagerMap.begin(), last = myViewManagerMap.end();
       for( ; it!=last; it++ )
       {
-        int aViewerId = it.key();
+        size_t aViewerId = it.key();
         OCCViewer_ViewManager* aMgr = dynamic_cast<OCCViewer_ViewManager*>( it.value().first );
         if( aMgr )
           getOCCDisplayer()->UpdatePolylines( aViewerId, aType, aSize );
@@ -1268,8 +1268,8 @@ void HYDROGUI_Module::setViewManagerRole( SUIT_ViewManager* theViewManager,
                                           const ViewManagerRole theRole )
 {
   DEBTRACE("HYDROGUI_Module::setViewManagerRole");
-  int anId = getViewManagerId( theViewManager );
-  if( anId != -1 )
+  size_t anId = getViewManagerId( theViewManager );
+  if( anId != 0 )
   {
     ViewManagerInfo& anInfo = myViewManagerMap[ anId ];
     anInfo.second = theRole;
@@ -1756,8 +1756,8 @@ void HYDROGUI_Module::onViewManagerRemoved( SUIT_ViewManager* theViewManager )
 
   createSelector( theViewManager ); // replace the default selector
 
-  int anId = getViewManagerId( theViewManager );
-  if( anId != -1 )
+  size_t anId = getViewManagerId( theViewManager );
+  if( anId != 0 )
   {
     OCCViewer_ViewManager* anOCCViewManager =
       ::qobject_cast<OCCViewer_ViewManager*>( myViewManagerMap[ anId ].first );
@@ -1765,7 +1765,7 @@ void HYDROGUI_Module::onViewManagerRemoved( SUIT_ViewManager* theViewManager )
     {
       OCCViewer_Viewer* anOCCViewer = anOCCViewManager->getOCCViewer();
       if ( anOCCViewer ) {
-        int aViewerId = (size_t)anOCCViewer;
+        size_t aViewerId = (size_t)anOCCViewer;
         removeViewShapes( aViewerId );
         setLandCoversScalarMapModeOff( aViewerId );
       }
@@ -1882,7 +1882,7 @@ void HYDROGUI_Module::updateViewer( HYDROGUI_AbstractDisplayer* theDisplayer,
                                     const bool theDoFitAll )
 {
   DEBTRACE("HYDROGUI_Module::updateViewer");
-  QList<int> aViewManagerIdList;
+  QList<size_t> aViewManagerIdList;
 
   // currently, all views are updated
   ViewManagerMapIterator anIter( myViewManagerMap );
@@ -1897,7 +1897,7 @@ void HYDROGUI_Module::updateViewer( HYDROGUI_AbstractDisplayer* theDisplayer,
     }
   }
 
-  QListIterator<int> anIdIter( aViewManagerIdList );
+  QListIterator<size_t> anIdIter( aViewManagerIdList );
   while( anIdIter.hasNext() )
   {
     theDisplayer->UpdateAll( anIdIter.next(), theIsInit, theIsForced, theDoFitAll );
@@ -2193,7 +2193,7 @@ void HYDROGUI_Module::dropObjects( const DataObjectList& what, SUIT_DataObject*
   
 }
 
-Handle(HYDROData_StricklerTable) HYDROGUI_Module::getLandCoverColoringTable( const int theViewId ) const
+Handle(HYDROData_StricklerTable) HYDROGUI_Module::getLandCoverColoringTable( const size_t theViewId ) const
 {
   Handle(HYDROData_StricklerTable) aTable;
 
@@ -2204,7 +2204,7 @@ Handle(HYDROData_StricklerTable) HYDROGUI_Module::getLandCoverColoringTable( con
   return aTable;
 }
 
-void HYDROGUI_Module::setLandCoverColoringTable( const int theViewId,
+void HYDROGUI_Module::setLandCoverColoringTable( const size_t theViewId,
                                                  const Handle(HYDROData_StricklerTable)& theTable )
 {
   if ( !theTable.IsNull() ) {
@@ -2212,12 +2212,12 @@ void HYDROGUI_Module::setLandCoverColoringTable( const int theViewId,
   }
 }
 
-void HYDROGUI_Module::setLandCoversScalarMapModeOff( const int theViewId )
+void HYDROGUI_Module::setLandCoversScalarMapModeOff( const size_t theViewId )
 {
   myLandCoverColoringMap.remove( theViewId );
 }
 
-bool HYDROGUI_Module::isLandCoversScalarMapModeOn( const int theViewId ) const
+bool HYDROGUI_Module::isLandCoversScalarMapModeOn( const size_t theViewId ) const
 {
   return myLandCoverColoringMap.contains( theViewId );
 }
@@ -2231,7 +2231,6 @@ void HYDROGUI_Module::setObjectRemoved( const Handle(HYDROData_Entity)& theObjec
   if ( theObject->GetKind() == KIND_STRICKLER_TABLE ) {
     Handle(HYDROData_StricklerTable) aTable = 
       Handle(HYDROData_StricklerTable)::DownCast( theObject );
-    QList<int> aViewIds;
     QMutableMapIterator<size_t, Handle(HYDROData_StricklerTable)> anIter( myLandCoverColoringMap );
     while ( anIter.hasNext() ) {
       if ( HYDROGUI_DataObject::dataObjectEntry( anIter.next().value() ) == 
index b8b57f38ac1e0be96bf5cae420afd7a7b3aac59b..fead3a71afcd8e0877e9fe0bdfdc67a70ef7931f 100644 (file)
@@ -239,27 +239,27 @@ public:
    * @return the Strickler table used for scalar map coloring of Land Covers in the given view;
              null - if scalar map coloring is off for the view  
    */
-  Handle(HYDROData_StricklerTable) getLandCoverColoringTable( const int theViewId ) const;
+  Handle(HYDROData_StricklerTable) getLandCoverColoringTable( const size_t theViewId ) const;
 
   /**
    * Set Strickler table to be used for Land Cover scalar map coloring in the given view.
    * @param theViewId the view id
    * @param theTable the Strickler table
    */
-  void                             setLandCoverColoringTable( const int theViewId,
+  void                             setLandCoverColoringTable( const size_t theViewId,
                                                               const Handle(HYDROData_StricklerTable)& theTable );
   /**
    * Set Land Cover scalar map coloring mode off for the given view.
    * @param theViewId the view id
    */
-  void                             setLandCoversScalarMapModeOff( const int theViewId );
+  void                             setLandCoversScalarMapModeOff( const size_t theViewId );
 
   /**
    * Check if Land Cover scalar map coloring mode is on in the given view.
    * @param theViewId the view id
    * @return true if the mode is on, false if the mode is off
    */
-  bool                             isLandCoversScalarMapModeOn( const int theViewId ) const;
+  bool                             isLandCoversScalarMapModeOn( const size_t theViewId ) const;
 
   /**
    * Set object as removed.
index 6bd771fa2a37619ceb530ed35d4612b8d6f8e42f..15d9d3b3fb4fad96a7205eaa0f7c7fb60310484c 100644 (file)
@@ -85,7 +85,7 @@ void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
   if ( !aViewer )
     return;
 
-  int aViewerId = (size_t)aViewer;
+  size_t aViewerId = (size_t)aViewer;
 
   Handle(AIS_InteractiveContext) aContext = aViewer->getAISContext();
   if ( aContext.IsNull() ) {
@@ -106,7 +106,6 @@ void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
   }*/
 
   mySelectedExternals.clear();
-  DEBTRACE("  ...");
   for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
   {
     const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
@@ -117,6 +116,7 @@ void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
       Handle(HYDROData_Entity) anEntity = myModule->getDataModel()->objectByEntry( anEntry );
       if( !anEntity.IsNull() )
       {
+       DEBTRACE("aViewerId, anEntity " << aViewerId << " " << anEntity.get());
         HYDROGUI_Shape* aShape = myModule->getObjectShape( aViewerId, anEntity );
         if( aShape && aShape->isVisible() )
         {
@@ -134,7 +134,7 @@ void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
         mySelectedExternals.append(*itr);
     }
   }
-
+  DEBTRACE("aSelList.Size() " << aSelList.Size());
   aViewer->unHighlightAll( false );
   aViewer->setObjectsSelected( aSelList );
 }
index e39176837ff9eafe6dfcc0aa7fda278c02627eb8..3545fa82ab016f6d5c7899f8b91873548a392c90 100644 (file)
@@ -113,7 +113,7 @@ QList<Handle(AIS_InteractiveObject)> HYDROGUI_ShapeLandCoverMap::createShape() c
       {
         if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() )
         {
-          int aViewerId = (size_t)aViewer;
+          size_t aViewerId = (size_t)aViewer;
 
           // Set Strickler table
           Handle(HYDROData_StricklerTable) aTable = 
index 9c866b85cb0a16d9d9f8765223cbd9e18458b5b5..7837456ccd2635fb1f76317740b60c432a82fda9 100644 (file)
@@ -110,7 +110,7 @@ bool HYDROGUI_VisualStateOp::saveVisualState()
     setVisualProperty( aPropertyMap, "AP_ACTIVE_VIEW", aViewWindow->objectName() );
 
   // C. Store view properties.
-  int aViewerId = 0;
+  size_t aViewerId = 0;
   QListIterator<SUIT_ViewManager*> anIter( aViewManagerList );
   while( anIter.hasNext() )
   {