glu-cylinder

Name

glu-cylinder -- A 3D GLobject cylinder based on gluquad.

Synopsis


#include <ogltk/glu_cylinder.h>


struct      glu_cylinder;
enum        eGluCylinderCap;
GLobject*   glu_cylinder_new                (gdouble base,
                                             gdouble top,
                                             gdouble height,
                                             gint slices,
                                             gint loops);
gboolean    glu_cylinder_set_base           (glu_cylinder *cylinder,
                                             gdouble base);
gboolean    glu_cylinder_set_top            (glu_cylinder *cylinder,
                                             gdouble top);
gboolean    glu_cylinder_set_height         (glu_cylinder *cylinder,
                                             gdouble height);
gboolean    glu_cylinder_set_slices         (glu_cylinder *cylinder,
                                             gint slices);
gboolean    glu_cylinder_set_loops          (glu_cylinder *cylinder,
                                             gint loops);
gboolean    glu_cylinder_set_cap            (glu_cylinder *cylinder,
                                             eGluCylinderCap cap);
gdouble     glu_cylinder_get_base           (glu_cylinder *cylinder);
gdouble     glu_cylinder_get_top            (glu_cylinder *cylinder);
gdouble     glu_cylinder_get_height         (glu_cylinder *cylinder);
gint        glu_cylinder_get_slices         (glu_cylinder *cylinder);
gint        glu_cylinder_get_loops          (glu_cylinder *cylinder);
eGluCylinderCap glu_cylinder_get_cap        (glu_cylinder *cylinder);

Description

Details

struct glu_cylinder

struct glu_cylinder {

    glo_gluquad             parent_instance;
    gdouble                 base;
    gdouble                 top;
    gdouble                 height;
    gint                    slices;
    gint                    loops;
    eGluCylinderCap         cap;
    
};


enum eGluCylinderCap

typedef enum
{
    GLU_CYLINDER_CAP_NONE,
    
    GLU_CYLINDER_CAP_TOP,
        
    GLU_CYLINDER_CAP_LAST

}eGluCylinderCap;


glu_cylinder_new ()

GLobject*   glu_cylinder_new                (gdouble base,
                                             gdouble top,
                                             gdouble height,
                                             gint slices,
                                             gint loops);

Create an instance of GLobject of type gluquad/cylinder.

base :

Set the base size.

top :

Set the top size.

height :

Set the height.

slices :

Set the number of sides.

loops :

Set the number of segments along z-axis.

Returns :

A new instance of gluquad/cylinder.


glu_cylinder_set_base ()

gboolean    glu_cylinder_set_base           (glu_cylinder *cylinder,
                                             gdouble base);

Set the base size of the cylinder.

cylinder :

gluquad Cylinder Object.

base :

Base size of cylinder.

Returns :

True if set.


glu_cylinder_set_top ()

gboolean    glu_cylinder_set_top            (glu_cylinder *cylinder,
                                             gdouble top);

Set the top size of the cylinder.

cylinder :

gluquad Cylinder Object.

top :

Top size of cylinder.

Returns :

True if set.


glu_cylinder_set_height ()

gboolean    glu_cylinder_set_height         (glu_cylinder *cylinder,
                                             gdouble height);

Set the height of the cylinder.

cylinder :

gluquad Cylinder Object.

height :

Hieght of cylinder.

Returns :

True if set.


glu_cylinder_set_slices ()

gboolean    glu_cylinder_set_slices         (glu_cylinder *cylinder,
                                             gint slices);

Set the number of slices which make up the cylinder.

cylinder :

gluquad Cylinder Object.

slices :

Number of slices which make up the cylinder.

Returns :

True if set.


glu_cylinder_set_loops ()

gboolean    glu_cylinder_set_loops          (glu_cylinder *cylinder,
                                             gint loops);

Set the number of segments which make up the cylinder along the z-axis.

cylinder :

gluquad Cylinder Object.

loops :

Number of segments along z-axis.

Returns :

True if set.


glu_cylinder_set_cap ()

gboolean    glu_cylinder_set_cap            (glu_cylinder *cylinder,
                                             eGluCylinderCap cap);

Place a cap on the cylinder (So you can't see through the ends. Note: This only works for one end of the cylinder for now. (FIXME)

cylinder :

gluquad Cylinder Object.

cap :

End which has a cap put on it.

Returns :

True if cap was set.


glu_cylinder_get_base ()

gdouble     glu_cylinder_get_base           (glu_cylinder *cylinder);

Get the base size of the cylinder.

cylinder :

gluquad Cylinder Object.

Returns :

Base size of cylinder.


glu_cylinder_get_top ()

gdouble     glu_cylinder_get_top            (glu_cylinder *cylinder);

Get the top size of the cylinder.

cylinder :

gluquad Cylinder Object.

Returns :

Top size of cylinder.


glu_cylinder_get_height ()

gdouble     glu_cylinder_get_height         (glu_cylinder *cylinder);

Get the height of the cylinder.

cylinder :

gluquad Cylinder Object.

Returns :

Height of cylinder.


glu_cylinder_get_slices ()

gint        glu_cylinder_get_slices         (glu_cylinder *cylinder);

Get the number of slices which make up the cylinder.

cylinder :

gluquad Cylinder Object.

Returns :

Number of slices.


glu_cylinder_get_loops ()

gint        glu_cylinder_get_loops          (glu_cylinder *cylinder);

Get the number of segments which make up the cylinder..

cylinder :

gluquad Cylinder Object.

Returns :

Number of segments.


glu_cylinder_get_cap ()

eGluCylinderCap glu_cylinder_get_cap        (glu_cylinder *cylinder);

Get were the caps are put on the cylinder. Note : (FIXME) Will only return top cuz that is the only place where it works right now.

cylinder :

gluquad Cylinder Object.

Returns :

eGluCylinderCap