View Issue Details

IDProjectCategoryView StatusLast Update
0032683Open CASCADEOCCT:Codingpublic2021-12-04 12:30
Reporterkgv Assigned Tosmoskvin  
PrioritynormalSeverityminor 
Status verifiedResolutionfixed 
Product Version7.6.0 
Target Version7.7.0 
Summary0032683: Coding Rules, XCAFDoc_Editor::CloneMetaData() - unexpected bitwise operations
DescriptionXCAFDoc_Editor::CloneMetaData() implementation (0028104) contains the following code:
  const Standard_Boolean toCopyColor = theToCopyColor & XCAFDoc_DocumentTool::CheckColorTool(theSrcLabel);
  const Standard_Boolean toCopyLayer = theToCopyLayer & XCAFDoc_DocumentTool::CheckLayerTool(theSrcLabel);
  const Standard_Boolean toCopyMaterial = theToCopyMaterial & XCAFDoc_DocumentTool::CheckMaterialTool(theSrcLabel);
  const Standard_Boolean toCopyVisMaterial = XCAFDoc_DocumentTool::CheckVisMaterialTool(theSrcLabel);


It seems that bitwise operators are used mistakenly instead of Boolean operators.
Steps To ReproduceN/A
TagsNo tags attached.
Test case numberN/A

Relationships

child of 0028104 closedsmoskvin Data Exchange - Extract sub-assembly (XDE) 

Activities

kgv

2021-11-23 11:18

developer   ~0105366

Last edited: 2021-11-23 11:18

In addition, the tool messes up the Name of cloned label ignoring XCAFDoc_ShapeTool::AutoNaming() value and unconditionally generating some mess.

  // Name
  Handle(TDataStd_Name) aNameAttr;
  theSrcLabel.FindAttribute(TDataStd_Name::GetID(), aNameAttr);
  Handle(XCAFDoc_ShapeTool) aDstShapeTool = XCAFDoc_DocumentTool::ShapeTool(theDstLabel);
...
  else
  {
    Standard_SStream Stream;
    TopoDS_Shape aShape = aDstShapeTool->GetShape(theDstLabel);
    TopAbs::Print(aShape.ShapeType(), Stream);
    TCollection_AsciiString aName(Stream.str().c_str());
    TDataStd_Name::Set(theDstLabel, TCollection_ExtendedString(aName));


git

2021-11-26 01:27

administrator   ~0105444

Branch CR32683 has been created by dpasukhi.

SHA-1: 03d32bd9877dc338ecefaacac28994cb69298b60


Detailed log of new commits:

Author: dpasukhi
Date: Fri Nov 26 01:26:49 2021 +0300

    0032683: Coding Rules, XCAFDoc_Editor::CloneMetaData() - unexpected bitwise operations
    
    Fixed problem with incorrect bitwise operators.
    Removed forced naming via cloning metadata

dpasukhi

2021-11-29 11:56

developer   ~0105506

Dear ika,
please review CR32683

All tests are ok, see:
http://jenkins-test-08.nnov.opencascade.com/view/CR32683-master-dpasukhi/view/COMPARE/

git

2021-11-29 14:01

administrator   ~0105516

Branch CR32683 has been updated forcibly by dpasukhi.

SHA-1: 7d7fab6498fbb855a303ccce53a1fcff0c9c9237

ika

2021-11-29 16:11

developer   ~0105517

All necessary changes are applied, no remarks.

Dear bugmaster,
please integrate.
OCCT - CR32683
Products - NOT.

smoskvin

2021-12-04 11:59

administrator   ~0105639

Combination -
OCCT branch : IR-2021-12-03
master SHA - 03eb96038e853c37a2229e59d0acb72f5dd0478d
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2021-12-03 SHA - 52ed38cc2ddefb01913e1984cdae84175a8fb8ed
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: 18166.60000000042 / 18390.6500000004 [-1.22%]
Products
Total CPU difference: 11658.820000000103 / 11648.280000000103 [+0.09%]
Windows-64-VC14:
OCCT
Total CPU difference: 19937.84375 / 19928.171875 [+0.05%]
Products
Total CPU difference: 13069.28125 / 13059.03125 [+0.08%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2021-12-04 12:30

administrator   ~0105652

Branch CR32683 has been deleted by mnt.

SHA-1: 7d7fab6498fbb855a303ccce53a1fcff0c9c9237

Related Changesets

occt: master 250ad34d

2021-11-25 22:26:49

dpasukhi


Committer: smoskvin Details Diff
0032683: Coding Rules, XCAFDoc_Editor::CloneMetaData() - unexpected bitwise operations

Fixed problem with incorrect bitwise operators.
Removed forced naming via cloning metadata
Affected Issues
0032683
mod - src/XCAFDoc/XCAFDoc_Editor.cxx Diff File

Issue History

Date Modified Username Field Change
2021-11-23 11:00 kgv New Issue
2021-11-23 11:00 kgv Assigned To => dpasukhi
2021-11-23 11:00 kgv Test case number => N/A
2021-11-23 11:00 kgv Status new => assigned
2021-11-23 11:01 kgv Relationship added child of 0028104
2021-11-23 11:02 kgv Description Updated
2021-11-23 11:18 kgv Note Added: 0105366
2021-11-23 11:18 kgv Note Edited: 0105366
2021-11-26 01:27 git Note Added: 0105444
2021-11-29 11:56 dpasukhi Note Added: 0105506
2021-11-29 11:56 dpasukhi Assigned To dpasukhi => ika
2021-11-29 11:56 dpasukhi Status assigned => resolved
2021-11-29 14:01 git Note Added: 0105516
2021-11-29 16:11 ika Note Added: 0105517
2021-11-29 16:11 ika Assigned To ika => bugmaster
2021-11-29 16:11 ika Status resolved => reviewed
2021-12-04 11:59 smoskvin Note Added: 0105639
2021-12-04 11:59 smoskvin Status reviewed => tested
2021-12-04 12:14 smoskvin Changeset attached => occt master 250ad34d
2021-12-04 12:14 smoskvin Assigned To bugmaster => smoskvin
2021-12-04 12:14 smoskvin Status tested => verified
2021-12-04 12:14 smoskvin Resolution open => fixed
2021-12-04 12:30 git Note Added: 0105652