Hi Andrew,

What I am suggesting is that you only call methods like GetEdges once, save the 
result into a local variable and then use the local variable in the inner loops 
instead.

e.g. You should only call to GetEdges (and many other mesh methods) once in 
your code.

CEdgeRefArray edges = curMesh.GetEdges();

for...
    for...
             do_something(edges.GetItem(i));

Whenever you see a long sting on repeated calls (a().b().c()...) you should ask 
yourself whether you can save the intermediate results in a local variable and 
use that instead.
--
Brent

From: [email protected] 
[mailto:[email protected]] On Behalf Of Andrew Prostrelov
Sent: 29 July 2017 07:43
To: Official Softimage Users Mailing List. 
https://groups.google.com/forum/#!forum/xsi_list 
<[email protected]>
Subject: Re: EdgeRing ALG for n-gons

Can you tell a bit more about optimisation and efficient calls pls.
I have lots of question about XSI objects and classes best practices.
If i understand your suggestion right i should alwayse preffer XSI reference 
containers (EdgeRefArray etc) to value containers like CLongArray, CValueArray 
etc. Or not ?
I also often use curMesh.GetEdges().GetItem() aproach to get one specific 
component instance with known index.
I suppose this way also is slow. What should i do in this situation ?
------
Softimage Mailing List.
To unsubscribe, send a mail to [email protected] with 
"unsubscribe" in the subject, and reply to confirm.

Reply via email to