SAMSON Forum
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • SAMSON Connect
    • Get SAMSON

    Inheriting fields in the inspector class and vector fields

    Modeling
    2
    3
    2291
    Loading More Posts
    • 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
      Elisa last edited by

      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 Reply Quote 1
      • Stephane
        Stephane last edited by

        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 Reply Quote 2
        • E
          Elisa last edited by

          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 Reply Quote 0
          • First post
            Last post