DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Expand ModelsModels
Expand DG Kernel ComponentsDG Kernel Components
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Expand General GeometryGeneral Geometry
Collapse ModelModel
Expand ViewView
Expand General ComputingGeneral Computing
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation LinksHome Page > API Reference > Model > Entities > Geometry > Mesh Geometry > ISimplex Search Documentation


ISimplex(64) Interface

GetVertexCount
GetVertexPosition
GetFacetNormal
GetNormal
GetNormalIndex
SetNormalIndex

This interface manipulates properties of a single simplex in a mesh.

Two ISimplex 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 simplex in a mesh should be avoided whenever possible to avoid excessive memory consumption. Consider using IMeshMods and/or other mesh interfaces instead

See also IMesh, IMesh, IVertex, IInterface List


HRESULT GetVertexCount(int* count )

Parameters

count  - [out] - Returned number of vertices in the simplex. In this product it is always 3.

Returns

S_OK in case of success.
Remarks:

This method returns number of vertices in the simplex. In this product (may change in future) all simplexes are triangles, so the return is always 3. 


HRESULT GetVertexPosition( int index, int* vertex )

Parameters

index  - [in] Index of a corner of the triangle. Must be 0, 1, or 2.

vertex - [out, retval] Returned position of the vertex in the vertex list of the mesh.

Return Values

S_OK in case of success.
Remarks:

This method returns position of the index-th corner in the vertex list of the mesh.


HRESULT GetFacetNormal( double* vx, double* vy, double* vz )

Parameters

vx, vy, vz - [out] - Calculated coordinates of normal to face of the simplex

Return Values

S_OK in case of success.
Remarks:

Returns coordinates of normal to face of the simplex. Note this normal may be different from normal returned by IMesh.GetNormal() or IVetrex.GetNormal() The later normals are applied at vertices of the mesh, which quite often does not coincide with normal of the face even for regular vertices.  The method is provided for convenience in performing different mesh related calculations. 


HRESULT GetNormal(int index, double* vx, double* vy, double* vz )

Parameters

index  - [in] Index of a corner of the triangle. Must be 0, 1, or 2.

vx, vy, vz - [out] - Returned coordinates of normal at the corner vertex.

Return Values

S_OK in case of success.
Remarks:

This method returns coordinates of normal at the index-th corner of the simplex. When the corner a singular vertex (has several normals) the correct normal, assigned via SetNormalIndex below or in some other way, is returned.


HRESULT GetNormalIndex(int index, int* normal)

Parameters

index  - [in] Index of a corner of the triangle. Must be 0, 1, or 2.

normal - [out, retval] - Returned index of the normal correspondent to this simplex in normal array of the vertex.

Return Values

S_OK in case of success.
Remarks:

Returns index of the normal correspondent to this simplex in normal array of the vertex  


HRESULT SetNormalIndex(int index, int normal)

Parameters

index  - [in] Index of a corner of the triangle. Must be 0, 1, or 2.

normal - [in] - 0-based index of the normal correspondent to this simplex in normals array of the vertex. Must be less than value returned by IVertex.GetNormalCount for the correspondent vertex.

Return Values

S_OK in case of success.
Remarks:

This methods assigns normal-th normal of normals array of the vertex as normal related to this simplex.