5. Extension library¶
The ext module contains simple Python extension of PlantGL.
5.1. openalea.plantgl.ext.absolute_shapes module¶
Absolute shapes implementation.
Absolute shapes (primary PlantGL4D:PlantGL for dummies) is an intermidiete layer to connect miserable human factor to the intergalatic concepts of PlantGL. The main idea is to help operating on PlantGL object in Cartesian 3D system. The most important is a AShape3D class which is a container for 3 basic transformation which allow to express the most important object transformations.
- version:
czw mar 22 14:36:00 CET 2007
- author:
szymon stoma, frederic boudon, david da silva
- class AArrow(radius=1.0, axis=Vector3(0, 0, 1), **keys)¶
AArrow implementation. AArrow is a shape build up from the cylinder and cone.
- AArrows’ individual properties:
- posVector3 convertable
Property: the center of the lower basis,
- axisVector3 convertable
Property: the vector which is a symetry axis of the arrow. If no height is given the height of the cylinder is the axis magnitude.
- heightReal
Property: the height of an arrow,
- radiusReal
Property: the radius of the lower basis
It also inherits properties from AShape3D object, hance look for possible properties in AShape3D object.
- property axis¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property height¶
Height of an arrow.
- property material¶
Material of the object is used to add appearence properites. Exact copy from PlantGL material.
- property pos¶
Position of the object is used to make default translate.
- property radius¶
Radius of an arrow.
- property roll¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property scale¶
Property used to make default scale operations.
- class ACenterPolygon(**keys)¶
ACenterPolygon implementation. ACenterPolygon is a wrapper for a FaceSet. Currently no useful operations to scale, rotate, roll, translate were redefined so it is more container for PlantGL FaceSet object. The default ones are still defined but they are not very usfull. The polygon is presented as a set of triangles. One vertex of each triangle is a baricenter of all points positions. the two others vertices are taken from ordered list of points obtained from init.
- ACenterPolygons’ individual properties:
- posVector3 convertable
Property: the shared translation T of each point creating a surface,
- axisVector3 convertable
Property: the shared rotation axis A of each point around. Zero element for the rotation axis is OZ.
- rollVector3 convertable
Property: the shared “roll angle” R of each point creating a surface around axis,
- pointsVector3 convertable tuple
Property: the tuple of points positions,
- ACenterPolygons’ individual properties:
- update_k_pointindex
Updates the point in the polygon
- get_centerVector3
Returns the center of ACenterPolygon
It also inherits properties from AShape3D object, hance look for possible properties in AShape3D object.
- property axis¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property material¶
Material of the object is used to add appearence properites. Exact copy from PlantGL material.
- property pos¶
Position of the object is used to make default translate.
- property roll¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property scale¶
Property used to make default scale operations.
- class ACylinder(radius=1.0, axis=Vector3(0, 0, 1), **keys)¶
ACylinder implementation.
- ACylinders’ individual properties:
- posVector3 convertable
Property: the center of the lower basis,
- axisVector3 convertable
Property: the vector which is a symetry axis of the cylinder. If no height is given the height of the cylinder is the axis magnitude.
- heightReal
Property: the height of cylinder,
- radiusReal
Property: the radius of the lower basis
It also inherits properties from AShape3D object, hance look for possible properties in AShape3D object.
- property axis¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property height¶
Height of the cylinder.
- property material¶
Material of the object is used to add appearence properites. Exact copy from PlantGL material.
- property pos¶
Position of the object is used to make default translate.
- property radius¶
Radius of the cylinder.
- property roll¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property scale¶
Property used to make default scale operations.
- class AShape3D(pos=Vector3(0, 0, 0), axis=Vector3(0, 0, 1), roll=0.0, scale=Vector3(1, 1, 1), material=Material(name='White', ambient=Color3(255, 255, 255), diffuse=1, specular=Color3(40, 40, 40), shininess=1), geometry=None, **keys)¶
Basic shape used to wrap all <2 axis objects.
Internally all the visual object are characterised by 3 transformation components:
scaling,
rotation,
translation.
The order of applying these operations: scaling, rotation, translation. This component is enough to express the position of many one-axis symetry objects. For more complex objects, the manual ingeration into component might be required (or different strategy should be developed).
- Important properties:
- posVector3 convertable
Property: pos of the object (look below),
- axisVector3 convertable
Property: main axis of the object, should be defined to describe the rotation. The Z of the primitive geometry would point to axis,
- rollReal
Property: rotation of the object around main axis,
- scaleVector3 convertable
Property: used while resizing the object. While resizing the Z corresponds to main axis of the object,
- materialpgl.Material
Property: describes the appearance of the object,
- geometrypgl.Geometry
describes the geometry of the object.
The concept of pos property: pos attribute for cylinder, arrow, cone, pyramid, etc. corresponds to one end of the object, whereas for a box, sphere, ring, etc. it corresponds to the center of the object.
- property axis¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property material¶
Material of the object is used to add appearence properites. Exact copy from PlantGL material.
- property pos¶
Property describing the position of the object. Its’ meaning depands on the type of the object. Pos attribute for cylinder, arrow, cone, pyramid, etc. corresponds to one end of the object, whereas for a box, sphere, ring, etc. it corresponds to the center of the object.
- property roll¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property scale¶
Property used to make default scale operations.
- class ASphere(radius=1.0, **keys)¶
ASphere implementation.
- ASphere individual properties:
- posVector3 convertable
Property: the point with equal distance from every point on the sphere surface
- radiusReal
Property: the distance between the center and every point on the sphere surface
It also inherits properties from AShape3D object, hance look for possible properties in AShape3D object.
- property axis¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property material¶
Material of the object is used to add appearence properites. Exact copy from PlantGL material.
- property pos¶
Position of the object is used to make default translate.
- property radius¶
Radius of the sphere.
- property roll¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property scale¶
Property used to make default scale operations.
- class ATriangle(**keys)¶
ATriangle implementation. ATriangle is a wrapper for a FaceSet. Currently no useful operations to scale, rotate, roll, translate were redefined so it is more container for PlantGL FaceSet object. The default ones are still defined but they are not very usfull.
- ATriangles’ individual properties:
- posVector3 convertable
Property: the shared translation T of each point creating a surface,
- axisVector3 convertable
Property: the shared rotation axis A of each point around. Zero element for the rotation axis is OZ.
- rollVector3 convertable
Property: the shared “roll angle” R of each point creating a surface around axis,
- pointsVector3 convertable tuple
Property: the tuple of points positions,
- ATriangles’ individual properties:
- update_k_pointindex
Updates the point in the polygon
- get_centerVector3
Returns the center of ACenterPolygon
It also inherits properties from AShape3D object, hance look for possible properties in AShape3D object.
- property axis¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property material¶
Material of the object is used to add appearence properites. Exact copy from PlantGL material.
- property pos¶
Position of the object is used to make default translate.
- property roll¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property scale¶
Property used to make default scale operations.
5.2. openalea.plantgl.ext.color module¶
- class BlueMap(val_min=0.0, val_max=1.0, **keys)¶
Created by Michael Walker 16/05/2011. If Jerome has a problem he can sue me.
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class Color(red=0, green=0, blue=0, alpha=1)¶
Classe managing simple color : R,G,B and Transparency
- Author:
Jerome Chopard
- License:
don’t touch
- property alpha¶
- property blue¶
- combine(color)¶
combine self with this color, considering color is under self alpha channel play a major role here if self.alpha==1 no change are visible
- Parameters:
color (Color) – background color
- Return type:
self
- f3tuple()¶
- f4tuple()¶
- get_CMYB()¶
return the channels in CMYB mode
- get_alpha()¶
- get_blue()¶
- get_green()¶
- get_int_channel(index)¶
return the value of a channel between 0 and 255 index =0 (red) =1 (green) =2 (blue) =3 (alpha)
- Parameters:
index (int) – index of the channel to retrieve
- Return type:
int
- get_red()¶
- get_transparency()¶
- property green¶
- i3tuple()¶
- i4tuple()¶
- normalize()¶
modify each channel to ensure it is bound between 0 and 1
- property red¶
- set_alpha(value)¶
- set_blue(value)¶
- set_green(value)¶
- set_int_channel(index, value)¶
set color channels from a value betwwen 0 and 255 index =0 (red) =1 (green) =2 (blue) =3 (alpha)
- Parameters:
index : channel to set
value : the new value bound between 0 and 1
- Types:
index : int
value : float
- Return type:
float
- set_red(value)¶
- set_transparency(value)¶
- property transparency¶
- class ColorMap¶
Functor used to associate a color to a set of values.
- get_color(value)¶
Return the color corresponding to this value in the color map.
value: float or int or whatever return: Color
- invert(color)¶
Compute the value that will give color using this color range invert function of get_color
- class ColorRange(value_range=(0.0, 1.0), color_list=[<openalea.plantgl.ext.color.Color object>, <openalea.plantgl.ext.color.Color object>, <openalea.plantgl.ext.color.Color object>], position_list=None, outside_values=False)¶
Usefull class for creating a range of colors like degrade of photoshop
- Author:
Jerome Chopard
- License:
don’t touch
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class CurvMap(val_min=0.0, val_max=1.0, **keys)¶
Created by Guillaume Cerutti 06/07/2014
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class GlasbeyMap(val_min=0.0, val_max=1.0, **keys)¶
Copied from the ImageJ glasbey lookup table
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class GrayMap(val_min=0.0, val_max=1.0, **keys)¶
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class GreenMap(val_min=0.0, val_max=1.0, **keys)¶
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class HeatMap(val_min=0.0, val_max=1.0, **keys)¶
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class IntMap¶
- get_color(value)¶
Return the color corresponding to this value in the color map.
value: float or int or whatever return: Color
- invert(color)¶
Compute the value that will give color using this color range invert function of get_color
- class InvertGreyMap(val_min=0.0, val_max=1.0, **keys)¶
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class JetMap(val_min=0.0, val_max=1.0, **keys)¶
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class JetMapWithoutRed(val_min=0.0, val_max=1.0, **keys)¶
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class MegaMap(val_min=0.0, val_max=1.0, **keys)¶
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- class TerrainMap(val_min=0.0, val_max=1.0, **keys)¶
- get_color(value)¶
compute the color corresponding to value by interpolating colors
- Parameters:
value (float) – the value for wich you need a color
- Return type:
- invert(color)¶
compute the value that will give color using this color range invert function of get_color
- set_value_range(value_range=(0.0, 1.0))¶
sets a value range.
- Parameters:
value_range : value range in which we pick values
- Types:
value_range : (float,float)
- create(red=0, green=0, blue=0, alpha=1)¶
create a color from the given channels same as Color.__init__
- gauss(mean=0.5, sd=0.2)¶
create a random color with alpha=1 color channel follow a gaussian
- gauss_bound(mean, sd)¶
internal function, gaussian bounded by 0 and 1
- int_create(red=0, green=0, blue=0, alpha=255)¶
create color with integer channels between 0 and 255
- random()¶
create a random color with alpha=1 color channels are uniformly reparted
5.3. openalea.plantgl.ext.dresser module¶
5.4. openalea.plantgl.ext.geom.box module¶
5.5. openalea.plantgl.ext.geom.color module¶
5.6. openalea.plantgl.ext.geom.geometrical_concept module¶
5.7. openalea.plantgl.ext.geom.interface.abstract_geometry module¶
5.8. openalea.plantgl.ext.geom.nvector module¶
5.9. openalea.plantgl.ext.geom.point module¶
5.10. openalea.plantgl.ext.geom.polygon module¶
5.11. openalea.plantgl.ext.geom.polyhedra module¶
5.12. openalea.plantgl.ext.geom.segment module¶
5.13. openalea.plantgl.ext.geom.sphere module¶
5.14. openalea.plantgl.ext.geom.text module¶
5.15. openalea.plantgl.ext.geom.tools module¶
5.16. openalea.plantgl.ext.interactive_mode module¶
Interactive shapes implementation.
This module integretes the absolute_shapes with the interactive mode
editing. It allows to instantly follow the object changes in the moment. It creates
a direct link from visual object to the PlantGL Viewer (when a property
is changed for the object the Viewer is updated instantly by default). It works almost perfectly
in the interactive mode. When we change the object we instantly see the change.
Of coz’ it is preliminary proposition.
Adding multiple objects: sometimes it is required to add many object to the scene. To avoid
the update after each addition the set_instant_update_visualisation_policy() could be used.
It allow to substitute the default behaviour of Viewer update:
>>>
import openalea.plantgl.all as pgl
import openalea.plantgl.plantgl4d as pd
pd.set_instant_update_visualisation_policy( policy = False )
for i in range(500):
l.append(pd.ASphere( pos=pgl.Vector3(i,0,0), radius=0.1 )
pd.set_instant_update_visualisation_policy( policy = True )
pd.instant_update_viewer( )
Multi scenes: currently I do not know how to do it in general way. Anyway i prepared the SCENES with CURRENT_SCENE to be able to extend it in the future(?).
- Deleting an object: with the current policy to free the memory of the object it is required to:
set its
visiblepropertry toFalsedelete all references to the object using
del
>>> import openalea.plantgl.all as pgl import openalea.plantgl.plantgl4d as pd s1 = pd.ASphere( pos=pgl.Vector3(i,0,0), radius=0.1 ) s1.visible = False #: the object is removed from the current scene s1.visible = True #: the object is reappearing in the current scene s1.visible = False #: the object is removed from the current scene del s1 # the memory used by s1 is free!! no futher access possible.
- version:
czw mar 22 14:36:00 CET 2007
- author:
szymon stoma
- class AIArrow(radius=1.0, axis=Vector3(0, 0, 1), **keys)¶
AIArrow implementation with binding to Viewer. AArrow is a shape build up from the cylinder and cone.
It also inherits properties from AShape3D, AArrow object, hance look for possible properties in AShape3D, AArrow objects.
- property axis¶
Axis of the object is used to make default translate rotate operations.
- property height¶
Height of an arrow.
- property material¶
Material of the object is used to add appearence properites.
- property pos¶
Position of the object is used to make default translate.
- property radius¶
Radius of an arrow.
- property roll¶
Axis of the object is used to make default translate rotate operations.
- property scale¶
Scale of the object is used to make default scale operations.
- property visible¶
True iff shape is currently displayed.
- class AICenterPolygon(**keys)¶
ACenterPolygon implementation. ACenterPolygon is a wrapper for a FaceSet. Currently no useful operations to scale, rotate, roll, translate were redefined so it is more container for PlantGL FaceSet object. The default ones are still defined but they are not very usfull. The polygon is presented as a set of triangles. One vertex of each triangle is a baricenter of all points positions. the two others vertices are taken from ordered list of points obtained from init.
- ACenterPolygons’ individual properties:
- posVector3 convertable
Property: the shared translation T of each point creating a surface,
- axisVector3 convertable
Property: the shared rotation axis A of each point around. Zero element for the rotation axis is OZ.
- rollVector3 convertable
Property: the shared “roll angle” R of each point creating a surface around axis,
- pointsVector3 convertable tuple
Property: the tuple of points positions,
- ACenterPolygons’ individual properties:
- update_k_pointindex
Updates the point in the polygon
- get_centerVector3
Returns the center of ACenterPolygon
It also inherits properties from AShape3D object, hance look for possible properties in AShape3D object.
- property axis¶
Axis of the object is used to make default translate rotate operations.
- property material¶
Material of the object is used to add appearence properites.
- property pos¶
Position of the object is used to make default translate.
- property roll¶
Axis of the object is used to make default translate rotate operations.
- property scale¶
Scale of the object is used to make default scale operations.
- property visible¶
True iff shape is currently displayed.
- class AICylinder(radius=1.0, axis=Vector3(0, 0, 1), **keys)¶
AICylinder implementation with binding to Viewer.
It also inherits properties from AIShape3D, ACylinder object, hance look for possible properties in AShape3D, ACylinder objects.
- property axis¶
Axis of the object is used to make default translate rotate operations.
- property height¶
Height of the cylinder.
- property material¶
Material of the object is used to add appearence properites.
- property pos¶
Position of the object is used to make default translate.
- property radius¶
Radius of the cylinder.
- property roll¶
Axis of the object is used to make default translate rotate operations.
- property scale¶
Scale of the object is used to make default scale operations.
- property visible¶
True iff shape is currently displayed.
- class AIShape3D(visible=True, **keys)¶
Basic shape used to wrap all <2 axis objects with binding to Viewer.
- Important properties:
- visibleBool
Property: True iff object is visible (look below),
The concept of visible property: to temporary make the object invisible in the current scene set the visible to False. If you want to wipe the object from the memory: make it invisible and then use del to remove reference to the object.
eg. The concept of pos property: pos attribute for cylinder, arrow, cone, pyramid, etc. corresponds to one end of the object, whereas for a box, sphere, ring, etc. it corresponds to the center of the object.
- property axis¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property material¶
Property describing the appearence of the object. Exact copy from PlantGL material.
- property pos¶
Property describing the position of the object. Its’ meaning depands on the type of the object. Pos attribute for cylinder, arrow, cone, pyramid, etc. corresponds to one end of the object, whereas for a box, sphere, ring, etc. it corresponds to the center of the object.
- property roll¶
Property describing the main axis for the object. Its’ meaning depands on the type of the object. It is important to rotation operations. For some object is defined to reach generalisation (eg. sphere).
- property scale¶
Scale of the object is used to make default scale operations.
- property visible¶
Property describing whether the object is currently visible in the current Scene. If object is not present in current scene nothing is happanning.
- class AISphere(radius=1.0, **keys)¶
AISphere implementation with binding to Viewer.
It also inherits properties from AIShape3D and ASphere object, hance look for possible properties in AShape3D, ASphere objects.
- property axis¶
Axis of the object is used to make default translate rotate operations.
- property material¶
Material of the object is used to add appearence properites.
- property pos¶
Position of the object is used to make default translate.
- property radius¶
Radius of the sphere.
- property roll¶
Axis of the object is used to make default translate rotate operations.
- property scale¶
Scale of the object is used to make default scale operations.
- property visible¶
True iff shape is currently displayed.
- class AITriangle(**keys)¶
AITriangle implementation. AITriangle is a wrapper for a FaceSet. Currently no useful operations to scale, rotate, roll, translate were redefined so it is more container for PlantGL FaceSet object. The default ones are still defined but they are not very usfull.
- AITriangle’ individual properties:
- posVector3 convertable
Property: the shared translation T of each point creating a surface,
- axisVector3 convertable
Property: the shared rotation axis A of each point around. Zero element for the rotation axis is OZ.
- rollVector3 convertable
Property: the shared “roll angle” R of each point creating a surface around axis,
- pointsVector3 convertable tuple
Property: the tuple of points positions,
- AITriangle’ individual properties:
- update_k_pointindex
Updates the point in the polygon
- get_centerVector3
Returns the center of ACenterPolygon
It also inherits properties from AShape3D object, hance look for possible properties in AShape3D object.
- property axis¶
Axis of the object is used to make default translate rotate operations.
- property material¶
Material of the object is used to add appearence properites.
- property pos¶
Position of the object is used to make default translate.
- property roll¶
Axis of the object is used to make default translate rotate operations.
- property scale¶
Scale of the object is used to make default scale operations.
- property visible¶
True iff shape is currently displayed.
- change_scene(scene=None, scn_index=None)¶
Changes current scene
<Long description of the function functionality.>
- Parameters:
- arg1T
<Description of arg1 meaning>
- Return type:
T
- Returns:
<Description of
return_objectmeaning>- Raises:
Exception – <Description of situation raising Exception>
- clear_scene(scn_index=None)¶
Clears scene.
<Long description of the function functionality.>
- Parameters:
- arg1T
<Description of arg1 meaning>
- Return type:
T
- Returns:
<Description of
return_objectmeaning>- Raises:
Exception – <Description of situation raising Exception>
- display_viewer()¶
Helper function used to make the Viewer visible whenever sth was changed and the Viewer was closed.
- get_scene(scn_index=None)¶
Gets scene.
<Long description of the function functionality.>
- Parameters:
- arg1T
<Description of arg1 meaning>
- Return type:
T
- Returns:
<Description of
return_objectmeaning>- Raises:
Exception – <Description of situation raising Exception>
- instant_update_viewer()¶
Updates the viewer window without any condition.
- set_instant_update_visualisation_policy(policy=True)¶
Sets the update visualisation policy. Check for semantics in the description of PlantGL4D.
- Parameters:
- policyBool
True iff Viewer should be refreshed every time the scen is changed. False elsewhere.
- update_viewer()¶
Updates the viewer window iff policy allows it. It should be run every time the scene object has changed. Policy is described by variable INSTANT_UPDATE_VISUALISATION_POLICY.
5.17. openalea.plantgl.ext.mesh module¶
- cell_geometry(cid, mesh, position)¶
compute the triangle set representing the geometry of this cell
5.18. openalea.plantgl.ext.pgl_utils module¶
5.19. openalea.plantgl.ext.shape_database module¶
- class ShapeDatabase¶
a view of a scene as a database of shapes a dictionary of shape_id, shapes
- clear() None. Remove all items from D.¶
- copy() a shallow copy of D¶
- fromkeys(value=None, /)¶
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)¶
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items¶
- keys() a set-like object providing a view on D's keys¶
- pop(k[, d]) v, remove specified key and return the corresponding value.¶
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- read(filename)¶
read a database (a bgeom file)
- save(filename)¶
save a database into a file (a bgeom file)
- scene()¶
convert the database into a plantgl scene
- setdefault(key, default=None, /)¶
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- update([E, ]**F) None. Update D from dict/iterable E and F.¶
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values¶