[Chameleon-dev] [Bug 1135] New: ROIPolygonTool widget -
goROIPolygonObj properties are lost
bugzilla-daemon at bugzilla.maptools.org
bugzilla-daemon at bugzilla.maptools.org
Mon Sep 5 02:57:04 EDT 2005
http://bugzilla.maptools.org/show_bug.cgi?id=1135
Summary: ROIPolygonTool widget - goROIPolygonObj properties are
lost
Product: Chameleon
Version: 2.2
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Widget
AssignedTo: chameleon-dev at lists.maptools.org
ReportedBy: jacob.delfos at maunsell.com
I *think* this may be a bug....
I am trying to access the aNodeCoords array, to get the nodes for the polygon
object. However, it is always empty after the polygon is finished. This makes it
impossible to get the nodes out for polygons that have already been created.
On line 646, the polygon is closed (finished), added to goCWCROIManager, and
ROIPolygonToolClearPolygon() is called. Here, goROIPolygonObj is "emptied", by
re-initialising the aNodeCoords array holding the nodes. But because
goROIPolygonObj is passed by reference when added to goCWCROIManager, it means
the aNodeCoords array of the finished polygon is emptied as well.
It appears that polygons added to goCWCROIManager all point to the same
goROIPolygonObj. When I put in code to create a new instance of a CWCPolygonROI
object, the problem goes away. I have inserted the following lines on line 729,
before "//reset":
// create new object, not to overwrite the old one
goROIPolygonObj = new CWCPolygonROI({$nPoints});
goROIPolygonObj.pointImageWidth = 6;
goROIPolygonObj.nodeImageWidth = 7;
goROIPolygonObj.left = gMapWhspc;
goROIPolygonObj.top = gMapWvspc;
goROIPolygonObj.right = gMapWhspc + gMapWiWidth;
goROIPolygonObj.bottom = gMapWvspc + gMapWiHeight;
goROIPolygonObj.edgeColor = goCWCROIManager.szEdgeColor;
goROIPolygonObj.edgeWidth = goCWCROIManager.nEdgeWidth;
goROIPolygonObj.fillLayer = goCWCROIManager.bUseFill;
goROIPolygonObj.fillColor = goCWCROIManager.szFillColor;
goROIPolygonObj.fillOpacity = goCWCROIManager.nFillOpacity;
// show the polygon
goROIPolygonObj.Show();
I can update the CVS, but would prefer if someone more experienced with this
widget would double-check.
Jacob
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
Please do NOT reply to this email, use the link above instead to
login to bugzilla and submit your comment. Any email reply to this
address will be lost.
More information about the Chameleon-dev
mailing list