v_sim.Gl¶
- Subclasses:
 
Methods¶
- Inherited:
 - Structs:
 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
|
class  | 
|
class  | 
  | 
class  | 
  | 
class  | 
|
class  | 
|
class  | 
  | 
class  | 
|
class  | 
  | 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
Properties¶
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w  | 
antialias line  | 
||
r/w  | 
immediate redraw after change  | 
||
r  | 
light environment  | 
||
r/w  | 
global rendering mode  | 
||
r/w  | 
differenciate right and left buffer  | 
||
r/w  | 
angle between left and right buffers  | 
||
r/w  | 
draw in two passes to improve transparency  | 
Signals¶
- Inherited:
 
Fields¶
- Inherited:
 
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
parent  | 
r  | 
||
priv  | 
r  | 
Class Details¶
- class v_sim.Gl(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
Common name to refer to a #_VisuGl.
- classmethod drawAngle(xyzRef, xyzRef2, xyz, id, drawLength)¶
 - Parameters:
 
Draw an angle mark by to distance marks and a disk taking xyzRef as central point and xyzRef2 and xyz as the two positions. id is a counter to obtain different colours for the disk and drawLength is a flag to display or not the angle value in degrees.
New in version 3.6.
- classmethod drawDistance(xyzRef, xyz, drawLength)¶
 - Parameters:
 
Draw a distance mark between xyzRef and xyz. A distance mark is a colour inverted line and two squared marks on node. drawLength is a flag to display or not the distance value.
New in version 3.6.
- classmethod drawEdgeArrow(centering, tailLength, tailRadius, tailRenderer, hatLength, hatRadius, hatRenderer)¶
 - Parameters:
 centering (
v_sim.GlArrowCentering) – a flag.tailLength (
float) – length of tail part.tailRadius (
float) – length of edge of tail part.tailRenderer (
v_sim.ElementRendererorNone) – a givenv_sim.ElementRendererto take the rendering properties of.hatLength (
float) – length of hat part.hatRadius (
float) – length of edge of hat part.hatRenderer (
v_sim.ElementRendererorNone) – a givenv_sim.ElementRendererto take the rendering properties of.
Draw arrows, using sqaure edges. For rounded arrows, see
v_sim.Gl.drawSmoothArrow().New in version 3.6.
- classmethod drawEllipsoid(obj, aAxis, bAxis, n, renderer)¶
 - Parameters:
 …
aAxis (
float) – length of long axis.bAxis (
float) – length of short axis.n (
float) – number of edges for the sphere approximation.renderer (
v_sim.ElementRendererorNone) – a givenv_sim.ElementRendererto take the rendering properties of.
Draw an ellipsoid.
New in version 3.6.
- classmethod drawSmoothArrow(obj, centering, tailLength, tailRadius, tailN, tailRenderer, hatLength, hatRadius, hatN, hatRenderer)¶
 - Parameters:
 …
centering (
v_sim.GlArrowCentering) – a flag.tailLength (
float) – length of tail part.tailRadius (
float) – length of edge of tail part.tailN (
float) – number of edges in the approximation.tailRenderer (
v_sim.ElementRendererorNone) – a givenv_sim.ElementRendererto take the rendering properties of.hatLength (
float) – length of hat part.hatRadius (
float) – length of edge of hat part.hatN (
float) – number of edges in the approximation.hatRenderer (
v_sim.ElementRendererorNone) – a givenv_sim.ElementRendererto take the rendering properties of.
Draw arrows, using sqaure edges. For rounded arrows, see
v_sim.Gl.drawEdgeArrow().New in version 3.6.
- classmethod drawTorus(obj, radius, ratio, nA, nB, renderer)¶
 - Parameters:
 …
radius (
float) – global radius.ratio (
float) – ratio on internal radius over global radius.nA (
int) – number of edges for the global radius.nB (
int) – number of edges for the internal radius.renderer (
v_sim.ElementRendererorNone) – a givenv_sim.ElementRendererto take the rendering properties of.
Draw a torus.
New in version 3.5.
- classmethod objectlist_new(size)¶
 - Parameters:
 size (
int) – the requested size.- Returns:
 an identifier used by OpenGl as a list.
- Return type:
 
It returns the id that can be used to link glObjectList. This number is also added to the list of glObjectList to be displayed. The size parameter is the number of lists that could be used by the user for this glObjectList. Then the next call to this function will return the last value plus the size plus one.
- classmethod rendering_applyMode(mode)¶
 - Parameters:
 mode (
v_sim.GlRenderingMode) – an integer.
Change the rendering mode of current OpenGL context.
- classmethod rendering_getAllModeLabels()¶
 - 
This function retrieve al the names (translated) of available rendering modes.
 
- classmethod rendering_getAllModes()¶
 - 
This function retrieve al the names of available rendering modes.
 
- classmethod rendering_getModeFromName(name, id)¶
 - Parameters:
 name (
str) – a string ;id (
v_sim.GlRenderingMode) – a location to store the resulting id.
- Returns:
 Trueif the name exists.- Return type:
 
This function retrieve the rendering mode id associated to the name.
- classmethod text_drawChars(s, size)¶
 - Parameters:
 s (
str) – a string.size (
v_sim.GlTextSize) – the size of the text to render.
Draw the given string on the current raster position with default font.
- classmethod text_initFontList()¶
 Initialise the font drawing with default font (depending on system). It must be called before
v_sim.Gl.text_drawChars() and not in a glNewList(). Can be called several times, fonts are initialized once only. Usev_sim.Gl.text_rebuildFontList() to force to build a new font list.
- classmethod text_onNewContext()¶
 Set the flag for text list build to
False. It will force to rebuild the text lists at next call ofv_sim.Gl.text_initFontList().New in version 3.6.
- classmethod text_putTextWithFTGL(text, size)¶
 - Parameters:
 text (
str) – the text to write.size (
v_sim.GlTextSize) – the size.
A
v_sim.GlTextFuncroutine using FTGL to render text with Pixmap lists, seev_sim.Gl.text_setFunc().New in version 3.7.
- classmethod text_rebuildFontList()¶
 Force to buid a new font list (for example new context has changed.
- classmethod text_setFontSize(size)¶
 - 
Change the normal font size used by V_Sim (see
v_sim.GlTextSize.NORMAL). The small font is scaled accordingly. This is working only with the FTGL backend.New in version 3.7.
 
- classmethod text_setFunc(func)¶
 - Parameters:
 func (
v_sim.GlTextFuncorNone) – av_sim.GlTextFuncfunction- Returns:
 Trueif the function is indeed changed.- Return type:
 
Set the function to render text at the raster position.
New in version 3.7.
- addHint(value)¶
 - 
Set some additional hints to self.
New in version 3.8.
 
- applyLights()¶
 If self has some defined lights, it setup the OpenGL context with them and notify the “lights” parameter.
New in version 3.8.
- drawArrow(origin, vect)¶
 - Parameters:
 
Draw an arrow defined by vect centred at origin. For a lower level function, see
v_sim.Gl.drawSmoothArrow().New in version 3.8.
- getAntialias()¶
 - Returns:
 wether or not the antialising for lines is activated.
- Return type:
 
Get the value of the antialiasing parameter.
- getHint()¶
 - Returns:
 the mask of current hints.
- Return type:
 
Retrieve hints of self.
New in version 3.8.
- getImmediate()¶
 - Returns:
 the value of the immediateDrawing option.
- Return type:
 
Get the value of the immediateDrawing option.
- getLights()¶
 - Returns:
 the set of current lights.
- Return type:
 
V_Sim proposes a wrapper around the OpenGL light definitions.
- getMode()¶
 - Returns:
 the identifier of the current rendering option.
- Return type:
 
This function retrieve the value of the parameter renderingOption.
- getStereo()¶
 - Returns:
 Trueif the surface try to draw in stereo (may beTrue, even ifv_sim.Gl.getStereoCapability() returnsFalse, in that case the stereo capability is not used).- Return type:
 
Retrieve the status of the OpenGL surface.
- getStereoAngle()¶
 - Returns:
 the angle.
- Return type:
 
Retrieve the angle of the eyes in the stereo output.
- getStereoCapability()¶
 - 
Retrieve if the OpenGL window can render in stereo or not.
 
- getTrueTransparency()¶
 - 
The drawing can be done in one pass or two to respect transparency.
 
- initContext()¶
 This method is called when an OpenGL surface is created for the first time. It sets basic OpenGL options and calls other OpenGLFunctions used in V_Sim.
- setAntialias(value)¶
 - Parameters:
 value (
bool) – a boolean to activate or not the lines antialias.- Returns:
 Trueif value is actually changed.- Return type:
 
To set the antialiasing on lines.
- setColor(material, rgba)¶
 - Parameters:
 
This method call glMaterial to create the right shiningness, emission, diffuse…
- setHighlightColor(material, rgb, alpha)¶
 - Parameters:
 
This method try to set a colour that will contrast with rgb.
- setImmediate(value)¶
 - Parameters:
 value (
bool) – a boolean to set or not the immediateDrawing option.- Returns:
 Trueif the value is changed.- Return type:
 
If true all changes are applied only when the refresh button is pushed.
- setMode(value)¶
 - Parameters:
 value (
v_sim.GlRenderingMode) – an integer to represent the method of rendering.- Returns:
 Trueif value is actually changed.- Return type:
 
This function change the value of the parameter renderingOption. It controls how V_Sim renders objects, in wireframe for example.
- setStereo(status)¶
 - 
Change the type of rendering. The surface can be switch to stereo, only if the OpenGL has stereo capabilities (see
v_sim.Gl.getStereoCapability()). 
- setStereoAngle(angle)¶
 - Parameters:
 angle (
float) – a positive floating point value.- Returns:
 Trueif redraw should be done.- Return type:
 
Change the angle of the eyes in the stereo output.
- setTrueTransparency(status)¶
 - 
If true the rendering is done twice to respect the transparency.
 
- do_initContext() virtual¶
 This method is called when an OpenGL surface is created for the first time. It sets basic OpenGL options and calls other OpenGLFunctions used in V_Sim.
Property Details¶
- v_sim.Gl.props.antialias¶
 - 
antialias line
 
- v_sim.Gl.props.immediate¶
 - 
immediate redraw after change
 
- v_sim.Gl.props.lights¶
 - Name:
 lights- Type:
 - Default Value:
 - Flags:
 
light environment
- v_sim.Gl.props.mode¶
 - 
global rendering mode
 
- v_sim.Gl.props.stereo¶
 - 
differenciate right and left buffer
 
- v_sim.Gl.props.stereo_angle¶
 - 
angle between left and right buffers