| 146 | } |
| 147 | |
| 148 | void load(const QString &model) |
| 149 | { |
| 150 | // since we are loading an existing model, add its path to the search list for submodels |
| 151 | // assuming it is not already present. |
| 152 | QFileInfo finfo(model); |
| 153 | QString path = finfo.absolutePath(); |
| 154 | if (!Globals->modelSearch.contains(path)) |
| 155 | Globals->modelSearch.append(path); |
| 156 | |
| 157 | QtUtils::BlockCompression compressedRead; |
| 158 | QFile inFile(model); |
| 159 | compressedRead.setBasis(&inFile); |
| 160 | QDataStream in(&compressedRead); |
| 161 | compressedRead.open(QFile::ReadOnly); |
| 162 | |
| 163 | // Load algorithm |
| 164 | transform = QSharedPointer<Transform>(Transform::deserialize(in)); |
| 165 | |
| 166 | qint32 mode; |
| 167 | in >> mode; |
| 168 | |
| 169 | if (mode == DistanceCompare) { |
| 170 | QString distanceDescription; |
| 171 | in >> distanceDescription; |
| 172 | distance = QSharedPointer<Distance>(Distance::make(distanceDescription, NULL)); |
| 173 | distance->load(in); |
| 174 | comparison = QSharedPointer<Transform>(Transform::make("GalleryCompare", NULL)); |
| 175 | comparison->setPropertyRecursive("distance", QVariant::fromValue(distance.data())); |
| 176 | } |
| 177 | if (mode == TransformCompare) |
| 178 | comparison = QSharedPointer<Transform>(Transform::deserialize(in)); |
| 179 | } |
| 180 | |
| 181 | File getMemoryGallery(const File &file) const |
| 182 | { |
no test coverage detected