DiscussionsIssue archiveOCCT:Visualization

Archived issue #0028276

Visualization, Graphic3d_ArrayOfPrimitives - fix usage of 16-bit indices

Open CASCADEOCCT:Visualizationclosed6 public notes

Search issues

Description

Graphic3d_ArrayOfPrimitives decides to allocate 16-bit or 32-bit indices within the following check:
    if (theMaxEdges < Standard_Integer(USHRT_MAX))
    {
      if (!myIndices->Init<unsigned short> (theMaxEdges))
      {
        myIndices.Nullify();
        return;
      }
    }
    else
    {
      if (!myIndices->Init<unsigned int> (theMaxEdges))
      {
        myIndices.Nullify();
        return;
      }
    }


This check is OK for normally compressed data.

However, external data might include exhaustive amount of vertex data requiring 32-bit indexation while overall amount of indices is still small.

Steps to reproduce

N/A

Public activity

6 archived notes

Participants are labeled by their role within this record.

01Commenter 3
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
Date: Fri Dec 23 21:21:00 2016 +0300

    0028276: Visualization, Graphic3d_ArrayOfPrimitives - fix usage of 16-bit indices
    
    Graphic3d_ArrayOfPrimitives now check the amount of vertex data rather than amount of indices.
02Author
Patch is ready for review.
03Commenter 3
Is it possible to implement a simple test case using pure OCCT capabilities (i.e. outside CAD Assistant)?
04Commenter 4
Branch CR28276 reviewed without remarks, ready for testing.
05Commenter 5
Dear Commenter 2,

Branch CR28276 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
[revision removed]

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 63
   Windows: 0
   MacOS: 1126

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 92817441 / 93054576 [-0.25%]
Total CPU difference: 21527.880000000092 / 21520.74000000037 [+0.03%]

Testing on Windows:
Total MEMORY difference: 58626750 / 58650770 [-0.04%]
Total CPU difference: 19440.75101939849 / 19731.318481998722 [-1.47%]
06Commenter 3
Branch [archived branch] has been deleted by Author.

[revision removed]

Related records