#ifndef DISABLE_OCCVIEWER
#include <OCCViewer_ViewManager.h>
+ #include <OCCViewer_ViewFrame.h>
#ifndef DISABLE_SALOMEOBJECT
#include <SOCC_ViewModel.h>
#else
#else
vm = new OCCViewer_Viewer( true, resMgr->booleanValue( "OCCViewer", "static_trihedron", true ) );
#endif
- vm->setBackgroundColor( resMgr->colorValue( "OCCViewer", "background", vm->backgroundColor() ) );
+ vm->setBackgroundColor( OCCViewer_ViewFrame::TOP_LEFT,
+ resMgr->colorValue( "OCCViewer", "xz_background", vm->backgroundColor() ) );
+ vm->setBackgroundColor( OCCViewer_ViewFrame::TOP_RIGHT,
+ resMgr->colorValue( "OCCViewer", "yz_background", vm->backgroundColor() ) );
+
+ vm->setBackgroundColor( OCCViewer_ViewFrame::BOTTOM_LEFT,
+ resMgr->colorValue( "OCCViewer", "xy_background", vm->backgroundColor() ) );
+ vm->setBackgroundColor( OCCViewer_ViewFrame::BOTTOM_RIGHT,
+ resMgr->colorValue( "OCCViewer", "3d_background", vm->backgroundColor() ) );
+
vm->setTrihedronSize( resMgr->doubleValue( "OCCViewer", "trihedron_size", vm->trihedronSize() ) );
int u( 1 ), v( 1 );
vm->isos( u, v );
pref->setItemProperty( "min", 1.0E-06, occTS );
pref->setItemProperty( "max", 1000, occTS );
+ int occStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), occGroup,
+ LightApp_Preferences::Selector, "OCCViewer", "navigation_mode" );
+
int isoU = pref->addPreference( tr( "PREF_ISOS_U" ), occGroup,
LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_u" );
pref->setItemProperty( "min", 0, isoU );
pref->setItemProperty( "max", 100000, isoU );
- pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup,
- LightApp_Preferences::Color, "OCCViewer", "background" );
-
int isoV = pref->addPreference( tr( "PREF_ISOS_V" ), occGroup,
LightApp_Preferences::IntSpin, "OCCViewer", "iso_number_v" );
pref->setItemProperty( "min", 0, isoV );
pref->setItemProperty( "max", 100000, isoV );
- int occStyleMode = pref->addPreference( tr( "PREF_NAVIGATION" ), occGroup,
- LightApp_Preferences::Selector, "OCCViewer", "navigation_mode" );
+ //pref->addPreference( tr( "PREF_VIEWER_BACKGROUND" ), occGroup,
+ // LightApp_Preferences::Color, "OCCViewer", "background" );
+ pref->addPreference( tr( "PREF_XZVIEWER_BACKGROUND" ), occGroup,
+ LightApp_Preferences::Color, "OCCViewer", "xz_background" );
+ pref->addPreference( tr( "PREF_YZVIEWER_BACKGROUND" ), occGroup,
+ LightApp_Preferences::Color, "OCCViewer", "yz_background" );
+
+ pref->addPreference( tr( "PREF_XYVIEWER_BACKGROUND" ), occGroup,
+ LightApp_Preferences::Color, "OCCViewer", "xy_background" );
+ pref->addPreference( tr( "PREF_3DVIEWER_BACKGROUND" ), occGroup,
+ LightApp_Preferences::Color, "OCCViewer", "3d_background" );
+
QStringList aStyleModeList;
aStyleModeList.append( tr("PREF_STANDARD_STYLE") );
aStyleModeList.append( tr("PREF_KEYFREE_STYLE") );
</section>
<section name="OCCViewer" >
<!-- OCC viewer preferences -->
- <parameter name="background" value="35, 136, 145" />
+ <parameter name="xz_background" value="35, 136, 145" />
+ <parameter name="yz_background" value="35, 136, 145" />
+ <parameter name="xy_background" value="35, 136, 145" />
+ <parameter name="3d_background" value="35, 136, 145" />
<parameter name="iso_number_u" value="1" />
<parameter name="iso_number_v" value="1" />
<parameter name="trihedron_size" value="100" />
<source>PREF_VIEWER_BACKGROUND</source>
<translation>Background color</translation>
</message>
+ <message>
+ <source>PREF_XYVIEWER_BACKGROUND</source>
+ <translation>XY View background color</translation>
+ </message>
+ <message>
+ <source>PREF_XZVIEWER_BACKGROUND</source>
+ <translation>XZ View background color</translation>
+ </message>
+ <message>
+ <source>PREF_YZVIEWER_BACKGROUND</source>
+ <translation>YZ View background color</translation>
+ </message>
+ <message>
+ <source>PREF_3DVIEWER_BACKGROUND</source>
+ <translation>3D View background color</translation>
+ </message>
<message>
<source>PREF_FONT</source>
<translation>Font</translation>
int i = 0;
if (myViews.count() == 1) {
- QColor aColor = myViews.at( MAIN_VIEW )->backgroundColor();
+ //QColor aColor = myViews.at( MAIN_VIEW )->backgroundColor();
OCCViewer_ViewWindow* view = 0;
for ( i = BOTTOM_LEFT; i <= TOP_RIGHT; i++) {
view = aModel->createSubWindow();
aModel->initView(view);
view->setMaximized(false, false);
connectViewSignals(view);
- view->setBackgroundColor(aColor);
+ view->setBackgroundColor(aModel->backgroundColor(i));
}
myLayout->addWidget( myViews.at(BOTTOM_LEFT), 1, 0 );
myLayout->addWidget( myViews.at(TOP_LEFT), 0, 0 );
*/
OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron, bool DisplayStaticTrihedron )
: SUIT_ViewModel(),
- myBgColor( Qt::black ),
- myShowStaticTrihedron( DisplayStaticTrihedron )
+ myShowStaticTrihedron( DisplayStaticTrihedron ),
+ myColors(4, Qt::black)
{
// init CasCade viewers
myV3dViewer = OCCViewer_VService::Viewer3d( "", (short*) "Viewer3d", "", 1000.,
*/
QColor OCCViewer_Viewer::backgroundColor() const
{
- return myBgColor;
+ return myColors[0];
}
/*!
void OCCViewer_Viewer::setBackgroundColor( const QColor& c )
{
if ( c.isValid() )
- myBgColor = c;
+ myColors[0] = c;
}
/*!
OCCViewer_ViewPort3d* vp3d = view->getViewPort();
if ( vp3d )
- vp3d->setBackgroundColor( myBgColor );
+ vp3d->setBackgroundColor( myColors[0] );
}
}
*/
void OCCViewer_Viewer::onChangeBgColor()
{
- OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
+ OCCViewer_ViewWindow* aView = dynamic_cast<OCCViewer_ViewWindow*>(myViewManager->getActiveView());
if( !aView )
return;
QColor aColorActive = aView->backgroundColor();
{
return new OCCViewer_ViewWindow( 0, this);
}
+
+QColor OCCViewer_Viewer::backgroundColor(int theViewId) const
+{
+ if (theViewId < myColors.count())
+ return myColors[theViewId];
+ return Qt::black;
+}
+
+void OCCViewer_Viewer::setBackgroundColor( int theViewId, const QColor& theColor)
+{
+ if (theViewId < myColors.count())
+ myColors[theViewId] = theColor;
+}
#include <QColor>
#include <QPoint>
+#include <QVector>
#include "OCCViewer.h"
virtual void clearViewAspects();
QColor backgroundColor() const;
- void setBackgroundColor( const QColor& );
+ void setBackgroundColor( const QColor& );
+
+ QColor backgroundColor(int theViewId) const;
+ void setBackgroundColor( int theViewId, const QColor& );
//! returns true if 3d Trihedron in viewer was created
bool trihedronActivated() const { return !myTrihedron.IsNull(); }
bool mySelectionEnabled;
bool myMultiSelectionEnabled;
- QColor myBgColor;
+ //QColor myBgColor;
QPoint myStartPnt, myEndPnt;
bool myShowStaticTrihedron;
+
+ QVector<QColor> myColors;
};
#ifdef WIN32
</section>
<section name="OCCViewer" >
<!-- OCC viewer preferences -->
- <parameter name="background" value="35, 136, 145" />
+ <parameter name="xz_background" value="35, 136, 145" />
+ <parameter name="yz_background" value="35, 136, 145" />
+ <parameter name="xy_background" value="35, 136, 145" />
+ <parameter name="3d_background" value="35, 136, 145" />
<parameter name="iso_number_u" value="1" />
<parameter name="iso_number_v" value="1" />
<parameter name="trihedron_size" value="100" />