Example #1
0
void Brush_ConstructPrefab(Brush& brush, EBrushPrefab type, const AABB& bounds, std::size_t sides, const std::string& shader, const TextureProjection& projection)
{
  switch(type)
  {
  case eBrushCuboid:
    {
      UndoableCommand undo("brushCuboid");

      Brush_ConstructCuboid(brush, bounds, shader, projection);
    }
    break;
  case eBrushPrism:
    {
      int axis = GetViewAxis();
	  std::ostringstream command;
      command << c_brushPrism_name << " -sides " << sides << " -axis " << axis;
      UndoableCommand undo(command.str());

      Brush_ConstructPrism(brush, bounds, sides, axis, shader, projection);
    }
    break;
  case eBrushCone:
    {
      std::ostringstream command;
      command << c_brushCone_name << " -sides " << sides;
      UndoableCommand undo(command.str());

      Brush_ConstructCone(brush, bounds, sides, shader, projection);
    }
    break;
  case eBrushSphere:
    {
      std::ostringstream command;
      command << c_brushSphere_name << " -sides " << sides;
      UndoableCommand undo(command.str());

      Brush_ConstructSphere(brush, bounds, sides, shader, projection);
    }
    break;

    default:
        break;
  }
}
Example #2
0
void Brush_ConstructPrefab(Brush& brush, EBrushPrefab type, const AABB& bounds, std::size_t sides, const char* shader, const TextureProjection& projection)
{
  switch(type)
  {
  case eBrushCuboid:
    {
      UndoableCommand undo("brushCuboid");

      Brush_ConstructCuboid(brush, bounds, shader, projection);
    }
    break;
  case eBrushPrism:
    {
      int axis = GetViewAxis();
      StringOutputStream command;
      command << c_brushPrism_name << " -sides " << Unsigned(sides) << " -axis " << axis;
      UndoableCommand undo(command.c_str());

      Brush_ConstructPrism(brush, bounds, sides, axis, shader, projection);
    }
    break;
  case eBrushCone:
    {
      StringOutputStream command;
      command << c_brushCone_name << " -sides " << Unsigned(sides);
      UndoableCommand undo(command.c_str());

      Brush_ConstructCone(brush, bounds, sides, shader, projection);
    }
    break;
  case eBrushSphere:
    {
      StringOutputStream command;
      command << c_brushSphere_name << " -sides " << Unsigned(sides);
      UndoableCommand undo(command.c_str());

      Brush_ConstructSphere(brush, bounds, sides, shader, projection);
    }
    break;
  }
}