diff options
author | Ben Batt <benbatt@gmail.com> | 2006-08-28 05:12:36 +0400 |
---|---|---|
committer | Ben Batt <benbatt@gmail.com> | 2006-08-28 05:12:36 +0400 |
commit | 433f6c7043c06d8d0330fa69f63d475549b48e91 (patch) | |
tree | d147f943e4cfcc2f0df50818e18f983772a52c22 /source/blender/blenkernel/BKE_cdderivedmesh.h | |
parent | 5dbc4c5f8fda61da055a2186a5080feec96828c0 (diff) |
Integration of the Google Summer of Code Modifier Stack Upgrade project. The
main features are:
* Modifiers can now be in any order in the modifier stack
* DerivedMesh now has a standard framework for custom element data to be passed
through the stack with mesh data (being copied and interpolated as
appropriate), so modifiers can access whatever data they need
* The modifier stack code has been refactored and a number of bugs have been
removed
* The EdgeSplit modifier has been added:
http://mediawiki.blender.org/index.php/BlenderDev/EdgeSplitModifier
* The DerivedMesh modifier has been added:
http://mediawiki.blender.org/index.php/BlenderDev/DisplaceModifier
* The UVProject modifier has been added:
http://mediawiki.blender.org/index.php/BlenderDev/UVProjectModifier
For more info, see:
http://mediawiki.blender.org/index.php/User:Artificer/ModifierStackUpgrade
(currently undergoing reorganisation)
Diffstat (limited to 'source/blender/blenkernel/BKE_cdderivedmesh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_cdderivedmesh.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_cdderivedmesh.h b/source/blender/blenkernel/BKE_cdderivedmesh.h new file mode 100644 index 00000000000..b8313440551 --- /dev/null +++ b/source/blender/blenkernel/BKE_cdderivedmesh.h @@ -0,0 +1,102 @@ +/* +* $Id$ +* +* ***** BEGIN GPL LICENSE BLOCK ***** +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* +* The Original Code is Copyright (C) 2006 Blender Foundation. +* All rights reserved. +* +* The Original Code is: all of this file. +* +* Contributor(s): Ben Batt <benbatt@gmail.com> +* +* ***** END GPL LICENSE BLOCK ***** +*/ + +/* CDDerivedMesh interface. + * CDDerivedMesh (CD = Custom Data) is a DerivedMesh backend which stores + * mesh elements (vertices, edges and faces) as layers of custom element data. + */ + +#ifndef BKE_CDDERIVEDMESH_H +#define BKE_CDDERIVEDMESH_H + +#include "BKE_DerivedMesh.h" + +struct DerivedMesh; +struct EditMesh; +struct Mesh; + +/* creates a new CDDerivedMesh */ +struct DerivedMesh *CDDM_new(int numVerts, int numEdges, int numFaces); + +/* creates a CDDerivedMesh from the given Mesh */ +struct DerivedMesh *CDDM_from_mesh(struct Mesh *mesh); + +/* creates a CDDerivedMesh from the given EditMesh */ +struct DerivedMesh *CDDM_from_editmesh(struct EditMesh *em, struct Mesh *me); + +/* Copies the given DerivedMesh with verts, faces & edges stored as + * custom element data. + */ +struct DerivedMesh *CDDM_copy(struct DerivedMesh *dm); + +/* creates a CDDerivedMesh with the same layer stack configuration as the + * given DerivedMesh and containing the requested numbers of elements. + * elements are initialised to all zeros + */ +struct DerivedMesh *CDDM_from_template(struct DerivedMesh *source, + int numVerts, int numEdges, int numFaces); + +/* applies vertex coordinates to a CDDerivedMesh + */ +void CDDM_apply_vert_coords(struct DerivedMesh *cddm, float (*vertCoords)[3]); + +/* recalculates normals for a CDDerivedMesh + */ +void CDDM_calc_normals(struct DerivedMesh *dm); + +/* calculates edges for a CDDerivedMesh (from face data) + * this completely replaces the current edge data in the DerivedMesh + */ +void CDDM_calc_edges(struct DerivedMesh *dm); + +/* sets the number of vertices/edges/faces in a CDDerivedMesh + * if the value given is more than the maximum, the maximum is used + */ +void CDDM_set_num_verts(struct DerivedMesh *dm, int numVerts); +void CDDM_set_num_edges(struct DerivedMesh *dm, int numEdges); +void CDDM_set_num_faces(struct DerivedMesh *dm, int numFaces); + +/* vertex/edge/face access functions + * should always succeed if index is within bounds + * note these return pointers - any change modifies the internals of the mesh + */ +struct MVert *CDDM_get_vert(struct DerivedMesh *dm, int index); +struct MEdge *CDDM_get_edge(struct DerivedMesh *dm, int index); +struct MFace *CDDM_get_face(struct DerivedMesh *dm, int index); + +/* vertex/edge/face array access functions - return the array holding the + * desired data + * should always succeed + * note these return pointers - any change modifies the internals of the mesh + */ +struct MVert *CDDM_get_verts(struct DerivedMesh *dm); +struct MEdge *CDDM_get_edges(struct DerivedMesh *dm); +struct MFace *CDDM_get_faces(struct DerivedMesh *dm); +#endif + |