// Generated by gtkmmproc -- DO NOT MODIFY!


#include <geglmm/curve.h>
#include <geglmm/private/curve_p.h>

/* libgeglmm - a C++ wrapper for libgegl
 *
 * (c) 2008 Hubert Figuiere
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with GEGL; if not, see <http://www.gnu.org/licenses/>.
 */

namespace
{
} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gegl::Curve> wrap(GeglCurve* object, bool take_copy)
{
  return Glib::RefPtr<Gegl::Curve>( dynamic_cast<Gegl::Curve*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gegl
{


/* The *_Class implementation: */

const Glib::Class& Curve_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &Curve_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gegl_curve_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void Curve_Class::class_init_function(void* g_class, void* class_data)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


}


Glib::ObjectBase* Curve_Class::wrap_new(GObject* object)
{
  return new Curve((GeglCurve*)object);
}


/* The implementation: */

GeglCurve* Curve::gobj_copy()
{
  reference();
  return gobj();
}

Curve::Curve(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

Curve::Curve(GeglCurve* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


Curve::~Curve()
{}


Curve::CppClassType Curve::curve_class_; // initialize static member

GType Curve::get_type()
{
  return curve_class_.init().get_type();
}


GType Curve::get_base_type()
{
  return gegl_curve_get_type();
}


Curve::Curve(double y_min, double y_max)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(curve_class_.init(), "y_min", y_min, "y_max", y_max, static_cast<char*>(0)))
{
  

}

Glib::RefPtr<Curve> Curve::create(double y_min, double y_max)
{
  return Glib::RefPtr<Curve>( new Curve(y_min, y_max) );
}

Glib::RefPtr<Curve> Curve::create_default_curve()
{
  return Glib::wrap(gegl_curve_default_curve());
}


void Curve::get_y_bounds(double & min_y, double & max_y) const
{
gegl_curve_get_y_bounds(const_cast<GeglCurve*>(gobj()), &(min_y), &(max_y)); 
}

guint Curve::add_point(double x, double y)
{
  return gegl_curve_add_point(gobj(), x, y);
}

void Curve::get_point(guint index, double & x, double & y) const
{
gegl_curve_get_point(const_cast<GeglCurve*>(gobj()), index, &(x), &(y)); 
}

void Curve::set_point(guint index, double x, double y)
{
gegl_curve_set_point(gobj(), index, x, y); 
}

guint Curve::num_points() const
{
  return gegl_curve_num_points(const_cast<GeglCurve*>(gobj()));
}

double Curve::calc_value(double x)
{
  return gegl_curve_calc_value(gobj(), x);
}

void Curve::calc_values(double x_min, double x_max, guint num_samples, double & xs, double & ys)
{
gegl_curve_calc_values(gobj(), x_min, x_max, num_samples, &(xs), &(ys)); 
}


} // namespace Gegl


