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

0023654: Problem with displaying vertices in OCC view after closing all OCC views and opening new one

Fixed graphic structure recompute after closing view.
Removed collector and all corresponding logic and methods from AIS_InteractiveContext.
Method AIS_InteractiveContext::Erase() now hide object from viewer without deleting resources.
Erased objects now properly recomputed after closing view.
Samples update
Removed useless method AIS_InteractiveContext::EraseMode()
Documentation update
Warnings fix
Regressions fix
This commit is contained in:
dbv
2013-10-03 14:11:13 +04:00
committed by bugmaster
parent 3ed30348aa
commit eb4320f2d9
45 changed files with 826 additions and 1256 deletions

View File

@@ -295,6 +295,7 @@ fields
myTransformPersistence : CTransPersStruct from Graphic3d;
friends
class Presentation3d from PrsMgr,
class PresentationManager from PrsMgr,
Compute from Presentation3d from PrsMgr(me : mutable; aProjector : DataStructureManager from Graphic3d),
Compute from Presentation3d from PrsMgr(me : mutable; aProjector : DataStructureManager from Graphic3d;

View File

@@ -40,7 +40,9 @@ is
Display(me: mutable) is deferred private;
Erase(me) is deferred private;
SetVisible (me: mutable; theValue: Boolean from Standard) is deferred private;
Highlight(me: mutable) is deferred private;
Unhighlight (me) is deferred private;

View File

@@ -54,8 +54,17 @@ is
Display(me: mutable)
is redefined static private;
Erase(me) is redefined static private;
Display (me: mutable;
theIsHighlight: Boolean from Standard)
is static private;
---Level: Private;
---Purpose: displays myStructure and sets myDisplayReason to theIsHighlight value if
-- myStructure was not displayed or was invisible
Erase(me) is redefined static private;
SetVisible (me: mutable; theValue: Boolean from Standard) is redefined static private;
Highlight(me: mutable) is redefined static private;
Unhighlight (me) is redefined static private;
@@ -126,6 +135,9 @@ is
---Category: Computed Structures
Compute(me : mutable; theStructure: Structure from Graphic3d)
is static private;
Compute(me : mutable; aProjector: DataStructureManager from Graphic3d)
returns Structure from Graphic3d
is static private;

View File

@@ -27,6 +27,7 @@
#include <PrsMgr_Presentation3d.ixx>
#include <PrsMgr_PresentationManager.hxx>
#include <PrsMgr_Prs.hxx>
#include <PrsMgr_ModedPresentation.hxx>
#include <Visual3d_View.hxx>
#include <Visual3d_ViewOrientation.hxx>
#include <Graphic3d_Structure.hxx>
@@ -47,24 +48,41 @@ PrsMgr_KindOfPrs PrsMgr_Presentation3d::KindOfPresentation() const
{return PrsMgr_KOP_3D;}
void PrsMgr_Presentation3d::Display () {
myStructure->Display();
void PrsMgr_Presentation3d::Display()
{
Display (Standard_False);
myDisplayReason = Standard_False;
}
void PrsMgr_Presentation3d::Display(const Standard_Boolean theIsHighlight)
{
if (!myStructure->IsDisplayed())
{
myStructure->Display();
myDisplayReason = theIsHighlight;
}
else if (!myStructure->IsVisible())
{
myStructure->SetVisible (Standard_True);
myDisplayReason = theIsHighlight;
}
}
void PrsMgr_Presentation3d::Erase () const {
myStructure->Erase();}
void PrsMgr_Presentation3d::SetVisible (const Standard_Boolean theValue)
{
myStructure->SetVisible (theValue);
}
void PrsMgr_Presentation3d::Highlight () {
if(!myStructure->IsDisplayed()) {
myStructure->Display();
myDisplayReason = Standard_True;
}
Display (Standard_True);
myStructure->Highlight();}
void PrsMgr_Presentation3d::Unhighlight () const {
myStructure->UnHighlight();
if(myDisplayReason) myStructure->Erase();
if (myDisplayReason) myStructure->SetVisible (Standard_False);
}
void PrsMgr_Presentation3d::Clear() {
@@ -81,13 +99,7 @@ void PrsMgr_Presentation3d::Clear() {
}
void PrsMgr_Presentation3d::Color(const Quantity_NameOfColor aColor){
Standard_Boolean ImmMode = myPresentationManager->IsImmediateModeOn();
if(!ImmMode){
if(!myStructure->IsDisplayed()) {
myStructure->Display();
myDisplayReason = Standard_True;
}
}
Display (Standard_True);
myStructure->Color(aColor);
}
@@ -96,7 +108,7 @@ void PrsMgr_Presentation3d::BoundBox() const {
}
Standard_Boolean PrsMgr_Presentation3d::IsDisplayed () const {
return myStructure->IsDisplayed() && !myDisplayReason;
return myStructure->IsDisplayed() && myStructure->IsVisible() && !myDisplayReason;
}
Standard_Boolean PrsMgr_Presentation3d::IsHighlighted () const {
@@ -167,6 +179,36 @@ Compute(const Handle(Graphic3d_DataStructureManager)& aProjector)
//purpose :
//=======================================================================
void PrsMgr_Presentation3d::Compute (const Handle(Graphic3d_Structure)& theStructure)
{
Standard_Integer aDispMode = 0;
Standard_Integer aPresentationsNumber = myPresentableObject->myPresentations.Length();
for (Standard_Integer anIter = 1; anIter <= aPresentationsNumber; anIter++)
{
const PrsMgr_ModedPresentation& aModedPresentation = myPresentableObject->myPresentations.Value (anIter);
Handle(PrsMgr_Presentation) aPresentation = aModedPresentation.Presentation();
PrsMgr_Presentation3d* aPresentation3d = (PrsMgr_Presentation3d* )aPresentation.operator->();
if (aPresentation3d == this)
{
aDispMode = aModedPresentation.Mode();
break;
}
}
Handle(Prs3d_Presentation) aPrs3d = Handle(Prs3d_Presentation)::DownCast (theStructure);
myPresentableObject->Compute(
Handle(PrsMgr_PresentationManager3d)::DownCast (PresentationManager()),
aPrs3d,
aDispMode);
}
//=======================================================================
//function : Compute
//purpose :
//=======================================================================
void PrsMgr_Presentation3d::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector,
const Handle(Graphic3d_Structure)& TheStructToFill)
{

View File

@@ -65,6 +65,11 @@ is
-- aPresentableObject in this framework with the
-- display mode aMode.
SetVisibility (me: mutable; thePresentableObject: PresentableObject from PrsMgr;
theMode: Integer from Standard;
theValue: Boolean from Standard);
---Purpose: Sets the visibility of presentable object.
Highlight(me: mutable; aPresentableObject: mutable PresentableObject from PrsMgr;
aMode: Integer from Standard = 0)
---Purpose: Highlights the presentation of the presentable object

View File

@@ -66,6 +66,12 @@ void PrsMgr_PresentationManager::Clear(const Handle(PrsMgr_PresentableObject)& a
Presentation(aPresentableObject,aMode)->Clear();}
}
void PrsMgr_PresentationManager::SetVisibility (const Handle(PrsMgr_PresentableObject)& thePresentableObject,
const Standard_Integer theMode,
const Standard_Boolean theValue)
{
Presentation(thePresentableObject, theMode)->SetVisible (theValue);
}
void PrsMgr_PresentationManager::Highlight(
const Handle(PrsMgr_PresentableObject)& aPresentableObject,

View File

@@ -36,7 +36,10 @@ is
aPresentation : Presentation3dPointer from PrsMgr;
aTypeOfPresentation3d : TypeOfPresentation3d from PrsMgr)
returns mutable Prs from PrsMgr;
Compute (me: mutable)
is redefined static;
Compute(me : mutable; aProjector: DataStructureManager from Graphic3d)
returns Structure from Graphic3d
is redefined static;

View File

@@ -37,6 +37,16 @@ PrsMgr_Prs::PrsMgr_Prs (const Handle(Graphic3d_StructureManager)& aStructureMana
//purpose :
//=======================================================================
void PrsMgr_Prs::Compute()
{
myPresentation3d->Compute (this);
}
//=======================================================================
//function : Compute
//purpose :
//=======================================================================
Handle(Graphic3d_Structure) PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector) {
return myPresentation3d->Compute(aProjector);
}