MCPcopy Create free account
hub / github.com/ImageEngine/cortex / handleLocation

Function handleLocation

src/IECoreScene/SceneAlgo.cpp:128–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126};
127
128CopyInfo<size_t> handleLocation( const SceneInterface *src, SceneInterface *dst, double time, unsigned int flags )
129{
130 SceneInterface::Path path;
131 src->path( path );
132 bool isRoot = path.empty();
133 CopyInfo<size_t> copyInfo;
134
135 if( flags & SceneAlgo::Bounds )
136 {
137 auto bound = src->readBound( time );
138 if( dst )
139 {
140 dst->writeBound( bound, time );
141 }
142 }
143
144 if( flags & SceneAlgo::Transforms )
145 {
146 IECore::ConstDataPtr transform = src->readTransform( time );
147 if( dst && !isRoot )
148 {
149 dst->writeTransform( transform.get(), time );
150 }
151 }
152
153 if( flags & SceneAlgo::Attributes )
154 {
155 SceneInterface::NameList attributeNames;
156 src->attributeNames( attributeNames );
157
158 copyInfo.attributeCount += attributeNames.size();
159 for( const auto &attributeName : attributeNames )
160 {
161 IECore::ConstObjectPtr attr = src->readAttribute( attributeName, time );
162 if( dst )
163 {
164 dst->writeAttribute( attributeName, attr.get(), time );
165 }
166 }
167 }
168
169 if( flags & SceneAlgo::Tags )
170 {
171 SceneInterface::NameList tags;
172 src->readTags( tags );
173 copyInfo.tagCount += tags.size();
174 if( dst )
175 {
176 dst->writeTags( tags );
177 }
178 }
179
180 if( flags & SceneAlgo::Sets && isRoot )
181 {
182 SceneInterface::NameList setNames = src->setNames();
183 copyInfo.setCount += setNames.size();
184 for( const auto &setName : setNames )
185 {

Callers 1

parallelReadAllFunction · 0.85

Calls 15

numFacesMethod · 0.80
numCurvesMethod · 0.80
getNumPointsMethod · 0.80
pathMethod · 0.45
readBoundMethod · 0.45
writeBoundMethod · 0.45
readTransformMethod · 0.45
writeTransformMethod · 0.45
getMethod · 0.45
attributeNamesMethod · 0.45
sizeMethod · 0.45
readAttributeMethod · 0.45

Tested by

no test coverage detected