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
|
|
|
*/
|
|
|
|
#ifndef BKE_CURVE_H
|
|
|
|
#define BKE_CURVE_H
|
|
|
|
|
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;
|
2011-09-14 00:37:27 +00:00
|
|
|
struct ListBase;
|
|
|
|
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
|
|
|
|
2010-08-06 08:27:07 +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 */
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +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
|
|
|
|
2009-09-08 00:23:33 +00:00
|
|
|
#define CU_DO_TILT(cu, nu) (((nu->flag & CU_2D) && (cu->flag & CU_3D)==0) ? 0 : 1)
|
2011-03-28 11:21:39 +00:00
|
|
|
#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
|
|
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void unlink_curve( struct Curve *cu);
|
2011-09-14 00:37:27 +00:00
|
|
|
void free_curve_editNurb_keyIndex(struct EditNurb *editnurb);
|
|
|
|
void free_curve_editNurb(struct Curve *cu);
|
2002-10-12 11:37:38 +00:00
|
|
|
void free_curve( struct Curve *cu);
|
2009-01-23 14:43:25 +00:00
|
|
|
void BKE_free_editfont(struct Curve *cu);
|
2010-11-17 09:45:45 +00:00
|
|
|
struct Curve *add_curve(const char *name, int type);
|
2002-10-12 11:37:38 +00:00
|
|
|
struct Curve *copy_curve( struct Curve *cu);
|
|
|
|
void make_local_curve( struct Curve *cu);
|
2011-09-14 00:37:27 +00:00
|
|
|
struct ListBase *curve_editnurbs(struct Curve *cu);
|
2007-03-27 11:37:54 +00:00
|
|
|
short curve_type( struct Curve *cu);
|
2002-10-12 11:37:38 +00:00
|
|
|
void test_curve_type( struct Object *ob);
|
2011-11-03 16:16:19 +00:00
|
|
|
void update_curve_dimension( struct Curve *cu );
|
2002-10-12 11:37:38 +00:00
|
|
|
void tex_space_curve( struct Curve *cu);
|
|
|
|
int count_curveverts( struct ListBase *nurb);
|
2007-06-14 14:36:27 +00:00
|
|
|
int count_curveverts_without_handles( struct ListBase *nurb);
|
2002-10-12 11:37:38 +00:00
|
|
|
void freeNurb( struct Nurb *nu);
|
|
|
|
void freeNurblist( struct ListBase *lb);
|
|
|
|
struct Nurb *duplicateNurb( struct Nurb *nu);
|
|
|
|
void duplicateNurblist( struct ListBase *lb1, struct ListBase *lb2);
|
|
|
|
void test2DNurb( struct Nurb *nu);
|
|
|
|
void minmaxNurb( struct Nurb *nu, float *min, float *max);
|
2006-02-07 19:59:02 +00:00
|
|
|
|
2010-09-30 06:51:32 +00:00
|
|
|
void nurbs_knot_calc_u(struct Nurb *nu);
|
|
|
|
void nurbs_knot_calc_v(struct Nurb *nu);
|
2006-02-07 19:59:02 +00:00
|
|
|
|
2010-11-11 09:56:39 +00:00
|
|
|
void makeNurbfaces(struct Nurb *nu, float *coord_array, int rowstride, int resolu, int resolv);
|
2010-04-21 11:59:47 +00:00
|
|
|
void makeNurbcurve(struct Nurb *nu, float *coord_array, float *tilt_array, float *radius_array, float *weight_array, int resolu, int stride);
|
2005-07-16 19:07:02 +00:00
|
|
|
void forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride);
|
2009-01-04 14:14:06 +00:00
|
|
|
float *make_orco_curve(struct Scene *scene, struct Object *ob);
|
2005-08-14 06:08:41 +00:00
|
|
|
float *make_orco_surf( struct Object *ob);
|
2010-03-26 15:06:30 +00:00
|
|
|
void makebevelcurve(struct Scene *scene, struct Object *ob, struct ListBase *disp, int forRender);
|
2006-02-07 19:59:02 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void makeBevelList( struct Object *ob);
|
2006-08-13 08:31:59 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void calchandleNurb( struct BezTriple *bezt, struct BezTriple *prev, struct BezTriple *next, int mode);
|
|
|
|
void calchandlesNurb( struct Nurb *nu);
|
|
|
|
void testhandlesNurb( struct Nurb *nu);
|
|
|
|
void autocalchandlesNurb( struct Nurb *nu, int flag);
|
2009-01-14 13:04:48 +00:00
|
|
|
void autocalchandlesNurb_all(ListBase *editnurb, int flag);
|
|
|
|
void sethandlesNurb(ListBase *editnurb, short code);
|
2006-02-07 19:59:02 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void switchdirectionNurb( struct Nurb *nu);
|
|
|
|
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
void addNurbPoints(struct Nurb *nu, int number);
|
|
|
|
void addNurbPointsBezier(struct Nurb *nu, int number);
|
|
|
|
|
2005-08-15 10:30:53 +00:00
|
|
|
float (*curve_getVertexCos(struct Curve *cu, struct ListBase *lb, int *numVerts_r))[3];
|
|
|
|
void curve_applyVertexCos(struct Curve *cu, struct ListBase *lb, float (*vertexCos)[3]);
|
|
|
|
|
2009-10-22 09:31:07 +00:00
|
|
|
float (*curve_getKeyVertexCos(struct Curve *cu, struct ListBase *lb, float *key))[3];
|
|
|
|
void curve_applyKeyVertexTilts(struct Curve *cu, struct ListBase *lb, float *key);
|
|
|
|
|
2008-05-26 09:50:46 +00:00
|
|
|
/* nurb checks if they can be drawn, also clamp order func */
|
|
|
|
int check_valid_nurb_u( struct Nurb *nu);
|
|
|
|
int check_valid_nurb_v( struct Nurb *nu);
|
|
|
|
|
|
|
|
int clamp_nurb_order_u( struct Nurb *nu);
|
|
|
|
int clamp_nurb_order_v( struct Nurb *nu);
|
|
|
|
|
2010-07-25 11:57:36 +00:00
|
|
|
ListBase *BKE_curve_nurbs(struct Curve *cu);
|
|
|
|
|
2010-08-03 00:56:43 +00:00
|
|
|
int minmax_curve(struct Curve *cu, float min[3], float max[3]);
|
2010-08-01 11:00:36 +00:00
|
|
|
int curve_center_median(struct Curve *cu, float cent[3]);
|
|
|
|
int curve_center_bounds(struct Curve *cu, float cent[3]);
|
|
|
|
void curve_translate(struct Curve *cu, float offset[3], int do_keys);
|
2011-07-31 12:43:41 +00:00
|
|
|
void curve_delete_material_index(struct Curve *cu, int index);
|
2002-10-12 11:37:38 +00:00
|
|
|
#endif
|
2002-10-30 02:07:20 +00:00
|
|
|
|