From b5163d2f8d19e9120fc9c019f3e1fd41100c8b11 Mon Sep 17 00:00:00 2001 From: kgv Date: Sat, 14 Mar 2020 20:34:46 +0300 Subject: [PATCH] 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. --- dox/dev_guides/upgrade/upgrade.md | 5 ++ .../src/ISession2D/ISession_Curve.h | 1 - .../src/ISession2D/ISession_Direction.cpp | 6 -- .../src/ISession2D/ISession_Direction.h | 2 - .../src/ISession2D/ISession_Point.cpp | 6 -- .../src/ISession2D/ISession_Point.h | 2 - .../src/ISession2D/ISession_Surface.h | 1 - .../04_Viewer3d/src/ISession_Curve.cpp | 6 -- .../standard/04_Viewer3d/src/ISession_Curve.h | 1 - samples/mfc/standard/06_Ocaf/src/StdAfx.h | 1 - .../07_Triangulation/src/ISession_Curve.cpp | 6 -- .../07_Triangulation/src/ISession_Curve.h | 1 - .../standard/08_HLR/src/SelectionDialog.cpp | 17 +++-- .../src/ISession/ISession_Curve.cpp | 6 -- .../10_Convert/src/ISession/ISession_Curve.h | 1 - samples/mfc/standard/Common/User_Cylinder.cxx | 8 ++- samples/mfc/standard/Common/User_Cylinder.hxx | 3 +- src/AIS/AIS_AngleDimension.hxx | 1 - src/AIS/AIS_Axis.cxx | 17 ----- src/AIS/AIS_Axis.hxx | 11 ---- src/AIS/AIS_Chamf2dDimension.cxx | 19 ------ src/AIS/AIS_Chamf2dDimension.hxx | 13 +--- src/AIS/AIS_Chamf3dDimension.cxx | 19 ------ src/AIS/AIS_Chamf3dDimension.hxx | 11 ---- src/AIS/AIS_Circle.cxx | 23 ------- src/AIS/AIS_Circle.hxx | 13 +--- src/AIS/AIS_ConcentricRelation.cxx | 17 ----- src/AIS/AIS_ConcentricRelation.hxx | 11 ---- src/AIS/AIS_ConnectedInteractive.cxx | 48 +++++--------- src/AIS/AIS_ConnectedInteractive.hxx | 20 ++---- src/AIS/AIS_EqualDistanceRelation.cxx | 28 -------- src/AIS/AIS_EqualDistanceRelation.hxx | 13 +--- src/AIS/AIS_EqualRadiusRelation.cxx | 26 -------- src/AIS/AIS_EqualRadiusRelation.hxx | 11 ---- src/AIS/AIS_FixRelation.cxx | 26 -------- src/AIS/AIS_FixRelation.hxx | 11 ---- src/AIS/AIS_IdenticRelation.cxx | 18 ----- src/AIS/AIS_IdenticRelation.hxx | 11 ---- src/AIS/AIS_LengthDimension.hxx | 1 - src/AIS/AIS_Line.cxx | 19 ------ src/AIS/AIS_Line.hxx | 11 ---- src/AIS/AIS_MaxRadiusDimension.cxx | 27 -------- src/AIS/AIS_MaxRadiusDimension.hxx | 11 ---- src/AIS/AIS_MidPointRelation.cxx | 20 ------ src/AIS/AIS_MidPointRelation.hxx | 11 ---- src/AIS/AIS_MinRadiusDimension.cxx | 26 -------- src/AIS/AIS_MinRadiusDimension.hxx | 11 ---- src/AIS/AIS_MultipleConnectedInteractive.cxx | 24 ------- src/AIS/AIS_MultipleConnectedInteractive.hxx | 11 ---- src/AIS/AIS_OffsetDimension.cxx | 21 ------ src/AIS/AIS_OffsetDimension.hxx | 12 ---- src/AIS/AIS_ParallelRelation.cxx | 18 ----- src/AIS/AIS_ParallelRelation.hxx | 11 ---- src/AIS/AIS_PerpendicularRelation.cxx | 18 ----- src/AIS/AIS_PerpendicularRelation.hxx | 13 +--- src/AIS/AIS_Plane.cxx | 15 ----- src/AIS/AIS_Plane.hxx | 11 ---- src/AIS/AIS_PlaneTrihedron.cxx | 14 ---- src/AIS/AIS_PlaneTrihedron.hxx | 13 +--- src/AIS/AIS_Point.cxx | 24 ------- src/AIS/AIS_Point.hxx | 11 ---- src/AIS/AIS_Shape.cxx | 15 +++-- src/AIS/AIS_Shape.hxx | 29 ++++---- src/AIS/AIS_SymmetricRelation.cxx | 20 ------ src/AIS/AIS_SymmetricRelation.hxx | 11 ---- src/AIS/AIS_TangentRelation.cxx | 20 ------ src/AIS/AIS_TangentRelation.hxx | 11 ---- src/AIS/AIS_Trihedron.cxx | 12 ---- src/AIS/AIS_Trihedron.hxx | 8 --- src/Graphic3d/Graphic3d_CView.cxx | 21 ++---- src/Graphic3d/Graphic3d_CView.hxx | 2 +- .../Graphic3d_DataStructureManager.hxx | 20 +----- src/Graphic3d/Graphic3d_Structure.hxx | 30 +-------- src/Prs3d/FILES | 2 - src/Prs3d/Prs3d_Projector.cxx | 57 ---------------- src/Prs3d/Prs3d_Projector.hxx | 64 ------------------ src/PrsMgr/PrsMgr_PresentableObject.cxx | 21 ++---- src/PrsMgr/PrsMgr_PresentableObject.hxx | 21 +++--- src/PrsMgr/PrsMgr_Presentation.cxx | 66 ++----------------- src/PrsMgr/PrsMgr_Presentation.hxx | 18 +---- src/QABugs/QABugs_17.cxx | 1 - src/StdPrs/FILES | 2 + src/StdPrs/StdPrs_HLRPolyShape.cxx | 25 ++++--- src/StdPrs/StdPrs_HLRPolyShape.hxx | 61 ++++------------- src/StdPrs/StdPrs_HLRShape.cxx | 29 +++++--- src/StdPrs/StdPrs_HLRShape.hxx | 26 +++----- src/StdPrs/StdPrs_HLRShapeI.cxx | 16 +++++ src/StdPrs/StdPrs_HLRShapeI.hxx | 39 +++++++++++ src/StdSelect/StdSelect_Shape.cxx | 15 ----- src/StdSelect/StdSelect_Shape.hxx | 13 ---- 90 files changed, 220 insertions(+), 1248 deletions(-) delete mode 100644 src/Prs3d/Prs3d_Projector.cxx delete mode 100644 src/Prs3d/Prs3d_Projector.hxx create mode 100644 src/StdPrs/StdPrs_HLRShapeI.cxx create mode 100644 src/StdPrs/StdPrs_HLRShapeI.hxx diff --git a/dox/dev_guides/upgrade/upgrade.md b/dox/dev_guides/upgrade/upgrade.md index c8e21c1e9e..d7c1612305 100644 --- a/dox/dev_guides/upgrade/upgrade.md +++ b/dox/dev_guides/upgrade/upgrade.md @@ -1889,6 +1889,11 @@ Unexpected const-ness of Aspect_Window::DoResize() method has been removed, so t Enumeration BRepOffset_Type is renamed to ChFiDS_TypeOfConcavity. +@subsection upgrade_750_hlrprs Changes in HLR presentation API + +Methods computing HLR presentation within *PrsMgr_PresentableObject::Compute()* have been renamed to *PrsMgr_PresentableObject::computeHLR()* +and now accept *Graphic3d_Camera* object instead of removed *Prs3d_Projector*. + @subsection upgrade_750_sensitiveEntity Select3D_SensitiveEntity interface change The method Select3D_SensitiveEntity::NbSubElements() has been changed to be constant. Select3D_SensitiveEntity subclasses at application level should be updated accordingly. diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.h b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.h index 0eba44f27c..8999d1d3bc 100755 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.h +++ b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Curve.h @@ -18,7 +18,6 @@ public: private: Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ; - virtual void Compute(const Handle(Prs3d_Projector)& ,const Handle(Prs3d_Presentation)& ) {} virtual void ComputeSelection (const Handle(SelectMgr_Selection)& ,const Standard_Integer ) {} private: diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp index fe084f12aa..ab9e6030eb 100755 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp +++ b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.cpp @@ -104,12 +104,6 @@ void ISession_Direction::Compute (const Handle(PrsMgr_PresentationManager3d)& /* } } - -void ISession_Direction::Compute (const Handle(Prs3d_Projector)& /*aProjector*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/) -{ -} - void ISession_Direction::ComputeSelection (const Handle(SelectMgr_Selection)& /*aSelection*/, const Standard_Integer /*aMode*/) { diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.h b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.h index 051db72dfc..68072bd009 100755 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.h +++ b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Direction.h @@ -33,8 +33,6 @@ private: void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode); - void Compute (const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) ; void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ; gp_Pnt myPnt; diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.cpp b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.cpp index 4464c6652e..1bb4c60165 100755 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.cpp +++ b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.cpp @@ -50,12 +50,6 @@ void ISession_Point::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPres StdPrs_Point::Add(aPresentation,aGeomPoint,myDrawer); } - -void ISession_Point::Compute(const Handle(Prs3d_Projector)& /*aProjector*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/) - { - } - void ISession_Point::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/, const Standard_Integer /*unMode*/) { diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.h b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.h index f12831a0ee..8a9fa8d8d6 100755 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.h +++ b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Point.h @@ -29,8 +29,6 @@ private : void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode); - void Compute (const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation); void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer unMode); diff --git a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.h b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.h index 0ddb6f297d..2d7a00c0fc 100755 --- a/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.h +++ b/samples/mfc/standard/01_Geometry/src/ISession2D/ISession_Surface.h @@ -18,7 +18,6 @@ public: private: Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0); - virtual void Compute (const Handle(Prs3d_Projector)& ,const Handle(Prs3d_Presentation)& ) {} virtual void ComputeSelection (const Handle(SelectMgr_Selection)& ,const Standard_Integer ) {} private: diff --git a/samples/mfc/standard/04_Viewer3d/src/ISession_Curve.cpp b/samples/mfc/standard/04_Viewer3d/src/ISession_Curve.cpp index 5b8b6a6f1b..db70409988 100755 --- a/samples/mfc/standard/04_Viewer3d/src/ISession_Curve.cpp +++ b/samples/mfc/standard/04_Viewer3d/src/ISession_Curve.cpp @@ -44,12 +44,6 @@ void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPres StdPrs_Curve::Add (aPresentation, anAdaptorCurve, myDrawer); } -void ISession_Curve::Compute(const Handle(Prs3d_Projector)& /*aProjector*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/) - { - - } - void ISession_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/, const Standard_Integer /*aMode*/) { diff --git a/samples/mfc/standard/04_Viewer3d/src/ISession_Curve.h b/samples/mfc/standard/04_Viewer3d/src/ISession_Curve.h index fa99e1e5ae..8641c0c184 100755 --- a/samples/mfc/standard/04_Viewer3d/src/ISession_Curve.h +++ b/samples/mfc/standard/04_Viewer3d/src/ISession_Curve.h @@ -24,7 +24,6 @@ DEFINE_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject) private: Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ; -Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ; void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ; Handle(Geom_Curve) myCurve; diff --git a/samples/mfc/standard/06_Ocaf/src/StdAfx.h b/samples/mfc/standard/06_Ocaf/src/StdAfx.h index 15d36044c6..2a8f0d3458 100755 --- a/samples/mfc/standard/06_Ocaf/src/StdAfx.h +++ b/samples/mfc/standard/06_Ocaf/src/StdAfx.h @@ -81,7 +81,6 @@ #include #include #include -#include #include #include #include diff --git a/samples/mfc/standard/07_Triangulation/src/ISession_Curve.cpp b/samples/mfc/standard/07_Triangulation/src/ISession_Curve.cpp index 5b8b6a6f1b..db70409988 100755 --- a/samples/mfc/standard/07_Triangulation/src/ISession_Curve.cpp +++ b/samples/mfc/standard/07_Triangulation/src/ISession_Curve.cpp @@ -44,12 +44,6 @@ void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPres StdPrs_Curve::Add (aPresentation, anAdaptorCurve, myDrawer); } -void ISession_Curve::Compute(const Handle(Prs3d_Projector)& /*aProjector*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/) - { - - } - void ISession_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/, const Standard_Integer /*aMode*/) { diff --git a/samples/mfc/standard/07_Triangulation/src/ISession_Curve.h b/samples/mfc/standard/07_Triangulation/src/ISession_Curve.h index fa99e1e5ae..8641c0c184 100755 --- a/samples/mfc/standard/07_Triangulation/src/ISession_Curve.h +++ b/samples/mfc/standard/07_Triangulation/src/ISession_Curve.h @@ -24,7 +24,6 @@ DEFINE_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject) private: Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ; -Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ; void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ; Handle(Geom_Curve) myCurve; diff --git a/samples/mfc/standard/08_HLR/src/SelectionDialog.cpp b/samples/mfc/standard/08_HLR/src/SelectionDialog.cpp index 54f8d38567..a9f28d0c4f 100644 --- a/samples/mfc/standard/08_HLR/src/SelectionDialog.cpp +++ b/samples/mfc/standard/08_HLR/src/SelectionDialog.cpp @@ -8,7 +8,6 @@ #include "HLRApp.h" #include "OCC_2dView.h" #include -#include "Prs3d_Projector.hxx" #ifdef _DEBUG //#define new DEBUG_NEW @@ -261,15 +260,15 @@ void CSelectionDialog::Apply() void CSelectionDialog::UpdateProjector() { - Standard_Real DX,DY,DZ,XAt,YAt,ZAt, Vx,Vy,Vz ; - myActiveView->Proj(DX,DY,DZ); - myActiveView->At(XAt,YAt,ZAt); - myActiveView->Up( Vx,Vy,Vz ); + const Handle(Graphic3d_Camera)& aCam = myActiveView->Camera(); + gp_Dir aBackDir = -aCam->Direction(); + gp_Dir aXpers = aCam->Up().Crossed (aBackDir); + gp_Ax3 anAx3 (aCam->Center(), aBackDir, aXpers); + gp_Trsf aTrsf; + aTrsf.SetTransformation (anAx3); + HLRAlgo_Projector aProjector (aTrsf, !aCam->IsOrthographic(), aCam->Scale()); + OnDisplay(false); - Standard_Boolean IsPerspective = (myActiveView->Type() == V3d_PERSPECTIVE); - Standard_Real aFocus = 1; - Prs3d_Projector aPrs3dProjector(IsPerspective,aFocus,DX,DY,DZ,XAt,YAt,ZAt,Vx,Vy,Vz); - HLRAlgo_Projector aProjector = aPrs3dProjector.Projector(); if (myDisplayableShape.IsNull()) return; myDisplayableShape->SetProjector(aProjector); diff --git a/samples/mfc/standard/10_Convert/src/ISession/ISession_Curve.cpp b/samples/mfc/standard/10_Convert/src/ISession/ISession_Curve.cpp index 5b8b6a6f1b..db70409988 100755 --- a/samples/mfc/standard/10_Convert/src/ISession/ISession_Curve.cpp +++ b/samples/mfc/standard/10_Convert/src/ISession/ISession_Curve.cpp @@ -44,12 +44,6 @@ void ISession_Curve::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPres StdPrs_Curve::Add (aPresentation, anAdaptorCurve, myDrawer); } -void ISession_Curve::Compute(const Handle(Prs3d_Projector)& /*aProjector*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/) - { - - } - void ISession_Curve::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/, const Standard_Integer /*aMode*/) { diff --git a/samples/mfc/standard/10_Convert/src/ISession/ISession_Curve.h b/samples/mfc/standard/10_Convert/src/ISession/ISession_Curve.h index fa99e1e5ae..8641c0c184 100755 --- a/samples/mfc/standard/10_Convert/src/ISession/ISession_Curve.h +++ b/samples/mfc/standard/10_Convert/src/ISession/ISession_Curve.h @@ -24,7 +24,6 @@ DEFINE_STANDARD_RTTIEXT(ISession_Curve,AIS_InteractiveObject) private: Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode = 0) ; -Standard_EXPORT virtual void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation) ; void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) ; Handle(Geom_Curve) myCurve; diff --git a/samples/mfc/standard/Common/User_Cylinder.cxx b/samples/mfc/standard/Common/User_Cylinder.cxx index 94adb35aa8..9de18f60bf 100755 --- a/samples/mfc/standard/Common/User_Cylinder.cxx +++ b/samples/mfc/standard/Common/User_Cylinder.cxx @@ -291,15 +291,17 @@ case 6: //color } } -void User_Cylinder::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) +void User_Cylinder::computeHLR (const Handle(Graphic3d_Camera)& aProjector, + const Handle(Geom_Transformation)& , + const Handle(Prs3d_Presentation)& aPresentation) { Handle (Prs3d_Drawer) aDefDrawer = GetContext()->DefaultDrawer(); if (aDefDrawer->DrawHiddenLine()) myDrawer->EnableDrawHiddenLine(); else myDrawer->DisableDrawHiddenLine(); - StdPrs_HLRPolyShape::Add(aPresentation,myShape,myDrawer,aProjector); + StdPrs_HLRPolyShape aTool; + aTool.ComputeHLR (aPresentation,myShape,myDrawer,aProjector); } void User_Cylinder::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, diff --git a/samples/mfc/standard/Common/User_Cylinder.hxx b/samples/mfc/standard/Common/User_Cylinder.hxx index 9021d7d8ef..16eb7a6f39 100755 --- a/samples/mfc/standard/Common/User_Cylinder.hxx +++ b/samples/mfc/standard/Common/User_Cylinder.hxx @@ -8,7 +8,6 @@ #include #include #include -#include // Handle definition // class User_Cylinder; @@ -31,7 +30,7 @@ private: const Standard_Integer aMode = 0) ; void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) ; - void Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation); + void computeHLR (const Handle(Graphic3d_Camera)& aProjector, const Handle(Geom_Transformation)& theTrsf, const Handle(Prs3d_Presentation)& aPresentation); Standard_Boolean TriangleIsValid(const gp_Pnt& P1,const gp_Pnt& P2,const gp_Pnt& P3) const; Quantity_Color Color(gp_Pnt& thePoint,Standard_Real AltMin,Standard_Real AltMax, const Standard_Integer ColorizationMode) ; diff --git a/src/AIS/AIS_AngleDimension.hxx b/src/AIS/AIS_AngleDimension.hxx index ede97619b1..7c9c1ce09f 100755 --- a/src/AIS/AIS_AngleDimension.hxx +++ b/src/AIS/AIS_AngleDimension.hxx @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/src/AIS/AIS_Axis.cxx b/src/AIS/AIS_Axis.cxx index 7783e90d40..507a4325fa 100644 --- a/src/AIS/AIS_Axis.cxx +++ b/src/AIS/AIS_Axis.cxx @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -183,12 +182,6 @@ void AIS_Axis::Compute(const Handle(PrsMgr_PresentationManager3d)&, } -void AIS_Axis::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_Axis::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : @@ -239,16 +232,6 @@ void AIS_Axis::SetWidth(const Standard_Real aValue) SynchronizeAspects(); } - -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= -void AIS_Axis::Compute(const Handle(Prs3d_Projector)&, - const Handle(Prs3d_Presentation)&) -{ -} - //======================================================================= //function : ComputeFields //purpose : diff --git a/src/AIS/AIS_Axis.hxx b/src/AIS/AIS_Axis.hxx index 2e52738617..eb1273bef6 100644 --- a/src/AIS/AIS_Axis.hxx +++ b/src/AIS/AIS_Axis.hxx @@ -83,15 +83,6 @@ public: //! Returns true if the interactive object accepts the display mode aMode. Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE; - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; virtual Standard_Integer Signature() const Standard_OVERRIDE { return 2; } @@ -109,8 +100,6 @@ private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeFields(); diff --git a/src/AIS/AIS_Chamf2dDimension.cxx b/src/AIS/AIS_Chamf2dDimension.cxx index a6514d0243..d9c59829af 100644 --- a/src/AIS/AIS_Chamf2dDimension.cxx +++ b/src/AIS/AIS_Chamf2dDimension.cxx @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -204,24 +203,6 @@ void AIS_Chamf2dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , } -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= - -void AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -void AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_Chamf2dDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_Chamf2dDimension.hxx b/src/AIS/AIS_Chamf2dDimension.hxx index 278e80c4a4..0b145aeba1 100644 --- a/src/AIS/AIS_Chamf2dDimension.hxx +++ b/src/AIS/AIS_Chamf2dDimension.hxx @@ -52,22 +52,11 @@ public: //! Returns true if the 2d chamfer dimension is movable. virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - + Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; gp_Pnt myPntAttach; diff --git a/src/AIS/AIS_Chamf3dDimension.cxx b/src/AIS/AIS_Chamf3dDimension.cxx index 8971e89338..c3edce7187 100644 --- a/src/AIS/AIS_Chamf3dDimension.cxx +++ b/src/AIS/AIS_Chamf3dDimension.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -178,24 +177,6 @@ void AIS_Chamf3dDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& , } -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= - -void AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -void AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_Chamf3dDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_Chamf3dDimension.hxx b/src/AIS/AIS_Chamf3dDimension.hxx index 1e8c6db2fe..d33117aa93 100644 --- a/src/AIS/AIS_Chamf3dDimension.hxx +++ b/src/AIS/AIS_Chamf3dDimension.hxx @@ -50,22 +50,11 @@ public: //! Returns true if the 3d chamfer dimension is movable. virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; gp_Pnt myPntAttach; diff --git a/src/AIS/AIS_Circle.cxx b/src/AIS/AIS_Circle.cxx index c8eb14aec0..19f9ea1269 100644 --- a/src/AIS/AIS_Circle.cxx +++ b/src/AIS/AIS_Circle.cxx @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -85,19 +84,6 @@ void AIS_Circle::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresenta } -//======================================================================= -//function : Compute -//purpose : -//======================================================================= - -void AIS_Circle::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Geom_Transformation)& aTransformation, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_Circle::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : @@ -282,12 +268,3 @@ void AIS_Circle::ComputeArcSelection(const Handle(SelectMgr_Selection)& aSelecti myIsFilledCircleSens); aSelection->Add(seg); } - -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= -void AIS_Circle::Compute(const Handle(Prs3d_Projector)&, - const Handle(Prs3d_Presentation)&) -{ -} diff --git a/src/AIS/AIS_Circle.hxx b/src/AIS/AIS_Circle.hxx index 5408bf78e8..a17cb803d7 100644 --- a/src/AIS/AIS_Circle.hxx +++ b/src/AIS/AIS_Circle.hxx @@ -37,16 +37,7 @@ public: //! starting point theUStart, the arc ending point theUEnd, //! and the type of sensitivity theIsFilledCircleSens. Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& theCircle, const Standard_Real theUStart, const Standard_Real theUEnd, const Standard_Boolean theIsFilledCircleSens = Standard_False); - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - + //! Returns index 6 by default. virtual Standard_Integer Signature() const Standard_OVERRIDE { return 6; } @@ -103,8 +94,6 @@ private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeCircle (const Handle(Prs3d_Presentation)& aPresentation); diff --git a/src/AIS/AIS_ConcentricRelation.cxx b/src/AIS/AIS_ConcentricRelation.cxx index 42402080ef..bf03ae487d 100644 --- a/src/AIS/AIS_ConcentricRelation.cxx +++ b/src/AIS/AIS_ConcentricRelation.cxx @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -86,12 +85,6 @@ void AIS_ConcentricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)& } } -void AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeTwoEdgesConcentric //purpose : @@ -223,16 +216,6 @@ void AIS_ConcentricRelation::ComputeTwoEdgesConcentric(const Handle(Prs3d_Presen } } -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= - -void AIS_ConcentricRelation::Compute(const Handle(Prs3d_Projector)&, - const Handle(Prs3d_Presentation)&) -{ -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_ConcentricRelation.hxx b/src/AIS/AIS_ConcentricRelation.hxx index af88f42ae8..8bcbccf309 100644 --- a/src/AIS/AIS_ConcentricRelation.hxx +++ b/src/AIS/AIS_ConcentricRelation.hxx @@ -41,22 +41,11 @@ public: //! aPlane is provided to create an axis along which the //! relation of concentricity can be extended. Standard_EXPORT AIS_ConcentricRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape, const Handle(Geom_Plane)& aPlane); - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeTwoEdgesConcentric (const Handle(Prs3d_Presentation)& aPresentationManager); Standard_EXPORT void ComputeEdgeVertexConcentric (const Handle(Prs3d_Presentation)& aPresentationManager); diff --git a/src/AIS/AIS_ConnectedInteractive.cxx b/src/AIS/AIS_ConnectedInteractive.cxx index f7b221799a..ac45194a5b 100644 --- a/src/AIS/AIS_ConnectedInteractive.cxx +++ b/src/AIS/AIS_ConnectedInteractive.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -137,42 +137,30 @@ void AIS_ConnectedInteractive::Compute (const Handle(PrsMgr_PresentationManager3 } //======================================================================= -//function : Compute +//function : computeHLR //purpose : //======================================================================= -void AIS_ConnectedInteractive::Compute (const Handle(Prs3d_Projector)& theProjector, - const Handle(Geom_Transformation)& theTransformation, - const Handle(Prs3d_Presentation)& thePresentation) +void AIS_ConnectedInteractive::computeHLR (const Handle(Graphic3d_Camera)& theProjector, + const Handle(Geom_Transformation)& theTransformation, + const Handle(Prs3d_Presentation)& thePresentation) { - updateShape (Standard_False); + const bool hasTrsf = !theTransformation.IsNull() + && theTransformation->Form() != gp_Identity; + updateShape (!hasTrsf); if (myShape.IsNull()) { return; } - const TopLoc_Location& aLocation = myShape.Location(); - TopoDS_Shape aShape = myShape.Located (TopLoc_Location (theTransformation->Trsf()) * aLocation); - Compute (theProjector, thePresentation, aShape); -} - -//======================================================================= -//function : Compute -//purpose : -//======================================================================= -void AIS_ConnectedInteractive::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) -{ - updateShape (Standard_True); - Compute (aProjector, aPresentation, myShape); -} - -//======================================================================= -//function : Compute -//purpose : -//======================================================================= -void AIS_ConnectedInteractive::Compute (const Handle(Prs3d_Projector)& theProjector, - const Handle(Prs3d_Presentation)& thePrs, - const TopoDS_Shape& theShape) -{ - AIS_Shape::computeHlrPresentation (theProjector, thePrs, theShape, myDrawer); + if (hasTrsf) + { + const TopLoc_Location& aLocation = myShape.Location(); + TopoDS_Shape aShape = myShape.Located (TopLoc_Location (theTransformation->Trsf()) * aLocation); + AIS_Shape::computeHlrPresentation (theProjector, thePresentation, aShape, myDrawer); + } + else + { + AIS_Shape::computeHlrPresentation (theProjector, thePresentation, myShape, myDrawer); + } } //======================================================================= diff --git a/src/AIS/AIS_ConnectedInteractive.hxx b/src/AIS/AIS_ConnectedInteractive.hxx index c8f43538ce..ec53af2e5c 100644 --- a/src/AIS/AIS_ConnectedInteractive.hxx +++ b/src/AIS/AIS_ConnectedInteractive.hxx @@ -105,18 +105,10 @@ protected: //! a transformation if there's one stored. Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode) Standard_OVERRIDE; - //! Computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - - //! Computes the presentation according to a point of view - //! given by . - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; + //! Computes the presentation according to a point of view. + Standard_EXPORT virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector, + const Handle(Geom_Transformation)& theTrsf, + const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE; //! Generates sensitive entities by copying //! them from myReference selection, creates and sets an entity @@ -130,10 +122,6 @@ protected: Standard_EXPORT void updateShape (const Standard_Boolean WithLocation = Standard_True); - //! Computes the presentation according to a point of view - //! given by . - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation, const TopoDS_Shape& aShape); - Standard_EXPORT void connect (const Handle(AIS_InteractiveObject)& theAnotherObj, const Handle(Geom_Transformation)& theLocation); diff --git a/src/AIS/AIS_EqualDistanceRelation.cxx b/src/AIS/AIS_EqualDistanceRelation.cxx index 96f21f646d..39fbb700ca 100644 --- a/src/AIS/AIS_EqualDistanceRelation.cxx +++ b/src/AIS/AIS_EqualDistanceRelation.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -206,33 +205,6 @@ void AIS_EqualDistanceRelation::Compute( const Handle( PrsMgr_PresentationManage myPoint1, myPoint2, myPoint3, myPoint4, myPlane ); } - -//======================================================================= -//function : Compute -//purpose : to avoid warning at compilation (SUN) -//======================================================================= - -void AIS_EqualDistanceRelation::Compute( const Handle( Prs3d_Projector )& /*aProjector*/, - const Handle( Prs3d_Presentation )& /*aPresentation*/) -{ -// throw Standard_NotImplemented("AIS_EqualDistanceRelation::Compute( const Handle( Prs3d_Projector )&, - // const Handle( Prs3d_Presentation )& )"); -// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -//======================================================================= -//function : Compute -//purpose : to avoid warning at compilation (SUN) -//======================================================================= -void AIS_EqualDistanceRelation::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Geom_Transformation)& aTransformation, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_EqualDistanceRelation::Compute(const Handle(Prs3d_Projector)&, -// const Handle(Geom_Transformation)&,const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_EqualDistanceRelation.hxx b/src/AIS/AIS_EqualDistanceRelation.hxx index b119072c56..644afd1b0f 100644 --- a/src/AIS/AIS_EqualDistanceRelation.hxx +++ b/src/AIS/AIS_EqualDistanceRelation.hxx @@ -61,16 +61,7 @@ public: //! Returns the shape aShape4 from the framework //! created at construction time. const TopoDS_Shape& Shape4() const; - - //! Computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - + //! Computes the location of an intreval between //! between two edges. FirstAttach , SecondAttach //! are the returned extreme points of the interval. @@ -88,8 +79,6 @@ private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; TopoDS_Shape myShape3; diff --git a/src/AIS/AIS_EqualRadiusRelation.cxx b/src/AIS/AIS_EqualRadiusRelation.cxx index 021c5c1ad2..4a1dfea6a0 100644 --- a/src/AIS/AIS_EqualRadiusRelation.cxx +++ b/src/AIS/AIS_EqualRadiusRelation.cxx @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -147,31 +146,6 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3 myFirstCenter, mySecondCenter, myFirstPoint, mySecondPoint, myPlane ); } -//======================================================================= -//function : Compute -//purpose : to avoid warning at compilation (SUN) -//======================================================================= - -void AIS_EqualRadiusRelation::Compute( const Handle( Prs3d_Projector )& /*aProjector*/, - const Handle( Prs3d_Presentation )& /*aPresentation*/) -{ -// throw Standard_NotImplemented("AIS_EqualRadiusRelation::Compute( const Handle( Prs3d_Projector )&,const Handle( Prs3d_Presentation )& )"); -// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -//======================================================================= -//function : Compute -//purpose : -//======================================================================= - -void AIS_EqualRadiusRelation::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Geom_Transformation)& aTransformation, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_EqualRadiusRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_EqualRadiusRelation.hxx b/src/AIS/AIS_EqualRadiusRelation.hxx index 0680585ba2..9d4917fd0b 100644 --- a/src/AIS/AIS_EqualRadiusRelation.hxx +++ b/src/AIS/AIS_EqualRadiusRelation.hxx @@ -32,22 +32,11 @@ public: //! If one of edges is not in the given plane, //! the presentation method projects it onto the plane. Standard_EXPORT AIS_EqualRadiusRelation(const TopoDS_Edge& aFirstEdge, const TopoDS_Edge& aSecondEdge, const Handle(Geom_Plane)& aPlane); - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeRadiusPosition(); diff --git a/src/AIS/AIS_FixRelation.cxx b/src/AIS/AIS_FixRelation.cxx index a0c2aca81b..e4ea9b585a 100644 --- a/src/AIS/AIS_FixRelation.cxx +++ b/src/AIS/AIS_FixRelation.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -196,31 +195,6 @@ void AIS_FixRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, myArrowSize); } -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= - -void AIS_FixRelation::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_FixRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -//======================================================================= -//function : Compute -//purpose : -//======================================================================= - -void AIS_FixRelation::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Geom_Transformation)& aTransformation, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_FixRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_FixRelation.hxx b/src/AIS/AIS_FixRelation.hxx index c730e523a7..5c904c05e3 100644 --- a/src/AIS/AIS_FixRelation.hxx +++ b/src/AIS/AIS_FixRelation.hxx @@ -66,23 +66,12 @@ public: //! Returns true if the Interactive Objects in the relation //! are movable. virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; } - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; //! computes the presentation for if it's a diff --git a/src/AIS/AIS_IdenticRelation.cxx b/src/AIS/AIS_IdenticRelation.cxx index 68d469fec0..fe394d4de6 100644 --- a/src/AIS/AIS_IdenticRelation.cxx +++ b/src/AIS/AIS_IdenticRelation.cxx @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -352,23 +351,6 @@ void AIS_IdenticRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, } } -//======================================================================= -//function : Compute -//purpose : -//======================================================================= -void AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -void AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_IdenticRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : function used to compute the selection associated to the diff --git a/src/AIS/AIS_IdenticRelation.hxx b/src/AIS/AIS_IdenticRelation.hxx index 80dc227a51..ef729100d9 100644 --- a/src/AIS/AIS_IdenticRelation.hxx +++ b/src/AIS/AIS_IdenticRelation.hxx @@ -59,15 +59,6 @@ public: //! Returns true if the interactive object is movable. virtual Standard_Boolean IsMovable() const Standard_OVERRIDE { return Standard_True; } - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(AIS_IdenticRelation,AIS_Relation) @@ -76,8 +67,6 @@ private: Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeOneEdgeOVertexPresentation (const Handle(Prs3d_Presentation)& aPresentation); diff --git a/src/AIS/AIS_LengthDimension.hxx b/src/AIS/AIS_LengthDimension.hxx index 90a87201c0..44eef508e6 100755 --- a/src/AIS/AIS_LengthDimension.hxx +++ b/src/AIS/AIS_LengthDimension.hxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include diff --git a/src/AIS/AIS_Line.cxx b/src/AIS/AIS_Line.cxx index ae4e111322..d96dfd9ff8 100644 --- a/src/AIS/AIS_Line.cxx +++ b/src/AIS/AIS_Line.cxx @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -78,11 +77,6 @@ void AIS_Line::Compute(const Handle(PrsMgr_PresentationManager3d)&, } -void AIS_Line::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation) -{ - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ; -} - //======================================================================= //function : ComputeSelection //purpose : @@ -288,16 +282,3 @@ void AIS_Line::ComputeSegmentLineSelection(const Handle(SelectMgr_Selection)& aS myEndPoint->Pnt()); aSelection->Add(seg); } - -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= -void AIS_Line::Compute(const Handle(Prs3d_Projector)&, - const Handle(Prs3d_Presentation)&) -{ -} - - - - diff --git a/src/AIS/AIS_Line.hxx b/src/AIS/AIS_Line.hxx index ffb0653373..2345a8bfd1 100644 --- a/src/AIS/AIS_Line.hxx +++ b/src/AIS/AIS_Line.hxx @@ -37,15 +37,6 @@ public: //! and a finishing point aEndPoint for the line. Standard_EXPORT AIS_Line(const Handle(Geom_Point)& aStartPoint, const Handle(Geom_Point)& aEndPoint); - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - //! Returns the signature 5. virtual Standard_Integer Signature() const Standard_OVERRIDE { return 5; } @@ -95,8 +86,6 @@ private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeInfiniteLine (const Handle(Prs3d_Presentation)& aPresentation); diff --git a/src/AIS/AIS_MaxRadiusDimension.cxx b/src/AIS/AIS_MaxRadiusDimension.cxx index 0b8aebd3fe..0efd40848b 100644 --- a/src/AIS/AIS_MaxRadiusDimension.cxx +++ b/src/AIS/AIS_MaxRadiusDimension.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -118,32 +117,6 @@ void AIS_MaxRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ComputeEllipse(aPresentation); } -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= - -void AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation)"); - PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -//======================================================================= -//function : Compute -//purpose : -//======================================================================= - -void AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Geom_Transformation)& aTransformation, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_MaxRadiusDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - - //======================================================================= //function : ComputeEllipse //purpose : diff --git a/src/AIS/AIS_MaxRadiusDimension.hxx b/src/AIS/AIS_MaxRadiusDimension.hxx index cdb5976cb9..a952ceb601 100644 --- a/src/AIS/AIS_MaxRadiusDimension.hxx +++ b/src/AIS/AIS_MaxRadiusDimension.hxx @@ -37,22 +37,11 @@ public: //! Max Ellipse radius dimension with position //! Shape can be edge , planar face or cylindrical face Standard_EXPORT AIS_MaxRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0); - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeEllipse (const Handle(Prs3d_Presentation)& aPresentation); diff --git a/src/AIS/AIS_MidPointRelation.cxx b/src/AIS/AIS_MidPointRelation.cxx index 0eaf05f340..13e8dee989 100644 --- a/src/AIS/AIS_MidPointRelation.cxx +++ b/src/AIS/AIS_MidPointRelation.cxx @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -137,25 +136,6 @@ void AIS_MidPointRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, } } -//======================================================================= -//function : Compute -//purpose : to avoid warning at compilation (SUN) -//======================================================================= -void AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)& /*aProjector*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/) -{ -// throw Standard_NotImplemented("AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)"); -// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -void AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&, - const Handle(Geom_Transformation)&, - const Handle(Prs3d_Presentation)&) -{ - throw Standard_NotImplemented("AIS_MidPointRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); -// PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_MidPointRelation.hxx b/src/AIS/AIS_MidPointRelation.hxx index cbe4b9901c..ca13b551b9 100644 --- a/src/AIS/AIS_MidPointRelation.hxx +++ b/src/AIS/AIS_MidPointRelation.hxx @@ -39,22 +39,11 @@ public: void SetTool (const TopoDS_Shape& aMidPointTool); const TopoDS_Shape& GetTool() const; - - //! Computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeFaceFromPnt (const Handle(Prs3d_Presentation)& aprs, const Standard_Boolean first); diff --git a/src/AIS/AIS_MinRadiusDimension.cxx b/src/AIS/AIS_MinRadiusDimension.cxx index 7237060105..d49da7f06c 100644 --- a/src/AIS/AIS_MinRadiusDimension.cxx +++ b/src/AIS/AIS_MinRadiusDimension.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -118,31 +117,6 @@ void AIS_MinRadiusDimension::Compute(const Handle(PrsMgr_PresentationManager3d)& ComputeEllipse(aPresentation); } -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= - -void AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation)"); - PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -//======================================================================= -//function : Compute -//purpose : -//======================================================================= - -void AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Geom_Transformation)& aTransformation, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_MinRadiusDimension::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeEllipse //purpose : diff --git a/src/AIS/AIS_MinRadiusDimension.hxx b/src/AIS/AIS_MinRadiusDimension.hxx index edfb4bf5fe..7eda655a6d 100644 --- a/src/AIS/AIS_MinRadiusDimension.hxx +++ b/src/AIS/AIS_MinRadiusDimension.hxx @@ -37,22 +37,11 @@ public: //! Max Ellipse radius dimension with position //! Shape can be edge , planar face or cylindrical face Standard_EXPORT AIS_MinRadiusDimension(const TopoDS_Shape& aShape, const Standard_Real aVal, const TCollection_ExtendedString& aText, const gp_Pnt& aPosition, const DsgPrs_ArrowSide aSymbolPrs, const Standard_Real anArrowSize = 0.0); - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeEllipse (const Handle(Prs3d_Presentation)& aPresentation); diff --git a/src/AIS/AIS_MultipleConnectedInteractive.cxx b/src/AIS/AIS_MultipleConnectedInteractive.cxx index 0776e7d3f7..7e9387c466 100644 --- a/src/AIS/AIS_MultipleConnectedInteractive.cxx +++ b/src/AIS/AIS_MultipleConnectedInteractive.cxx @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -159,29 +158,6 @@ void AIS_MultipleConnectedInteractive::Compute (const Handle(PrsMgr_Presentation } } -//======================================================================= -//function : Compute -//purpose : -//======================================================================= - -void AIS_MultipleConnectedInteractive::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ - PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -//======================================================================= -//function : Compute -//purpose : -//======================================================================= - -void AIS_MultipleConnectedInteractive::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Geom_Transformation)& aTransformation, - const Handle(Prs3d_Presentation)& aPresentation) -{ - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : AcceptShapeDecomposition //purpose : diff --git a/src/AIS/AIS_MultipleConnectedInteractive.hxx b/src/AIS/AIS_MultipleConnectedInteractive.hxx index fc5f3a676f..f5109006ed 100644 --- a/src/AIS/AIS_MultipleConnectedInteractive.hxx +++ b/src/AIS/AIS_MultipleConnectedInteractive.hxx @@ -57,17 +57,6 @@ public: //! Clears all the connections to objects. Standard_EXPORT void DisconnectAll(); - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - //! Informs the graphic context that the interactive Object //! may be decomposed into sub-shapes for dynamic selection. Standard_EXPORT virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE; diff --git a/src/AIS/AIS_OffsetDimension.cxx b/src/AIS/AIS_OffsetDimension.cxx index ed0f42498d..eaf8623f13 100644 --- a/src/AIS/AIS_OffsetDimension.cxx +++ b/src/AIS/AIS_OffsetDimension.cxx @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -132,26 +131,6 @@ void AIS_OffsetDimension::Compute(const Handle(PrsMgr_PresentationManager3d)&, } } - -//======================================================================= -//function : Compute -//purpose : to avoid warning at compilation (SUN) -//======================================================================= -void AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& /*aProjector*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/) -{ -// throw Standard_NotImplemented("AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& aProjector,const Handle(Prs3d_Presentation)& aPresentation)"); -// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -void AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Geom_Transformation)& aTransformation, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_OffsetDimension::Compute(const Handle(Prs3d_Projector)&,const Handle(Geom_Transformation)&,const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_OffsetDimension.hxx b/src/AIS/AIS_OffsetDimension.hxx index 5c769ec477..d0d254f327 100644 --- a/src/AIS/AIS_OffsetDimension.hxx +++ b/src/AIS/AIS_OffsetDimension.hxx @@ -36,16 +36,6 @@ public: //! first shape aFShape, the second shape aSShape, the //! dimension aVal, and the text aText. Standard_EXPORT AIS_OffsetDimension(const TopoDS_Shape& FistShape, const TopoDS_Shape& SecondShape, const Standard_Real aVal, const TCollection_ExtendedString& aText); - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - //! Indicates that the dimension we are concerned with is an offset. virtual AIS_KindOfDimension KindOfDimension() const Standard_OVERRIDE; @@ -61,8 +51,6 @@ private: Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeTwoFacesOffset (const Handle(Prs3d_Presentation)& aPresentation, const gp_Trsf& aTrsf); diff --git a/src/AIS/AIS_ParallelRelation.cxx b/src/AIS/AIS_ParallelRelation.cxx index 6f979065e7..ed515f7cce 100644 --- a/src/AIS/AIS_ParallelRelation.cxx +++ b/src/AIS/AIS_ParallelRelation.cxx @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -116,23 +115,6 @@ void AIS_ParallelRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, } } -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= -void AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -void AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_ParallelRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_ParallelRelation.hxx b/src/AIS/AIS_ParallelRelation.hxx index 2dcc2d1aa2..7fb1708548 100644 --- a/src/AIS/AIS_ParallelRelation.hxx +++ b/src/AIS/AIS_ParallelRelation.hxx @@ -45,22 +45,11 @@ public: //! Returns true if the parallelism is movable. virtual Standard_Boolean IsMovable() const Standard_OVERRIDE; - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeTwoFacesParallel (const Handle(Prs3d_Presentation)& aPresentation); diff --git a/src/AIS/AIS_PerpendicularRelation.cxx b/src/AIS/AIS_PerpendicularRelation.cxx index 313f974ef7..34091cd258 100644 --- a/src/AIS/AIS_PerpendicularRelation.cxx +++ b/src/AIS/AIS_PerpendicularRelation.cxx @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -107,23 +106,6 @@ void AIS_PerpendicularRelation::Compute(const Handle(PrsMgr_PresentationManager3 // Cas pas traite - Edge/Face } -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= -void AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -void AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_PerpendicularRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_PerpendicularRelation.hxx b/src/AIS/AIS_PerpendicularRelation.hxx index 574091886a..d27baeaa5a 100644 --- a/src/AIS/AIS_PerpendicularRelation.hxx +++ b/src/AIS/AIS_PerpendicularRelation.hxx @@ -43,23 +43,12 @@ public: //! This object is defined by a first shape aFShape and a //! second shape aSShape. Standard_EXPORT AIS_PerpendicularRelation(const TopoDS_Shape& aFShape, const TopoDS_Shape& aSShape); - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - + Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeTwoFacesPerpendicular (const Handle(Prs3d_Presentation)& aPresentation); diff --git a/src/AIS/AIS_Plane.cxx b/src/AIS/AIS_Plane.cxx index 1f7dd56d89..afb0da2e91 100644 --- a/src/AIS/AIS_Plane.cxx +++ b/src/AIS/AIS_Plane.cxx @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -286,11 +285,6 @@ void AIS_Plane::Compute(const Handle(PrsMgr_PresentationManager3d)& , } } -void AIS_Plane::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation) -{ - PrsMgr_PresentableObject::Compute(aProjector, aTransformation, aPresentation); -} - //======================================================================= //function : ComputeSelection //purpose : @@ -529,15 +523,6 @@ void AIS_Plane::ComputeFrame() } } -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= -void AIS_Plane::Compute(const Handle(Prs3d_Projector)&, - const Handle(Prs3d_Presentation)&) -{ -} - //======================================================================= //function : ComputeFields //purpose : diff --git a/src/AIS/AIS_Plane.hxx b/src/AIS/AIS_Plane.hxx index 73364aec10..021472aa29 100644 --- a/src/AIS/AIS_Plane.hxx +++ b/src/AIS/AIS_Plane.hxx @@ -132,15 +132,6 @@ public: //! Sets the type of sensitivity for the plane. void SetTypeOfSensitivity (Select3D_TypeOfSensitivity theTypeOfSensitivity) { myTypeOfSensitivity = theTypeOfSensitivity; } - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, const Standard_Integer theMode) Standard_OVERRIDE; Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE; @@ -151,8 +142,6 @@ private: Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeFrame(); Standard_EXPORT void ComputeFields(); diff --git a/src/AIS/AIS_PlaneTrihedron.cxx b/src/AIS/AIS_PlaneTrihedron.cxx index 6f38424180..7a3d476cd3 100644 --- a/src/AIS/AIS_PlaneTrihedron.cxx +++ b/src/AIS/AIS_PlaneTrihedron.cxx @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -181,12 +180,6 @@ void AIS_PlaneTrihedron::Compute(const Handle(PrsMgr_PresentationManager3d)&, aPresentation->SetInfiniteState (Standard_True); } -void AIS_PlaneTrihedron::Compute(const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTransformation, const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_PlaneTrihedron::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ; -} - //======================================================================= //function : ComputeSelection //purpose : @@ -251,13 +244,6 @@ void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol) SynchronizeAspects(); } - -void AIS_PlaneTrihedron::Compute(const Handle(Prs3d_Projector)&, - const Handle(Prs3d_Presentation)&) -{ -} - - //======================================================================= //function : ExtremityPoints //purpose : to avoid warning diff --git a/src/AIS/AIS_PlaneTrihedron.hxx b/src/AIS/AIS_PlaneTrihedron.hxx index 5d8d9a8011..be79176b8f 100644 --- a/src/AIS/AIS_PlaneTrihedron.hxx +++ b/src/AIS/AIS_PlaneTrihedron.hxx @@ -73,16 +73,7 @@ public: //! Returns true if the display mode selected, aMode, is valid. Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE; - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - + virtual Standard_Integer Signature() const Standard_OVERRIDE { return 4; } //! Returns datum as the type of Interactive Object. @@ -101,8 +92,6 @@ protected: private: - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; private: diff --git a/src/AIS/AIS_Point.cxx b/src/AIS/AIS_Point.cxx index 44eb8d9d2d..0acb6a1c3f 100644 --- a/src/AIS/AIS_Point.cxx +++ b/src/AIS/AIS_Point.cxx @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -102,19 +101,6 @@ void AIS_Point::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat } -//======================================================================= -//function : Compute -//purpose : -//======================================================================= - -void AIS_Point::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Geom_Transformation)& aTransformation, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_Point::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ; -} - //======================================================================= //function : ComputeSelection //purpose : @@ -160,16 +146,6 @@ TopoDS_Vertex AIS_Point::Vertex() const return BRepBuilderAPI_MakeVertex(P); } - -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= -void AIS_Point::Compute(const Handle(Prs3d_Projector)&, - const Handle(Prs3d_Presentation)&) -{ -} - //======================================================================= //function : SetMarker //purpose : diff --git a/src/AIS/AIS_Point.hxx b/src/AIS/AIS_Point.hxx index 4a0682878d..af5bd9048e 100644 --- a/src/AIS/AIS_Point.hxx +++ b/src/AIS/AIS_Point.hxx @@ -48,15 +48,6 @@ public: //! Returns true if the display mode selected is valid for point datums. Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE; - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; //! Allows you to provide settings for the Color. Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE; @@ -84,8 +75,6 @@ protected: Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; private: - - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; diff --git a/src/AIS/AIS_Shape.cxx b/src/AIS/AIS_Shape.cxx index 44b7a5a351..c3eab18854 100644 --- a/src/AIS/AIS_Shape.cxx +++ b/src/AIS/AIS_Shape.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -224,7 +223,7 @@ void AIS_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentat //function : computeHlrPresentation //purpose : //======================================================================= -void AIS_Shape::computeHlrPresentation (const Handle(Prs3d_Projector)& theProjector, +void AIS_Shape::computeHlrPresentation (const Handle(Graphic3d_Camera)& theProjector, const Handle(Prs3d_Presentation)& thePrs, const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer) @@ -282,12 +281,18 @@ void AIS_Shape::computeHlrPresentation (const Handle(Prs3d_Projector)& theProjec switch (theDrawer->TypeOfHLR()) { case Prs3d_TOH_Algo: - StdPrs_HLRShape::Add (thePrs, theShape, theDrawer, theProjector); + { + StdPrs_HLRShape aBuilder; + aBuilder.ComputeHLR (thePrs, theShape, theDrawer, theProjector); break; + } case Prs3d_TOH_PolyAlgo: - default: - StdPrs_HLRPolyShape::Add (thePrs, theShape, theDrawer, theProjector); + case Prs3d_TOH_NotSet: + { + StdPrs_HLRPolyShape aBuilder; + aBuilder.ComputeHLR (thePrs, theShape, theDrawer, theProjector); break; + } } } catch (Standard_Failure const& anException) diff --git a/src/AIS/AIS_Shape.hxx b/src/AIS/AIS_Shape.hxx index 1b2ce0fcd5..ceb86a5359 100644 --- a/src/AIS/AIS_Shape.hxx +++ b/src/AIS/AIS_Shape.hxx @@ -282,20 +282,21 @@ protected: const Standard_Integer theMode) Standard_OVERRIDE; //! Compute projected presentation. - virtual void Compute (const Handle(Prs3d_Projector)& theProjector, - const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE + virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector, + const Handle(Geom_Transformation)& theTrsf, + const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE { - computeHlrPresentation (theProjector, thePrs, myshape, myDrawer); - } - - //! Compute projected presentation with transformation. - virtual void Compute (const Handle(Prs3d_Projector)& theProjector, - const Handle(Geom_Transformation)& theTrsf, - const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE - { - const TopLoc_Location& aLoc = myshape.Location(); - const TopoDS_Shape aShape = myshape.Located (TopLoc_Location (theTrsf->Trsf()) * aLoc); - computeHlrPresentation (theProjector, thePrs, aShape, myDrawer); + if (!theTrsf.IsNull() + && theTrsf->Form() != gp_Identity) + { + const TopLoc_Location& aLoc = myshape.Location(); + const TopoDS_Shape aShape = myshape.Located (TopLoc_Location (theTrsf->Trsf()) * aLoc); + computeHlrPresentation (theProjector, thePrs, aShape, myDrawer); + } + else + { + computeHlrPresentation (theProjector, thePrs, myshape, myDrawer); + } } //! Compute selection. @@ -320,7 +321,7 @@ protected: public: //! Compute HLR presentation for specified shape. - Standard_EXPORT static void computeHlrPresentation (const Handle(Prs3d_Projector)& theProjector, + Standard_EXPORT static void computeHlrPresentation (const Handle(Graphic3d_Camera)& theProjector, const Handle(Prs3d_Presentation)& thePrs, const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer); diff --git a/src/AIS/AIS_SymmetricRelation.cxx b/src/AIS/AIS_SymmetricRelation.cxx index a1553c7c10..336480c56d 100644 --- a/src/AIS/AIS_SymmetricRelation.cxx +++ b/src/AIS/AIS_SymmetricRelation.cxx @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -121,25 +120,6 @@ void AIS_SymmetricRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, } } -//======================================================================= -//function : Compute -//purpose : to avoid warning at compilation (SUN) -//======================================================================= -void AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)& /*aProjector*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/) -{ -// throw Standard_NotImplemented("AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)"); -// PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -void AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&, - const Handle(Geom_Transformation)&, - const Handle(Prs3d_Presentation)&) -{ - throw Standard_NotImplemented("AIS_SymmetricRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); -// PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_SymmetricRelation.hxx b/src/AIS/AIS_SymmetricRelation.hxx index dcbc2cdd9f..1f3ce3c6d1 100644 --- a/src/AIS/AIS_SymmetricRelation.hxx +++ b/src/AIS/AIS_SymmetricRelation.hxx @@ -54,22 +54,11 @@ public: //! Returns the tool composed of a first shape, a second //! shape, and a plane. This tool is created at construction time. const TopoDS_Shape& GetTool() const; - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeTwoFacesSymmetric (const Handle(Prs3d_Presentation)& aprs); diff --git a/src/AIS/AIS_TangentRelation.cxx b/src/AIS/AIS_TangentRelation.cxx index bab248221e..c5b6eac123 100644 --- a/src/AIS/AIS_TangentRelation.cxx +++ b/src/AIS/AIS_TangentRelation.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -113,25 +112,6 @@ void AIS_TangentRelation::Compute(const Handle(PrsMgr_PresentationManager3d)&, } } -//======================================================================= -//function : Compute -//purpose : to avoid warning -//======================================================================= -void AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)&,const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aPresentation ) ; -} - -void AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Geom_Transformation)& aTransformation, - const Handle(Prs3d_Presentation)& aPresentation) -{ -// throw Standard_NotImplemented("AIS_TangentRelation::Compute(const Handle(Prs3d_Projector)&, const Handle(Geom_Transformation)&, const Handle(Prs3d_Presentation)&)"); - PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation ) ; -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_TangentRelation.hxx b/src/AIS/AIS_TangentRelation.hxx index e19703551e..a9da68daf4 100644 --- a/src/AIS/AIS_TangentRelation.hxx +++ b/src/AIS/AIS_TangentRelation.hxx @@ -52,22 +52,11 @@ public: //! - 2 - there is a connection to the second shape. //! This reference is initially defined at construction time. Standard_EXPORT void SetExternRef (const Standard_Integer aRef); - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; private: Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE; Standard_EXPORT void ComputeTwoFacesTangent (const Handle(Prs3d_Presentation)& aPresentation); diff --git a/src/AIS/AIS_Trihedron.cxx b/src/AIS/AIS_Trihedron.cxx index d31538ee25..aa50e63841 100644 --- a/src/AIS/AIS_Trihedron.cxx +++ b/src/AIS/AIS_Trihedron.cxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -200,17 +199,6 @@ void AIS_Trihedron::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrsM computePresentation (thePrsMgr, thePrs); } -//======================================================================= -//function : Compute -//purpose : -//======================================================================= -void AIS_Trihedron::Compute (const Handle(Prs3d_Projector)& theProjector, - const Handle(Geom_Transformation)& theTrsf, - const Handle(Prs3d_Presentation)& thePrs) -{ - PrsMgr_PresentableObject::Compute (theProjector, theTrsf, thePrs); -} - //======================================================================= //function : ComputeSelection //purpose : diff --git a/src/AIS/AIS_Trihedron.hxx b/src/AIS/AIS_Trihedron.hxx index 9d635df2cf..011334e0e3 100644 --- a/src/AIS/AIS_Trihedron.hxx +++ b/src/AIS/AIS_Trihedron.hxx @@ -207,14 +207,6 @@ protected: const Handle(Prs3d_Presentation)& thePrs, const Standard_Integer theMode) Standard_OVERRIDE; - //! This compute is unavailable for trihedron presentation. - void Compute (const Handle(Prs3d_Projector)& , const Handle(Prs3d_Presentation)& ) Standard_OVERRIDE {} - - //! This compute is unavailable for trihedron presentation. - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& theProjector, - const Handle(Geom_Transformation)& theTrsf, - const Handle(Prs3d_Presentation)& thePrs) Standard_OVERRIDE; - //! Compute selection. Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, const Standard_Integer theMode) Standard_OVERRIDE; diff --git a/src/Graphic3d/Graphic3d_CView.cxx b/src/Graphic3d/Graphic3d_CView.cxx index 829151db39..6306a58fdf 100644 --- a/src/Graphic3d/Graphic3d_CView.cxx +++ b/src/Graphic3d/Graphic3d_CView.cxx @@ -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); diff --git a/src/Graphic3d/Graphic3d_CView.hxx b/src/Graphic3d/Graphic3d_CView.hxx index f3a2836997..82d689393e 100644 --- a/src/Graphic3d/Graphic3d_CView.hxx +++ b/src/Graphic3d/Graphic3d_CView.hxx @@ -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; } diff --git a/src/Graphic3d/Graphic3d_DataStructureManager.hxx b/src/Graphic3d/Graphic3d_DataStructureManager.hxx index 294a95fdb5..def5e631a7 100644 --- a/src/Graphic3d/Graphic3d_DataStructureManager.hxx +++ b/src/Graphic3d/Graphic3d_DataStructureManager.hxx @@ -21,6 +21,7 @@ #include +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 . Standard_EXPORT Graphic3d_DataStructureManager(); - - -private: - - - + //! Returns camera object of the view. + virtual const Handle(Graphic3d_Camera)& Camera() const = 0; }; - - - - - - #endif // _Graphic3d_DataStructureManager_HeaderFile diff --git a/src/Graphic3d/Graphic3d_Structure.hxx b/src/Graphic3d/Graphic3d_Structure.hxx index 5c0bf76b38..15a6070a40 100644 --- a/src/Graphic3d/Graphic3d_Structure.hxx +++ b/src/Graphic3d/Graphic3d_Structure.hxx @@ -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 //! if is displayed and TOS_COMPUTED. diff --git a/src/Prs3d/FILES b/src/Prs3d/FILES index 31d2a551e6..37271672b8 100755 --- a/src/Prs3d/FILES +++ b/src/Prs3d/FILES @@ -35,8 +35,6 @@ Prs3d_PointAspect.hxx Prs3d_Presentation.hxx Prs3d_PresentationShadow.cxx Prs3d_PresentationShadow.hxx -Prs3d_Projector.cxx -Prs3d_Projector.hxx Prs3d_Root.hxx Prs3d_ShadingAspect.cxx Prs3d_ShadingAspect.hxx diff --git a/src/Prs3d/Prs3d_Projector.cxx b/src/Prs3d/Prs3d_Projector.cxx deleted file mode 100644 index efbe5b7ec6..0000000000 --- a/src/Prs3d/Prs3d_Projector.cxx +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 1995-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. - - -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(Prs3d_Projector,Standard_Transient) - -Prs3d_Projector::Prs3d_Projector (const HLRAlgo_Projector& HLPr): MyProjector(HLPr) -{} - - - -Prs3d_Projector::Prs3d_Projector (const Standard_Boolean Pers, - const Standard_Real Focus, - const Standard_Real DX, - const Standard_Real DY, - const Standard_Real DZ, - const Standard_Real XAt, - const Standard_Real YAt, - const Standard_Real ZAt, - const Standard_Real XUp, - const Standard_Real YUp, - const Standard_Real ZUp) -{ - gp_Pnt At (XAt,YAt,ZAt); - gp_Dir Zpers (DX,DY,DZ); - gp_Dir Ypers (XUp,YUp,ZUp); - gp_Dir Xpers = Ypers.Crossed(Zpers); - gp_Ax3 Axe (At, Zpers, Xpers); - gp_Trsf T; - T.SetTransformation(Axe); - MyProjector = HLRAlgo_Projector(T,Pers,Focus); -} - - -HLRAlgo_Projector Prs3d_Projector::Projector () const -{ - return MyProjector; -} diff --git a/src/Prs3d/Prs3d_Projector.hxx b/src/Prs3d/Prs3d_Projector.hxx deleted file mode 100644 index 0a8324dd84..0000000000 --- a/src/Prs3d/Prs3d_Projector.hxx +++ /dev/null @@ -1,64 +0,0 @@ -// Created on: 1993-03-19 -// Created by: Jean-Louis FRENKEL -// Copyright (c) 1993-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 _Prs3d_Projector_HeaderFile -#define _Prs3d_Projector_HeaderFile - -#include -#include - -#include -#include -#include - -class Prs3d_Projector; -DEFINE_STANDARD_HANDLE(Prs3d_Projector, Standard_Transient) - -//! A projector object. -//! This object defines the parameters of a view for a -//! visualization algorithm. It is, for example, used by the -//! hidden line removal algorithms. -class Prs3d_Projector : public Standard_Transient -{ - -public: - - - Standard_EXPORT Prs3d_Projector(const HLRAlgo_Projector& Pr); - - //! Constructs a projector framework from the following parameters - //! - Pers is true if the view is a perspective view and - //! false if it is an axonometric one; - //! - Focus is the focal length if a perspective view is defined; - //! - DX, DY and DZ are the coordinates of the - //! projection vector; - //! - XAt, YAt and ZAt are the coordinates of the view point; - //! - XUp, YUp and ZUp are the coordinates of the - //! vertical direction vector. - Standard_EXPORT Prs3d_Projector(const Standard_Boolean Pers, const Standard_Real Focus, const Standard_Real DX, const Standard_Real DY, const Standard_Real DZ, const Standard_Real XAt, const Standard_Real YAt, const Standard_Real ZAt, const Standard_Real XUp, const Standard_Real YUp, const Standard_Real ZUp); - - //! Returns a projector object for use in a hidden line removal algorithm. - Standard_EXPORT HLRAlgo_Projector Projector() const; - - DEFINE_STANDARD_RTTIEXT(Prs3d_Projector,Standard_Transient) - -private: - - HLRAlgo_Projector MyProjector; - -}; - -#endif // _Prs3d_Projector_HeaderFile diff --git a/src/PrsMgr/PrsMgr_PresentableObject.cxx b/src/PrsMgr/PrsMgr_PresentableObject.cxx index 64d689a0e3..10edc778af 100644 --- a/src/PrsMgr/PrsMgr_PresentableObject.cxx +++ b/src/PrsMgr/PrsMgr_PresentableObject.cxx @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -99,22 +98,12 @@ void PrsMgr_PresentableObject::Fill (const Handle(PrsMgr_PresentationManager)& t } //======================================================================= -//function : Compute -//purpose : +//function : computeHLR +//purpose : //======================================================================= -void PrsMgr_PresentableObject::Compute(const Handle(Prs3d_Projector)& /*aProjector*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/) -{ - throw Standard_NotImplemented("cannot compute under a specific projector"); -} - -//======================================================================= -//function : Compute -//purpose : -//======================================================================= -void PrsMgr_PresentableObject::Compute(const Handle(Prs3d_Projector)& /* aProjector*/, - const Handle(Geom_Transformation)& /*aTrsf*/, - const Handle(Prs3d_Presentation)& /*aPresentation*/) +void PrsMgr_PresentableObject::computeHLR (const Handle(Graphic3d_Camera)& , + const Handle(Geom_Transformation)& , + const Handle(Prs3d_Presentation)& ) { throw Standard_NotImplemented("cannot compute under a specific projector"); } diff --git a/src/PrsMgr/PrsMgr_PresentableObject.hxx b/src/PrsMgr/PrsMgr_PresentableObject.hxx index 6fda97c954..0d50aaeb07 100644 --- a/src/PrsMgr/PrsMgr_PresentableObject.hxx +++ b/src/PrsMgr/PrsMgr_PresentableObject.hxx @@ -341,21 +341,16 @@ protected: //! @name interface methods const Handle(Prs3d_Presentation)& thePrs, const Standard_Integer theMode) = 0; - //! Calculates the 3D view presentation. + //! Calculates hidden line removal presentation for specific camera position. //! Each of the views in the viewer and every modification such as rotation, for example, entails recalculation. - //! It must be redefined to implement hidden line removal for the object. The user never calls this method himself. - //! This is done via the InteractiveContext object and is dependent on the point of view from which the object is displayed. - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& theProjector, - const Handle(Prs3d_Presentation)& thePrs); - - //! Calculates the 3D view presentation. - //! A point of view is provided by the projector, and the geometric transformation which has transformed associated presentable objects is specified by transformation. - //! This function is to be used in case where a hidden line removal display cannot be calculated automatically. - //! This occurs when associated presentable objects have been transformed geometrically, but not translated. + //! Default implementation throws Standard_NotImplemented exception //! Warning! The transformation must be applied to the object before computation. - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& theProjector, - const Handle(Geom_Transformation)& theTrsf, - const Handle(Prs3d_Presentation)& thePrs); + //! @param theProjector [in] view orientation + //! @param theTrsf [in] additional transformation, or NULL if undefined + //! @param thePrs [in] presentation to fill + Standard_EXPORT virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector, + const Handle(Geom_Transformation)& theTrsf, + const Handle(Prs3d_Presentation)& thePrs); //! Recomputes invalidated presentations of the object. //! @param theToIncludeHidden if TRUE, then even hidden invalidated presentations will be updated diff --git a/src/PrsMgr/PrsMgr_Presentation.cxx b/src/PrsMgr/PrsMgr_Presentation.cxx index fe14f583e0..d9b8ae3c62 100644 --- a/src/PrsMgr/PrsMgr_Presentation.cxx +++ b/src/PrsMgr/PrsMgr_Presentation.cxx @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -188,71 +187,20 @@ void PrsMgr_Presentation::Compute() myPresentableObject->Compute (myPresentationManager, this, aDispMode); } -//======================================================================= -//function : Compute -//purpose : Methods for hidden parts... -//======================================================================= -Handle(Graphic3d_Structure) PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector) -{ - Handle(Graphic3d_Structure) aPrs = new Graphic3d_Structure (myPresentationManager->StructureManager()); - myPresentableObject->Compute (Projector (theProjector), aPrs); - return aPrs; -} - //======================================================================= //function : Compute //purpose : //======================================================================= -void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, - Handle(Graphic3d_Structure)& theStructToFill) +void PrsMgr_Presentation::computeHLR (const Handle(Graphic3d_Camera)& theProjector, + Handle(Graphic3d_Structure)& theStructToFill) { - theStructToFill->Clear(); - Handle(Prs3d_Presentation) aPrs = theStructToFill; - myPresentableObject->Compute (Projector (theProjector), aPrs); -} - -//======================================================================= -//function : Compute -//purpose : -//======================================================================= -Handle(Graphic3d_Structure) PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, - const Handle(Geom_Transformation)& theTrsf) -{ - Handle(Prs3d_Presentation) aPrs3d = new Prs3d_Presentation (myPresentationManager->StructureManager()); - myPresentableObject->Compute (Projector (theProjector), theTrsf, aPrs3d); - return aPrs3d; -} - -//======================================================================= -//function : Compute -//purpose : -//======================================================================= -void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, - const Handle(Geom_Transformation)& theTrsf, - Handle(Graphic3d_Structure)& theStructToFill) -{ - // recompute HLR after transformation in all the case + if (theStructToFill.IsNull()) + { + theStructToFill = new Prs3d_Presentation (myPresentationManager->StructureManager()); + } Handle(Graphic3d_Structure) aPrs = theStructToFill; theStructToFill->Clear(); - myPresentableObject->Compute (Projector (theProjector), theTrsf, aPrs); -} - -//======================================================================= -//function : Projector -//purpose : -//======================================================================= -Handle(Prs3d_Projector) PrsMgr_Presentation::Projector (const Handle(Graphic3d_DataStructureManager)& theProjector) -{ - Handle(Graphic3d_Camera) aCamera = Handle(Graphic3d_CView)::DownCast (theProjector)->Camera(); - const gp_Dir aDir = aCamera->Direction().Reversed(); - const gp_Pnt anAt = aCamera->Center(); - const gp_Dir anUp = aCamera->Up(); - Handle(Prs3d_Projector) aProj = new Prs3d_Projector (!aCamera->IsOrthographic(), - aCamera->Scale(), - aDir.X(), aDir.Y(), aDir.Z(), - anAt.X(), anAt.Y(), anAt.Z(), - anUp.X(), anUp.Y(), anUp.Z()); - return aProj; + myPresentableObject->computeHLR (theProjector, Transformation(), aPrs); } //======================================================================= diff --git a/src/PrsMgr/PrsMgr_Presentation.hxx b/src/PrsMgr/PrsMgr_Presentation.hxx index 85763463b4..6e27895299 100644 --- a/src/PrsMgr/PrsMgr_Presentation.hxx +++ b/src/PrsMgr/PrsMgr_Presentation.hxx @@ -23,11 +23,11 @@ class PrsMgr_PresentationManager; class PrsMgr_PresentableObject; class Quantity_Color; +class Graphic3d_Camera; class Geom_Transformation; class Prs3d_Drawer; class Graphic3d_Structure; class Graphic3d_DataStructureManager; -class Prs3d_Projector; DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, Graphic3d_Structure) @@ -93,20 +93,8 @@ protected: //! Displays myStructure. Standard_EXPORT void display (const Standard_Boolean theIsHighlight); - Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector) Standard_OVERRIDE; - - Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, - const Handle(Geom_Transformation)& theTrsf) Standard_OVERRIDE; - - Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, - Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE; - - Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, - const Handle(Geom_Transformation)& theTrsf, - Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE; - - Standard_EXPORT static Handle(Prs3d_Projector) Projector (const Handle(Graphic3d_DataStructureManager)& theProjector); - + Standard_EXPORT virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector, + Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE; protected: Handle(PrsMgr_PresentationManager) myPresentationManager; diff --git a/src/QABugs/QABugs_17.cxx b/src/QABugs/QABugs_17.cxx index 0660ff45cd..60102a94f7 100644 --- a/src/QABugs/QABugs_17.cxx +++ b/src/QABugs/QABugs_17.cxx @@ -69,7 +69,6 @@ #include #include #include -#include #include #include #include diff --git a/src/StdPrs/FILES b/src/StdPrs/FILES index 94ffef116e..8c307bc97e 100644 --- a/src/StdPrs/FILES +++ b/src/StdPrs/FILES @@ -8,6 +8,8 @@ StdPrs_HLRPolyShape.cxx StdPrs_HLRPolyShape.hxx StdPrs_HLRShape.cxx StdPrs_HLRShape.hxx +StdPrs_HLRShapeI.cxx +StdPrs_HLRShapeI.hxx StdPrs_HLRToolShape.cxx StdPrs_HLRToolShape.hxx StdPrs_Isolines.cxx diff --git a/src/StdPrs/StdPrs_HLRPolyShape.cxx b/src/StdPrs/StdPrs_HLRPolyShape.cxx index 9fa5a5cd75..df97938bbe 100644 --- a/src/StdPrs/StdPrs_HLRPolyShape.cxx +++ b/src/StdPrs/StdPrs_HLRPolyShape.cxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -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; diff --git a/src/StdPrs/StdPrs_HLRPolyShape.hxx b/src/StdPrs/StdPrs_HLRPolyShape.hxx index 5edfc044e2..c5af4f28ce 100644 --- a/src/StdPrs/StdPrs_HLRPolyShape.hxx +++ b/src/StdPrs/StdPrs_HLRPolyShape.hxx @@ -17,59 +17,26 @@ #ifndef _StdPrs_HLRPolyShape_HeaderFile #define _StdPrs_HLRPolyShape_HeaderFile -#include -#include +#include -class TopoDS_Shape; -class Prs3d_Projector; - -//! Instantiates Prs3d_PolyHLRShape to define a -//! display of a shape where hidden and visible lines are -//! identified with respect to a given projection. -//! StdPrs_HLRPolyShape works with a polyhedral -//! simplification of the shape whereas -//! StdPrs_HLRShape takes the shape itself into -//! account. When you use StdPrs_HLRShape, you -//! obtain an exact result, whereas, when you use -//! StdPrs_HLRPolyShape, you reduce computation -//! time but obtain polygonal segments. +//! Instantiates Prs3d_PolyHLRShape to define a display of a shape where hidden +//! and visible lines are identified with respect to a given projection. +//! StdPrs_HLRPolyShape works with a polyhedral simplification of the shape whereas +//! StdPrs_HLRShape takes the shape itself into account. +//! When you use StdPrs_HLRShape, you obtain an exact result, whereas, when you use StdPrs_HLRPolyShape, +//! you reduce computation time but obtain polygonal segments. //! The polygonal algorithm is used. -class StdPrs_HLRPolyShape : public Prs3d_Root +class StdPrs_HLRPolyShape : public StdPrs_HLRShapeI { + DEFINE_STANDARD_RTTIEXT(StdPrs_HLRPolyShape, StdPrs_HLRShapeI) public: - - DEFINE_STANDARD_ALLOC - - //! Defines the hidden line removal display of the - //! topology aShape in the projection defined by - //! aProjector. The shape and the projection are added - //! to the display aPresentation, and the attributes of the - //! elements present in the aPresentation are defined by - //! the attribute manager aDrawer. - Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& aPresentation, const TopoDS_Shape& aShape, const Handle(Prs3d_Drawer)& aDrawer, const Handle(Prs3d_Projector)& aProjector); - - - - -protected: - - - - - -private: - - - - + //! Compute presentation for specified shape. + Standard_EXPORT virtual void ComputeHLR (const Handle(Prs3d_Presentation)& thePrs, + const TopoDS_Shape& theShape, + const Handle(Prs3d_Drawer)& theDrawer, + const Handle(Graphic3d_Camera)& theProjector) const Standard_OVERRIDE; }; - - - - - - #endif // _StdPrs_HLRPolyShape_HeaderFile diff --git a/src/StdPrs/StdPrs_HLRShape.cxx b/src/StdPrs/StdPrs_HLRShape.cxx index 25050b318e..34fa73dcc7 100755 --- a/src/StdPrs/StdPrs_HLRShape.cxx +++ b/src/StdPrs/StdPrs_HLRShape.cxx @@ -11,29 +11,38 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include #include #include -#include -#include #include #include #include #include +#include + +IMPLEMENT_STANDARD_RTTIEXT(StdPrs_HLRShape, StdPrs_HLRShapeI) //======================================================================= -//function : Add -//purpose : +//function : ComputeHLR +//purpose : //======================================================================= - -void StdPrs_HLRShape::Add (const Handle(Prs3d_Presentation)& thePresentation, - const TopoDS_Shape& theShape, - const Handle(Prs3d_Drawer)& theDrawer, - const Handle(Prs3d_Projector)& theProjector) +void StdPrs_HLRShape::ComputeHLR (const Handle(Prs3d_Presentation)& thePresentation, + const TopoDS_Shape& theShape, + const Handle(Prs3d_Drawer)& theDrawer, + const Handle(Graphic3d_Camera)& theProjector) const { - StdPrs_HLRToolShape aTool(theShape, theProjector->Projector()); + 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()); + + StdPrs_HLRToolShape aTool(theShape, aProj); Standard_Integer aNbEdges = aTool.NbEdges(); Standard_Integer anI; Standard_Real anU1, anU2; diff --git a/src/StdPrs/StdPrs_HLRShape.hxx b/src/StdPrs/StdPrs_HLRShape.hxx index 7283538403..6c73a44ca5 100755 --- a/src/StdPrs/StdPrs_HLRShape.hxx +++ b/src/StdPrs/StdPrs_HLRShape.hxx @@ -14,26 +14,20 @@ #ifndef _StdPrs_HLRFace_H__ #define _StdPrs_HLRFace_H__ -#include -#include -#include -#include +#include -// Computes the presentation of objects with -// removal of their hidden lines for a specific -// projector. The exact algorithm is used. - -class StdPrs_HLRShape: public Prs3d_Root +//! Computes the presentation of objects with removal of their hidden lines for a specific projector. +//! The exact algorithm is used. +class StdPrs_HLRShape : public StdPrs_HLRShapeI { + DEFINE_STANDARD_RTTIEXT(StdPrs_HLRShape, StdPrs_HLRShapeI) public: - DEFINE_STANDARD_ALLOC - - Standard_EXPORT static void Add - (const Handle(Prs3d_Presentation)& thePresentation, - const TopoDS_Shape& theShape, - const Handle(Prs3d_Drawer)& theDrawer, - const Handle(Prs3d_Projector)& theProjector); + //! Compute presentation for specified shape. + Standard_EXPORT virtual void ComputeHLR (const Handle(Prs3d_Presentation)& thePrs, + const TopoDS_Shape& theShape, + const Handle(Prs3d_Drawer)& theDrawer, + const Handle(Graphic3d_Camera)& theProjector) const Standard_OVERRIDE; }; #endif diff --git a/src/StdPrs/StdPrs_HLRShapeI.cxx b/src/StdPrs/StdPrs_HLRShapeI.cxx new file mode 100644 index 0000000000..13f44f0d3a --- /dev/null +++ b/src/StdPrs/StdPrs_HLRShapeI.cxx @@ -0,0 +1,16 @@ +// Copyright (c) 2020 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. + +#include + +IMPLEMENT_STANDARD_RTTIEXT(StdPrs_HLRShapeI, Standard_Transient) diff --git a/src/StdPrs/StdPrs_HLRShapeI.hxx b/src/StdPrs/StdPrs_HLRShapeI.hxx new file mode 100644 index 0000000000..2c05d1a233 --- /dev/null +++ b/src/StdPrs/StdPrs_HLRShapeI.hxx @@ -0,0 +1,39 @@ +// Copyright (c) 2020 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 _StdPrs_HLRShapeI_HeaderFile +#define _StdPrs_HLRShapeI_HeaderFile + +#include +#include +#include + +class TopoDS_Shape; +class Prs3d_Drawer; +class Graphic3d_Camera; + +//! Computes the presentation of objects with removal of their hidden lines for a specific projector. +class StdPrs_HLRShapeI : public Standard_Transient +{ + DEFINE_STANDARD_RTTIEXT(StdPrs_HLRShapeI, Standard_Transient) +public: + + //! Compute presentation for specified shape. + virtual void ComputeHLR (const Handle(Prs3d_Presentation)& thePrs, + const TopoDS_Shape& theShape, + const Handle(Prs3d_Drawer)& theDrawer, + const Handle(Graphic3d_Camera)& theProjector) const = 0; + +}; + +#endif // _StdPrs_HLRShapeI_HeaderFile diff --git a/src/StdSelect/StdSelect_Shape.cxx b/src/StdSelect/StdSelect_Shape.cxx index aa20ba5f06..e1f25bb292 100644 --- a/src/StdSelect/StdSelect_Shape.cxx +++ b/src/StdSelect/StdSelect_Shape.cxx @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -58,20 +57,6 @@ void StdSelect_Shape::Compute(const Handle(PrsMgr_PresentationManager3d)& /*PM*/ StdPrs_WFShape::Add (P, mysh, myDrawer); } -void StdSelect_Shape::Compute(const Handle(Prs3d_Projector)& aProjector , - const Handle(Geom_Transformation)& aGeomTrans, - const Handle(Prs3d_Presentation)& aPresentation ) -{ - PrsMgr_PresentableObject::Compute(aProjector,aGeomTrans,aPresentation); -} - - -void StdSelect_Shape::Compute(const Handle(Prs3d_Projector)& aProjector, - const Handle(Prs3d_Presentation)& aPresentation) -{ - PrsMgr_PresentableObject::Compute(aProjector,aPresentation); -} - void StdSelect_Shape::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const { OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream) diff --git a/src/StdSelect/StdSelect_Shape.hxx b/src/StdSelect/StdSelect_Shape.hxx index d3bb771ee7..850f6ade87 100644 --- a/src/StdSelect/StdSelect_Shape.hxx +++ b/src/StdSelect/StdSelect_Shape.hxx @@ -32,15 +32,6 @@ public: Standard_EXPORT StdSelect_Shape(const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer = Handle(Prs3d_Drawer)()); Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE; - - //! computes the presentation according to a point of view - //! given by . - //! To be Used when the associated degenerated Presentations - //! have been transformed by which is not a Pure - //! Translation. The HLR Prs can't be deducted automatically - //! WARNING : must be applied - //! to the object to display before computation !!! - Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; const TopoDS_Shape& Shape() const { return mysh; } @@ -49,10 +40,6 @@ public: //! Dumps the content of me into the stream Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; -private: - - Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE; - private: TopoDS_Shape mysh;