MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0029367Community[OCCT] OCCT:Visualizationpublic2017-12-05 06:522019-10-09 15:08
ReporterVico Liang 
Assigned Tomzernova 
PrioritynormalSeverityintegration request 
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.5.0*Fixed in Version 
Summary0029367: Visualization - simplify interface of V3d_View and V3d_Viewer
Descriptionclass V3d_View:
  Standard_EXPORT Standard_Boolean IfMoreLights() const;
  V3d_ListOfLightIterator ActiveLightIterator() const;
  void InitActiveLights();
  Standard_Boolean MoreActiveLights() const;
  void NextActiveLights();
  const Handle(V3d_Light)& ActiveLight() const;

class V3d_Viewer:
  V3d_ListOfViewIterator ActiveViewIterator() const;
  void InitActiveViews();
  Standard_Boolean MoreActiveViews() const;
  void NextActiveViews();
  const Handle(V3d_View)& ActiveView();

  V3d_ListOfViewIterator DefinedViewIterator() const;
  void InitDefinedViews();
  Standard_Boolean MoreDefinedViews() const;
  void NextDefinedViews();
  const Handle(V3d_View)& DefinedView() const;

  V3d_ListOfLightIterator ActiveLightIterator() const;
  void InitActiveLights();
  Standard_Boolean MoreActiveLights() const;
  void NextActiveLights();
  const Handle(V3d_Light)& ActiveLight() const;

  V3d_ListOfLightIterator DefinedLightIterator() const;
  void InitDefinedLights();
  Standard_Boolean MoreDefinedLights() const;
  void NextDefinedLights();
  const Handle(V3d_Light)& DefinedLight() const;

All above methods can be removed and replaced by returning the internal raw data
  V3d_ListOfView myDefinedViews;
  V3d_ListOfView myActiveViews;
  V3d_ListOfLight myDefinedLights;
  V3d_ListOfLight myActiveLights;
Steps To ReproduceNot required
TagsNo tags attached.
Test case number
Attached Files

- Relationships
related to 0028987closedkgv Open CASCADE Visualization, SelectMgr_SelectableObject - move out iterator from object 
related to 0030972newkgv Open CASCADE Visualization - remove deprecated iterators embedded into TKV3d containers 

-  Notes
(0087977)
git (administrator)
2019-10-09 14:54

Branch CR29367 has been created by mzernova.

SHA-1: 4a4410e4fab1d0dd919a348de1933558c544649d


Detailed log of new commits:

Author: mzernova
Date: Thu Sep 19 12:54:11 2019 +0300

    0029367: Visualization - simplify interface of V3d_View and V3d_Viewer
    
    The interface of V3d_View and V3d_Viewer has been simplified. For the fields myDefinedViews, myActiveViews, myDefinedLights, myActiveLights were added appropriate Get***() methods
(0087979)
mzernova (developer)
2019-10-09 14:57

The patch CR29367 is ready to review
(0087980)
kgv (developer)
2019-10-09 15:08

+  //! @return a list of defined views.
+  V3d_ListOfView GetDefinedViews() const { return myDefinedViews; }
...
+  //! @return a list of active lights.
+  V3d_ListOfLight GetActiveLights() const { return myActiveLights; }
...
+  //! @return a list of defined lights.
+  V3d_ListOfLight GetDefinedLights() const { return myDefinedLights; }

Why list is returned by copy?
And remove "Get" prefix from these methods.

-  for (V3d_ListOfLightIterator aDefLightIter (MyViewer->DefinedLightIterator()); aDefLightIter.More(); 
aDefLightIter.Next())
+  V3d_ListOfLight aDefinedLights = MyViewer->GetDefinedLights();
+  for (V3d_ListOfLightIterator aDefLightIter (aDefinedLights); aDefLightIter.More(); aDefLightIter.Next())


Please revert modifications removing usage of method returning iterator.

-  //! 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(); }

Please don't remove these methods - they should be marked as Deprecated and removed after next OCCT release.
Methods creating an Iterator should be left as is and used in existing code, only methods using "embedded" iterators should be marked deprecated.

- Issue History
Date Modified Username Field Change
2017-12-05 06:52 Vico Liang New Issue
2017-12-05 06:52 Vico Liang Assigned To => kgv
2017-12-05 08:30 kgv Relationship added related to 0029290
2017-12-05 08:33 kgv Relationship added related to 0028987
2019-09-04 13:04 abv Target Version 7.4.0 => 7.5.0*
2019-09-17 10:23 kgv Assigned To kgv => mzernova
2019-09-17 10:23 kgv Severity minor => integration request
2019-09-17 10:23 kgv Status new => assigned
2019-09-17 10:23 kgv Summary Simplify interface of V3d_View and V3d_Viewer => Visualization - simplify interface of V3d_View and V3d_Viewer
2019-09-17 10:24 kgv Relationship added related to 0030972
2019-10-09 14:54 git Note Added: 0087977
2019-10-09 14:57 mzernova Note Added: 0087979
2019-10-09 14:57 mzernova Assigned To mzernova => kgv
2019-10-09 14:57 mzernova Status assigned => resolved
2019-10-09 14:57 mzernova Steps to Reproduce Updated View Revisions
2019-10-09 15:08 kgv Note Added: 0087980
2019-10-09 15:08 kgv Assigned To kgv => mzernova
2019-10-09 15:08 kgv Status resolved => assigned


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker