comparison framework/Document.h @ 691:c8ba09756eff by-id

Work on management of alignment-related models
author Chris Cannam
date Fri, 12 Jul 2019 13:58:02 +0100
parents e0b0f3e163ca
children 3c5dc95bea91
comparison
equal deleted inserted replaced
690:827a522a5da4 691:c8ba09756eff
221 221
222 /** 222 /**
223 * Add a derived model associated with the given transform. This 223 * Add a derived model associated with the given transform. This
224 * is necessary to register any derived model that was not created 224 * is necessary to register any derived model that was not created
225 * by the document using createDerivedModel or 225 * by the document using createDerivedModel or
226 * createDerivedLayer. The model must have been added to ModelById 226 * createDerivedLayer. Document will take responsibility for
227 * already, and Document will take responsibility for releasing it 227 * releasing the model later.
228 * later.
229 */ 228 */
230 void addAlreadyDerivedModel(const Transform &transform, 229 void addAlreadyDerivedModel(const Transform &transform,
231 const ModelTransformer::Input &input, 230 const ModelTransformer::Input &input,
232 ModelId outputModelToAdd); 231 ModelId outputModelToAdd);
233 232
234 /** 233 /**
235 * Add an imported (non-derived, non-main) model. This is 234 * Add an imported model, i.e. any model (other than the main
236 * necessary to register any imported model that is associated 235 * model) that has been created by any means other than as the
237 * with a layer. The model must have been added to ModelById 236 * output of a transform. This is necessary to register any
238 * already, and Document will take responsibility for releasing it 237 * imported model that is to be associated with a layer, and also
239 * later. 238 * to make sure that the model is released by the Document
240 */ 239 * later. Aggregate models, alignment models, and miscellaneous
241 void addImportedModel(ModelId); 240 * temporary models should also be added in this way, unless the
242 241 * temporary models are large enough to need managing in a way
243 /** 242 * that guarantees the shortest possible lifespan.
244 *!!! todo: do we still need this to be separate? 243 */
245 * 244 void addNonDerivedModel(ModelId);
246 * Add an aggregate model (one which represents a set of component
247 * wave models as one model per channel in a single wave
248 * model). Aggregate models are unusual in that they are created
249 * for a single transform each and have no refcount. (This
250 * probably isn't ideal!) They are recorded separately from other
251 * models, and will be deleted if any of their component models
252 * are removed.
253 *
254 * The model must have been added to ModelById already, and
255 * Document will take responsibility for releasing it later.
256 */
257 void addAggregateModel(ModelId); // an AggregateWaveModel
258 245
259 /** 246 /**
260 * Associate the given model with the given layer. The model must 247 * Associate the given model with the given layer. The model must
261 * have already been registered using one of the addXXModel 248 * have already been registered using one of the addXXModel
262 * methods above. 249 * methods above.
391 }; 378 };
392 379
393 // These must be stored in increasing order of id (as in the 380 // These must be stored in increasing order of id (as in the
394 // ordered std::map), to ensure repeatability for automated tests 381 // ordered std::map), to ensure repeatability for automated tests
395 std::map<ModelId, ModelRecord> m_models; 382 std::map<ModelId, ModelRecord> m_models;
383
396 std::set<ModelId> m_aggregateModels; 384 std::set<ModelId> m_aggregateModels;
385 std::set<ModelId> m_alignmentModels;
397 386
398 /** 387 /**
399 * Add an extra derived model (returned at the end of processing a 388 * Add an extra derived model (returned at the end of processing a
400 * transform). 389 * transform).
401 */ 390 */