- Messages
- 34,850
- Country
I have been doing some work on a class model for FSX Scenery Objects with the intention that it should support any type of object whether compiled via BGLComp, SHp2Vec or Resample. At the moment I have focused on BGLComp because that is the one I understand. I have used class inheritance rather than interfaces. There are a lot of properties floating about.
I have an Abstract Scenery Base Class which has properties for Name, Type, and Compiler and abstract methods for SourceCode and Draw. These are abstract to force classes which inherit from them to implement them as they will be different class to class. I have also a ToString Method which just returns Type and Name. The Draw method returns something that can be used to display the object in some way (will depend on the display method), and SourceCode returns the XML or whatever needed to compile that object using the compiler specified in the Compiler property.
All the top level Elements that BGLComp compiles inherit from this:
There are classes for the sub Elements in objects like airports. I am following the XML Element/Attribute Model from the BGLComp SDK as closely as makes sense
SceneryObject is also an abstract class inheriting from SceneryBase but adding the properties common to all SceneryObjects. This forms the base for:
I have a class to encompass a complete bgl file. This contains a collection of SceneryBase objects and has methods to DeCompile, Compile and Draw. It should also handle persistence and make sure that the compile process builds separate bgls by Compiler and that the order of elements in the bgl are correct. One of these objects could be created by de-compiling one or more existing bgls or as a container for A scenery design project.
I have an Abstract Scenery Base Class which has properties for Name, Type, and Compiler and abstract methods for SourceCode and Draw. These are abstract to force classes which inherit from them to implement them as they will be different class to class. I have also a ToString Method which just returns Type and Name. The Draw method returns something that can be used to display the object in some way (will depend on the display method), and SourceCode returns the XML or whatever needed to compile that object using the compiler specified in the Compiler property.
All the top level Elements that BGLComp compiles inherit from this:
- ModelData
- ExclusionRectanngle
- TimeZone
- ExtrusionBridge
- Airport
- Vor
- Ndb
- Marker
- Waypoint
- Geopol
- SceneryObject
There are classes for the sub Elements in objects like airports. I am following the XML Element/Attribute Model from the BGLComp SDK as closely as makes sense
SceneryObject is also an abstract class inheriting from SceneryBase but adding the properties common to all SceneryObjects. This forms the base for:
- Beacon
- Effect
- GenericBuilding
- LibraryObject
- Trigger
- Windsock
I have a class to encompass a complete bgl file. This contains a collection of SceneryBase objects and has methods to DeCompile, Compile and Draw. It should also handle persistence and make sure that the compile process builds separate bgls by Compiler and that the order of elements in the bgl are correct. One of these objects could be created by de-compiling one or more existing bgls or as a container for A scenery design project.