comparison framework/Document.h @ 54:a798f5e6fc5e

* Further naming change: Transformer -> ModelTransformer. The Transform class now describes a thing that can be done, and the ModelTransformer does it to a Model.
author Chris Cannam
date Wed, 07 Nov 2007 12:59:01 +0000
parents de2b3c6479c8
children 4aa40182321f 22bf057ea151
comparison
equal deleted inserted replaced
53:de2b3c6479c8 54:a798f5e6fc5e
15 15
16 #ifndef _DOCUMENT_H_ 16 #ifndef _DOCUMENT_H_
17 #define _DOCUMENT_H_ 17 #define _DOCUMENT_H_
18 18
19 #include "layer/LayerFactory.h" 19 #include "layer/LayerFactory.h"
20 #include "plugin/transform/Transformer.h" 20 #include "plugin/transform/Transform.h"
21 #include "plugin/transform/PluginTransformer.h" 21 #include "plugin/transform/PluginTransformer.h"//!!!
22 #include "plugin/transform/ModelTransformer.h"
22 #include "base/Command.h" 23 #include "base/Command.h"
23 24
24 #include <map> 25 #include <map>
25 #include <set> 26 #include <set>
26 27
43 * - Any number of imported Model objects, which contain data without any 44 * - Any number of imported Model objects, which contain data without any
44 * requirement to remember where the data came from or how to 45 * requirement to remember where the data came from or how to
45 * regenerate it. 46 * regenerate it.
46 * 47 *
47 * - Any number of Model objects that were generated by a Transformer 48 * - Any number of Model objects that were generated by a Transformer
48 * such as FeatureExtractionPluginTransformer. For these, we also 49 * such as FeatureExtractionModelTransformer. For these, we also
49 * record the source model and the name of the transform used to 50 * record the source model and the name of the transform used to
50 * generate the model so that we can regenerate it (potentially 51 * generate the model so that we can regenerate it (potentially
51 * from a different source) on demand. 52 * from a different source) on demand.
52 * 53 *
53 * - A flat list of Layer objects. Elsewhere, the GUI may distribute these 54 * - A flat list of Layer objects. Elsewhere, the GUI may distribute these
104 * transform itself, nor create a model. The caller can safely 105 * transform itself, nor create a model. The caller can safely
105 * add a model to the layer later, but note that all models used 106 * add a model to the layer later, but note that all models used
106 * by a transform layer _must_ be registered with the document 107 * by a transform layer _must_ be registered with the document
107 * using addDerivedModel below. 108 * using addDerivedModel below.
108 */ 109 */
109 Layer *createDerivedLayer(LayerFactory::LayerType, TransformerId); 110 Layer *createDerivedLayer(LayerFactory::LayerType, TransformId);
110 111
111 /** 112 /**
112 * Create and return a suitable layer for the given transform, 113 * Create and return a suitable layer for the given transform,
113 * running the transform and associating the resulting model with 114 * running the transform and associating the resulting model with
114 * the new layer. 115 * the new layer.
115 */ 116 */
116 Layer *createDerivedLayer(TransformerId, 117 Layer *createDerivedLayer(TransformId,
117 Model *inputModel, 118 Model *inputModel,
118 const PluginTransformer::ExecutionContext &context, 119 const PluginTransformer::ExecutionContext &context,
119 QString configurationXml); 120 QString configurationXml);
120 121
121 /** 122 /**
147 148
148 /** 149 /**
149 * Add a derived model associated with the given transform, 150 * Add a derived model associated with the given transform,
150 * running the transform and returning the resulting model. 151 * running the transform and returning the resulting model.
151 */ 152 */
152 Model *addDerivedModel(TransformerId transform, 153 Model *addDerivedModel(TransformId transform,
153 Model *inputModel, 154 Model *inputModel,
154 const PluginTransformer::ExecutionContext &context, 155 const PluginTransformer::ExecutionContext &context,
155 QString configurationXml); 156 QString configurationXml);
156 157
157 /** 158 /**
158 * Add a derived model associated with the given transform. This 159 * Add a derived model associated with the given transform. This
159 * is necessary to register any derived model that was not created 160 * is necessary to register any derived model that was not created
160 * by the document using createDerivedModel or createDerivedLayer. 161 * by the document using createDerivedModel or createDerivedLayer.
161 */ 162 */
162 void addDerivedModel(TransformerId, 163 void addDerivedModel(TransformId,
163 Model *inputModel, 164 Model *inputModel,
164 const PluginTransformer::ExecutionContext &context, 165 const PluginTransformer::ExecutionContext &context,
165 Model *outputModelToAdd, 166 Model *outputModelToAdd,
166 QString configurationXml); 167 QString configurationXml);
167 168
265 // and the transform name will be set appropriately. If the 266 // and the transform name will be set appropriately. If the
266 // transform name is set but source is NULL, then there was a 267 // transform name is set but source is NULL, then there was a
267 // transform involved but the (target) model has been modified 268 // transform involved but the (target) model has been modified
268 // since being generated from it. 269 // since being generated from it.
269 const Model *source; 270 const Model *source;
270 TransformerId transform; 271 TransformId transform;
271 PluginTransformer::ExecutionContext context; 272 PluginTransformer::ExecutionContext context;
272 QString configurationXml; 273 QString configurationXml;
273 274
274 // Count of the number of layers using this model. 275 // Count of the number of layers using this model.
275 int refcount; 276 int refcount;