mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +03:00
Method for adding new nodes
This commit is contained in:
@@ -119,6 +119,30 @@ void Poly_Triangulation::RemoveUVNodes()
|
|||||||
myUVNodes.Clear();
|
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
|
//function : Node
|
||||||
//purpose :
|
//purpose :
|
||||||
|
@@ -109,6 +109,11 @@ public:
|
|||||||
//! @return true if 2D nodes are associated with 3D nodes for this triangulation.
|
//! @return true if 2D nodes are associated with 3D nodes for this triangulation.
|
||||||
Standard_Boolean HasUVNodes() const { return !myUVNodes.IsEmpty(); }
|
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.
|
//! @return node at the given index.
|
||||||
//! Raises exception if theIndex is less than 1 or bigger than NbNodes().
|
//! Raises exception if theIndex is less than 1 or bigger than NbNodes().
|
||||||
Standard_EXPORT const gp_Pnt& Node (const Standard_Integer theIndex) const;
|
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().
|
//! Raises exception if theIndex is less than 1 or bigger than NbNodes().
|
||||||
Standard_EXPORT gp_Pnt& ChangeNode (const Standard_Integer theIndex);
|
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.
|
//! @return UVNode at the given index.
|
||||||
//! Raises Standard_OutOfRange exception.
|
//! Raises Standard_OutOfRange exception.
|
||||||
Standard_EXPORT const gp_Pnt2d& UVNode (const Standard_Integer theIndex) const;
|
Standard_EXPORT const gp_Pnt2d& UVNode (const Standard_Integer theIndex) const;
|
||||||
|
Reference in New Issue
Block a user