1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0026272: Visualization - provide a possibility to activate selection modes without opening local context

- picked or selected objects are now highlighted via owners instead of interactive objects;
- support methods for owners were added to AIS_InteractiveContext;
- dynamically highlighted owners are now displayed in immediate mode;
- selection without opening of local context is enabled by default;
- added "-local" key to vselmode command to enable selection in local context;
- selection filters are now completely supported in AIS_InteractiveContext;
- the idea of differencing of selected items onto current (in interactive context) and selected (local selection) was eliminated;
- all calls to "current" were replaced by calls to "selected" in terms of future local context removal;
- AIS_InteractiveObject::mySelectionMode was removed;
- now each selectable object can define own selection mode for "global" selection of the whole object;
- whole object selection mode is 0 by default for all standard interactive objects;
- immediate structures are now added to topmost and top layer lists;
- added support of drawing immediate structures in different layers;
- unused code for immediate mode was removed;
- vfeedback and vexport commands now produce correct output for raytrace mode.
This commit is contained in:
vpa
2015-07-31 14:38:19 +03:00
parent a7cb665a6a
commit c3282ec170
48 changed files with 1397 additions and 1190 deletions

View File

@@ -33,6 +33,8 @@
#include <TDF_RelocationTable.hxx>
#include <TDF_Tool.hxx>
#include <TPrsStd_AISPresentation.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TPrsStd_AISViewer.hxx>
#include <TPrsStd_Driver.hxx>
#include <TPrsStd_DriverTable.hxx>
@@ -576,17 +578,12 @@ void TPrsStd_AISPresentation::SetSelectionMode(const Standard_Integer theSelecti
{
// OCC2932 correction
if(hasOwnSelectionMode && mySelectionMode == theSelectionMode && !myAIS.IsNull())
if(myAIS->SelectionMode() == theSelectionMode )
return;
Backup();
mySelectionMode = theSelectionMode;
hasOwnSelectionMode = Standard_True;
if( myAIS.IsNull() ) AISUpdate();
if( !myAIS.IsNull() ) {
if( myAIS->SelectionMode() == theSelectionMode ) return;
myAIS->SetSelectionMode(theSelectionMode);
}
}
//=======================================================================
@@ -596,15 +593,12 @@ void TPrsStd_AISPresentation::SetSelectionMode(const Standard_Integer theSelecti
void TPrsStd_AISPresentation::UnsetSelectionMode()
{
if(!hasOwnSelectionMode && !myAIS.IsNull())
if(!myAIS->HasSelectionMode())
return;
Backup();
hasOwnSelectionMode = Standard_False;
if( myAIS.IsNull() ) AISUpdate();
if( !myAIS.IsNull() && myAIS->HasSelectionMode() ) {
myAIS->UnsetSelectionMode();
}
mySelectionMode = myAIS->GlobalSelectionMode();
}
//=======================================================================
@@ -921,9 +915,25 @@ void TPrsStd_AISPresentation::AISUpdate ()
}
if (hasOwnSelectionMode) {
if (myAIS->SelectionMode() != mySelectionMode ) {
myAIS->SetSelectionMode(mySelectionMode);
if (hasOwnSelectionMode) {
const Handle(AIS_InteractiveContext) aContext =
ctx.IsNull() ? myAIS->GetContext() : ctx;
if (!aContext.IsNull())
{
TColStd_ListOfInteger anActivatedModes;
aContext->ActivatedModes (myAIS, anActivatedModes);
Standard_Boolean isActivated = Standard_False;
for (TColStd_ListIteratorOfListOfInteger aModeIter (anActivatedModes); aModeIter.More(); aModeIter.Next())
{
if (aModeIter.Value() == mySelectionMode)
{
isActivated = Standard_True;
break;
}
}
if (!isActivated)
aContext->Activate (myAIS, mySelectionMode, Standard_False);
}
}