<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to add new fields in the inspector for my custom class ?]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">I have created my own custom class that derives from SBStructuralModel and I want to display an important information of my class in the brand new SAMSON inspector. How should I do that ?</p>
<p dir="auto">Thanks in advance !<br />
Yassine</p>
]]></description><link>https://forum.samson-connect.net/topic/27/how-to-add-new-fields-in-the-inspector-for-my-custom-class</link><generator>RSS for Node</generator><lastBuildDate>Wed, 10 Jun 2026 05:53:37 GMT</lastBuildDate><atom:link href="https://forum.samson-connect.net/topic/27.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 Feb 2018 10:30:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to add new fields in the inspector for my custom class ? on Fri, 16 Feb 2018 10:57:50 GMT]]></title><description><![CDATA[<p dir="auto">Here is an example for a Visual model, you can simply adapt that:</p>
<p dir="auto">1 Create and implements the functions</p>
<pre><code>SBQuantity::length getVal1() const;
float getVal2() const;

void setVal1(SBQuantity::length val1);
void setVal2(float val2);
</code></pre>
<p dir="auto">2 Then in the descriptor(you may have to create the descriptor if not already done) of your node, add:</p>
<pre><code>SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE(SBQuantity::length, MyVisualModel, Val1, "value 1", "My Parameter");
SB_ATTRIBUTE_READ_WRITE(float, MyVisualModel, Val2, "value 2", "My Parameter");

SB_INTERFACE_END;
</code></pre>
]]></description><link>https://forum.samson-connect.net/post/90</link><guid isPermaLink="true">https://forum.samson-connect.net/post/90</guid><dc:creator><![CDATA[Guillaume]]></dc:creator><pubDate>Fri, 16 Feb 2018 10:57:50 GMT</pubDate></item><item><title><![CDATA[Reply to How to add new fields in the inspector for my custom class ? on Fri, 16 Feb 2018 10:59:24 GMT]]></title><description><![CDATA[<p dir="auto">Awesome !</p>
<p dir="auto">Thank you guys, you rock !</p>
<p dir="auto">Yassine</p>
]]></description><link>https://forum.samson-connect.net/post/93</link><guid isPermaLink="true">https://forum.samson-connect.net/post/93</guid><dc:creator><![CDATA[Yassine]]></dc:creator><pubDate>Fri, 16 Feb 2018 10:59:24 GMT</pubDate></item><item><title><![CDATA[Reply to How to add new fields in the inspector for my custom class ? on Fri, 16 Feb 2018 10:57:29 GMT]]></title><description><![CDATA[<p dir="auto">Indeed, I will edit my answer</p>
]]></description><link>https://forum.samson-connect.net/post/92</link><guid isPermaLink="true">https://forum.samson-connect.net/post/92</guid><dc:creator><![CDATA[Guillaume]]></dc:creator><pubDate>Fri, 16 Feb 2018 10:57:29 GMT</pubDate></item><item><title><![CDATA[Reply to How to add new fields in the inspector for my custom class ? on Fri, 16 Feb 2018 10:52:06 GMT]]></title><description><![CDATA[<p dir="auto">All the getters must be 'const' :</p>
<pre><code>SBQuantity::length getVal1() const;
float getVal2() const;
</code></pre>
]]></description><link>https://forum.samson-connect.net/post/91</link><guid isPermaLink="true">https://forum.samson-connect.net/post/91</guid><dc:creator><![CDATA[Francois]]></dc:creator><pubDate>Fri, 16 Feb 2018 10:52:06 GMT</pubDate></item><item><title><![CDATA[Reply to How to add new fields in the inspector for my custom class ? on Fri, 16 Feb 2018 10:57:50 GMT]]></title><description><![CDATA[<p dir="auto">Here is an example for a Visual model, you can simply adapt that:</p>
<p dir="auto">1 Create and implements the functions</p>
<pre><code>SBQuantity::length getVal1() const;
float getVal2() const;

void setVal1(SBQuantity::length val1);
void setVal2(float val2);
</code></pre>
<p dir="auto">2 Then in the descriptor(you may have to create the descriptor if not already done) of your node, add:</p>
<pre><code>SB_INTERFACE_BEGIN;
SB_ATTRIBUTE_READ_WRITE(SBQuantity::length, MyVisualModel, Val1, "value 1", "My Parameter");
SB_ATTRIBUTE_READ_WRITE(float, MyVisualModel, Val2, "value 2", "My Parameter");

SB_INTERFACE_END;
</code></pre>
]]></description><link>https://forum.samson-connect.net/post/90</link><guid isPermaLink="true">https://forum.samson-connect.net/post/90</guid><dc:creator><![CDATA[Guillaume]]></dc:creator><pubDate>Fri, 16 Feb 2018 10:57:50 GMT</pubDate></item></channel></rss>