Nested parameters with ofxGui and ofParameters

Hello, I’m using ofxGui and ofParameter in order to save the seetings of the GUI in differents XML files. Everything works fine, I can save and load parameters .
the xml file look like this:

<rule>F -> |[-F][+F]</rule>

Now i would like is to read(not to modify, in this case) a field as a nested field, that can contains multiple items, like the field rules in this example:

  <rule>B -> F[-B]+B</rule>
  <rule>F -> FF</rule>

I first tried something obvious like ofParameter<vector<string>> rules, but ofParameter does not support vectors. Is there a workaround for this case?

ofParmaterGroup should do, you can anidate an ofParameterGroup into another and ofParameter into an ofParameterGroup and will give you the xml you are trying to create.

ofParameter of a vector should work but won’t be serializable since vector doesn’t implement the stream operator

Thank you. It works only if I specify the structure and the values of the parameters in the setup.

    ofParameterGroup selectedRules;
    ofParameter<string> singleRule;
    singleRule.set("rule", "FF");

But I can not specify the number of the parameter contained in the group in the setup call, because sometimes the node contains 3 nested node, sometimes only one.
I think i go for a simple string and a character that acts as delimiters between the different values.

Hi Arturo,

Sorry to bring back this old thread. Is there a way now to serialise ofParameter<vector>?
I tried to implement stream operators to vector but since ofParameter class is not aware of those implementations seems not to work.

Is there anything I could do, that is not manually checking if a parameter is a vector, and serializing / deserializing it manually? That’s what I’m already doing in: