v_sim.GlView

g GObject.GInterface GObject.GInterface v_sim.Animatable v_sim.Animatable GObject.GInterface->v_sim.Animatable v_sim.Boxed v_sim.Boxed GObject.GInterface->v_sim.Boxed GObject.Object GObject.Object v_sim.GlView v_sim.GlView GObject.Object->v_sim.GlView v_sim.Animatable->v_sim.GlView v_sim.Boxed->v_sim.GlView

Subclasses:

None

Methods

Inherited:

GObject.Object (37), v_sim.Animatable (6), v_sim.Boxed (2)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_withSize (w, h)

alignToAxis (axis)

getDetailLevel (dimension)

getPrecision ()

getRealCoordinates (xyz, winx, winy, winz)

getZCoordinate (xyz)

initContext ()

rotateBox (dTheta, dPhi)

rotateCamera (dTheta, dPhi)

setGross (value)

setObjectRadius (lg, units)

setPersp (value)

setPrecision (value)

setRefLength (lg, units)

setThetaPhiOmega (valueTheta, valuePhi, valueOmega, mask)

setViewport (width, height)

setXsYs (valueX, valueY, mask)

Virtual Methods

Inherited:

GObject.Object (7), v_sim.Boxed (1)

Properties

Inherited:

v_sim.Boxed (2)

Name

Type

Flags

Short Description

omega

float

r/w

omega angle

perspective

float

r/w

perspective level

phi

float

r/w

phi angle

precision

float

r/w

precision level

theta

float

r/w

theta angle

trans-x

float

r/w

translation along x

trans-y

float

r/w

translation along y

zoom

float

r/w

zoom level

Signals

Inherited:

GObject.Object (1), v_sim.Animatable (1), v_sim.Boxed (1)

Name

Short Description

DetailLevelChanged

Gets emitted when precision of the drawn object has been changed.

RefLengthChanged

Gets emitted when the reference length of the camera has been changed.

WidthHeightChanged

Gets emitted when the viewing frame has been changed.

changed

Gets emitted when the view is changed.

Fields

Inherited:

GObject.Object (1), v_sim.Animatable (1), v_sim.Boxed (1)

Name

Type

Access

Description

camera

v_sim.GlCamera

r

parent

GObject.Object

r

window

v_sim.GlWindow

r

Class Details

class v_sim.GlView(**kwargs)
Bases:

GObject.Object, v_sim.Animatable, v_sim.Boxed

Abstract:

No

Structure:

v_sim.GlViewClass

A container structure to deal with OpenGL observer position, size of rendering viewport…

classmethod new()
Returns:

the newly created object.

Return type:

v_sim.GlView

Create a new v_sim.GlView object with default values.

classmethod new_withSize(w, h)
Parameters:
  • w (int) – the width ;

  • h (int) – the height.

Returns:

the newly created object.

Return type:

v_sim.GlView

Create a new v_sim.GlView object with default values and the given window size.

New in version 3.7.

alignToAxis(axis)
Parameters:

axis (v_sim.XyzDir) – an axis.

Rotate the view to align it with the given box axis.

New in version 3.8.

getDetailLevel(dimension)
Parameters:

dimension (float) – the size of the object which asks for its number of facettes.

Returns:

the number of facettes the object should used.

Return type:

int

This is a function to get the number of “facettes” advised by the server (according to its policy on rendering) to draw an object according to a given dimension.

getPrecision()
Returns:

the actual precision.

Return type:

float

This function retrieve the value of the parameter precisionOfRendering.

getRealCoordinates(xyz, winx, winy, winz)
Parameters:
  • xyz (float) – a location to store the result.

  • winx (float) – position on X axis of screen.

  • winy (float) – position on Y axis of screen.

  • winz (float) – height before projection on screen.

Use this routine to get the cartesian coordinates in real space of a point located at winx and winy on screen.

getZCoordinate(xyz)
Parameters:

xyz (float) – a cartesian point.

Return type:

float

Use this routine to know the Z value of a real point defined by xyz in caretsian coordinates.

initContext()

Modelize and project the view. Should be called when used in a new OpenGL context.

New in version 3.8.

rotateBox(dTheta, dPhi)
Parameters:
  • dTheta (float) – a float value ;

  • dPhi (float) – a float value ;

Returns:

a storing area two floats.

Return type:

angles: [float]

This methods rotates the camera of the given self of (dTheta, dPhi) and put new theta and phi angles in angles, first being theta and second phi.

rotateCamera(dTheta, dPhi)
Parameters:
  • dTheta (float) – a float value ;

  • dPhi (float) – a float value ;

Returns:

a storing area three floats.

Return type:

angles: [float]

This methods rotates the camera of the given self of (dTheta, dPhi). dTheta is taken as displacement along camera x axis and dPhi along camera y axis. Then, computations are done to obtain new theta, phi and omega values. They are put in angles, first being theta, second phi and third omega.

setGross(value)
Parameters:

value (float) – a positive floating point value.

Returns:

True if value is actually changed.

Return type:

bool

This method is used to change the camera zoom for the given self. If necessary, this method will emit the ‘GrossChanged’ signal and the ‘FacetteChangedChanged’ signal.

setObjectRadius(lg, units)
Parameters:
  • lg (float) – the new value.

  • units (v_sim.Units) – the unit to read lg with.

Returns:

True if value is actually changed.

Return type:

bool

This method is used to change the window frustum for the given self. If necessary, this method will project and emit the ‘NearFarChanged’ signal.

New in version 3.7.

setPersp(value)
Parameters:

value (float) – a positive floating point value (> 1.1).

Returns:

True if value is actually changed.

Return type:

bool

This method is used to change the camera perspective for the given self. If necessary, this method will emit the ‘PerspChanged’ signal and the ‘FacetteChangedChanged’ signal.

setPrecision(value)
Parameters:

value (float) – a positive value (1. is normal precision).

Returns:

True if value is actually changed.

Return type:

bool

This function change the value of the parameter precisionOfRendering. It changes the number of facettes advised for every objects. It allows to increase or decrease the number of polygons drawn and thus acts on the speed of rendering.

setRefLength(lg, units)
Parameters:
  • lg (float) – the new value.

  • units (v_sim.Units) – the unit to read lg with.

Returns:

True if value is actually changed.

Return type:

bool

This method is used to change the camera reference length for the given self. If necessary, this method will modelize and emit the ‘RefLengthChanged’ signal.

setThetaPhiOmega(valueTheta, valuePhi, valueOmega, mask)
Parameters:
  • valueTheta (float) – a floatinf point value in degrees ;

  • valuePhi (float) – a floating point value in degrees ;

  • valueOmega (float) – a floating point value in degrees ;

  • mask (int) – to specified what values will be changed.

Returns:

True if value is actually changed.

Return type:

bool

This method is used to change the camera orientation for the given self. If necessary, this method will emit the ‘ThetaPhiOmegaChanged’ signal.

setViewport(width, height)
Parameters:
  • width (int) – the new horizontal size ;

  • height (int) – the new vertical size.

Returns:

True if value is actually changed.

Return type:

bool

It changes the size of the OpenGl area and reccompute the OpenGL viewport. Warning : it doesn’t change the size of the window.

setXsYs(valueX, valueY, mask)
Parameters:
  • valueX (float) – a floatinf point value in the bounding box scale (1 is the size of the bounding box) ;

  • valueY (float) – a floating point value in bounding box scale ;

  • mask (int) – to specified what values will be changed.

Returns:

True if value is actually changed.

Return type:

bool

This method is used to change the camera position for the given self. If necessary, this method will emit the ‘XsYsChanged’ signal.

Signal Details

v_sim.GlView.signals.DetailLevelChanged(gl_view)
Signal Name:

DetailLevelChanged

Flags:

RUN_LAST, NO_RECURSE, NO_HOOKS

Parameters:

gl_view (v_sim.GlView) – The object which received the signal

Gets emitted when precision of the drawn object has been changed.

New in version 3.2.

v_sim.GlView.signals.RefLengthChanged(gl_view)
Signal Name:

RefLengthChanged

Flags:

RUN_LAST, NO_RECURSE, NO_HOOKS

Parameters:

gl_view (v_sim.GlView) – The object which received the signal

Gets emitted when the reference length of the camera has been changed.

New in version 3.7.

v_sim.GlView.signals.WidthHeightChanged(gl_view)
Signal Name:

WidthHeightChanged

Flags:

RUN_LAST, NO_RECURSE, NO_HOOKS

Parameters:

gl_view (v_sim.GlView) – The object which received the signal

Gets emitted when the viewing frame has been changed.

New in version 3.2.

v_sim.GlView.signals.changed(gl_view)
Signal Name:

changed

Flags:

RUN_LAST, NO_RECURSE, NO_HOOKS

Parameters:

gl_view (v_sim.GlView) – The object which received the signal

Gets emitted when the view is changed.

New in version 3.8.

Property Details

v_sim.GlView.props.omega
Name:

omega

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

omega angle

v_sim.GlView.props.perspective
Name:

perspective

Type:

float

Default Value:

5.0

Flags:

READABLE, WRITABLE

perspective level

v_sim.GlView.props.phi
Name:

phi

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE

phi angle

v_sim.GlView.props.precision
Name:

precision

Type:

float

Default Value:

1.0

Flags:

READABLE, WRITABLE

precision level

v_sim.GlView.props.theta
Name:

theta

Type:

float

Default Value:

90.0

Flags:

READABLE, WRITABLE

theta angle

v_sim.GlView.props.trans_x
Name:

trans-x

Type:

float

Default Value:

0.5

Flags:

READABLE, WRITABLE

translation along x

v_sim.GlView.props.trans_y
Name:

trans-y

Type:

float

Default Value:

0.5

Flags:

READABLE, WRITABLE

translation along y

v_sim.GlView.props.zoom
Name:

zoom

Type:

float

Default Value:

1.0

Flags:

READABLE, WRITABLE

zoom level