instantreality forum
news: Welcome to the instantreality forums!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 21, 2018, 01:24:01 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: [AEI/C++] setting MFColor field with AEI::Client::setFieldValue  (Read 5847 times)
Rauy
Newbie
*
Posts: 5


View Profile
« on: August 27, 2007, 01:05:25 pm »

Hi,
Im working on a project using AEI.
I try to set the Colors in an IndexedFaceSet. This IndexedFaceset is in an Inline Node.
So I have to use Namespaces.

Code in the .wrl-file:
[...]
color DEF wpcolor Color
      {
          color [
         0.437500 1.000000 0.562500,
[...]

Code in the .cpp-file:
[...]
avInstance->setFieldValue("workpiece::wpcolor","color",newColor.str().c_str());
[...]

workpiece:    is the namespacename of the Inline-Node
newColor:     is the String with the new Colors (data: "r g b, r g b, ..., r g b" i also tried
                    "[r g b, r g b, ... r g b]" same results)
                    this are in my case 51600 Color-Values

The Problem:

The new Colors are not added correctly.
But I'm sure that they are in correct order in the string, becauseI I wrote a new .wrl-file
with my c++-program and loaded it in the inline node. But this had a rather bad
performance, because of the size of the .wrl-file (>14MB).

So my question is, what's wrong.  Wink Is my string formated wrong? should I use a different function?

I hope this is the right forum for that kind of question
thanks for the answers

Stefan
Logged
jbehr
Administrator
Full Member
*****
Posts: 155


View Profile
« Reply #1 on: August 28, 2007, 04:04:50 pm »

Hi,

well, should work.

Some ideas which could help:

You could use the web-interface to check the field value.
You could try to send fewer values (not 50000).
You could check if there is any WARNING/FATAL output on the Avalon side?

regards,
johannes
Logged
Rauy
Newbie
*
Posts: 5


View Profile
« Reply #2 on: August 29, 2007, 01:43:34 pm »

Quote
You could use the web-interface to check the field value.

This is something I forgot to mention. The web-interface doesn't show the
values of that field. Ok sometimes it does it. I have no idea it is so.
same problem appears, if I try to get the value with the function getFieldValue.
Only sometimes I get the values. The string I get is empty.
I also tested this with the working version. (writing a new vrml file)
same results.
If I get  values they are in correct order, but in the scene they are not

Quote
You could try to send fewer values (not 50000).

I also thought about that. The problem is I am working with a given model.
The color values are output from a fem-analysis. they are representing
temperature values.
I could try to write a testfile with fewer values, but i hoped that i could avoid
that extrawork.
If the number of values is the problem, then the function setfieldvalue is useless
for our purpose.

Quote
You could check if there is any WARNING/FATAL output on the Avalon side?

There are no such outputs.

I have another question:
This is a question about using qt-forms as textures.
I used them many times getting values from them, but now I tried to get
values in them. I tried to route float/int values to a spinbox. (the other direction is working properly).
I get this errors:
FATAL   Avalon   Can't create ROUTE >Tunnel.min< TO >scalagui.min<: Invalid inSlot
FATAL   Avalon   Can't create ROUTE >Tunnel.max< TO >scalagui.max<: Invalid inSlot
they have the same datatypes SFloat/SFInt32 (i tested both)
the connection to the qtobjects is working (i got no errormessages from that)

Quote
regards,
johannes

regards
stefan
Logged
Rauy
Newbie
*
Posts: 5


View Profile
« Reply #3 on: August 29, 2007, 02:33:42 pm »

OK the problem with routing into the qtform is solved.
it was my fault. i didn't used the right name. Embarrassed
Logged
jbehr
Administrator
Full Member
*****
Posts: 155


View Profile
« Reply #4 on: September 03, 2007, 12:22:25 pm »

Quote
You could use the web-interface to check the field value.

This is something I forgot to mention. The web-interface doesn't show the
values of that field. Ok sometimes it does it. I have no idea it is so.
same problem appears, if I try to get the value with the function getFieldValue.
Only sometimes I get the values. The string I get is empty.
I also tested this with the working version. (writing a new vrml file)
same results.
If I get  values they are in correct order, but in the scene they are not

Quote
You could try to send fewer values (not 50000).

I also thought about that. The problem is I am working with a given model.
The color values are output from a fem-analysis. they are representing
temperature values.
I could try to write a testfile with fewer values, but i hoped that i could avoid
that extrawork.
If the number of values is the problem, then the function setfieldvalue is useless
for our purpose.

Quote
You could check if there is any WARNING/FATAL output on the Avalon side?

regards
stefan

For static Scenes the System optimizes some field values.
What kind of runtime system (e.g InstantPlayer, sav) you are using on what kind of OS?

Regards
johannes
Logged
Rauy
Newbie
*
Posts: 5


View Profile
« Reply #5 on: September 03, 2007, 12:42:56 pm »

we are using sav. our OS is Suse 10.0.

stefan
Logged
jbehr
Administrator
Full Member
*****
Posts: 155


View Profile
« Reply #6 on: September 07, 2007, 10:18:15 am »

What Version is it? Is it from the InstantReality package or not?

You could try to set some 'forbidFieldFree' ContextSetup-Parameter values.
With a current, not more than 1-2 years, old sav version you can set
it on the command line. Just try 'sav --help' to get the parameter and
values.

This should stop the automatic field-free optimization that kills your
update process.

regards
johannes
Logged
stefan
Newbie
*
Posts: 1


View Profile
« Reply #7 on: September 11, 2007, 02:01:37 pm »

Hi,

I used --forbidFieldFree TRUE. It worked, I could see the values in the avalon webInterface. The color-values in the webInterface where the the same I set with setFieldValue. But they where still not displayed correctly.
But because of your hint and the command line help I tried some other parameters.
With --forbidSingleIndex TRUE the Color-values are now set correctly.
Now it is all displayed correct and it is faster.

thanks for the help

regards
Stefan
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.15 | SMF © 2011, Simple Machines