Skip to content

Commit

Permalink
Update visualea wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
pradal committed Dec 17, 2024
1 parent d940c17 commit b79247f
Show file tree
Hide file tree
Showing 13 changed files with 836 additions and 814 deletions.
103 changes: 52 additions & 51 deletions src/openalea/plantgl/wralea/demos/__wralea__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
from openalea.core import *


__name__ = 'vplants.plantgl.demos'
__name__ = 'openalea.plantgl.demos'
__alias__ = ["vplants.plantgl.demos"]

__editable__ = True
__description__ = 'Demos of plantgl nodes'
__license__ = 'CECILL-C'
__url__ = 'http://openalea.gforge.inria.fr/doc/vplants/plantgl/doc/_build/html/contents.html'
__url__ = 'http://openalea.rtfd.io/'
__alias__ = []
__version__ = '0.8.0'
__version__ = '0.9.0'
__authors__ = 'Thomas Cokelaer'
__institutes__ = 'INRIA/CIRAD'
__icon__ = 'hull.png'
Expand All @@ -27,15 +28,15 @@
doc='',
inputs=[],
outputs=[],
elt_factory={ 2: ('vplants.plantgl.objects', 'Box'),
elt_factory={ 2: ('openalea.plantgl.objects', 'Box'),
3: ('openalea.flow control', 'annotation'),
4: ('openalea.flow control', 'annotation'),
5: ('vplants.plantgl.visualization', 'plot3D'),
6: ('vplants.plantgl.visualization', 'plot3D'),
8: ('vplants.plantgl.objects', 'Sphere'),
9: ('vplants.plantgl.objects', 'Shape'),
10: ('vplants.plantgl.objects', 'Sphere'),
11: ('vplants.plantgl.objects', 'Material')},
5: ('openalea.plantgl.visualization', 'plot3D'),
6: ('openalea.plantgl.visualization', 'plot3D'),
8: ('openalea.plantgl.objects', 'Sphere'),
9: ('openalea.plantgl.objects', 'Shape'),
10: ('openalea.plantgl.objects', 'Sphere'),
11: ('openalea.plantgl.objects', 'Material')},
elt_connections={ 147877352: (8, 0, 9, 2),
147877364: (9, 0, 5, 0),
147877376: (10, 0, 6, 0),
Expand Down Expand Up @@ -217,28 +218,28 @@
inputs=[],
outputs=[],
elt_factory={ 2: ('openalea.data structure.list', 'list'),
3: ('vplants.plantgl.objects', 'Color3'),
4: ('vplants.plantgl.objects', 'Material'),
5: ('vplants.plantgl.objects', 'Shape'),
6: ('vplants.plantgl.objects', 'Scene'),
7: ('vplants.plantgl.visualization', 'plot3D'),
3: ('openalea.plantgl.objects', 'Color3'),
4: ('openalea.plantgl.objects', 'Material'),
5: ('openalea.plantgl.objects', 'Shape'),
6: ('openalea.plantgl.objects', 'Scene'),
7: ('openalea.plantgl.visualization', 'plot3D'),
8: ('openalea.data structure.list', 'list'),
9: ('vplants.plantgl.objects', 'AsymmetricHull'),
9: ('openalea.plantgl.objects', 'AsymmetricHull'),
10: ('openalea.data structure.list', 'list'),
11: ('vplants.plantgl.objects', 'AsymmetricHull'),
12: ('vplants.plantgl.objects', 'Shape'),
13: ('vplants.plantgl.objects', 'Translated'),
14: ('vplants.plantgl.objects', 'Translated'),
11: ('openalea.plantgl.objects', 'AsymmetricHull'),
12: ('openalea.plantgl.objects', 'Shape'),
13: ('openalea.plantgl.objects', 'Translated'),
14: ('openalea.plantgl.objects', 'Translated'),
15: ('openalea.data structure.list', 'list'),
16: ('openalea.data structure.list', 'list'),
17: ('vplants.plantgl.objects', 'AsymmetricHull'),
18: ('vplants.plantgl.objects', 'AsymmetricHull'),
19: ('vplants.plantgl.objects', 'Translated'),
20: ('vplants.plantgl.objects', 'Translated'),
17: ('openalea.plantgl.objects', 'AsymmetricHull'),
18: ('openalea.plantgl.objects', 'AsymmetricHull'),
19: ('openalea.plantgl.objects', 'Translated'),
20: ('openalea.plantgl.objects', 'Translated'),
21: ('openalea.data structure.list', 'list'),
22: ('openalea.data structure.list', 'list'),
23: ('vplants.plantgl.objects', 'Shape'),
24: ('vplants.plantgl.objects', 'Shape'),
23: ('openalea.plantgl.objects', 'Shape'),
24: ('openalea.plantgl.objects', 'Shape'),
25: ('openalea.flow control', 'annotation')},
elt_connections={ 155573412: (13, 0, 12, 2),
155573424: (19, 0, 23, 2),
Expand Down Expand Up @@ -789,16 +790,16 @@
doc='',
inputs=[],
outputs=[],
elt_factory={ 3: ('vplants.plantgl.objects', 'Shape'),
4: ('vplants.plantgl.visualization', 'plot3D'),
5: ('vplants.plantgl.objects', 'ImageTexture'),
6: ('vplants.plantgl.objects', 'QuadSet'),
elt_factory={ 3: ('openalea.plantgl.objects', 'Shape'),
4: ('openalea.plantgl.visualization', 'plot3D'),
5: ('openalea.plantgl.objects', 'ImageTexture'),
6: ('openalea.plantgl.objects', 'QuadSet'),
7: ('openalea.data structure.list', 'list'),
8: ('openalea.data structure.list', 'list'),
9: ('openalea.data structure.list', 'list'),
10: ('openalea.data structure.list', 'list'),
11: ('openalea.flow control', 'annotation'),
13: ('vplants.plantgl.demos', 'leaf_tex.png')},
13: ('openalea.plantgl.demos', 'leaf_tex.png')},
elt_connections={ 167714232: (6, 0, 3, 2),
167714244: (10, 0, 6, 13),
167714256: (8, 0, 6, 5),
Expand Down Expand Up @@ -982,7 +983,7 @@
9: [(0, '[(0, 1, 2, 3)]')],
10: [(0, '[(0, 0), (0, 1), (1, 1), (1, 0)]')],
11: [],
13: [ (0, 'PackageData(vplants.plantgl.demos, leaf_tex.png)'),
13: [ (0, 'PackageData(openalea.plantgl.demos, leaf_tex.png)'),
(1, 'None'),
(2, 'None')],
'__in__': [],
Expand Down Expand Up @@ -1042,21 +1043,21 @@
doc='',
inputs=[],
outputs=[],
elt_factory={ 2: ('vplants.plantgl.visualization', 'plot3D'),
3: ('vplants.plantgl.objects', 'QuadSet'),
elt_factory={ 2: ('openalea.plantgl.visualization', 'plot3D'),
3: ('openalea.plantgl.objects', 'QuadSet'),
4: ('openalea.data structure.list', 'list'),
5: ('openalea.flow control', 'annotation'),
6: ('openalea.data structure.list', 'list'),
7: ('openalea.data structure.list', 'list'),
8: ('openalea.data structure.list', 'list'),
10: ('vplants.plantgl.objects', 'Color4'),
10: ('openalea.plantgl.objects', 'Color4'),
13: ('openalea.flow control', 'annotation'),
14: ('openalea.flow control', 'annotation'),
15: ('openalea.flow control', 'annotation'),
16: ('openalea.flow control', 'annotation'),
17: ('vplants.plantgl.objects', 'Color4'),
18: ('vplants.plantgl.objects', 'Color4'),
19: ('vplants.plantgl.objects', 'Color4')},
17: ('openalea.plantgl.objects', 'Color4'),
18: ('openalea.plantgl.objects', 'Color4'),
19: ('openalea.plantgl.objects', 'Color4')},
elt_connections={ 147877292: (7, 0, 3, 5),
147877304: (17, 0, 8, 0),
147877316: (10, 0, 8, 0),
Expand Down Expand Up @@ -1320,27 +1321,27 @@
doc='',
inputs=[],
outputs=[],
elt_factory={ 2: ('vplants.plantgl.objects', 'Sphere'),
3: ('vplants.plantgl.objects', 'Translated'),
elt_factory={ 2: ('openalea.plantgl.objects', 'Sphere'),
3: ('openalea.plantgl.objects', 'Translated'),
4: ('openalea.data structure.list', 'list'),
5: ('vplants.plantgl.visualization', 'plot3D'),
5: ('openalea.plantgl.visualization', 'plot3D'),
6: ('openalea.flow control', 'annotation'),
7: ('openalea.flow control', 'annotation'),
8: ('vplants.plantgl.objects', 'Sphere'),
9: ('vplants.plantgl.objects', 'Sphere'),
10: ('vplants.plantgl.objects', 'Translated'),
11: ('vplants.plantgl.objects', 'Translated'),
8: ('openalea.plantgl.objects', 'Sphere'),
9: ('openalea.plantgl.objects', 'Sphere'),
10: ('openalea.plantgl.objects', 'Translated'),
11: ('openalea.plantgl.objects', 'Translated'),
12: ('openalea.data structure.tuple', 'tuple'),
13: ('openalea.data structure.tuple', 'tuple'),
14: ('vplants.plantgl.objects', 'Shape'),
14: ('openalea.plantgl.objects', 'Shape'),
15: ('openalea.data structure.tuple', 'tuple'),
16: ('vplants.plantgl.objects', 'Material'),
17: ('vplants.plantgl.visualization', 'plot3D'),
16: ('openalea.plantgl.objects', 'Material'),
17: ('openalea.plantgl.visualization', 'plot3D'),
18: ('openalea.data structure.tuple', 'tuple'),
19: ('vplants.plantgl.objects', 'Material'),
20: ('vplants.plantgl.objects', 'Shape'),
19: ('openalea.plantgl.objects', 'Material'),
20: ('openalea.plantgl.objects', 'Shape'),
21: ('openalea.data structure.list', 'list'),
22: ('vplants.plantgl.objects', 'Scene')},
22: ('openalea.plantgl.objects', 'Scene')},
elt_connections={ 147877148: (12, 0, 16, 1),
147877160: (12, 0, 16, 3),
147877172: (13, 0, 11, 2),
Expand Down
8 changes: 4 additions & 4 deletions src/openalea/plantgl/wralea/dresser/__wralea__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

from openalea.core import Factory

__name__ = "vplants.plantgl.dresser"
__alias__ = ["PlantGL.Dresser"]
__name__ = "openalea.plantgl.dresser"
__alias__ = ["PlantGL.Dresser", "vplants.plantgl.dresser"]

__version__ = '0.0.1'
__version__ = '0.1.0'
__license__ = 'CECILL-C'
__authors__ = 'F. Boudon and D. Da Silva'
__institutes__ = 'INRIA/CIRAD'
Expand All @@ -32,6 +32,6 @@
dresser = Factory(name="PGL Dresser",
description="Add Pgl geometry an object",
category="scene.PGL",
nodemodule="vplants.plantgl.ext.dresser",
nodemodule="openalea.plantgl.ext.dresser",
nodeclass="dresser",
)
13 changes: 7 additions & 6 deletions src/openalea/plantgl/wralea/edition/__wralea__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
#from .pgl_interface import *
#from .pgl_interface_widget import *

__name__ = "vplants.plantgl.edition"
__name__ = "openalea.plantgl.edition"
__alias__ = ["vplants.plantgl.edition"]

__version__ = '0.0.2'
__license__ = 'CECILL-V2'
__authors__ = 'F. Boudon'
__institutes__ = 'INRIA/CIRAD'
__description__ = 'PlantGL Edition nodes.'
__url__ = 'http://openalea.gforge.inria.fr'
__url__ = 'http://openalea.rtfd.io'

__all__ = ['curve2d', 'nurbs']

curve2d = Factory( name= "Curve2D",
description= "Display and edition of a curve 2D",
category = "Visualisation, Edition",
nodemodule = "pgl_edition_node",
nodemodule = "openalea.plantgl.wralea.edition.pgl_edition_node",
nodeclass = "curve2D",
widgetmodule = "pgl_interface_widget",
widgetmodule = "openalea.plantgl.wralea.edition.pgl_interface_widget",
widgetclass = "Curve2DWidget",
inputs=(dict(name="curve", interface=None,),dict(name="curve", interface=None,)),
outputs=(dict(name="curve", interface=None,),),
Expand All @@ -28,9 +29,9 @@
nurbs= Factory( name= "NurbsPatch",
description= "Display and edition of a Nurbs Patch",
category = "Visualisation, Edition",
nodemodule = "pgl_edition_node",
nodemodule = "openalea.plantgl.wralea.edition.pgl_edition_node",
nodeclass = "nurbs",
widgetmodule = "pgl_interface_widget",
widgetmodule = "openalea.plantgl.wralea.edition.pgl_interface_widget",
widgetclass = "NurbsPatchWidget",
inputs=(dict(name="nurbs", interface=None,),),
outputs=(dict(name="nurbs",),),
Expand Down
3 changes: 1 addition & 2 deletions src/openalea/plantgl/wralea/edition/pgl_edition_node.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from openalea.core import *
from openalea.core import Node
from copy import deepcopy
from pickle import loads, dumps
from openalea.plantgl.all import NurbsCurve2D
Expand All @@ -22,6 +22,5 @@ def __call__(self, inputs):

def nurbs(surf):
""" A curve 2D """
from copy import deepcopy
return deepcopy(surf)

5 changes: 2 additions & 3 deletions src/openalea/plantgl/wralea/edition/pgl_interface.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- python -*-
#
#
# Copyright 2006-2010 INRIA - CIRAD - INRA
# Copyright 2006-2024 INRIA - CIRAD - INRAE
#
# File author(s): Pradal, Boudon, Barbeau
#
Expand All @@ -14,9 +14,8 @@
"""declaration of curve2D interface and its widget """

__license__ = "Cecill-C"
__revision__ = " $Id: interface.py 2245 2010-02-08 17:11:34Z cokelaer $"

from openalea.core.interface import IInterface, IInterfaceMetaClass
from openalea.core.interface import IInterface
from openalea.plantgl.scenegraph import Curve2D, NurbsCurve2D, NurbsPatch

class ICurve2D(IInterface) :
Expand Down
16 changes: 8 additions & 8 deletions src/openalea/plantgl/wralea/edition/pgl_interface_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# OpenAlea.Visualea: OpenAlea graphical user interface
#
# Copyright 2006-2008 INRIA - CIRAD - INRA
# Copyright 2006-2024 INRIA - CIRAD - INRAE
#
# File author(s): Samuel Dufour-Kowalski <[email protected]>
# Christophe Pradal <[email protected]>
Expand All @@ -24,8 +24,8 @@
from openalea.core.interface import * #IGNORE:W0614,W0401
from openalea.core.observer import lock_notify
from openalea.visualea.node_widget import NodeWidget
from openalea.plantgl.gui.curve2deditor import Curve2DEditor, Curve2DConstraint, FuncConstraint
from openalea.plantgl.gui.nurbspatcheditor import NurbsPatchEditor
from openalea.plantgl.gui.curve2deditor import Curve2DEditorView, Curve2DConstraint, FuncConstraint
from openalea.plantgl.gui.nurbspatcheditor import NurbsPatch3DEditorView
from openalea.plantgl.scenegraph import NurbsCurve2D
from .pgl_interface import ICurve2D, INurbsPatch
from pickle import loads
Expand Down Expand Up @@ -76,7 +76,7 @@ def notify(self, sender, event):
'''


class Curve2DWidget(NodeWidget, Curve2DEditor):
class Curve2DWidget(NodeWidget, Curve2DEditorView):
"""
Curve2D widget
"""
Expand All @@ -89,7 +89,7 @@ def isDefault(crv):
def __init__(self, node, parent):
"""
"""
Curve2DEditor.__init__(self, parent)
Curve2DEditorView.__init__(self, parent)
NodeWidget.__init__(self, node)

self.notify(node, ('input_modified',))
Expand Down Expand Up @@ -176,7 +176,7 @@ def notify(self, sender, event):
'''


class NurbsPatchWidget(NodeWidget, NurbsPatchEditor):
class NurbsPatchWidget(NodeWidget, NurbsPatch3DEditorView):
"""
NurbsPatchEditor widget
"""
Expand All @@ -185,7 +185,7 @@ class NurbsPatchWidget(NodeWidget, NurbsPatchEditor):
def __init__(self, node, parent):
"""
"""
NurbsPatchEditor.__init__(self, parent)
NurbsPatch3DEditorView.__init__(self, parent)
NodeWidget.__init__(self, node)

self.notify(node, ('input_modified',))
Expand All @@ -198,7 +198,7 @@ def __init__(self, node, parent):
@lock_notify
def valueChanged(self):
""" update value """
patch = self.getNurbsPatch()
patch = self.getNurbsObject()
self.node.set_input(0, patch)

def notify(self, sender, event):
Expand Down
Loading

0 comments on commit b79247f

Please sign in to comment.