View Issue Details

IDProjectCategoryView StatusLast Update
0029814Open CASCADEOCCT:Modeling Datapublic2018-06-23 13:57
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version7.4.0Fixed in Version7.4.0 
Summary0029814: Modeling Data - add method TopoDS_Shape::NbChildren() for simple check of sub-shapes number
DescriptionSometimes it is needed to check if TopoDS_Shape has any sub-shapes / has only single sub-shape (for example, when creating an empty TopoDS_Compound).

Using TopoDS_Iterator in this context is annoying (requires several lines of code for creation, Next() + More()).

So that it is proposed adding a method TopoDS_Shape::NbChildren() which would allow making these queries simple and compact.
Steps To ReproduceN/A
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0029827 closedbugmaster Modeling Data - TopoDS_Shape::Nullify() does not reset location 
related to 0029828 closedbugmaster Coding Rules - specify preferred style for declaring OCCT RTTI elements in class definition 

Activities

git

2018-05-24 18:07

administrator   ~0076248

Branch CR29814 has been created by kgv.

SHA-1: 3c011edf44d665821e047a6a544ba644a0d01334


Detailed log of new commits:

Author: kgv
Date: Thu May 24 18:06:37 2018 +0300

    0029814: Modeling Data - add method TopoDS_Shape::NbChildren() for simple check of sub-shapes number
    
    TopoDS_Shape::NbChildren() - new method has been introduced.
    TopoDS_Shape.lxx, TopoDS_TShape.lxx - inline methods have been moved to hxx.
    TopoDS_TShape_Flags has been redeclared as enumeration instead of preprocessor macros.

kgv

2018-05-24 19:27

developer   ~0076300

Patch is ready for review.

abv

2018-05-31 09:06

manager   ~0076467

Some remarks:

1. Is "#include <TopoDS_Shape.hxx>" really needed at the end of TopoDS_TShape.hxx? Can we avoid having cyclic inclusion here?

2. Please stop reorganizing the code of touched headers by moving DEFINE_STANDARD_HANDLE() macro to the end of the header file. The default variant (inherited from CDL times) is when it is located before definition of relevant class, and it is how this is done in most places. If you think it should be moved to the end, please do this systematically for the whole code base in the frames of separate issue.

3. Note that Standard_Type.hxx includes (directly or indirectly) most of general headers from Standard (Standard.hxx, Standard_Transient.hxx, Standard_Boolean.hxx etc.), thus including it alone is sufficient in most cases.

git

2018-05-31 10:37

administrator   ~0076470

Branch CR29814 has been updated forcibly by kgv.

SHA-1: f3eee77a26f41c9135e8fe97423661a74f945840

git

2018-05-31 10:45

administrator   ~0076471

Branch CR29814 has been updated by kgv.

SHA-1: 7d482a60b86dd2640c722856a23389c57bbab0fb


Detailed log of new commits:

Author: kgv
Date: Thu May 31 10:45:01 2018 +0300

    # remove some redundant headers inclusion and comment #include <TopoDS_Shape.hxx> at the end of TopoDS_TShape.hxx

kgv

2018-05-31 12:14

developer   ~0076476

Please check updated patch.

http://jenkins-test-11.nnov.opencascade.com/view/CR29814-master-KGV/

git

2018-06-03 14:53

administrator   ~0076555

Branch CR29814_1 has been created by abv.

SHA-1: 1b12fc6d47302066fea1a597cb997f89b2a4bb1d


Detailed log of new commits:

Author: kgv
Date: Thu May 24 18:06:37 2018 +0300

    0029814: Modeling Data - add method TopoDS_Shape::NbChildren() for simple check of sub-shapes number
    
    TopoDS_Shape::NbChildren() - new method has been introduced.
    TopoDS_Shape.lxx, TopoDS_TShape.lxx - inline methods have been moved to hxx.
    TopoDS_TShape_Flags has been redeclared as enumeration instead of preprocessor macros.
    
    Cyclic dependency between headers TopoDS_Shape.hxx and TopoDS_TShape.hxx eliminated.

abv

2018-06-03 14:55

manager   ~0076556

Reviewed with amendments:
- removed cyclic dependency between headers TopoDS_Shape.hxx and TopoDS_TShape.hxx;
- location of DEFINE_STANDARD_RTTI macro is restored in TopoDS_TShape.hxx

abv

2018-06-03 22:26

manager   ~0076557

Testing of branch CR29814_1 passed in Jenkins job CR29814-master-KGV

git

2018-06-04 12:06

administrator   ~0076579

Branch CR29814_1 has been updated by abv.

SHA-1: 611e324c3e36656e1b92c2d2a918e7072bd977ad


Detailed log of new commits:

Author: abv
Date: Mon Jun 4 11:50:10 2018 +0300

    Places where TopoDS_Iterator is used only for calculation of number of sub-shapes are updated to use NbChildren() instead

abv

2018-06-04 13:40

manager   ~0076584

Testing of updated branch CR29814_1 passed in Jenkins job CR29814-master-KGV

bugmaster

2018-06-04 16:50

administrator   ~0076597

Combination -
OCCT branch : CR29814_1 SHA - 611e324c3e36656e1b92c2d2a918e7072bd977ad
Products branch : master SHA - 82570c1f4b0e27eb09789f573087eef089260f59
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:
Debian70-64:
OCCT
Total CPU difference: 17100.790000000114 / 17011.039999999866 [+0.53%]
Products
Total CPU difference: 7467.240000000033 / 7518.570000000041 [-0.68%]
Windows-64-VC10:
OCCT
Total CPU difference: 16856.594454398568 / 16821.806231398525 [+0.21%]
Products
Total CPU difference: 8228.3039451999 / 8177.369618699882 [+0.62%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2018-06-23 13:57

administrator   ~0076964

Branch CR29814 has been deleted by kgv.

SHA-1: 7d482a60b86dd2640c722856a23389c57bbab0fb

git

2018-06-23 13:57

administrator   ~0076965

Branch CR29814_1 has been deleted by kgv.

SHA-1: 611e324c3e36656e1b92c2d2a918e7072bd977ad

Related Changesets

occt: master b2d1851c

2018-05-24 15:06:37

kgv


Committer: bugmaster Details Diff
0029814: Modeling Data - add method TopoDS_Shape::NbChildren() for simple check of sub-shapes number

TopoDS_Shape::NbChildren() - new method has been introduced.
TopoDS_Shape.lxx, TopoDS_TShape.lxx - inline methods have been moved to hxx.
TopoDS_TShape_Flags has been redeclared as enumeration instead of preprocessor macros.

Cyclic dependency between headers TopoDS_Shape.hxx and TopoDS_TShape.hxx eliminated.

Places where TopoDS_Iterator is used only for calculation of number of sub-shapes are updated to use NbChildren() instead
Affected Issues
0029814
mod - src/AIS/AIS_ParallelRelation.cxx Diff File
mod - src/AIS/AIS_Shape.cxx Diff File
mod - src/AIS/AIS_SymmetricRelation.cxx Diff File
mod - src/BOPAlgo/BOPAlgo_ArgumentAnalyzer.cxx Diff File
mod - src/BOPAlgo/BOPAlgo_Builder_3.cxx Diff File
mod - src/BOPAlgo/BOPAlgo_Tools.cxx Diff File
mod - src/BOPAlgo/BOPAlgo_WireSplitter.cxx Diff File
mod - src/BRep/BRep_TEdge.cxx Diff File
mod - src/BRep/BRep_TFace.cxx Diff File
mod - src/BRep/BRep_TVertex.cxx Diff File
mod - src/BRepCheck/BRepCheck.cxx Diff File
mod - src/BRepFill/BRepFill_TrimShellCorner.cxx Diff File
mod - src/BRepGProp/BRepGProp.cxx Diff File
mod - src/BRepGProp/BRepGProp_Gauss.cxx Diff File
mod - src/BRepOffset/BRepOffset_MakeOffset.cxx Diff File
mod - src/BRepOffset/BRepOffset_MakeOffset_1.cxx Diff File
mod - src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx Diff File
mod - src/BRepProj/BRepProj_Projection.cxx Diff File
mod - src/BRepTools/BRepTools.cxx Diff File
mod - src/DBRep/DBRep_IsoBuilder.cxx Diff File
mod - src/DNaming/DNaming.cxx Diff File
mod - src/DNaming/DNaming_BooleanOperationDriver.cxx Diff File
mod - src/DNaming/DNaming_FilletDriver.cxx Diff File
mod - src/DrawDim/DrawDim_PlanarDimensionCommands.cxx Diff File
mod - src/HLRBRep/HLRBRep_ShapeToHLR.cxx Diff File
mod - src/IGESToBRep/IGESToBRep.cxx Diff File
mod - src/IGESToBRep/IGESToBRep_BRepEntity.cxx Diff File
mod - src/IVtkOCC/IVtkOCC_SelectableObject.cxx Diff File
mod - src/ShapeAnalysis/ShapeAnalysis_Wire.cxx Diff File
mod - src/ShapeCustom/ShapeCustom.cxx Diff File
mod - src/ShapeFix/ShapeFix_FixSmallSolid.cxx Diff File
mod - src/ShapeFix/ShapeFix_Shape.cxx Diff File
mod - src/ShapeFix/ShapeFix_Shell.cxx Diff File
mod - src/ShapePersistent/ShapePersistent_TopoDS.cxx Diff File
mod - src/ShapeProcessAPI/ShapeProcessAPI_ApplySequence.cxx Diff File
mod - src/StdPrs/StdPrs_ShadedShape.cxx Diff File
mod - src/STEPConstruct/STEPConstruct_Styles.cxx Diff File
mod - src/STEPConstruct/STEPConstruct_ValidationProps.cxx Diff File
mod - src/StepToTopoDS/StepToTopoDS_TranslateCurveBoundedSurface.cxx Diff File
mod - src/TNaming/TNaming_Localizer.cxx Diff File
mod - src/TNaming/TNaming_Name.cxx Diff File
mod - src/TopoDS/FILES Diff File
mod - src/TopoDS/TopoDS_Builder.cxx Diff File
mod - src/TopoDS/TopoDS_Iterator.cxx Diff File
mod - src/TopoDS/TopoDS_Shape.cxx Diff File
mod - src/TopoDS/TopoDS_Shape.hxx Diff File
rm - src/TopoDS/TopoDS_Shape.lxx Diff File
mod - src/TopoDS/TopoDS_TCompound.cxx Diff File
mod - src/TopoDS/TopoDS_TCompSolid.cxx Diff File
mod - src/TopoDS/TopoDS_TEdge.cxx Diff File
mod - src/TopoDS/TopoDS_TFace.cxx Diff File
mod - src/TopoDS/TopoDS_TShape.cxx Diff File
mod - src/TopoDS/TopoDS_TShape.hxx Diff File
rm - src/TopoDS/TopoDS_TShape.lxx Diff File
mod - src/TopoDS/TopoDS_TShell.cxx Diff File
mod - src/TopoDS/TopoDS_TSolid.cxx Diff File
mod - src/TopoDS/TopoDS_TVertex.cxx Diff File
mod - src/TopoDS/TopoDS_TWire.cxx Diff File
mod - src/TopoDSToStep/TopoDSToStep_MakeFacetedBrep.cxx Diff File
mod - src/TopoDSToStep/TopoDSToStep_MakeGeometricCurveSet.cxx Diff File
mod - src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx Diff File
mod - src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx Diff File
mod - src/TopoDSToStep/TopoDSToStep_MakeStepWire.cxx Diff File
mod - src/TopOpeBRepBuild/TopOpeBRepBuild_Merge.cxx Diff File
mod - src/TransferBRep/TransferBRep.cxx Diff File
mod - src/XCAFDoc/XCAFDoc_ShapeTool.cxx Diff File
mod - src/XCAFPrs/XCAFPrs.cxx Diff File
mod - src/XCAFPrs/XCAFPrs_AISObject.cxx Diff File

Issue History

Date Modified Username Field Change
2018-05-24 18:04 kgv New Issue
2018-05-24 18:04 kgv Assigned To => msv
2018-05-24 18:07 git Note Added: 0076248
2018-05-24 19:27 kgv Note Added: 0076300
2018-05-24 19:27 kgv Assigned To msv => abv
2018-05-24 19:27 kgv Status new => resolved
2018-05-31 08:47 abv Relationship added related to 0029827
2018-05-31 09:06 abv Note Added: 0076467
2018-05-31 09:06 abv Assigned To abv => kgv
2018-05-31 09:06 abv Status resolved => assigned
2018-05-31 10:37 git Note Added: 0076470
2018-05-31 10:45 git Note Added: 0076471
2018-05-31 12:11 kgv Relationship added related to 0029828
2018-05-31 12:14 kgv Note Added: 0076476
2018-05-31 12:14 kgv Assigned To kgv => abv
2018-05-31 12:14 kgv Status assigned => resolved
2018-06-03 14:53 git Note Added: 0076555
2018-06-03 14:55 abv Note Added: 0076556
2018-06-03 22:26 abv Note Added: 0076557
2018-06-03 22:26 abv Assigned To abv => bugmaster
2018-06-03 22:26 abv Status resolved => reviewed
2018-06-04 12:06 git Note Added: 0076579
2018-06-04 13:40 abv Note Added: 0076584
2018-06-04 16:37 bugmaster Test case number => Not needed
2018-06-04 16:50 bugmaster Note Added: 0076597
2018-06-04 16:50 bugmaster Status reviewed => tested
2018-06-14 18:20 bugmaster Changeset attached => occt master b2d1851c
2018-06-14 18:20 bugmaster Status tested => verified
2018-06-14 18:20 bugmaster Resolution open => fixed
2018-06-23 13:57 git Note Added: 0076964
2018-06-23 13:57 git Note Added: 0076965