Skip to content

Commit

Permalink
Fix errors in curve and surface widgets. Update all the OpenAlea nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
pradal committed Dec 18, 2024
1 parent b79247f commit 2436ac2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/openalea/plantgl/wralea/edition/__wralea__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
__name__ = "openalea.plantgl.edition"
__alias__ = ["vplants.plantgl.edition"]

__editable__ = True
__version__ = '0.0.2'
__license__ = 'CECILL-V2'
__authors__ = 'F. Boudon'
__authors__ = 'F. Boudon, C. Pradal'
__institutes__ = 'INRIA/CIRAD'
__description__ = 'PlantGL Edition nodes.'
__url__ = 'http://openalea.rtfd.io'
Expand All @@ -33,7 +34,7 @@
nodeclass = "nurbs",
widgetmodule = "openalea.plantgl.wralea.edition.pgl_interface_widget",
widgetclass = "NurbsPatchWidget",
inputs=(dict(name="nurbs", interface=None,),),
inputs=(dict(name="nurbs", interface=None,),dict(name="curve", interface=None,)),
outputs=(dict(name="nurbs",),),
lazy = False
)
Expand Down
26 changes: 13 additions & 13 deletions src/openalea/plantgl/wralea/edition/pgl_interface_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
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 Curve2DEditorView, Curve2DConstraint, FuncConstraint
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
Expand Down Expand Up @@ -94,13 +94,12 @@ def __init__(self, node, parent):

self.notify(node, ('input_modified',))

self.connect(self, QtCore.SIGNAL("valueChanged()"), \
self.valueChanged)
self.valueChanged.connect(self.onValueChanged)

self.window().setWindowTitle(node.get_caption())

@lock_notify
def valueChanged(self):
def onValueChanged(self):
""" update value """
crv = self.getCurve()
if crv and not self.isDefault(crv):
Expand Down Expand Up @@ -190,13 +189,14 @@ def __init__(self, node, parent):

self.notify(node, ('input_modified',))

self.connect(self, QtCore.SIGNAL("valueChanged()"), \
self.valueChanged)

#self.connect(self, QtCore.SIGNAL("valueChanged()"),
# self.valueChanged)
self.valueChanged.connect(self.onValueChanged)

self.window().setWindowTitle(node.get_caption())

@lock_notify
def valueChanged(self):
def onValueChanged(self):
""" update value """
patch = self.getNurbsObject()
self.node.set_input(0, patch)
Expand All @@ -215,10 +215,10 @@ def notify(self, sender, event):
pass

try:
crv = self.node.get_input(0)
patch = self.node.get_input(0)
except:
crv = INurbsPatch.default()
if not crv:
crv = INurbsPatch.default()
self.setNurbsPatch(crv)
patch= INurbsPatch.default()
if not patch:
patch = INurbsPatch.default()
self.setNurbsObject(patch)

0 comments on commit 2436ac2

Please sign in to comment.