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();
}
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",
pView->UpdateWindow();
}
- myViewer->InitActiveViews();
- Handle(V3d_View) aView = myViewer->ActiveView();
+ Handle(V3d_View) aView = myViewer->ActiveViews().First();
ExportView (aView);
}
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\
pView->UpdateWindow();
}
- myViewer->InitActiveViews();
- Handle(V3d_View) aView = myViewer->ActiveView();
+ Handle(V3d_View) aView = myViewer->ActiveViews().First();
ExportView (aView);
}
pView->UpdateWindow();
}
- myViewer->InitActiveViews();
- Handle(V3d_View) aView = myViewer->ActiveView();
+ Handle(V3d_View) aView = myViewer->ActiveViews().First();
ExportView (aView);
}
// 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;
//=======================================================================
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())
{
SelectMgr_SelectableObject::SelectMgr_SelectableObject (const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d)
: PrsMgr_PresentableObject (aTypeOfPresentation3d),
myGlobalSelMode (0),
- mycurrent (0),
myAutoHilight (Standard_True)
{
//
//! 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.
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
};
// 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),
//! Return entities.
NCollection_Vector<Handle(SelectMgr_SensitiveEntity)>& 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:
private:
NCollection_Vector<Handle(SelectMgr_SensitiveEntity)> myEntities;
- Standard_Integer myEntityIter;
Standard_Integer myMode;
SelectMgr_TypeOfUpdate myUpdateStatus;
mutable SelectMgr_StateOfSelection mySelectionState;
{
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);
- }
-}
//! 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:
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);
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 :
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:
#include <V3d_PositionLight.hxx>
-#include <V3d_Viewer.hxx>
-
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);
- }
}
#include <V3d_TypeOfPickLight.hxx>
#include <V3d_TypeOfRepresentation.hxx>
-class V3d_Viewer;
-
//! Base class for Positional, Spot and Directional Light classes.
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:
// =======================================================================
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);
-}
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:
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);
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 :
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)
//! 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;
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;
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:
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.
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.
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;
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;
}