View Issue Details

IDProjectCategoryView StatusLast Update
0023762Open CASCADEOCCT:Foundation Classespublic2021-10-21 20:01
Reportersan Assigned Tobugmaster  
PrioritynormalSeveritytweak 
Status closedResolutionno change required 
PlatformAOSL 
Product Version6.5.4 
Target Version7.6.0 
Summary0023762: Way of getting normals from Poly_Triangulation is inconvenient
DescriptionThe current implementation of Poly_Triangulation::Normals() looks heavy and inconvenient:
const TShort_Array1OfShortReal& Poly_Triangulation::Normals() const
{

  if(myNormals.IsNull() || myNormals->Length() != 3*myNbNodes) {
    Standard_NullObject::Raise("Poly_Triangulation::Normals : "
                               "wrong length or null array");
  }

  return myNormals->Array1();
}


1. Why return a const reference to the internal array instead of returning myNormals directly?
2. Throwing an exception in case if normals data is not available requires special tricks or code duplication in order to write the conditional code that works both when normals are present and when they are not.
3. What is the purpose of Poly_Triangulation::ChangeNormals()? Why provide access to internal array of myNormals instead of simply returning myNormals itself and letting the applications decide what to do with it?

It is proposed to return myNormals in Poly_Trinagulation::Normals() and remove consistency checks leaving them to the applications that can e.g. use Poly_Triangulation::HasNormals() for this purpose. Poly_Trinagulation::ChangeNormals() is most likely to be removed, too. Normals() and SetNormals() methods seem sufficient.

TagsNo tags attached.
Test case number

Relationships

related to 0025936 assignedkgv Open CASCADE Modeling Data - reusable data structure for 2D tesselation (3- and 4-nodal mesh) 
related to 0032133 closedbugmaster Open CASCADE Modeling Data - Restriction of access to internal arrays for Poly_Triangulation, revision of API 

Activities

kgv

2021-09-20 10:35

developer   ~0104225

#0026007 introduced Poly_Triangulation::Normal()/Poly_Triangulation::SetNormal() methods for accessing per-vertex normal values, and 0032133 deprecated access to internal array of normals (as well as to other internal arrays).

Therefore, I propose closing this issues.

Issue History

Date Modified Username Field Change
2013-02-14 10:59 san New Issue
2013-02-14 10:59 san Assigned To => abv
2014-09-12 14:43 abv Target Version => 7.1.0
2016-11-01 06:41 abv Target Version 7.1.0 => 7.2.0
2016-11-01 10:14 kgv Relationship added related to 0025936
2017-07-27 11:17 abv Target Version 7.2.0 => 7.4.0
2019-07-10 22:29 abv Target Version 7.4.0 => 7.5.0
2020-09-11 16:13 utverdov Target Version 7.5.0 => 7.6.0
2020-12-14 12:51 kgv Description Updated
2021-09-20 10:28 kgv Relationship added related to 0032133
2021-09-20 10:35 kgv Note Added: 0104225
2021-09-20 10:35 kgv Assigned To abv => bugmaster
2021-09-20 10:35 kgv Status new => feedback
2021-09-20 10:35 kgv Resolution open => no change required
2021-10-21 20:01 bugmaster Status feedback => closed