Skip to content
  • Recent
  • Tags
  • Popular
  • SAMSON Connect
  • Get SAMSON
Collapse
SAMSON Forum
  1. Home
  2. Develop
  3. Modeling
  4. Inheriting fields in the inspector class and vector fields

Inheriting fields in the inspector class and vector fields

Scheduled Pinned Locked Moved Modeling
3 Posts 2 Posters 3.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    E
    Elisa
    wrote on last edited by
    #1

    Dear all, I have derived my won classes from SAMSON classes (for example, SBAtom), and I'm able to add custom fields to the inspector, but I would also like that the default inspector fields would be available. Do I need to code them or is there an easy way to "inherit" them?

    Also, how can I produce custom inspector fields that display positions? I have used:

    SB_ATTRIBUTE_READ_ONLY(SBPosition3 const&, MyAtomClass, Position, "Position", "Properties");

    But only the last coordinate (Z) is displayed.

    Thanks in advance,

    Elisa

    1 Reply Last reply
    1
    • StephaneS
      StephaneS
      Stephane
      wrote on last edited by
      #2

      Dear Elisa, there's no way right now to automatically inherit attributes, so you have to re-add them.
      There's a bug in the read-only position inspector, unfortunately, which is fixed in the upcoming 0.8.0. If possible, you can use a read-write inspector, or indeed write a new one. Maybe the simplest option is to have three read-only length attributes?

      SB_ATTRIBUTE_READ_ONLY(SBQuantity::length const&, MyAtomClass, X, "X", "Properties");
      SB_ATTRIBUTE_READ_ONLY(SBQuantity::length const&, MyAtomClass, Y, "Y", "Properties");
      SB_ATTRIBUTE_READ_ONLY(SBQuantity::length const&, MyAtomClass, Z, "Z", "Properties");
      

      I will add a tutorial about writing an inspector and I will let you know about it.

      1 Reply Last reply
      2
      • E
        E
        Elisa
        wrote on last edited by
        #3

        Dear Stephane,

        Thanks for the quick reply. I will add the position in three attributes for now. Looking forward to 0.8.0!

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Recent
        • Tags
        • Popular
        • SAMSON Connect
        • Get SAMSON