msgid "VisuGUI::MEN_SHRINK"
msgstr "Shrink"
+msgid "VisuGUI::MEN_SHADING"
+msgstr "Shading On"
+
+msgid "VisuGUI::MEN_NOSHADING"
+msgstr "Shading Off"
+
msgid "VisuGUI::MEN_STREAM_LINES"
msgstr "Stream Lines"
ChangeRepresentation(this, VISU::SHRINK);
}
+void
+VisuGUI::
+OnSetShadingOn()
+{
+ SetShading(this, true);
+}
+
+void
+VisuGUI::
+OnSetShadingOff()
+{
+ SetShading(this, false);
+}
+
void
VisuGUI::
OnChangeColor()
createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIconSet(),
tr("MEN_UNSHRINK"), "", 0, aParent, false,
this, SLOT(OnMakeShrink()));
+
+ createAction( VISU_SHADING, tr("MEN_SHADING"), QIconSet(),
+ tr("MEN_SHADING"), "", 0, aParent, false,
+ this, SLOT(OnSetShadingOn()));
+
+ createAction( VISU_NOSHADING, tr("MEN_NOSHADING"), QIconSet(),
+ tr("MEN_NOSHADING"), "", 0, aParent, false,
+ this, SLOT(OnSetShadingOff()));
createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIconSet(),
tr("MEN_CELL_COLOR"), "", 0, aParent, false,
mgr->insert( action( VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
mgr->insert( action( VISU_SHRINK ) , parentId, -1, -1 ); // shrink
mgr->insert( action( VISU_UNSHRINK ) , parentId, -1, -1 ); // unshrink
+ mgr->insert( separator(), parentId, -1, -1 );
+ mgr->insert( action( VISU_SHADING ) , parentId, -1, -1 ); // shading
+ mgr->insert( action( VISU_NOSHADING ) , parentId, -1, -1 ); // noshading
// "Properties" submenu
parentId = mgr->insert( tr( "MEN_PROPERTIES" ), -1, -1 );
mgr->setRule( action( VISU_SHRINK ) , aRule + aShrinkType + " and isShrunk=0", true );
mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1", true );
+ mgr->setRule( action( VISU_SHADING ) , aRule + " and isScalarMapAct=1 and isShading=0", true );
+ mgr->setRule( action( VISU_NOSHADING ), aRule + " and isScalarMapAct=1 and isShading=1", true );
+
// "Properties" submenu
mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
mgr->setRule( action( VISU_EDGE_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
void OnMakePoints();
void OnMakeShrink();
+ void OnSetShadingOn();
+ void OnSetShadingOff();
+
void OnChangeColor();
void OnChangeWireframeColor();
void OnChangeOpacity();
#define VISU_SHRINK 4055
#define VISU_UNSHRINK 4056
+#define VISU_SHADING 4083
+#define VISU_NOSHADING 4084
+
#define VISU_CELL_COLOR 4057
#define VISU_COLOR 4058
#define VISU_EDGE_COLOR 4059
#include "VisuGUI_Tools.h"
#include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
using namespace VISU;
// else if ( p == "isVisible" ) val = QtxValue( isVisible( ind ) );
else if ( p == "isShrunk" ) val = QtxValue( isShrunk( ind ) );
else if ( p == "hasActor" ) val = QtxValue( hasActor( ind ) );
+ else if ( p == "isShading" ) val = QtxValue( isShading( ind ) );
+ else if ( p == "isScalarMapAct" ) val = QtxValue( isScalarMapAct( ind ) );
}
return val;
{
return representation( ind ).isEmpty() ? "0" : "1";
}
+
+QString VisuGUI_Selection::isShading( const int ind ) const
+{
+ QString aResStr;
+
+ if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+ if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
+ if ( VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor) )
+ aResStr = anActor->IsShading() ? "1" : "0";
+
+ return aResStr;
+}
+
+QString VisuGUI_Selection::isScalarMapAct( const int ind ) const
+{
+ QString aResStr;
+
+ if ( SVTK_ViewWindow* aView = GetViewWindow( myModule ) )
+ if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) )
+ {
+ VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(anVISUActor);
+ aResStr = anActor ? "1" : "0";
+ }
+
+ return aResStr;
+}
QString isVisible( const int ) const;
QString isShrunk( const int ) const;
QString hasActor( const int ) const;
+ QString isShading( const int ) const;
+ QString isScalarMapAct( const int ) const;
private:
int nbChild( const int, const bool ) const;
#include "VISU_ViewManager_i.hh"
#include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
#include "SalomeApp_Module.h"
#include "SalomeApp_Study.h"
}
}
}
+
+ void
+ SetShading ( const SalomeApp_Module* theModule,
+ bool theOn )
+ {
+ SUIT_ViewWindow* aView = GetActiveView(theModule, SVTK_Viewer::Type());
+ if (!aView) return;
+ SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( aView );
+ if( !vw )
+ return;
+
+ Handle(SALOME_InteractiveObject) anIO;
+ CORBA::Object_var anObject = GetSelectedObj(theModule, &anIO);
+ if (CORBA::is_nil(anObject)) return;
+
+ VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
+ if (CORBA::is_nil(aVisuObj)) return;
+
+ PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
+ if (!aServant.in()) return;
+
+ VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
+ if (aPrs3d) {
+ if (VISU_Actor* anActor = GetActor(aPrs3d, vw)) {
+ if ( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
+ aScalarMapActor->SetShading( theOn );
+ }
+ vw->Repaint();
+ }
+ }
//************************************************************
// SObject type
void ChangeRepresentation (const SalomeApp_Module* theModule,
VISU::PresentationType theType);
+ void SetShading ( const SalomeApp_Module* theModule, bool theOn = true );
+
// SObject type
bool CheckTimeStamp(const SalomeApp_Module* theModule,
_PTR(SObject)& theSObject,