Inheriting fields in the inspector class and vector fields
-
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
-
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.
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