1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0031431: Visualization, PrsMgr_PresentableObject - simplify HLR computing interface

Multiple PrsMgr_PresentableObject::Compute() methods have been replaced by single one
PrsMgr_PresentableObject::computeHLR().
Dummy implementations of previously declared methods have been removed
from AIS classes not implementng HLR presentation.
Class Prs3d_Projector has been removed and Graphic3d_Camera is now passed directly,
so that redundant dependency from HLRAlgo_Projector in Prs3d interfaces has been eliminated.
StdPrs_HLRShape and StdPrs_HLRPolyShape now implement common interface StdPrs_HLRShapeI.
This commit is contained in:
kgv
2020-03-14 20:34:46 +03:00
parent 29263c947e
commit b5163d2f8d
90 changed files with 220 additions and 1248 deletions

View File

@@ -218,7 +218,8 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode)
}
else
{
Handle(Graphic3d_Structure) aCompStruct = aStruct->IsTransformed() ? aStruct->Compute (this, aStruct->Transformation()) : aStruct->Compute (this);
Handle(Graphic3d_Structure) aCompStruct;
aStruct->computeHLR (myCamera, aCompStruct);
aCompStruct->SetHLRValidation (Standard_True);
const Standard_Boolean toComputeWireframe = myVisualization == Graphic3d_TOV_WIREFRAME
@@ -298,8 +299,7 @@ void Graphic3d_CView::ReCompute (const Handle(Graphic3d_Structure)& theStruct)
Handle(Graphic3d_Structure) aCompStructOld = myStructsComputed.ChangeValue (anIndex);
Handle(Graphic3d_Structure) aCompStruct = aCompStructOld;
aCompStruct->SetTransformation (Handle(Geom_Transformation)());
theStruct->IsTransformed() ? theStruct->Compute (this, theStruct->Transformation(), aCompStruct)
: theStruct->Compute (this, aCompStruct);
theStruct->computeHLR (myCamera, aCompStruct);
aCompStruct->SetHLRValidation (Standard_True);
aCompStruct->CalculateBoundBox();
@@ -769,21 +769,8 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure)
{
aStruct = myStructsComputed.Value (anIndex);
aStruct->SetTransformation (Handle(Geom_Transformation)());
if (theStructure->IsTransformed())
{
theStructure->Compute (this, theStructure->Transformation(), aStruct);
}
else
{
theStructure->Compute (this, aStruct);
}
}
else
{
aStruct = theStructure->IsTransformed()
? theStructure->Compute (this, theStructure->Transformation())
: theStructure->Compute (this);
}
theStructure->computeHLR (myCamera, aStruct);
aStruct->SetHLRValidation (Standard_True);

View File

@@ -90,7 +90,7 @@ public:
Standard_Boolean IsRemoved() const { return myIsRemoved; }
//! Returns camera object of the view.
virtual const Handle(Graphic3d_Camera)& Camera() const { return myCamera; }
virtual const Handle(Graphic3d_Camera)& Camera() const Standard_OVERRIDE { return myCamera; }
//! Sets camera used by the view.
virtual void SetCamera (const Handle(Graphic3d_Camera)& theCamera) { myCamera = theCamera; }

View File

@@ -21,6 +21,7 @@
#include <Standard_Transient.hxx>
class Graphic3d_Camera;
class Graphic3d_DataStructureManager;
DEFINE_STANDARD_HANDLE(Graphic3d_DataStructureManager, Standard_Transient)
@@ -31,30 +32,15 @@ DEFINE_STANDARD_HANDLE(Graphic3d_DataStructureManager, Standard_Transient)
//! It defines the global attributes.
class Graphic3d_DataStructureManager : public Standard_Transient
{
public:
DEFINE_STANDARD_RTTIEXT(Graphic3d_DataStructureManager,Standard_Transient)
protected:
//! Initializes the manager <me>.
Standard_EXPORT Graphic3d_DataStructureManager();
private:
//! Returns camera object of the view.
virtual const Handle(Graphic3d_Camera)& Camera() const = 0;
};
#endif // _Graphic3d_DataStructureManager_HeaderFile

View File

@@ -173,40 +173,14 @@ public:
{
//
}
//! Returns the new Structure defined for the new visualization
virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector)
{
(void )theProjector;
return this;
}
//! Returns the new Structure defined for the new visualization
virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
const Handle(Geom_Transformation)& theTrsf)
{
(void )theProjector;
(void )theTrsf;
return this;
}
//! Returns the new Structure defined for the new visualization
virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
Handle(Graphic3d_Structure)& theStructure)
virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector,
Handle(Graphic3d_Structure)& theStructure)
{
(void )theProjector;
(void )theStructure;
}
//! Returns the new Structure defined for the new visualization
virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
const Handle(Geom_Transformation)& theTrsf,
Handle(Graphic3d_Structure)& theStructure)
{
(void )theProjector;
(void )theTrsf;
(void )theStructure;
}
//! Forces a new construction of the structure <me>
//! if <me> is displayed and TOS_COMPUTED.