Zoom behavior in TSimpleGraph

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Zoom behavior in TSimpleGraph

Postby elias » March 22nd, 2006, 1:56 pm

Very busy but found time to test last version. Very interesting behavior of the zoom. For I've seen, it zooms taking like reference the center of control when possible.
Many time thinking around the idea (but no much time and knowledge of the zoom methods to make it working) of making a browser-Zoom. I'll explain it with these draws.
Attachments
Zooming2.JPG
Zooming2.JPG (101.25 KiB) Viewed 5042 times
Zooming1.JPG
Zooming1.JPG (64.17 KiB) Viewed 5042 times
elias
Senior Member
Senior Member
 
Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Postby Kambiz » March 22nd, 2006, 4:50 pm

Honestly, I couldn't understand the different behaviors you described. :oops:

I added the following methods to SimpleGraph:

Code: Select all
function ChangeZoom(NewZoom: Integer; Origin: TGraphZoomOrigin): Boolean;
function ChangeZoomBy(Delta: Integer; Origin: TGraphZoomOrigin): Boolean;

The Origin parameter is one of the following values:
  • zoTopLeft
    Tries to keep top left curnor of the current view visible.
  • zoCenter
    Tries to keep center of the current view, still centered.
  • ZoCursor
    Tries to keep point under cursor, still under cursor.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 23rd, 2006, 3:42 am

Kambiz wrote:I added the following methods to SimpleGraph:

Code: Select all
function ChangeZoom(NewZoom: Integer; Origin: TGraphZoomOrigin): Boolean;
function ChangeZoomBy(Delta: Integer; Origin: TGraphZoomOrigin): Boolean;

The Origin parameter is one of the following values:
  • zoTopLeft
    Tries to keep top left curnor of the current view visible.
  • zoCenter
    Tries to keep center of the current view, still centered.
  • ZoCursor
    Tries to keep point under cursor, still under cursor.


Is this exactly what I wanted but didn't like to ask after all that effort of yours. Now we can zoom in the way we like.

Let me add some ACAD terminology for the future:
  • Zoom Range: zoom to the marquee area.
  • Zoom Extends: zoom to the bounding rect of the graph.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby HPW » March 23rd, 2006, 6:42 am

Let me add some ACAD terminology for the future


Hey, nice to see another ACAD user and delphi-fan!
My main-language is still autolisp. :wink:
Hans-Peter
HPW
Moderator
Moderator
 
Posts: 238
Joined: February 25th, 2006, 10:19 am
Location: Germany

Postby kokkoras » March 23rd, 2006, 10:14 am

HPW wrote:
Let me add some ACAD terminology for the future


Hey, nice to see another ACAD user and delphi-fan!
My main-language is still autolisp. :wink:


I just used to teach ACAD for a long time (~5000 hours). I am out of it since 2004 though (missing it :cry: ).


EDIT: I am too old for autolisp (even my account says I am a senior member :lol: :lol: :lol: ). Besides, my favorites was always Prolog and Delphi.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby HPW » March 23rd, 2006, 11:28 am

.. I am too old for autolisp


I do not believe that, but I am a huge lisp-fan at all.
So I am not objective. :lol:

Through my plugin even SimpleGraph gets lispy now, because the plugin support a direct-call interface to newLISP.dll :wink:

I am quite involved on the newLISP project and its windows DLL-port.
http://www.newlisp.org :!:

Easy using even from delphi:
Code: Select all
type
  TNewLispCall = function(string1: PChar): PChar;
  stdcall;
//...

var     
  DllCall: TNewLispCall;
//...
  Handle := 0;
  Handle := LoadLibrary(PChar('newlisp.dll'));
  if Handle <> 0 then
  begin @DllCall := GetProcAddress(Handle, PChar('newlispEvalStr'));
    if Assigned(DllCall) then
    begin
      RetStr := nil;
      RetStr := DllCall(PChar(DllParam1));
    end;
  end;
Hans-Peter
HPW
Moderator
Moderator
 
Posts: 238
Joined: February 25th, 2006, 10:19 am
Location: Germany

Postby kokkoras » March 23rd, 2006, 11:45 am

HPW wrote:
.. I am too old for autolisp


I do not believe that, but I am a huge lisp-fan at all.
So I am not objective. :lol:

Through my plugin even SimpleGraph gets lispy now, because the plugin support a direct-call interface to newLISP.dll :wink:


I mean, I don't have time to invest on new langs, unless I got paid.

I believe that at some point in the future, the nodes should store code in some interpreted lang, name it Java, Lisp, Prolog, VB, scripting Pascal, whatever.

I am a big fan of declarative langs but unfortunately we live in a C/C++ world. If MS or Borland had developed shining Prolog/Lisp IDEs the world would have been different. Even Delphi is strangling.

EDIT: of course, we are off-topic :roll:
Last edited by kokkoras on March 23rd, 2006, 7:07 pm, edited 1 time in total.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby HPW » March 23rd, 2006, 11:51 am

I believe that at some point in the future, the nodes should store code in some interpreted lang, name it Java, Lisp, Prolog, VB, scripting Pascal, whatever.


Thats why I had ask Kambiz for the TStingslist-property!
The answer is the new data-property, which I want to use for this soon.

I am a big fan of declarative langs but unfortunately we live in a C/C++ world. If MS or Borland had developed shining Prolog/Lisp IDEs the world would have been different. Even Delphi is strugling.


When you mean the .NET future the answer for me is LSharp.NET
http://lsharp.sourceforge.net/
(Another Lisp-project I am involved)

PS: Sorry again to be so off-topic :oops:
Hans-Peter
HPW
Moderator
Moderator
 
Posts: 238
Joined: February 25th, 2006, 10:19 am
Location: Germany

Postby Kambiz » March 23rd, 2006, 6:50 pm

Do you know what? About 10-11 years ago, I used to work with ACAD too. ;)
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 23rd, 2006, 7:01 pm

Kambiz wrote:Do you know what? About 10-11 years ago, I used to work with ACAD too. ;)


It is all clear to me now! It sounds like an international conspirancy theory :lol: :lol: . I am also a die hard fan of Total Commander.
http://www.ghisler.com/
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby elias » March 23rd, 2006, 7:15 pm

Ok, I was talking about just an algorithm; said with common words, when i have several objects at a graph, and i want to zoom one of them, I simply put the cursor over the desired point and zoom in. With this algorithm, the point starts to center at the control until it is completely centered. This corresponds to picture #2.
Zooming out cannot follow this way, so I just put the cursor where I'd want to have it (relative to the graph) after zoommig (Explained in #1).
This way pan-mode would not be necessary to browse around the graph.
¿Isn't anybody who understand me?
elias
Senior Member
Senior Member
 
Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Postby elias » March 23rd, 2006, 7:19 pm

Well, I'll try to find any time to implement it. I think you'll see the result amazing.
elias
Senior Member
Senior Member
 
Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Postby kokkoras » March 23rd, 2006, 7:26 pm

elias wrote:Well, I'll try to find any time to implement it. I think you'll see the result amazing.


What you want is clear now.

Try Alt+drag around your object. It is what you asked for.

You can also get the extends (bounding rect) of your object and zoom at that area with one command.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » March 23rd, 2006, 7:38 pm

elias wrote:Ok, I was talking about just an algorithm; said with common words, when i have several objects at a graph, and i want to zoom one of them, I simply put the cursor over the desired point and zoom in. With this algorithm, the point starts to center at the control until it is completely centered. This corresponds to picture #2.
Zooming out cannot follow this way, so I just put the cursor where I'd want to have it (relative to the graph) after zoommig (Explained in #1).
This way pan-mode would not be necessary to browse around the graph.
¿Isn't anybody who understand me?


I think I got what you mean.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 23rd, 2006, 7:53 pm

Talking about zoom, let's put them all together. IMHO the expected behaviours should be the following:

1. WheelZoom: when zooming with the mousewheel the point under the mouse should stay still.
2. Zoom Center: When clicking somewhere to zoom, that point, should become the center of the zoomed picture.
3. Zoom Extends: should maximaly zoom the graph bounds
4. Zoom Range: should maximaly zoom the selected area (Alt+Drag) trying to keep in view the the bigger dimension.
5. No zoom: should return to 100%

Kambiz, which one is currently not supported? (I mean, it's impossible/hard to implement due to library limitations)
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Next

Return to DELPHI AREA Projects

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron