![]() |
![]() |
![]() |
Gwyddion Widgets Library Reference Manual | ![]() |
---|
Gwy3DViewGwy3DView — OpenGL 3D data display |
Gwy3DView; Gwy3DViewClass; GtkWidget* gwy_3d_view_new (GwyContainer *data); void gwy_3d_view_update (Gwy3DView *gwy3dview); const gchar* gwy_3d_view_get_gradient (Gwy3DView *gwy3dview); void gwy_3d_view_set_gradient (Gwy3DView *gwy3dview, const gchar *gradient); 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); const gchar* gwy_3d_view_get_material (Gwy3DView *gwy3dview); void gwy_3d_view_set_material (Gwy3DView *gwy3dview, const gchar *material); 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_status(). 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.
Due to lack of real GwyWatchable implementation in data fields, you have to call gwy_3d_view_update() to instruct the 3D view to update self, when data changes.
typedef struct { GtkWidgetClass parent_class; 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. |
void gwy_3d_view_update (Gwy3DView *gwy3dview);
gwy_3d_view_update is deprecated and should not be used in newly-written code.
Instructs a 3D data view to update self and repaint. Data, palette, etc. are updated from container container. If necessary new downsampled data are created.
The display lists are recreated if the widget is realized. This may take a great amount of processor time (seconds).
gwy3dview : | A 3D data view widget. |
const gchar* gwy_3d_view_get_gradient (Gwy3DView *gwy3dview);
Returns the color gradient a 3D data view uses.
gwy3dview : | A 3D data view widget. |
Returns : | The color gradient. |
void gwy_3d_view_set_gradient (Gwy3DView *gwy3dview, const gchar *gradient);
Sets the color gradient a 3D data view should use.
gwy3dview : | A 3D data view widget. |
gradient : | Name of gradient gwy3dview should use. It should exist. |
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. |
const gchar* gwy_3d_view_get_material (Gwy3DView *gwy3dview);
Returns a name of GL material used to draw data with lights on.
gwy3dview : | A 3D data view widget. |
Returns : | A GL material name as a string owned by the material. |
void gwy_3d_view_set_material (Gwy3DView *gwy3dview, const gchar *material);
Sets the material of the surface.
gwy3dview : | A 3D data view widget. |
material : | A GwyGLMaterial name to render data with lights on. |
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 >> |