![]() |
![]() |
![]() |
Gwyddion Widgets Library Reference Manual | ![]() |
---|
Gwy3DViewGwy3DView — OpenGL 3D data display |
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);
"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
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.
typedef struct { GtkWidgetClass parent_class; gpointer list_pool; gpointer reserved1; /* reserved for future use (signals) */ gpointer reserved2; gpointer reserved3; gpointer reserved4; } Gwy3DViewClass;
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. |
const gchar* gwy_3d_view_get_data_key (Gwy3DView *gwy3dview);
gwy3dview : | |
Returns : |
void gwy_3d_view_set_data_key (Gwy3DView *gwy3dview, const gchar *key);
gwy3dview : | |
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. |
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. |
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. |
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. |
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 |
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. |
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. |
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. |
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 |
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 |
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. |
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 |
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. |
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. |
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. |
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. |
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. |
Gwy3DLabel* gwy_3d_view_get_label (Gwy3DView *gwy3dview, Gwy3DViewLabel label);
gwy3dview : | |
label : | |
Returns : |
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. |
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. |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
"movement-type" Gwy3DMovement : Read / Write
The :movement-type property represents type of action on user pointer drag.
Default value: GWY_3D_MOVEMENT_NONE
"projection" Gwy3DProjection : Read / Write
The :projection property represents type of 3D to 2D projection.
Default value: GWY_3D_PROJECTION_ORTHOGRAPHIC
"reduced-size" guint : Read / Write
The size of downsampled data in quick view.
Allowed values: [4,4096]
Default value: 100
"show-axes" gboolean : Read / Write
The :show-axes property determines whether axes around data are shown.
Default value: TRUE
"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
"visualization" Gwy3DVisualization : Read / Write
The type of data visualization.
Default value: GWY_3D_VISUALIZATION_GRADIENT
<< 3D Widgets | Gwy3DWindow >> |