From f1a70360a7f4122d7ac6d4684176f4358d213d5a Mon Sep 17 00:00:00 2001 From: abv Date: Fri, 23 Oct 2015 07:20:32 +0300 Subject: [PATCH] 0026561: Porting CSharp wrapper to OCCT 7.0.0 Added missing Standard_EXPORT for public methods; declaration of unimplemented method removed. Restoring some changes made for #26788 but omitted in its commit. OpenGl_View::ReadDepths() - drop obsolete and broken method; V3d_View::ToPixMap() should be used instead --- src/AIS/AIS_LocalContext.hxx | 4 --- src/BRepFill/BRepFill_Evolved.cxx | 4 +-- src/BRepLib/BRepLib_FindSurface.cxx | 5 ++-- src/Bisector/Bisector_BisecPC.cxx | 20 +++++++------- src/Graphic3d/Graphic3d_CView.hxx | 7 ----- src/OpenGl/OpenGl_View.cxx | 16 ----------- src/OpenGl/OpenGl_View.hxx | 7 ----- src/OpenGl/OpenGl_Window.cxx | 41 ----------------------------- src/OpenGl/OpenGl_Window.hxx | 5 ---- src/ShapeFix/ShapeFix_Edge.hxx | 2 +- 10 files changed, 15 insertions(+), 96 deletions(-) diff --git a/src/AIS/AIS_LocalContext.hxx b/src/AIS/AIS_LocalContext.hxx index eed643be10..02972a28e6 100644 --- a/src/AIS/AIS_LocalContext.hxx +++ b/src/AIS/AIS_LocalContext.hxx @@ -95,10 +95,6 @@ public: Standard_EXPORT void Terminate (const Standard_Boolean updateviewer = Standard_True); - //! to be called when a upper local context was closed... - //! useful to put pack the right projector... - Standard_EXPORT void Reactivate(); - //! returns true if done... Standard_EXPORT Standard_Boolean Display (const Handle(AIS_InteractiveObject)& anInteractive, const Standard_Integer DisplayMode = 0, const Standard_Boolean AllowShapeDecomposition = Standard_True, const Standard_Integer ActivationMode = 0); diff --git a/src/BRepFill/BRepFill_Evolved.cxx b/src/BRepFill/BRepFill_Evolved.cxx index aa834d2c6c..de4f1a4d0e 100644 --- a/src/BRepFill/BRepFill_Evolved.cxx +++ b/src/BRepFill/BRepFill_Evolved.cxx @@ -2095,8 +2095,8 @@ void BRepFill_Evolved::AddTopAndBottom(BRepTools_Quilt& Glue) gp_Pnt PC; gp_Vec VC; C.D1(u,PC,VC); - gp_Vec PPC(P,PC); - gp_Vec Prod = PPC.Crossed(VC); + gp_Vec aPPC(P,PC); + gp_Vec Prod = aPPC.Crossed(VC); if (IsOut) { ToReverse = Prod.Z() < 0.; } diff --git a/src/BRepLib/BRepLib_FindSurface.cxx b/src/BRepLib/BRepLib_FindSurface.cxx index b01ac1b9f2..64451fb673 100644 --- a/src/BRepLib/BRepLib_FindSurface.cxx +++ b/src/BRepLib/BRepLib_FindSurface.cxx @@ -203,7 +203,7 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S, TopoDS_Edge E = TopoDS::Edge(ex.Current()); Standard_Real f,l,ff,ll; - Handle(Geom2d_Curve) PC,PPC; + Handle(Geom2d_Curve) PC,aPPC; Handle(Geom_Surface) SS; TopLoc_Location L; Standard_Integer i = 0,j; @@ -221,8 +221,7 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S, j = 0; for(;;) { j++; - BRep_Tool::CurveOnSurface(TopoDS::Edge(ex.Current()), - PPC,SS,L,ff,ll,j); + BRep_Tool::CurveOnSurface(TopoDS::Edge(ex.Current()),aPPC,SS,L,ff,ll,j); if (SS.IsNull()) { break; } diff --git a/src/Bisector/Bisector_BisecPC.cxx b/src/Bisector/Bisector_BisecPC.cxx index 434ac1e3b6..c1e1672671 100644 --- a/src/Bisector/Bisector_BisecPC.cxx +++ b/src/Bisector/Bisector_BisecPC.cxx @@ -386,11 +386,11 @@ void Bisector_BisecPC::Values(const Standard_Real U, case 2 : {curve->D3(UOnCurve,PC,Tu,Tuu,T3u);break;} } - gp_Vec2d PPC(PC.X() - point.X(), PC.Y() - point.Y()); + gp_Vec2d aPPC(PC.X() - point.X(), PC.Y() - point.Y()); gp_Vec2d Nor( - Tu.Y(), Tu.X()); - Standard_Real SquarePPC = PPC.SquareMagnitude(); - Standard_Real NorPPC = Nor.Dot(PPC); + Standard_Real SquarePPC = aPPC.SquareMagnitude(); + Standard_Real NorPPC = Nor.Dot(aPPC); Standard_Real A1; if (Abs(NorPPC) > gp::Resolution() && (NorPPC*sign) < 0.) { @@ -402,8 +402,8 @@ void Bisector_BisecPC::Values(const Standard_Real U, if (N == 0) return; // End Calculation Point; gp_Vec2d Nu ( - Tuu.Y() , Tuu.X()); // derivative of the normal by U. - Standard_Real NuPPC = Nu .Dot(PPC); - Standard_Real TuPPC = Tu .Dot(PPC); + Standard_Real NuPPC = Nu .Dot(aPPC); + Standard_Real TuPPC = Tu .Dot(aPPC); Standard_Real NorPPCE2 = NorPPC*NorPPC; Standard_Real A2 = TuPPC/NorPPC - 0.5*NuPPC*SquarePPC/NorPPCE2; @@ -415,8 +415,8 @@ void Bisector_BisecPC::Values(const Standard_Real U, gp_Vec2d Nuu ( - T3u.Y() , T3u.X()); Standard_Real NorPPCE4 = NorPPCE2*NorPPCE2; - Standard_Real NuuPPC = Nuu.Dot(PPC); - Standard_Real TuuPPC = Tuu.Dot(PPC); + Standard_Real NuuPPC = Nuu.Dot(aPPC); + Standard_Real TuuPPC = Tuu.Dot(aPPC); Standard_Real A21 = TuuPPC/NorPPC - TuPPC*NuPPC/NorPPCE2; Standard_Real A22 = (0.5*NuuPPC*SquarePPC + NuPPC*TuPPC)/NorPPCE2 - @@ -470,12 +470,12 @@ Standard_Real Bisector_BisecPC::Distance (const Standard_Real U) const Standard_Real UOnCurve = LinkBisCurve(U); curve->D1(UOnCurve,PC,Tan); - gp_Vec2d PPC(PC.X() - point.X(), PC.Y() - point.Y()); + gp_Vec2d aPPC(PC.X() - point.X(), PC.Y() - point.Y()); gp_Vec2d Nor( - Tan.Y(), Tan.X()); Standard_Real NorNor = Nor.SquareMagnitude(); - Standard_Real SquareMagPPC = PPC.SquareMagnitude(); - Standard_Real Prosca = Nor.Dot(PPC); + Standard_Real SquareMagPPC = aPPC.SquareMagnitude(); + Standard_Real Prosca = Nor.Dot(aPPC); if (point.IsEqual(PC,Precision::Confusion())) { if (isConvex) { return 0.;} diff --git a/src/Graphic3d/Graphic3d_CView.hxx b/src/Graphic3d/Graphic3d_CView.hxx index 4fb824b8db..2a29b9101e 100644 --- a/src/Graphic3d/Graphic3d_CView.hxx +++ b/src/Graphic3d/Graphic3d_CView.hxx @@ -296,13 +296,6 @@ public: //! @param theMax [in] the maximum point of scene. virtual void GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax) = 0; - //! Reads depths of shown pixels of the given rectangle. - virtual void ReadDepths (const Standard_Integer theX, - const Standard_Integer theY, - const Standard_Integer theWidth, - const Standard_Integer theHeight, - const Standard_Address theBuffer) const = 0; - //! Dump active rendering buffer into specified memory buffer. virtual Standard_Boolean BufferDump (Image_PixMap& theImage, const Graphic3d_BufferType& theBufferType) = 0; diff --git a/src/OpenGl/OpenGl_View.cxx b/src/OpenGl/OpenGl_View.cxx index 4b3ae3b382..b5723967d7 100644 --- a/src/OpenGl/OpenGl_View.cxx +++ b/src/OpenGl/OpenGl_View.cxx @@ -366,22 +366,6 @@ void OpenGl_View::GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, c myGraduatedTrihedron.SetMinMax (theMin, theMax); } -// ======================================================================= -// function : ReadDepths -// purpose : -// ======================================================================= -void OpenGl_View::ReadDepths (const Standard_Integer theX, - const Standard_Integer theY, - const Standard_Integer theWidth, - const Standard_Integer theHeight, - const Standard_Address theBuffer) const -{ - if (myWindow.IsNull()) - return; - - myWindow->ReadDepths (theX, theY, theWidth, theHeight, (float*)theBuffer); -} - // ======================================================================= // function : BufferDump // purpose : diff --git a/src/OpenGl/OpenGl_View.hxx b/src/OpenGl/OpenGl_View.hxx index 2f0123b4dd..b256b4e759 100644 --- a/src/OpenGl/OpenGl_View.hxx +++ b/src/OpenGl/OpenGl_View.hxx @@ -183,13 +183,6 @@ public: //! @param theMax [in] the maximum point of scene. Standard_EXPORT virtual void GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax) Standard_OVERRIDE; - //! Reads depths of shown pixels of the given rectangle. - Standard_EXPORT virtual void ReadDepths (const Standard_Integer theX, - const Standard_Integer theY, - const Standard_Integer theWidth, - const Standard_Integer theHeight, - const Standard_Address theBuffer) const Standard_OVERRIDE; - //! Dump active rendering buffer into specified memory buffer. Standard_EXPORT virtual Standard_Boolean BufferDump (Image_PixMap& theImage, const Graphic3d_BufferType& theBufferType) Standard_OVERRIDE; diff --git a/src/OpenGl/OpenGl_Window.cxx b/src/OpenGl/OpenGl_Window.cxx index 6a9eb3d85b..15f8141e42 100644 --- a/src/OpenGl/OpenGl_Window.cxx +++ b/src/OpenGl/OpenGl_Window.cxx @@ -702,47 +702,6 @@ void OpenGl_Window::Resize() Init(); } -#endif // !__APPLE__ - -// ======================================================================= -// function : ReadDepths -// purpose : TelReadDepths -// ======================================================================= -void OpenGl_Window::ReadDepths (const Standard_Integer theX, const Standard_Integer theY, - const Standard_Integer theWidth, const Standard_Integer theHeight, - float* theDepths) -{ - if (theDepths == NULL || !Activate()) - return; - - OpenGl_Mat4 aProjectMat; - Graphic3d_TransformUtils::Ortho2D (aProjectMat, - 0.f, static_cast (myWidth), 0.f, static_cast (myHeight)); - - myGlContext->WorldViewState.Push(); - myGlContext->ProjectionState.Push(); - - myGlContext->WorldViewState.SetIdentity(); - myGlContext->ProjectionState.SetCurrent (aProjectMat); - - myGlContext->ApplyProjectionMatrix(); - myGlContext->ApplyWorldViewMatrix(); - -#if !defined(GL_ES_VERSION_2_0) - glRasterPos2i (theX, theY); - myGlContext->DisableFeatures(); - glReadPixels (theX, theY, theWidth, theHeight, GL_DEPTH_COMPONENT, GL_FLOAT, theDepths); - myGlContext->EnableFeatures(); -#endif - - myGlContext->WorldViewState.Pop(); - myGlContext->ProjectionState.Pop(); - - myGlContext->ApplyProjectionMatrix(); -} - -#if !defined(__APPLE__) || defined(MACOSX_USE_GLX) - // ======================================================================= // function : Init // purpose : diff --git a/src/OpenGl/OpenGl_Window.hxx b/src/OpenGl/OpenGl_Window.hxx index 4fd070f0d9..a3ded8f77c 100644 --- a/src/OpenGl/OpenGl_Window.hxx +++ b/src/OpenGl/OpenGl_Window.hxx @@ -59,11 +59,6 @@ public: //! Resizes the window. Standard_EXPORT virtual void Resize(); - //! Reads depth component for current scene into specified buffer. - void ReadDepths (const Standard_Integer theX, const Standard_Integer theY, - const Standard_Integer theWidth, const Standard_Integer theHeight, - float* theDepths); - Handle(Aspect_Window) PlatformWindow() { return myPlatformWindow; } Standard_Integer Width() const { return myWidth; } diff --git a/src/ShapeFix/ShapeFix_Edge.hxx b/src/ShapeFix/ShapeFix_Edge.hxx index ba1a759759..c7dd6d27e4 100644 --- a/src/ShapeFix/ShapeFix_Edge.hxx +++ b/src/ShapeFix/ShapeFix_Edge.hxx @@ -218,7 +218,7 @@ public: Standard_EXPORT void SetContext (const Handle(ShapeBuild_ReShape)& context); //! Returns context - Handle(ShapeBuild_ReShape) Context() const; + Standard_EXPORT Handle(ShapeBuild_ReShape) Context() const; DEFINE_STANDARD_RTTI(ShapeFix_Edge,MMgt_TShared)