Gtk3dcanvasItem

Name

Gtk3dcanvasItem -- Ancestor of all item types.

Synopsis


#include <gtk-3dcanvas.h>


struct      Gtk3dcanvasItem;
Gtk3dcanvasItem* gtk_3dcanvas_item_new      (Gtk3dcanvasGroup *parent,
                                             GType type,
                                             const gchar *first_arg_name,
                                             ...);
int         gtk_3dcanvas_item_add_point     (Gtk3dcanvasItem *item,
                                             float x,
                                             float y,
                                             float z,
                                             float norm_x,
                                             float norm_y,
                                             float norm_z);
void        gtk_3dcanvas_item_add_index     (Gtk3dcanvasItem *item,
                                             int index);
void        gtk_3dcanvas_item_compute_extents
                                            (Gtk3dcanvasItem *item);
void        gtk_3dcanvas_item_dump          (Gtk3dcanvasItem *item);
void        gtk_3dcanvas_item_empty         (Gtk3dcanvasItem *item);

Object Hierarchy


  GObject
   +----GtkObject
         +----Gtk3dcanvasItem

Properties


  "parent"               Gtk3dcanvasGroup     : Read / Write / Construct
  "type"                 gint                 : Read / Write / Construct
  "color"                gchararray           : Read / Write / Construct

Description

This type should not be used directly, and its childs (Gtk3dCanvasBall, etc) should be prefered. The methods here should be seen as internal ones, for the implementation of these childs.

If you insist, to use Gtk3dCanvasItem, you should create it using gtk_3dcanvas_item_new(), then add some points on it using gtk_3dcanvas_item_add_point(), and finally link the points using gtk_3dcanvas_item_add_index().

Details

struct Gtk3dcanvasItem

struct Gtk3dcanvasItem;

The fields of the Gtk3dcanvasItem are private, and should be accessed only through the properties and functions below.


gtk_3dcanvas_item_new ()

Gtk3dcanvasItem* gtk_3dcanvas_item_new      (Gtk3dcanvasGroup *parent,
                                             GType type,
                                             const gchar *first_arg_name,
                                             ...);

Allocates an gtk_3dcanvas item. Once it is created, you have to fill it using add_point and add_index functions.

You may find easier to use a child of gtk_3dcanvas_item instead of this.

parent :

the group in which this item should be placed

type :

The object type of the item.

first_arg_name :

A list of object argument name/value pairs, NULL-terminated, used to configure the item. For example, "color", "00BB00", "type", GL_QUAD_STRIP, NULL.

... :

Rest of this list

Returns :

the newly allocated item


gtk_3dcanvas_item_add_point ()

int         gtk_3dcanvas_item_add_point     (Gtk3dcanvasItem *item,
                                             float x,
                                             float y,
                                             float z,
                                             float norm_x,
                                             float norm_y,
                                             float norm_z);

Add a point to a previously allocated object.

This can be viewed as an internal function for gtk_3dcanvas_item childs, but was made public just in case you know what you do.

item :

self

x :

x of the point to add

y :

y of the point to add

z :

z of the point to add

norm_x :

the normal along x of the point

norm_y :

the normal along y of the point

norm_z :

the normal along z of the point

Returns :

the index of the created point in the item.


gtk_3dcanvas_item_add_index ()

void        gtk_3dcanvas_item_add_index     (Gtk3dcanvasItem *item,
                                             int index);

Add an index to a previously allocated item.

This can be viewed as an internal function for gtk_3dcanvas_item childs, but was made public just in case you know what you do.

item :

self

index :

the index to add


gtk_3dcanvas_item_compute_extents ()

void        gtk_3dcanvas_item_compute_extents
                                            (Gtk3dcanvasItem *item);

Only needed if you remove points from the item, since adding point updates the extents automatically. But how could you remove points?

item :

self


gtk_3dcanvas_item_dump ()

void        gtk_3dcanvas_item_dump          (Gtk3dcanvasItem *item);

Dump an item to stdout for debugging purpose

item :

what to dump


gtk_3dcanvas_item_empty ()

void        gtk_3dcanvas_item_empty         (Gtk3dcanvasItem *item);

Remove all the previously added points and index from that item.

This can be viewed as an internal function for gtk_3dcanvas_item childs, but was made public just in case you know what you do.

item :

self

Properties

"parent" (Gtk3dcanvasGroup : Read / Write / Construct)

"type" (gint : Read / Write / Construct)

"color" (gchararray : Read / Write / Construct)