visualdatatools.com Forum Index visualdatatools.com
Discussion for DataTank and DataGraph
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Setting a magnify command.

 
Post new topic   Reply to topic    visualdatatools.com Forum Index -> DataGraph Framework
View previous topic :: View next topic  
Author Message
sussillo



Joined: 30 Apr 2009
Posts: 137

PostPosted: Thu Oct 29, 2009 4:09 pm    Post subject: Setting a magnify command. Reply with quote

Hi David,

I see that the DGMagnifyCommand is fully fleshed out but I can't figure out how to create one / add it to the controller. There is no createMagnifyCommand and any form of adding it via addCommandWithType:@"Magnify" doesn't seem to work either. Did I miss something?

Thank you,
-David
_________________
David Sussillo
Back to top
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1964
Location: Chapel Hill, NC

PostPosted: Fri Oct 30, 2009 7:00 am    Post subject: Reply with quote

Added this.

David
Back to top
View user's profile Send private message Send e-mail
sussillo



Joined: 30 Apr 2009
Posts: 137

PostPosted: Fri Oct 30, 2009 12:45 pm    Post subject: Reply with quote

Thanks it's being created now. However, I'm still having issues setting the properties of the class. Specifically, I get
Code:

*** -[DGCommand setYRange:]: unrecognized selector sent to instance 0x156a5fc0


and also setXRange, or the setXRangeString

Also, the magnify command is axis specific. I'm trying to use it like the Loupe tool, which the user selects from the context menu, and which doesn't care which axis is actually defined. Is there any way you could make the magnify tool have an option like this? Otherwise, I have to do mouse point location testing, check which axis the mouse point is in, and then set those as the axis properties for the magnify command.

If you can't add an additional option, can you please explain what the mouse point needed for the DGController method (I mean mouse point relative to the view, the window or the screen:
-
Code:
 (BOOL)point:(NSPoint)p liesInsideXAxis:(int)axisNumber;


Thank you,
-David
_________________
David Sussillo
Back to top
View user's profile Send private message
sussillo



Joined: 30 Apr 2009
Posts: 137

PostPosted: Fri Oct 30, 2009 5:05 pm    Post subject: Reply with quote

Also, I tried to use the old methods to set basic parameters of the magnify command. The X range and Y range worked, but I couldn't set the fill (to white so the background is occluded), which has "unknown" type when using the "po" command in the debugger. Is this a bug or do I just not know how to set it?

Thank you,
-David
_________________
David Sussillo
Back to top
View user's profile Send private message
David
Site Admin


Joined: 25 Nov 2006
Posts: 1964
Location: Chapel Hill, NC

PostPosted: Fri Oct 30, 2009 7:06 pm    Post subject: Reply with quote

I fixed the Magnify command and uploaded a new framework.

The following commands convert back and fort and do hit tests.
Code:
// Convert from pixel to physical coordinates.
- (NSPoint)windowLocationInDrawingView:(NSPoint)locationInWindow;
- (double)convertXPoint:(double)xInPoints forAxis:(int)axisNumber;
- (double)convertYPoint:(double)yInPoints forAxis:(int)axisNumber;
- (double)convertToNiceXPoint:(double)xInPoints forAxis:(int)axisNumber;
- (double)convertToNiceYPoint:(double)yInPoints forAxis:(int)axisNumber;

// Testing where the mouse is
- (BOOL)point:(NSPoint)p liesInsideXAxis:(int)axisNumber;
- (BOOL)point:(NSPoint)p liesInsideYAxis:(int)axisNumber;


You can query the point, find out which axis it lies in and convert to physical coordinates. There are some methods missing that would make things easier for you, in particular to create a region in physical coordinates that has a specific size in pixel coordinates. I will look into making that easier with your use case in mind.

David
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    visualdatatools.com Forum Index -> DataGraph Framework All times are GMT - 3 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group