diff --git a/samples/mfc/standard/01_Geometry/src/GeomSources.cpp b/samples/mfc/standard/01_Geometry/src/GeomSources.cpp index 562812f08a..9155713280 100755 --- a/samples/mfc/standard/01_Geometry/src/GeomSources.cpp +++ b/samples/mfc/standard/01_Geometry/src/GeomSources.cpp @@ -216,8 +216,7 @@ void GeomSources::DisplaySurface(CGeometryDoc* aDoc, void GeomSources::ResetView(CGeometryDoc* aDoc) { - aDoc->GetAISContext()->CurrentViewer()->InitActiveViews(); - Handle(V3d_View) aView = aDoc->GetAISContext()->CurrentViewer()->ActiveView(); + Handle(V3d_View) aView = aDoc->GetAISContext()->CurrentViewer()->ActiveViews().First(); aView->Reset(); } diff --git a/samples/mfc/standard/04_Viewer3d/src/TexturesExt_Presentation.cpp b/samples/mfc/standard/04_Viewer3d/src/TexturesExt_Presentation.cpp index c0badccdd9..27048c1c0b 100755 --- a/samples/mfc/standard/04_Viewer3d/src/TexturesExt_Presentation.cpp +++ b/samples/mfc/standard/04_Viewer3d/src/TexturesExt_Presentation.cpp @@ -68,8 +68,7 @@ void TexturesExt_Presentation::DoSample() void TexturesExt_Presentation::Init() { // initialize v3d_view so it displays TexturesExt well - getViewer()->InitActiveViews(); - Handle(V3d_View) aView = getViewer()->ActiveView(); + Handle(V3d_View) aView = getViewer()->ActiveViews().First(); aView->SetSize(ZVIEW_SIZE); // getDocument()->UpdateResultMessageDlg("Textured Shape", diff --git a/samples/mfc/standard/04_Viewer3d/src/Viewer3dDoc.cpp b/samples/mfc/standard/04_Viewer3d/src/Viewer3dDoc.cpp index 03b667f934..7e36e17153 100755 --- a/samples/mfc/standard/04_Viewer3d/src/Viewer3dDoc.cpp +++ b/samples/mfc/standard/04_Viewer3d/src/Viewer3dDoc.cpp @@ -1020,8 +1020,7 @@ void CViewer3dDoc::OnDumpView() pView->UpdateWindow(); } - myViewer->InitActiveViews(); - Handle(V3d_View) aView = myViewer->ActiveView(); + Handle(V3d_View) aView = myViewer->ActiveViews().First(); ExportView (aView); } diff --git a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp index fcdeb4598c..62f5df3316 100755 --- a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp +++ b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp @@ -1012,65 +1012,61 @@ aParams.NbMsaaSamples = aParams.NbMsaaSamples == 0 ? 8 : 0;\n\ GetDocument()->UpdateResultMessageDlg("SetAntialiasingOn/SetAntialiasingOff",Message); } -void CViewer3dView::OnClearLights() +void CViewer3dView::OnClearLights() { -// Setting Off all viewer active lights - TColStd_ListOfTransient lights; - for(myView->Viewer()->InitActiveLights(); myView->Viewer()->MoreActiveLights(); myView->Viewer()->NextActiveLights()) +// Setting Off all viewer active lights + V3d_ListOfLight lights; + for (V3d_ListOfLightIterator anIter = myView->Viewer()->ActiveLightIterator(); anIter.More(); anIter.Next()) { - lights.Append(myView->Viewer()->ActiveLight()); + lights.Append (anIter.Value()); } - TColStd_ListIteratorOfListOfTransient itrLights(lights); + V3d_ListOfLightIterator itrLights(lights); for (; itrLights.More(); itrLights.Next()) { - Handle(V3d_Light) light = Handle(V3d_Light)::DownCast(itrLights.Value()); - myView->Viewer()->SetLightOff(light); + myView->Viewer()->SetLightOff (itrLights.Value()); } -// Setting Off all view active lights +// Setting Off all view active lights lights.Clear(); - for(myView->InitActiveLights(); myView->MoreActiveLights(); myView->NextActiveLights()) + for (V3d_ListOfLightIterator anIter = myView->ActiveLightIterator(); anIter.More(); anIter.Next()) { - lights.Append(myView->ActiveLight()); + lights.Append (anIter.Value()); } - itrLights.Initialize(lights); + itrLights.Initialize (lights); for (; itrLights.More(); itrLights.Next()) { - Handle(V3d_Light) light = Handle(V3d_Light)::DownCast(itrLights.Value()); - myView->SetLightOff(light); + myView->SetLightOff (itrLights.Value()); } - myView->Viewer()->SetDefaultLights();// Setting the default lights on + myView->Viewer()->SetDefaultLights(); // Setting the default lights on - NbActiveLights = 2;// There are 2 default active lights + NbActiveLights = 2; // There are 2 default active lights - myView->Update(); + myView->Update(); TCollection_AsciiString Message("\ -// Setting Off all viewer active lights\n\ -TColStd_ListOfTransient lights;\n\ -for(myView->Viewer()->InitActiveLights(); myView->Viewer()->MoreActiveLights(); myView->Viewer()->NextActiveLights())\n\ +// Setting Off all viewer active lights\n\ +V3d_ListOfLight lights;\n\ +for (V3d_ListOfLightIterator anIter = myView->Viewer()->ActiveLightIterator(); anIter.More(); anIter.Next())\n\ {\n\ - lights.Append(myView->Viewer()->ActiveLight());\n\ + lights.Append (anIter.Value());\n\ }\n\ -TColStd_ListIteratorOfListOfTransient itrLights(lights);\n\ +V3d_ListOfLightIterator itrLights(lights);\n\ for (; itrLights.More(); itrLights.Next())\n\ {\n\ - Handle(V3d_Light) light = Handle(V3d_Light)::DownCast(itrLights.Value());\n\ - myView->Viewer()->SetLightOff(light);\n\ + myView->Viewer()->SetLightOff (itrLights.Value())\n\ }\n\ \n\ -// Setting Off all view active lights\n\ +// Setting Off all view active lights\n\ lights.Clear();\n\ -for(myView->InitActiveLights(); myView->MoreActiveLights(); myView->NextActiveLights())\n\ +for (V3d_ListOfLightIterator anIter = myView->ActiveLightIterator(); anIter.More(); anIter.Next())\n\ {\n\ - lights.Append(myView->ActiveLight());\n\ + lights.Append (anIter.Value());\n\ }\n\ itrLights.Initialize(lights);\n\ for (; itrLights.More(); itrLights.Next())\n\ {\n\ - Handle(V3d_Light) light = Handle(V3d_Light)::DownCast(itrLights.Value());\n\ - myView->SetLightOff(light);\n\ + myView->SetLightOff (itrLights.Value());\n\ }\n\ \n\ myView->Viewer()->SetDefaultLights();// Setting the default lights on\n\ diff --git a/samples/mfc/standard/07_Triangulation/src/TriangulationDoc.cpp b/samples/mfc/standard/07_Triangulation/src/TriangulationDoc.cpp index 4b7f5342b0..d25bf8924d 100755 --- a/samples/mfc/standard/07_Triangulation/src/TriangulationDoc.cpp +++ b/samples/mfc/standard/07_Triangulation/src/TriangulationDoc.cpp @@ -413,8 +413,7 @@ void CTriangulationDoc::OnDumpView() pView->UpdateWindow(); } - myViewer->InitActiveViews(); - Handle(V3d_View) aView = myViewer->ActiveView(); + Handle(V3d_View) aView = myViewer->ActiveViews().First(); ExportView (aView); } diff --git a/samples/mfc/standard/10_Convert/src/WNT/OCCDemoDoc.cpp b/samples/mfc/standard/10_Convert/src/WNT/OCCDemoDoc.cpp index 6aa31decc9..ae16d93428 100755 --- a/samples/mfc/standard/10_Convert/src/WNT/OCCDemoDoc.cpp +++ b/samples/mfc/standard/10_Convert/src/WNT/OCCDemoDoc.cpp @@ -230,8 +230,7 @@ void COCCDemoDoc::OnDumpView() pView->UpdateWindow(); } - myViewer->InitActiveViews(); - Handle(V3d_View) aView = myViewer->ActiveView(); + Handle(V3d_View) aView = myViewer->ActiveViews().First(); ExportView (aView); } diff --git a/samples/mfc/standard/Common/OCC_3dBaseDoc.cpp b/samples/mfc/standard/Common/OCC_3dBaseDoc.cpp index 7578112cb0..19ab71b7d7 100755 --- a/samples/mfc/standard/Common/OCC_3dBaseDoc.cpp +++ b/samples/mfc/standard/Common/OCC_3dBaseDoc.cpp @@ -489,8 +489,7 @@ void OCC_3dBaseDoc::OnUpdateV3dButtons (CCmdUI* pCmdUI) // Common function to change raytracing params and redraw view void OCC_3dBaseDoc::OnObjectRayTracingAction() { - myAISContext->CurrentViewer()->InitActiveViews(); - Handle(V3d_View) aView = myAISContext->CurrentViewer()->ActiveView(); + Handle(V3d_View) aView = myAISContext->CurrentViewer()->ActiveViews().First(); Graphic3d_RenderingParams& aParams = aView->ChangeRenderingParams(); if (myRayTracingIsOn) aParams.Method = Graphic3d_RM_RAYTRACING; diff --git a/src/AIS/AIS_ColorScale.cxx b/src/AIS/AIS_ColorScale.cxx index c69883328b..ebc618b81d 100644 --- a/src/AIS/AIS_ColorScale.cxx +++ b/src/AIS/AIS_ColorScale.cxx @@ -415,11 +415,6 @@ Standard_Boolean AIS_ColorScale::FindColor (const Standard_Real theValue, //======================================================================= Standard_Integer AIS_ColorScale::computeMaxLabelWidth (const TColStd_SequenceOfExtendedString& theLabels) const { - { - Handle(V3d_Viewer) aViewer = GetContext()->CurrentViewer(); - aViewer->InitActiveViews(); // for AIS_ColorScale::TextSize() - } - Standard_Integer aWidthMax = 0; for (TColStd_SequenceOfExtendedString::Iterator aLabIter (theLabels); aLabIter.More(); aLabIter.Next()) { diff --git a/src/SelectMgr/SelectMgr_SelectableObject.cxx b/src/SelectMgr/SelectMgr_SelectableObject.cxx index cedd1c00d3..992f814329 100644 --- a/src/SelectMgr/SelectMgr_SelectableObject.cxx +++ b/src/SelectMgr/SelectMgr_SelectableObject.cxx @@ -49,7 +49,6 @@ namespace SelectMgr_SelectableObject::SelectMgr_SelectableObject (const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d) : PrsMgr_PresentableObject (aTypeOfPresentation3d), myGlobalSelMode (0), - mycurrent (0), myAutoHilight (Standard_True) { // diff --git a/src/SelectMgr/SelectMgr_SelectableObject.hxx b/src/SelectMgr/SelectMgr_SelectableObject.hxx index 73885090a2..1d3566b15e 100644 --- a/src/SelectMgr/SelectMgr_SelectableObject.hxx +++ b/src/SelectMgr/SelectMgr_SelectableObject.hxx @@ -172,24 +172,6 @@ public: //! Dumps the content of me into the stream Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const Standard_OVERRIDE; -public: - - //! Begins the iteration scanning for sensitive primitives. - Standard_DEPRECATED("Deprecated method, Selections() should be used instead") - void Init() { mycurrent = 1; } - - //! Continues the iteration scanning for sensitive primitives. - Standard_DEPRECATED("Deprecated method, Selections() should be used instead") - Standard_Boolean More() const { return mycurrent <= myselections.Length(); } - - //! Continues the iteration scanning for sensitive primitives. - Standard_DEPRECATED("Deprecated method, Selections() should be used instead") - void Next() { ++mycurrent; } - - //! Returns the current selection in this framework. - Standard_DEPRECATED("Deprecated method, Selections() should be used instead") - const Handle(SelectMgr_Selection)& CurrentSelection() const { return myselections (mycurrent); } - protected: //! Protected empty constructor. @@ -214,7 +196,6 @@ protected: Handle(Prs3d_Presentation) mySelectionPrs; //!< optional presentation for highlighting selected object Handle(Prs3d_Presentation) myHilightPrs; //!< optional presentation for highlighting detected object Standard_Integer myGlobalSelMode; //!< global selection mode - Standard_Integer mycurrent; //!< [deprecated] iterator value Standard_Boolean myAutoHilight; //!< auto-highlighting flag defining }; diff --git a/src/SelectMgr/SelectMgr_Selection.cxx b/src/SelectMgr/SelectMgr_Selection.cxx index b42881df73..8109a3dbd9 100644 --- a/src/SelectMgr/SelectMgr_Selection.cxx +++ b/src/SelectMgr/SelectMgr_Selection.cxx @@ -26,8 +26,7 @@ IMPLEMENT_STANDARD_RTTIEXT(SelectMgr_Selection,Standard_Transient) // Purpose : //================================================== SelectMgr_Selection::SelectMgr_Selection (const Standard_Integer theModeIdx) -: myEntityIter (0), - myMode (theModeIdx), +: myMode (theModeIdx), mySelectionState (SelectMgr_SOS_Unknown), myBVHUpdateStatus (SelectMgr_TBU_None), mySensFactor (2), diff --git a/src/SelectMgr/SelectMgr_Selection.hxx b/src/SelectMgr/SelectMgr_Selection.hxx index 1287306fb0..500b2d6f14 100644 --- a/src/SelectMgr/SelectMgr_Selection.hxx +++ b/src/SelectMgr/SelectMgr_Selection.hxx @@ -92,25 +92,6 @@ public: //! Return entities. NCollection_Vector& ChangeEntities() { return myEntities; } - //! Begins an iteration scanning for sensitive primitives. - Standard_DEPRECATED("Deprecated method, Entities() should be used instead") - void Init() { myEntityIter = myEntities.Lower(); } - - //! Continues the iteration scanning for sensitive - //! primitives with the mode defined in this framework. - Standard_DEPRECATED("Deprecated method, Entities() should be used instead") - Standard_Boolean More() const { return myEntityIter <= myEntities.Upper(); } - - //! Returns the next sensitive primitive found in the - //! iteration. This is a scan for entities with the mode - //! defined in this framework. - Standard_DEPRECATED("Deprecated method, Entities() should be used instead") - void Next() { ++myEntityIter; } - - //! Returns any sensitive primitive in this framework. - Standard_DEPRECATED("Deprecated method, Entities() should be used instead") - const Handle(SelectMgr_SensitiveEntity)& Sensitive() const { return myEntities.Value (myEntityIter); } - //! Returns the flag UpdateFlag. //! This flage gives the update status of this framework //! in a ViewerSelector object: @@ -142,7 +123,6 @@ public: private: NCollection_Vector myEntities; - Standard_Integer myEntityIter; Standard_Integer myMode; SelectMgr_TypeOfUpdate myUpdateStatus; mutable SelectMgr_StateOfSelection mySelectionState; diff --git a/src/V3d/V3d_AmbientLight.cxx b/src/V3d/V3d_AmbientLight.cxx index 3dc99869fe..a64ee21861 100644 --- a/src/V3d/V3d_AmbientLight.cxx +++ b/src/V3d/V3d_AmbientLight.cxx @@ -28,18 +28,3 @@ V3d_AmbientLight::V3d_AmbientLight (const Quantity_Color& theColor) { SetColor (theColor); } - -// ======================================================================= -// function : V3d_AmbientLight -// purpose : -// ======================================================================= -V3d_AmbientLight::V3d_AmbientLight (const Handle(V3d_Viewer)& theViewer, - const Quantity_Color& theColor) -: Graphic3d_CLight (Graphic3d_TOLS_AMBIENT) -{ - SetColor (theColor); - if (!theViewer.IsNull()) - { - theViewer->AddLight (this); - } -} diff --git a/src/V3d/V3d_AmbientLight.hxx b/src/V3d/V3d_AmbientLight.hxx index eccc5a0124..8a19d9df20 100644 --- a/src/V3d/V3d_AmbientLight.hxx +++ b/src/V3d/V3d_AmbientLight.hxx @@ -31,12 +31,6 @@ public: //! The default Color of this light source is WHITE. Standard_EXPORT V3d_AmbientLight (const Quantity_Color& theColor = Quantity_NOC_WHITE); - //! Constructs an ambient light source in the viewer. - //! The default Color of this light source is WHITE. - Standard_DEPRECATED("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()") - Standard_EXPORT V3d_AmbientLight (const Handle(V3d_Viewer)& theViewer, - const Quantity_Color& theColor = Quantity_NOC_WHITE); - //! @name hidden properties not applicable to ambient light private: diff --git a/src/V3d/V3d_DirectionalLight.cxx b/src/V3d/V3d_DirectionalLight.cxx index 69aac382fa..ab4aa39a1f 100644 --- a/src/V3d/V3d_DirectionalLight.cxx +++ b/src/V3d/V3d_DirectionalLight.cxx @@ -24,7 +24,7 @@ IMPLEMENT_STANDARD_RTTIEXT(V3d_DirectionalLight,V3d_PositionLight) V3d_DirectionalLight::V3d_DirectionalLight (const V3d_TypeOfOrientation theDirection, const Quantity_Color& theColor, const Standard_Boolean theIsHeadlight) -: V3d_PositionLight (Graphic3d_TOLS_DIRECTIONAL, Handle(V3d_Viewer)()) +: V3d_PositionLight (Graphic3d_TOLS_DIRECTIONAL) { SetColor (theColor); SetHeadlight (theIsHeadlight); @@ -38,48 +38,13 @@ V3d_DirectionalLight::V3d_DirectionalLight (const V3d_TypeOfOrientation theDirec V3d_DirectionalLight::V3d_DirectionalLight (const gp_Dir& theDirection, const Quantity_Color& theColor, const Standard_Boolean theIsHeadlight) -: V3d_PositionLight (Graphic3d_TOLS_DIRECTIONAL, Handle(V3d_Viewer)()) +: V3d_PositionLight (Graphic3d_TOLS_DIRECTIONAL) { SetColor (theColor); SetHeadlight (theIsHeadlight); SetDirection (theDirection); } -// ======================================================================= -// function : V3d_DirectionalLight -// purpose : -// ======================================================================= -V3d_DirectionalLight::V3d_DirectionalLight (const Handle(V3d_Viewer)& theViewer, - const V3d_TypeOfOrientation theDirection, - const Quantity_Color& theColor, - const Standard_Boolean theIsHeadlight) -: V3d_PositionLight (Graphic3d_TOLS_DIRECTIONAL, theViewer) -{ - SetColor (theColor); - SetHeadlight (theIsHeadlight); - SetDirection (V3d::GetProjAxis (theDirection)); -} - -// ======================================================================= -// function : V3d_DirectionalLight -// purpose : -// ======================================================================= -V3d_DirectionalLight::V3d_DirectionalLight (const Handle(V3d_Viewer)& theViewer, - const Standard_Real theXt, - const Standard_Real theYt, - const Standard_Real theZt, - const Standard_Real theXp, - const Standard_Real theYp, - const Standard_Real theZp, - const Quantity_Color& theColor, - const Standard_Boolean theIsHeadlight) -: V3d_PositionLight (Graphic3d_TOLS_DIRECTIONAL, theViewer) -{ - SetColor (theColor); - SetHeadlight (theIsHeadlight); - SetDirection (gp_Dir (gp_XYZ (theXt, theYt, theZt) - gp_XYZ(theXp, theYp, theZp))); -} - // ======================================================================= // function : SetDirection // purpose : diff --git a/src/V3d/V3d_DirectionalLight.hxx b/src/V3d/V3d_DirectionalLight.hxx index 30215cc9c3..73cb5b174d 100644 --- a/src/V3d/V3d_DirectionalLight.hxx +++ b/src/V3d/V3d_DirectionalLight.hxx @@ -40,29 +40,6 @@ public: Standard_EXPORT void SetDirection (V3d_TypeOfOrientation theDirection); using Graphic3d_CLight::SetDirection; -public: - - Standard_DEPRECATED("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()") - Standard_EXPORT V3d_DirectionalLight (const Handle(V3d_Viewer)& theViewer, - const V3d_TypeOfOrientation theDirection = V3d_XposYposZpos, - const Quantity_Color& theColor = Quantity_NOC_WHITE, - const Standard_Boolean theIsHeadlight = Standard_False); - - //! Creates a directional light source in the viewer. - //! theXt, theYt, theZt : Coordinate of light source Target. - //! theXp, theYp, theZp : Coordinate of light source Position. - //! The others parameters describe before. - Standard_DEPRECATED("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()") - Standard_EXPORT V3d_DirectionalLight (const Handle(V3d_Viewer)& theViewer, - const Standard_Real theXt, - const Standard_Real theYt, - const Standard_Real theZt, - const Standard_Real theXp, - const Standard_Real theYp, - const Standard_Real theZp, - const Quantity_Color& theColor = Quantity_NOC_WHITE, - const Standard_Boolean theIsHeadlight = Standard_False); - //! @name hidden properties not applicable to directional light private: diff --git a/src/V3d/V3d_PositionLight.cxx b/src/V3d/V3d_PositionLight.cxx index fae0432234..8f2a6170ca 100644 --- a/src/V3d/V3d_PositionLight.cxx +++ b/src/V3d/V3d_PositionLight.cxx @@ -13,20 +13,13 @@ #include -#include - IMPLEMENT_STANDARD_RTTIEXT(V3d_PositionLight, Graphic3d_CLight) // ======================================================================= // function : V3d_PositionLight // purpose : // ======================================================================= -V3d_PositionLight::V3d_PositionLight (Graphic3d_TypeOfLightSource theType, - const Handle(V3d_Viewer)& theViewer) +V3d_PositionLight::V3d_PositionLight (Graphic3d_TypeOfLightSource theType) : Graphic3d_CLight (theType) { - if (!theViewer.IsNull()) - { - theViewer->AddLight (this); - } } diff --git a/src/V3d/V3d_PositionLight.hxx b/src/V3d/V3d_PositionLight.hxx index f1a656c8b0..b0b781f010 100644 --- a/src/V3d/V3d_PositionLight.hxx +++ b/src/V3d/V3d_PositionLight.hxx @@ -22,8 +22,6 @@ #include #include -class V3d_Viewer; - //! Base class for Positional, Spot and Directional Light classes. class V3d_PositionLight : public Graphic3d_CLight { @@ -31,8 +29,7 @@ class V3d_PositionLight : public Graphic3d_CLight protected: //! Protected constructor. - Standard_EXPORT V3d_PositionLight (Graphic3d_TypeOfLightSource theType, - const Handle(V3d_Viewer)& theViewer); + Standard_EXPORT V3d_PositionLight (Graphic3d_TypeOfLightSource theType); //! @name hidden properties not applicable to positional light protected: diff --git a/src/V3d/V3d_PositionalLight.cxx b/src/V3d/V3d_PositionalLight.cxx index 9cc8660b15..7613a824ee 100644 --- a/src/V3d/V3d_PositionalLight.cxx +++ b/src/V3d/V3d_PositionalLight.cxx @@ -21,26 +21,8 @@ IMPLEMENT_STANDARD_RTTIEXT(V3d_PositionalLight,V3d_PositionLight) // ======================================================================= V3d_PositionalLight::V3d_PositionalLight (const gp_Pnt& thePos, const Quantity_Color& theColor) -: V3d_PositionLight (Graphic3d_TOLS_POSITIONAL, Handle(V3d_Viewer)()) +: V3d_PositionLight (Graphic3d_TOLS_POSITIONAL) { SetColor (theColor); SetPosition (thePos); } - -// ======================================================================= -// function : V3d_PositionalLight -// purpose : -// ======================================================================= -V3d_PositionalLight::V3d_PositionalLight (const Handle(V3d_Viewer)& theViewer, - const Standard_Real theX, - const Standard_Real theY, - const Standard_Real theZ, - const Quantity_Color& theColor, - const Standard_Real theConstAttenuation, - const Standard_Real theLinearAttenuation) -: V3d_PositionLight (Graphic3d_TOLS_POSITIONAL, theViewer) -{ - SetColor (theColor); - SetPosition (theX, theY, theZ); - SetAttenuation ((float )theConstAttenuation, (float )theLinearAttenuation); -} diff --git a/src/V3d/V3d_PositionalLight.hxx b/src/V3d/V3d_PositionalLight.hxx index 33905e5edf..5e34b370ab 100644 --- a/src/V3d/V3d_PositionalLight.hxx +++ b/src/V3d/V3d_PositionalLight.hxx @@ -38,17 +38,6 @@ public: using Graphic3d_CLight::Position; using Graphic3d_CLight::SetPosition; -public: - - Standard_DEPRECATED("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()") - Standard_EXPORT V3d_PositionalLight (const Handle(V3d_Viewer)& theViewer, - const Standard_Real theX, - const Standard_Real theY, - const Standard_Real theZ, - const Quantity_Color& theColor = Quantity_NOC_WHITE, - const Standard_Real theConstAttenuation = 1.0, - const Standard_Real theLinearAttenuation = 0.0); - //! @name hidden properties not applicable to positional light private: diff --git a/src/V3d/V3d_SpotLight.cxx b/src/V3d/V3d_SpotLight.cxx index 1329ec3cf1..faae6f9b0f 100644 --- a/src/V3d/V3d_SpotLight.cxx +++ b/src/V3d/V3d_SpotLight.cxx @@ -24,7 +24,7 @@ IMPLEMENT_STANDARD_RTTIEXT(V3d_SpotLight,V3d_PositionLight) V3d_SpotLight::V3d_SpotLight (const gp_Pnt& thePos, const V3d_TypeOfOrientation theDirection, const Quantity_Color& theColor) -: V3d_PositionLight (Graphic3d_TOLS_SPOT, Handle(V3d_Viewer)()) +: V3d_PositionLight (Graphic3d_TOLS_SPOT) { SetColor (theColor); SetPosition (thePos); @@ -38,63 +38,13 @@ V3d_SpotLight::V3d_SpotLight (const gp_Pnt& thePos, V3d_SpotLight::V3d_SpotLight (const gp_Pnt& thePos, const gp_Dir& theDirection, const Quantity_Color& theColor) -: V3d_PositionLight (Graphic3d_TOLS_SPOT, Handle(V3d_Viewer)()) +: V3d_PositionLight (Graphic3d_TOLS_SPOT) { SetColor (theColor); SetPosition (thePos); SetDirection (theDirection); } -// ======================================================================= -// function : V3d_SpotLight -// purpose : -// ======================================================================= -V3d_SpotLight::V3d_SpotLight (const Handle(V3d_Viewer)& theViewer, - const Standard_Real theX, - const Standard_Real theY, - const Standard_Real theZ, - const V3d_TypeOfOrientation theDirection, - const Quantity_Color& theColor, - const Standard_Real theConstAttenuation, - const Standard_Real theLinearAttenuation, - const Standard_Real theConcentration, - const Standard_Real theAngle) -: V3d_PositionLight (Graphic3d_TOLS_SPOT, theViewer) -{ - SetColor (theColor); - SetPosition (theX, theY, theZ); - SetDirection (V3d::GetProjAxis (theDirection)); - SetAttenuation ((float )theConstAttenuation, (float )theLinearAttenuation); - SetConcentration ((float )theConcentration); - SetAngle ((float )theAngle); -} - -// ======================================================================= -// function : V3d_SpotLight -// purpose : -// ======================================================================= -V3d_SpotLight::V3d_SpotLight (const Handle(V3d_Viewer)& theViewer, - const Standard_Real theXt, - const Standard_Real theYt, - const Standard_Real theZt, - const Standard_Real theXp, - const Standard_Real theYp, - const Standard_Real theZp, - const Quantity_Color& theColor, - const Standard_Real theConstAttenuation, - const Standard_Real theLinearAttenuation, - const Standard_Real theConcentration, - const Standard_Real theAngle) -: V3d_PositionLight (Graphic3d_TOLS_SPOT, theViewer) -{ - SetColor (theColor); - SetPosition (theXp, theYp, theZp); - SetDirection (theXt - theXp, theYt - theYp, theZt - theZp); - SetAttenuation ((float )theConstAttenuation, (float )theLinearAttenuation); - SetConcentration ((float )theConcentration); - SetAngle ((float )theAngle); -} - // ======================================================================= // function : SetDirection // purpose : diff --git a/src/V3d/V3d_SpotLight.hxx b/src/V3d/V3d_SpotLight.hxx index 8d1de06551..1bdccbde98 100644 --- a/src/V3d/V3d_SpotLight.hxx +++ b/src/V3d/V3d_SpotLight.hxx @@ -52,36 +52,6 @@ public: using Graphic3d_CLight::Position; using Graphic3d_CLight::SetPosition; -public: - - Standard_DEPRECATED("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()") - Standard_EXPORT V3d_SpotLight (const Handle(V3d_Viewer)& theViewer, - const Standard_Real theX, - const Standard_Real theY, - const Standard_Real theZ, - const V3d_TypeOfOrientation theDirection = V3d_XnegYnegZpos, - const Quantity_Color& theColor = Quantity_NOC_WHITE, - const Standard_Real theConstAttenuation = 1.0, - const Standard_Real theLinearAttenuation = 0.0, - const Standard_Real theConcentration = 1.0, - const Standard_Real theAngle = 0.523599); - - //! theXt, theYt, theZt : Coordinate of light source Target. - //! theXp, theYp, theZp : Coordinate of light source Position. - Standard_DEPRECATED("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()") - Standard_EXPORT V3d_SpotLight (const Handle(V3d_Viewer)& theViewer, - const Standard_Real theXt, - const Standard_Real theYt, - const Standard_Real theZt, - const Standard_Real theXp, - const Standard_Real theYp, - const Standard_Real theZp, - const Quantity_Color& theColor = Quantity_NOC_WHITE, - const Standard_Real theConstAttenuation = 1.0, - const Standard_Real theLinearAttenuation = 0.0, - const Standard_Real theConcentration = 1.0, - const Standard_Real theAngle = 0.523599); - }; DEFINE_STANDARD_HANDLE(V3d_SpotLight, V3d_PositionLight) diff --git a/src/V3d/V3d_View.hxx b/src/V3d/V3d_View.hxx index 9f162ac9de..98af39c189 100644 --- a/src/V3d/V3d_View.hxx +++ b/src/V3d/V3d_View.hxx @@ -707,24 +707,12 @@ public: //! Returns the current visualisation mode. Standard_EXPORT V3d_TypeOfVisualization Visualization() const; - //! Returns True if One light more can be - //! activated in this View. - Standard_EXPORT Standard_Boolean IfMoreLights() const; + //! Returns a list of active lights. + const V3d_ListOfLight& ActiveLights() const { return myActiveLights; } //! Return iterator for defined lights. V3d_ListOfLightIterator ActiveLightIterator() const { return V3d_ListOfLightIterator (myActiveLights); } - //! initializes an iteration on the active Lights. - void InitActiveLights() { myActiveLightsIterator.Initialize (myActiveLights); } - - //! returns true if there are more active Light(s) to return. - Standard_Boolean MoreActiveLights() const { return myActiveLightsIterator.More(); } - - //! Go to the next active Light (if there is not, ActiveLight will raise an exception) - void NextActiveLights() { myActiveLightsIterator.Next(); } - - const Handle(V3d_Light)& ActiveLight() const { return myActiveLightsIterator.Value(); } - //! Returns the MAX number of light associated to the view. Standard_EXPORT Standard_Integer LightLimit() const; @@ -969,6 +957,28 @@ public: DEFINE_STANDARD_RTTIEXT(V3d_View,Standard_Transient) +public: //! @name deprecated methods + + //! Returns True if One light more can be + //! activated in this View. + Standard_DEPRECATED ("Deprecated method - ActiveLights() should be used instead") + Standard_EXPORT Standard_Boolean IfMoreLights() const; + + //! initializes an iteration on the active Lights. + Standard_DEPRECATED ("Deprecated method - ActiveLights() should be used instead") + void InitActiveLights() { myActiveLightsIterator.Initialize (myActiveLights); } + + //! returns true if there are more active Light(s) to return. + Standard_DEPRECATED ("Deprecated method - ActiveLights() should be used instead") + Standard_Boolean MoreActiveLights() const { return myActiveLightsIterator.More(); } + + //! Go to the next active Light (if there is not, ActiveLight will raise an exception) + Standard_DEPRECATED ("Deprecated method - ActiveLights() should be used instead") + void NextActiveLights() { myActiveLightsIterator.Next(); } + + Standard_DEPRECATED ("Deprecated method - ActiveLights() should be used instead") + const Handle(V3d_Light)& ActiveLight() const { return myActiveLightsIterator.Value(); } + protected: Standard_EXPORT void ImmediateUpdate() const; diff --git a/src/V3d/V3d_Viewer.hxx b/src/V3d/V3d_Viewer.hxx index 51e2db182f..306c74c98b 100644 --- a/src/V3d/V3d_Viewer.hxx +++ b/src/V3d/V3d_Viewer.hxx @@ -237,39 +237,23 @@ public: public: + //! Return a list of active views. + const V3d_ListOfView& ActiveViews() const { return myActiveViews; } + //! Return an iterator for active views. V3d_ListOfViewIterator ActiveViewIterator() const { return V3d_ListOfViewIterator (myActiveViews); } - //! Initializes an internal iterator on the active views. - void InitActiveViews() { myActiveViewsIterator.Initialize (myActiveViews); } - - //! Returns true if there are more active view(s) to return. - Standard_Boolean MoreActiveViews() const { return myActiveViewsIterator.More(); } - - //! Go to the next active view (if there is not, ActiveView will raise an exception) - void NextActiveViews() { if (!myActiveViews.IsEmpty()) myActiveViewsIterator.Next(); } - - const Handle(V3d_View)& ActiveView() const { return myActiveViewsIterator.Value(); } - //! returns true if there is only one active view. Standard_Boolean LastActiveView() const { return myActiveViews.Extent() == 1; } public: + //! Return a list of defined views. + const V3d_ListOfView& DefinedViews() const { return myDefinedViews; } + //! Return an iterator for defined views. V3d_ListOfViewIterator DefinedViewIterator() const { return V3d_ListOfViewIterator (myDefinedViews); } - //! Initializes an internal iterator on the Defined views. - void InitDefinedViews() { myDefinedViewsIterator.Initialize (myDefinedViews); } - - //! returns true if there are more Defined view(s) to return. - Standard_Boolean MoreDefinedViews() const { return myDefinedViewsIterator.More(); } - - //! Go to the next Defined view (if there is not, DefinedView will raise an exception) - void NextDefinedViews() { if (!myDefinedViews.IsEmpty()) myDefinedViewsIterator.Next(); } - - const Handle(V3d_View)& DefinedView() const { return myDefinedViewsIterator.Value(); } - public: //! @name lights management //! Defines default lights: @@ -302,36 +286,20 @@ public: //! @name lights management Standard_EXPORT Standard_Boolean IsGlobalLight (const Handle(V3d_Light)& TheLight) const; + //! Return a list of active lights. + const V3d_ListOfLight& ActiveLights() const { return myActiveLights; } + //! Return an iterator for defined lights. V3d_ListOfLightIterator ActiveLightIterator() const { return V3d_ListOfLightIterator (myActiveLights); } - //! Initializes an internal iteratator on the active Lights. - void InitActiveLights() { myActiveLightsIterator.Initialize (myActiveLights); } - - //! returns true if there are more active Light(s) to return. - Standard_Boolean MoreActiveLights() const { return myActiveLightsIterator.More(); } - - //! Go to the next active Light (if there is not, ActiveLight() will raise an exception) - void NextActiveLights() { myActiveLightsIterator.Next(); } - - const Handle(V3d_Light)& ActiveLight() const { return myActiveLightsIterator.Value(); } - public: + //! Return a list of defined lights. + const V3d_ListOfLight& DefinedLights() const { return myDefinedLights; } + //! Return an iterator for defined lights. V3d_ListOfLightIterator DefinedLightIterator() const { return V3d_ListOfLightIterator (myDefinedLights); } - //! Initializes an internal iterattor on the Defined Lights. - void InitDefinedLights() { myDefinedLightsIterator.Initialize (myDefinedLights); } - - //! Returns true if there are more Defined Light(s) to return. - Standard_Boolean MoreDefinedLights() const { return myDefinedLightsIterator.More(); } - - //! Go to the next Defined Light (if there is not, DefinedLight() will raise an exception) - void NextDefinedLights() { if (!myDefinedLights.IsEmpty()) myDefinedLightsIterator.Next(); } - - const Handle(V3d_Light)& DefinedLight() const { return myDefinedLightsIterator.Value(); } - public: //! @name objects management //! Erase all Objects in All the views. @@ -480,6 +448,66 @@ public: //! @name deprecated methods aColor.Values (theV1, theV2, theV3, theType) ; } + //! Initializes an internal iterator on the active views. + Standard_DEPRECATED ("Deprecated method - ActiveViews() should be used instead") + void InitActiveViews() { myActiveViewsIterator.Initialize (myActiveViews); } + + //! Returns true if there are more active view(s) to return. + Standard_DEPRECATED ("Deprecated method - ActiveViews() should be used instead") + Standard_Boolean MoreActiveViews() const { return myActiveViewsIterator.More(); } + + //! Go to the next active view (if there is not, ActiveView will raise an exception) + Standard_DEPRECATED ("Deprecated method - ActiveViews() should be used instead") + void NextActiveViews() { if (!myActiveViews.IsEmpty()) myActiveViewsIterator.Next(); } + + Standard_DEPRECATED ("Deprecated method - ActiveViews() should be used instead") + const Handle(V3d_View)& ActiveView() const { return myActiveViewsIterator.Value(); } + + //! Initializes an internal iterator on the Defined views. + Standard_DEPRECATED ("Deprecated method - DefinedViews() should be used instead") + void InitDefinedViews() { myDefinedViewsIterator.Initialize (myDefinedViews); } + + //! returns true if there are more Defined view(s) to return. + Standard_DEPRECATED ("Deprecated method - DefinedViews() should be used instead") + Standard_Boolean MoreDefinedViews() const { return myDefinedViewsIterator.More(); } + + //! Go to the next Defined view (if there is not, DefinedView will raise an exception) + Standard_DEPRECATED ("Deprecated method - DefinedViews() should be used instead") + void NextDefinedViews() { if (!myDefinedViews.IsEmpty()) myDefinedViewsIterator.Next(); } + + Standard_DEPRECATED ("Deprecated method - DefinedViews() should be used instead") + const Handle(V3d_View)& DefinedView() const { return myDefinedViewsIterator.Value(); } + + //! Initializes an internal iteratator on the active Lights. + Standard_DEPRECATED ("Deprecated method - ActiveLights() should be used instead") + void InitActiveLights() { myActiveLightsIterator.Initialize (myActiveLights); } + + //! returns true if there are more active Light(s) to return. + Standard_DEPRECATED ("Deprecated method - ActiveLights() should be used instead") + Standard_Boolean MoreActiveLights() const { return myActiveLightsIterator.More(); } + + //! Go to the next active Light (if there is not, ActiveLight() will raise an exception) + Standard_DEPRECATED ("Deprecated method - ActiveLights() should be used instead") + void NextActiveLights() { myActiveLightsIterator.Next(); } + + Standard_DEPRECATED ("Deprecated method - ActiveLights() should be used instead") + const Handle(V3d_Light)& ActiveLight() const { return myActiveLightsIterator.Value(); } + + //! Initializes an internal iterattor on the Defined Lights. + Standard_DEPRECATED ("Deprecated method - DefinedLights() should be used instead") + void InitDefinedLights() { myDefinedLightsIterator.Initialize (myDefinedLights); } + + //! Returns true if there are more Defined Light(s) to return. + Standard_DEPRECATED ("Deprecated method - DefinedLights() should be used instead") + Standard_Boolean MoreDefinedLights() const { return myDefinedLightsIterator.More(); } + + //! Go to the next Defined Light (if there is not, DefinedLight() will raise an exception) + Standard_DEPRECATED ("Deprecated method - DefinedLights() should be used instead") + void NextDefinedLights() { if (!myDefinedLights.IsEmpty()) myDefinedLightsIterator.Next(); } + + Standard_DEPRECATED ("Deprecated method - DefinedLights() should be used instead") + const Handle(V3d_Light)& DefinedLight() const { return myDefinedLightsIterator.Value(); } + private: //! Returns the default background colour. diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index dad8389bf2..1022ba9d35 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -2564,8 +2564,8 @@ void ViewerTest::RemoveView (const TCollection_AsciiString& theViewName, const S if (!aCurrentContext.IsNull()) { // Check if there are more difined views in the viewer - aCurrentContext->CurrentViewer()->InitDefinedViews(); - if ((isContextRemoved || ViewerTest_myContexts.Size() != 1) && !aCurrentContext->CurrentViewer()->MoreDefinedViews()) + if ((isContextRemoved || ViewerTest_myContexts.Size() != 1) + && aCurrentContext->CurrentViewer()->DefinedViews().IsEmpty()) { // Remove driver if there is no viewers that use it Standard_Boolean isRemoveDriver = Standard_True; diff --git a/tools/View/View_Displayer.cxx b/tools/View/View_Displayer.cxx index e218cae80e..50d41a989c 100644 --- a/tools/View/View_Displayer.cxx +++ b/tools/View/View_Displayer.cxx @@ -284,9 +284,10 @@ Handle(V3d_View) View_Displayer::GetView() const const Handle(V3d_Viewer)& aViewer = GetContext()->CurrentViewer(); if (!aViewer.IsNull()) { - aViewer->InitActiveViews(); - if (aViewer->MoreActiveViews()) - aView = aViewer->ActiveView(); + if (!aViewer->ActiveViews().IsEmpty()) + { + aView = aViewer->ActiveViews().First(); + } } return aView; }