Developer Documentation
MetadataInterface Class Referenceabstract

Enables implementers to react on deserialization of meta data. More...

#include <OpenFlipper/BasePlugin/MetadataInterface.hh>

Inheritance diagram for MetadataInterface:
DeserializeScreenshotMetadataPlugin

Signals

virtual void metadataDeserialized (const QVector< QPair< QString, QString > > &data)=0
 

Public Member Functions

virtual ~MetadataInterface ()
 Destructor.
 

Private Slots

virtual void slotGenericMetadataDeserialized (QString key, QString value)
 

Private Member Functions

virtual void slotObjectMetadataDeserialized (QString object_name, QString value)
 
virtual void slotObjectMetadataDeserializedJson (QString object_name, QJsonDocument value)
 

Detailed Description

Enables implementers to react on deserialization of meta data.

Detailed description

Using functions such as BaseObject::getCommentByKey() plugins can attach meta data to objects. This meta data is currently only serialized when taking viewer snapshots. "Plugin-DeserializeScreenshotMetadata" allows deserializing this metadata from a viewer snapshot. (In the future serialization and deserialization of meta data may occur in other contexts as well.)

Whenever meta gets deserialized the slots in this interface will get triggered. Please refer to the documentation of the individual slots to find out which specific signal suits your needs.

The slots are always triggered in the order slotGenericMetadataDeserialized(), slotObjectMetadataDeserialized(), slotObjectMetadataDeserializedJson().

Definition at line 77 of file MetadataInterface.hh.

Member Function Documentation

◆ metadataDeserialized

virtual void MetadataInterface::metadataDeserialized ( const QVector< QPair< QString, QString > > &  data)
pure virtualsignal

Can be called by anyone who deserializes meta data, e.g. from a viewer snapshot PNG file. The appropriate slots within this interface will be triggered.

◆ slotGenericMetadataDeserialized

virtual void MetadataInterface::slotGenericMetadataDeserialized ( QString  key,
QString  value 
)
inlineprivatevirtualslot

This low-level signal is very inconvenient to use and chances are you want to use one of the other signals.

Triggered for every top level meta data entry. Currently the only top level meta data entries created by OpenFlipper are "Mesh Comments", "Mesh Materials" and "View". "Mesh Comments" contains the raw concatenation of all object meta data and is very cumbersome to parse. In most cases it's a better idea to use objectMetadataDeserialized().

Definition at line 91 of file MetadataInterface.hh.

◆ slotObjectMetadataDeserialized()

virtual void MetadataInterface::slotObjectMetadataDeserialized ( QString  object_name,
QString  value 
)
inlineprivatevirtual

Triggered for every piece of object specific meta data encapsulated in "Mesh Comments".

Definition at line 98 of file MetadataInterface.hh.

◆ slotObjectMetadataDeserializedJson()

virtual void MetadataInterface::slotObjectMetadataDeserializedJson ( QString  object_name,
QJsonDocument  value 
)
inlineprivatevirtual

Triggered for every piece of object specific meta data encapsulated in "Mesh Comments" if it is valid JSON.

Definition at line 105 of file MetadataInterface.hh.


The documentation for this class was generated from the following file: