return myIs2dMode;
}
+ // Methods for color scale management
+
+ //! Returns True if ColorScale is visible
+ virtual bool isColorScaleVisible() const = 0;
+
+ //! Show/Hide ColorScale object
+ virtual void setColorScaleShown(bool on) = 0;
+
+ //! Set position of color scale
+ // \param theX is X position relative to current view width
+ // \param theY is Y position relative to current view heigth
+ virtual void setColorScalePosition(double theX, double theY) = 0;
+
+ //! Set size of color scale
+ // \param theW is width relative to current view width
+ // \param theh is height relative to current view heigth
+ virtual void setColorScaleSize(double theW, double theH) = 0;
+
+ //! Set range of color scale
+ // \param theMin is a minimal value
+ // \param theMax is a maximal value
+ virtual void setColorScaleRange(double theMin, double theMax) = 0;
+
+ //! Set number of intervals of color scale
+ // \param theNb is number of intervals
+ virtual void setColorScaleIntervals(int theNb) = 0;
+
+ //! Set text heigth of color scale
+ // \param theH is number of intervals
+ virtual void setColorScaleTextHeigth(int theH) = 0;
+
+ //! Set title of color scale
+ // \param theText is a title
+ virtual void setColorScaleTitle(const QString& theText) = 0;
+
static Handle(Prs3d_Drawer) DefaultHighlightDrawer;
signals:
}
}
+bool SHAPERGUI_SalomeViewer::isColorScaleVisible() const
+{
+ if (mySelector) {
+ return mySelector->viewer()->isColorScaleVisible();
+ }
+ return false;
+}
+
+void SHAPERGUI_SalomeViewer::setColorScaleShown(bool on)
+{
+ if (mySelector) {
+ mySelector->viewer()->setColorScaleShown(on);
+ }
+}
+
+void SHAPERGUI_SalomeViewer::setColorScalePosition(double theX, double theY)
+{
+ if (mySelector) {
+ QWidget* aWindow = activeViewPort();
+ mySelector->viewer()->getColorScale()->SetPosition(aWindow->width() * theX,
+ aWindow->height() * theY);
+ }
+}
+
+void SHAPERGUI_SalomeViewer::setColorScaleSize(double theW, double theH)
+{
+ if (mySelector) {
+ QWidget* aWindow = activeViewPort();
+ mySelector->viewer()->getColorScale()->SetSize(aWindow->width() * theW,
+ aWindow->height() * theH);
+ }
+}
+
+void SHAPERGUI_SalomeViewer::setColorScaleRange(double theMin, double theMax)
+{
+ if (mySelector) {
+ mySelector->viewer()->getColorScale()->SetRange(theMin, theMax);
+ }
+}
+
+void SHAPERGUI_SalomeViewer::setColorScaleIntervals(int theNb)
+{
+ if (mySelector) {
+ mySelector->viewer()->getColorScale()->SetNumberOfIntervals(theNb);
+ }
+}
+
+void SHAPERGUI_SalomeViewer::setColorScaleTextHeigth(int theH)
+{
+ if (mySelector) {
+ mySelector->viewer()->getColorScale()->SetTextHeight(theH);
+ }
+}
+
+void SHAPERGUI_SalomeViewer::setColorScaleTitle(const QString& theText)
+{
+ if (mySelector) {
+ mySelector->viewer()->getColorScale()->SetTitle(theText.toStdString().c_str());
+ }
+}
+
+
+
//void SHAPERGUI_SalomeViewer::Zfitall()
//{
// if (!mySelector || !mySelector->viewer())
/// \param toActivate - activation flag
void activateViewer(bool toActivate);
+
+ // Methods for color scale management
+
+ //! Returns True if ColorScale is visible
+ virtual bool isColorScaleVisible() const;
+
+ //! Show/Hide ColorScale object
+ virtual void setColorScaleShown(bool on);
+
+ //! Set position of color scale
+ // \param theX is X position relative to current view width
+ // \param theY is Y position relative to current view heigth
+ virtual void setColorScalePosition(double theX, double theY);
+
+ //! Set size of color scale
+ // \param theW is width relative to current view width
+ // \param theh is height relative to current view heigth
+ virtual void setColorScaleSize(double theW, double theH);
+
+ //! Set range of color scale
+ // \param theMin is a minimal value
+ // \param theMax is a maximal value
+ virtual void setColorScaleRange(double theMin, double theMax);
+
+ //! Set number of intervals of color scale
+ // \param theNb is number of intervals
+ virtual void setColorScaleIntervals(int theNb);
+
+ //! Set text heigth of color scale
+ // \param theH is number of intervals
+ virtual void setColorScaleTextHeigth(int theH);
+
+ //! Set title of color scale
+ // \param theText is a title
+ virtual void setColorScaleTitle(const QString& theText);
+
// Fit all along Z (perpendicular to display)
//virtual void Zfitall();
void XGUI_ViewerProxy::setColorScalePosition(double theX, double theY)
{
- QWidget* aWindow = activeViewPort();
#ifdef HAVE_SALOME
- myWorkshop->salomeConnector()->viewer()->setColorScaleShown(on);
+ myWorkshop->salomeConnector()->viewer()->setColorScalePosition(theX, theY);
#else
+ QWidget* aWindow = activeViewPort();
Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
aColorScale->SetPosition(aWindow->width() * theX, aWindow->height() * theY);
#endif
void XGUI_ViewerProxy::setColorScaleSize(double theW, double theH)
{
- QWidget* aWindow = activeViewPort();
#ifdef HAVE_SALOME
- myWorkshop->salomeConnector()->viewer()->setColorScaleShown(on);
+ myWorkshop->salomeConnector()->viewer()->setColorScaleSize(theW, theH);
#else
+ QWidget* aWindow = activeViewPort();
Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
aColorScale->SetSize(aWindow->width() * theW, aWindow->height() * theH);
#endif
void XGUI_ViewerProxy::setColorScaleRange(double theMin, double theMax)
{
#ifdef HAVE_SALOME
- myWorkshop->salomeConnector()->viewer()->setColorScaleShown(on);
+ myWorkshop->salomeConnector()->viewer()->setColorScaleRange(theMin, theMax);
#else
Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
aColorScale->SetRange(theMin, theMax);
void XGUI_ViewerProxy::setColorScaleIntervals(int theNb)
{
#ifdef HAVE_SALOME
- myWorkshop->salomeConnector()->viewer()->setColorScaleShown(on);
+ myWorkshop->salomeConnector()->viewer()->setColorScaleIntervals(theNb);
#else
Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
aColorScale->SetNumberOfIntervals(theNb);
void XGUI_ViewerProxy::setColorScaleTextHeigth(int theH)
{
#ifdef HAVE_SALOME
- myWorkshop->salomeConnector()->viewer()->setColorScaleShown(on);
+ myWorkshop->salomeConnector()->viewer()->setColorScaleTextHeigth(theH);
#else
Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
aColorScale->SetTextHeight(theH);
void XGUI_ViewerProxy::setColorScaleTitle(const QString& theText)
{
#ifdef HAVE_SALOME
- myWorkshop->salomeConnector()->viewer()->setColorScaleShown(on);
+ myWorkshop->salomeConnector()->viewer()->setColorScaleTitle(theText);
#else
Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
aColorScale->SetTitle(theText.toStdString().c_str());
setColorScaleSize(0.2, 0.5);
setColorScaleTextHeigth(14);
setColorScaleIntervals(20);
- Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
}