mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-25 06:12:04 +05:00
Set of parameters of displayPreview methods is increased, display mode and color are added(PAL131191: EDF160 GEOM: in Glue Faces, visualize faces existing twice)
This commit is contained in:
parent
6318afdea1
commit
3e52968abb
@ -44,6 +44,7 @@
|
||||
#include <SalomeApp_Application.h>
|
||||
#include <SalomeApp_Study.h>
|
||||
#include <LightApp_SelectionMgr.h>
|
||||
#include <LightApp_DataOwner.h>
|
||||
#include <SalomeApp_Tools.h>
|
||||
#include <SalomeApp_DataModel.h>
|
||||
|
||||
@ -247,7 +248,9 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object,
|
||||
void GEOMBase_Helper::displayPreview( const bool activate,
|
||||
const bool update,
|
||||
const bool toRemoveFromEngine,
|
||||
const double lineWidth )
|
||||
const double lineWidth,
|
||||
const int displayMode,
|
||||
const int color )
|
||||
{
|
||||
isPreview = true;
|
||||
QString msg;
|
||||
@ -269,7 +272,7 @@ void GEOMBase_Helper::displayPreview( const bool activate,
|
||||
else {
|
||||
for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it )
|
||||
{
|
||||
displayPreview( *it, true, activate, false, lineWidth );
|
||||
displayPreview( *it, true, activate, false, lineWidth, displayMode, color );
|
||||
if ( toRemoveFromEngine )
|
||||
getGeomEngine()->RemoveObject( *it );
|
||||
}
|
||||
@ -293,14 +296,19 @@ void GEOMBase_Helper::displayPreview( GEOM::GEOM_Object_ptr object,
|
||||
const bool append,
|
||||
const bool activate,
|
||||
const bool update,
|
||||
const double lineWidth )
|
||||
const double lineWidth,
|
||||
const int displayMode,
|
||||
const int color )
|
||||
{
|
||||
// Set color for preview shape
|
||||
getDisplayer()->SetColor( Quantity_NOC_VIOLET );
|
||||
getDisplayer()->SetColor( color == -1 ? Quantity_NOC_VIOLET : color );
|
||||
|
||||
// set width of displayed shape
|
||||
getDisplayer()->SetWidth( lineWidth );
|
||||
|
||||
// set display mode of displayed shape
|
||||
int aPrevDispMode = getDisplayer()->SetDisplayMode( displayMode );
|
||||
|
||||
// Disable activation of selection
|
||||
getDisplayer()->SetToActivate( activate );
|
||||
|
||||
@ -316,6 +324,8 @@ void GEOMBase_Helper::displayPreview( GEOM::GEOM_Object_ptr object,
|
||||
displayPreview( aPrs, append, update );
|
||||
|
||||
getDisplayer()->UnsetName();
|
||||
getDisplayer()->UnsetColor();
|
||||
getDisplayer()->SetDisplayMode( aPrevDispMode );
|
||||
|
||||
// Enable activation of displayed objects
|
||||
getDisplayer()->SetToActivate( true );
|
||||
@ -985,3 +995,38 @@ SUIT_Desktop* GEOMBase_Helper::getDesktop() const
|
||||
return myDesktop;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : selectObjects
|
||||
// Purpose : Selects list of objects
|
||||
//================================================================
|
||||
bool GEOMBase_Helper::selectObjects( ObjectList& objects )
|
||||
{
|
||||
SUIT_DataOwnerPtrList aList;
|
||||
ObjectList::iterator anIter;
|
||||
for ( anIter = objects.begin(); anIter != objects.end(); ++anIter )
|
||||
{
|
||||
string entry = getEntry( *anIter );
|
||||
QString aEntry( entry.c_str() );
|
||||
LightApp_DataOwner* anOwher = new LightApp_DataOwner( aEntry );
|
||||
aList.append( anOwher );
|
||||
}
|
||||
|
||||
SUIT_Session* session = SUIT_Session::session();
|
||||
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
|
||||
if ( !app )
|
||||
return false;
|
||||
|
||||
LightApp_SelectionMgr* aMgr = app->selectionMgr();
|
||||
if ( !aMgr )
|
||||
return false;
|
||||
|
||||
aMgr->setSelected( aList, false );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -83,7 +83,9 @@ protected:
|
||||
virtual void displayPreview ( const bool activate = false,
|
||||
const bool update = true,
|
||||
const bool toRemoveFromEngine = true,
|
||||
const double lineWidth = -1 );
|
||||
const double lineWidth = -1,
|
||||
const int displayMode = -1,
|
||||
const int color = -1 );
|
||||
// This is the easiest way to show preview. It is based on execute() method.
|
||||
// It removes temporary GEOM::GEOM_Objects automatically.
|
||||
|
||||
@ -91,7 +93,9 @@ protected:
|
||||
const bool append = false,
|
||||
const bool activate = false,
|
||||
const bool update = true,
|
||||
const double lineWidth = -1 );
|
||||
const double lineWidth = -1,
|
||||
const int displayMode = -1,
|
||||
const int color = -1 );
|
||||
void displayPreview ( const SALOME_Prs* prs,
|
||||
const bool append = false,
|
||||
const bool = true );
|
||||
@ -152,6 +156,9 @@ protected:
|
||||
// Function returns the last selected object in the list
|
||||
// of selected objects
|
||||
|
||||
bool selectObjects( ObjectList& objects );
|
||||
// Selects list of objects
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Virtual methods, to be redefined in dialog classes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user