IVertex Interface
- GetVertexCoord
- SetVertexCoord
- GetNormalCount
- SetNormalCount
- GetNormal
- SetNormal
This interface manipulates properties of a single Vertex in a mesh. IVertex
can be obtained using GetVertex method of IMeshEx
interface.
Two IVertex instances may have different pointer (or hash etc in higher level
languages) but still represent the same vertex. Use
IObject_KC interface queried from
each to compare the identity of the undelying object with a call to IObject_KC.IsEqual
Quering this interface for each vertex in a mesh should be avoided whenever possible to avoid excessive memory consumption. Consider using IMeshMods instead
See also Morph sample, IMesh,
ISimplex, IInterface List
HRESULT GetVertexCoord(double* x, double* y, double* z )
Parameters
x, y, z - [out] - Returned coordinates of
the vertex.
Returns
- S_OK in case of
success.
-
- Remarks:
The method returns coordinates of the vertex.
HRESULT SetVertexCoord(double x, double y, double z )
Parameters
x, y, z - [in] - New coordinates of
the vertex.
Return Values
-
- S_OK in case of
success.
-
- Remarks:
This method allows direct manipulation of vertices in the mesh. See also
remarks for IMesh interface.
This method requires a call to IModel.Update() or DG Kernel.UpdateSurface() for changes to appear in 3D view. If there are series of such changes it is recommended for performance to make the call once in the end of the series
HRESULT GetNormalCount( int* count)
Parameters
count - [out, retval] returned
count of normals
Return Values
-
- S_OK in case of
success.
-
- Remarks:
Returns count of normals kept by the vertex. It is equal to 1 when the vertex
is regular (inside of a smooth piece of surface). When the vertex is located at
an edge or a 3D corner the count coincides with the number of adjoined pieces of
surfaces.
HRESULT SetNormalCount( int count)
Parameters
count - [in] New normal count.
See remarks for GetNormalCount
Return Values
-
- S_OK in case of
success.
-
- Remarks:
This methods changes size of array of normals kept in the vertex. When the
size is changed coordinates of all normals are preserved. When the size is increased
newly added normals are created with default coordinates (1,0,0).
HRESULT GetNormal( int which, double* x, double* y, double* z )
Parameters
which - [in] 0-based index of
the normal in array of normals kept by the vertex. It must be between 0 and less
than the number returned by GetNormalCount.
Return Values
-
- S_OK in case of
success.
-
- Remarks:
Returns coordinates of the which-th normal
from array of normals kept by the vertex.
HRESULT SetNormal( int which, double vx, double vy, double vz )
Parameters
which - [in] 0-based index of
the normal in array of normals kept by the vertex. It must be between 0 and less
than the number returned by GetNormalCount.
vx, vy, vz- [in] - New coordinates of the normal.
Return Values
-
- S_OK in case of
success.
-
- Remarks:
Modifies coordinates of the which-th normal
from array of normals kept by the vertex.
|