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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 drawing lots of lines

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
couturier Posted - 07/07/2016 : 04:45:47 AM
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) ?
4   L A T E S T    R E P L I E S    (Newest First)
couturier Posted - 07/20/2016 : 03:56:29 AM
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 ?
Castiel Posted - 07/13/2016 : 06:40:56 AM
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);
}


©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦
couturier Posted - 07/12/2016 : 12:24:39 PM
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
Castiel Posted - 07/12/2016 : 05:41:39 AM
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.

©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000