DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Future of SimpleGraph

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
shternlib
Member


Joined: 28 Jun 2004
Posts: 5
Location: Russia

PostPosted: 28/06/04 07:38    Post subject: Future of SimpleGraph Reply with quote

Hi. Where can I know about your feature plans of TSimpleGraph? Do you plan to make polylines? Thanks.
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 386
Location: Tehran, Iran

PostPosted: 28/06/04 09:24    Post subject: Reply with quote

Frankly, no future plan!

Defining a new polyline node is very easy. You just need to subclass a new class from TPloygonalNode and override two simple methods.

For example here is the definitian of TTriangularNode:

Code:
TTriangularNode = class(TPolygonalNode)
  protected
    function GetMaxTextRect: TRect; override;
    class procedure DefineVertices(const ARect: TRect; var Points: TPointArray); override;
  end;

class procedure TTriangularNode.DefineVertices(const ARect: TRect;
  var Points: TPointArray);
begin
  SetLength(Points, 3);
  with ARect do
  begin
    with Points[0] do
    begin
      X := (Left + Right) div 2;
      Y := Top;
    end;
    with Points[1] do
    begin
      X := Right;
      Y := Bottom;
    end;
    with Points[2] do
    begin
      X := Left;
      Y := Bottom;
    end;
  end;
end;

function TTriangularNode.GetMaxTextRect: TRect;
begin
  with Result do
  begin
    Left := (Vertices[0].X + Vertices[2].X) div 2;
    Top := (Vertices[0].Y + Vertices[2].Y) div 2;
    Right := (Vertices[0].X + Vertices[1].X) div 2;
    Bottom := Vertices[1].Y;
  end;
  OffsetRect(Result, -Left, -Top);
  IntersectRect(Result, Result, inherited GetMaxTextRect);
end;

By the way, to be able to read a newly defined node from a stream, you have to register its class to SimpleGraph as follow:

Code:
TSimpleGraph.Register(TTriangularNode);

That's all.
Back to top
View user's profile Send e-mail Visit poster's website
shternlib
Member


Joined: 28 Jun 2004
Posts: 5
Location: Russia

PostPosted: 28/06/04 10:43    Post subject: I mean polyline link Reply with quote

Is it possible to make polyline link? F.e. link from node A to node B and another link from B to A?


polylink.JPG
 Description:
 Filesize:  5.77 KB
 Viewed:  297 Time(s)

polylink.JPG


Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 386
Location: Tehran, Iran

PostPosted: 28/06/04 11:56    Post subject: Reply with quote

For this purpose you have to subclass TGraphLink, and add some intermediate points to the link. Also, the new link class should be registered to the SimpleGraph, as same as node classes.

To be honest, it's lot of work and because of that I didn't implement it myself. Who knows, maybe in future I do it.
Back to top
View user's profile Send e-mail Visit poster's website
shternlib
Member


Joined: 28 Jun 2004
Posts: 5
Location: Russia

PostPosted: 28/06/04 13:53    Post subject: :D Reply with quote

And what is needed to make this moment closure?
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 386
Location: Tehran, Iran

PostPosted: 28/06/04 14:00    Post subject: Reply with quote

(Motivation + Spare Time) . (a lot)
Back to top
View user's profile Send e-mail Visit poster's website
shternlib
Member


Joined: 28 Jun 2004
Posts: 5
Location: Russia

PostPosted: 28/06/04 14:03    Post subject: Reply with quote

Motivation is what? Cool If I understand you correct, spare time is consequence of motivation
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 386
Location: Tehran, Iran

PostPosted: 28/06/04 14:33    Post subject: Reply with quote

Currently I have three open projects in my hands. When I finished them, I may improve TGraphLink class to fit in your needs.
Back to top
View user's profile Send e-mail Visit poster's website
shternlib
Member


Joined: 28 Jun 2004
Posts: 5
Location: Russia

PostPosted: 28/06/04 14:40    Post subject: Reply with quote

Does anything can change the priority of your projects? I mean making TSimpleGraph before those three projects Smile
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 386
Location: Tehran, Iran

PostPosted: 28/06/04 16:04    Post subject: Reply with quote

Two of them are contracted projects and I cannot postpone them.
Back to top
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group