OOF2: The Manual

8.6. Adding New Material Properties

New Material Properties are the most complicated kind of OOF2 extension. Just to make it simpler, there are two ways of doing it. Properties can be written in C++ or they can be written in Python. Python Properties are a bit easier to write and install, but will run significantly more slowly. It may be convenient to develop new Properties in Python and translate them to C++ after the bugs have been worked out.

Whether a Property is written in C++ or Python, the same code elements must be present. Not all of them are necessary for every Property. It is safe simply to omit the unnecessary ones.

A Property consists of a class definition and a PropertyRegistration object. The registration contains metadata about the Property and allows it to be found in the user interface. The class must be a subclass of one of these intermediate base classes:

See the documentation for each intermediate class for the details.

Property classes perform the following types of tasks (the links below each task lead to detailed documentation, see the pages for the classes for the full list of methods):