mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-09 18:50:54 +03:00
0032162: Visualization - move AIS_DisplayStatus from AIS_GlobalStatus to PrsMgr_PresentableObject
AIS_DisplayStatus has been renamed to PrsMgr_DisplayStatus and moved from AIS_GlobalStatus class field to PrsMgr_PresentableObject. 0032167: Visualization, AIS_InteractiveContext - setObjectStatus sets wrong status when AIS_DS_Erased AIS_InteractiveContext::setObjectStatus() Fixed setting unexpected Displayed status to Erased objects.
This commit is contained in:
parent
79d49683d6
commit
39e6123e3b
@ -17,12 +17,9 @@
|
|||||||
#ifndef _AIS_DisplayStatus_HeaderFile
|
#ifndef _AIS_DisplayStatus_HeaderFile
|
||||||
#define _AIS_DisplayStatus_HeaderFile
|
#define _AIS_DisplayStatus_HeaderFile
|
||||||
|
|
||||||
|
#include <PrsMgr_DisplayStatus.hxx>
|
||||||
|
|
||||||
//! To give the display status of an Interactive Object.
|
//! To give the display status of an Interactive Object.
|
||||||
enum AIS_DisplayStatus
|
typedef PrsMgr_DisplayStatus AIS_DisplayStatus;
|
||||||
{
|
|
||||||
AIS_DS_Displayed, //!< the Interactive Object is displayed in the main viewer
|
|
||||||
AIS_DS_Erased, //!< the Interactive Object is hidden in main viewer
|
|
||||||
AIS_DS_None //!< the Interactive Object is nowhere displayed
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // _AIS_DisplayStatus_HeaderFile
|
#endif // _AIS_DisplayStatus_HeaderFile
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
IMPLEMENT_STANDARD_RTTIEXT(AIS_GlobalStatus, Standard_Transient)
|
IMPLEMENT_STANDARD_RTTIEXT(AIS_GlobalStatus, Standard_Transient)
|
||||||
|
|
||||||
AIS_GlobalStatus::AIS_GlobalStatus():
|
AIS_GlobalStatus::AIS_GlobalStatus():
|
||||||
myStatus(AIS_DS_None),
|
|
||||||
myDispMode(AIS_WireFrame),
|
myDispMode(AIS_WireFrame),
|
||||||
myLayerIndex(0),
|
myLayerIndex(0),
|
||||||
myIsHilit(Standard_False),
|
myIsHilit(Standard_False),
|
||||||
@ -31,18 +30,15 @@ mySubInt(Standard_False)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
AIS_GlobalStatus::AIS_GlobalStatus(const AIS_DisplayStatus DS,
|
AIS_GlobalStatus::AIS_GlobalStatus (const Standard_Integer theDMode,
|
||||||
const Standard_Integer DMode,
|
const Standard_Integer theSMode,
|
||||||
const Standard_Integer SMode,
|
const Standard_Integer theLayer):
|
||||||
const Standard_Boolean /*ishilighted*/,
|
myDispMode (theDMode),
|
||||||
const Standard_Integer Layer):
|
myLayerIndex (theLayer),
|
||||||
myStatus(DS),
|
myIsHilit (Standard_False),
|
||||||
myDispMode(DMode),
|
mySubInt (Standard_False)
|
||||||
myLayerIndex(Layer),
|
|
||||||
myIsHilit(Standard_False),
|
|
||||||
mySubInt(Standard_False)
|
|
||||||
{
|
{
|
||||||
mySelModes.Append(SMode);
|
mySelModes.Append (theSMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS_GlobalStatus::RemoveSelectionMode(const Standard_Integer aMode)
|
void AIS_GlobalStatus::RemoveSelectionMode(const Standard_Integer aMode)
|
||||||
|
@ -43,9 +43,9 @@ public:
|
|||||||
|
|
||||||
Standard_EXPORT AIS_GlobalStatus();
|
Standard_EXPORT AIS_GlobalStatus();
|
||||||
|
|
||||||
Standard_EXPORT AIS_GlobalStatus(const AIS_DisplayStatus aStat, const Standard_Integer aDispMode, const Standard_Integer aSelMode, const Standard_Boolean ishilighted = Standard_False, const Standard_Integer aLayerIndex = 0);
|
Standard_EXPORT AIS_GlobalStatus (const Standard_Integer theDispMode,
|
||||||
|
const Standard_Integer theSelMode,
|
||||||
void SetGraphicStatus (const AIS_DisplayStatus theStatus) { myStatus = theStatus; }
|
const Standard_Integer theLayerIndex = 0);
|
||||||
|
|
||||||
void AddSelectionMode (const Standard_Integer theMode) { if (!IsSModeIn (theMode)) mySelModes.Append (theMode); }
|
void AddSelectionMode (const Standard_Integer theMode) { if (!IsSModeIn (theMode)) mySelModes.Append (theMode); }
|
||||||
|
|
||||||
@ -74,9 +74,7 @@ public:
|
|||||||
Standard_EXPORT void RemoveSelectionMode (const Standard_Integer aMode);
|
Standard_EXPORT void RemoveSelectionMode (const Standard_Integer aMode);
|
||||||
|
|
||||||
Standard_EXPORT void ClearSelectionModes();
|
Standard_EXPORT void ClearSelectionModes();
|
||||||
|
|
||||||
AIS_DisplayStatus GraphicStatus() const { return myStatus; }
|
|
||||||
|
|
||||||
//! keeps the active selection modes of the object
|
//! keeps the active selection modes of the object
|
||||||
//! in the main viewer.
|
//! in the main viewer.
|
||||||
const TColStd_ListOfInteger& SelectionModes() const { return mySelModes; }
|
const TColStd_ListOfInteger& SelectionModes() const { return mySelModes; }
|
||||||
@ -95,7 +93,6 @@ private:
|
|||||||
|
|
||||||
TColStd_ListOfInteger mySelModes;
|
TColStd_ListOfInteger mySelModes;
|
||||||
Handle(Prs3d_Drawer) myHiStyle;
|
Handle(Prs3d_Drawer) myHiStyle;
|
||||||
AIS_DisplayStatus myStatus;
|
|
||||||
Standard_Integer myDispMode;
|
Standard_Integer myDispMode;
|
||||||
Standard_Integer myLayerIndex;
|
Standard_Integer myLayerIndex;
|
||||||
Standard_Boolean myIsHilit;
|
Standard_Boolean myIsHilit;
|
||||||
|
@ -245,7 +245,7 @@ void AIS_InteractiveContext::DisplayedObjects (AIS_ListOfInteractive& theListOfI
|
|||||||
{
|
{
|
||||||
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
||||||
{
|
{
|
||||||
if (anObjIter.Value()->GraphicStatus() == AIS_DS_Displayed)
|
if (anObjIter.Key()->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
theListOfIO.Append (anObjIter.Key());
|
theListOfIO.Append (anObjIter.Key());
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ void AIS_InteractiveContext::DisplayedObjects (const AIS_KindOfInteractive theKi
|
|||||||
const Standard_Integer theSign,
|
const Standard_Integer theSign,
|
||||||
AIS_ListOfInteractive& theListOfIO) const
|
AIS_ListOfInteractive& theListOfIO) const
|
||||||
{
|
{
|
||||||
ObjectsByDisplayStatus (theKind, theSign, AIS_DS_Displayed, theListOfIO);
|
ObjectsByDisplayStatus (theKind, theSign, PrsMgr_DisplayStatus_Displayed, theListOfIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -269,7 +269,7 @@ void AIS_InteractiveContext::DisplayedObjects (const AIS_KindOfInteractive theKi
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_InteractiveContext::ErasedObjects (AIS_ListOfInteractive& theListOfIO) const
|
void AIS_InteractiveContext::ErasedObjects (AIS_ListOfInteractive& theListOfIO) const
|
||||||
{
|
{
|
||||||
ObjectsByDisplayStatus (AIS_DS_Erased, theListOfIO);
|
ObjectsByDisplayStatus (PrsMgr_DisplayStatus_Erased, theListOfIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -280,19 +280,19 @@ void AIS_InteractiveContext::ErasedObjects (const AIS_KindOfInteractive theKind,
|
|||||||
const Standard_Integer theSign,
|
const Standard_Integer theSign,
|
||||||
AIS_ListOfInteractive& theListOfIO) const
|
AIS_ListOfInteractive& theListOfIO) const
|
||||||
{
|
{
|
||||||
ObjectsByDisplayStatus (theKind, theSign, AIS_DS_Erased, theListOfIO);
|
ObjectsByDisplayStatus (theKind, theSign, PrsMgr_DisplayStatus_Erased, theListOfIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : ObjectsByDisplayStatus
|
//function : ObjectsByDisplayStatus
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_InteractiveContext::ObjectsByDisplayStatus (const AIS_DisplayStatus theStatus,
|
void AIS_InteractiveContext::ObjectsByDisplayStatus (const PrsMgr_DisplayStatus theStatus,
|
||||||
AIS_ListOfInteractive& theListOfIO) const
|
AIS_ListOfInteractive& theListOfIO) const
|
||||||
{
|
{
|
||||||
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
||||||
{
|
{
|
||||||
if (anObjIter.Value()->GraphicStatus() == theStatus)
|
if (anObjIter.Key()->DisplayStatus() == theStatus)
|
||||||
{
|
{
|
||||||
theListOfIO.Append (anObjIter.Key());
|
theListOfIO.Append (anObjIter.Key());
|
||||||
}
|
}
|
||||||
@ -305,13 +305,13 @@ void AIS_InteractiveContext::ObjectsByDisplayStatus (const AIS_DisplayStatus the
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_InteractiveContext::ObjectsByDisplayStatus (const AIS_KindOfInteractive theKind,
|
void AIS_InteractiveContext::ObjectsByDisplayStatus (const AIS_KindOfInteractive theKind,
|
||||||
const Standard_Integer theSign,
|
const Standard_Integer theSign,
|
||||||
const AIS_DisplayStatus theStatus,
|
const PrsMgr_DisplayStatus theStatus,
|
||||||
AIS_ListOfInteractive& theListOfIO) const
|
AIS_ListOfInteractive& theListOfIO) const
|
||||||
{
|
{
|
||||||
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
||||||
{
|
{
|
||||||
if (theStatus != AIS_DS_None
|
if (theStatus != PrsMgr_DisplayStatus_None
|
||||||
&& anObjIter.Value()->GraphicStatus() != theStatus)
|
&& anObjIter.Key()->DisplayStatus() != theStatus)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -368,14 +368,14 @@ void AIS_InteractiveContext::ObjectsInside (AIS_ListOfInteractive& theListO
|
|||||||
void AIS_InteractiveContext::ObjectsForView (AIS_ListOfInteractive& theListOfIO,
|
void AIS_InteractiveContext::ObjectsForView (AIS_ListOfInteractive& theListOfIO,
|
||||||
const Handle(V3d_View)& theView,
|
const Handle(V3d_View)& theView,
|
||||||
const Standard_Boolean theIsVisibleInView,
|
const Standard_Boolean theIsVisibleInView,
|
||||||
const AIS_DisplayStatus theStatus) const
|
const PrsMgr_DisplayStatus theStatus) const
|
||||||
{
|
{
|
||||||
Handle(Graphic3d_CView) aViewImpl = theView->View();
|
Handle(Graphic3d_CView) aViewImpl = theView->View();
|
||||||
const Standard_Integer aViewId = aViewImpl->Identification();
|
const Standard_Integer aViewId = aViewImpl->Identification();
|
||||||
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
||||||
{
|
{
|
||||||
if (theStatus != AIS_DS_None
|
if (theStatus != PrsMgr_DisplayStatus_None
|
||||||
&& anObjIter.Value()->GraphicStatus() != theStatus)
|
&& anObjIter.Key()->DisplayStatus() != theStatus)
|
||||||
{
|
{
|
||||||
theListOfIO.Append (anObjIter.Key());
|
theListOfIO.Append (anObjIter.Key());
|
||||||
continue;
|
continue;
|
||||||
@ -442,14 +442,14 @@ void AIS_InteractiveContext::Display (const Handle(AIS_InteractiveObject)& theIO
|
|||||||
const Standard_Integer theDispMode,
|
const Standard_Integer theDispMode,
|
||||||
const Standard_Integer theSelectionMode,
|
const Standard_Integer theSelectionMode,
|
||||||
const Standard_Boolean theToUpdateViewer,
|
const Standard_Boolean theToUpdateViewer,
|
||||||
const AIS_DisplayStatus theDispStatus)
|
const PrsMgr_DisplayStatus theDispStatus)
|
||||||
{
|
{
|
||||||
if (theIObj.IsNull())
|
if (theIObj.IsNull())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theDispStatus == AIS_DS_Erased)
|
if (theDispStatus == PrsMgr_DisplayStatus_Erased)
|
||||||
{
|
{
|
||||||
Erase (theIObj, theToUpdateViewer);
|
Erase (theIObj, theToUpdateViewer);
|
||||||
Load (theIObj, theSelectionMode);
|
Load (theIObj, theSelectionMode);
|
||||||
@ -463,7 +463,7 @@ void AIS_InteractiveContext::Display (const Handle(AIS_InteractiveObject)& theIO
|
|||||||
setContextToObject (theIObj);
|
setContextToObject (theIObj);
|
||||||
if (!myObjects.IsBound (theIObj))
|
if (!myObjects.IsBound (theIObj))
|
||||||
{
|
{
|
||||||
setObjectStatus (theIObj, AIS_DS_Displayed, theDispMode, theSelectionMode);
|
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Displayed, theDispMode, theSelectionMode);
|
||||||
myMainVwr->StructureManager()->RegisterObject (theIObj);
|
myMainVwr->StructureManager()->RegisterObject (theIObj);
|
||||||
myMainPM->Display(theIObj, theDispMode);
|
myMainPM->Display(theIObj, theDispMode);
|
||||||
if (theSelectionMode != -1)
|
if (theSelectionMode != -1)
|
||||||
@ -495,8 +495,8 @@ void AIS_InteractiveContext::Display (const Handle(AIS_InteractiveObject)& theIO
|
|||||||
|
|
||||||
aStatus->SetDisplayMode (theDispMode);
|
aStatus->SetDisplayMode (theDispMode);
|
||||||
|
|
||||||
|
theIObj->SetDisplayStatus (PrsMgr_DisplayStatus_Displayed);
|
||||||
myMainPM->Display (theIObj, theDispMode);
|
myMainPM->Display (theIObj, theDispMode);
|
||||||
aStatus->SetGraphicStatus (AIS_DS_Displayed);
|
|
||||||
if (aStatus->IsHilighted())
|
if (aStatus->IsHilighted())
|
||||||
{
|
{
|
||||||
highlightGlobal (theIObj, aStatus->HilightStyle(), theDispMode);
|
highlightGlobal (theIObj, aStatus->HilightStyle(), theDispMode);
|
||||||
@ -540,7 +540,7 @@ void AIS_InteractiveContext::Load (const Handle(AIS_InteractiveObject)& theIObj,
|
|||||||
{
|
{
|
||||||
Standard_Integer aDispMode, aHiMod, aSelModeDef;
|
Standard_Integer aDispMode, aHiMod, aSelModeDef;
|
||||||
GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
|
GetDefModes (theIObj, aDispMode, aHiMod, aSelModeDef);
|
||||||
setObjectStatus (theIObj, AIS_DS_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
|
setObjectStatus (theIObj, PrsMgr_DisplayStatus_Erased, aDispMode, theSelMode != -1 ? theSelMode : aSelModeDef);
|
||||||
myMainVwr->StructureManager()->RegisterObject (theIObj);
|
myMainVwr->StructureManager()->RegisterObject (theIObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,7 +584,7 @@ void AIS_InteractiveContext::EraseAll (const Standard_Boolean theToUpdateViewer)
|
|||||||
{
|
{
|
||||||
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
||||||
{
|
{
|
||||||
if (anObjIter.Value()->GraphicStatus() == AIS_DS_Displayed)
|
if (anObjIter.Key()->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
Erase (anObjIter.Key(), Standard_False);
|
Erase (anObjIter.Key(), Standard_False);
|
||||||
}
|
}
|
||||||
@ -604,8 +604,8 @@ void AIS_InteractiveContext::DisplayAll (const Standard_Boolean theToUpdateViewe
|
|||||||
{
|
{
|
||||||
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjIter (myObjects); anObjIter.More(); anObjIter.Next())
|
||||||
{
|
{
|
||||||
const AIS_DisplayStatus aStatus = anObjIter.Value()->GraphicStatus();
|
const PrsMgr_DisplayStatus aStatus = anObjIter.Key()->DisplayStatus();
|
||||||
if (aStatus == AIS_DS_Erased)
|
if (aStatus == PrsMgr_DisplayStatus_Erased)
|
||||||
{
|
{
|
||||||
Display (anObjIter.Key(), Standard_False);
|
Display (anObjIter.Key(), Standard_False);
|
||||||
}
|
}
|
||||||
@ -659,14 +659,14 @@ void AIS_InteractiveContext::EraseSelected (const Standard_Boolean theToUpdateVi
|
|||||||
//function : DisplayStatus
|
//function : DisplayStatus
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
AIS_DisplayStatus AIS_InteractiveContext::DisplayStatus (const Handle(AIS_InteractiveObject)& theIObj) const
|
PrsMgr_DisplayStatus AIS_InteractiveContext::DisplayStatus (const Handle(AIS_InteractiveObject)& theIObj) const
|
||||||
{
|
{
|
||||||
if (theIObj.IsNull())
|
if (theIObj.IsNull())
|
||||||
{
|
{
|
||||||
return AIS_DS_None;
|
return PrsMgr_DisplayStatus_None;
|
||||||
}
|
}
|
||||||
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
||||||
return aStatus != NULL ? (*aStatus)->GraphicStatus() : AIS_DS_None;
|
return aStatus != NULL ? theIObj->DisplayStatus() : PrsMgr_DisplayStatus_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -729,7 +729,7 @@ void AIS_InteractiveContext::HilightWithColor(const Handle(AIS_InteractiveObject
|
|||||||
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theObj);
|
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theObj);
|
||||||
aStatus->SetHilightStatus (Standard_True);
|
aStatus->SetHilightStatus (Standard_True);
|
||||||
|
|
||||||
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
|
if (theObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
highlightGlobal (theObj, theStyle, aStatus->DisplayMode());
|
highlightGlobal (theObj, theStyle, aStatus->DisplayMode());
|
||||||
aStatus->SetHilightStyle (theStyle);
|
aStatus->SetHilightStyle (theStyle);
|
||||||
@ -743,21 +743,26 @@ void AIS_InteractiveContext::HilightWithColor(const Handle(AIS_InteractiveObject
|
|||||||
//function : Unhilight
|
//function : Unhilight
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_InteractiveContext::Unhilight(const Handle(AIS_InteractiveObject)& anIObj, const Standard_Boolean updateviewer)
|
void AIS_InteractiveContext::Unhilight (const Handle(AIS_InteractiveObject)& theObj,
|
||||||
|
const Standard_Boolean theToUpdateViewer)
|
||||||
{
|
{
|
||||||
if(anIObj.IsNull()) return;
|
Handle(AIS_GlobalStatus)* aStatus = !theObj.IsNull() ? myObjects.ChangeSeek (theObj) : NULL;
|
||||||
if(!myObjects.IsBound(anIObj)) return;
|
if (aStatus == NULL)
|
||||||
|
|
||||||
const Handle(AIS_GlobalStatus)& aStatus = myObjects(anIObj);
|
|
||||||
aStatus->SetHilightStatus (Standard_False);
|
|
||||||
aStatus->SetHilightStyle (Handle(Prs3d_Drawer)());
|
|
||||||
|
|
||||||
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
|
|
||||||
{
|
{
|
||||||
unhighlightGlobal (anIObj);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(updateviewer) myMainVwr->Update();
|
(*aStatus)->SetHilightStatus (Standard_False);
|
||||||
|
(*aStatus)->SetHilightStyle (Handle(Prs3d_Drawer)());
|
||||||
|
if (theObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
|
{
|
||||||
|
unhighlightGlobal (theObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (theToUpdateViewer)
|
||||||
|
{
|
||||||
|
myMainVwr->Update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -861,7 +866,7 @@ Standard_Boolean AIS_InteractiveContext::IsDisplayed(const Handle(AIS_Interactiv
|
|||||||
|
|
||||||
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theObj);
|
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theObj);
|
||||||
return aStatus != NULL
|
return aStatus != NULL
|
||||||
&& (*aStatus)->GraphicStatus() == AIS_DS_Displayed;
|
&& theObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -878,7 +883,7 @@ Standard_Boolean AIS_InteractiveContext::IsDisplayed (const Handle(AIS_Interacti
|
|||||||
|
|
||||||
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
||||||
return aStatus != NULL
|
return aStatus != NULL
|
||||||
&& (*aStatus)->GraphicStatus() == AIS_DS_Displayed
|
&& theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed
|
||||||
&& (*aStatus)->DisplayMode() == theMode;
|
&& (*aStatus)->DisplayMode() == theMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -895,8 +900,8 @@ Standard_Integer AIS_InteractiveContext::DisplayPriority (const Handle(AIS_Inter
|
|||||||
|
|
||||||
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
||||||
if (aStatus != NULL
|
if (aStatus != NULL
|
||||||
&& ((*aStatus)->GraphicStatus() == AIS_DS_Displayed
|
&& (theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed
|
||||||
|| (*aStatus)->GraphicStatus() == AIS_DS_Erased))
|
|| theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Erased))
|
||||||
{
|
{
|
||||||
Standard_Integer aDispMode = theIObj->HasDisplayMode()
|
Standard_Integer aDispMode = theIObj->HasDisplayMode()
|
||||||
? theIObj->DisplayMode()
|
? theIObj->DisplayMode()
|
||||||
@ -923,8 +928,8 @@ void AIS_InteractiveContext::SetDisplayPriority (const Handle(AIS_InteractiveObj
|
|||||||
setContextToObject (theIObj);
|
setContextToObject (theIObj);
|
||||||
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
||||||
if (aStatus != NULL
|
if (aStatus != NULL
|
||||||
&& ((*aStatus)->GraphicStatus() == AIS_DS_Displayed
|
&& (theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed
|
||||||
|| (*aStatus)->GraphicStatus() == AIS_DS_Erased))
|
|| theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Erased))
|
||||||
{
|
{
|
||||||
Standard_Integer aDisplayMode = theIObj->HasDisplayMode()
|
Standard_Integer aDisplayMode = theIObj->HasDisplayMode()
|
||||||
? theIObj->DisplayMode()
|
? theIObj->DisplayMode()
|
||||||
@ -965,7 +970,7 @@ void AIS_InteractiveContext::Redisplay (const AIS_KindOfInteractive theKOI,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Redisplay (anObj, Standard_False);
|
Redisplay (anObj, Standard_False);
|
||||||
isRedisplayed = anObjIter.Value()->GraphicStatus() == AIS_DS_Displayed
|
isRedisplayed = anObjIter.Key()->DisplayStatus() == PrsMgr_DisplayStatus_Displayed
|
||||||
|| isRedisplayed;
|
|| isRedisplayed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -998,7 +1003,7 @@ void AIS_InteractiveContext::RecomputePrsOnly (const Handle(AIS_InteractiveObjec
|
|||||||
|
|
||||||
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
||||||
if (aStatus != NULL
|
if (aStatus != NULL
|
||||||
&& (*aStatus)->GraphicStatus() == AIS_DS_Displayed)
|
&& theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
myMainVwr->Update();
|
myMainVwr->Update();
|
||||||
}
|
}
|
||||||
@ -1018,7 +1023,7 @@ void AIS_InteractiveContext::RecomputeSelectionOnly (const Handle(AIS_Interactiv
|
|||||||
|
|
||||||
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIO);
|
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIO);
|
||||||
if (aStatus == NULL
|
if (aStatus == NULL
|
||||||
|| (*aStatus)->GraphicStatus() != AIS_DS_Displayed)
|
|| theIO->DisplayStatus() != PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1051,7 +1056,7 @@ void AIS_InteractiveContext::Update (const Handle(AIS_InteractiveObject)& theIOb
|
|||||||
{
|
{
|
||||||
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
const Handle(AIS_GlobalStatus)* aStatus = myObjects.Seek (theIObj);
|
||||||
if (aStatus != NULL
|
if (aStatus != NULL
|
||||||
&& (*aStatus)->GraphicStatus() == AIS_DS_Displayed)
|
&& theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
myMainVwr->Update();
|
myMainVwr->Update();
|
||||||
}
|
}
|
||||||
@ -1202,7 +1207,7 @@ void AIS_InteractiveContext::SetDisplayMode(const Standard_Integer theMode,
|
|||||||
Handle(AIS_GlobalStatus) aStatus = anObjIter.Value();
|
Handle(AIS_GlobalStatus) aStatus = anObjIter.Value();
|
||||||
aStatus->SetDisplayMode (theMode);
|
aStatus->SetDisplayMode (theMode);
|
||||||
|
|
||||||
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
|
if (anObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
myMainPM->Display (anObj, theMode);
|
myMainPM->Display (anObj, theMode);
|
||||||
if (!myLastPicked.IsNull() && myLastPicked->IsSameSelectable (anObj))
|
if (!myLastPicked.IsNull() && myLastPicked->IsSameSelectable (anObj))
|
||||||
@ -1246,7 +1251,7 @@ void AIS_InteractiveContext::SetDisplayMode (const Handle(AIS_InteractiveObject)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
|
Handle(AIS_GlobalStatus) aStatus = myObjects (theIObj);
|
||||||
if (aStatus->GraphicStatus() != AIS_DS_Displayed)
|
if (theIObj->DisplayStatus() != PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
aStatus->SetDisplayMode (theMode);
|
aStatus->SetDisplayMode (theMode);
|
||||||
theIObj->SetDisplayMode (theMode);
|
theIObj->SetDisplayMode (theMode);
|
||||||
@ -1311,7 +1316,7 @@ void AIS_InteractiveContext::UnsetDisplayMode (const Handle(AIS_InteractiveObjec
|
|||||||
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theIObj);
|
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theIObj);
|
||||||
aStatus->SetDisplayMode (myDefaultDrawer->DisplayMode());
|
aStatus->SetDisplayMode (myDefaultDrawer->DisplayMode());
|
||||||
|
|
||||||
if (aStatus->GraphicStatus() == AIS_DS_Displayed)
|
if (theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
if (myMainPM->IsHighlighted (theIObj, anOldMode))
|
if (myMainPM->IsHighlighted (theIObj, anOldMode))
|
||||||
{
|
{
|
||||||
@ -1763,14 +1768,14 @@ void AIS_InteractiveContext::Status (const Handle(AIS_InteractiveObject)& theIOb
|
|||||||
theStatus += "\t ____________________________________________";
|
theStatus += "\t ____________________________________________";
|
||||||
theStatus += "\t| Known at Neutral Point:\n\tDisplayStatus:";
|
theStatus += "\t| Known at Neutral Point:\n\tDisplayStatus:";
|
||||||
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theIObj);
|
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theIObj);
|
||||||
switch (aStatus->GraphicStatus())
|
switch (theIObj->DisplayStatus())
|
||||||
{
|
{
|
||||||
case AIS_DS_Displayed:
|
case PrsMgr_DisplayStatus_Displayed:
|
||||||
{
|
{
|
||||||
theStatus += "\t| -->Displayed\n";
|
theStatus += "\t| -->Displayed\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AIS_DS_Erased:
|
case PrsMgr_DisplayStatus_Erased:
|
||||||
{
|
{
|
||||||
theStatus += "\t| -->Erased\n";
|
theStatus += "\t| -->Erased\n";
|
||||||
break;
|
break;
|
||||||
@ -1829,7 +1834,7 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
Handle(AIS_GlobalStatus) aStatus;
|
Handle(AIS_GlobalStatus) aStatus;
|
||||||
if (theIObj.IsNull()
|
if (theIObj.IsNull()
|
||||||
|| !myObjects.Find (theIObj, aStatus)
|
|| !myObjects.Find (theIObj, aStatus)
|
||||||
|| aStatus->GraphicStatus() == AIS_DS_Erased)
|
|| theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Erased)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1858,7 +1863,7 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
mgrSelector->Deactivate (theIObj, aSelModeIter.Value());
|
mgrSelector->Deactivate (theIObj, aSelModeIter.Value());
|
||||||
}
|
}
|
||||||
aStatus->ClearSelectionModes();
|
aStatus->ClearSelectionModes();
|
||||||
aStatus->SetGraphicStatus (AIS_DS_Erased);
|
theIObj->SetDisplayStatus (PrsMgr_DisplayStatus_Erased);
|
||||||
|
|
||||||
if (theToUpdateviewer)
|
if (theToUpdateviewer)
|
||||||
{
|
{
|
||||||
@ -1944,7 +1949,7 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
const Handle(SelectMgr_SelectableObject)& anObj = theIObj; // to avoid ambiguity
|
const Handle(SelectMgr_SelectableObject)& anObj = theIObj; // to avoid ambiguity
|
||||||
mgrSelector->Remove (anObj);
|
mgrSelector->Remove (anObj);
|
||||||
|
|
||||||
setObjectStatus (theIObj, AIS_DS_None, -1, -1);
|
setObjectStatus (theIObj, PrsMgr_DisplayStatus_None, -1, -1);
|
||||||
myMainVwr->StructureManager()->UnregisterObject (theIObj);
|
myMainVwr->StructureManager()->UnregisterObject (theIObj);
|
||||||
|
|
||||||
for (V3d_ListOfViewIterator aDefViewIter (myMainVwr->DefinedViewIterator()); aDefViewIter.More(); aDefViewIter.Next())
|
for (V3d_ListOfViewIterator aDefViewIter (myMainVwr->DefinedViewIterator()); aDefViewIter.More(); aDefViewIter.Next())
|
||||||
@ -1961,7 +1966,8 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theToUpdateviewer && aStatus->GraphicStatus() == AIS_DS_Displayed)
|
if (theToUpdateviewer
|
||||||
|
&& theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
myMainVwr->Update();
|
myMainVwr->Update();
|
||||||
}
|
}
|
||||||
@ -1975,14 +1981,13 @@ void AIS_InteractiveContext::ClearGlobalPrs (const Handle(AIS_InteractiveObject)
|
|||||||
const Standard_Integer theMode,
|
const Standard_Integer theMode,
|
||||||
const Standard_Boolean theToUpdateViewer)
|
const Standard_Boolean theToUpdateViewer)
|
||||||
{
|
{
|
||||||
if (theIObj.IsNull()
|
const Handle(AIS_GlobalStatus)* aStatus = !theIObj.IsNull() ? myObjects.Seek (theIObj) : NULL;
|
||||||
|| !myObjects.IsBound (theIObj))
|
if (aStatus == NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Handle(AIS_GlobalStatus)& aStatus = myObjects (theIObj);
|
if ((*aStatus)->DisplayMode() == theMode)
|
||||||
if (aStatus->DisplayMode() == theMode)
|
|
||||||
{
|
{
|
||||||
const Standard_Integer aDispMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
|
const Standard_Integer aDispMode = theIObj->HasHilightMode() ? theIObj->HilightMode() : 0;
|
||||||
if (aDispMode == theMode
|
if (aDispMode == theMode
|
||||||
@ -1994,7 +1999,7 @@ void AIS_InteractiveContext::ClearGlobalPrs (const Handle(AIS_InteractiveObject)
|
|||||||
myMainPM->Erase (theIObj, theMode);
|
myMainPM->Erase (theIObj, theMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aStatus->GraphicStatus() == AIS_DS_Displayed
|
if (theIObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed
|
||||||
&& theToUpdateViewer)
|
&& theToUpdateViewer)
|
||||||
{
|
{
|
||||||
myMainVwr->Update();
|
myMainVwr->Update();
|
||||||
@ -2429,28 +2434,34 @@ gp_Pnt AIS_InteractiveContext::GravityPoint (const Handle(V3d_View)& theView) co
|
|||||||
{
|
{
|
||||||
return theView->GravityPoint();
|
return theView->GravityPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : setObjectStatus
|
//function : setObjectStatus
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_InteractiveContext::setObjectStatus (const Handle(AIS_InteractiveObject)& theIObj,
|
void AIS_InteractiveContext::setObjectStatus (const Handle(AIS_InteractiveObject)& theIObj,
|
||||||
const AIS_DisplayStatus theStatus,
|
const PrsMgr_DisplayStatus theStatus,
|
||||||
const Standard_Integer theDispMode,
|
const Standard_Integer theDispMode,
|
||||||
const Standard_Integer theSelectionMode)
|
const Standard_Integer theSelectionMode)
|
||||||
{
|
{
|
||||||
if (theStatus != AIS_DS_None)
|
theIObj->SetDisplayStatus (theStatus);
|
||||||
|
if (theStatus != PrsMgr_DisplayStatus_None)
|
||||||
{
|
{
|
||||||
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (AIS_DS_Displayed, theDispMode, theSelectionMode);
|
Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (theDispMode, theSelectionMode);
|
||||||
myObjects.Bind (theIObj, aStatus);
|
myObjects.Bind (theIObj, aStatus);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
myObjects.UnBind (theIObj);
|
myObjects.UnBind (theIObj);
|
||||||
|
}
|
||||||
|
|
||||||
for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (theIObj->Children()); aPrsIter.More(); aPrsIter.Next())
|
for (PrsMgr_ListOfPresentableObjectsIter aPrsIter (theIObj->Children()); aPrsIter.More(); aPrsIter.Next())
|
||||||
{
|
{
|
||||||
Handle(AIS_InteractiveObject) aChild (Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value()));
|
Handle(AIS_InteractiveObject) aChild (Handle(AIS_InteractiveObject)::DownCast (aPrsIter.Value()));
|
||||||
if (aChild.IsNull())
|
if (aChild.IsNull())
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
setObjectStatus (aChild, theStatus, theDispMode, theSelectionMode);
|
setObjectStatus (aChild, theStatus, theDispMode, theSelectionMode);
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ public: //! @name object display management
|
|||||||
//! - AIS_DS_Erased hidden in main viewer
|
//! - AIS_DS_Erased hidden in main viewer
|
||||||
//! - AIS_DS_Temporary temporarily displayed
|
//! - AIS_DS_Temporary temporarily displayed
|
||||||
//! - AIS_DS_None nowhere displayed.
|
//! - AIS_DS_None nowhere displayed.
|
||||||
Standard_EXPORT AIS_DisplayStatus DisplayStatus (const Handle(AIS_InteractiveObject)& anIobj) const;
|
Standard_EXPORT PrsMgr_DisplayStatus DisplayStatus (const Handle(AIS_InteractiveObject)& anIobj) const;
|
||||||
|
|
||||||
//! Returns the status of the Interactive Context for the view of the Interactive Object.
|
//! Returns the status of the Interactive Context for the view of the Interactive Object.
|
||||||
Standard_EXPORT void Status (const Handle(AIS_InteractiveObject)& anObj, TCollection_ExtendedString& astatus) const;
|
Standard_EXPORT void Status (const Handle(AIS_InteractiveObject)& anObj, TCollection_ExtendedString& astatus) const;
|
||||||
@ -112,7 +112,7 @@ public: //! @name object display management
|
|||||||
const Standard_Integer theDispMode,
|
const Standard_Integer theDispMode,
|
||||||
const Standard_Integer theSelectionMode,
|
const Standard_Integer theSelectionMode,
|
||||||
const Standard_Boolean theToUpdateViewer,
|
const Standard_Boolean theToUpdateViewer,
|
||||||
const AIS_DisplayStatus theDispStatus = AIS_DS_None);
|
const PrsMgr_DisplayStatus theDispStatus = PrsMgr_DisplayStatus_None);
|
||||||
|
|
||||||
//! Allows you to load the Interactive Object with a given selection mode,
|
//! Allows you to load the Interactive Object with a given selection mode,
|
||||||
//! and/or with the desired decomposition option, whether the object is visualized or not.
|
//! and/or with the desired decomposition option, whether the object is visualized or not.
|
||||||
@ -125,7 +125,7 @@ public: //! @name object display management
|
|||||||
const Standard_Integer theSelectionMode,
|
const Standard_Integer theSelectionMode,
|
||||||
const Standard_Boolean theToUpdateViewer,
|
const Standard_Boolean theToUpdateViewer,
|
||||||
const Standard_Boolean theToAllowDecomposition,
|
const Standard_Boolean theToAllowDecomposition,
|
||||||
const AIS_DisplayStatus theDispStatus = AIS_DS_None)
|
const PrsMgr_DisplayStatus theDispStatus = PrsMgr_DisplayStatus_None)
|
||||||
{
|
{
|
||||||
(void )theToAllowDecomposition;
|
(void )theToAllowDecomposition;
|
||||||
Display (theIObj, theDispMode, theSelectionMode, theToUpdateViewer, theDispStatus);
|
Display (theIObj, theDispMode, theSelectionMode, theToUpdateViewer, theDispStatus);
|
||||||
@ -861,11 +861,14 @@ public: //! @name common properties
|
|||||||
|
|
||||||
//! Returns the list theListOfIO of objects with indicated display status particular Type WhichKind and Signature WhichSignature.
|
//! Returns the list theListOfIO of objects with indicated display status particular Type WhichKind and Signature WhichSignature.
|
||||||
//! By Default, WhichSignature equals 1. This means that there is a check on type only.
|
//! By Default, WhichSignature equals 1. This means that there is a check on type only.
|
||||||
Standard_EXPORT void ObjectsByDisplayStatus (const AIS_DisplayStatus theStatus, AIS_ListOfInteractive& theListOfIO) const;
|
Standard_EXPORT void ObjectsByDisplayStatus (const PrsMgr_DisplayStatus theStatus, AIS_ListOfInteractive& theListOfIO) const;
|
||||||
|
|
||||||
//! gives the list of objects with indicated display status
|
//! gives the list of objects with indicated display status
|
||||||
//! Type and signature by Default, <WhichSignature> = -1 means control only on <WhichKind>.
|
//! Type and signature by Default, <WhichSignature> = -1 means control only on <WhichKind>.
|
||||||
Standard_EXPORT void ObjectsByDisplayStatus (const AIS_KindOfInteractive WhichKind, const Standard_Integer WhichSignature, const AIS_DisplayStatus theStatus, AIS_ListOfInteractive& theListOfIO) const;
|
Standard_EXPORT void ObjectsByDisplayStatus (const AIS_KindOfInteractive WhichKind,
|
||||||
|
const Standard_Integer WhichSignature,
|
||||||
|
const PrsMgr_DisplayStatus theStatus,
|
||||||
|
AIS_ListOfInteractive& theListOfIO) const;
|
||||||
|
|
||||||
//! fills <aListOfIO> with objects of a particular Type and Signature with no consideration of display status.
|
//! fills <aListOfIO> with objects of a particular Type and Signature with no consideration of display status.
|
||||||
//! by Default, <WhichSignature> = -1 means control only on <WhichKind>.
|
//! by Default, <WhichSignature> = -1 means control only on <WhichKind>.
|
||||||
@ -881,7 +884,10 @@ public: //! @name common properties
|
|||||||
Standard_EXPORT void Disconnect (const Handle(AIS_InteractiveObject)& theAssembly, const Handle(AIS_InteractiveObject)& theObjToDisconnect = NULL);
|
Standard_EXPORT void Disconnect (const Handle(AIS_InteractiveObject)& theAssembly, const Handle(AIS_InteractiveObject)& theObjToDisconnect = NULL);
|
||||||
|
|
||||||
//! Query objects visible or hidden in specified view due to affinity mask.
|
//! Query objects visible or hidden in specified view due to affinity mask.
|
||||||
Standard_EXPORT void ObjectsForView (AIS_ListOfInteractive& theListOfIO, const Handle(V3d_View)& theView, const Standard_Boolean theIsVisibleInView, const AIS_DisplayStatus theStatus = AIS_DS_None) const;
|
Standard_EXPORT void ObjectsForView (AIS_ListOfInteractive& theListOfIO,
|
||||||
|
const Handle(V3d_View)& theView,
|
||||||
|
const Standard_Boolean theIsVisibleInView,
|
||||||
|
const PrsMgr_DisplayStatus theStatus = PrsMgr_DisplayStatus_None) const;
|
||||||
|
|
||||||
//! Clears all the structures which don't belong to objects displayed at neutral point
|
//! Clears all the structures which don't belong to objects displayed at neutral point
|
||||||
//! only effective when no Local Context is opened...
|
//! only effective when no Local Context is opened...
|
||||||
@ -1399,7 +1405,7 @@ protected: //! @name internal methods
|
|||||||
//! @param theObj [in] the object to change status
|
//! @param theObj [in] the object to change status
|
||||||
//! @param theStatus status, if NULL, unbind object
|
//! @param theStatus status, if NULL, unbind object
|
||||||
Standard_EXPORT void setObjectStatus (const Handle(AIS_InteractiveObject)& theIObj,
|
Standard_EXPORT void setObjectStatus (const Handle(AIS_InteractiveObject)& theIObj,
|
||||||
const AIS_DisplayStatus theStatus,
|
const PrsMgr_DisplayStatus theStatus,
|
||||||
const Standard_Integer theDispyMode,
|
const Standard_Integer theDispyMode,
|
||||||
const Standard_Integer theSelectionMode);
|
const Standard_Integer theSelectionMode);
|
||||||
|
|
||||||
|
@ -248,8 +248,10 @@ void AIS_InteractiveContext::turnOnSubintensity (const Handle(AIS_InteractiveObj
|
|||||||
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjsIter (myObjects); anObjsIter.More(); anObjsIter.Next())
|
for (AIS_DataMapIteratorOfDataMapOfIOStatus anObjsIter (myObjects); anObjsIter.More(); anObjsIter.Next())
|
||||||
{
|
{
|
||||||
const Handle(AIS_GlobalStatus)& aStatus = anObjsIter.Value();
|
const Handle(AIS_GlobalStatus)& aStatus = anObjsIter.Value();
|
||||||
if (aStatus->GraphicStatus() != AIS_DS_Displayed && theIsDisplayedOnly)
|
if (theObject->DisplayStatus() != PrsMgr_DisplayStatus_Displayed && theIsDisplayedOnly)
|
||||||
|
{
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
aStatus->SubIntensityOn();
|
aStatus->SubIntensityOn();
|
||||||
myMainPM->Color (anObjsIter.Key(), aSubStyle, theDispMode != -1 ? theDispMode : aStatus->DisplayMode());
|
myMainPM->Color (anObjsIter.Key(), aSubStyle, theDispMode != -1 ? theDispMode : aStatus->DisplayMode());
|
||||||
@ -259,10 +261,14 @@ void AIS_InteractiveContext::turnOnSubintensity (const Handle(AIS_InteractiveObj
|
|||||||
{
|
{
|
||||||
Handle(AIS_GlobalStatus) aStatus;
|
Handle(AIS_GlobalStatus) aStatus;
|
||||||
if (!myObjects.Find (theObject, aStatus))
|
if (!myObjects.Find (theObject, aStatus))
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (aStatus->GraphicStatus() != AIS_DS_Displayed && theIsDisplayedOnly)
|
if (theObject->DisplayStatus() != PrsMgr_DisplayStatus_Displayed && theIsDisplayedOnly)
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
aStatus->SubIntensityOn();
|
aStatus->SubIntensityOn();
|
||||||
myMainPM->Color (theObject, aSubStyle, theDispMode != -1 ? theDispMode : aStatus->DisplayMode());
|
myMainPM->Color (theObject, aSubStyle, theDispMode != -1 ? theDispMode : aStatus->DisplayMode());
|
||||||
|
@ -66,7 +66,7 @@ void AIS_InteractiveContext::SetSelectionModeActive (const Handle(AIS_Interactiv
|
|||||||
|| (theMode == -1
|
|| (theMode == -1
|
||||||
&& theActiveFilter == AIS_SelectionModesConcurrency_Single))
|
&& theActiveFilter == AIS_SelectionModesConcurrency_Single))
|
||||||
{
|
{
|
||||||
if ((*aStat)->GraphicStatus() == AIS_DS_Displayed
|
if (theObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed
|
||||||
|| theIsForce)
|
|| theIsForce)
|
||||||
{
|
{
|
||||||
if (theMode == -1)
|
if (theMode == -1)
|
||||||
@ -103,7 +103,7 @@ void AIS_InteractiveContext::SetSelectionModeActive (const Handle(AIS_Interactiv
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*aStat)->GraphicStatus() == AIS_DS_Displayed
|
if (theObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed
|
||||||
|| theIsForce)
|
|| theIsForce)
|
||||||
{
|
{
|
||||||
switch (theActiveFilter)
|
switch (theActiveFilter)
|
||||||
@ -247,7 +247,7 @@ void AIS_InteractiveContext::SubIntensityOff (const Handle(AIS_InteractiveObject
|
|||||||
|
|
||||||
(*aStatus)->SubIntensityOff();
|
(*aStatus)->SubIntensityOff();
|
||||||
Standard_Boolean toUpdateMain = Standard_False;
|
Standard_Boolean toUpdateMain = Standard_False;
|
||||||
if ((*aStatus)->GraphicStatus() == AIS_DS_Displayed)
|
if (theObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
{
|
{
|
||||||
myMainPM->Unhighlight (theObj);
|
myMainPM->Unhighlight (theObj);
|
||||||
toUpdateMain = Standard_True;
|
toUpdateMain = Standard_True;
|
||||||
|
@ -52,12 +52,11 @@ void AIS_InteractiveContext::SetPolygonOffsets(
|
|||||||
setContextToObject (anObj);
|
setContextToObject (anObj);
|
||||||
anObj->SetPolygonOffsets( aMode, aFactor, aUnits );
|
anObj->SetPolygonOffsets( aMode, aFactor, aUnits );
|
||||||
|
|
||||||
if ( updateviewer ) {
|
const Handle(AIS_GlobalStatus)* aStatus = updateviewer ? myObjects.Seek (anObj) : NULL;
|
||||||
if( myObjects.IsBound( anObj ) ) {
|
if (aStatus != NULL
|
||||||
Handle(AIS_GlobalStatus) STATUS = myObjects(anObj);
|
&& anObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
|
||||||
if ( STATUS->GraphicStatus() == AIS_DS_Displayed )
|
{
|
||||||
myMainVwr->Update();
|
myMainVwr->Update();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +97,15 @@ void AIS_InteractiveObject::SetContext (const Handle(AIS_InteractiveContext)& th
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : SetDisplayStatus
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void AIS_InteractiveObject::SetDisplayStatus (PrsMgr_DisplayStatus theStatus)
|
||||||
|
{
|
||||||
|
myDisplayStatus = theStatus;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : HasPresentation
|
//function : HasPresentation
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@ -143,6 +143,9 @@ protected:
|
|||||||
//! may have a presentation dependant of the view of Display.
|
//! may have a presentation dependant of the view of Display.
|
||||||
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
Standard_EXPORT AIS_InteractiveObject(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
||||||
|
|
||||||
|
//! Set presentation display status.
|
||||||
|
Standard_EXPORT void SetDisplayStatus (PrsMgr_DisplayStatus theStatus);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
AIS_InteractiveContext* myCTXPtr; //!< pointer to Interactive Context, where object is currently displayed; @sa SetContext()
|
AIS_InteractiveContext* myCTXPtr; //!< pointer to Interactive Context, where object is currently displayed; @sa SetContext()
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
PrsMgr_DisplayStatus.hxx
|
||||||
PrsMgr_ListOfPresentableObjects.hxx
|
PrsMgr_ListOfPresentableObjects.hxx
|
||||||
PrsMgr_ListOfPresentations.hxx
|
PrsMgr_ListOfPresentations.hxx
|
||||||
PrsMgr_PresentableObject.cxx
|
PrsMgr_PresentableObject.cxx
|
||||||
|
32
src/PrsMgr/PrsMgr_DisplayStatus.hxx
Normal file
32
src/PrsMgr/PrsMgr_DisplayStatus.hxx
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// Created on: 1996-12-11
|
||||||
|
// Created by: Robert COUBLANC
|
||||||
|
// Copyright (c) 1996-1999 Matra Datavision
|
||||||
|
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// This file is part of Open CASCADE Technology software library.
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or modify it under
|
||||||
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||||
|
// by the Free Software Foundation, with special exception defined in the file
|
||||||
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||||
|
// distribution for complete text of the license and disclaimer of any warranty.
|
||||||
|
//
|
||||||
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
|
#ifndef _PrsMgr_DisplayStatus_HeaderFile
|
||||||
|
#define _PrsMgr_DisplayStatus_HeaderFile
|
||||||
|
|
||||||
|
//! To give the display status of an Interactive Object.
|
||||||
|
enum PrsMgr_DisplayStatus
|
||||||
|
{
|
||||||
|
PrsMgr_DisplayStatus_Displayed, //!< the Interactive Object is displayed in the main viewer
|
||||||
|
PrsMgr_DisplayStatus_Erased, //!< the Interactive Object is hidden in main viewer
|
||||||
|
PrsMgr_DisplayStatus_None, //!< the Interactive Object is nowhere displayed
|
||||||
|
// old aliases
|
||||||
|
AIS_DS_Displayed = PrsMgr_DisplayStatus_Displayed,
|
||||||
|
AIS_DS_Erased = PrsMgr_DisplayStatus_Erased,
|
||||||
|
AIS_DS_None = PrsMgr_DisplayStatus_None
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _PrsMgr_DisplayStatus_HeaderFile
|
@ -47,6 +47,7 @@ PrsMgr_PresentableObject::PrsMgr_PresentableObject (const PrsMgr_TypeOfPresentat
|
|||||||
: myParent (NULL),
|
: myParent (NULL),
|
||||||
myDrawer (new Prs3d_Drawer()),
|
myDrawer (new Prs3d_Drawer()),
|
||||||
myTypeOfPresentation3d (theType),
|
myTypeOfPresentation3d (theType),
|
||||||
|
myDisplayStatus (PrsMgr_DisplayStatus_None),
|
||||||
//
|
//
|
||||||
myCurrentFacingModel (Aspect_TOFM_BOTH_SIDE),
|
myCurrentFacingModel (Aspect_TOFM_BOTH_SIDE),
|
||||||
myOwnWidth (0.0f),
|
myOwnWidth (0.0f),
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <PrsMgr_ListOfPresentableObjects.hxx>
|
#include <PrsMgr_ListOfPresentableObjects.hxx>
|
||||||
#include <PrsMgr_Presentation.hxx>
|
#include <PrsMgr_Presentation.hxx>
|
||||||
#include <PrsMgr_Presentations.hxx>
|
#include <PrsMgr_Presentations.hxx>
|
||||||
|
#include <PrsMgr_DisplayStatus.hxx>
|
||||||
#include <PrsMgr_TypeOfPresentation3d.hxx>
|
#include <PrsMgr_TypeOfPresentation3d.hxx>
|
||||||
#include <TColStd_ListOfInteger.hxx>
|
#include <TColStd_ListOfInteger.hxx>
|
||||||
|
|
||||||
@ -161,6 +162,9 @@ public:
|
|||||||
//! Set type of presentation.
|
//! Set type of presentation.
|
||||||
Standard_EXPORT void SetTypeOfPresentation (const PrsMgr_TypeOfPresentation3d theType);
|
Standard_EXPORT void SetTypeOfPresentation (const PrsMgr_TypeOfPresentation3d theType);
|
||||||
|
|
||||||
|
//! Return presentation display status; PrsMgr_DisplayStatus_None by default.
|
||||||
|
PrsMgr_DisplayStatus DisplayStatus() const { return myDisplayStatus; }
|
||||||
|
|
||||||
public: //! @name presentation attributes
|
public: //! @name presentation attributes
|
||||||
|
|
||||||
//! Returns the attributes settings.
|
//! Returns the attributes settings.
|
||||||
@ -522,6 +526,7 @@ protected:
|
|||||||
PrsMgr_ListOfPresentableObjects myChildren; //!< list of children
|
PrsMgr_ListOfPresentableObjects myChildren; //!< list of children
|
||||||
gp_GTrsf myInvTransformation; //!< inversion of absolute transformation (combined parents + local transformations)
|
gp_GTrsf myInvTransformation; //!< inversion of absolute transformation (combined parents + local transformations)
|
||||||
PrsMgr_TypeOfPresentation3d myTypeOfPresentation3d; //!< presentation type
|
PrsMgr_TypeOfPresentation3d myTypeOfPresentation3d; //!< presentation type
|
||||||
|
PrsMgr_DisplayStatus myDisplayStatus; //!< presentation display status
|
||||||
|
|
||||||
Aspect_TypeOfFacingModel myCurrentFacingModel; //!< current facing model
|
Aspect_TypeOfFacingModel myCurrentFacingModel; //!< current facing model
|
||||||
Standard_ShortReal myOwnWidth; //!< custom width value
|
Standard_ShortReal myOwnWidth; //!< custom width value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user