]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Merge commit '970751f6a5df4c1c8c0f57f511af98f2bc37c784'
authorBERNHARD Martin OpenCascade <martin.bernhard@opencascade.com>
Tue, 23 Apr 2024 09:13:24 +0000 (11:13 +0200)
committerBERNHARD Martin OpenCascade <martin.bernhard@opencascade.com>
Tue, 23 Apr 2024 09:13:24 +0000 (11:13 +0200)
1  2 
src/LightApp/LightApp_Application.cxx

index 45759e967bc9de3b9fb5e41c1c1767d2ba91d017,7df31635f2fdc5363d0d73b3048f80fe8f56626f..bbf021081a344f0f9a80ad13b12c34d0192819f8
@@@ -29,6 -29,7 +29,7 @@@
  // E.A. : some same symbols : acosh, asinh, ...
    #include <Standard_math.hxx>
    #ifndef DISABLE_PYCONSOLE
+     #include <Python.h>
      #include <pymath.h>
    #endif
  #endif
@@@ -2058,7 -2059,7 +2059,7 @@@ SUIT_ViewManager* LightApp_Application:
                                    resMgr->stringValue( "OCCViewer", "clipping_texture", vm->clippingTexture() ),
                                    resMgr->booleanValue( "OCCViewer", "clipping_modulate", vm->isTextureModulated() ),
                                    resMgr->doubleValue( "OCCViewer", "clipping_scale", vm->clippingTextureScale() ) );
 -
 +    vm->setClippingUseObjColor( resMgr->booleanValue( "OCCViewer", "clipping_use_object_color", vm->isClippingObjColorUsed() ) );
  
      viewMgr->setViewModel( vm );// custom view model, which extends SALOME_View interface
      new LightApp_OCCSelector( (OCCViewer_Viewer*)viewMgr->getViewModel(), mySelMgr );
@@@ -3063,16 -3064,11 +3064,16 @@@ void LightApp_Application::createPrefer
  
    // ... "Clipping" group <<start>>
    int occClippingGroup = pref->addPreference( tr( "PREF_GROUP_CLIPPING" ), occGroup );
 -  // .... -> clipping color
 -  pref->addPreference( tr( "PREF_CLIPPING_COLOR" ), occClippingGroup,
 -                       LightApp_Preferences::Color, "OCCViewer", "clipping_color" );
    int texturePref = pref->addPreference( "", occClippingGroup, LightApp_Preferences::Frame );
    pref->setItemProperty( "columns", 2, texturePref );
 +
 +  // .... -> use object color
 +  pref->addPreference( tr( "PREF_CLIPPING_USE_OBJECT_COLOR" ), texturePref,
 +               LightApp_Preferences::Bool, "OCCViewer", "clipping_use_object_color" );
 +  // .... -> clipping color
 +  pref->addPreference( tr( "PREF_CLIPPING_COLOR" ), texturePref,
 +                       LightApp_Preferences::Color, "OCCViewer", "clipping_color" );
 +
    // .... -> use default texture
    pref->addPreference( tr( "PREF_CLIPPING_DEFAULT_TEXTURE" ), texturePref,
                 LightApp_Preferences::Bool, "OCCViewer", "clipping_use_default_texture" );
@@@ -3790,25 -3786,6 +3791,25 @@@ void LightApp_Application::preferencesC
    }
  #endif
  
 +#ifndef DISABLE_OCCVIEWER
 +  if ( sec == QString( "OCCViewer" ) && param == QString( "clipping_use_object_color" ) )
 +  {
 +    bool useObjColor = resMgr->booleanValue( "OCCViewer", "clipping_use_object_color" );
 +    QList<SUIT_ViewManager*> lst;
 +    viewManagers( OCCViewer_Viewer::Type(), lst );
 +    QListIterator<SUIT_ViewManager*> it( lst );
 +    while ( it.hasNext() )
 +    {
 +      SUIT_ViewModel* vm = it.next()->getViewModel();
 +      if ( !vm || !vm->inherits( "OCCViewer_Viewer" ) )
 +        continue;
 +
 +      OCCViewer_Viewer* occVM = (OCCViewer_Viewer*)vm;
 +      occVM->setClippingUseObjColor( useObjColor );
 +    }
 +  }
 +#endif
 +
  #ifndef DISABLE_OCCVIEWER
    if ( sec == QString( "OCCViewer" ) && param == QString( "projection_mode" ) )
    {