Skip to content
Browse files

qtchanges

  • Loading branch information...
1 parent ee8149d commit 86d34b5ba7299b7e019bd7a8b5b06841bba996bd jonklein committed
View
3 breve/Changes.html
@@ -49,11 +49,14 @@
The <a href="http://www.spiderland.org/breve">breve</a> simulation environment change log.
+<h5>version 2.7.x [XX/XX/2008]</h5>
+<ul>
<li>Fixed Python matrix transpose problem (reversed connections of joints)
<li>Fixed Push macro instructions being cleared with clear-stacks
<li>Fixed PatchToroid get-neighbor wraparound for grid size = 1
<li>Added variable neighborhood size for Patch neighbor methods
<li>Added DTDs of breve XML formats
+</ul>
<h5>version 2.7.2 [02/25/2008]</h5>
<ul>
View
2 breve/Makefile.in
@@ -14,7 +14,7 @@ ACLOCAL_AMFLAGS = -I m4
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@ -Iinclude/breve -DdDOUBLE @DEFS@
-LDFLAGS = @LDFLAGS@
+LDFLAGS = -Lbin @LDFLAGS@
EXTRACFLAGS = -g
OPTFLAGS = -O4 @EXTRAOPTFLAGS@
View
8 breve/OSX/breve.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 44;
+ objectVersion = 45;
objects = {
/* Begin PBXAggregateTarget section */
@@ -631,7 +631,7 @@
OTHER_CFLAGS = "$(CPPFLAGS)";
OTHER_LDFLAGS = "$(LIBS)";
PRODUCT_NAME = breve;
- SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
+ SDKROOT = macosx10.4;
SECTORDER_FLAGS = "";
UNSTRIPPED_PRODUCT = YES;
WARNING_CFLAGS = "-Wmost";
@@ -683,7 +683,7 @@
OTHER_CFLAGS = "$(CPPFLAGS)";
OTHER_LDFLAGS = "$(LIBS)";
PRODUCT_NAME = breve;
- SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
+ SDKROOT = macosx10.4;
SECTORDER_FLAGS = "";
UNSTRIPPED_PRODUCT = YES;
WARNING_CFLAGS = "-Wmost";
@@ -769,7 +769,7 @@
OTHER_CFLAGS = "$(CPPFLAGS)";
OTHER_LDFLAGS = "$(LIBS)";
PRODUCT_NAME = breve;
- SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk";
+ SDKROOT = macosx10.4;
SECTORDER_FLAGS = "";
UNSTRIPPED_PRODUCT = YES;
WARNING_CFLAGS = "-Wmost";
View
18 breve/OSXSaver/breveSaver.xcodeproj/project.pbxproj
@@ -87,8 +87,8 @@
/* Begin PBXFileReference section */
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- 4818572A05CABEEB00C48BE6 /* breveSwarm-info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "breveSwarm-info.plist"; sourceTree = "<group>"; };
- 4818574E05CABEEB00C48BE6 /* breveWalker-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "breveWalker-Info.plist"; sourceTree = "<group>"; };
+ 4818572A05CABEEB00C48BE6 /* breveSwarm-info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "breveSwarm-info.plist"; sourceTree = "<group>"; };
+ 4818574E05CABEEB00C48BE6 /* breveWalker-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "breveWalker-Info.plist"; sourceTree = "<group>"; };
4818574F05CABEEB00C48BE6 /* breveCreatures.saver */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = breveCreatures.saver; sourceTree = BUILT_PRODUCTS_DIR; };
4818575605CABFE300C48BE6 /* classes */ = {isa = PBXFileReference; lastKnownFileType = folder; name = classes; path = ../lib/classes; sourceTree = SOURCE_ROOT; };
4842D87207F9A72700140407 /* libbreve.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbreve.a; path = ../lib/libbreve.a; sourceTree = SOURCE_ROOT; };
@@ -116,11 +116,11 @@
489D8CB706B5554900740D0A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
489D8D5D06B5558A00740D0A /* libode.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libode.a; path = /usr/local/lib/libode.a; sourceTree = "<absolute>"; };
489DE21706B5587300740D0A /* brevePainter.saver */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = brevePainter.saver; sourceTree = BUILT_PRODUCTS_DIR; };
- 489DE21806B5587400740D0A /* brevePainter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = "brevePainter-Info.plist"; path = "/Users/jk/dev/breveSaver/brevePainter-Info.plist"; sourceTree = "<absolute>"; };
+ 489DE21806B5587400740D0A /* brevePainter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "brevePainter-Info.plist"; path = "/Users/jk/dev/breveSaver/brevePainter-Info.plist"; sourceTree = "<absolute>"; };
489DE2B006B5598B00740D0A /* Digitizer.tz */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Digitizer.tz; sourceTree = SOURCE_ROOT; };
489DE2B806B559C100740D0A /* PainterSaver.tz */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = PainterSaver.tz; sourceTree = "<group>"; };
48B9BDBC05EA6004002C7A42 /* breveResearcher.saver */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = breveResearcher.saver; sourceTree = BUILT_PRODUCTS_DIR; };
- 48B9BDBD05EA6004002C7A42 /* breveResearcher-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = "breveResearcher-Info.plist"; path = "/Users/jk/dev/breveSaver/breveResearcher-Info.plist"; sourceTree = "<absolute>"; };
+ 48B9BDBD05EA6004002C7A42 /* breveResearcher-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = "breveResearcher-Info.plist"; path = "/Users/jk/dev/breveSaver/breveResearcher-Info.plist"; sourceTree = "<absolute>"; };
48B9BE2D05EA60B4002C7A42 /* slBreveResearcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = slBreveResearcher.h; sourceTree = "<group>"; };
48B9BE2E05EA60B4002C7A42 /* slBreveResearcher.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = slBreveResearcher.mm; sourceTree = "<group>"; };
48BB26B20B2285DF006FA9E9 /* libpython.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpython.dylib; path = /usr/lib/libpython.dylib; sourceTree = "<absolute>"; };
@@ -532,7 +532,6 @@
INFOPLIST_FILE = "breveWalker-Info.plist";
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
MACOSX_DEPLOYMENT_TARGET = 10.3;
- OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-bundle",
@@ -563,12 +562,11 @@
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_OPTIMIZATION_LEVEL = 4;
GCC_PREPROCESSOR_DEFINITIONS = MACOSX;
INFOPLIST_FILE = "breveWalker-Info.plist";
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
MACOSX_DEPLOYMENT_TARGET = 10.3;
- OPTIMIZATION_CFLAGS = "-O4";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-bundle",
@@ -604,7 +602,6 @@
GCC_WARN_UNKNOWN_PRAGMAS = NO;
INFOPLIST_FILE = "breveResearcher-Info.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Screen Savers";
- OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-bundle",
@@ -625,6 +622,7 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_OPTIMIZATION_LEVEL = 4;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
GCC_PREPROCESSOR_DEFINITIONS = MACOSX;
@@ -632,7 +630,6 @@
GCC_WARN_UNKNOWN_PRAGMAS = NO;
INFOPLIST_FILE = "breveResearcher-Info.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Screen Savers";
- OPTIMIZATION_CFLAGS = "-O4";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-bundle",
@@ -663,7 +660,6 @@
INFOPLIST_FILE = "brevePainter-Info.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
MACOSX_DEPLOYMENT_TARGET = 10.1;
- OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-bundle",
@@ -685,6 +681,7 @@
buildSettings = {
COPY_PHASE_STRIP = YES;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_OPTIMIZATION_LEVEL = 4;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
@@ -692,7 +689,6 @@
INFOPLIST_FILE = "brevePainter-Info.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
MACOSX_DEPLOYMENT_TARGET = 10.1;
- OPTIMIZATION_CFLAGS = "-O4";
OTHER_CFLAGS = "";
OTHER_LDFLAGS = (
"-bundle",
View
76 breve/Qt/brqtEngine.cpp
@@ -1,14 +1,39 @@
#include "brqtEngine.h"
-brqtEngine::brqtEngine( const char *inSimulationText, const char *inSimulationName, brqtGLWidget *inGLView ) {
+#include <QApplication>
+
+brqtEngine *brqtEngine::_currentEngine = NULL;
+
+brqtEngine::brqtEngine( const char *inSimulationText, const char *inSimulationName, brqtGLWidget *inGLView, QMenu *inSimulationMenu ) {
_glwidget = inGLView;
+ _currentEngine = this;
+
+ _simulationMenu = inSimulationMenu;
+
_timerDelay = 0;
_engine = brEngineNew();
_glwidget -> setEngine( _engine );
- brAddSearchPath( _engine, "../lib/classes" );
+ brEngineSetUpdateMenuCallback( _engine, updateSimulationMenuCallback );
+ brEngineSetPauseCallback( _engine, pauseCallback );
+ brEngineSetUnpauseCallback( _engine, unpauseCallback );
+
+ QString classPath;
+
+ #ifdef Q_WS_MAC
+
+ classPath = QApplication::applicationDirPath() + "/../Resources/classes";
+
+ #else
+
+ classPath = QApplication::applicationDirPath() + "../lib/classes";
+
+ #endif
+
+
+ brAddSearchPath( _engine, classPath.toAscii().constData() );
brInitFrontendLanguages( _engine );
@@ -20,3 +45,50 @@ brqtEngine::brqtEngine( const char *inSimulationText, const char *inSimulationNa
_error = true;
}
}
+
+brqtEngine::~brqtEngine() {
+ _stop = 1;
+
+ if( _glwidget )
+ _glwidget->setEngine( NULL );
+
+ if( _timerID != -1 )
+ killTimer( _timerID );
+
+ brEngineFree( _engine );
+
+ _currentEngine = NULL;
+}
+
+void brqtEngine::updateSimulationMenu( brInstance *inInstance ) {
+ _simulationMenu -> clear();
+
+ for( int n = 0; n < inInstance -> _menus.size(); n++ ) {
+ brMenuEntry *entry = inInstance -> _menus[ n ];
+ _simulationMenu -> addAction( entry -> title );
+ }
+}
+
+
+
+
+
+/**
+ * Static engine callbacks
+ */
+
+int brqtEngine::pauseCallback() {
+ if( _currentEngine && _currentEngine -> _paused == false )
+ _currentEngine -> togglePaused();
+}
+
+int brqtEngine::unpauseCallback() {
+ if( _currentEngine && _currentEngine -> _paused == true )
+ _currentEngine -> togglePaused();
+}
+
+void brqtEngine::updateSimulationMenuCallback( brInstance *inInstance ) {
+ if( _currentEngine )
+ _currentEngine -> updateSimulationMenu( inInstance );
+}
+
View
27 breve/Qt/brqtEngine.h
@@ -3,24 +3,15 @@
#define BRQTENGINE
#include "brqtGLWidget.h"
-
#include "kernel.h"
+#include <QMenu>
+
class brqtEngine : public QObject {
public:
- brqtEngine( const char *inSimulationText, const char *inSimulationName, brqtGLWidget *inGLView );
+ brqtEngine( const char *inSimulationText, const char *inSimulationName, brqtGLWidget *inGLView, QMenu *inSimMenu );
- ~brqtEngine() {
- _stop = 1;
-
- if( _glwidget )
- _glwidget->setEngine( NULL );
-
- if( _timerID != -1 )
- killTimer( _timerID );
-
- brEngineFree( _engine );
- }
+ ~brqtEngine();
void timerEvent( QTimerEvent* ) {
brEngineIterate( _engine );
@@ -57,6 +48,12 @@ class brqtEngine : public QObject {
}
private:
+ static int pauseCallback();
+ static int unpauseCallback();
+ static void updateSimulationMenuCallback( brInstance *inObject );
+
+ void updateSimulationMenu( brInstance *inObject );
+
int _timerID;
bool _stop;
bool _paused;
@@ -64,6 +61,10 @@ class brqtEngine : public QObject {
int _timerDelay;
bool _error;
+
+ QMenu* _simulationMenu;
+
+ static brqtEngine* _currentEngine;
};
#endif
View
6 breve/Qt/brqtMainWindow.cpp
@@ -253,7 +253,7 @@ void brqtMainWindow::toggleSimulation() {
printf( "%s\n", params );
- _engine = new brqtEngine( str, window -> windowTitle().toAscii().constData(), _ui.glWidget );
+ _engine = new brqtEngine( str, window -> windowTitle().toAscii().constData(), _ui.glWidget, _ui.menuSimulation );
slFree( str );
@@ -298,5 +298,7 @@ void brqtMainWindow::updateSimulationPopup() {
for( int n = 0; n < _documents.size(); n++ )
_ui.simulationPopup -> addItem( _documents[ n ] -> windowTitle(), QVariant( _documents[ n ] ) );
- // _ui.simulationPopup -> activated( _documents.size() - 1 );
+ _ui.simulationPopup -> setCurrentIndex( _documents.size() - 1 );
}
+
+
View
1 breve/configure.ac
@@ -335,6 +335,7 @@ if test "x$engine_only" = "x"; then
AC_CHECK_LIB([termcap], [tputs])
AC_CHECK_LIB([history], [add_history])
AC_CHECK_LIB([readline], [readline])
+ AC_CHECK_LIB([obj], [main])
AC_CHECK_LIB([freetype], [FT_Init_FreeType])
View
10 breve/demos/Push/PushTest.tz
@@ -35,11 +35,15 @@ Object : PushTest {
interpreter add-instruction for-instance self for-method "callback" named "CALLBACK-TEST".
+ to test-set-from-list:
- code = ( new PushProgram parse program "( INTEGER./ 1 1 1 1 1 1 1 1)" ).
+ code = ( new PushProgram parse program "( ( INTEGER./ 1 1 1 1 1 1 1 1) )" ).
- code2 set-from code-list { "X", code, "Y", code, "Z", code }.
+ code2 copy-from program code.
+ # code2 set-from code-list { "X", code, "Y", code, "Z", code }.
- code mutate with-interpreter interpreter.
+ code2 mutate with-interpreter interpreter.
+ code2 mutate with-interpreter interpreter.
+ code2 mutate with-interpreter interpreter.
+ code2 mutate with-interpreter interpreter.
print "c2: ", (code2 get-string).
print "c1: ", (code get-string).
View
2 breve/lib/classes/breve/Shape.py
@@ -121,7 +121,7 @@ def setMass( self, newMass ):
def setInertiaMatrix( self, newInertia ):
'''Sets the 3x3 matrix representing the shape's inertia. Appropriate intertia matrices are automatically computed for all shapes, so this method is for advanced customization only. Any calls that change the shape's density, mass or structure will recompute the inertia matrix, so this method should be called only after the final structure, mass and density of the shape have been set.'''
- breve.breveInternalFunctionFinder.shapeSetInertiaMatrix( shapePointer, newInertia )
+ breve.breveInternalFunctionFinder.shapeSetInertiaMatrix( self, self.shapePointer, newInertia )
breve.Shape = Shape
View
4 breve/plugins/slQTMusicPlugin/QTInstrumentFunctions.cc
@@ -168,8 +168,6 @@ int brQTInstrumentStopNote( brEval args[], brEval *result, void *i ) {
return EC_OK;
}
-extern "C" {
-
void slInitQTInstrumentFuncs( void *n ) {
brNewBreveCall( n, "instrumentNew", brQTInstrumentNew, AT_POINTER, AT_INT, 0 );
brNewBreveCall( n, "instrumentFree", brQTInstrumentFree, AT_NULL, AT_POINTER, 0 );
@@ -179,5 +177,3 @@ void slInitQTInstrumentFuncs( void *n ) {
brNewBreveCall( n, "instrumentPlayChord", brQTInstrumentPlayChord, AT_NULL, AT_POINTER, AT_LIST, AT_INT, AT_DOUBLE, 0 );
brNewBreveCall( n, "instrumentSetController", brQTInstrumentSetController, AT_NULL, AT_POINTER, AT_INT, AT_INT, 0 );
}
-
-}
View
29 breve/simulation/shadowvolume.cc
@@ -120,12 +120,11 @@ void slSphere::drawShadowVolume( slCamera *c, slPosition *p ) {
#if 0
slVector light, lNormal, x1, x2, lastV;
- int n, first = 1;
+ int n;
double diff;
int divisions;
static int inited;
-
static float sineTable[361], cosineTable[361];
slVectorSub( &c->_lights[0]._location, &p->location, &light );
@@ -150,8 +149,6 @@ void slSphere::drawShadowVolume( slCamera *c, slPosition *p ) {
slVectorNormalize( &x1 );
slVectorNormalize( &x2 );
- glBegin( GL_QUADS );
-
divisions = ( int )( _radius * 5.0 );
if ( divisions < MIN_SPHERE_VOLUME_DIVISIONS )
@@ -171,18 +168,25 @@ void slSphere::drawShadowVolume( slCamera *c, slPosition *p ) {
diff = 2.0 * M_PI / ( double )divisions;
- int step = ( 360 / divisions );
+ double step = ( 360.0f / divisions );
- for ( n = 0;n < divisions + 1;n++ ) {
+ glBegin( GL_QUADS );
+
+ for ( n = 0; n < divisions + 1; n++ ) {
slVector dx, dy, v, vBottom, lBottom;
- slVectorMul( &x1, _radius * cosineTable[ n * step], &dx );
- slVectorMul( &x2, _radius * sineTable[n * step], &dy );
+ // make the last index line up with the first -- otherwise, rounding
+ // error can make it so that the rays don't line up.
+
+ int index = ( n == divisions ) ? 0 : (int)( n * step );
+
+ slVectorMul( &x1, _radius * cosineTable[ index ], &dx );
+ slVectorMul( &x2, _radius * sineTable[ index ], &dy );
slVectorAdd( &p->location, &dx, &v );
slVectorAdd( &v, &dy, &v );
- if ( !first ) {
+ if ( n != 0 ) {
slVectorSub( &v, &light, &vBottom );
slVectorSub( &lastV, &light, &lBottom );
@@ -192,8 +196,6 @@ void slSphere::drawShadowVolume( slCamera *c, slPosition *p ) {
glVertex3f( v.x, v.y, v.z );
}
- first = 0;
-
slVectorCopy( &v, &lastV );
}
@@ -204,8 +206,9 @@ void slSphere::drawShadowVolume( slCamera *c, slPosition *p ) {
for ( n = 0;n < divisions + 1;n++ ) {
slVector dx, dy, v;
- slVectorMul( &x1, _radius * cosineTable[ n * step], &dx );
- slVectorMul( &x2, _radius * sineTable[n * step], &dy );
+ int index = ( n == divisions ) ? 0 : (int)( n * step );
+ slVectorMul( &x1, _radius * cosineTable[ index ], &dx );
+ slVectorMul( &x2, _radius * sineTable[ index ], &dy );
slVectorAdd( &p->location, &dx, &v );
slVectorAdd( &v, &dy, &v );

0 comments on commit 86d34b5

Please sign in to comment.
Something went wrong with that request. Please try again.