1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

OCC22357 Hidden face selection

This commit is contained in:
bugmaster
2011-04-28 15:57:34 +00:00
committed by bugmaster
parent 256d432045
commit 4952a30a49
32 changed files with 1565 additions and 1213 deletions

View File

@@ -20,8 +20,6 @@
#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
#include <AIS_Selection.hxx>
static TColStd_ListIteratorOfListOfInteger ItL;
//=======================================================================
//function : OpenLocalContext
//purpose :
@@ -64,21 +62,13 @@ OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
UseDisplayedObjects,
AllowShapeDecomposition,
AcceptEraseOfTemporary);
// rob 16/04/97 pour les Pbs d'ordres asynchrones
if(myLocalContexts.Extent()>0){
const Select3D_Projector& Prj = myLocalContexts(untilnow)->MainSelector()->Projector();
NewLocal->MainSelector()->Set(Prj);
}
else{
const Select3D_Projector& Prj = myMainSel->Projector();
NewLocal->MainSelector()->Set(Prj);
}
NewLocal->MainSelector()->UpdateConversion();
myLocalContexts.Bind(myCurLocalIndex,NewLocal);
NewLocal->MainSelector()->Set ((myLocalContexts.Extent() > 0)
? myLocalContexts (untilnow)->MainSelector()->Projector()
: myMainSel->Projector());
NewLocal->MainSelector()->UpdateConversion();
myLocalContexts.Bind(myCurLocalIndex,NewLocal);
#ifdef DEB
cout<<"\tOpen Local Context No "<<myCurLocalIndex<<endl;
@@ -93,7 +83,6 @@ OpenLocalContext(const Standard_Boolean UseDisplayedObjects,
cout<<"\t\tNo Objects Were Loaded "<<endl;
#endif
return myCurLocalIndex;
}
//=======================================================================
@@ -268,6 +257,7 @@ Deactivate(const Handle(AIS_InteractiveObject)& anIObj)
{
if(!HasOpenedContext()){
if(!myObjects.IsBound(anIObj)) return;
TColStd_ListIteratorOfListOfInteger ItL;
for(ItL.Initialize(myObjects(anIObj)->SelectionModes());
ItL.More();
ItL.Next()){
@@ -312,9 +302,9 @@ void AIS_InteractiveContext::
ActivatedModes(const Handle(AIS_InteractiveObject)& anIObj,
TColStd_ListOfInteger& theList) const
{
TColStd_ListIteratorOfListOfInteger ItL;
if(!HasOpenedContext()){
if(myObjects.IsBound(anIObj)){
//ItL est une variable statique...
for(ItL.Initialize(myObjects(anIObj)->SelectionModes());
ItL.More();
ItL.Next())
@@ -393,6 +383,7 @@ SubIntensityOn(const Handle(AIS_InteractiveObject)& anIObj,
if(myObjects.IsBound(anIObj)){
const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
STAT->SubIntensityOn();
TColStd_ListIteratorOfListOfInteger ItL;
for (ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
myMainPM->Color(anIObj,mySubIntensity,ItL.Value());
}
@@ -446,6 +437,7 @@ SubIntensityOff(const Handle(AIS_InteractiveObject)& anIObj,
if(myObjects.IsBound(anIObj)){
const Handle(AIS_GlobalStatus)& STAT = myObjects(anIObj);
STAT->SubIntensityOff();
TColStd_ListIteratorOfListOfInteger ItL;
for (ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
myMainPM->Unhighlight(anIObj,ItL.Value());
if(STAT->IsHilighted())
@@ -489,11 +481,10 @@ void AIS_InteractiveContext::SubIntensityOn(const Standard_Boolean updateviewer)
//=======================================================================
void AIS_InteractiveContext::SubIntensityOff(const Standard_Boolean updateviewer)
{
if(!HasOpenedContext()) return;
AIS_DataMapIteratorOfDataMapOfIOStatus It (myObjects);
TColStd_ListIteratorOfListOfInteger ItL;
for(;It.More();It.Next()){
const Handle(AIS_GlobalStatus)& STAT = It.Value();
if(STAT->IsSubIntensityOn())
@@ -501,7 +492,7 @@ void AIS_InteractiveContext::SubIntensityOff(const Standard_Boolean updateviewer
for(ItL.Initialize(STAT->DisplayedModes());ItL.More();ItL.Next())
myMainPM->Unhighlight(It.Key());
}
if(updateviewer) myMainVwr->Update();
}
@@ -877,7 +868,7 @@ void AIS_InteractiveContext::ResetOriginalState(const Standard_Boolean updatevie
{
Standard_Boolean upd_main(Standard_False),upd_col(Standard_False);
TColStd_ListIteratorOfListOfInteger itl;
for (AIS_DataMapIteratorOfDataMapOfIOStatus it(myObjects);it.More();it.Next()){
const Handle(AIS_InteractiveObject)& iobj = it.Key();
const Handle(AIS_GlobalStatus)& STAT = it.Value();

View File

@@ -660,22 +660,25 @@ void AIS_LocalContext::RemoveFilter(const Handle(SelectMgr_Filter)& aFilter)
Standard_Boolean AIS_LocalContext::HasSameProjector(const Select3D_Projector& aPrj) const
Standard_Boolean AIS_LocalContext::HasSameProjector(const Handle(Select3D_Projector)& thePrj) const
{
const Select3D_Projector& CurPrj = myMainVS->Projector();
if(CurPrj.Perspective()!=aPrj.Perspective()) return Standard_False;
if(CurPrj.Perspective())
if(CurPrj.Focus()!=aPrj.Focus()) return Standard_False;
gp_GTrsf CurTrsf(CurPrj.Transformation());
gp_GTrsf PrjTrsf(aPrj.Transformation());
for(Standard_Integer i=1;i<=3;i++){
for(Standard_Integer j=1;j<=3;j++){
if(CurTrsf.Value(i,j)!=PrjTrsf.Value(i,j))
return Standard_False;
const Handle(Select3D_Projector)& aCurPrj = myMainVS->Projector();
if (aCurPrj->Perspective() != thePrj->Perspective())
return Standard_False;
if (aCurPrj->Perspective() && aCurPrj->Focus() != thePrj->Focus())
return Standard_False;
const gp_GTrsf& aCurTrsf = aCurPrj->Transformation();
const gp_GTrsf& aPrjTrsf = thePrj->Transformation();
for (Standard_Integer i = 1; i <= 3; ++i)
{
for (Standard_Integer j = 1; j <= 3 ; ++j)
{
if (aCurTrsf.Value (i, j) != aPrjTrsf.Value (i, j))
return Standard_False;
}
}
return Standard_True;
}