Skip to content

Commit

Permalink
Merge commit 'sandofsky/master'
Browse files Browse the repository at this point in the history
Made masking avatars optional and fixed spacing
  • Loading branch information
rictic committed Feb 12, 2010
2 parents f1c2a39 + 3a87c09 commit e82e1e5
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 21 deletions.
1 change: 1 addition & 0 deletions data/sample.config
Expand Up @@ -129,3 +129,4 @@ IsInputSorted=true

# OpenGL is experimental. Use at your own risk.
UseOpenGL=false
ShowUserName=true
133 changes: 133 additions & 0 deletions data/twitter.config
@@ -0,0 +1,133 @@
# This is a sample configuration file for code_swarm

# Frame width
Width=1920

# Frame height
Height=1080

# Input file
InputFile=/Volumes/Scratch/projects/twitter_code_swarm/twitter_log.xml

# Particle sprite file
ParticleSpriteFile=src/particle.png

#Font Settings
Font=Helvetica
FontSize=15
BoldFontSize=15

# Project time per frame
#MillisecondsPerFrame=21600000
FramesPerDay=3

# Maximum number of background processes
# Probably no more than 2 per processor needed.
# N.B. If you're taking snapshots, increasing this
# number will noticably increase memory usage.
MaxThreads=6

# Optional Method instead of MillisecondsPerFrame
#FramesPerDay=4

# Background in R,G,B
Background=0,0,0

# Color assignment rules
# Keep in order, do not skip numbers. Numbers start
# at 1.
#
# Pattern: "Label", "regex", R,G,B, R,G,B
# Label is optional. If it is omitted, the regex
# will be used.
#
ColorAssign1="Ruby","app/(models|controllers|helpers).*|lib/.*rb|config/.*|db/.*", 255,20,10, 255,20,10
ColorAssign2="Tests","(test|spec)/.*", 33,255,47, 33,255,47
ColorAssign3="View","app/views/.*|public/.*\.(css|js|jpg|gif|png)", 0,255,255, 0,255,255
ColorAssign4="Libraries","vendor/(plugins|gems|rails).*", 234,38,255, 234,38,255
#ColorAssign5="Javascript","public/.*\.js", 255,255,0, 255,255,0
#ColorAssign6="Images","public/.*(png|jpg|gif", 119,68,119, 119,68,119
#ColorAssign7="Code6",".*src6.*", 136,51,17, 136,51,17
#ColorAssign8="Code7",".*src7.*", 250,110,110, 250,110,130
#ColorAssign9="Code8",".*src8.*", 238,102,68, 238,102,68
#ColorAssign10=".*src9.*", 238,68,119, 238,68,119

# Save each frame to an image?
TakeSnapshots=false

# Where to save each frame
SnapshotLocation=frames/code_swarm-######.png

# Draw names (combinatory) :
# Draw sharp names?
DrawNamesSharp=true
# And draw a glow around names? (Runs slower)
DrawNamesHalos=false

# Draw files (combinatory) :
# Draw sharp files
DrawFilesSharp=false
# Draw fuzzy files
DrawFilesFuzzy=true
# Draw jelly files
DrawFilesJelly=false

# Show the Legend at start
ShowLegend=true

# Show the History at start
ShowHistory=true

# Show the Date at start
ShowDate=true

# Show edges between authors and files, mostly for debug purpose
ShowEdges=false

# Turn on Debug counts.
ShowDebug=false

# Natural distance of files to people
EdgeLength=25

# Amount of life to decrement
EdgeDecrement=-2
FileDecrement=-1
PersonDecrement=-1

#Speeds.
#Optional: NodeSpeed=7.0, If used, FileSpeed and PersonSpeed need not be set.
#
FileSpeed=7.0
PersonSpeed=2.0

#Masses
FileMass=2.0
PersonMass=10.0

# Life of an Edge
EdgeLife=250

# Life of a File
FileLife=250

# Life of a Person
PersonLife=255

# Highlight percent.
# This is the amount of time that the person or
# file will be highlighted.
HighlightPct=5

## Physics engine selection and configuration
# Directory physics engine config files reside in.
PhysicsEngineConfigDir=physics_engine
# Force calculation algorithms ("PhysicsEngineLegacy", "PhysicsEngineSimple"...) :
PhysicsEngineSelection=PhysicsEngineOrderly

#Is the input xml sorted by date? It's faster and uses much less memory if it is
IsInputSorted=true

# OpenGL is experimental. Use at your own risk.
UseOpenGL=true
ShowUserName=false
4 changes: 4 additions & 0 deletions defaults/code_swarm.config
Expand Up @@ -26,6 +26,8 @@ TakeSnapshots=false
# Where to save the frames
SnapshotLocation=code_swarm_frames/#####.png

ShowUserName=true

## How to draw names (choose as many as you like)
# Draw sharp names?
DrawNamesSharp=true
Expand All @@ -40,6 +42,8 @@ DrawFilesFuzzy=true
# Draw jelly files?
DrawFilesJelly=false

CircularAvatars=false

# Show a legend of colors and their labels
ShowLegend=true

Expand Down
61 changes: 61 additions & 0 deletions run.sh
@@ -0,0 +1,61 @@
# run.sh : code_swarm launching script
# need the config file as first parameter

params=$@
default_config="data/sample.config"
code_swarm_jar="dist/code_swarm.jar"

# command line parameters basic check
if [ $# = 0 ]; then
# asking user for a config file
echo "code_swarm project !"
echo -n "Specify a config file, or ENTER for default one [$default_config] : "
read config
if [ ${#config} = 0 ]; then
params=$default_config
else
params=$config
fi
else
if [ $1 == "-h" ] || [ $1 == "--help" ]; then
# if help needed, print it and exit
echo "usage: run.sh <configfile>"
echo ""
echo " data/sample.config is the default config file"
echo ""
exit
else
echo "code_swarm project !"
fi
fi

# checking for code_swarm java binaries
if [ ! -f $code_swarm_jar ]; then
echo "no code_swarm binaries !"
echo "needing to build it with 'ant' and 'javac' (java-sdk)"
echo ""
echo "auto-trying the ant command..."
if ant; then
echo ""
else
echo ""
echo "ERROR, please verify 'ant' and 'java-sdk' installation"
echo -n "press a key to exit"
read key
echo "bye"
exit
fi
fi

# running
#if java -Xmx1000m -classpath dist/code_swarm.jar:lib/core.jar:lib/xml.jar:lib/vecmath.jar:. code_swarm $params; then
if java -Xmx1000m -classpath dist/code_swarm.jar:lib/gluegen-rt.jar:lib/jogl.jar:lib/jogl-natives-macosx-universal.jar:lib/core.jar:lib/opengl.jar:lib/xml.jar:lib/vecmath.jar:. code_swarm $params; then
# always on error due to no "exit buton" on rendering window
echo "bye"
# echo -n "error, press a key to exit"
# read key
else
echo "bye"
fi


2 changes: 2 additions & 0 deletions src/CodeSwarmConfig.java
Expand Up @@ -102,8 +102,10 @@ public class CodeSwarmConfig {
/** Controls where the config files are for the Physical Engine */
public static final String PHYSICS_ENGINE_CONF_DIR = "PhysicsEngineConfigDir";
public static final String IS_INPUT_SORTED_KEY = "IsInputSorted";
public static final String SHOW_USER_NAME_KEY = "ShowUserName";
/** Default regex and rgb values used to match anything not caught in the config file */
public static String DEFAULT_COLOR_ASSIGN = "\"Misc\",\".*\",128,128,128,128,128,128";
public static final String DRAW_CIRCULAR_AVATARS = "CircularAvatars";

private List<Properties> propStack;

Expand Down

0 comments on commit e82e1e5

Please sign in to comment.