DiscussionsIssue archiveOCCT:Modeling Data

Archived issue #0029827

Modeling Data - TopoDS_Shape::Nullify() does not reset location

Open CASCADEOCCT:Modeling Dataclosed15 public notes

Search issues

Description

TopoDS_Shape::Nullify() only nullifies the stored TShape but not location (and not orientation). This means that two different IsNull() shapes still can be neither IsEqual() nor even IsSame(), and have different hash codes.

It can be more consistent to reset also location to Null and orientation to default value (TopAbs_EXTERNAL) in the method Nullify().

(The issue has been detected during review of #0029814.)

Steps to reproduce

bugs moddata_3 bug29827

Public activity

15 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Commenter 4.

[revision removed]


Detailed log of new commits:

Author: Commenter 4
Date: Tue Nov 10 09:41:23 2020 +0300

    0029827: Modeling Data - TopoDS_Shape::Nullify() does not reset location
    
    TopoDS_Shape::Nullify() nullify not only myTShape but myLocation and myOrient
    Nullified shapes are equal and same now.
    Added new Draw command "nullify" and test for current bug
02Commenter 3
+  theCommands.Add("nullify",

This doesn't look like a good name for such command - bnullify or tnullify might be better. Or move the command to QABugs as this functionality does not look very useful for regular usage in Draw...

+    myLocation = TopLoc_Location();

I have some doubts if it wouldn't be reasonable adding TopLoc_Location::Clear() method or checking if myLocation is not empty before assignment.
03Commenter 2
Branch [archived branch] has been updated by Commenter 4.

[revision removed]


Detailed log of new commits:

Author: Commenter 4
Date: Fri Nov 13 10:57:51 2020 +0300

    #remarks

04Commenter 3
+  Standard_EXPORT void Clear()
+  {
+    myItems.Clear();

Standard_EXPORT should not be used for inline methods.

+  theCommands.Add("nullify",

Commands within QA group follow a name convention like "OCC29827" or "QANullifyShape".

05Commenter 2
Branch [archived branch] has been updated forcibly by Commenter 4.

[revision removed]
06Commenter 6
Please avoid using shapes from the private section for the test of the open bug.
In this particular case, you don't need restore any shapes at all. Just create a shape and use the commands orientation, ttranslate to change its location and orientation.
07Commenter 7
Also, create a new branch with one commit with updated description.
08Commenter 2
Branch [archived branch] has been created by Commenter 4.

[revision removed]


Detailed log of new commits:

Author: Commenter 4
Date: Tue Nov 10 09:41:23 2020 +0300

    0029827: Modeling Data - TopoDS_Shape::Nullify() does not reset location
    
    TopoDS_Shape::Nullify() nullify not only myTShape but myLocation and myOrient.
    Nullified shapes are equal and same now.
    Added test.
09Commenter 4
10Commenter 10
di << "Usage: nullify shape\n";
Wrong command name here

                  "Nullify shape shapes. Usage: QANullifyShape shape",
Unclear sentence "Nullify shape shapes"
11Commenter 2
Branch [archived branch] has been updated forcibly by Commenter 4.

[revision removed]
12Commenter 12
For integration:
occt - CR29827_1
products - none
13Commenter 1
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 18024.090000000127 / 17964.340000000077 [+0.33%]
Products
Total CPU difference: 12166.12000000011 / 12169.520000000111 [-0.03%]
Windows-64-VC14:
OCCT
Total CPU difference: 19696.90625 / 19723.125 [-0.13%]
Products
Total CPU difference: 13644.875 / 13567.078125 [+0.57%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
14Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
15Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records