View Issue Details

IDProjectCategoryView StatusLast Update
0025560CommunityOCCT:Documentationpublic2018-03-05 17:01
ReporterRoman Lygin Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.8.0 
Target Version7.1.0Fixed in Version7.1.0 
Summary0025560: Documentation - describe changes in AIS_InteractiveConnect and AIS_MultipleConnected introduced within 6.8.0
Description(Tracker per the respective post on the forum https://dev.opencascade.org/index.php?q=node/1019)


Version 6.8.0 apparently introduced some signficant change about how the IO's can be connected.
The former use case as explained in my blog post (http://opencascade.blogspot.ru/2013/11/ais-connecting-objects.html) has been broken.
In particular an exception is currently thrown in ConnectedInteractive:

void AIS_ConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& theAnotherObj)
{...
  else
  {
    Standard_ProgramError::Raise ("AIS_ConnectedInteractive::Connect() - object without own presentation can not be connected");
  }
}

The change seems to be introduced in #25371 (http://tracker.dev.opencascade.org/view.php?id=25371), to which access is denied for
community members to get further details.

The use case as explained in the above blog post is to create a hierarchy of AIS_IO's via connection of CI and MC. Here is
an excerpt as pseudo-code:

Handle_AIS_InteractiveObject CreateIO (const SceneGraphElement& e)
{
    Handle_AIS_InteractiveObject r;
    if (e is a Part (i.e. leaf of scene graph)) {
        r = create_concrete_interativeobject();
    } else if (e is Instance) {
        Handle_AIS_InteractiveObject ref_r = CreateIO (e->reference); //recursion
        Handle_AIS_ConnectedInteractive i = new AIS_ConnectedInteractive;
        i->Connect (ref_r, location);
        r = i;
    } else if (e is assembly) {
        Handle_AIS_MultipleConnected m = new AIS_MultipleConnected;
        for (all childs in assembly) {
            Handle_AIS_InteractiveObject c = CreateIO (child_i); //recursion
            m->Connect (c);
        }
        r = m;
    }
    return r;
}

Thus, there never exists a presentation for any IO which gets connected and any interim IO will ever be displayed itself.

Neither the Release Notes nor the Visualization User's Guide invalidate the formerly valid and working use case. So please do
restore the possibility existed before and meanwhile please advise on a proper work-around.
Steps To ReproduceNA
Additional information
and documentation updates
The only correction needed is related to Visualization User's Guide: it should be extended by a chapter describing the new design of connected interactive objects and the rules of their usage.
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0024837 closedbugmaster Open CASCADE Visualization - revise design and implementation of connected Interactive Objects 
related to 0029545 closedbugmaster Community Documentation, visualization.md - article incorrectly specifies that AIS_ConnectedInteractive can define own Material 

Activities

kgv

2014-12-06 17:49

developer   ~0035094

Dear Roman,

could you please describe in more detail exactly the use case that is no more working for you? Probably simple draw command would be sufficient to address your problem.

From current description I can not find the statement that was not documented.

Roman Lygin

2014-12-06 18:55

developer   ~0035096

Dear Kirill,

Please find the reproducer below, made with the help of shape structure.
Apparently the exception gets raised on the combination of ConnectedInteractive referring to the MultipleConnectedInteractive. The method ::Connect() checks HasOwnRepresentations() which is set to false for MC.


static Handle_AIS_InteractiveObject CreateAIS (const TopoDS_Shape& theShape)
{
    Handle_AIS_InteractiveObject r;
    if (theShape.IsNull ())
        return r;

    const TopLoc_Location& aLoc = theShape.Location ();
    if (!aLoc.IsIdentity ()) { //instance
        Handle_AIS_ConnectedInteractive aCon = new AIS_ConnectedInteractive;
        TopoDS_Shape aRef = theShape.Located (TopLoc_Location ());
        Handle_AIS_InteractiveObject aRefAIS = CreateAIS (aRef);
        if (!aRefAIS.IsNull ()) {
            aCon->Connect (aRefAIS, aLoc);
        }
        r = aCon;
    } else if (theShape.ShapeType () == TopAbs_COMPOUND) { //assembly
        Handle_AIS_MultipleConnectedInteractive aM = new AIS_MultipleConnectedInteractive;
        for (TopoDS_Iterator i (theShape); i.More (); i.Next ()) {
            Handle_AIS_InteractiveObject aChildAIS = CreateAIS (i.Value ());
            if (!aChildAIS.IsNull ())
                aM->Connect (aChildAIS);
        }
        r = aM;
    } else { //part
        r = new AIS_Shape (theShape);
    }
    return r;
}

static void Test ()
{
    TopoDS_Vertex aV = BRepBuilderAPI_MakeVertex (gp_Pnt (0., 0., 0.));
    gp_Trsf aT;
    aT.SetTranslation (gp_Vec (1, 2, 3));
    TopoDS_Compound aC;
    BRep_Builder aB;
    aB.MakeCompound (aC);
    aB.Add (aC, aV.Located (TopLoc_Location (aT)));
    Handle_AIS_InteractiveObject anAIS = CreateAIS (aC.Located (aT));
}

kgv

2014-12-08 08:46

developer   ~0035108

Severity has been lowered since this is expected behavior change.

kgv

2015-01-13 11:44

developer   ~0036000

Dear Danila,

please update Visualization User's Guide as discussed on the forum.

san

2016-10-13 19:12

developer   ~0058688

Dear YSN,

Can you please contact DUV and try to draft together the Visualization User's Guide section dedicated to connected interactive objects?

san

2016-10-13 19:19

developer   ~0058689

Please contact me for some general explanations first of all.

git

2016-11-03 13:06

administrator   ~0059841

Branch CR25560 has been created by ysn.

SHA-1: 568ee8291ac40d93de7c195d1edb15e80902a724


Detailed log of new commits:

Author: ysn
Date: Thu Nov 3 13:06:24 2016 +0300

    0025560: Regression on AIS_InteractiveConnect and AIS_MultipleConnected support in 6.8.0
    
    New section about Connected Interactive Objects.
    Proofreading of extended section about z-layers.

ysn

2016-11-03 13:14

developer   ~0059846

Dear DUV,

Could you please review the implementation of your new text in Visualization manual.
I'd suggest explaining what each example shows.

duv

2016-11-08 17:30

developer   ~0060045

Dear YSN,

Please consider changes committed to branch.

git

2016-11-09 11:09

administrator   ~0060075

Branch CR25560 has been updated by duv.

SHA-1: 23b3d64aca282dbe914659d4f9987ef3630f4768


Detailed log of new commits:

Author: duv
Date: Tue Nov 8 17:28:39 2016 +0300

    Review of connected interactive section

git

2016-11-09 13:52

administrator   ~0060107

Branch CR25560_1 has been created by ysn.

SHA-1: 3d62bafd3af919199b7c6d9e4d16c1622d3154f4


Detailed log of new commits:

Author: ysn
Date: Wed Nov 9 13:51:43 2016 +0300

    0025560: Regression on AIS_InteractiveConnect and AIS_MultipleConnected support in 6.8.0
    
     New section about scene-graph hierarchy and instancing.
     Proofreading of extended section about z-layers.
     Removal of obsolete information.

ysn

2016-11-09 13:53

developer   ~0060108

Please, review.

san

2016-11-09 20:27

developer   ~0060154

Last edited: 2016-11-09 20:32

Branch CR25560_1 reviewed with the following remarks:

+The calculation of selection primitives (or sensitive entities) is done by the intermediary of a virtual function


Why not simply say "...is done in a virtual function..."?

+*      Instances project the selection (or to remove the hidden lines) based on the current view.


Is this statement relevant here? Anyway, instances do not "project the selection" as the selection algorithm is not based on 2D projections since 6.9.0 release.

+Classes *AIS_ConnectedInteractive* and *AIS_MultiplyConnectedInteractive*
...
+*AIS_MultiplyConnectedInteractive* represents an assembly...


The class name is AIS_MultipleConnectedInteractive - not AIS_MultiplyConnectedInteractive, please correct all occurrences.

vpa

2016-11-10 13:18

developer   ~0060178

Last edited: 2016-11-10 13:30

In addition to Sergey's remarks, I would say that usage of the term "scene graph" is incorrect and confusing here:

+@subsubsection occt_visu_3_2_7 Scene-graph hierarchy


In fact, OCCT does not have a scene graph in its original wide-spread meaning. The use case described in section occt_visu_3_2_7 should be referenced as single object hierarchy.

Please, correct the following:

+Scene hierarchy can be controlled by the following API calls:
Object hierarchy ...

+The conception of instancing (scene-graph level instancing) is separated from hierarchy.
The conception of instancing operates object's hierarchy principles along with the following

+The assemblies are able to participate in a scene hierarchy and are intended
The assemblies are able to participate in object's hierarchy and are intended

It is also necessary to add that AIS_ConnectedInteractive copies sensitive entities of origin object for selection, unlike AIS_MultipleConnectedInteractive that re-uses origin's entities.

git

2016-11-16 13:05

administrator   ~0060419

Branch CR25560_1 has been updated by ysn.

SHA-1: 2d2a724a0c5c627afd8c82d92d08e5846c4f03d1


Detailed log of new commits:

Author: ysn
Date: Wed Nov 16 13:05:29 2016 +0300

    Remarks taken into account.

git

2016-11-21 13:44

administrator   ~0060613

Branch CR25560_1 has been updated forcibly by san.

SHA-1: c706292cd9630536ccc5c5f163f1de8ccfcda33c

san

2016-11-21 13:46

developer   ~0060614

Branch CR25560_1 reviewed without remarks, please test the updated Visualization User's Guide.

git

2016-11-21 14:55

administrator   ~0060623

Branch CR25560_1 has been updated forcibly by apv.

SHA-1: a4a4b0e5fc4591d43970aa0d5a5eb3531419da78

apv

2016-11-21 14:55

tester   ~0060624

Branch CR25560_1 has been rebased on the current master

git

2016-12-07 11:30

administrator   ~0061232

Branch CR25560 has been deleted by kgv.

SHA-1: 23b3d64aca282dbe914659d4f9987ef3630f4768

git

2016-12-07 11:30

administrator   ~0061233

Branch CR25560_1 has been deleted by kgv.

SHA-1: a4a4b0e5fc4591d43970aa0d5a5eb3531419da78

Related Changesets

occt: master ebcbd824

2016-11-23 09:57:32

ysn


Committer: apn Details Diff
0025560: Documentation - describe changes in AIS_InteractiveConnect and AIS_MultipleConnected introduced within 6.8.0

New section about scene-graph hierarchy and instancing.
Proofreading of extended section about z-layers.
Removal of obsolete information.

Remarks taken into account.
Affected Issues
0025560
add - dox/user_guides/visualization/images/visualization_image029.png Diff File
add - dox/user_guides/visualization/images/visualization_image030.png Diff File
mod - dox/user_guides/visualization/visualization.md Diff File

Issue History

Date Modified Username Field Change
2014-12-06 15:50 Roman Lygin New Issue
2014-12-06 15:50 Roman Lygin Assigned To => kgv
2014-12-06 17:35 kgv Relationship added related to 0024837
2014-12-06 17:49 kgv Note Added: 0035094
2014-12-06 17:49 kgv Assigned To kgv => Roman Lygin
2014-12-06 17:49 kgv Status new => feedback
2014-12-06 18:55 Roman Lygin Note Added: 0035096
2014-12-06 18:55 Roman Lygin Assigned To Roman Lygin => kgv
2014-12-06 18:55 Roman Lygin Status feedback => assigned
2014-12-08 08:46 kgv Note Added: 0035108
2014-12-08 08:46 kgv Severity major => minor
2014-12-09 20:38 san Additional Information Updated
2015-01-13 11:44 kgv Note Added: 0036000
2015-01-13 11:44 kgv Assigned To kgv => duv
2015-01-13 11:44 kgv Resolution open => documentation updated
2015-01-13 11:44 kgv Target Version => 6.9.0
2015-04-30 10:22 kgv Target Version 6.9.0 => 7.1.0
2016-10-13 19:12 san Note Added: 0058688
2016-10-13 19:12 san Assigned To duv => ysn
2016-10-13 19:12 san Status assigned => feedback
2016-10-13 19:15 san Description Updated
2016-10-13 19:19 san Note Added: 0058689
2016-11-03 13:06 git Note Added: 0059841
2016-11-03 13:07 ysn Assigned To ysn => Roman Lygin
2016-11-03 13:09 ysn Assigned To Roman Lygin => duv
2016-11-03 13:14 ysn Note Added: 0059846
2016-11-08 17:30 duv Note Added: 0060045
2016-11-08 17:30 duv Assigned To duv => ysn
2016-11-08 17:30 duv Status feedback => assigned
2016-11-08 17:34 kgv Category OCCT:Visualization => OCCT:Documentation
2016-11-08 17:34 kgv Summary Regression on AIS_InteractiveConnect and AIS_MultipleConnected support in 6.8.0 => Documentation - describe changes in AIS_InteractiveConnect and AIS_MultipleConnected introduced within 6.8.0
2016-11-09 11:09 git Note Added: 0060075
2016-11-09 13:52 git Note Added: 0060107
2016-11-09 13:53 ysn Note Added: 0060108
2016-11-09 13:53 ysn Assigned To ysn => san
2016-11-09 13:53 ysn Status assigned => resolved
2016-11-09 13:53 ysn Steps to Reproduce Updated
2016-11-09 20:27 san Note Added: 0060154
2016-11-09 20:27 san Assigned To san => ysn
2016-11-09 20:27 san Status resolved => assigned
2016-11-09 20:32 san Note Edited: 0060154
2016-11-10 13:18 vpa Note Added: 0060178
2016-11-10 13:19 vpa Note Edited: 0060178
2016-11-10 13:22 vpa Note Edited: 0060178
2016-11-10 13:30 vpa Note Edited: 0060178
2016-11-16 13:05 git Note Added: 0060419
2016-11-16 13:06 ysn Assigned To ysn => san
2016-11-16 13:06 ysn Status assigned => resolved
2016-11-21 13:44 git Note Added: 0060613
2016-11-21 13:46 san Note Added: 0060614
2016-11-21 13:46 san Assigned To san => bugmaster
2016-11-21 13:46 san Status resolved => reviewed
2016-11-21 14:39 apv Assigned To bugmaster => apv
2016-11-21 14:49 apv Test case number => Not needed
2016-11-21 14:55 git Note Added: 0060623
2016-11-21 14:55 apv Note Added: 0060624
2016-11-21 14:57 apv Assigned To apv => bugmaster
2016-11-21 14:57 apv Status reviewed => tested
2016-11-24 15:52 apn Changeset attached => occt master ebcbd824
2016-11-24 15:52 apn Assigned To bugmaster => apn
2016-11-24 15:52 apn Status tested => verified
2016-11-24 15:52 apn Resolution documentation updated => fixed
2016-12-07 11:30 git Note Added: 0061232
2016-12-07 11:30 git Note Added: 0061233
2016-12-09 16:30 aiv Status verified => closed
2016-12-09 16:39 aiv Fixed in Version => 7.1.0
2018-03-05 17:01 kgv Relationship added related to 0029545