[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10972] branches/imgbrowser-elubie: === merge from trunk ===

Andrea Weikert elubie at gmx.net
Tue Jun 19 19:03:29 CEST 2007


Revision: 10972
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=10972
Author:   elubie
Date:     2007-06-19 19:03:29 +0200 (Tue, 19 Jun 2007)

Log Message:
-----------
=== merge from trunk ===
- changes from rev. 10904 to rev. 10969

Modified Paths:
--------------
    branches/imgbrowser-elubie/CMakeLists.txt
    branches/imgbrowser-elubie/SConstruct
    branches/imgbrowser-elubie/config/win32-vc-config.py
    branches/imgbrowser-elubie/doc/blender-scons.txt
    branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPNode.cpp
    branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPNode.h
    branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPTree.cpp
    branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPTree.h
    branches/imgbrowser-elubie/intern/boolop/intern/BOP_Interface.cpp
    branches/imgbrowser-elubie/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj
    branches/imgbrowser-elubie/release/scripts/object_find.py
    branches/imgbrowser-elubie/release/scripts/scripttemplate_mesh_edit.py
    branches/imgbrowser-elubie/release/scripts/vrml97_export.py
    branches/imgbrowser-elubie/source/blender/blenkernel/BKE_curve.h
    branches/imgbrowser-elubie/source/blender/blenkernel/BKE_verse.h
    branches/imgbrowser-elubie/source/blender/blenkernel/bad_level_call_stubs/stubs.c
    branches/imgbrowser-elubie/source/blender/blenkernel/intern/constraint.c
    branches/imgbrowser-elubie/source/blender/blenkernel/intern/curve.c
    branches/imgbrowser-elubie/source/blender/blenkernel/intern/idprop.c
    branches/imgbrowser-elubie/source/blender/blenkernel/intern/verse_node.c
    branches/imgbrowser-elubie/source/blender/blenkernel/intern/verse_object_node.c
    branches/imgbrowser-elubie/source/blender/blenkernel/intern/verse_session.c
    branches/imgbrowser-elubie/source/blender/blenloader/intern/readfile.c
    branches/imgbrowser-elubie/source/blender/blenloader/intern/writefile.c
    branches/imgbrowser-elubie/source/blender/include/BDR_drawaction.h
    branches/imgbrowser-elubie/source/blender/include/BDR_editcurve.h
    branches/imgbrowser-elubie/source/blender/include/BIF_editconstraint.h
    branches/imgbrowser-elubie/source/blender/include/BIF_editsima.h
    branches/imgbrowser-elubie/source/blender/include/blendef.h
    branches/imgbrowser-elubie/source/blender/include/multires.h
    branches/imgbrowser-elubie/source/blender/makesdna/DNA_constraint_types.h
    branches/imgbrowser-elubie/source/blender/makesdna/DNA_meshdata_types.h
    branches/imgbrowser-elubie/source/blender/python/BPY_extern.h
    branches/imgbrowser-elubie/source/blender/python/BPY_interface.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Blender.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Camera.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Constraint.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/CurNurb.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Draw.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Font.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Geometry.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Group.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/IDProp.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Image.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Ipo.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Ipocurve.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Ipocurve.h
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Lamp.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Library.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Material.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Mathutils.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Mathutils.h
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Mesh.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Metaball.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Modifier.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/NLA.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Object.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Scene.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Sound.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Sys.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Text.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Text3d.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Texture.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/Window.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/World.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/bpy_data.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/doc/Constraint.py
    branches/imgbrowser-elubie/source/blender/python/api2_2x/gen_utils.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/gen_utils.h
    branches/imgbrowser-elubie/source/blender/python/api2_2x/logic.c
    branches/imgbrowser-elubie/source/blender/python/api2_2x/windowTheme.c
    branches/imgbrowser-elubie/source/blender/src/buttons_object.c
    branches/imgbrowser-elubie/source/blender/src/drawaction.c
    branches/imgbrowser-elubie/source/blender/src/drawobject.c
    branches/imgbrowser-elubie/source/blender/src/editarmature.c
    branches/imgbrowser-elubie/source/blender/src/editconstraint.c
    branches/imgbrowser-elubie/source/blender/src/editcurve.c
    branches/imgbrowser-elubie/source/blender/src/editnla.c
    branches/imgbrowser-elubie/source/blender/src/editsima.c
    branches/imgbrowser-elubie/source/blender/src/header_image.c
    branches/imgbrowser-elubie/source/blender/src/header_text.c
    branches/imgbrowser-elubie/source/blender/src/header_view3d.c
    branches/imgbrowser-elubie/source/blender/src/multires.c
    branches/imgbrowser-elubie/source/blender/src/space.c
    branches/imgbrowser-elubie/source/blender/src/toolbox.c

Added Paths:
-----------
    branches/imgbrowser-elubie/release/scripts/scripttemplate_pyconstraint.py
    branches/imgbrowser-elubie/source/blender/blenkernel/intern/verse_method.c

Modified: branches/imgbrowser-elubie/CMakeLists.txt
===================================================================
--- branches/imgbrowser-elubie/CMakeLists.txt	2007-06-19 15:06:32 UTC (rev 10971)
+++ branches/imgbrowser-elubie/CMakeLists.txt	2007-06-19 17:03:29 UTC (rev 10972)
@@ -144,6 +144,7 @@
     /opt/local/include/freetype2
     /opt/csw/include/freetype2
     /opt/include/freetype2
+    NO_DEFAULT_PATH
   )
   SET(FREETYPE_LIB freetype)
 

Modified: branches/imgbrowser-elubie/SConstruct
===================================================================
--- branches/imgbrowser-elubie/SConstruct	2007-06-19 15:06:32 UTC (rev 10971)
+++ branches/imgbrowser-elubie/SConstruct	2007-06-19 17:03:29 UTC (rev 10972)
@@ -390,7 +390,7 @@
     dllsources = ['${LCGDIR}/gettext/lib/gnu_gettext.dll',
                         '${LCGDIR}/png/lib/libpng.dll',
                         '#release/windows/extra/python25.zip',
-#                        '#release/windows/extra/zlib.pyd',
+                        '#release/windows/extra/zlib.pyd',
                         '${LCGDIR}/sdl/lib/SDL.dll',
                         '${LCGDIR}/zlib/lib/zlib.dll',
                         '${LCGDIR}/tiff/lib/libtiff.dll']

Modified: branches/imgbrowser-elubie/config/win32-vc-config.py
===================================================================
--- branches/imgbrowser-elubie/config/win32-vc-config.py	2007-06-19 15:06:32 UTC (rev 10971)
+++ branches/imgbrowser-elubie/config/win32-vc-config.py	2007-06-19 17:03:29 UTC (rev 10972)
@@ -145,7 +145,7 @@
 
 CCFLAGS = ['/nologo', '/Og', '/Ot', '/Ob1', '/Op', '/G6','/EHsc', '/J', '/W3', '/Gd', '/MT']
 
-BF_DEBUG_FLAGS = ['/Zi', '/FR${TARGET.base}.sbr']
+BF_DEBUG_FLAGS = ['/Zi', '/FR${TARGET}.sbr']
 
 CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-DUSE_OPENAL', '-DFTGL_LIBRARY_STATIC', '-D_CRT_SECURE_NO_DEPRECATE']
 REL_CFLAGS = ['-O2', '-DNDEBUG']

Modified: branches/imgbrowser-elubie/doc/blender-scons.txt
===================================================================
--- branches/imgbrowser-elubie/doc/blender-scons.txt	2007-06-19 15:06:32 UTC (rev 10971)
+++ branches/imgbrowser-elubie/doc/blender-scons.txt	2007-06-19 17:03:29 UTC (rev 10972)
@@ -1,6 +1,6 @@
 $Id$
 
-    Note: The current official release of SCons is 0.96.1
+    Note: The current official release of SCons is 0.97
 
     Blenders SCons build scripts
     ============================
@@ -29,7 +29,7 @@
 
     To build Blender with the SCons scripts you need a full Python
     install, version 2.4 or later (http://www.python.org) and a SCons
-    installation, version v0.96.1 (http://www.scons.org).
+    installation, version v0.97 (http://www.scons.org).
 
     Check from the page
     http://www.blender.org/development/building-blender/getting-dependencies/

Modified: branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPNode.cpp
===================================================================
--- branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPNode.cpp	2007-06-19 15:06:32 UTC (rev 10971)
+++ branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPNode.cpp	2007-06-19 17:03:29 UTC (rev 10972)
@@ -58,32 +58,84 @@
 
 /**
  * Adds a new face to this BSP tree.
- * @param p1 first face point.
- * @param p2 second face point.
- * @param p3 third face point.
+ * @param pts vector containing face points
  * @param plane face plane.
  */
-unsigned int BOP_BSPNode::addFace(const MT_Point3& p1, 
-								  const MT_Point3& p2, 
-								  const MT_Point3& p3, 
-								  const MT_Plane3& plane)
+
+unsigned int BOP_BSPNode::addFace(BOP_BSPPoints pts,
+								  const MT_Plane3& plane )
 {
 	unsigned int newDeep = 0;
-	BOP_TAG tag = BOP_createTAG(testPoint(p1), testPoint(p2), testPoint(p3));
-	if ((tag & IN_IN_IN) != 0) {
+	BOP_TAG tag = ON;
+
+	// find out if any points on the "face" lie in either half-space
+	BOP_IT_BSPPoints ptsEnd = pts.end();
+	for(BOP_IT_BSPPoints itp=pts.begin();itp!=ptsEnd;itp++){
+		tag = (BOP_TAG) ((int) tag | (int)testPoint(*itp));
+	}
+ 
+	if (tag == ON) { }		// face lies on hyperplane: do nothing
+	else if ((tag & IN) != 0 && (tag & OUT) == 0) {	// face is entirely on inside
 		if (m_inChild != NULL)
-			newDeep = m_inChild->addFace(p1, p2, p3, plane) + 1;
+			newDeep = m_inChild->addFace(pts, plane) + 1;
 		else {
 			m_inChild = new BOP_BSPNode(plane);
 			newDeep = 2;
 		}    
-	}
-	
-	if ((tag & OUT_OUT_OUT) != 0){
+	} else if ((tag & OUT) != 0 && (tag & IN) == 0) { // face is entirely on outside
 		if (m_outChild != NULL)
-			newDeep = MT_max(newDeep, m_outChild->addFace(p1, p2, p3, plane) + 1);
+			newDeep = m_outChild->addFace(pts, plane) + 1;
 		else {
 			m_outChild = new BOP_BSPNode(plane);
+			newDeep = 2;
+		}      
+	} else { // face lies in both half-spaces: split it
+		BOP_BSPPoints inside, outside;
+  		MT_Point3 lpoint= pts[pts.size()-1];
+		BOP_TAG ltag = testPoint(lpoint);
+		BOP_TAG tstate = ltag;
+
+		// classify each line segment, looking for endpoints which lie on different
+		// sides of the hyperplane.
+
+		BOP_IT_BSPPoints ptsEnd = pts.end();
+		for(BOP_IT_BSPPoints itp=pts.begin();itp!=ptsEnd;itp++){
+			MT_Point3 npoint= *itp;
+			BOP_TAG ntag = testPoint(npoint);
+
+			if(ltag != ON) {	// last point not on hyperplane
+				if(tstate == IN) {
+					if (m_inChild != NULL) inside.push_back(lpoint);
+				} else {
+					if (m_outChild != NULL) outside.push_back(lpoint);
+				}
+				if(ntag != ON && ntag != tstate) {	// last, self in different half-spaces 
+					MT_Point3 mpoint = BOP_intersectPlane( m_plane, lpoint, npoint );
+					if (m_inChild != NULL) inside.push_back(mpoint);
+					if (m_outChild != NULL) outside.push_back(mpoint);
+					tstate = ntag;
+				}
+			} else {			// last point on hyperplane, so we're switching
+								// half-spaces
+								// boundary point belong to both faces
+				if (m_inChild != NULL) inside.push_back(lpoint);	
+				if (m_outChild != NULL) outside.push_back(lpoint);
+				tstate = ntag;	// state changes to new point tag
+			}
+			lpoint = npoint;	// save point, tag for next iteration
+			ltag = ntag;
+		}
+
+		if (m_inChild != NULL)
+			newDeep = m_inChild->addFace(inside, plane) + 1;
+		else {
+			m_inChild = new BOP_BSPNode(plane);
+			newDeep = 2;
+		}    
+		if (m_outChild != NULL)
+			newDeep = MT_max(newDeep, m_outChild->addFace(outside, plane) + 1);
+		else {
+			m_outChild = new BOP_BSPNode(plane);
 			newDeep = MT_max(newDeep,(unsigned int)2);
 		}      
 	}
@@ -653,19 +705,13 @@
  */
 void BOP_BSPNode::print(unsigned int deep)
 {
-	for (unsigned int i = 0; i < deep; ++i)
-		cout << "  ";
-	
-	cout << m_plane.x() << ", ";
-	cout << m_plane.y() << ", ";
-	cout << m_plane.z() << ", ";
-	cout << m_plane.w() << endl;
-	if (m_inChild != NULL) {
-		cout << "IN:";
+	cout << "(" << deep << "," << m_plane << ")," << endl;
+	if (m_inChild != NULL)
 		m_inChild->print(deep + 1);
-	}
-	if (m_outChild != NULL) {
-		cout << "OUT:";
+	else
+		cout << "(" << deep+1 << ",None)," << endl;
+	if (m_outChild != NULL)
 		m_outChild->print(deep + 1);
-	}
+	else
+		cout << "(" << deep+1 << ",None)," << endl;
 }

Modified: branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPNode.h
===================================================================
--- branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPNode.h	2007-06-19 15:06:32 UTC (rev 10971)
+++ branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPNode.h	2007-06-19 17:03:29 UTC (rev 10972)
@@ -35,6 +35,9 @@
 #include "BOP_Tag.h"
 #include "BOP_Face.h"
 
+typedef vector<MT_Point3> BOP_BSPPoints;
+typedef vector<MT_Point3>::iterator BOP_IT_BSPPoints;
+
 class BOP_BSPNode
 {
 protected:
@@ -47,9 +50,7 @@
 	// Construction methods
 	BOP_BSPNode(const MT_Plane3& plane);
 	~BOP_BSPNode();
-	unsigned int addFace(const MT_Point3& p1, 
-						 const MT_Point3& p2, 
-						 const MT_Point3& p3, 
+	unsigned int addFace(BOP_BSPPoints pts, 
 						 const MT_Plane3& plane);
 	BOP_TAG classifyFace(const MT_Point3& p1, 
 						 const MT_Point3& p2, 

Modified: branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPTree.cpp
===================================================================
--- branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPTree.cpp	2007-06-19 15:06:32 UTC (rev 10971)
+++ branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPTree.cpp	2007-06-19 17:03:29 UTC (rev 10972)
@@ -69,6 +69,7 @@
  * @param mesh Input data for BSP tree.
  * @param face index to mesh face.
  */
+
 void BOP_BSPTree::addFace(BOP_Mesh* mesh, BOP_Face* face)
 {
 	addFace(mesh->getVertex(face->getVertex(0))->getPoint(),
@@ -91,9 +92,16 @@
 {
 	if (m_root == NULL)
 		m_root = new BOP_BSPNode(plane);
-	else
-		m_root->addFace(p1,p2,p3,plane);
+	else {
+		BOP_BSPPoints pts;
 
+		pts.push_back(p1);
+		pts.push_back(p2);
+		pts.push_back(p3);
+
+		m_root->addFace(pts,plane);
+	}
+
 	// update bounding box
 	m_bbox.add(p1);
 	m_bbox.add(p2);
@@ -171,37 +179,6 @@
 }
 
 /**
- * Computes the bounding BSP data.
- */
-void BOP_BSPTree::computeBox()
-{
-	if ( m_root != NULL ) {
-		MT_Point3 p1(m_bbox.m_minX,m_bbox.m_minY,m_bbox.m_minZ);
-		MT_Point3 p2(m_bbox.m_maxX,m_bbox.m_minY,m_bbox.m_minZ);
-		MT_Point3 p3(m_bbox.m_maxX,m_bbox.m_maxY,m_bbox.m_minZ);
-		MT_Point3 p4(m_bbox.m_minX,m_bbox.m_maxY,m_bbox.m_minZ);
-		MT_Point3 p5(m_bbox.m_minX,m_bbox.m_minY,m_bbox.m_maxZ);
-		MT_Point3 p6(m_bbox.m_maxX,m_bbox.m_minY,m_bbox.m_maxZ);
-		MT_Point3 p7(m_bbox.m_maxX,m_bbox.m_maxY,m_bbox.m_maxZ);
-		MT_Point3 p8(m_bbox.m_minX,m_bbox.m_maxY,m_bbox.m_maxZ);        
-		
-		MT_Plane3 plane1(p3,p2,p1);
-		MT_Plane3 plane2(p5,p6,p7);
-		MT_Plane3 plane3(p1,p2,p6);
-		MT_Plane3 plane4(p8,p7,p3);
-		MT_Plane3 plane5(p2,p3,p7);
-		MT_Plane3 plane6(p1,p5,p8);
-		
-		BOP_BSPNode bsp(plane1);
-		bsp.addFace(p5,p6,p7,plane2);
-		bsp.addFace(p1,p2,p6,plane3);
-		bsp.addFace(p8,p7,p3,plane4);
-		bsp.addFace(p2,p3,p7,plane5);
-		bsp.addFace(p1,p5,p8,plane6);
-	}
-}
-
-/**
  * Prints debug information.
  */
 void BOP_BSPTree::print()

Modified: branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPTree.h
===================================================================
--- branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPTree.h	2007-06-19 15:06:32 UTC (rev 10971)
+++ branches/imgbrowser-elubie/intern/boolop/intern/BOP_BSPTree.h	2007-06-19 17:03:29 UTC (rev 10972)
@@ -65,7 +65,6 @@
 								   const MT_Point3& p3, 
 								   const MT_Plane3& plane) const;
 	unsigned int getDeep() const;
-	void computeBox();
 	void print();

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list