mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0028162: Draw Harness - eliminate usage of deprecated Local Context
Create a general draw command 'VRelation' and drop the old 'relation' commands. Add test cases for new draw command "vrelation". Add two new methods: Activate and Deactivate which activate/deactivate the given selection mode for all displayed objects. Eliminate deprecated local context methods in ObjectCommands, QABugs. Eliminate deprecated local context methods in mfc standard sample and qt samples.
This commit is contained in:
@@ -544,11 +544,11 @@ void ApplicationCommonWindow::onSelectionChanged()
|
||||
int numSel = context->NbSelected();
|
||||
if ( numSel )
|
||||
{
|
||||
for ( context->InitCurrent(); context->MoreCurrent(); context->NextCurrent() )
|
||||
for ( context->InitSelected(); context->MoreSelected(); context->NextSelected() )
|
||||
{
|
||||
if ( context->IsDisplayed( context->Current(), 1 ) )
|
||||
if ( context->IsDisplayed( context->SelectedInteractive(), 1 ) )
|
||||
OneOrMoreInShading = true;
|
||||
if ( context->IsDisplayed( context->Current(), 0 ) )
|
||||
if ( context->IsDisplayed( context->SelectedInteractive(), 0 ) )
|
||||
OneOrMoreInWireframe = true;
|
||||
}
|
||||
myToolActions.at( ToolWireframeId )->setEnabled( OneOrMoreInShading );
|
||||
|
@@ -159,8 +159,8 @@ void DocumentCommon::fitAll()
|
||||
void DocumentCommon::onWireframe()
|
||||
{
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
for( myContext->InitCurrent(); myContext->MoreCurrent(); myContext->NextCurrent() )
|
||||
myContext->SetDisplayMode( myContext->Current(), 0, false );
|
||||
for( myContext->InitSelected(); myContext->MoreSelected(); myContext->NextSelected() )
|
||||
myContext->SetDisplayMode( myContext->SelectedInteractive(), 0, false );
|
||||
myContext->UpdateCurrentViewer();
|
||||
getApplication()->onSelectionChanged();
|
||||
QApplication::restoreOverrideCursor();
|
||||
@@ -169,8 +169,8 @@ void DocumentCommon::onWireframe()
|
||||
void DocumentCommon::onShading()
|
||||
{
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
for( myContext->InitCurrent(); myContext->MoreCurrent(); myContext->NextCurrent() )
|
||||
myContext->SetDisplayMode( myContext->Current(), 1, false );
|
||||
for( myContext->InitSelected(); myContext->MoreSelected(); myContext->NextSelected() )
|
||||
myContext->SetDisplayMode( myContext->SelectedInteractive(), 1, false );
|
||||
myContext->UpdateCurrentViewer();
|
||||
getApplication()->onSelectionChanged();
|
||||
QApplication::restoreOverrideCursor();
|
||||
@@ -180,8 +180,8 @@ void DocumentCommon::onColor()
|
||||
{
|
||||
QColor aColor ;
|
||||
Quantity_Color aShapeColor;
|
||||
myContext->InitCurrent();
|
||||
Handle(AIS_InteractiveObject) Current = myContext->Current() ;
|
||||
myContext->InitSelected();
|
||||
Handle(AIS_InteractiveObject) Current = myContext->SelectedInteractive() ;
|
||||
if ( Current->HasColor () )
|
||||
{
|
||||
aShapeColor = myContext->Color( Current );
|
||||
@@ -195,15 +195,15 @@ void DocumentCommon::onColor()
|
||||
{
|
||||
Quantity_Color color( aRetColor.red() / 255., aRetColor.green() / 255.,
|
||||
aRetColor.blue() / 255., Quantity_TOC_RGB );
|
||||
for (; myContext->MoreCurrent(); myContext->NextCurrent() )
|
||||
myContext->SetColor( myContext->Current(), color.Name() );
|
||||
for (; myContext->MoreSelected(); myContext->NextSelected() )
|
||||
myContext->SetColor( myContext->SelectedInteractive(), color.Name() );
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentCommon::onMaterial( int theMaterial )
|
||||
{
|
||||
for ( myContext->InitCurrent(); myContext->MoreCurrent (); myContext->NextCurrent () )
|
||||
myContext->SetMaterial( myContext->Current(), (Graphic3d_NameOfMaterial)theMaterial );
|
||||
for ( myContext->InitSelected(); myContext->MoreSelected (); myContext->NextSelected () )
|
||||
myContext->SetMaterial( myContext->SelectedInteractive(), (Graphic3d_NameOfMaterial)theMaterial );
|
||||
}
|
||||
|
||||
void DocumentCommon::onMaterial()
|
||||
@@ -215,8 +215,8 @@ void DocumentCommon::onMaterial()
|
||||
|
||||
void DocumentCommon::onTransparency( int theTrans )
|
||||
{
|
||||
for( myContext->InitCurrent(); myContext->MoreCurrent(); myContext->NextSelected() )
|
||||
myContext->SetTransparency( myContext->Current(), ((Standard_Real)theTrans) / 10.0 );
|
||||
for( myContext->InitSelected(); myContext->MoreSelected(); myContext->NextSelected() )
|
||||
myContext->SetTransparency( myContext->SelectedInteractive(), ((Standard_Real)theTrans) / 10.0 );
|
||||
}
|
||||
|
||||
void DocumentCommon::onTransparency()
|
||||
|
Reference in New Issue
Block a user