mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-24 16:32:04 +05:00
Following methods are added to have possibility specify display mode for preview
int SetDisplayMode( const int ); int GetDisplayMode() const; int UnsetDisplayMode(); (PAL13191: EDF160 GEOM: in Glue Faces, visualize faces existing twice)
This commit is contained in:
parent
5bbd38e972
commit
69de88f091
@ -1075,7 +1075,13 @@ void GEOM_Displayer::AfterDisplay( SALOME_View*, const SALOME_OCCViewType& )
|
||||
//=================================================================
|
||||
void GEOM_Displayer::SetColor( const int color )
|
||||
{
|
||||
myColor = color;
|
||||
if ( color == -1 )
|
||||
UnsetColor();
|
||||
else
|
||||
{
|
||||
myColor = color;
|
||||
myShadingColor = Quantity_Color( (Quantity_NameOfColor)color );
|
||||
}
|
||||
}
|
||||
|
||||
int GEOM_Displayer::GetColor() const
|
||||
@ -1091,6 +1097,10 @@ bool GEOM_Displayer::HasColor() const
|
||||
void GEOM_Displayer::UnsetColor()
|
||||
{
|
||||
myColor = -1;
|
||||
|
||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||
QColor col = resMgr->colorValue( "Geometry", "shading_color", QColor( 255, 0, 0 ) );
|
||||
myShadingColor = SalomeApp_Tools::color( col );
|
||||
}
|
||||
|
||||
//=================================================================
|
||||
@ -1183,3 +1193,27 @@ bool GEOM_Displayer::canBeDisplayed( const QString& /*entry*/, const QString& vi
|
||||
{
|
||||
return viewer_type==SOCC_Viewer::Type() || viewer_type==SVTK_Viewer::Type();
|
||||
}
|
||||
|
||||
int GEOM_Displayer::SetDisplayMode( const int theMode )
|
||||
{
|
||||
int aPrevMode = myDisplayMode;
|
||||
if ( theMode != -1 )
|
||||
myDisplayMode = theMode;
|
||||
else
|
||||
{
|
||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||
myDisplayMode = resMgr->integerValue( "Geometry", "display_mode", 0 );
|
||||
}
|
||||
return aPrevMode;
|
||||
}
|
||||
|
||||
int GEOM_Displayer::GetDisplayMode() const
|
||||
{
|
||||
return myDisplayMode;
|
||||
}
|
||||
|
||||
int GEOM_Displayer::UnsetDisplayMode()
|
||||
{
|
||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||
myDisplayMode = resMgr->integerValue( "Geometry", "display_mode", 0 );
|
||||
}
|
||||
|
@ -128,6 +128,11 @@ public:
|
||||
void UnsetWidth();
|
||||
double GetWidth () const;
|
||||
bool HasWidth () const;
|
||||
|
||||
/* Set display mode shape displaying. If it is equal -1 then display mode is used. */
|
||||
int SetDisplayMode( const int );
|
||||
int GetDisplayMode() const;
|
||||
int UnsetDisplayMode();
|
||||
|
||||
|
||||
/* Sets name - for temporary objects only */
|
||||
|
Loading…
x
Reference in New Issue
Block a user