renderingSpin

renderingSpin — A module able to represent atoms by their position and spin.

Synopsis

#define             VISU_RENDERING_SPIN_MAX_MODULUS_ID
#define             VISU_RENDERING_SPIN_NAME
#define             VISU_RENDERING_SPIN_VALUES_ID
                    VisuRenderingSpin;
                    VisuRenderingSpinClass;
enum                VisuRenderingSpinDrawingPolicy;
enum                VisuRenderingSpinFileType;
enum                VisuRenderingSpinModulusPolicy;
enum                VisuRenderingSpinResources;
enum                VisuRenderingSpinShapeId;
VisuRenderingSpinDrawingPolicy visu_rendering_spin_getHidingPolicyFromName
                                                        (const char *name);
const char *        visu_rendering_spin_getHidingPolicyName
                                                        (VisuRenderingSpinDrawingPolicy n);
const char *        visu_rendering_spin_getHidingPolicyNameI18n
                                                        (VisuRenderingSpinDrawingPolicy n);
void                visu_rendering_spin_getResource     (VisuElement *ele,
                                                         VisuRenderingSpinResources property,
                                                         GValue *val);
gboolean            visu_rendering_spin_getResourceBoolean
                                                        (VisuElement *ele,
                                                         VisuRenderingSpinResources property);
gfloat              visu_rendering_spin_getResourceFloat
                                                        (VisuElement *ele,
                                                         VisuRenderingSpinResources property);
guint               visu_rendering_spin_getResourceUint (VisuElement *ele,
                                                         VisuRenderingSpinResources property);
const char *        visu_rendering_spin_getShapeNameI18n
                                                        (VisuRenderingSpinShapeId n);
VisuRenderingSpin * visu_rendering_spin_new             ();
gboolean            visu_rendering_spin_setResource     (VisuElement *ele,
                                                         VisuRenderingSpinResources property,
                                                         GValue *val);
gboolean            visu_rendering_spin_setResourceBoolean
                                                        (VisuElement *ele,
                                                         VisuRenderingSpinResources property,
                                                         gboolean value);
gboolean            visu_rendering_spin_setResourceFloat
                                                        (VisuElement *ele,
                                                         VisuRenderingSpinResources property,
                                                         gfloat value);
gboolean            visu_rendering_spin_setResourceUint (VisuElement *ele,
                                                         VisuRenderingSpinResources property,
                                                         guint value);

Object Hierarchy

  GObject
   +----VisuRendering
         +----VisuRenderingSpin

Properties

  "cone-omega"               gfloat                : Read / Write
  "cone-phi"                 gfloat                : Read / Write
  "cone-theta"               gfloat                : Read / Write
  "hiding-mode"              guint                 : Read / Write
  "modulus-scaling"          guint                 : Read / Write
  "use-atomic"               gboolean              : Read / Write

Signals

  "colorisationChange"                             : No Hooks

Description

This method draws arrows to represent atoms. Each arrow has a given orientation which is set acording to parameters. This is one way to represent the spin of an atom. These arrows direction are determined by the spin of each atom. It is designed to read two separate files : one containing the position of the atoms, the other containing the spin of each atom. Of course these two files need to have the exact same number of atoms and also need to sort atoms in the same order.

Details

VISU_RENDERING_SPIN_MAX_MODULUS_ID

#define VISU_RENDERING_SPIN_MAX_MODULUS_ID "spinRendering_maxModulus"

This flag should be used when creating a new spin rendering method as the flag for the max modulus values as a VisuNode property (see visu_node_array_property_newPointer()).


VISU_RENDERING_SPIN_NAME

#define VISU_RENDERING_SPIN_NAME "Spin visualisation"

Public name of the spin rendering mode.


VISU_RENDERING_SPIN_VALUES_ID

#define VISU_RENDERING_SPIN_VALUES_ID     "spinRendering_values"

This flag should be used when creating a new spin rendering method as the flag for the spin values as node properties (see visu_node_array_property_newPointer()).


VisuRenderingSpin

typedef struct _VisuRenderingSpin VisuRenderingSpin;

An opaque structure.


VisuRenderingSpinClass

typedef struct _VisuRenderingSpinClass VisuRenderingSpinClass;

An opaque structure.


enum VisuRenderingSpinDrawingPolicy

typedef enum {
    VISU_RENDERING_SPIN_ALWAYS,    
    VISU_RENDERING_SPIN_HIDE_NULL,  
    VISU_RENDERING_SPIN_ATOMIC_NULL,
    VISU_RENDERING_SPIN_N_MODES
} VisuRenderingSpinDrawingPolicy;

Different policy to render the spin when the modulus is null. This policy is applied for all VisuElement.

VISU_RENDERING_SPIN_ALWAYS

Arrows are drawn whatever the modulus value.

VISU_RENDERING_SPIN_HIDE_NULL

Spin with a null modulus are hidden.

VISU_RENDERING_SPIN_ATOMIC_NULL

Follow atomic rendering for null modulus.

VISU_RENDERING_SPIN_N_MODES

a flag to count the number of modes.

enum VisuRenderingSpinFileType

typedef enum {
    FILE_KIND_POSITION,
    FILE_KIND_SPIN
} VisuRenderingSpinFileType;

These are keys for the storing of spin files in a VisuData object.

FILE_KIND_POSITION

define a position file ;

FILE_KIND_SPIN

define a spin description file.

enum VisuRenderingSpinModulusPolicy

typedef enum {
    VISU_RENDERING_SPIN_CONSTANT,    
    VISU_RENDERING_SPIN_PER_TYPE,  
    VISU_RENDERING_SPIN_GLOBAL,
    VISU_RENDERING_SPIN_N_MODULUS_MODES
} VisuRenderingSpinModulusPolicy;

Different policy to render the spin depending on the modulus.

VISU_RENDERING_SPIN_CONSTANT

arrows have all the same size, whatever the modulus value.

VISU_RENDERING_SPIN_PER_TYPE

arrows are scaled per node type.

VISU_RENDERING_SPIN_GLOBAL

arrows are scaled globaly.

VISU_RENDERING_SPIN_N_MODULUS_MODES

a flag to count the number of modes.

enum VisuRenderingSpinResources

typedef enum {
    VISU_RENDERING_SPIN_HAT_LENGTH,
    spin_VISU_RENDERING_SPIN_TAIL_LENGTH,
    VISU_RENDERING_SPIN_HAT_RADIUS,
    VISU_RENDERING_SPIN_TAIL_RADIUS,
    VISU_RENDERING_SPIN_HAT_COLOR,
    VISU_RENDERING_SPIN_TAIL_COLOR,
    VISU_RENDERING_SPIN_A_AXIS,
    VISU_RENDERING_SPIN_B_AXIS,
    VISU_RENDERING_SPIN_ELIPSOID_COLOR,
    VISU_RENDERING_SPIN_SHAPE,
    VISU_RENDERING_SPIN_N_RESOURCES
} VisuRenderingSpinResources;

These are resources defined for each element. They can be accessed with visu_rendering_spin_getResource() or visu_rendering_spin_getResourceBoolean() and other methods of the same kind.

VISU_RENDERING_SPIN_HAT_LENGTH

the length of the pointing element ;

spin_VISU_RENDERING_SPIN_TAIL_LENGTH

the length of the tail ;

VISU_RENDERING_SPIN_HAT_RADIUS

the raidus of the pointing element ;

VISU_RENDERING_SPIN_TAIL_RADIUS

the radius of the tail ;

VISU_RENDERING_SPIN_HAT_COLOR

if TRUE, the pointing part use the color of the element ;

VISU_RENDERING_SPIN_TAIL_COLOR

if TRUE, the tail uses the color of the element ;

VISU_RENDERING_SPIN_A_AXIS

the size of the A axis (elipsoid shape) ;

VISU_RENDERING_SPIN_B_AXIS

the size of the B axis (elipsoid shape) ;

VISU_RENDERING_SPIN_ELIPSOID_COLOR

if TRUE, the elipsoid uses the color of the element ;

VISU_RENDERING_SPIN_SHAPE

an id to defined the shape (rounded arrow, elipsoid...) ;

VISU_RENDERING_SPIN_N_RESOURCES

number of resources per element.

enum VisuRenderingSpinShapeId

typedef enum {
    VISU_RENDERING_SPIN_ARROW_SMOOTH,
    VISU_RENDERING_SPIN_ARROW_SHARP,
    VISU_RENDERING_SPIN_ELLIPSOID,
    VISU_RENDERING_SPIN_TORUS,
} VisuRenderingSpinShapeId;

An identifier for the different shapes to draw elements.

VISU_RENDERING_SPIN_ARROW_SMOOTH

the shape is smooth and rounded ;

VISU_RENDERING_SPIN_ARROW_SHARP

the shape is built on squares ;

VISU_RENDERING_SPIN_ELLIPSOID

the shape is an ellipsoid ;

VISU_RENDERING_SPIN_TORUS

the shape is a torus (direction of the arrow is normal to the torus plane).

VISU_RENDERING_SPIN_N_SHAPES

private.

visu_rendering_spin_getHidingPolicyFromName ()

VisuRenderingSpinDrawingPolicy visu_rendering_spin_getHidingPolicyFromName
                                                        (const char *name);

In the config file, the hiding policy resource is stored with its name (untranslated). This method is used to retrieve the id from the name.

name :

a string. [type filename]

Returns :

the maximum value if the name is invalid.

visu_rendering_spin_getHidingPolicyName ()

const char *        visu_rendering_spin_getHidingPolicyName
                                                        (VisuRenderingSpinDrawingPolicy n);

Transform ids to untranslated names.

n :

an id for hiding policy.

Returns :

the name associated to the id. [type filename]

visu_rendering_spin_getHidingPolicyNameI18n ()

const char *        visu_rendering_spin_getHidingPolicyNameI18n
                                                        (VisuRenderingSpinDrawingPolicy n);

Transform ids to translated names.

n :

an id for hiding policy.

Returns :

the name associated to the id in UTF-8. [type utf8]

visu_rendering_spin_getResource ()

void                visu_rendering_spin_getResource     (VisuElement *ele,
                                                         VisuRenderingSpinResources property,
                                                         GValue *val);

This is a generic method to access resources per element. Use visu_rendering_spin_setResourceBoolean() is favored if the type of the value is known (boolean in this exemple).

ele :

a pointer to a VisuElement object ;

property :

the id of the resource (see VisuRenderingSpinResources);

val :

a location to store the value. [out caller-allocates]

Since 3.7


visu_rendering_spin_getResourceBoolean ()

gboolean            visu_rendering_spin_getResourceBoolean
                                                        (VisuElement *ele,
                                                         VisuRenderingSpinResources property);

This is the specific method to retrieve value of boolean element resources.

ele :

a pointer to a VisuElement object ;

property :

the id of the property to get.

Returns :

the boolean value.

visu_rendering_spin_getResourceFloat ()

gfloat              visu_rendering_spin_getResourceFloat
                                                        (VisuElement *ele,
                                                         VisuRenderingSpinResources property);

This is the specific method to retrieve value of floating point element resources.

ele :

a pointer to a VisuElement object ;

property :

the id of the property to get.

Returns :

the floating point value.

visu_rendering_spin_getResourceUint ()

guint               visu_rendering_spin_getResourceUint (VisuElement *ele,
                                                         VisuRenderingSpinResources property);

This is the specific method to retrieve value of guint element resources.

ele :

a pointer to a VisuElement object ;

property :

the id of the property to get.

Returns :

the guint value.

visu_rendering_spin_getShapeNameI18n ()

const char *        visu_rendering_spin_getShapeNameI18n
                                                        (VisuRenderingSpinShapeId n);

This routine returnes the translated name in UTF-8 corresponding to the given shape id.

n :

an id for spin shape.

Returns :

a string owned by V_Sim. [type utf8]

visu_rendering_spin_new ()

VisuRenderingSpin * visu_rendering_spin_new             ();

Create the structure and initialise its values.

Returns :

a newly allocate VisuRenderingSpin object.

Since 3.6


visu_rendering_spin_setResource ()

gboolean            visu_rendering_spin_setResource     (VisuElement *ele,
                                                         VisuRenderingSpinResources property,
                                                         GValue *val);

The spin rendering method has properties stored for each element. Use this method to change the value of property for ele.

ele :

a VisuElement object.

property :

an id for element property.

val :

the value.

Returns :

TRUE if value is indeed changed.

Since 3.7


visu_rendering_spin_setResourceBoolean ()

gboolean            visu_rendering_spin_setResourceBoolean
                                                        (VisuElement *ele,
                                                         VisuRenderingSpinResources property,
                                                         gboolean value);

This method is used to change element resources that are boolean.

ele :

a pointer to a VisuElement object ;

property :

the id of the property to set ;

value :

its value.

Returns :

TRUE if the value was changed.

visu_rendering_spin_setResourceFloat ()

gboolean            visu_rendering_spin_setResourceFloat
                                                        (VisuElement *ele,
                                                         VisuRenderingSpinResources property,
                                                         gfloat value);

This method is used to change element resources that are floating point.

ele :

a pointer to a VisuElement object ;

property :

the id of the property to set ;

value :

its value.

Returns :

TRUE if the value was changed.

visu_rendering_spin_setResourceUint ()

gboolean            visu_rendering_spin_setResourceUint (VisuElement *ele,
                                                         VisuRenderingSpinResources property,
                                                         guint value);

This method is used to change element resources that are guint.

ele :

a pointer to a VisuElement object ;

property :

the id of the property to set ;

value :

its value.

Returns :

TRUE if the value was changed.

Property Details

The "cone-omega" property

  "cone-omega"               gfloat                : Read / Write

The omega angle to orientate the colourisation cone.

Allowed values: [0,360]

Default value: 0


The "cone-phi" property

  "cone-phi"                 gfloat                : Read / Write

The phi angle to orientate the colourisation cone.

Allowed values: [0,360]

Default value: 0


The "cone-theta" property

  "cone-theta"               gfloat                : Read / Write

The theta angle to orientate the colourisation cone.

Allowed values: [0,180]

Default value: 0


The "hiding-mode" property

  "hiding-mode"              guint                 : Read / Write

The hiding policy for spin with a null modulus.

Allowed values: <= 3

Default value: 0


The "modulus-scaling" property

  "modulus-scaling"          guint                 : Read / Write

The scaling policy based on modulus value.

Allowed values: <= 3

Default value: 0


The "use-atomic" property

  "use-atomic"               gboolean              : Read / Write

If atomic rendering is used in addition to spin rendering.

Default value: FALSE

Signal Details

The "colorisationChange" signal

void                user_function                      (VisuRenderingSpin *render,
                                                        gpointer           user_data)      : No Hooks

This signal is emitted whenever a change occur in the colourisation scheme of the spins.

render :

the object emitting the signal.

user_data :

user data set when the signal handler was connected.

Since 3.6