1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-13 14:27:08 +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

@@ -27,7 +27,7 @@
#include <HLRBRep_PolyAlgo.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Projector.hxx>
#include <StdPrs_ToolTriangulatedShape.hxx>
#include <StdPrs_WFShape.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TopAbs.hxx>
@@ -41,16 +41,24 @@
#define PntY2 ((Standard_Real*)Coordinates)[4]
#define PntZ2 ((Standard_Real*)Coordinates)[5]
IMPLEMENT_STANDARD_RTTIEXT(StdPrs_HLRPolyShape, StdPrs_HLRShapeI)
//=======================================================================
//function : Add
//purpose :
//purpose :
//=======================================================================
void StdPrs_HLRPolyShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
const TopoDS_Shape& aShape,
const Handle (Prs3d_Drawer)& aDrawer,
const Handle (Prs3d_Projector)& aProjector)
void StdPrs_HLRPolyShape::ComputeHLR (const Handle(Prs3d_Presentation)& aPresentation,
const TopoDS_Shape& aShape,
const Handle(Prs3d_Drawer)& aDrawer,
const Handle(Graphic3d_Camera)& theProjector) const
{
gp_Dir aBackDir = -theProjector->Direction();
gp_Dir aXpers = theProjector->Up().Crossed (aBackDir);
gp_Ax3 anAx3 (theProjector->Center(), aBackDir, aXpers);
gp_Trsf aTrsf;
aTrsf.SetTransformation (anAx3);
const HLRAlgo_Projector aProj (aTrsf, !theProjector->IsOrthographic(), theProjector->Scale());
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(aPresentation);
TopExp_Explorer ex;
@@ -76,8 +84,7 @@ void StdPrs_HLRPolyShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
}
Handle(HLRBRep_PolyAlgo) hider = new HLRBRep_PolyAlgo(aShape);
hider->Projector(aProjector->Projector());
hider->Projector (aProj);
hider->Angle(aDrawer->HLRAngle());
hider->Update();
Standard_Real sta,end,dx,dy,dz;