Editor Object Abstraction

2007-05-29

Editor Object Abstraction

Permalink 06:15:29 am, Categories: World Editor  

Since my last post, I realized how important SCF is in Crystal Space and how it could help me implement the property editor, tools, scene browser, and asset browser in a way that remains extensible.

In my last post, I talked about how I will implement the property editor. I'll now talk about how to do the rest of the major parts.

When something in the editor needs to know about what interfaces an object implements, it must query each possible SCF interface until it finds a match. When you have all of the CS interfaces, all of the CEL interfaces, and user-defined interfaces represented, there is a lot of querying going on.

Editor object diagram

Over the weekend, I spent some time to come up with a class EditorObject which abstracts each iBase* object in the editor. This class will keep a list of the interfaces which an object implements. Since I need to do a lot of SCF interface querying, and querying isn't particularly efficient, this cache should boost performance. More importantly, it provides an abstraction of an editor object--no matter what kind of interfaces the object implements, there should be a consistent way of getting/setting the name, parent, and getting the type (factory, instance, or other) and properties.

For each SCF interface, there will be an implementation of iInterfaceWrapperFactory. This will create instances of iInterfaceWrapper, only if the passed iBase* implements the particular interface which the iInterfaceWrapperFactory wraps (it determines this using QueryInterface). Each iInterfaceWrapper implementation will keep a pointer to the queried interface to carry out requests for the Name, Parent, Properties, etc.

Upon construction with an iBase* object, the EditorObject calls each registered iInterfaceWrapperFactory on the object, and stores the resulting iInterfaceWrappers in a list. It stores iInterfaceWrappers whose iInterfaceWrapperFactory::HasNameAttribute() and HasParentAttribute(), respectively, return true, separately, but in addition to the aforementioned list. It does this so it can provide constant time access to name and parent attributes. I can't think of a case at the moment in which one object has at least two interfaces which provide a Name attribute, but if this becomes a problem, certain interfaces could be given a higher priority than others. Even in this case, the other Name attribute can still be edited in the property editor.

How does the Scene Browser and Asset Browser know which objects to display? EditorObject asks each iInterfaceWrapperFactory for the type of the object implementing the interface. By type, I mean instance or factory. For those interfaces which do not help identify whether an object is an instance or a factory, they return unknown type. The EditorObject then stores the resulting type. Ideally, all interfaces return unknown, but one which returns either instance or factory. If there is a conflict where at least one interface says it is an instance type and at least one says it is a factory type, then the logical solution would be to set the resulting EditorObject type to unknown. In this case, both the Scene Browser and the Asset Browser could show it. This isn't as uncommon as it might sound, although I can't think of an example.

The Property Editor will also need to know about the properties from each interface. Here EditorObject will ask each interface for a list of properties. I still need to come up with a property representation which these GetProperties functions use. I don't think it would be a good idea to have the interface wrappers tied to wxPropertyGrid.

Instead of showing the interface name as the category in the property editor, there will be a name based on logical groupings of properties, like "Surface", for properties related to a surface. The idea is that there is a better grouping of properties for editing than the groupings dictated by the interfaces, which were designed to be good groupings for runtime. To implement this, each property will specifie under which category that property should be displayed. Ideally, these category names would be standardized. For the advanced user, the underlying interface name can be shown in the property description, and optionally, the properties could be grouped by interface.

Finally, Tools are interested in what interfaces an object has so that they can determine whether they are available. They can use EditorObject::HasInterface to query for interfaces using cached results.

On a more practical note...
My mentor kindly created a branch for me in https://crystalspace3d.org/svnroot/crystal/CSExtra/branches/soc/editor/
I've gotten both wxAUI and wxPropertyGrid samples to compile from within the CSExtra source tree, by including wxPropertyGrid sources in the tree and assuming wxAUI is built into wxWidgets. I should require wxWidgets 2.8+ since only that has wxAUI, but I haven't messed with the standard configure check yet. A more elegant way would be to make an additional check for wxAUI. In the case that it isn't present, I could have the PanelManager use some sort of static layout with splitters, but this isn't a priority.

In my next post, I'll talk a bit about registering objects with the editor and selections.

I hope to really iron out the design during this week so I can get a good start on the code. I'll try to come up with a schedule tomorrow. Signing out.

Trackback address for this post:

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

Comments, Trackbacks, Pingbacks:

Comment from: barbecue electrique [Visitor] · http://www.barbecue-electrique.info/
I know this if off topic but I'm looking into starting my own blog and was wondering what all is required to get setup? I'm assuming having
a blog like yours would cost a pretty penny? I'm not very internet smart so I'm not 100% positive. Any suggestions or advice would be greatly appreciated. Thank you
PermalinkPermalink 2013-02-14 @ 14:21
Comment from: disque-dur-interne [Visitor] · http://www.disque-dur-interne.net/disque-dur-sata/
Hey! Quick question that's entirely off topic. Do you know how to make your site mobile friendly? My site looks weird when browsing from my iphone 4. I'm trying to find a theme or plugin that might
be able to resolve this issue. If you have any recommendations, please share.
With thanks!
PermalinkPermalink 2013-02-15 @ 09:32
Comment from: http://www.prnewswire.com/news-releases/trilastin-review-and-latest-coupon-code-savings-released-at- [Visitor] · http://fellowship.se/index.php?title=Anv%C3%A4ndare:JeramyTap
I seriously hope you can ascertain to just take an appear for your self.
PermalinkPermalink 2013-02-15 @ 17:08
Comment from: Daniel@AskMobi [Visitor] Email · http://www.askmobi.com
I enjoyed reading this article.
PermalinkPermalink 2013-02-27 @ 12:38
Comment from: www.strony.fantazja.waw.pl [Visitor] · http://www.strony.fantazja.waw.pl/59396/You-will-discover-numerous-unique/wpis.html
Dominik Werner from Marburg Hessen sac à main
Pas cher Germany Nom d'utilisateur HCdomnik
wholesale wigs
Public Profile Nom :Dominik Werner Rue : Ville :Marburg Région/Etat:Hessen ?Postal Code (ZIP): 35037 Pays :Germany Date de naissance23.7.1982Sexe :Homme Occupation :Student ( +Education+ and +Life+ )Deuxième adresse:Rue, Ville:VadenrodCode PostalHessenPays, téléphone:GermanyA propos de cette adresse:That where my Parents live! You can find there profile with the following name: madodojumi
Lumieres Modernes pas Cher
They live in a beautifull old house with big garden in a www.ventengrossiste.net small village surounded by forests!
nike Football boots
Its near Alsfeld at the highway A5 100km north of Frankfurt! Maybe interesting for hitchhikers.?Voyages et intérêtsLangues parlées :german english espanol (pocito)Loisirs, centres d'intérêt :Travelling ; good food ; hiphop funk soul dnb reggae ragga music ; dancing ;
(making) movies ; books ; poetry; directaction
resistance; improtheater; theatre of the oppressed; systemic thinking; studying paedagogic and especialy education for sustainable development,
meditation and yoga.
PermalinkPermalink 2013-03-13 @ 01:44
There have been a lot of famous women martial artists, which has caused
more women to take a serious look at karate.
As you can see the selection of Android sports apps on the Android
Market is excellent. Lots of exercises and workouts
are involved in the entire regimen.
PermalinkPermalink 2013-03-16 @ 22:20
Comment from: online dating [Visitor] · http://www.whereloveisfound.com
Inspiring quest there. What happened after? Take care!


online dating
PermalinkPermalink 2013-04-09 @ 21:38
Comment from: projektowanie stron Kraków [Visitor] · http://projektowaniestronkrakowiokolice.pl/
It's remarkable to visit this website and reading the views of all mates about this paragraph, while I am also keen of getting knowledge.
PermalinkPermalink 2013-04-11 @ 16:06
Comment from: W Najnowszym Artykule [Visitor] · http://equip.pl/pol_m_Roncato-10514.html
An outstanding share! I have just forwarded this onto a colleague who has been conducting a little research on this.
And he actually bought me breakfast due to the fact that I
discovered it for him... lol. So let me reword this...
. Thanks for the meal!! But yeah, thanx for spending time to discuss this subject here on your web site.
PermalinkPermalink 2013-04-14 @ 22:39
Comment from: ckupony.pl [Visitor] · http://ckupony.pl
I'm now not certain where you are getting your info, however good topic. I must spend a while learning more or understanding more. Thanks for magnificent info I was looking for this info for my mission.
PermalinkPermalink 2013-04-18 @ 03:49
Comment from: Oakley Sunglasses Sale [Visitor] · http://www.hutchinsontransmission.biz/sunglasses.html
Have you ever thought about creating an ebook or guest authoring on other websites?

I have a blog based on the same information
you discuss and would really like to have you share some stories/information.
I know my visitors would value your work. If you're even remotely interested, feel free to shoot me an e mail.
PermalinkPermalink 2013-05-02 @ 18:02
Comment from: http://www.prnewswire.com/news-releases/trilastin-review-and-latest-coupon-code-savings-released-at- [Visitor] · http://onthank.info/FamilyTree/tiki-index.php?page=UserPagejolenefra
This anti-stretch marks technique is successful and efficient
in every way.
PermalinkPermalink 2013-05-05 @ 16:52
Comment from: Hungry Girl 200 Under 200 Just Desserts: 200 Recipes Under 200 Calories ebook [Visitor] · http://ebooks-4free.com/hungry-girl-200-under-200-just-desserts-200-recipes-under-200-calories-
Having read this I believed it was very enlightening.
I appreciate you finding the time and energy to put this informative
article together. I once again find myself spending a lot of time both reading and leaving comments.
But so what, it was still worthwhile!
PermalinkPermalink 2013-05-12 @ 12:46

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

May 2013
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Search

Categories

Archives

Misc

XML Feeds

What is this?

powered by
b2evolution