View Issue Details

IDProjectCategoryView StatusLast Update
0021306Open CASCADEOCCT:Visualizationpublic2016-12-09 16:38
ReportersanAssigned Tobugmaster  
PrioritynormalSeverityintegration request 
Status closedResolutionfixed 
OSAll 
Target Version7.1.0Fixed in Version7.1.0 
Summary0021306: Visualization, AIS_InteractiveContext - revise DisplayedModes() semantics
DescriptionReported by R.Lygin on 05.08.2009.

AIS_GlobalStatus manages a list of display modes for each interactive object.
The modes in this list are considered as "displayed modes". However,
AIS_InteractiveContext::Display() removes all the modes except the current one
from AIS_GlobalStatus. This was done intentionally to avoid problems in LH3D-3H
application. Thus AIS_GlobalStatus::DisplayedModes() and
AIS_InteractiveContext::DisplayedModes() always return a list with a single
integer equal to the current display mode of the object.

Meanwhile, there is a reliable way to query all display modes, for which an
interactive object has presentations already computed (but some of them might
be erased, i.e. invisible): PrsMgr_PresentableObject::Presentations() method
returns all the object's presentations, each having a display mode. However,
this method is protected, and it is necessary to implement ComputedModes()
method in each application that needs such functionality.

It is proposed to remove DisplayedModes() from AIS_GlobalStatus and
AIS_InteractiveContext classes and keep one and only DisplayMode() per an
object. To obtain all display modes ever computed,
AIS_InteractiveObject::ComputedModes() method should be implemented:

void AIS_InteractiveObject::ComputedModes (TColStd_ListOfInteger& theList)
{
    theList.Clear();
    const PrsMgr_Presentations& aPrsSeq = Presentations();
    Standard_Integer aLen = aPrsSeq.Length();
    for (Standard_Integer i = 1; i <= aLen; i++) {
        theList.Append (aPrsSeq (i).Mode());
    }
}

Note that presentations for all display modes returned by this method except
the current one returned by AIS_InteractiveObject::DisplayMode() are erased
(invisible).
Steps To ReproduceNot required
TagsNo tags attached.
Test case numberNot needed

Relationships

parent of 0027883 closedkgv Open CASCADE Visualization - AIS_InteractiveContext::IsDisplayed() does not return displayed state for specified Display Mode 
related to 0027815 closedbugmaster Open CASCADE Visualization, TKV3d - AIS_InteractiveContext has inconsistent display mode API 

Activities

git

2016-08-03 11:19

administrator   ~0056417

Branch CR21306 has been created by isk.

SHA-1: 88bd6a7793e0d3bf2a83af026f07d886e4411f33


Detailed log of new commits:

Author: isk
Date: Tue Aug 2 14:46:13 2016 +0300

    0021306: Visualization, AIS_InteractiveContext - revise DisplayedModes() semantics
    Add a new method AIS_InteractiveObject::ComputedModes().
    Remove the AIS_InteractiveContext::DisplayedModes() method.
    Remove list of active display modes from AIS_GlobalStatus.

isk

2016-08-04 09:08

developer   ~0056450

Dear Kirill,
please review the branch CR21306.

kgv

2016-08-04 10:05

developer   ~0056453

Last edited: 2016-08-04 10:06

The patch is expected to be based on #0027680.

-  TColStd_ListOfInteger myDispModes;
+  Standard_Integer myDispMode;

New field is left uninitialized in some constructors.
Please also check that logic works properly for objects that has been Loaded and then Displayed.

+  //! Returns the list of active display modes.
+  Standard_EXPORT void ComputedModes (TColStd_ListOfInteger& theModes) const;

Description does not looks correct.

+void AIS_InteractiveObject::ComputedModes (TColStd_ListOfInteger& theModes) const
+{
+  const PrsMgr_Presentations& aPrsList = Presentations();
+  for (PrsMgr_Presentations::Iterator anIt (aPrsList); anIt.More(); anIt.Next())
+  {
+    theModes.Append (anIt.Value().Mode());
+  }
+}

Implementation looks incorrect as well (possible duplication of the same display mode).
What is the purpose for this method - it is not used anywhere and application can do the same?

git

2016-08-04 13:51

administrator   ~0056468

Branch CR21306 has been updated forcibly by isk.

SHA-1: 52fdef177263cbcf689a1c5ffeab4c36ff64eca1

isk

2016-08-04 13:52

developer   ~0056469

Fix remarks by Kirill.

kgv

2016-08-04 15:22

developer   ~0056470

Please test the patch (only last commit in branch should be rebased onto current IR).

git

2016-08-05 15:27

administrator   ~0056504

Branch CR21306 has been updated forcibly by apv.

SHA-1: f55dbe388e55702f804b468d2275df4721fa37e8

apv

2016-08-05 15:28

tester   ~0056505

Branch CR21306 has been rebased on the current master.

apv

2016-08-08 10:37

tester   ~0056537

Dear BugMaster,

Branch CR21306 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: f55dbe388e55702f804b468d2275df4721fa37e8

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 64
   Windows: 0
   MacOS: 1119

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 89247396 / 88460446 [+0.89%]
Total CPU difference: 19389.900000000027 / 19249.11000000006 [+0.73%]

Testing on Windows:
Total MEMORY difference: 57134779 / 57173794 [-0.07%]
Total CPU difference: 18361.302099898774 / 18044.994472298804 [+1.75%]

git

2016-08-26 16:24

administrator   ~0057163

Branch CR21306 has been deleted by inv.

SHA-1: f55dbe388e55702f804b468d2275df4721fa37e8

Related Changesets

occt: master 3db69e41

2016-08-02 11:46:13

isk


Committer: bugmaster Details Diff
0021306: Visualization, AIS_InteractiveContext - revise DisplayedModes() semantics
Remove the AIS_InteractiveContext::DisplayedModes() method.
Remove list of active display modes from AIS_GlobalStatus.
Affected Issues
0021306
mod - src/AIS/AIS_GlobalStatus.cxx Diff File
mod - src/AIS/AIS_GlobalStatus.hxx Diff File
mod - src/AIS/AIS_GlobalStatus.lxx Diff File
mod - src/AIS/AIS_InteractiveContext.cxx Diff File
mod - src/AIS/AIS_InteractiveContext.hxx Diff File
mod - src/AIS/AIS_InteractiveContext_2.cxx Diff File

Issue History

Date Modified Username Field Change
2011-08-02 11:24 bugmaster Category OCCT:VIZ => OCCT:Visualization
2014-02-05 15:28 kgv Assigned To bugmaster => san
2014-02-05 15:28 kgv Fixed in Version EMPTY =>
2014-02-05 15:28 kgv Target Version => 7.0.0
2014-02-05 15:28 kgv Description Updated
2014-09-29 22:57 kgv Target Version 7.0.0 => 7.1.0
2016-08-02 09:49 kgv Assigned To san => isk
2016-08-02 09:49 kgv Severity feature => integration request
2016-08-02 09:49 kgv Status new => assigned
2016-08-02 09:49 kgv Summary Revise DisplayedModes() semantics in AIS => Visualization, AIS_InteractiveContext - revise DisplayedModes() semantics
2016-08-03 11:19 git Note Added: 0056417
2016-08-04 09:08 isk Note Added: 0056450
2016-08-04 09:08 isk Assigned To isk => kgv
2016-08-04 09:08 isk Status assigned => resolved
2016-08-04 09:08 isk Steps to Reproduce Updated
2016-08-04 10:05 kgv Note Added: 0056453
2016-08-04 10:05 kgv Assigned To kgv => isk
2016-08-04 10:05 kgv Status resolved => assigned
2016-08-04 10:06 kgv Note Edited: 0056453
2016-08-04 13:51 git Note Added: 0056468
2016-08-04 13:52 isk Note Added: 0056469
2016-08-04 14:17 isk Assigned To isk => kgv
2016-08-04 14:17 isk Status assigned => resolved
2016-08-04 15:22 kgv Note Added: 0056470
2016-08-04 15:22 kgv Assigned To kgv => bugmaster
2016-08-04 15:22 kgv Status resolved => reviewed
2016-08-05 15:27 git Note Added: 0056504
2016-08-05 15:28 apv Note Added: 0056505
2016-08-05 15:28 apv Assigned To bugmaster => apv
2016-08-05 15:28 apv Test case number => Not needed
2016-08-08 10:37 apv Note Added: 0056537
2016-08-08 10:37 apv Assigned To apv => bugmaster
2016-08-08 10:37 apv Status reviewed => tested
2016-08-12 10:48 bugmaster Changeset attached => occt master 3db69e41
2016-08-12 10:48 bugmaster Status tested => verified
2016-08-12 10:48 bugmaster Resolution open => fixed
2016-08-26 16:24 git Note Added: 0057163
2016-08-26 20:42 san Relationship added related to 0027815
2016-09-26 11:24 kgv Relationship added parent of 0027883
2016-12-09 16:30 aiv Status verified => closed
2016-12-09 16:38 aiv Fixed in Version => 7.1.0