# class GeometryData

GeometryData represents a geometric structure consisting of point data (Vertices) and topological data (Triangles). GeometryData may represent a whole geometric object, but can also be used by streaming data filters, and in this way, only represents a part of the object. Different fields in the Vertices and Triangles fields data objects will contain point data and topological data. The standard naming convention used in the filters/renderers are as follows: (Case sensitive naming, other fields may also be present) 'Coords' Positional coordinates of a vertex, expressed with a 3-component real field (XYZ). 'TexCoords0' - 'TexCoords255' Texture coordinates of a vertex, expressed with a 2 components real field. By convention, the existing fields must be sequential, and must start with 'TexCoord0'. 'Normals' Normal vector for the vertex, expressed with a 3-component real field, a normalized (XYZ) vector. 'VertexIds' The id of the current vertex in the primitive. This field is present even if the vertex data is directly specified in the primitive data, to specify topology. The field is of type rid. 'MaterialIds' The material of the primitive. The field is of type rid. The 'Coords' and 'VertexIds' fields always exist in the object, but the other fields are optional. Also, there can exist user fields.

# Properties

Property Description
Name The name of the GeometryData object. (Inherited from Object)
TriangleCount The number of triangles in the geometry. The number of corners is always set to (TriangleCount*3), so there is no specific method to set the number of corners.
VertexCount The number of vertices in the geometry.

# Methods

Method Description
AddBaseTypeCustomField Adds an empty custom field. To be able to add a field, it must have a name that does not conflict with the existing custom fields.
AddBaseTypeUserCornerField Adds an empty user-specified corner field.
AddBaseTypeUserTriangleField Adds an empty user-specified triangle field.
AddBaseTypeUserVertexField Adds a user-specified vertex field. To be able to add a field, it must have a name that does not conflict with the existing vertex fields.
AddBoneWeights Adds the BoneWeights and BoneIds fields in the vertices. The BoneWeights and BoneIds fields are added and removed in unison, and should always be the same tuple size. (Field names: "BoneWeights" & "BoneIds", Tuple size: varying , Stored as: Vertex attribute)
AddColors The vertex colors in the input channel from the corners the geometry. The valid id range of the channel parameter is 0-255, which equals fields 'Colors0' - 'Colors255' (Field name: 'Color0'-'Color255' which is stored as attribute per corner)
AddCustomField Adds a custom field. To be able to add a field, it must have a name that does not conflict with the existing custom fields.
AddGroupIds Adds the GroupIds field in the triangles. (Field name: "GroupIds", Tuple size: 1 , Stored as: triangle attribute)
AddMaterialIds Adds the MaterialIds field in the triangles. (Field name: "MaterialIds", Tuple size: 1 , Stored as: triangle attribute)
AddNamedColors Adds a named Color field in the corners. (Field name: "Colors0" - "Colors255", Tuple size: 4 , Stored as: Corner attribute)
AddNamedTexCoords Adds a named TexCoords field in the corners. (Field name: "TexCoords0" - "TexCoords255", Tuple size: 2 , Stored as: Corner attribute)
AddNormals Adds the Normals field in the corners. (Field name: "Normals" , Tuple size: 3 , Stored as: Corner attribute)
AddObserver Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
AddTangents Adds Tangents and Bitangents fields in the corners. The valid id range of the level parameter is 0-255. (Field names: "Tangents0" - "Tangents255" & "Bitangents0" - "Bitangents255", Tuple size: 3 , Stored as: Corner attribute)
AddTexCoords Adds a TexCoords field in the corners. The valid id range of the level parameter is 0-255, which equals fields 'TexCoords0' - 'TexCoords255' (Field name: "TexCoords0" - "TexCoords255", Tuple size: 2 , Stored as: Corner attribute)
AddTriangles AddTriangles increases the triangle count by the specified value.
AddUserCornerField Adds a user-specified corner field. To be able to add a field, it must have a name that does not conflict with the existing corner fields.
AddUserTriangleField Adds a user-specified triangle field. To be able to add a field, it must have a name that does not conflict with the existing triangle fields.
AddUserVertexField Adds a user-specified vertex field. To be able to add a field, it must have a name that does not conflict with the existing vertex fields.
AddVertexLocks Adds the VertexLocks field for the vertices. If the value for a vertex is true, then the vertex should be locked, and not be removed in the collapse-process. (Field name: "VertexLocks", Tuple size: 1 , Stored as: Vertex attribute)
AddVertexWeights Adds the VertexWeights field for the vertices. The weights are used to determine how important it is to keep the vertices when the geometry is reduced. 1 means the weight won't change the importance, values closer to 0 means it will be less important, values > 1 means the vertex is more important and less probable to be removed. (Field name: "VertexWeights", Tuple size: 1 , Stored as: Vertex attribute)
AddVertices Increases the vertex count by the specified value.
AppendGeometry Appends the geometry data to this geometry. This geometry will contain all triangles and vertices of both geometries. The VertexIds that are copied from the source are remapped to point at the vertices, which are appended to the end of the current vertices. Any field in the appended geometry that does not exist in this geometry will be added, with the tuples that are added set to 0. The method will fail if the source geometry has identically named fields, but with different tuple sizes or base types.
CalculateExtents Calculate the extents by checking the coordinates of all vertices in the geometry. Set only_triangles to true to test only vertices that are indexed by a triangle. This is a slower test, and the bounding box may not encompass all vertices' positions. the new extents are found by calling GetInf() and GetSup() afterwards.
ChangeWinding Change winding.
CleanupInvalidTriangles Finds triangles that contain the same vertex more than once, and invalidates them, ie. sets all the vertex id references to -1. These triangles can be culled using Compact().
CleanupNanValues Finds all Nan (1.#IND, 1.#INF etc) values in the real/float/double arrays in the GeometryData, and sets them to 0.0 just to make sure all numbers in the GeometryData are legit. Should not be needed if all the data loaded into the GeometryData object is ok to begin with.
Compact Removes invalid triangles and vertices not referenced by any triangle. If any vertices are removed, the triangles will be remapped to the new compacted vertex field.
ConvertHandedness Converts the handedness of the triangle winding, coords, normals and texture coordinates of the geometry from left-handed to right-handed coordinate systems and vice versa. Simplygon generally uses right-handed coordinates, so this conversion needs to be done before processing any left-handed geometry.
CopyCombine3Corners Combines three corners via barycentric coordinates. alpha_3 = 1-(alpha_1 + alpha_2) dest = src_1*alpha_1 + src_2*alpha_2 + src_3*alpha_3.
CopyCombine3Triangles Combines the fields of three triangles via barycentric coordinates. alpha_3 = 1-(alpha_1 + alpha_2) dest = src_1*alpha_1 + src_2*alpha_2 + src_3*alpha_3.
CopyCombine3Vertices Combines the fields of three vertices via barycentric coordinates. alpha_3 = 1-(alpha_1 + alpha_2) dest = src_1*alpha_1 + src_2*alpha_2 + src_3*alpha_3.
CopyCombineCorners Combines the fields of two corners by linear interpolation into the destination corner.
CopyCombineTriangles Combines the fields of two triangles by linear interpolation into the destination triangle.
CopyCombineVertices Combines the fields of two vertices by linear interpolation into the destination vertex.
CopyCorner Copies all fields in the specified corner in the source geometry to the destination corner in this geometry .
CopyTriangle Copies all fields in the specified triangle in the source geometry to the destination triangle in this geometry.
CopyVertex Copies all fields in the specified vertex in the source geometry to the destination vertex in this geometry.
CreateAABB Returns an axis aligned bounding box GeometryData of this geometry.
DeepCopy Copies the field setup and data from another object into this object. To only copy the setup, set copy_data to false.
DetectEdgeNeighbours Detect triangle edge neighbors. Neighbor ids are stored in the "SgEdgeNeighbours" Corner field.
ExpandVertices Expands the Vertices field data so that there exists one vertex for each of the three corners of each triangle in the geometry. The vertices will be organized identical to the Corners field. The triangles will be remapped to use the new vertices correctly. Expanding the vertex field is required to be able to extract a range of the geometry, and to be able to stream it. Note! This will lead to increased memory requirement, as vertex data is not shared among neighboring triangles. It also removes the connectivity information of the triangles, and effectively detaches all triangles from one another. This call may replace fields in the Vertices field data. Re-query any previously cached field pointer after the call. All user fields are copied as well.
ExtentsContainCoords Tests if the extents of the geometry fully contain all vertex coordinates. Note! ExtentsContainCoords() checks all vertices in the geometry, regardless to whether the vertex is referenced by any triangle. Use Compact() to remove any non-referenced vertex before calling ExtentsContainCoords.
ExtractRange Extracts a range of triangles with their vertices from the geometry. ExpandVertices() must first be called for the extraction to succeed. ExtractGeometry() can be used to stream geometries in chunks. If writing to a stream, the extracted geometry is guaranteed to have the same setup as the original. Any previous data in the destination will be deleted.
ExtractTriangles Extracts specified triangles from the geometry. The destination geometry will contain the triangles and vertices. The vertices in the destination will be expanded so that there exists one vertex for each of the three corners of each triangle in the geometry.
FindEdgeIdsFromVertexPairs Each tuple in the "vertex_pairs" array contains the start-vertex and end-vertex of a half-edge in the geometry. If a half-edge is found from a tuple in the "vertex_pairs" array, the edge-id of that half-edge will be stored in the edge_ids array. Do note: the half-edges are directed, so if you want all half-edges that contains 2 vertices, you need to add the tuple twice.
FindNamedColorsIndex Returns the level index of the colors field with the name returns -1 if not found.
FindNamedTexCoordsIndex Returns the level index of the texcoord field with the name returns -1 if not found.
GetBitangents Gets a Bitangents field in the corners. The valid id range of the level parameter is 0-255. (Field name: "Bitangents0" - "Bitangents255", Tuple size: 3 , Stored as: Corner attribute)
GetBoneIds The BoneIds fields in the vertices. (Field name: "BoneIds", Tuple size: varying , Stored as: Vertex attribute)
GetBoneWeights The BoneWeights field in the vertices. (Field name: "BoneWeights", Tuple size: varying , Stored as: Vertex attribute)
GetClass Get the name of the GeometryData class. (Inherited from Object)
GetColors Gets a Color field in the corners. The valid id range of the level parameter is 0-255, which equals fields 'Colors0' - 'Colors255' (Field name: "Colors0" - "Colors255", Tuple size: 4 , Stored as: Corner attribute)
GetCoords The Coords field in the vertices. (Field name: "Coords", Tuple size: 3 , Stored as: Vertex attribute)
GetCorners Retrieves the IFieldData object that contains the corner fields.
GetCustomField Gets a custom field.
GetGroupIds The GroupIds field in the triangles. (Field name: "GroupIds", Tuple size: 1 , Stored as: triangle attribute)
GetInf The inferior (minimum) extent of the geometry.
GetMaterialIds The MaterialIds field in the triangles. (Field name: "MaterialIds", Tuple size: 1 , Stored as: triangle attribute)
GetNamedColors Gets a Color field, using the alternative name instead of the index.
GetNamedTexCoords Gets a TexCoords field, using the alternative name instead of the index.
GetNormals The Normals field in the corners. (Field name: "Normals" , Tuple size: 3 , Stored as: Corner attribute)
GetSup The superior (maximum) extent of the geometry.
GetTangents Gets a Tangents field in the corners. The valid id range of the level parameter is 0-255. (Field name: "Tangents0" - "Tangents255", Tuple size: 3 , Stored as: Corner attribute)
GetTexCoords Gets a TexCoords field in the corners. The valid id range of the level parameter is 0-255, which equals fields 'TexCoords0' - 'TexCoords255' (Field name: "TexCoords0" - "TexCoords255", Tuple size: 2 , Stored as: Corner attribute).
GetTriangles Retrieves the IFieldData object that contains the triangle fields.
GetUserCornerField Gets a user-specified corner field.
GetUserTriangleField Gets a user-specified triangle field.
GetUserVertexField Gets a user-specified vertex field.
GetVertexIds The VertexIds field in the corners.
GetVertexLocks The VertexLocks field for the vertices. If the value for a vertex is true, then the vertex should be locked, and not be removed in the collapse-process. (Field name: "VertexLocks", Tuple size: 1 , Stored as: Vertex attribute)
GetVertexWeights The VertexWeights field for the vertices. The weights are used to determine how important it is to keep the vertices when the geometry is reduced. 1 means the weight won't change the importance, values closer to 0 means it will be less important, values > 1 means the vertex is more important and less probable to be removed. (Field name: "VertexWeights", Tuple size: 1 , Stored as: Vertex attribute)
GetVertices Retrieves the IFieldData object that contains the vertex fields.
IsA Returns true if GeometryData is a or is a descendant of the class named as the type parameter. (Inherited from Object)
IsNull Returns true if the GeometryData object is invalid. (Inherited from Object)
IsSameObjectAs Returns true if the GeometryData object is valid. (Inherited from Object)
NewCopy Creates another geometry data object with the same field setup. To also copy the data to the new object, set copy_data to true.
NewPackedCopy Creates a "packed" PackedGeometryData object, where all fields in the Corner field data object is moved to the vertex field data object. Please note that the vertex field data object will be enlarged to accommodate for data in a vertex shared by multiple triangles, where the corner data differs between the triangles. The method will fail if a Corner field is named the same as an existing Vertices field, please make sure to remove any such field before calling the method.
NonNull Returns true if the GeometryData object is valid. (Inherited from Object)
PrintInfo Prints the content/info of the GeometryData object to the log. (Inherited from Object)
RemoveBoneWeights Removes the BoneWeights and BoneIds fields in the vertices. The BoneWeights and BoneIds fields are added and removed in unison, and should always be the same tuple size. (Field names: "BoneWeights" & "BoneIds", Tuple size: varying , Stored as: Vertex attribute)
RemoveColors Removes a Color field in the corners. The valid id range of the level parameter is 0-255, which equals fields 'Colors0' - 'Colors255' (Field name: "Colors0" - "Colors255", Tuple size: 4 , Stored as: Corner attribute)
RemoveCustomField Removes a custom field.
RemoveGroupIds Removes the GroupIds field in the triangles. (Field name: "GroupIds", Tuple size: 1 , Stored as: triangle attribute)
RemoveMaterialIds Removes the MaterialIds field in the triangles. (Field name: "MaterialIds", Tuple size: 1 , Stored as: triangle attribute)
RemoveNamedColors Removes a named Color field in the corners. (Field name: "Colors0" - "Colors255", Tuple size: 4 , Stored as: Corner attribute)
RemoveNamedTexCoords Removes a named TexCoords field in the corners. 'TexCoords0' - 'TexCoords255' (Field name: "TexCoords0" - "TexCoords255", Tuple size: 2 , Stored as: Corner attribute)
RemoveNormals Removes the Normals field in the corners. (Field name: "Normals" , Tuple size: 3 , Stored as: Corner attribute)
RemoveObserver Removes a previously added observer object. (Inherited from Object)
RemoveTangents Removes Tangents and Bitangents fields in the corners. The valid id range of the level parameter is 0-255. (Field names: "Tangents0" - "Tangents255" & "Bitangents0" - "Bitangents255", Tuple size: 3 , Stored as: Corner attribute)
RemoveTexCoords Removes a TexCoords field in the corners. The valid id range of the level parameter is 0-255, which equals fields 'TexCoords0' - 'TexCoords255' (Field name: "TexCoords0" - "TexCoords255", Tuple size: 2 , Stored as: Corner attribute)
RemoveUserCornerField Removes a user-specified corner field.
RemoveUserTriangleField Removes a user-specified triangle field.
RemoveUserVertexField Removes a user-specified vertex field.
RemoveVertexLocks Removes the VertexLocks field for the vertices. If the value for a vertex is true, then the vertex should be locked, and not be removed in the collapse-process. (Field name: "VertexLocks", Tuple size: 1 , Stored as: Vertex attribute)
RemoveVertexWeights Removes the VertexWeights field for the vertices. The weights are used to determine how important it is to keep the vertices when the geometry is reduced. 1 means the weight won't change the importance, values closer to 0 means it will be less important, values > 1 means the vertex is more important and less probable to be removed. (Field name: "VertexWeights", Tuple size: 1 , Stored as: Vertex attribute)
SetInf The inferior (minimum) extent of the geometry.
SetSup The superior (maximum) extent of the geometry.
Transform Transforms the geometry using the supplied matrix transformation. The fields that are modified are the Coords field of Vertices, as well as the Normals and all Tangent and Bi-tangent fields of the Corners.
Weld Welds all vertices in the geometry that are closer than the welding threshold. Non-referenced vertices will not be removed, only the vertex indices will be remapped. Call Compact() to clean up the geometry and free up memory.

# Static methods

Method Description
IsClassA Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)
SafeCast SafeCast makes sure the input object is of a class that can be cast into spGeometryData, and if this is the case, returns the object cast into spGeometryData. (Inherited from Object)

# Properties details

# Name

The name of the GeometryData object. (Inherited from Object)

# Syntax

// Setter
void SetName( const char * name ) const;

// Getter
spString GetName() const;

# SetName parameters

Type Name Min Max Description
const char * name New name of the object.

# GetName return value

Type: spString

# TriangleCount

The number of triangles in the geometry. The number of corners is always set to (TriangleCount*3), so there is no specific method to set the number of corners.

# Syntax

// Setter
void SetTriangleCount( unsigned int count ) const;

// Getter
unsigned int GetTriangleCount() const;

# SetTriangleCount parameters

Type Name Min Max Description
unsigned int count 0 INT_MAX The desired new triangle count.

# GetTriangleCount return value

Type: unsigned int

# VertexCount

The number of vertices in the geometry.

# Syntax

// Setter
void SetVertexCount( unsigned int count ) const;

// Getter
unsigned int GetVertexCount() const;

# SetVertexCount parameters

Type Name Min Max Description
unsigned int count 0 INT_MAX The desired new vertex count.

# GetVertexCount return value

Type: unsigned int

# Methods details

# AddBaseTypeCustomField

Adds an empty custom field. To be able to add a field, it must have a name that does not conflict with the existing custom fields.

# Syntax

spValueArray AddBaseTypeCustomField( Simplygon::EBaseTypes base_type , const char * name , unsigned int tuple_size ) const;

# Parameters

Type Name Min Max Description
EBaseTypes base_type The base_type of the new custom field, data types are listed in BaseTypes.
const char * name The name of the new custom field.
unsigned int tuple_size The tuple size of the new custom field, defaults to 1 if not specified.

# Return value

Type: ValueArray

# AddBaseTypeUserCornerField

Adds an empty user-specified corner field.

# Syntax

spValueArray AddBaseTypeUserCornerField( Simplygon::EBaseTypes base_type , const char * name , unsigned int tuple_size ) const;

# Parameters

Type Name Min Max Description
EBaseTypes base_type Specifies the base type of the new corner field, data types are listed in BaseTypes.
const char * name The name of the field to add.
unsigned int tuple_size The tuple size of the new field, defaults to 1 if not specified.

# Return value

Type: ValueArray

# AddBaseTypeUserTriangleField

Adds an empty user-specified triangle field.

# Syntax

spValueArray AddBaseTypeUserTriangleField( Simplygon::EBaseTypes base_type , const char * name , unsigned int tuple_size ) const;

# Parameters

Type Name Min Max Description
EBaseTypes base_type The base_type of the new user triangle field, data types are listed in BaseTypes.
const char * name The name of the triangle field to add to the GeometryData object.
unsigned int tuple_size The tuple size of the new field, deafaults to 1 if not specified.

# Return value

Type: ValueArray

# AddBaseTypeUserVertexField

Adds a user-specified vertex field. To be able to add a field, it must have a name that does not conflict with the existing vertex fields.

# Syntax

spValueArray AddBaseTypeUserVertexField( Simplygon::EBaseTypes base_type , const char * name , unsigned int tuple_size ) const;

# Parameters

Type Name Min Max Description
EBaseTypes base_type The BaseType of the new user field, data types are listed in BaseTypes.
const char * name The name of the new user field.
unsigned int tuple_size The tuple size of the new user field, defaults to 1 if not specified.

# Return value

Type: ValueArray

# AddBoneWeights

Adds the BoneWeights and BoneIds fields in the vertices. The BoneWeights and BoneIds fields are added and removed in unison, and should always be the same tuple size. (Field names: "BoneWeights" & "BoneIds", Tuple size: varying , Stored as: Vertex attribute)

# Syntax

void AddBoneWeights( unsigned int tuplesize ) const;

# Parameters

Type Name Min Max Description
unsigned int tuplesize The number of bones allowed per vertex.

# AddColors

The vertex colors in the input channel from the corners the geometry. The valid id range of the channel parameter is 0-255, which equals fields 'Colors0' - 'Colors255' (Field name: 'Color0'-'Color255' which is stored as attribute per corner)

# Syntax

void AddColors( rid channel ) const;

# Parameters

Type Name Min Max Description
rid channel The channel to retrieve the vertex colors for(0-255)

# AddCustomField

Adds a custom field. To be able to add a field, it must have a name that does not conflict with the existing custom fields.

# Syntax

void AddCustomField( const spValueArray & field ) const;

# Parameters

Type Name Min Max Description
ValueArray field The custom field to add to the GeometryData object.

# AddGroupIds

Adds the GroupIds field in the triangles. (Field name: "GroupIds", Tuple size: 1 , Stored as: triangle attribute)

# Syntax

void AddGroupIds() const;

# Parameters

AddGroupIds takes no parameters.

# AddMaterialIds

Adds the MaterialIds field in the triangles. (Field name: "MaterialIds", Tuple size: 1 , Stored as: triangle attribute)

# Syntax

void AddMaterialIds() const;

# Parameters

AddMaterialIds takes no parameters.

# AddNamedColors

Adds a named Color field in the corners. (Field name: "Colors0" - "Colors255", Tuple size: 4 , Stored as: Corner attribute)

# Syntax

rid AddNamedColors( const char * alternative_name ) const;

# Parameters

Type Name Min Max Description
const char * alternative_name The named color channel "Colors0" - "Colors255".

# Return value

Type: rid

# AddNamedTexCoords

Adds a named TexCoords field in the corners. (Field name: "TexCoords0" - "TexCoords255", Tuple size: 2 , Stored as: Corner attribute)

# Syntax

rid AddNamedTexCoords( const char * alternative_name ) const;

# Parameters

Type Name Min Max Description
const char * alternative_name The name of the texcoord level i.e. 'TexCoord0'.

# Return value

Type: rid

# AddNormals

Adds the Normals field in the corners. (Field name: "Normals" , Tuple size: 3 , Stored as: Corner attribute)

# Syntax

void AddNormals() const;

# Parameters

AddNormals takes no parameters.

# AddObserver

Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)

# Syntax

rid AddObserver( const spObserver & observer ) const;

# Parameters

Type Name Min Max Description
Observer observer Observer is the object that will receive events.

# Return value

Type: rid

# AddTangents

Adds Tangents and Bitangents fields in the corners. The valid id range of the level parameter is 0-255. (Field names: "Tangents0" - "Tangents255" & "Bitangents0" - "Bitangents255", Tuple size: 3 , Stored as: Corner attribute)

# Syntax

void AddTangents( rid level ) const;

# Parameters

Type Name Min Max Description
rid level The texture channel.

# AddTexCoords

Adds a TexCoords field in the corners. The valid id range of the level parameter is 0-255, which equals fields 'TexCoords0' - 'TexCoords255' (Field name: "TexCoords0" - "TexCoords255", Tuple size: 2 , Stored as: Corner attribute)

# Syntax

void AddTexCoords( rid level ) const;

# Parameters

Type Name Min Max Description
rid level The id of the texture field to add.

# AddTriangles

AddTriangles increases the triangle count by the specified value.

# Syntax

void AddTriangles( unsigned int count ) const;

# Parameters

Type Name Min Max Description
unsigned int count The number of new triangles to add.

# AddUserCornerField

Adds a user-specified corner field. To be able to add a field, it must have a name that does not conflict with the existing corner fields.

# Syntax

void AddUserCornerField( const spValueArray & field ) const;

# Parameters

Type Name Min Max Description
ValueArray field The field to add into the GeometryData object.

# AddUserTriangleField

Adds a user-specified triangle field. To be able to add a field, it must have a name that does not conflict with the existing triangle fields.

# Syntax

void AddUserTriangleField( const spValueArray & field ) const;

# Parameters

Type Name Min Max Description
ValueArray field The triangle field to add to the GeometryData object.

# AddUserVertexField

Adds a user-specified vertex field. To be able to add a field, it must have a name that does not conflict with the existing vertex fields.

# Syntax

void AddUserVertexField( const spValueArray & field ) const;

# Parameters

Type Name Min Max Description
ValueArray field The field to add to this GeometryData object.

# AddVertexLocks

Adds the VertexLocks field for the vertices. If the value for a vertex is true, then the vertex should be locked, and not be removed in the collapse-process. (Field name: "VertexLocks", Tuple size: 1 , Stored as: Vertex attribute)

# Syntax

void AddVertexLocks() const;

# Parameters

AddVertexLocks takes no parameters.

# AddVertexWeights

Adds the VertexWeights field for the vertices. The weights are used to determine how important it is to keep the vertices when the geometry is reduced. 1 means the weight won't change the importance, values closer to 0 means it will be less important, values > 1 means the vertex is more important and less probable to be removed. (Field name: "VertexWeights", Tuple size: 1 , Stored as: Vertex attribute)

# Syntax

void AddVertexWeights() const;

# Parameters

AddVertexWeights takes no parameters.

# AddVertices

Increases the vertex count by the specified value.

# Syntax

void AddVertices( unsigned int count ) const;

# Parameters

Type Name Min Max Description
unsigned int count The number of vertices to add.

# AppendGeometry

Appends the geometry data to this geometry. This geometry will contain all triangles and vertices of both geometries. The VertexIds that are copied from the source are remapped to point at the vertices, which are appended to the end of the current vertices. Any field in the appended geometry that does not exist in this geometry will be added, with the tuples that are added set to 0. The method will fail if the source geometry has identically named fields, but with different tuple sizes or base types.

# Syntax

void AppendGeometry( const spGeometryData & source ) const;

# Parameters

Type Name Min Max Description
GeometryData source The source geometry that will be appended to this geometry. the contents of source will not be modified.

# CalculateExtents

Calculate the extents by checking the coordinates of all vertices in the geometry. Set only_triangles to true to test only vertices that are indexed by a triangle. This is a slower test, and the bounding box may not encompass all vertices' positions. the new extents are found by calling GetInf() and GetSup() afterwards.

# Syntax

void CalculateExtents( bool only_triangles ) const;

# Parameters

Type Name Min Max Description
bool only_triangles True if only vertices indexed by triangles should be checked, defaults to false if not specified.

# ChangeWinding

Change winding.

# Syntax

void ChangeWinding() const;

# Parameters

ChangeWinding takes no parameters.

# CleanupInvalidTriangles

Finds triangles that contain the same vertex more than once, and invalidates them, ie. sets all the vertex id references to -1. These triangles can be culled using Compact().

# Syntax

void CleanupInvalidTriangles() const;

# Parameters

CleanupInvalidTriangles takes no parameters.

# CleanupNanValues

Finds all Nan (1.#IND, 1.#INF etc) values in the real/float/double arrays in the GeometryData, and sets them to 0.0 just to make sure all numbers in the GeometryData are legit. Should not be needed if all the data loaded into the GeometryData object is ok to begin with.

# Syntax

void CleanupNanValues() const;

# Parameters

CleanupNanValues takes no parameters.

# Compact

Removes invalid triangles and vertices not referenced by any triangle. If any vertices are removed, the triangles will be remapped to the new compacted vertex field.

# Syntax

void Compact( bool only_compact_triangles ) const;

# Parameters

Type Name Min Max Description
bool only_compact_triangles If true, no vertices will be removed.

# ConvertHandedness

Converts the handedness of the triangle winding, coords, normals and texture coordinates of the geometry from left-handed to right-handed coordinate systems and vice versa. Simplygon generally uses right-handed coordinates, so this conversion needs to be done before processing any left-handed geometry.

# Syntax

void ConvertHandedness() const;

# Parameters

ConvertHandedness takes no parameters.

# CopyCombine3Corners

Combines three corners via barycentric coordinates. alpha_3 = 1-(alpha_1 + alpha_2) dest = src_1*alpha_1 + src_2*alpha_2 + src_3*alpha_3.

# Syntax

void CopyCombine3Corners( const spGeometryData & source , rid dest_id , rid src_id_1 , rid src_id_2 , rid src_id_3 , real alpha_1 , real alpha_2 ) const;

# Parameters

Type Name Min Max Description
GeometryData source The GeometryData object to combine from.
rid dest_id The corner id to replace in this GeometryData object.
rid src_id_1 The first corner id to combine from.
rid src_id_2 The second corner id to combine from.
rid src_id_3 The third corner id to combine from.
real alpha_1 The first interpolation value.
real alpha_2 The second interpolation value.

# CopyCombine3Triangles

Combines the fields of three triangles via barycentric coordinates. alpha_3 = 1-(alpha_1 + alpha_2) dest = src_1*alpha_1 + src_2*alpha_2 + src_3*alpha_3.

# Syntax

void CopyCombine3Triangles( const spGeometryData & source , rid dest_id , rid src_id_1 , rid src_id_2 , rid src_id_3 , real alpha_1 , real alpha_2 ) const;

# Parameters

Type Name Min Max Description
GeometryData source The GeometryData object to combine from.
rid dest_id The triangle id to replace in this GeometryData object.
rid src_id_1 The first triangle id to combine from.
rid src_id_2 The second triangle id to combine from.
rid src_id_3 The third triangle id to combine from.
real alpha_1 The first interpolation value.
real alpha_2 The second interpolation value.

# CopyCombine3Vertices

Combines the fields of three vertices via barycentric coordinates. alpha_3 = 1-(alpha_1 + alpha_2) dest = src_1*alpha_1 + src_2*alpha_2 + src_3*alpha_3.

# Syntax

void CopyCombine3Vertices( const spGeometryData & source , rid dest_id , rid src_id_1 , rid src_id_2 , rid src_id_3 , real alpha_1 , real alpha_2 ) const;

# Parameters

Type Name Min Max Description
GeometryData source The GeometryData object to combine from.
rid dest_id The vertex id to replace in this GeometryData object.
rid src_id_1 The first vertex id to combine from.
rid src_id_2 The second vertex id to combine from.
rid src_id_3 The third vertex id to combine from.
real alpha_1 The first interpolation value.
real alpha_2 The first interpolation value.

# CopyCombineCorners

Combines the fields of two corners by linear interpolation into the destination corner.

# Syntax

void CopyCombineCorners( const spGeometryData & source , rid dest_id , rid src_id_1 , rid src_id_2 , real alpha ) const;

# Parameters

Type Name Min Max Description
GeometryData source The GeometryData object to combine from.
rid dest_id The corner id to replace in this GeometryData object.
rid src_id_1 The first corner id to combine from.
rid src_id_2 The second corner id to combine from.
real alpha The interpolation value between 0 and 1.

# CopyCombineTriangles

Combines the fields of two triangles by linear interpolation into the destination triangle.

# Syntax

void CopyCombineTriangles( const spGeometryData & source , rid dest_id , rid src_id_1 , rid src_id_2 , real alpha ) const;

# Parameters

Type Name Min Max Description
GeometryData source The GeometryData object to combine from.
rid dest_id The triangle id to replace in this GeometryData object.
rid src_id_1 The first triangle id to combine from.
rid src_id_2 The second triangle id to combine from.
real alpha The interpolation value between 0 and 1.

# CopyCombineVertices

Combines the fields of two vertices by linear interpolation into the destination vertex.

# Syntax

void CopyCombineVertices( const spGeometryData & source , rid dest_id , rid src_id_1 , rid src_id_2 , real alpha ) const;

# Parameters

Type Name Min Max Description
GeometryData source The GeometryData object to combine from.
rid dest_id The vertex id to replace in this GeometryData object.
rid src_id_1 The first vertex id to combine from.
rid src_id_2 The second vertex id to combine from.
real alpha The interpolation value between 0 and 1.

# CopyCorner

Copies all fields in the specified corner in the source geometry to the destination corner in this geometry .

# Syntax

void CopyCorner( const spGeometryData & source , rid dest_id , rid src_id ) const;

# Parameters

Type Name Min Max Description
GeometryData source The GeometryData object to copy from.
rid dest_id The vertex id to replace in this GeometryData object.
rid src_id The id of the vertex to copy.

# CopyTriangle

Copies all fields in the specified triangle in the source geometry to the destination triangle in this geometry.

# Syntax

void CopyTriangle( const spGeometryData & source , rid dest_id , rid src_id ) const;

# Parameters

Type Name Min Max Description
GeometryData source The GeometryData object to copy from.
rid dest_id The triangle id to replace in this GeometryData object.
rid src_id The id of the triangle to copy.

# CopyVertex

Copies all fields in the specified vertex in the source geometry to the destination vertex in this geometry.

# Syntax

void CopyVertex( const spGeometryData & source , rid dest_id , rid src_id ) const;

# Parameters

Type Name Min Max Description
GeometryData source The GeometryData object to copy from.
rid dest_id The vertex id to replace in this GeometryData object.
rid src_id The id of the vertex to copy.

# CreateAABB

Returns an axis aligned bounding box GeometryData of this geometry.

# Syntax

spGeometryData CreateAABB() const;

# Parameters

CreateAABB takes no parameters.

# Return value

Type: GeometryData

# DeepCopy

Copies the field setup and data from another object into this object. To only copy the setup, set copy_data to false.

# Syntax

void DeepCopy( const spGeometryData & source , bool copy_data ) const;

# Parameters

Type Name Min Max Description
GeometryData source The GeometryData object to copy from.
bool copy_data If true, copies the data along with the GeometryData properties.

# DetectEdgeNeighbours

Detect triangle edge neighbors. Neighbor ids are stored in the "SgEdgeNeighbours" Corner field.

# Syntax

void DetectEdgeNeighbours() const;

# Parameters

DetectEdgeNeighbours takes no parameters.

# ExpandVertices

Expands the Vertices field data so that there exists one vertex for each of the three corners of each triangle in the geometry. The vertices will be organized identical to the Corners field. The triangles will be remapped to use the new vertices correctly. Expanding the vertex field is required to be able to extract a range of the geometry, and to be able to stream it. Note! This will lead to increased memory requirement, as vertex data is not shared among neighboring triangles. It also removes the connectivity information of the triangles, and effectively detaches all triangles from one another. This call may replace fields in the Vertices field data. Re-query any previously cached field pointer after the call. All user fields are copied as well.

# Syntax

void ExpandVertices() const;

# Parameters

ExpandVertices takes no parameters.

# ExtentsContainCoords

Tests if the extents of the geometry fully contain all vertex coordinates. Note! ExtentsContainCoords() checks all vertices in the geometry, regardless to whether the vertex is referenced by any triangle. Use Compact() to remove any non-referenced vertex before calling ExtentsContainCoords.

# Syntax

bool ExtentsContainCoords() const;

# Parameters

ExtentsContainCoords takes no parameters.

# Return value

Type: bool

# ExtractRange

Extracts a range of triangles with their vertices from the geometry. ExpandVertices() must first be called for the extraction to succeed. ExtractGeometry() can be used to stream geometries in chunks. If writing to a stream, the extracted geometry is guaranteed to have the same setup as the original. Any previous data in the destination will be deleted.

# Syntax

void ExtractRange( const spGeometryData & dest , rid start_tri_id , unsigned int count ) const;

# Parameters

Type Name Min Max Description
GeometryData dest The GeometryData object that is written to.
rid start_tri_id The first triangle to be extracted.
unsigned int count The number of triangles to extract.

# ExtractTriangles

Extracts specified triangles from the geometry. The destination geometry will contain the triangles and vertices. The vertices in the destination will be expanded so that there exists one vertex for each of the three corners of each triangle in the geometry.

# Syntax

void ExtractTriangles( const spGeometryData & dest , const spRidArray & triangle_ids ) const;

# Parameters

Type Name Min Max Description
GeometryData dest The GeometryData object that is written to.
RidArray triangle_ids The list of triangles indices to extract.

# FindEdgeIdsFromVertexPairs

Each tuple in the "vertex_pairs" array contains the start-vertex and end-vertex of a half-edge in the geometry. If a half-edge is found from a tuple in the "vertex_pairs" array, the edge-id of that half-edge will be stored in the edge_ids array. Do note: the half-edges are directed, so if you want all half-edges that contains 2 vertices, you need to add the tuple twice.

# Syntax

void FindEdgeIdsFromVertexPairs( const spRidArray & vertex_pairs , const spRidArray & edge_ids ) const;

# Parameters

Type Name Min Max Description
RidArray vertex_pairs An array with tuplesize 2, which contains start and end-vertex of the edges you want to find.
RidArray edge_ids Will contain all edge-ids that were found from the vertex-pairs. The function will replace all previous data in this array.

# FindNamedColorsIndex

Returns the level index of the colors field with the name returns -1 if not found.

# Syntax

rid FindNamedColorsIndex( const char * field_name ) const;

# Parameters

Type Name Min Max Description
const char * field_name The named Colors field to be fetched.

# Return value

Type: rid

# FindNamedTexCoordsIndex

Returns the level index of the texcoord field with the name returns -1 if not found.

# Syntax

rid FindNamedTexCoordsIndex( const char * field_name ) const;

# Parameters

Type Name Min Max Description
const char * field_name The named TexCoord field to be fetched.

# Return value

Type: rid

# GetBitangents

Gets a Bitangents field in the corners. The valid id range of the level parameter is 0-255. (Field name: "Bitangents0" - "Bitangents255", Tuple size: 3 , Stored as: Corner attribute)

# Syntax

spRealArray GetBitangents( rid level ) const;

# Parameters

Type Name Min Max Description
rid level The texture channel.

# Return value

Type: RealArray

# GetBoneIds

The BoneIds fields in the vertices. (Field name: "BoneIds", Tuple size: varying , Stored as: Vertex attribute)

# Syntax

spRidArray GetBoneIds() const;

# Parameters

GetBoneIds takes no parameters.

# Return value

Type: RidArray

# GetBoneWeights

The BoneWeights field in the vertices. (Field name: "BoneWeights", Tuple size: varying , Stored as: Vertex attribute)

# Syntax

spRealArray GetBoneWeights() const;

# Parameters

GetBoneWeights takes no parameters.

# Return value

Type: RealArray

# GetClass

Get the name of the GeometryData class. (Inherited from Object)

# Syntax

spString GetClass() const;

# Parameters

GetClass takes no parameters.

# Return value

Type: spString

# GetColors

Gets a Color field in the corners. The valid id range of the level parameter is 0-255, which equals fields 'Colors0' - 'Colors255' (Field name: "Colors0" - "Colors255", Tuple size: 4 , Stored as: Corner attribute)

# Syntax

spRealArray GetColors( rid level ) const;

# Parameters

Type Name Min Max Description
rid level The color level (0-255)

# Return value

Type: RealArray

# GetCoords

The Coords field in the vertices. (Field name: "Coords", Tuple size: 3 , Stored as: Vertex attribute)

# Syntax

spRealArray GetCoords() const;

# Parameters

GetCoords takes no parameters.

# Return value

Type: RealArray

# GetCorners

Retrieves the IFieldData object that contains the corner fields.

# Syntax

spFieldData GetCorners() const;

# Parameters

GetCorners takes no parameters.

# Return value

Type: FieldData

# GetCustomField

Gets a custom field.

# Syntax

spValueArray GetCustomField( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name The name of the custom field to get from the GeometryData object.

# Return value

Type: ValueArray

# GetGroupIds

The GroupIds field in the triangles. (Field name: "GroupIds", Tuple size: 1 , Stored as: triangle attribute)

# Syntax

spRidArray GetGroupIds() const;

# Parameters

GetGroupIds takes no parameters.

# Return value

Type: RidArray

# GetInf

The inferior (minimum) extent of the geometry.

# Syntax

spRealData GetInf() const;

# Parameters

GetInf takes no parameters.

# Return value

Type: spRealData

# GetMaterialIds

The MaterialIds field in the triangles. (Field name: "MaterialIds", Tuple size: 1 , Stored as: triangle attribute)

# Syntax

spRidArray GetMaterialIds() const;

# Parameters

GetMaterialIds takes no parameters.

# Return value

Type: RidArray

# GetNamedColors

Gets a Color field, using the alternative name instead of the index.

# Syntax

spRealArray GetNamedColors( const char * alternative_name ) const;

# Parameters

Type Name Min Max Description
const char * alternative_name The alternative name of the field.

# Return value

Type: RealArray

# GetNamedTexCoords

Gets a TexCoords field, using the alternative name instead of the index.

# Syntax

spRealArray GetNamedTexCoords( const char * alternative_name ) const;

# Parameters

Type Name Min Max Description
const char * alternative_name The alternative name of the field.

# Return value

Type: RealArray

# GetNormals

The Normals field in the corners. (Field name: "Normals" , Tuple size: 3 , Stored as: Corner attribute)

# Syntax

spRealArray GetNormals() const;

# Parameters

GetNormals takes no parameters.

# Return value

Type: RealArray

# GetSup

The superior (maximum) extent of the geometry.

# Syntax

spRealData GetSup() const;

# Parameters

GetSup takes no parameters.

# Return value

Type: spRealData

# GetTangents

Gets a Tangents field in the corners. The valid id range of the level parameter is 0-255. (Field name: "Tangents0" - "Tangents255", Tuple size: 3 , Stored as: Corner attribute)

# Syntax

spRealArray GetTangents( rid level ) const;

# Parameters

Type Name Min Max Description
rid level The texture channel.

# Return value

Type: RealArray

# GetTexCoords

Gets a TexCoords field in the corners. The valid id range of the level parameter is 0-255, which equals fields 'TexCoords0' - 'TexCoords255' (Field name: "TexCoords0" - "TexCoords255", Tuple size: 2 , Stored as: Corner attribute).

# Syntax

spRealArray GetTexCoords( rid level ) const;

# Parameters

Type Name Min Max Description
rid level The id of the texture field to get.

# Return value

Type: RealArray

# GetTriangles

Retrieves the IFieldData object that contains the triangle fields.

# Syntax

spFieldData GetTriangles() const;

# Parameters

GetTriangles takes no parameters.

# Return value

Type: FieldData

# GetUserCornerField

Gets a user-specified corner field.

# Syntax

spValueArray GetUserCornerField( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name The name of the field to get.

# Return value

Type: ValueArray

# GetUserTriangleField

Gets a user-specified triangle field.

# Syntax

spValueArray GetUserTriangleField( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name The name of the triangle field to get from the GeometryData object.

# Return value

Type: ValueArray

# GetUserVertexField

Gets a user-specified vertex field.

# Syntax

spValueArray GetUserVertexField( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name The name of the user vertex field to be fetched from the GeometryData object.

# Return value

Type: ValueArray

# GetVertexIds

The VertexIds field in the corners.

# Syntax

spRidArray GetVertexIds() const;

# Parameters

GetVertexIds takes no parameters.

# Return value

Type: RidArray

# GetVertexLocks

The VertexLocks field for the vertices. If the value for a vertex is true, then the vertex should be locked, and not be removed in the collapse-process. (Field name: "VertexLocks", Tuple size: 1 , Stored as: Vertex attribute)

# Syntax

spBoolArray GetVertexLocks() const;

# Parameters

GetVertexLocks takes no parameters.

# Return value

Type: BoolArray

# GetVertexWeights

The VertexWeights field for the vertices. The weights are used to determine how important it is to keep the vertices when the geometry is reduced. 1 means the weight won't change the importance, values closer to 0 means it will be less important, values > 1 means the vertex is more important and less probable to be removed. (Field name: "VertexWeights", Tuple size: 1 , Stored as: Vertex attribute)

# Syntax

spRealArray GetVertexWeights() const;

# Parameters

GetVertexWeights takes no parameters.

# Return value

Type: RealArray

# GetVertices

Retrieves the IFieldData object that contains the vertex fields.

# Syntax

spFieldData GetVertices() const;

# Parameters

GetVertices takes no parameters.

# Return value

Type: FieldData

# IsA

Returns true if GeometryData is a or is a descendant of the class named as the type parameter. (Inherited from Object)

# Syntax

bool IsA( const char * type ) const;

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if GeometryData is, or is a descendant of.

# Return value

Type: bool

# IsNull

Returns true if the GeometryData object is invalid. (Inherited from Object)

# Syntax

bool IsNull() const;

# Parameters

IsNull takes no parameters.

# Return value

Type: bool

# IsSameObjectAs

Returns true if the GeometryData object is valid. (Inherited from Object)

# Syntax

bool IsSameObjectAs( const spObject & object ) const;

# Parameters

Type Name Min Max Description
Object object Object to compare with.

# Return value

Type: bool

# NewCopy

Creates another geometry data object with the same field setup. To also copy the data to the new object, set copy_data to true.

# Syntax

spGeometryData NewCopy( bool copy_data ) const;

# Parameters

Type Name Min Max Description
bool copy_data If true, copies the data along with the GeometryData properties.

# Return value

Type: GeometryData

# NewPackedCopy

Creates a "packed" PackedGeometryData object, where all fields in the Corner field data object is moved to the vertex field data object. Please note that the vertex field data object will be enlarged to accommodate for data in a vertex shared by multiple triangles, where the corner data differs between the triangles. The method will fail if a Corner field is named the same as an existing Vertices field, please make sure to remove any such field before calling the method.

# Syntax

spPackedGeometryData NewPackedCopy() const;

# Parameters

NewPackedCopy takes no parameters.

# Return value

Type: PackedGeometryData

# NonNull

Returns true if the GeometryData object is valid. (Inherited from Object)

# Syntax

bool NonNull() const;

# Parameters

NonNull takes no parameters.

# Return value

Type: bool

# PrintInfo

Prints the content/info of the GeometryData object to the log. (Inherited from Object)

# Syntax

void PrintInfo() const;

# Parameters

PrintInfo takes no parameters.

# RemoveBoneWeights

Removes the BoneWeights and BoneIds fields in the vertices. The BoneWeights and BoneIds fields are added and removed in unison, and should always be the same tuple size. (Field names: "BoneWeights" & "BoneIds", Tuple size: varying , Stored as: Vertex attribute)

# Syntax

void RemoveBoneWeights() const;

# Parameters

RemoveBoneWeights takes no parameters.

# RemoveColors

Removes a Color field in the corners. The valid id range of the level parameter is 0-255, which equals fields 'Colors0' - 'Colors255' (Field name: "Colors0" - "Colors255", Tuple size: 4 , Stored as: Corner attribute)

# Syntax

void RemoveColors( rid level ) const;

# Parameters

Type Name Min Max Description
rid level The color level (0-255)

# RemoveCustomField

Removes a custom field.

# Syntax

void RemoveCustomField( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name The name of the custom field to remove from the GeometryData object.

# RemoveGroupIds

Removes the GroupIds field in the triangles. (Field name: "GroupIds", Tuple size: 1 , Stored as: triangle attribute)

# Syntax

void RemoveGroupIds() const;

# Parameters

RemoveGroupIds takes no parameters.

# RemoveMaterialIds

Removes the MaterialIds field in the triangles. (Field name: "MaterialIds", Tuple size: 1 , Stored as: triangle attribute)

# Syntax

void RemoveMaterialIds() const;

# Parameters

RemoveMaterialIds takes no parameters.

# RemoveNamedColors

Removes a named Color field in the corners. (Field name: "Colors0" - "Colors255", Tuple size: 4 , Stored as: Corner attribute)

# Syntax

bool RemoveNamedColors( const char * alternative_name ) const;

# Parameters

Type Name Min Max Description
const char * alternative_name The named color channel "Colors0" - "Colors255".

# Return value

Type: bool

# RemoveNamedTexCoords

Removes a named TexCoords field in the corners. 'TexCoords0' - 'TexCoords255' (Field name: "TexCoords0" - "TexCoords255", Tuple size: 2 , Stored as: Corner attribute)

# Syntax

bool RemoveNamedTexCoords( const char * alternative_name ) const;

# Parameters

Type Name Min Max Description
const char * alternative_name The name of the texcoord level i.e. 'TexCoord0'.

# Return value

Type: bool

# RemoveNormals

Removes the Normals field in the corners. (Field name: "Normals" , Tuple size: 3 , Stored as: Corner attribute)

# Syntax

void RemoveNormals() const;

# Parameters

RemoveNormals takes no parameters.

# RemoveObserver

Removes a previously added observer object. (Inherited from Object)

# Syntax

void RemoveObserver( rid observerId ) const;

# Parameters

Type Name Min Max Description
rid observerId ObserverId is the id returned by AddObserver when the observer was added.

# RemoveTangents

Removes Tangents and Bitangents fields in the corners. The valid id range of the level parameter is 0-255. (Field names: "Tangents0" - "Tangents255" & "Bitangents0" - "Bitangents255", Tuple size: 3 , Stored as: Corner attribute)

# Syntax

void RemoveTangents( rid level ) const;

# Parameters

Type Name Min Max Description
rid level The texture channel.

# RemoveTexCoords

Removes a TexCoords field in the corners. The valid id range of the level parameter is 0-255, which equals fields 'TexCoords0' - 'TexCoords255' (Field name: "TexCoords0" - "TexCoords255", Tuple size: 2 , Stored as: Corner attribute)

# Syntax

void RemoveTexCoords( rid level ) const;

# Parameters

Type Name Min Max Description
rid level The id of the texture field to remove.

# RemoveUserCornerField

Removes a user-specified corner field.

# Syntax

void RemoveUserCornerField( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name The name of the field to remove from the GeometryData object.

# RemoveUserTriangleField

Removes a user-specified triangle field.

# Syntax

void RemoveUserTriangleField( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name The name of the triangle field to remove from the GeometryData object.

# RemoveUserVertexField

Removes a user-specified vertex field.

# Syntax

void RemoveUserVertexField( const char * name ) const;

# Parameters

Type Name Min Max Description
const char * name The name of the user vertex field to be removed from the GeometryData object.

# RemoveVertexLocks

Removes the VertexLocks field for the vertices. If the value for a vertex is true, then the vertex should be locked, and not be removed in the collapse-process. (Field name: "VertexLocks", Tuple size: 1 , Stored as: Vertex attribute)

# Syntax

void RemoveVertexLocks() const;

# Parameters

RemoveVertexLocks takes no parameters.

# RemoveVertexWeights

Removes the VertexWeights field for the vertices. The weights are used to determine how important it is to keep the vertices when the geometry is reduced. 1 means the weight won't change the importance, values closer to 0 means it will be less important, values > 1 means the vertex is more important and less probable to be removed. (Field name: "VertexWeights", Tuple size: 1 , Stored as: Vertex attribute)

# Syntax

void RemoveVertexWeights() const;

# Parameters

RemoveVertexWeights takes no parameters.

# SetInf

The inferior (minimum) extent of the geometry.

# Syntax

void SetInf( const real *vec_realInputDataPtr ) const;

# Parameters

Type Name Min Max Description
RealData vec The new inferior.

# SetSup

The superior (maximum) extent of the geometry.

# Syntax

void SetSup( const real *vec_realInputDataPtr ) const;

# Parameters

Type Name Min Max Description
RealData vec The new superior.

# Transform

Transforms the geometry using the supplied matrix transformation. The fields that are modified are the Coords field of Vertices, as well as the Normals and all Tangent and Bi-tangent fields of the Corners.

# Syntax

void Transform( const spMatrix4x4 & transformation ) const;

# Parameters

Type Name Min Max Description
Matrix4x4 transformation The 4x4 transformation as a IMatrix4x4.

# Weld

Welds all vertices in the geometry that are closer than the welding threshold. Non-referenced vertices will not be removed, only the vertex indices will be remapped. Call Compact() to clean up the geometry and free up memory.

# Syntax

void Weld( real threshold ) const;

# Parameters

Type Name Min Max Description
real threshold The welding threshold distance.

# Static methods details

# IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)

# Syntax

static bool IsClassA( const char * type ) const;

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if the class is, or is a descendant of.

# Return value

Type: bool

# SafeCast

SafeCast makes sure the input object is of a class that can be cast into spGeometryData, and if this is the case, returns the object cast into spGeometryData. (Inherited from Object)

# Syntax

static spGeometryData SafeCast( const spObject & object ) const;

# Parameters

Type Name Min Max Description
Object object Object to cast.

# Return value

Type: GeometryData