Module gwy :: Class Shader
[hide private]
[frames] | no frames]

Class Shader

source code

Instance Methods [hide private]
 
__init__(gradient)
Creates a new spherical shader.
source code
 
get_theta()
Returns the theta coordinate of a shader.
source code
 
get_phi()
Returns the phi coordinate of a shader.
source code
 
set_theta(theta)
Sets the theta coordinate of a shader.
source code
 
set_phi(phi)
Sets the phi coordinate of a shader.
source code
 
set_angle(theta, phi)
Sets the spherical angle of a shader.
source code
 
get_gradient()
Returns the name of color gradient a shader uses.
source code
 
set_gradient(gradient)
Sets the gradient a shader uses.
source code
 
get_update_policy()
Returns the update policy of a shader.
source code
 
set_update_policy(update_policy)
Sets the update policy of a shader.
source code
Method Details [hide private]

__init__(gradient)
(Constructor)

source code 

Creates a new spherical shader.

The widget takes up all the space allocated for it.

Parameters:
  • gradient - Name of gradient to color the spehere with. Can be None to use the default gradient. (string)
Returns:
The new shader as a GtkWidget. (gtk.Widget)

get_theta()

source code 

Returns the theta coordinate of a shader.

Returns:
The theta coordinate, in radians. Theta coordinate is angle from sphere's north pole. (float)

get_phi()

source code 

Returns the phi coordinate of a shader.

Returns:
The phi coordinate, in radians. Phi coordinate is orientation in horizontal plane, measured from x axis, counterclockwise. (float)

set_theta(theta)

source code 

Sets the theta coordinate of a shader.

Parameters:
  • theta - The theta coordinate to set. See Shader.get_theta() for description. (float)

set_phi(phi)

source code 

Sets the phi coordinate of a shader.

Parameters:
  • phi - The phi coordinate to set. See Shader.get_phi() for description. (float)

set_angle(theta, phi)

source code 

Sets the spherical angle of a shader.

Parameters:
  • theta - The theta coordinate to set. See Shader.get_theta() for description. (float)
  • phi - The phi coordinate to set. See Shader.get_phi() for description. (float)

get_gradient()

source code 

Returns the name of color gradient a shader uses.

Returns:
The gradient name. It must not be modified or freed. It may differ the name that was used on initialization or set with Shader.set_gradient(), if the gradient didn't exist or was renamed meanwhile. (string)

set_gradient(gradient)

source code 

Sets the gradient a shader uses.

Parameters:
  • gradient - Name of gradient shader should use. It should exist. (string)

get_update_policy()

source code 

Returns the update policy of a shader.

Returns:
The update policy. (GtkUpdateType)

set_update_policy(update_policy)

source code 

Sets the update policy of a shader.

Parameters:
  • update_policy - The update policy shader should use. (GtkUpdateType)