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-18 17:30
ReporterVico Liang 
Assigned Toosa 
PrioritynormalSeverityintegration request 
StatusresolvedResolutionopen 
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.
(0088280)
git (administrator)
2019-10-17 18:46

Branch CR29367 has been updated by mzernova.

SHA-1: ddaa9992d5b4b22763ca3c1b2802f00b7d528174


Detailed log of new commits:

Author: mzernova
Date: Thu Oct 10 12:18:41 2019 +0300

    remarks from kgv

(0088281)
git (administrator)
2019-10-17 18:46

Branch CR29367_1 has been created by mzernova.

SHA-1: 4ddced4e8e65cde3fa4056f655c4a6a8e22600ff


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 methods returning the internal raw data
(0088304)
mzernova (developer)
2019-10-18 14:32

The patch CR29367 is ready to review
(0088307)
kgv (developer)
2019-10-18 14:49

+  Standard_DEPRECATED ("This method is deprecated. Please use ActiveLights() to getting raw data 
and work with them")
   const Handle(V3d_Light)& ActiveLight() const { return myActiveLightsIterator.Value(); }

Please move deprecated methods into dedicated "public:" section at the end of class definition (but before protected/private sections).
(0088312)
git (administrator)
2019-10-18 15:53

Branch CR29367_1 has been updated by mzernova.

SHA-1: 9e5a5f9a5b0b8ac9468b6f2f94b840d221f3472f


Detailed log of new commits:

Author: mzernova
Date: Fri Oct 18 15:47:18 2019 +0300

    remarks from kgv

(0088313)
git (administrator)
2019-10-18 16:06

Branch CR29367_2 has been created by mzernova.

SHA-1: a440b8f41658f8b0e68373ef49c8830d0feba08f


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 methods returning the internal raw data
(0088320)
mzernova (developer)
2019-10-18 17:30

Please review the branch CR29367_2

- 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
2019-10-17 18:46 git Note Added: 0088280
2019-10-17 18:46 git Note Added: 0088281
2019-10-18 14:32 mzernova Note Added: 0088304
2019-10-18 14:32 mzernova Assigned To mzernova => osa
2019-10-18 14:32 mzernova Status assigned => resolved
2019-10-18 14:49 kgv Note Added: 0088307
2019-10-18 15:53 git Note Added: 0088312
2019-10-18 16:06 git Note Added: 0088313
2019-10-18 17:30 mzernova Note Added: 0088320


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker