Defines a polygonal shape consisting of triangles. More...
Public Member Functions | |
| IndexedTriangleSet (global::System.IntPtr cPtr, bool cMemoryOwn) | |
| Adds triangles. | |
| bool | AddTriangles (cadex.Collections.PointList theVertices, cadex.Collections.IntList theVertexIndices) |
| bool | AddTriangles (cadex.Collections.PointList theVertices, cadex.Collections.IntList theVertexIndices, cadex.Collections.VectorList theNormals, cadex.Collections.IntList theNormalIndices) |
| Adds triangles. | |
| bool | AddTriangles (cadex.Collections.PointList theVertices, cadex.Collections.IntList theVertexIndices, cadex.Collections.VectorList theNormals, cadex.Collections.IntList theNormalIndices, cadex.Collections.ColorList theColors, cadex.Collections.IntList theColorIndices) |
| Adds triangles. | |
| bool | AddTriangles (cadex.ModelData.IndexedTriangleSet theTriangleSet) |
| Adds triangles from theTriangleSet. | |
| cadex.ModelData.IndexedTriangleSet | WithColors (cadex.Collections.ColorList theColors, cadex.Collections.IntList theColorIndices) |
| Returns a new IndexedTriangleSet. Vertices and Normals copies from the caller. | |
| cadex.Geom.Point | Vertex (int theIndex) |
| Returns a vertex. | |
| uint | NumberOfVertices () |
| Returns a number of vertices. | |
| bool | HasNormals () |
| Returns true if the triangle set has explicitly defined normals. | |
| cadex.Geom.Vector | Normal (int theIndex) |
| Returns a normal. | |
| uint | NumberOfNormals () |
| Returns a number of normals. | |
| bool | HasColors () |
| Returns true if the triangle set has explicitly defined colors. | |
| cadex.Materials.Color | Color (int theIndex) |
| Returns a color. | |
| uint | NumberOfColors () |
| Returns a number of colors. | |
| cadex.Geom.Point | TriangleVertex (uint theTriangleIndex, uint theVertexSlot) |
| Returns a vertex of a triangle. | |
| int | TriangleVertexIndex (uint theTriangleIndex, uint theVertexSlot) |
| Returns a vertex index in a triangle. | |
| cadex.Geom.Vector | TriangleVertexNormal (uint theTriangleIndex, uint theVertexSlot) |
| Returns a normal at vertex in a triangle. | |
| int | TriangleVertexNormalIndex (uint theTriangleIndex, uint theVertexSlot) |
| Returns a normal index for vertex in a triangle. | |
| cadex.Geom.Vector | TriangleNormal (uint theTriangleIndex) |
| Returns a normal of a triangle. | |
| cadex.Materials.Color | TriangleVertexColor (uint theTriangleIndex, uint theVertexSlot) |
| Returns a color at vertex in a triangle. | |
| int | TriangleVertexColorIndex (uint theTriangleIndex, uint theVertexSlot) |
| Returns a color index for vertex in a triangle. | |
| uint | NumberOfTriangles () |
| Returns a number of triangles. | |
Public Member Functions inherited from cadex.ModelData.MeshShape | |
| MeshShape (global::System.IntPtr cPtr, bool cMemoryOwn) | |
Public Member Functions inherited from cadex.BaseObject | |
| BaseObject (global::System.IntPtr cPtr, bool cMemoryOwn) | |
| void | Dispose () |
| bool | IsNull () |
| ulong | Id () |
| Return unique identifier of public object. | |
| bool | IsEqual (cadex.BaseObject theObj) |
| override int | GetHashCode () |
| override bool | Equals (System.Object o) |
Static Public Member Functions | |
| static new bool | CompareType (cadex.BaseObject theObject) |
| static cadex.ModelData.IndexedTriangleSet | Cast (cadex.ModelData.MeshShape theBase) |
Static Public Member Functions inherited from cadex.ModelData.MeshShape | |
| static bool | CompareType (cadex.BaseObject theObject) |
| Check the type of object. Returns true if the specified object is this class type. | |
| static cadex.ModelData.MeshShape | Cast (cadex.BaseObject theBase) |
Protected Member Functions | |
| override void | Dispose (bool disposing) |
Protected Member Functions inherited from cadex.ModelData.MeshShape | |
| override void | Dispose (bool disposing) |
Defines a polygonal shape consisting of triangles.
Triangles are defined via array of unique vertices and triplets of indices in this array. This is to describe connectivity and to reduce data required to describe a triangle set.
The triangle set can optionally contain normals and/or colors which are defined per each vertex. Normals and colors also use indexing in the same manner as vertices.
A triangle set can be constructed using AddTriangles(), supplying unique vertices and indices describing triangles, for instance:
The user must ensure data consistency so that the number of added normals and/or colors is equal to number of added vertices. Otherwise, triangles won't be added.
Data can be queried using the rank number of triangle and a vertex slot (0 to 2), for instance:
Coordinate and normal indices into respective arrays of unique values can be queried using TriangleVertexIndex() and TriangleVertexNormalIndex() respectively.
|
inline |
Adds triangles.
The number of values in theVertexIndices must be a multiple of three, since each triplet defines a triangle.
Returns true if the triangles were successfully added and false otherwise.
Constructor.
Creates not initialized object, for which IsNull() returns true.
|
inline |
Adds triangles.
The number of values in theVertexIndices and theNormalIndices must be the same and a multiple of three, since each triple defines a vertex and vertex normal of a triangle, respectively.
Returns true if the triangles were successfully added and false otherwise.
|
inline |
Adds triangles.
The number of values in theVertexIndices, theNormalIndices and theColorIndices should be the same and a multiple of three, since each triple defines a vertex, vertex normal and vertex color of a triangle, respectively. However, if there is no need to add normals, then theNormals and theNormalIndices can be empty.
Returns true if the triangles were successfully added and false otherwise.
|
inline |
Returns a color.
theIndex must be in the range [0, NumberOfColors()-1]. Otherwise the result is undefined.
|
inlineprotectedvirtual |
Reimplemented from cadex.BaseObject.
|
inline |
Returns true if the triangle set has explicitly defined colors.
|
inline |
Returns true if the triangle set has explicitly defined normals.
|
inline |
Returns a normal.
theIndex must be in the range [0, NumberOfNormals()-1]. Otherwise the result is undefined.
|
inline |
Returns a normal of a triangle.
theTriangleIndex must be in the range [0, NumberOfTriangles()-1]. Otherwise the result is undefined.
The normal is calculated on the fly based on the vertices of the triangle.
In case of a degenerate triangle the zero vector will be returned.
|
inline |
Returns a vertex of a triangle.
theTriangleIndex must be in the range [0, NumberOfTriangles()-1]. Otherwise the result is undefined. theVertexSlot must be in the range [0, 2]. Otherwise the result is undefined.
|
inline |
Returns a color at vertex in a triangle.
theTriangleIndex must be in the range [0, NumberOfTriangles()-1]. Otherwise the result is undefined. theVertexSlot must be in the range [0, 2]. Otherwise the result is undefined.
|
inline |
Returns a color index for vertex in a triangle.
theTriangleIndex must be in the range [0, NumberOfTriangles()-1]. theVertexSlot must be in the range [0, 2].
If the color index was not found -1 will be returned.
|
inline |
Returns a vertex index in a triangle.
theTriangleIndex must be in the range [0, NumberOfTriangles()-1]. theVertexSlot must be in the range [0, 2].
If the vertex index was not found -1 will be returned.
|
inline |
Returns a normal at vertex in a triangle.
theTriangleIndex must be in the range [0, NumberOfTriangles()-1]. Otherwise the result is undefined. theVertexSlot must be in the range [0, 2]. Otherwise the result is undefined.
|
inline |
Returns a normal index for vertex in a triangle.
theTriangleIndex must be in the range [0, NumberOfTriangles()-1]. theVertexSlot must be in the range [0, 2].
If the normal index was not found -1 will be returned.
|
inline |
Returns a vertex.
theIndex must be in the range [0, NumberOfVertices()-1]. Otherwise the result is undefined.
|
inline |
Returns a new IndexedTriangleSet. Vertices and Normals copies from the caller.
The size of theColorIndices must be equal to the size of theVertexIndices (NumberOfTriangles() * 3). Otherwise an empty IndexedTriangleSet will be returned.