1
1
// ////////////////////////////////////////////////////////////////////////
2
2
//
3
- // Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
3
+ // Copyright (c) 2013-2014 , Image Engine Design Inc. All rights reserved.
4
4
//
5
5
// Redistribution and use in source and binary forms, with or without
6
6
// modification, are permitted provided that the following conditions are
@@ -145,40 +145,26 @@ class SceneCacheReader : public DD::Image::SourceGeo
145
145
146
146
Imath::M44d worldTransform ( IECore::ConstSceneInterfacePtr scene, IECore::SceneInterface::Path root, double time );
147
147
148
- // uses firstOp to return the Op that has the up-to-date private data
149
- SceneCacheReader *firstReader ();
150
-
151
148
// / Returns an InternedString with the name of the geometry tag.
152
149
static const IECore::InternedString &geometryTag ();
153
150
151
+ // uses firstOp to return the Op that has the up-to-date private data
152
+ SceneCacheReader *firstReader ();
153
+ const SceneCacheReader *firstReader () const ;
154
+
155
+ class SharedData ;
156
+
157
+ // this function should only be called from the firstReader() object.
158
+ SharedData *sharedData ();
159
+ const SharedData *sharedData () const ;
160
+
154
161
// Knob Members.
155
162
const char *m_filePath; // Holds the raw SceneCache file path.
156
- std::string m_evaluatedFilePath; // Holds the SceneCache file path after any TCL scripts have been evaluated..
157
163
std::string m_root; // Holds the root item in the SceneCache.
158
- std::string m_filterText; // The text to filter the scene with.
159
- std::string m_filterTagText; // The text to filter the tags with. This is set from the Enumeration_knob.
164
+ std::string m_filter; // The text to filter the scene with.
160
165
bool m_worldSpace; // Set to ignore local transforms..
161
166
DD::Image::Matrix4 m_baseParentMatrix; // The global matrix that is applied to the geo.
162
-
163
- // Hashes that are used to both provide an early-out to some methods
164
- // and also contribute towards a hash for the geometry.
165
- DD::Image::Hash m_selectionHash;
166
- DD::Image::Hash m_filterHash;
167
- DD::Image::Hash m_sceneHash;
168
-
169
- // When buildSceneView is called to parse the scene cache and generate a list of entries for the SceneView_knob,
170
- // this map is also populated. It holds a mapping of tag names to the indices of items which have that tag.
171
- // It is used within the filterScene method to quickly filter items with a particular tag.
172
- typedef std::map< std::string, std::vector< unsigned int > > TagMap;
173
- TagMap m_tagMap;
174
-
175
- // When specifying a root we store the path to it's parent item along with the length of it. We do this so that when
176
- // we are building the list of items in the SceneView_knob we can strip this path quickly from the front of the
177
- // name and easily restore it later to load it from the SceneCache. This ensures that the names of the items in the
178
- // SceneView_knob are kept short.
179
- std::string m_pathPrefix;
180
- unsigned int m_pathPrefixLength;
181
-
167
+
182
168
// Pointers to various knobs.
183
169
DD::Image::Knob *m_filePathKnob;
184
170
DD::Image::Knob *m_baseParentMatrixKnob;
@@ -187,19 +173,8 @@ class SceneCacheReader : public DD::Image::SourceGeo
187
173
DD::Image::Knob *m_sceneFilterKnob;
188
174
DD::Image::Knob *m_rootKnob;
189
175
190
- // A flag which is set when all of the knobs have been loaded from the script.
191
- bool m_scriptFinishedLoading;
192
-
193
- // A flag which is used to initialize the internal data structures the first time the node is run.
194
- bool m_isFirstRun;
195
-
196
- // / The SceneView_knob holds a list of all leaf items in the scene. When filtering the SceneView we specify indices into
197
- // / this list. When setting or querying the selected items in the SceneView_knob we need to use indices into the list of
198
- // / filtered (visible) items. This means that we have to keep a look-up table of mappings between indices in the filtered
199
- // / list of items and the index within the complete list of items in the scene.
200
- std::map<int , int > m_itemToFiltered; // Mapping of the index within the full scene list and the filtered scene list.
201
- std::vector<unsigned int > m_filteredToItem; // Mapping from an index in the filtered scene list to the complete scene list.
202
- std::vector< bool > m_itemSelected; // An array of flags which indicate whether an item in the filtered list is selected or not.
176
+ // only the first reader allocates the shared data
177
+ SharedData *m_data;
203
178
};
204
179
205
180
} // namespace IECoreNuke
0 commit comments