Skip to content

Commit

Permalink
Merge branch 'hotfix/0.9.0c'
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter committed Aug 11, 2015
2 parents 08a83df + 5638b6b commit f389cb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/fab/inc/fab/types/shape.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@

#include "fab/tree/tree.h"

typedef std::tuple<int,int,int> int3;

/** Represents a math expression and a set of bounds. */
struct Shape
{
/* Constructor throws fab::ParseError if parsing fails. */
Shape(std::string math="=1;", Bounds bounds=Bounds(),
std::tuple<int,int,int> color={-1,-1,-1});
int3 color=int3(-1,-1,-1));

/* Simpler constructor that can be wrapped by Boost */
Shape(std::string math, Bounds bounds, int r, int g, int b);
Expand Down
4 changes: 2 additions & 2 deletions lib/fab/src/types/shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
using namespace boost::python;

Shape::Shape(std::string math, Bounds bounds, int r, int g, int b)
: Shape(math, bounds, {r,g,b})
: Shape(math, bounds, int3(r,g,b))
{
// Nothing to do here
}

Shape::Shape(std::string math, Bounds bounds, std::tuple<int,int,int> color)
Shape::Shape(std::string math, Bounds bounds, int3 color)
: math(math), bounds(bounds), tree(parse(math.c_str()), free_tree),
r(std::get<0>(color)), g(std::get<1>(color)), b(std::get<2>(color))
{
Expand Down

0 comments on commit f389cb3

Please sign in to comment.