The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 drawing lots of lines
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

couturier

France
291 Posts

Posted - 07/07/2016 :  04:45:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2016
Operating System:7

Hi,

I want to draw a huge amount of lines in a graph (many hundreds).
Each line property can be accessed in vectors (position, color, name).
I've been using LT but was wondering if I could speed things up with OC.

So far, only way I found was to loop through my vectors and use CreateGraphObject, set up a tree style, UpdateThemeIDs and ApplyFormat.

In the end, time execution is about the same. Looks like UpdateThemeIDs and ApplyFormat are highly time consumming.
Is there any way to massively create, set and apply style in one shot (maybe with Collection<GraphObject> grobjcollection) ?

Edited by - couturier on 07/07/2016 06:05:09 AM

Castiel

343 Posts

Posted - 07/12/2016 :  05:41:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by couturier

Origin Ver. and Service Release (Select Help-->About Origin): 2016
Operating System:7

Hi,

I want to draw a huge amount of lines in a graph (many hundreds).
Each line property can be accessed in vectors (position, color, name).
I've been using LT but was wondering if I could speed things up with OC.

So far, only way I found was to loop through my vectors and use CreateGraphObject, set up a tree style, UpdateThemeIDs and ApplyFormat.

In the end, time execution is about the same. Looks like UpdateThemeIDs and ApplyFormat are highly time consumming.
Is there any way to massively create, set and apply style in one shot (maybe with Collection<GraphObject> grobjcollection) ?



To create objects, I suppose you may have a try of
Layer::CreateShapeGraphObjects()

Not sure how to apply style in that way.

妾+   午旦  妹罕妾  妾伊    用仇  妾/     岫ㄞ
 妾京用 仍巨  件 侈   件戶' 甘岫平   /欠  白岫妹
   併             艮          岫  奈 白   岫
                              岫
Go to Top of Page

couturier

France
291 Posts

Posted - 07/12/2016 :  12:24:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Interesting.

Played a bit with the options but looks like all the objects are joined together, so no possibility to edit/delete them separately afterwards.

Thanks anyway
Go to Top of Page

Castiel

343 Posts

Posted - 07/13/2016 :  06:40:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by couturier

Interesting.

Played a bit with the options but looks like all the objects are joined together, so no possibility to edit/delete them separately afterwards.

Thanks anyway



void create_line_objects()
{
    vector<double> vxPos = {1.0,3.5,3.5,1.5,1.5, 1,4, 2,2, 1,4, 3,3};
    vector<double> vyPos = {2.5,2.5,0.5,0.5,3.0, 1,1, 0,3, 2,2, 0,3};
    vector<uint> vShapeIndex = {0, 5, 7, 9, 11};
    vector<uint> vBlockIndex = {0, 1, 2, 3, 4};

    GraphPage gp;
    gp.Create();
    GraphLayer gl;
    gl = gp.Layers();

    gl.CreateShapeGraphObjects(vxPos, vyPos, vShapeIndex, vBlockIndex, "lines", 0, CPO_POLYLINE);
}


妾+   午旦  妹罕妾  妾伊    用仇  妾/     岫ㄞ
 妾京用 仍巨  件 侈   件戶' 甘岫平   /欠  白岫妹
   併             艮          岫  奈 白   岫
                              岫
Go to Top of Page

couturier

France
291 Posts

Posted - 07/20/2016 :  03:56:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
One again, thanks a lot Castiel for your help.

Still a few issues with the script, and maybe some people from Olab could give advice as well:
- in the script above, as well as in the script example in Layer::CreateShapeGraphObjects help page, the names of the objects should increment (lines0, lines1, ...). They all have the same name

- style: any method or hidden option for creating objects with different color than black ?

- any method for massively editing style ?
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000