View Issue Details

IDProjectCategoryView StatusLast Update
0030206Open CASCADEOCCT:DRAWpublic2021-09-11 14:05
ReportermsvAssigned Tosmoskvin 
PrioritynormalSeveritytweak 
Status closedResolutionfixed 
Product Version7.3.0 
Target Version7.6.0Fixed in Version7.6.0 
Summary0030206: Improve API of commands bbop and bapibop
DescriptionImprove API of commands bbop and bapibop so that it was possible to use symbolic names of operations instead of integer type.
Steps To ReproduceN/A
TagsNo tags attached.
Test case numbertest bugs modalg_7 bug30206

Relationships

related to 0030620 closedbugmaster Tests - perf/bop/buildfaces does not match description (broken) 

Activities

git

2021-09-07 16:01

administrator   ~0103895

Branch CR30206 has been created by emv.

SHA-1: a677d51c8c8ccacc27c02c3e56593b95da94b340


Detailed log of new commits:

Author: emv
Date: Tue Sep 7 16:00:25 2021 +0300

    0030206: Improve API of commands bbop and bapibop
    
    Allow using meaningful parameters for the commands bbop and bapibop:
    common - for Common operation
    fuse - for Fuse operation
    cut - for Cut operation
    tuc/cut21 - for Cut21 operation
    section - for Section operation

git

2021-09-07 17:42

administrator   ~0103900

Branch CR30206 has been updated forcibly by emv.

SHA-1: 1b9139411885b2c695db3d6eac3817a52de98f44

git

2021-09-07 22:06

administrator   ~0103906

Branch CR30206 has been updated forcibly by emv.

SHA-1: 32a9c0430a589ca7622bb4e4efaa7073d4bb6187

emv

2021-09-08 07:40

developer   ~0103911

Last edited: 2021-09-08 07:41

Dear Mikhail, could you please review the git branch CR30206?

Test results - http://jenkins-test-occt.nnov.opencascade.com/view/CR30206-master-emv/view/COMPARE/

Please note, that it also fixes the the issue 0030620.

msv

2021-09-08 10:46

developer   ~0103916

src/BOPTest/BOPTest.cxx
  if (std::strlen(theOp) == 1)
  {
    // Try converting to integer
    Standard_Integer iOp = Draw::Atoi(theOp);
    if (iOp < 0 || iOp > 4)
    {
      // out of range
      return BOPAlgo_UNKNOWN;
    }

    // Check if satisfies the enumeration. If 0 is returned, check that 0 was really meant.
    if ((iOp > 0 && iOp <= 4) || (iOp == 0 && theOp[0] == '0'))
    {
      return static_cast<BOPAlgo_Operation>(iOp);
    }

    return BOPAlgo_UNKNOWN;
  }

This can be much shorter:
  if (std::strlen(theOp) == 1)
  {
    if (theOp[0] >= '0' && theOp[0] <= '4'))
    {
      return static_cast<BOPAlgo_Operation>(theOp[0] - '0');
    }

    return BOPAlgo_UNKNOWN;
  }


  if (!strcasecmp(theOp, "common"))


I am in doubt if we can safely use strcasecmp function. I found such statement in
https://stackoverflow.com/questions/31127260/strcasecmp-a-non-standard-function:
"strcasecmp is not in the C or C++ standard. It's defined by POSIX.1-2001 and 4.4BSD.
If your system POSIX or BSD compliant, you'll have no problems. Otherwise, the function will be unavailable."

Instead, it is better to do as in other OCCT places: convert the input string to lowercase (with TCollection_AsciiString) and compare with lowercase sample.

kgv

2021-09-08 10:46

developer   ~0103917

Last edited: 2021-09-08 10:48

+  theCommands.Add("bfillds", "Performs intersection of the arguments.\n"
+                  "\t\tUsage: bfillds [-t]\n"
+                  "\t\tWhere: -t is the optional parameter for enabling timer and showing elapsed time of the operation",
+                  __FILE__, bfillds, g);

Command help doesn't mention a syntax for providing "the arguments" for intersection operation.
If this should be provided by another command - it would be useful mentioning command name in help.

+  Standard_EXPORT static BOPAlgo_Operation GetOperationType(const Standard_CString& theOp);

It is unusual and unnecessary passing Standard_CString (which is char*) by reference.

git

2021-09-08 12:07

administrator   ~0103918

Branch CR30206 has been updated forcibly by emv.

SHA-1: 96ed82265f9012e45c3d0f9b5899f9dae39b9dfa

emv

2021-09-08 14:32

developer   ~0103924

Corrected.

git

2021-09-08 15:07

administrator   ~0103926

Branch CR30206 has been updated by emv.

SHA-1: 7f5c10d02eaf3f11eb0b1bca6ecba2601f249fb8


Detailed log of new commits:

Author: emv
Date: Wed Sep 8 15:06:16 2021 +0300

    # small correction.

msv

2021-09-08 15:09

developer   ~0103927

For integration:
occt - CR30206
products - node

smoskvin

2021-09-11 13:24

administrator   ~0104006

Combination -
OCCT branch : IR-2021-09-10
master SHA - 9ae883970dd77a39d856b49e6883ed5d0e60d20f
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2021-09-10 SHA - 2d2bc879e2da9d770a1938ab3410f5885c8555e7
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: 17358.54000000042 / 17496.500000000422 [-0.79%]
Products
Total CPU difference: 11397.800000000112 / 11567.680000000111 [-1.47%]
Windows-64-VC14:
OCCT
Total CPU difference: 19328.109375 / 19307.609375 [+0.11%]
Products
Total CPU difference: 12733.328125 / 12920.953125 [-1.45%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2021-09-11 14:05

administrator   ~0104025

Branch CR30206 has been deleted by mnt.

SHA-1: 7f5c10d02eaf3f11eb0b1bca6ecba2601f249fb8

Related Changesets

occt: master 74a53b82

2021-09-07 13:00:25

emv


Committer: smoskvin Details Diff
0030206: Improve API of commands bbop and bapibop
0030620: Tests - perf/bop/buildfaces does not match description (broken)

Allow using meaningful parameters for the commands bbop and bapibop:
* common - for Common operation
* fuse - for Fuse operation
* cut - for Cut operation
* tuc/cut21 - for Cut21 operation
* section - for Section operation

Add description for the commands dealing with Boolean/GF/Split operations.
Validate arguments of these commands.

Correct test case perf/bop/buildfaces to perform GF execution in parallel and serial modes - compare the results.
Affected Issues
0030206
mod - src/BOPTest/BOPTest.cxx Diff File
mod - src/BOPTest/BOPTest.hxx Diff File
mod - src/BOPTest/BOPTest_APICommands.cxx Diff File
mod - src/BOPTest/BOPTest_ObjCommands.cxx Diff File
mod - src/BOPTest/BOPTest_PartitionCommands.cxx Diff File
mod - tests/bugs/modalg_5/bug24639 Diff File
add - tests/bugs/modalg_7/bug30206 Diff File
mod - tests/perf/bop/buildfaces Diff File

Issue History

Date Modified Username Field Change
2018-10-05 16:03 msv New Issue
2018-10-05 16:03 msv Assigned To => emv
2019-07-19 17:27 apn Target Version 7.4.0 => 7.5.0
2020-08-28 13:25 emv Target Version 7.5.0 => 7.6.0
2021-09-07 16:01 git Note Added: 0103895
2021-09-07 17:42 git Note Added: 0103900
2021-09-07 22:06 git Note Added: 0103906
2021-09-08 07:40 emv Note Added: 0103911
2021-09-08 07:40 emv Assigned To emv => msv
2021-09-08 07:40 emv Status new => resolved
2021-09-08 07:41 emv Note Edited: 0103911
2021-09-08 07:41 emv Relationship added related to 0030620
2021-09-08 10:46 msv Note Added: 0103916
2021-09-08 10:46 msv Assigned To msv => emv
2021-09-08 10:46 msv Status resolved => assigned
2021-09-08 10:46 kgv Note Added: 0103917
2021-09-08 10:48 kgv Note Edited: 0103917
2021-09-08 12:07 git Note Added: 0103918
2021-09-08 14:32 emv Note Added: 0103924
2021-09-08 14:32 emv Assigned To emv => msv
2021-09-08 14:32 emv Status assigned => resolved
2021-09-08 15:07 git Note Added: 0103926
2021-09-08 15:09 msv Note Added: 0103927
2021-09-08 15:09 msv Assigned To msv => bugmaster
2021-09-08 15:09 msv Status resolved => reviewed
2021-09-08 15:12 emv Test case number => test bugs modalg_7 bug30206
2021-09-11 13:24 smoskvin Note Added: 0104006
2021-09-11 13:24 smoskvin Status reviewed => tested
2021-09-11 13:43 smoskvin Changeset attached => occt master 74a53b82
2021-09-11 13:43 smoskvin Assigned To bugmaster => smoskvin
2021-09-11 13:43 smoskvin Status tested => verified
2021-09-11 13:43 smoskvin Resolution open => fixed
2021-09-11 14:05 git Note Added: 0104025