2011-02-18 13:05:18 +00:00
|
|
|
/*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* 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
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BKE_CURVE_H__
|
|
|
|
#define __BKE_CURVE_H__
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2011-02-18 13:05:18 +00:00
|
|
|
/** \file BKE_curve.h
|
|
|
|
* \ingroup bke
|
|
|
|
* \since March 2001
|
|
|
|
* \author nzc
|
|
|
|
*/
|
2011-09-14 00:37:27 +00:00
|
|
|
|
|
|
|
struct BevList;
|
|
|
|
struct BezTriple;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct Curve;
|
2011-09-14 00:37:27 +00:00
|
|
|
struct EditNurb;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct ListBase;
|
2013-02-05 12:46:15 +00:00
|
|
|
struct Main;
|
2011-09-14 00:37:27 +00:00
|
|
|
struct Nurb;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct Object;
|
2009-01-04 14:14:06 +00:00
|
|
|
struct Scene;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2012-05-12 20:39:39 +00:00
|
|
|
#define KNOTSU(nu) ( (nu)->orderu + (nu)->pntsu + (((nu)->flagu & CU_NURB_CYCLIC) ? ((nu)->orderu - 1) : 0) )
|
|
|
|
#define KNOTSV(nu) ( (nu)->orderv + (nu)->pntsv + (((nu)->flagv & CU_NURB_CYCLIC) ? ((nu)->orderv - 1) : 0) )
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
|
2008-09-23 06:26:48 +00:00
|
|
|
/* Non cyclic nurbs have 1 less segment */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define SEGMENTSU(nu) ( ((nu)->flagu & CU_NURB_CYCLIC) ? (nu)->pntsu : (nu)->pntsu - 1)
|
|
|
|
#define SEGMENTSV(nu) ( ((nu)->flagv & CU_NURB_CYCLIC) ? (nu)->pntsv : (nu)->pntsv - 1)
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2012-05-12 20:39:39 +00:00
|
|
|
#define CU_DO_TILT(cu, nu) (((nu->flag & CU_2D) && (cu->flag & CU_3D) == 0) ? 0 : 1)
|
|
|
|
#define CU_DO_RADIUS(cu, nu) ((CU_DO_TILT(cu, nu) || ((cu)->flag & CU_PATH_RADIUS) || (cu)->bevobj || (cu)->ext1 != 0.0f || (cu)->ext2 != 0.0f) ? 1 : 0)
|
2009-04-20 15:06:46 +00:00
|
|
|
|
2012-04-28 16:49:00 +00:00
|
|
|
/* ** Curve ** */
|
|
|
|
void BKE_curve_unlink(struct Curve *cu);
|
|
|
|
void BKE_curve_free(struct Curve *cu);
|
|
|
|
void BKE_curve_editfont_free(struct Curve *cu);
|
2013-02-05 12:46:15 +00:00
|
|
|
struct Curve *BKE_curve_add(struct Main *bmain, const char *name, int type);
|
2012-04-28 16:49:00 +00:00
|
|
|
struct Curve *BKE_curve_copy(struct Curve *cu);
|
|
|
|
void BKE_curve_make_local(struct Curve *cu);
|
|
|
|
short BKE_curve_type_get(struct Curve *cu);
|
|
|
|
void BKE_curve_type_test(struct Object *ob);
|
|
|
|
void BKE_curve_curve_dimension_update(struct Curve *cu);
|
2012-05-05 21:28:12 +00:00
|
|
|
void BKE_curve_texspace_calc(struct Curve *cu);
|
2009-04-20 15:06:46 +00:00
|
|
|
|
2013-03-09 05:35:49 +00:00
|
|
|
bool BKE_curve_minmax(struct Curve *cu, float min[3], float max[3]);
|
|
|
|
bool BKE_curve_center_median(struct Curve *cu, float cent[3]);
|
|
|
|
bool BKE_curve_center_bounds(struct Curve *cu, float cent[3]);
|
2012-04-28 16:49:00 +00:00
|
|
|
void BKE_curve_translate(struct Curve *cu, float offset[3], int do_keys);
|
|
|
|
void BKE_curve_delete_material_index(struct Curve *cu, int index);
|
|
|
|
|
|
|
|
ListBase *BKE_curve_nurbs_get(struct Curve *cu);
|
|
|
|
|
|
|
|
float (*BKE_curve_vertexCos_get(struct Curve *cu, struct ListBase *lb, int *numVerts_r))[3];
|
|
|
|
void BK_curve_vertexCos_apply(struct Curve *cu, struct ListBase *lb, float (*vertexCos)[3]);
|
|
|
|
|
|
|
|
float (*BKE_curve_keyVertexCos_get(struct Curve *cu, struct ListBase *lb, float *key))[3];
|
|
|
|
void BKE_curve_keyVertexTilts_apply(struct Curve *cu, struct ListBase *lb, float *key);
|
|
|
|
|
|
|
|
void BKE_curve_editNurb_keyIndex_free(struct EditNurb *editnurb);
|
|
|
|
void BKE_curve_editNurb_free(struct Curve *cu);
|
|
|
|
struct ListBase *BKE_curve_editNurbs_get(struct Curve *cu);
|
|
|
|
|
|
|
|
float *BKE_curve_make_orco(struct Scene *scene, struct Object *ob);
|
|
|
|
float *BKE_curve_surf_make_orco(struct Object *ob);
|
|
|
|
|
|
|
|
void BKE_curve_bevelList_make(struct Object *ob);
|
2013-04-05 00:33:59 +00:00
|
|
|
void BKE_curve_bevel_make(struct Scene *scene, struct Object *ob, struct ListBase *disp, int forRender, int renderResolution);
|
2012-04-28 16:49:00 +00:00
|
|
|
|
|
|
|
void BKE_curve_forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride);
|
|
|
|
|
|
|
|
/* ** Nurbs ** */
|
|
|
|
|
2012-09-16 08:25:31 +00:00
|
|
|
int BKE_nurbList_index_get_co(struct ListBase *editnurb, const int index, float r_co[3]);
|
|
|
|
|
2012-04-28 16:49:00 +00:00
|
|
|
int BKE_nurbList_verts_count(struct ListBase *nurb);
|
|
|
|
int BKE_nurbList_verts_count_without_handles(struct ListBase *nurb);
|
|
|
|
|
|
|
|
void BKE_nurbList_free(struct ListBase *lb);
|
|
|
|
void BKE_nurbList_duplicate(struct ListBase *lb1, struct ListBase *lb2);
|
|
|
|
void BKE_nurbList_handles_set(struct ListBase *editnurb, short code);
|
|
|
|
|
|
|
|
void BKE_nurbList_handles_autocalc(ListBase *editnurb, int flag);
|
|
|
|
|
|
|
|
void BKE_nurb_free(struct Nurb *nu);
|
|
|
|
struct Nurb *BKE_nurb_duplicate(struct Nurb *nu);
|
|
|
|
|
|
|
|
void BKE_nurb_test2D(struct Nurb *nu);
|
2012-10-15 09:11:17 +00:00
|
|
|
void BKE_nurb_minmax(struct Nurb *nu, float min[3], float max[3]);
|
2012-04-28 16:49:00 +00:00
|
|
|
|
|
|
|
void BKE_nurb_makeFaces(struct Nurb *nu, float *coord_array, int rowstride, int resolu, int resolv);
|
|
|
|
void BKE_nurb_makeCurve(struct Nurb *nu, float *coord_array, float *tilt_array, float *radius_array, float *weight_array, int resolu, int stride);
|
|
|
|
|
|
|
|
void BKE_nurb_knot_calc_u(struct Nurb *nu);
|
|
|
|
void BKE_nurb_knot_calc_v(struct Nurb *nu);
|
2009-10-22 09:31:07 +00:00
|
|
|
|
2008-05-26 09:50:46 +00:00
|
|
|
/* nurb checks if they can be drawn, also clamp order func */
|
2013-03-09 05:35:49 +00:00
|
|
|
bool BKE_nurb_check_valid_u(struct Nurb *nu);
|
|
|
|
bool BKE_nurb_check_valid_v(struct Nurb *nu);
|
2008-05-26 09:50:46 +00:00
|
|
|
|
2013-03-09 05:35:49 +00:00
|
|
|
bool BKE_nurb_order_clamp_u(struct Nurb *nu);
|
|
|
|
bool BKE_nurb_order_clamp_v(struct Nurb *nu);
|
2008-05-26 09:50:46 +00:00
|
|
|
|
2012-04-28 16:49:00 +00:00
|
|
|
void BKE_nurb_direction_switch(struct Nurb *nu);
|
2013-03-20 15:01:15 +00:00
|
|
|
bool BKE_nurb_type_convert(struct Nurb *nu, const short type, const bool use_handles);
|
2010-07-25 11:57:36 +00:00
|
|
|
|
2012-04-28 16:49:00 +00:00
|
|
|
void BKE_nurb_points_add(struct Nurb *nu, int number);
|
|
|
|
void BKE_nurb_bezierPoints_add(struct Nurb *nu, int number);
|
|
|
|
|
|
|
|
void BKE_nurb_handle_calc(struct BezTriple *bezt, struct BezTriple *prev, struct BezTriple *next, int mode);
|
2002-10-30 02:07:20 +00:00
|
|
|
|
2012-04-28 16:49:00 +00:00
|
|
|
void BKE_nurb_handles_calc(struct Nurb *nu);
|
|
|
|
void BKE_nurb_handles_autocalc(struct Nurb *nu, int flag);
|
|
|
|
void BKE_nurb_handles_test(struct Nurb *nu);
|
|
|
|
|
2013-03-09 05:35:49 +00:00
|
|
|
#endif /* __BKE_CURVE_H__ */
|