1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

Method for adding new nodes

This commit is contained in:
dbv
2015-03-31 17:44:21 +03:00
parent 5b43cc4ecb
commit fdb679fe1a
2 changed files with 29 additions and 4 deletions

View File

@@ -119,6 +119,30 @@ void Poly_Triangulation::RemoveUVNodes()
myUVNodes.Clear();
}
//=======================================================================
//function : AddNode
//purpose :
//=======================================================================
Standard_Integer Poly_Triangulation::AddNode (const gp_Pnt& theNode)
{
myNodes.Append (theNode);
if (!myUVNodes.IsEmpty())
{
myUVNodes.Append (gp_Pnt2d (0.0, 0.0));
}
if (!myNormals.IsEmpty())
{
Standard_Integer aNbNormals = myNodes.Size();
myNormals.SetValue (aNbNormals + 2, 0.0);
myNormals.SetValue (aNbNormals + 1, 0.0);
myNormals.SetValue (aNbNormals, 0.0);
}
return myNodes.Size();
}
//=======================================================================
//function : Node
//purpose :

View File

@@ -109,6 +109,11 @@ public:
//! @return true if 2D nodes are associated with 3D nodes for this triangulation.
Standard_Boolean HasUVNodes() const { return !myUVNodes.IsEmpty(); }
//! Adds Node to the triangulation. If triangulation has UVNodes or Normals
//! they will be expanded and set to zero values to match the new number of nodes.
//! @return index of the added Node.
Standard_EXPORT Standard_Integer AddNode (const gp_Pnt& theNode);
//! @return node at the given index.
//! Raises exception if theIndex is less than 1 or bigger than NbNodes().
Standard_EXPORT const gp_Pnt& Node (const Standard_Integer theIndex) const;
@@ -117,10 +122,6 @@ public:
//! Raises exception if theIndex is less than 1 or bigger than NbNodes().
Standard_EXPORT gp_Pnt& ChangeNode (const Standard_Integer theIndex);
//! Adds UVNode to the triangulation.
//! @return index of the added UVNode.
Standard_EXPORT Standard_Integer AddUVNode (const gp_Pnt2d& theUVNode);
//! @return UVNode at the given index.
//! Raises Standard_OutOfRange exception.
Standard_EXPORT const gp_Pnt2d& UVNode (const Standard_Integer theIndex) const;