// display isoline on planar faces (box for ex.)
myAISContext->IsoOnPlane( true );
+
+ // create color scale
+ myColorScale = new AIS_ColorScale();
+ myColorScale->SetZLayer( Graphic3d_ZLayerId_TopOSD );
+ myColorScale->SetTransformPersistence( Graphic3d_TransformPers::FromDeprecatedParams( Graphic3d_TMF_2d, gp_Pnt(-1, -1, 0) ) );
/* create trihedron */
if ( DisplayTrihedron )
myV3dViewer->Update();
}
+bool OCCViewer_Viewer::isColorScaleVisible() const
+{
+ return !myColorScale.IsNull() && !myAISContext.IsNull() && myAISContext->IsDisplayed( myColorScale );
+}
+
+void OCCViewer_Viewer::setColorScaleShown( const bool on )
+{
+ if ( myColorScale.IsNull() )
+ return;
+ if ( on )
+ {
+ if ( !myAISContext->IsDisplayed( myColorScale ) )
+ myAISContext->Display( myColorScale, Standard_True );
+ myAISContext->Redisplay( myColorScale, Standard_True, Standard_True );
+ }
+ else
+ {
+ if ( myAISContext->IsDisplayed( myColorScale ) )
+ myAISContext->Erase( myColorScale, Standard_True );
+ }
+}
+
/*!
Changes visibility of trihedron to opposite
*/
#include "SUIT_ViewModel.h"
#include <V3d_View.hxx>
+#include <AIS_ColorScale.hxx>
#include <AIS_Trihedron.hxx>
#include <AIS_InteractiveContext.hxx>
#include <AIS_ListOfInteractive.hxx>
Qtx::BackgroundData background(int theViewId) const;
void setBackground( int theViewId, const Qtx::BackgroundData& );
+ bool isColorScaleVisible() const;
+ virtual void setColorScaleShown( const bool );
+
//! returns true if 3d Trihedron in viewer was created
bool trihedronActivated() const { return !myTrihedron.IsNull(); }
public:
Handle(V3d_Viewer) getViewer3d() const { return myV3dViewer;}
Handle(AIS_InteractiveContext) getAISContext() const { return myAISContext; }
+ Handle(AIS_ColorScale) getColorScale() const { return myColorScale; }
Handle(AIS_Trihedron) getTrihedron() const { return myTrihedron; }
int getTopLayerId();
protected:
Handle(V3d_Viewer) myV3dViewer;
-
+ Handle(AIS_ColorScale) myColorScale;
Handle(AIS_Trihedron) myTrihedron;
Handle(AIS_InteractiveContext) myAISContext;