Gwy3DView

Gwy3DView — OpenGL 3D data display

Synopsis




            Gwy3DView;
            Gwy3DViewClass;
GtkWidget*  gwy_3d_view_new                 (GwyContainer *data);
const gchar* gwy_3d_view_get_data_key       (Gwy3DView *gwy3dview);
void        gwy_3d_view_set_data_key        (Gwy3DView *gwy3dview,
                                             const gchar *key);
const gchar* gwy_3d_view_get_gradient_key   (Gwy3DView *gwy3dview);
void        gwy_3d_view_set_gradient_key    (Gwy3DView *gwy3dview,
                                             const gchar *key);
const gchar* gwy_3d_view_get_material_key   (Gwy3DView *gwy3dview);
void        gwy_3d_view_set_material_key    (Gwy3DView *gwy3dview,
                                             const gchar *key);
Gwy3DMovement gwy_3d_view_get_movement_type (Gwy3DView *gwy3dview);
void        gwy_3d_view_set_movement_type   (Gwy3DView *gwy3dview,
                                             Gwy3DMovement movement);
Gwy3DProjection gwy_3d_view_get_projection  (Gwy3DView *gwy3dview);
void        gwy_3d_view_set_projection      (Gwy3DView *gwy3dview,
                                             Gwy3DProjection projection);
gboolean    gwy_3d_view_get_show_axes       (Gwy3DView *gwy3dview);
void        gwy_3d_view_set_show_axes       (Gwy3DView *gwy3dview,
                                             gboolean show_axes);
gboolean    gwy_3d_view_get_show_labels     (Gwy3DView *gwy3dview);
void        gwy_3d_view_set_show_labels     (Gwy3DView *gwy3dview,
                                             gboolean show_labels);
Gwy3DVisualization gwy_3d_view_get_visualization
                                            (Gwy3DView *gwy3dview);
void        gwy_3d_view_set_visualization   (Gwy3DView *gwy3dview,
                                             Gwy3DVisualization visual);
guint       gwy_3d_view_get_reduced_size    (Gwy3DView *gwy3dview);
void        gwy_3d_view_set_reduced_size    (Gwy3DView *gwy3dview,
                                             guint reduced_size);
GdkPixbuf*  gwy_3d_view_get_pixbuf          (Gwy3DView *gwy3dview);
Gwy3DLabel* gwy_3d_view_get_label           (Gwy3DView *gwy3dview,
                                             Gwy3DViewLabel label);
GwyContainer* gwy_3d_view_get_data          (Gwy3DView *gwy3dview);
void        gwy_3d_view_reset_view          (Gwy3DView *gwy3dview);
GtkAdjustment* gwy_3d_view_get_rot_x_adjustment
                                            (Gwy3DView *gwy3dview);
GtkAdjustment* gwy_3d_view_get_rot_y_adjustment
                                            (Gwy3DView *gwy3dview);
GtkAdjustment* gwy_3d_view_get_view_scale_adjustment
                                            (Gwy3DView *gwy3dview);
GtkAdjustment* gwy_3d_view_get_z_deformation_adjustment
                                            (Gwy3DView *gwy3dview);
GtkAdjustment* gwy_3d_view_get_light_z_adjustment
                                            (Gwy3DView *gwy3dview);
GtkAdjustment* gwy_3d_view_get_light_y_adjustment
                                            (Gwy3DView *gwy3dview);
gdouble     gwy_3d_view_get_max_view_scale  (Gwy3DView *gwy3dview);
gdouble     gwy_3d_view_get_min_view_scale  (Gwy3DView *gwy3dview);
void        gwy_3d_view_set_max_view_scale  (Gwy3DView *gwy3dview,
                                             gdouble new_max_scale);
void        gwy_3d_view_set_min_view_scale  (Gwy3DView *gwy3dview,
                                             gdouble new_min_scale);

Object Hierarchy


  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----Gwy3DView

Implemented Interfaces

Gwy3DView implements AtkImplementorIface.

Properties


  "movement-type"        Gwy3DMovement         : Read / Write
  "projection"           Gwy3DProjection       : Read / Write
  "reduced-size"         guint                 : Read / Write
  "show-axes"            gboolean              : Read / Write
  "show-labels"          gboolean              : Read / Write
  "visualization"        Gwy3DVisualization    : Read / Write

Description

Gwy3DView displays a data field as a threedimensional heightfield using OpenGL. You can create a new 3D view for a data container with gwy_3d_view_new(). By default, it inherits properties like palette from data view settings, but supports separate settings -- see gwy_3d_view_set_palette() et al.

Gwy3DView allows the user to interactively rotate, scale, z-scale the data or move lights, depending on its movement state. There are no controls provided for mode change, you have to provide some yourself and set the movement mode with gwy_3d_view_set_movement_type(). There are GtkAdjustment's for each view parameter, you can fetch them with gwy_3d_view_get_rot_x_adjustment(), gwy_3d_view_get_rot_y_adjustment(), etc.

You have initialize GtkGLExt with gtk_gl_init_check() and then Gwyddion's OpenGL with gwy_widgets_gl_init() before you can use Gwy3DView. These functions may not always succeed, see their description for more.

Details

Gwy3DView

typedef struct _Gwy3DView Gwy3DView;


Gwy3DViewClass

typedef struct {
    GtkWidgetClass parent_class;

    gpointer list_pool;

    gpointer reserved1;             /* reserved for future use (signals) */
    gpointer reserved2;
    gpointer reserved3;
    gpointer reserved4;
} Gwy3DViewClass;


gwy_3d_view_new ()

GtkWidget*  gwy_3d_view_new                 (GwyContainer *data);

Creates a new threedimensional OpenGL display of data.

The widget is initialized from container data.

data : A GwyContainer containing the data to display.
Returns : The new OpenGL 3D widget as a GtkWidget.

gwy_3d_view_get_data_key ()

const gchar* gwy_3d_view_get_data_key       (Gwy3DView *gwy3dview);

gwy3dview :
Returns :

gwy_3d_view_set_data_key ()

void        gwy_3d_view_set_data_key        (Gwy3DView *gwy3dview,
                                             const gchar *key);

gwy3dview :
key :

gwy_3d_view_get_gradient_key ()

const gchar* gwy_3d_view_get_gradient_key   (Gwy3DView *gwy3dview);

Gets key identifying color gradient.

gwy3dview : A 3D data view widget.
Returns : The string key, or NULL if it isn't set.

gwy_3d_view_set_gradient_key ()

void        gwy_3d_view_set_gradient_key    (Gwy3DView *gwy3dview,
                                             const gchar *key);

Sets the color gradient to use to visualize data in a 3D view.

gwy3dview : A 3D data view widget.
key : Container string key identifying the color gradient to use for gradient visualization mode.

gwy_3d_view_get_material_key ()

const gchar* gwy_3d_view_get_material_key   (Gwy3DView *gwy3dview);

Gets key identifying GL material.

gwy3dview : A 3D data view widget.
Returns : The string key, or NULL if it isn't set.

gwy_3d_view_set_material_key ()

void        gwy_3d_view_set_material_key    (Gwy3DView *gwy3dview,
                                             const gchar *key);

Sets the GL material to use to visualize data in a 3D view.

gwy3dview : A 3D data view widget.
key : Container string key identifying the color material to use for material visualization mode.

gwy_3d_view_get_movement_type ()

Gwy3DMovement gwy_3d_view_get_movement_type (Gwy3DView *gwy3dview);

Returns a movement type describing actual type of response on the mouse motion event.

gwy3dview : A 3D data view widget.
Returns : actual type of response on the mouse motion event

gwy_3d_view_set_movement_type ()

void        gwy_3d_view_set_movement_type   (Gwy3DView *gwy3dview,
                                             Gwy3DMovement movement);

Sets the type of widget response on the mouse motion event.

gwy3dview : A 3D data view widget.
movement : A new type of response on the mouse motion event.

gwy_3d_view_get_projection ()

Gwy3DProjection gwy_3d_view_get_projection  (Gwy3DView *gwy3dview);

Gets projection a 3D data view uses.

gwy3dview : A 3D data view widget.
Returns : Projection type used by gwy3dview.

gwy_3d_view_set_projection ()

void        gwy_3d_view_set_projection      (Gwy3DView *gwy3dview,
                                             Gwy3DProjection projection);

Sets the type of projection of a 3D data to the screen.

gwy3dview : A 3D data view widget.
projection : Proejction type to use.

gwy_3d_view_get_show_axes ()

gboolean    gwy_3d_view_get_show_axes       (Gwy3DView *gwy3dview);

Returns whether the axes are shown within the widget.

gwy3dview : A 3D data view widget.
Returns : visibility of the axes

gwy_3d_view_set_show_axes ()

void        gwy_3d_view_set_show_axes       (Gwy3DView *gwy3dview,
                                             gboolean show_axes);

Show/hide axes within gwy3dview.

gwy3dview : A 3D data view widget.
show_axes : Show/hide axes

gwy_3d_view_get_show_labels ()

gboolean    gwy_3d_view_get_show_labels     (Gwy3DView *gwy3dview);

Returns whether the axes labels are shown within the gwy3dview. The labels are visible only if show_axes is TRUE.

gwy3dview : A 3D data view widget.
Returns : Whwteher the axes labels are visible.

gwy_3d_view_set_show_labels ()

void        gwy_3d_view_set_show_labels     (Gwy3DView *gwy3dview,
                                             gboolean show_labels);

Show/hide labels of the axes within gwy3dview. Widget is invalidated if necessary. The labels of the axes are visible only if show_axes is TRUE.

gwy3dview : A 3D data view widget.
show_labels : Show/hide axes labels

gwy_3d_view_get_visualization ()

Gwy3DVisualization gwy_3d_view_get_visualization
                                            (Gwy3DView *gwy3dview);

Returns visualization method a 3D view uses.

gwy3dview : A 3D data view widget.
Returns : The visualization type.

gwy_3d_view_set_visualization ()

void        gwy_3d_view_set_visualization   (Gwy3DView *gwy3dview,
                                             Gwy3DVisualization visual);

Sets the visualization type a 3D view should use.

gwy3dview : A 3D data view widget.
visual : Visualization method to use.

gwy_3d_view_get_reduced_size ()

guint       gwy_3d_view_get_reduced_size    (Gwy3DView *gwy3dview);

Returns the size of the downsampled data. The downampled data are used when fast rendering of surface is needed (in the situations like mouse rotations etc.)

gwy3dview : A 3D data view widget.
Returns : The size of the downsampled data.

gwy_3d_view_set_reduced_size ()

void        gwy_3d_view_set_reduced_size    (Gwy3DView *gwy3dview,
                                             guint reduced_size);

Sets the size of the downsampled data. In case of the original data are not square, the reduced_size is the greater size of the downsampled data, the other dimension is proportional to the original size.

If necessary a display list is recreated and widget is invalidated

gwy3dview : A 3D data view widget.
reduced_size : The size of the downsampled data.

gwy_3d_view_get_pixbuf ()

GdkPixbuf*  gwy_3d_view_get_pixbuf          (Gwy3DView *gwy3dview);

Copies the contents of the framebuffer to the GdkPixbuf.

The size of the pixbuf is currently indentical with the size of the widget. xres and yres will be implemented to set the resolution of the pixbuf.

gwy3dview : A 3D data view widget.
Returns : A newly allocated GdkPixbuf with copy of the framebuffer.

gwy_3d_view_get_label ()

Gwy3DLabel* gwy_3d_view_get_label           (Gwy3DView *gwy3dview,
                                             Gwy3DViewLabel label);

gwy3dview :
label :
Returns :

gwy_3d_view_get_data ()

GwyContainer* gwy_3d_view_get_data          (Gwy3DView *gwy3dview);

Returns the data container this 3D view displays.

gwy3dview : A 3D data view widget.
Returns : The container as a GwyContainer.

gwy_3d_view_reset_view ()

void        gwy_3d_view_reset_view          (Gwy3DView *gwy3dview);

Resets angle of the view, scale, deformation ant the position of the light to the "default" values. Invalidates the widget.

gwy3dview : A 3D data view widget.

gwy_3d_view_get_rot_x_adjustment ()

GtkAdjustment* gwy_3d_view_get_rot_x_adjustment
                                            (Gwy3DView *gwy3dview);

Returns a GtkAdjustment with settings of the Phi angle of rotation.

gwy3dview : A 3D data view widget.
Returns : a GtkAdjustment with settings of the Phi angle of rotation

gwy_3d_view_get_rot_y_adjustment ()

GtkAdjustment* gwy_3d_view_get_rot_y_adjustment
                                            (Gwy3DView *gwy3dview);

Returns a GtkAdjustment with settings of the Theta angle of rotation

gwy3dview : A 3D data view widget.
Returns : a GtkAdjustment with settings of the Theta angle of rotation

gwy_3d_view_get_view_scale_adjustment ()

GtkAdjustment* gwy_3d_view_get_view_scale_adjustment
                                            (Gwy3DView *gwy3dview);

Returns a GtkAdjustment with settings of the view zoom

gwy3dview : A 3D data view widget.
Returns : a GtkAdjustment with settings of the view zoom

gwy_3d_view_get_z_deformation_adjustment ()

GtkAdjustment* gwy_3d_view_get_z_deformation_adjustment
                                            (Gwy3DView *gwy3dview);

Returns a GtkAdjustment with settings of the zoom of the z-axis

gwy3dview : A 3D data view widget.
Returns : a GtkAdjustment with settings of the zoom of the z-axis

gwy_3d_view_get_light_z_adjustment ()

GtkAdjustment* gwy_3d_view_get_light_z_adjustment
                                            (Gwy3DView *gwy3dview);

Returns a GtkAdjustment with settings of the Phi angle of light position.

gwy3dview : A 3D data view widget.
Returns : a GtkAdjustment with settings of the Phi angle of light position

gwy_3d_view_get_light_y_adjustment ()

GtkAdjustment* gwy_3d_view_get_light_y_adjustment
                                            (Gwy3DView *gwy3dview);

Returns a GtkAdjustment with settings of the Theta angle of light position.

gwy3dview : A 3D data view widget.
Returns : a GtkAdjustment with settings of the Theta angle of light position

gwy_3d_view_get_max_view_scale ()

gdouble     gwy_3d_view_get_max_view_scale  (Gwy3DView *gwy3dview);

Returns the maximal zoom of the 3D data view

gwy3dview : A 3D data view widget.
Returns : the maximal zoom of the 3D data view

gwy_3d_view_get_min_view_scale ()

gdouble     gwy_3d_view_get_min_view_scale  (Gwy3DView *gwy3dview);

Returns the minimal zoom of the 3D data view

gwy3dview : A 3D data view widget.
Returns : the minimal zoom of the 3D data view

gwy_3d_view_set_max_view_scale ()

void        gwy_3d_view_set_max_view_scale  (Gwy3DView *gwy3dview,
                                             gdouble new_max_scale);

Sets the new maximal zoom of 3D data view. Recommended values are 0.5 - 5.0.

gwy3dview : A 3D data view widget.
new_max_scale : maximal zoom of the 3D data view

gwy_3d_view_set_min_view_scale ()

void        gwy_3d_view_set_min_view_scale  (Gwy3DView *gwy3dview,
                                             gdouble new_min_scale);

Sets the new manimal zoom of 3D data view. Recommended values are 0.5 - 5.0.

gwy3dview : A 3D data view widget.
new_min_scale : minimal zoom of the 3D data view

Properties

The "movement-type" property

  "movement-type"        Gwy3DMovement         : Read / Write

The :movement-type property represents type of action on user pointer drag.

Default value: GWY_3D_MOVEMENT_NONE


The "projection" property

  "projection"           Gwy3DProjection       : Read / Write

The :projection property represents type of 3D to 2D projection.

Default value: GWY_3D_PROJECTION_ORTHOGRAPHIC


The "reduced-size" property

  "reduced-size"         guint                 : Read / Write

The size of downsampled data in quick view.

Allowed values: [4,4096]

Default value: 100


The "show-axes" property

  "show-axes"            gboolean              : Read / Write

The :show-axes property determines whether axes around data are shown.

Default value: TRUE


The "show-labels" property

  "show-labels"          gboolean              : Read / Write

The :show-labels property determines whether axis labels are shown. Note when axes themselves are not shown, neither are labels.

Default value: TRUE


The "visualization" property

  "visualization"        Gwy3DVisualization    : Read / Write

The type of data visualization.

Default value: GWY_3D_VISUALIZATION_GRADIENT

See Also

Gwy3DWindow -- window combining 3D view with controls, GwyGLMaterial -- OpenGL materials