/*  Copyright (C) 2008--2009 Joshua Judson Rosen <rozzin@geekspace.com>.

    This program is free software: you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    version 3 as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; see the file COPYING. If not, see
    <http://www.gnu.org/licenses/> or write to:

        The Free Software Foundation, inc.
        51 Franklin Street, Fifth Floor
        Boston, MA 02110-1301
        USA
*/

#ifndef VISUALID_METASHAPE_H
#define VISUALID_METASHAPE_H

struct _VisualID_Shape {
  VisualID_Glyph base;

  int n; /* number of objects (power) */

  int ncoef; /* number of coefficients used in generation of fourier series */
  double *coefficients;
  double *points;

  int fourier; /* bool: use fourier series (else FFT) */
  double exponent; /* spectral exponent for FFT filtering */

  gboolean spawn_inside;
  VisualID_Glyph *inside_child;
  double ic_scale;

  gboolean spawn_vertex;
  VisualID_Glyph *outline_child;
  double oc_scale;

  double max_angle; /* i.e.: whether it's a shape or a curve */
};

struct _VisualID_MetashapeClass {
  VisualID_GlyphClass parent_class;
};


#define VISUALID_TYPE_METASHAPE            (visualid_metashape_get_type ())
#define VISUALID_METASHAPE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), VISUALID_TYPE_METASHAPE, VisualID_Metashape))
#define VISUALID_IS_METASHAPE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VISUALID_TYPE_METASHAPE))
#define VISUALID_METASHAPE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), VISUALID_TYPE_METASHAPE, VisualID_Metashape))
#define VISUALID_IS_METASHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VISUALID_TYPE_METASHAPE))
#define VISUALID_METASHAPE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), VISUALID_TYPE_METASHAPE, VisualID_Metashape))

typedef struct _VisualID_Shape VisualID_Metashape;
typedef struct _VisualID_MetashapeClass VisualID_MetashapeClass;

GType visualid_metashape_get_type (void);

/* For internal use: */
void visualid_metashape_exec (VisualID_Metashape *shape, cairo_t *cr);
int visualid_metashape_complexity (VisualID_Metashape *shape, int recurse);
void synth_wave (VisualID_Metashape *self);

#endif

