Index

 E3d_VerticesAllocate
 E3d_VerticesAdd
 E3d_MeshAddTriangleStrip
 E3d_MeshAddTriangleStrips
 E3d_MeshRemovePolyGroup
 E3d_MeshRemoveAndFreePolyGroup
 E3d_MeshDefault
 E3d_MeshAllocate
 E3d_MeshClone
 E3d_MeshFilterVertices
 E3d_MeshGetBoundingBox
 E3d_MeshGetTransformedBoundingBox
 E3d_MeshVertexGetConnectedVertices
 E3d_MeshVertexGetEdges
 E3d_MeshEdgeGetPolygons
 E3d_MeshUpdateForDisplay


E3d_VerticesAllocate

Allocate memory for an array of Vertices

Syntax
 E3dVertex* E3d_VerticesAllocate(unsigned int LNumOfVertices, EBool LInitialize)
Arguments
 unsigned int LNumOfVertices   Number of Vertices to allocate
 EBool        LInitialize      Initialize the Vertex array
Description
Allocates memory for the specified number of Vertices.

Return value
A pointer to the allocated array, or NULL in case of an error.

See also
E3d_MeshFreeVertices

E3d_VerticesAdd

Add new Vertices to an array

Syntax
 E3dVertex* E3d_VerticesAdd(E3dVertex* LOldVertices, unsigned int LNumOfOldVertices, unsigned int LNumOfNewVertices, EBool LInitialize)
Arguments
 unsigned int LNumOfOldVertices   Number of Vertices already in the array
 unsigned int LNumOfNewVertices   Number of Vertices to add
 EBool        LInitialize         Initialize the Vertex array
Description
Allocates memory for the specified number of Vertices.

Return value
A pointer to the allocated array, or NULL in case of an error.

See also
E3d_MeshFreeVertices

E3d_MeshAddTriangleStrip

Add a TriangleStrip to a Mesh

Syntax
 E3dTriangleStrip* E3d_MeshAddTriangleStrip(E3dMesh* LMesh, E3dPolyGroup* LPolyGroup)
Arguments
 E3dMesh*      LMesh        Pointer to the E3dMesh
 E3dPolyGroup* LPolyGroup   The PolyGroup to which the strip will be added
Description
Allocates space for and initializes a new TriangleStrip in the given Mesh and PolyGroup.

Return value
A pointer to the new strip or NULL if unsuccessful

See also
E3d_TriangleStripsAllocate, E3d_MeshAddTriangleStrips

E3d_MeshAddTriangleStrips

Add TriangleStrips to a Mesh

Syntax
 E3dTriangleStrip* E3d_MeshAddTriangleStrips(E3dMesh* LMesh, E3dPolyGroup* LPolyGroup,
                                             unsigned int LNumOfStrips)
Arguments
 E3dMesh*      LMesh          Pointer to the Mesh
 E3dPolyGroup* LPolyGroup     The PolyGroup to which the strip will be added
 unsigned int  LNumOfStrips   Number of triangle strips to add
Description
Allocates space for and initializes the specified number of TriangleStrips in the given Mesh and PolyGroup.

Return value
A pointer to the new strips or NULL if unsuccessful

See also
E3d_TriangleStripsAllocate, E3d_MeshAddTriangleStrip

E3d_MeshRemovePolyGroup

Remove a PolyGroup from a Mesh

Syntax
 void E3d_MeshRemovePolyGroup(E3dMesh* LMesh, E3dPolyGroup* LPolyGroup)
Arguments
 E3dMesh*      LMesh          Pointer to the Mesh
 E3dPolyGroup* LPolyGroup     Pointer to the PolyGroup
Description
Removes the given PolyGroup from the given Mesh's dynamically allocated PolyGroups array.

Return value
None.

E3d_MeshRemoveAndFreePolyGroup

Remove a PolyGroup from a Mesh and free it

Syntax
 void E3d_MeshRemoveAndFreePolyGroup(E3dMesh* LMesh, E3dPolyGroup* LPolyGroup)
Arguments
 E3dMesh*      LMesh          Pointer to the Mesh
 E3dPolyGroup* LPolyGroup     Pointer to the PolyGroup
Description
Removes the given PolyGroup from the given Mesh's dynamically allocated PolyGroups array and frees all memory assiciated with the PolyGroup.

Return value
None.

E3d_MeshDefault

Initialize a Mesh

Syntax
 void E3d_MeshDefault(E3dMesh* LMesh)
Argument
 E3dMesh* LMesh    Pointer to the Mesh
Description
Initializes a Mesh structure.

Return value
None.

See also
E3d_MeshAllocate, E3d_MeshFree

E3d_MeshAllocate

Allocate memory for and initialize a Mesh

Syntax
 E3dMesh* E3d_MeshAllocate(void)
Arguments
None.

Description
Allocates memory for a new Mesh structure and initializes it.

Return value
A pointer to the new Mesh or NULL if unsuccessful.

See also
E3d_GeometryFree

E3d_MeshClone

Clone a Mesh

Syntax
 E3dMesh* E3d_MeshClone(E3dMesh* LMesh, int LFlags)
Argument
 E3dMesh* LMesh        Pointer to the Mesh structure to be cloned
 int      LFlags       Flags determining what to clone / share
Description
This function creates and exact copy of the given Mesh. If LFlags has the flag E3dCLONE_MATERIALS set, all the Materials of the PolyGroups will be cloned as well, otherwise the Materials will be shared between the original Mesh and the clone.

Return value
Pointer to the new Mesh structure, or NULL in case of an error

See also
E3d_MeshAllocate, E3d_MeshFree

E3d_MeshFilterVertices

Mark Vertices of a Mesh that pass the given filter criteria

Syntax
 unsigned int E3d_MeshFilterVertices(E3dMesh* LMesh, unsigned int LWhatToInclude)
Argument
 E3dMesh*     LMesh            Pointer to the Mesh structure
 unsigned int LWhatToInclude   The filter criteria (OR-ed together bits)
Description
This function examines the given Mesh and marks the Vertices that pass the given filter criteria by setting their E3dVTX_PASSED flag.

Example
E3d_MeshFilterVertices(LMesh, E3dBB_SELECTED_POLYGROUPS); < BR> This will mark the Vertices PASSED, that are referenced from the selected PolyGroups of the Mesh. For improved efficiency, if all the Vertices pass, no Vertex flags are set, but the returned value will be equal to LMesh->NumOfVertices.

Return value
The number of Vertices that passed the test.

See also
E3d_MeshGetBoundingBox

E3d_MeshGetBoundingBox

Get the local bounding box of a Mesh

Syntax
 EBool E3d_MeshGetBoundingBox(E3dMesh* LMesh,
                              E3d3DPosition* LBBMin, E3d3DPosition* LBBMax,
                              unsigned int LWhatToInclude)
Argument
 E3dMesh*       LMesh      Pointer to the Mesh structure
 E3d3DPosition* LBBMin     Returned bounding box point 0
 E3d3DPosition* LBBMax     Returned bounding box point 1
Description
This function returns the minimum and maximum XYZ values of the bounding box of the given Mesh.

Return value
TRUE if successful, FALSE in case of an error.

See also
E3d_MeshGetTransformedBoundingBox

E3d_MeshGetTransformedBoundingBox

Get the bounding box of a Mesh aligned to an arbitrary coordinate system

Syntax
 EBool E3d_MeshGetTransformedBoundingBox(E3dMesh* LMesh,
                                         E3dMatrix LMatrix,
                                         E3d3DPosition* LBBMin, E3d3DPosition* LBBMax,
                                         unsigned int LWhatToInclude)
Argument
 E3dMesh*       LMesh        Pointer to the Mesh structure
 E3dMatrix      LMatrix      The Matrix that defines the coordinate system
 E3d3DPosition* LBBMin       Returned bounding box point 0
 E3d3DPosition* LBBMax       Returned bounding box point 1
Description
This function transforms each Vertex of the given Mesh with the given Matrix and returns the minimum and maximum XYZ values of the resulting bounding box.

Example
E3d_MeshGetTransformedBoundingBox(LMesh, LModel->LocalToWorldMatrix, LBBMin, LBBMax); This will return the "world-aligned" bounding box of the LMesh (assuming that LMesh is a Geometry of LModel).

Return value
TRUE if successful, FALSE in case of an error.

See also
E3d_MeshGetBoundingBox

E3d_MeshVertexGetConnectedVertices

Collect Vertices that a Vertex is connected to via Edges

Syntax
 int E3d_MeshVertexGetConnectedVertices(E3dMesh* LMesh, int LVertexIndex, int** LVertexIndicesPtr)
Arguments
 E3dMesh* LMesh            Pointer to the Mesh
 int      LVertexIndex     Index of the Vertex in question
 LEdgesPtr        The list of Edges will be returned here
Description
Collects a list of Edges in a Mesh that share a given Vertex.

Return value
The number of Edges that share the given Vertex

E3d_MeshVertexGetEdges

Collect Edges that share a Vertex

Syntax
 int E3d_MeshVertexGetEdges(E3dMesh* LMesh, int LVertexIndex, E3dEdge*** LEdgesPtr)
Arguments
 E3dMesh*   LMesh            Pointer to the Mesh
 int        LVertexIndex     Index of the Vertex in question
 E3dEdge*** LEdgesPtr        The list of Edges will be returned here
Description
Collects a list of Edges in a Mesh that share a given Vertex.

Return value
The number of Edges that share the given Vertex

E3d_MeshEdgeGetPolygons

Collect Polygons that share an Edge

Syntax
 int E3d_MeshEdgeGetPolygons(E3dMesh* LMesh, E3dEdge* LEdge, E3dPolygon*** LPolygonsPtr, E3dPolyGroup*** LPolyGroupsPtr)
Arguments
 E3dMesh*        LMesh              Pointer to the Mesh
 E3dEdge*        LEdge              The Edge to be tested
 E3dPolygon***   LPolygonsPtr       Return pointer for the Polygons
 E3dPolyGroup*** LPolyGroupsPtr     Return pointer for the PolyGroups
Description
Collects the Polygons that share an Edge within a Mesh. If successful, it will return the Polygons in LPolygonsPtr and the associated PolyGroups in LPolyGroupsPtr.

Return value
The number of Polygons that share LEdge

E3d_MeshUpdateForDisplay

Update a Geometry for drawing

Syntax
 void E3d_MeshUpdateForDisplay(E3dMesh* LMesh, unsigned int LFlags)
Arguments
 E3dMesh*     LMesh      The Mesh to update
 unsigned int LFlags     OR-ed together flags, telling what to update
Description
This function updates the given Mesh for rendering (drawing). This is a platform-independent procedure that ensures that the given Mesh will be drawn correctly after changes to its components. Calling this function for a Mesh after change, with only the necessary flags set, helps EQUINOX-3D greatly improve performance by only updating things that really changed. For example, if the position of a few Vertices changed in a Mesh, use the E3dGF_SHAPE flag bit.

Return value
None.