bugpyFormex - Bugs: bug #42014, pick points does not work in gl2

 
 

bug #42014: pick points does not work in gl2

Submitted by:  gianluca de santis <gianlucadesi>
Submitted on:  Mon 31 Mar 2014 10:53:00 AM UTC  
 
Category: GUISeverity: 3 - Normal
Item Group: Functionality errorStatus: Fixed
Privacy: PublicAssigned to: Benedict Verhegghe <bverheg>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 02 Apr 2014 09:39:33 AM UTC, comment #4:

About the reportDistances question: it is useful for many points, and you can define from which point the distances are measured: first pick the point to which you want to measure distances,
then add the other points to the selection.

We may want to change the report, having it display the point numbers instead of their index in the picked points list.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Wed 02 Apr 2014 08:46:14 AM UTC, comment #3:

Notice:

- when drawing an object, the original object is accessible from the resulting actor as actor.object

- actor.coords and actor.fcoords are 'live' attributes that are generated on demand (for visualization purposes only), and do not necessarily correspond with the actor.object.coords

- actor.object.points() returns the object's coords as a 2D array

- since commit c66373d there is now also actor.points() returning the same value

- hasattr() should not be used to test for an attribute of an Actor: it will indeed always return True. I am not sure if there is a way to fix that behavior. Instead, you should test whether actor.attribute is None.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Wed 02 Apr 2014 08:36:31 AM UTC, comment #2:

this seems to be fixed now. Should we adjust the reportDistances to work only with 2 points in tools_menu?

gianluca de santis <gianlucadesi>
Project Member
Tue 01 Apr 2014 11:12:52 AM UTC, comment #1:

in tools.py there are some problems with attributes of pyformex.opengl.drawable.Actor

1) if hasattr(actor, 'attr'):

is always true and actor.attr will give None if attr is not an attribute of actor.

one way to solve it is to replace
if hasattr(actor, 'attr'):
with
if 'attr' in dir(actor):

2) 'point' is not an attribute of actor whereas 'coords' is.
Should we use actor.coords or actor.points (would actor.coords work well with a Formex?) ? This is very important because it is needed in getCollection (get the coordinates of the picked points)

gianluca de santis <gianlucadesi>
Project Member
Mon 31 Mar 2014 10:53:00 AM UTC, original submission:

In tools.py there are some bugs:

--line 135
x = A.points()
should be replaced by
x = A.coords

--line 213
return obj.points()[items]
should be replaced by
return obj.coords[items]

--line 169:
reportDistances(K) it always start by reporting the distance of a point from itself (of course it is 0.0), and then the distances of all other points from the first one. I think this is useless, because the user cannot control the order of the picked points, and so he cannot know to which point the distance value is referring. I would suggest to restrict the use of reportDistance to two points only and report also the vector distace.

gianluca de santis <gianlucadesi>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bverheg (Posted a comment)
  • -unavailable- added by gianlucadesi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 02 Apr 2014 09:39:33 AM UTCbverhegOpen/ClosedOpen=>Closed
    Wed 02 Apr 2014 08:46:14 AM UTCbverhegItem GroupNone=>Functionality error
      StatusNone=>Fixed
      Assigned toNone=>bverheg

    Back to the top


    Powered by Savane 3.1-cleanup1