View Issue Details

IDProjectCategoryView StatusLast Update
0026079CommunityOCCT:Application Frameworkpublic2015-09-29 08:58
ReporterVico Liang Assigned ToVico Liang  
PrioritynormalSeverityminor 
Status closedResolutionno change required 
PlatformWindowsOSVC++ 2013 
Summary0026079: TNaming_Selector Select a modified shape should not result in nametype="intersection" .
DescriptionThe function below will make a rectangle and its mirror copy. and then translate the mirrored rectangle and finally select the translated rectangle.

The selection result in xml will show that there is nametype="intersection" with only one argument. I think the expected result should be nametype = "modifuntil".

void BugN(const TDF_Label& theLabel)
{
    gp_Pln aPlane(gp::Origin(), gp::DZ());
    BRepBuilderAPI_MakeFace aMF(aPlane, -10, 10, -10, 10);
    TopoDS_Shape aFace = aMF.Shape();

    TDF_Label aFaceLabel = theLabel.FindChild(900, Standard_True);
    TNaming_Builder aFaceBuilder(aFaceLabel);
    aFaceBuilder.Generated(aFace);

    gp_Trsf aMirrorTrsf;
    aMirrorTrsf.SetMirror(gp_Ax2(gp_Pnt(0, 0, 10), gp::DZ()));
    BRepBuilderAPI_Transform aMakeMirror(aFace, aMirrorTrsf, Standard_False);
    TopoDS_Shape aFaceMirror = aMakeMirror.Shape();

    TDF_Label aFaceMirrorLabel = theLabel.FindChild(901, Standard_True);
    TNaming_Builder aFaceMirrorBuilder(aFaceMirrorLabel);
    aFaceMirrorBuilder.Generated(aFace, aFaceMirror);

    gp_Trsf aTranslateTrsf;
    aTranslateTrsf.SetTranslation(gp_Vec(0, 0, -5.0));
    BRepBuilderAPI_Transform aFaceMirrorTranslate(aFaceMirror, aTranslateTrsf, Standard_False);
    TopoDS_Shape aFaceMirrorTranslateShape = aFaceMirrorTranslate.Shape();

    TDF_Label aFaceMirrorTranslateLabel = theLabel.FindChild(902, Standard_True);
    TNaming_Builder aFaceMirrorTranslateBuilder(aFaceMirrorTranslateLabel);
    aFaceMirrorTranslateBuilder.Modify(aFaceMirror, aFaceMirrorTranslateShape);

    TDF_Label aFaceMirrorSelectLabel = theLabel.FindChild(903, Standard_True);
    TNaming_Selector aSeletor(aFaceMirrorSelectLabel);
    aSeletor.Select(aFaceMirrorTranslateShape, aFaceMirrorTranslateShape);
}
Steps To ReproduceThe selection result in xml style looks like below:

         <label tag="1">
            <TDF_TagSource id="237">1</TDF_TagSource>
            <TNaming_NamedShape id="238" evolution="selected">
             <olds>
              <shape tshape="+10" location="3" index="1"/>
             </olds>
             <news>
              <shape tshape="+10" location="3" index="1"/>
             </news>
            </TNaming_NamedShape>
            <TNaming_Naming id="239" nametype="identity" shapetype="face" arguments="240 " index="-1" contextlabel="" orientation="0"/>
            <label tag="1">
             <TNaming_Naming id="241" nametype="intersection" shapetype="face" arguments="242 " index="-1" contextlabel="" orientation="0"/>
             <TDF_TagSource id="243">1</TDF_TagSource>
             <TNaming_NamedShape id="240" evolution="selected">
              <olds>
               <shape tshape="+10" location="3" index="1"/>
              </olds>
              <news>
               <shape tshape="+10" location="3" index="1"/>
              </news>
             </TNaming_NamedShape>
             <label tag="1">
              <TNaming_Naming id="244" nametype="generation" shapetype="face" arguments="112 86 " index="1" contextlabel="" orientation="0"/>
              <TNaming_NamedShape id="242" evolution="selected">
               <olds>
                <shape tshape="+10" location="1" index="1"/>
               </olds>
               <news>
                <shape tshape="+10" location="1" index="1"/>
               </news>
              </TNaming_NamedShape>
             </label>
            </label>
           </label>
TagsNo tags attached.
Test case number

Activities

szy

2015-09-23 15:35

manager   ~0046047

The provided code snippet clearly shows that you are not friendly with Topological Naming framework and don't respect ordinary rules of data framework filling. Selection mechanism can't work correctly on wrong data structure. I suggest you first to learn it more carefully (see OCAF User's Guide, which is sufficiently updated in coming soon OCCT6.9.1 version).
Conclusion. Incorrect usage of Topological Naming framework.

Issue History

Date Modified Username Field Change
2015-04-15 09:17 Vico Liang New Issue
2015-04-15 09:17 Vico Liang Assigned To => szy
2015-04-30 11:34 abv Target Version 6.9.0 => 7.1.0
2015-09-23 15:35 szy Note Added: 0046047
2015-09-23 15:35 szy Status new => closed
2015-09-23 15:35 szy Assigned To szy => Vico Liang
2015-09-23 15:35 szy Resolution open => no change required
2015-09-29 08:58 abv Target Version 7.1.0 =>