Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/common/IO_abstract_hierarchy_iterator.h
| Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | |||||
| * | * | ||||
| * Instantiated by the AbstractHierarchyIterator on the first frame an object exists. Generally | * Instantiated by the AbstractHierarchyIterator on the first frame an object exists. Generally | ||||
| * that's the first frame to be exported, but can be later, for example when objects are | * that's the first frame to be exported, but can be later, for example when objects are | ||||
| * instantiated by particles. The AbstractHierarchyWriter::write() function is called on every | * instantiated by particles. The AbstractHierarchyWriter::write() function is called on every | ||||
| * frame the object exists in the dependency graph and should be exported. | * frame the object exists in the dependency graph and should be exported. | ||||
| */ | */ | ||||
| class AbstractHierarchyWriter { | class AbstractHierarchyWriter { | ||||
| public: | public: | ||||
| virtual ~AbstractHierarchyWriter(); | virtual ~AbstractHierarchyWriter() = default; | ||||
| virtual void write(HierarchyContext &context) = 0; | virtual void write(HierarchyContext &context) = 0; | ||||
| /* TODO(Sybren): add function like absent() that's called when a writer was previously created, | /* TODO(Sybren): add function like absent() that's called when a writer was previously created, | ||||
| * but wasn't used while exporting the current frame (for example, a particle-instanced mesh of | * but wasn't used while exporting the current frame (for example, a particle-instanced mesh of | ||||
| * which the particle is no longer alive). */ | * which the particle is no longer alive). */ | ||||
| protected: | protected: | ||||
| /* Return true if the data written by this writer changes over time. | /* Return true if the data written by this writer changes over time. | ||||
| * Note that this function assumes this is an object data writer. Transform writers should not | * Note that this function assumes this is an object data writer. Transform writers should not | ||||
| * call this but implement their own logic. */ | * call this but implement their own logic. */ | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | public: | ||||
| Object *object; | Object *object; | ||||
| Object *duplicated_by; /* nullptr for real objects. */ | Object *duplicated_by; /* nullptr for real objects. */ | ||||
| PersistentID persistent_id; | PersistentID persistent_id; | ||||
| protected: | protected: | ||||
| ObjectIdentifier(Object *object, Object *duplicated_by, const PersistentID &persistent_id); | ObjectIdentifier(Object *object, Object *duplicated_by, const PersistentID &persistent_id); | ||||
| public: | public: | ||||
| ObjectIdentifier(const ObjectIdentifier &other); | |||||
| ~ObjectIdentifier(); | |||||
| static ObjectIdentifier for_graph_root(); | static ObjectIdentifier for_graph_root(); | ||||
| static ObjectIdentifier for_real_object(Object *object); | static ObjectIdentifier for_real_object(Object *object); | ||||
| static ObjectIdentifier for_hierarchy_context(const HierarchyContext *context); | static ObjectIdentifier for_hierarchy_context(const HierarchyContext *context); | ||||
| static ObjectIdentifier for_duplicated_object(const DupliObject *dupli_object, | static ObjectIdentifier for_duplicated_object(const DupliObject *dupli_object, | ||||
| Object *duplicated_by); | Object *duplicated_by); | ||||
| bool is_root() const; | bool is_root() const; | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines | |||||