[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21713] branches/nurbs25: Initial commit of nurbana code in 2.5 codebase.

Emmanuel Stone emmanuel.stone at gmail.com
Mon Jul 20 05:18:18 CEST 2009


Revision: 21713
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21713
Author:   eman
Date:     2009-07-20 05:18:16 +0200 (Mon, 20 Jul 2009)

Log Message:
-----------
Initial commit of nurbana code in 2.5 codebase.

This does not have any of the new functionality from the 2.4 branch, but existing NURBS calculations are now being performed by libNurbana.

Modified Paths:
--------------
    branches/nurbs25/CMakeLists.txt
    branches/nurbs25/intern/CMakeLists.txt
    branches/nurbs25/intern/SConscript
    branches/nurbs25/release/ui/buttons_data_curve.py
    branches/nurbs25/source/blender/blenkernel/BKE_curve.h
    branches/nurbs25/source/blender/blenkernel/BKE_displist.h
    branches/nurbs25/source/blender/blenkernel/BKE_utildefines.h
    branches/nurbs25/source/blender/blenkernel/CMakeLists.txt
    branches/nurbs25/source/blender/blenkernel/SConscript
    branches/nurbs25/source/blender/blenkernel/intern/curve.c
    branches/nurbs25/source/blender/blenkernel/intern/displist.c
    branches/nurbs25/source/blender/editors/CMakeLists.txt
    branches/nurbs25/source/blender/editors/curve/SConscript
    branches/nurbs25/source/blender/editors/curve/editcurve.c
    branches/nurbs25/source/blender/editors/space_view3d/drawobject.c
    branches/nurbs25/source/blender/makesdna/DNA_curve_types.h

Added Paths:
-----------
    branches/nurbs25/intern/nurbana/
    branches/nurbs25/intern/nurbana/CMakeLists.txt
    branches/nurbs25/intern/nurbana/SConscript
    branches/nurbs25/intern/nurbana/extern/
    branches/nurbs25/intern/nurbana/extern/nurbana.h
    branches/nurbs25/intern/nurbana/intern/
    branches/nurbs25/intern/nurbana/intern/Makefile
    branches/nurbs25/intern/nurbana/intern/NGlobal.h
    branches/nurbs25/intern/nurbana/intern/NURBS.h
    branches/nurbs25/intern/nurbana/intern/NURBS_Construct.cpp
    branches/nurbs25/intern/nurbana/intern/NURBS_Construct.h
    branches/nurbs25/intern/nurbana/intern/NURBS_Degree.cpp
    branches/nurbs25/intern/nurbana/intern/NURBS_Degree.h
    branches/nurbs25/intern/nurbana/intern/NURBS_Fitting.cpp
    branches/nurbs25/intern/nurbana/intern/NURBS_Fitting.h
    branches/nurbs25/intern/nurbana/intern/NURBS_Generate.cpp
    branches/nurbs25/intern/nurbana/intern/NURBS_Generate.h
    branches/nurbs25/intern/nurbana/intern/NURBS_Knot.cpp
    branches/nurbs25/intern/nurbana/intern/NURBS_Knot.h
    branches/nurbs25/intern/nurbana/intern/NURBS_Utils.h
    branches/nurbs25/intern/nurbana/intern/NurbanaMath.cpp
    branches/nurbs25/intern/nurbana/intern/NurbanaMath.h
    branches/nurbs25/intern/nurbana/intern/ON_IO.h
    branches/nurbs25/intern/nurbana/intern/Object_Base.cpp
    branches/nurbs25/intern/nurbana/intern/Object_Base.h
    branches/nurbs25/intern/nurbana/intern/Object_NURBS.cpp
    branches/nurbs25/intern/nurbana/intern/Object_NURBS.h
    branches/nurbs25/intern/nurbana/intern/Object_Normals.cpp
    branches/nurbs25/intern/nurbana/intern/Object_Normals.h
    branches/nurbs25/intern/nurbana/intern/Object_Primitives.cpp
    branches/nurbs25/intern/nurbana/intern/Object_Primitives.h
    branches/nurbs25/intern/nurbana/intern/VertexOps.cpp
    branches/nurbs25/intern/nurbana/intern/VertexOps.h
    branches/nurbs25/intern/nurbana/intern/blenderNurbsStruct.h
    branches/nurbs25/intern/nurbana/intern/libNurbana.cpp
    branches/nurbs25/intern/nurbana/intern/nbGridTessellator.cpp
    branches/nurbs25/intern/nurbana/intern/nbGridTessellator.h
    branches/nurbs25/intern/nurbana/intern/nbTessellator.cpp
    branches/nurbs25/intern/nurbana/intern/nbTessellator.h
    branches/nurbs25/intern/nurbana/intern/nbTrimTessellator.cpp
    branches/nurbs25/intern/nurbana/intern/nbTrimTessellator.h
    branches/nurbs25/intern/nurbana/intern/trim/
    branches/nurbs25/intern/nurbana/intern/trim/nbSubDiv.cpp
    branches/nurbs25/intern/nurbana/intern/trim/nbSubDiv.h
    branches/nurbs25/intern/nurbana/intern/trim/nbTessGrid.cpp
    branches/nurbs25/intern/nurbana/intern/trim/nbTessGrid.h
    branches/nurbs25/intern/nurbana/intern/trim/nbTrimPatch.cpp
    branches/nurbs25/intern/nurbana/intern/trim/nbTrimPatch.h

Modified: branches/nurbs25/CMakeLists.txt
===================================================================
--- branches/nurbs25/CMakeLists.txt	2009-07-20 02:43:20 UTC (rev 21712)
+++ branches/nurbs25/CMakeLists.txt	2009-07-20 03:18:16 UTC (rev 21713)
@@ -193,7 +193,7 @@
   ENDIF(CMAKE_CL_64)
 
   SET(PYTHON ${LIBDIR}/python)
-  SET(PYTHON_VERSION 2.6)
+  SET(PYTHON_VERSION 2.5)
   SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}")
   SET(PYTHON_BINARY python)
   SET(PYTHON_LIB python26)
@@ -274,6 +274,9 @@
   SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
   ENDIF(CMAKE_CL_64)
   
+  #OpenNURBS FIXME make optional
+  SET(LLIBS ${LLIBS} rpcrt4)
+
   IF(WITH_OPENAL)
     SET(LLIBS ${LLIBS} dxguid)
   ENDIF(WITH_OPENAL)

Modified: branches/nurbs25/intern/CMakeLists.txt
===================================================================
--- branches/nurbs25/intern/CMakeLists.txt	2009-07-20 02:43:20 UTC (rev 21712)
+++ branches/nurbs25/intern/CMakeLists.txt	2009-07-20 03:18:16 UTC (rev 21713)
@@ -35,6 +35,7 @@
 ADD_SUBDIRECTORY(iksolver)
 ADD_SUBDIRECTORY(boolop)
 ADD_SUBDIRECTORY(opennl)
+ADD_SUBDIRECTORY(nurbana)
 
 IF(WITH_ELBEEM)
   ADD_SUBDIRECTORY(elbeem)

Modified: branches/nurbs25/intern/SConscript
===================================================================
--- branches/nurbs25/intern/SConscript	2009-07-20 02:43:20 UTC (rev 21712)
+++ branches/nurbs25/intern/SConscript	2009-07-20 03:18:16 UTC (rev 21713)
@@ -11,6 +11,7 @@
             'decimation/SConscript',
             'iksolver/SConscript',
             'boolop/SConscript',
+            'nurbana/SConscript',
             'opennl/SConscript'])
 
 # NEW_CSG was intended for intern/csg, but

Added: branches/nurbs25/intern/nurbana/CMakeLists.txt
===================================================================
--- branches/nurbs25/intern/nurbana/CMakeLists.txt	                        (rev 0)
+++ branches/nurbs25/intern/nurbana/CMakeLists.txt	2009-07-20 03:18:16 UTC (rev 21713)
@@ -0,0 +1,72 @@
+# ***** BEGIN GPL/BL DUAL 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. The Blender
+# Foundation also sells licenses for use in proprietary software under
+# the Blender License.  See http://www.blender.org/BL/ for information
+# about this.
+#
+# 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): Emmanuel Stone.
+#
+# ***** END GPL/BL DUAL LICENSE BLOCK *****
+
+SET(INC include)
+
+FILE(GLOB SRC intern/*.cpp intern/opennurbs/*.cpp intern/opennurbs/*.c intern/opennurbs/zlib/*.c intern/trim/*.cpp)
+
+
+INCLUDE_DIRECTORIES(../../intern/guardedalloc ./opennurbs ./opennurbs/zlib intern/trim)
+BLENDERLIB(bf_nurbana "${SRC}" "${INC}")
+#, libtype=['intern','game','game2','player'], priority = [15, 55, 100, 135] )
+# ***** BEGIN GPL/BL DUAL 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. The Blender
+# Foundation also sells licenses for use in proprietary software under
+# the Blender License.  See http://www.blender.org/BL/ for information
+# about this.
+#
+# 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): Emmanuel Stone.
+#
+# ***** END GPL/BL DUAL LICENSE BLOCK *****
+
+SET(INC include)
+
+FILE(GLOB SRC intern/*.cpp intern/opennurbs/*.cpp intern/opennurbs/*.c intern/opennurbs/zlib/*.c intern/trim/*.cpp)
+
+
+INCLUDE_DIRECTORIES(../../intern/guardedalloc ./opennurbs ./opennurbs/zlib intern/trim)
+BLENDERLIB(bf_nurbana "${SRC}" "${INC}")
+#, libtype=['intern','game','game2','player'], priority = [15, 55, 100, 135] )

Added: branches/nurbs25/intern/nurbana/SConscript
===================================================================
--- branches/nurbs25/intern/nurbana/SConscript	                        (rev 0)
+++ branches/nurbs25/intern/nurbana/SConscript	2009-07-20 03:18:16 UTC (rev 21713)
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+ 
+Import('env')
+ 
+sources = env.Glob('intern/*.cpp') + env.Glob('intern/opennurbs/*.cpp') + env.Glob('intern/opennurbs/*.c') + env.Glob('intern/opennurbs/zlib/*.c') + env.Glob('intern/trim/*.cpp')
+incs = '../../intern/guardedalloc ./intern/opennurbs/ ./intern/opennurbs/zlib ./intern/trim'
+ 
+env.BlenderLib ('bf_nurbana', sources, Split(incs), defines=[], libtype=['intern', 'player'], priority = [12, 177] )

Added: branches/nurbs25/intern/nurbana/extern/nurbana.h
===================================================================
--- branches/nurbs25/intern/nurbana/extern/nurbana.h	                        (rev 0)
+++ branches/nurbs25/intern/nurbana/extern/nurbana.h	2009-07-20 03:18:16 UTC (rev 21713)
@@ -0,0 +1,414 @@
+/*
+* $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) 2005 by Emmanuel Stone
+* All rights reserved.
+*
+* The Original Code is: all of this file.
+*
+* Contributor(s): none yet.
+*
+* ***** END GPL LICENSE BLOCK *****
+*/
+
+#ifndef NAN_INCLUDED_nurbana_h
+#define NAN_INCLUDED_nurbana_h
+
+#include "../intern/blenderNurbsStruct.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void nurbs_test();
+
+typedef float nbReal;
+
+typedef struct nbReal3 {
+	nbReal  x;
+	nbReal  y;
+	nbReal  z;
+
+}nbReal3;
+typedef struct nbReal4 {
+	nbReal  x;
+	nbReal  y;
+	nbReal  z;
+	nbReal  a;
+}nbReal4;
+
+
+/*typedef struct Point3d {
+	nbReal  x;
+	nbReal  y;
+	nbReal  z;
+	nbReal  H;
+
+	// This extra data should make Point4d 'struct'rally equivalent to BPoint from Blender::DNA_Data_Types.h
+	nbReal alfa, weight;		// alfa: tilt in 3D View, weight: used for softbody goal weight 
+	short f1, hide;
+	nbReal radius, pad;		// user-set radius per point for bevelling etc 
+}Point3d;
+*/
+//typedef Point3d nbReal3;
+
+typedef struct Nurb_Extern {
+   int numCPu;
+	int numCPv;
+	int resolu;
+	int resolv;
+	short cyclicU;
+	short cyclicV;
+	short orderU;
+	short orderV;
+	int numKnotsU;
+	int numKnotsV;
+	nbReal *KnotU;
+	nbReal *KnotV;
+	struct ControlPoint *CP;
+} Nurb_Extern;
+
+typedef struct ControlPoint {
+	nbReal x;
+	nbReal y;
+	nbReal z;
+	nbReal H;
+	// This extra data makes nurbana struct compatible with blender
+	float alfa, weight;		/* alfa: tilt in 3D View, weight: used for softbody goal weight */
+	short f1, hide;
+	float radius, pad;		/* user-set radius per point for bevelling etc */
+} ControlPoint;
+
+
+typedef Nurb_Extern* Nurb_ExternPtr;
+
+// forward declare as void
+//typedef void Point3d; 
+//typedef void* Point3d_ptr;
+typedef Point3d* Point3d_ptr;
+typedef nbReal3* nbReal3_ptr;
+typedef void* BlenderNurbs_ptr;
+typedef void* NurbanaObj_ptr; // to hide pointer to C++ object in C space
+
+//extern NurbanaObj_ptr NRB_addObject(Point3d** CtlPts, short* numCPu, short* numCPv, short* orderU, short* orderV, nbReal** knotsU, nbReal** knotsV,  short* cyclicU,  short* cyclicV, short* knottypeu, short* knottypev,  short* resolu,  short* resolv, short* isores, short* isoden, short* isovis) ;
+extern NurbanaObj_ptr NRB_addObject(BlenderNurbs_ptr bNurbs);
+
+
+//extern NurbanaObj_ptr NRB_allocate();
+//extern void NRB_deallocate(NurbanaObj_ptr nop);
+extern void NRB_init(NurbanaObj_ptr nop);
+
+extern NurbanaObj_ptr NRB_reallocate(BlenderNurbs_ptr bNurbs);
+
+extern NurbanaObj_ptr NRB_CreatePrimitive(NurbanaObj_ptr nop, unsigned char type);
+extern void NRB_removeObject(NurbanaObj_ptr nop);
+
+extern void NRB_changeCyclic(NurbanaObj_ptr nop,int uv);
+
+extern void NRB_getTriangleNormals(float v0[], float v1[], float v2[], float n0[], float n1[], float n2[]);
+extern void NRB_getTrimTess(NurbanaObj_ptr surface, float** vertex, int** index, int* totindex, float** norm);
+extern void NRB_addTrimCurve(NurbanaObj_ptr surface, void* curve);
+
+extern void NRB_ResChanged(NurbanaObj_ptr nop );
+extern void NRB_SizeChanged(NurbanaObj_ptr nop, int newU, int newV);
+extern void NRB_UpdateSize(NurbanaObj_ptr nop);
+
+extern void NRB_setLength(int U, int V, int shiftU, int shiftV, int copyKnots, NurbanaObj_ptr nurb);
+extern void NRB_reallocKnots(int U, int V, int copy, NurbanaObj_ptr nurb);
+extern void NRB_copyPatchFromBuffer(nbReal4 *buffer, int curveLength, int nextCurve, int curveCount, NurbanaObj_ptr nurb, int uOffset, int vOffset);
+extern void NRB_reallocCtlPts(int U, int V, int shiftU, int shiftV, NurbanaObj_ptr nurb);
+

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list