v_sim.GlView¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
omega angle |
||
r/w |
perspective level |
||
r/w |
phi angle |
||
r/w |
precision level |
||
r/w |
theta angle |
||
r/w |
translation along x |
||
r/w |
translation along y |
||
r/w |
zoom level |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Gets emitted when precision of the drawn object has been changed. |
|
Gets emitted when the reference length of the camera has been changed. |
|
Gets emitted when the viewing frame has been changed. |
|
Gets emitted when the view is changed. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
camera |
r |
||
parent |
r |
||
window |
r |
Class Details¶
- class v_sim.GlView(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A container structure to deal with OpenGL observer position, size of rendering viewport…
- classmethod new()¶
- Returns:
the newly created object.
- Return type:
Create a new
v_sim.GlViewobject with default values.
- classmethod new_withSize(w, h)¶
- Parameters:
- Returns:
the newly created object.
- Return type:
Create a new
v_sim.GlViewobject 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:
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:
This function retrieve the value of the parameter precisionOfRendering.
- getRealCoordinates(xyz, winx, winy, winz)¶
- Parameters:
Use this routine to get the cartesian coordinates in real space of a point located at winx and winy on screen.
- getZCoordinate(xyz)¶
-
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:
- 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:
- 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:
Trueif value is actually changed.- Return type:
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:
Trueif value is actually changed.- Return type:
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:
Trueif value is actually changed.- Return type:
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:
Trueif value is actually changed.- Return type:
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:
Trueif value is actually changed.- Return type:
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:
- Returns:
Trueif value is actually changed.- Return type:
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:
- Returns:
Trueif value is actually changed.- Return type:
It changes the size of the OpenGl area and reccompute the OpenGL viewport. Warning : it doesn’t change the size of the window.
Signal Details¶
- v_sim.GlView.signals.DetailLevelChanged(gl_view)¶
- Signal Name:
DetailLevelChanged- Flags:
- 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:
- 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:
- 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:
- 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¶
-
omega angle
- v_sim.GlView.props.perspective¶
-
perspective level
- v_sim.GlView.props.phi¶
-
phi angle
- v_sim.GlView.props.precision¶
-
precision level
- v_sim.GlView.props.theta¶
-
theta angle
- v_sim.GlView.props.trans_x¶
-
translation along x
- v_sim.GlView.props.trans_y¶
-
translation along y