Partially revert "Cleanup: use post increment/decrement"
This partially reverts commit 0b2d1badec
Post increment can deep-copy for C++ iterators, while in my own checks
GCC was able to optimize this to get the same output,
better follow C++ best practice and use pre-increment for iterators.
This commit is contained in:
parent
abeab4fcad
commit
fd05f01be6
|
@ -197,7 +197,7 @@ AbcExporter::~AbcExporter()
|
|||
{
|
||||
/* Free xforms map */
|
||||
m_xforms_type::iterator it_x, e_x;
|
||||
for (it_x = m_xforms.begin(), e_x = m_xforms.end(); it_x != e_x; it_x++) {
|
||||
for (it_x = m_xforms.begin(), e_x = m_xforms.end(); it_x != e_x; ++it_x) {
|
||||
delete it_x->second;
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,7 @@ void AbcExporter::operator()(float &progress, bool &was_canceled)
|
|||
const float size = static_cast<float>(frames.size());
|
||||
size_t i = 0;
|
||||
|
||||
for (; begin != end; begin++) {
|
||||
for (; begin != end; ++begin) {
|
||||
progress = (++i / size);
|
||||
|
||||
if (G.is_break) {
|
||||
|
@ -355,14 +355,14 @@ void AbcExporter::operator()(float &progress, bool &was_canceled)
|
|||
}
|
||||
|
||||
m_xforms_type::iterator xit, xe;
|
||||
for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; xit++) {
|
||||
for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; ++xit) {
|
||||
xit->second->write();
|
||||
}
|
||||
|
||||
/* Save the archive 's bounding box. */
|
||||
Imath::Box3d bounds;
|
||||
|
||||
for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; xit++) {
|
||||
for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; ++xit) {
|
||||
Imath::Box3d box = xit->second->bounds();
|
||||
bounds.extendBy(box);
|
||||
}
|
||||
|
|
|
@ -525,7 +525,7 @@ template<typename Schema> void AbcGenericMeshWriter::writeFaceSets(struct Mesh *
|
|||
getGeoGroups(me, geo_groups);
|
||||
|
||||
std::map<std::string, std::vector<int32_t>>::iterator it;
|
||||
for (it = geo_groups.begin(); it != geo_groups.end(); it++) {
|
||||
for (it = geo_groups.begin(); it != geo_groups.end(); ++it) {
|
||||
OFaceSet face_set = schema.createFaceSet(it->first);
|
||||
OFaceSetSchema::Sample samp;
|
||||
samp.setFaces(Int32ArraySample(it->second));
|
||||
|
@ -707,7 +707,7 @@ static void assign_materials(Main *bmain,
|
|||
std::map<std::string, int>::const_iterator it = mat_index_map.begin();
|
||||
|
||||
int matcount = 0;
|
||||
for (; it != mat_index_map.end(); it++, matcount++) {
|
||||
for (; it != mat_index_map.end(); ++it, matcount++) {
|
||||
if (!BKE_object_material_slot_add(bmain, ob)) {
|
||||
can_assign = false;
|
||||
break;
|
||||
|
@ -723,7 +723,7 @@ static void assign_materials(Main *bmain,
|
|||
if (can_assign) {
|
||||
it = mat_index_map.begin();
|
||||
|
||||
for (; it != mat_index_map.end(); it++) {
|
||||
for (; it != mat_index_map.end(); ++it) {
|
||||
std::string mat_name = it->first;
|
||||
mat_iter = mat_map.find(mat_name.c_str());
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ bool AbcNurbsReader::valid() const
|
|||
}
|
||||
|
||||
std::vector<std::pair<INuPatchSchema, IObject>>::const_iterator it;
|
||||
for (it = m_schemas.begin(); it != m_schemas.end(); it++) {
|
||||
for (it = m_schemas.begin(); it != m_schemas.end(); ++it) {
|
||||
const INuPatchSchema &schema = it->first;
|
||||
|
||||
if (!schema.valid()) {
|
||||
|
@ -243,7 +243,7 @@ void AbcNurbsReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSele
|
|||
|
||||
std::vector<std::pair<INuPatchSchema, IObject>>::iterator it;
|
||||
|
||||
for (it = m_schemas.begin(); it != m_schemas.end(); it++) {
|
||||
for (it = m_schemas.begin(); it != m_schemas.end(); ++it) {
|
||||
Nurb *nu = static_cast<Nurb *>(MEM_callocN(sizeof(Nurb), "abc_getnurb"));
|
||||
nu->flag = CU_SMOOTH;
|
||||
nu->type = CU_NURBS;
|
||||
|
|
|
@ -211,7 +211,7 @@ static void find_iobject(const IObject &object, IObject &ret, const std::string
|
|||
IObject tmp = object;
|
||||
|
||||
std::vector<std::string>::iterator iter;
|
||||
for (iter = tokens.begin(); iter != tokens.end(); iter++) {
|
||||
for (iter = tokens.begin(); iter != tokens.end(); ++iter) {
|
||||
IObject child = tmp.getChild(*iter);
|
||||
tmp = child;
|
||||
}
|
||||
|
@ -704,7 +704,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
|
|||
|
||||
ISampleSelector sample_sel(0.0f);
|
||||
std::vector<AbcObjectReader *>::iterator iter;
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
|
||||
AbcObjectReader *reader = *iter;
|
||||
|
||||
if (reader->valid()) {
|
||||
|
@ -743,7 +743,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
|
|||
}
|
||||
|
||||
/* Setup parenthood. */
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
|
||||
const AbcObjectReader *reader = *iter;
|
||||
const AbcObjectReader *parent_reader = reader->parent_reader;
|
||||
Object *ob = reader->object();
|
||||
|
@ -758,7 +758,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
|
|||
|
||||
/* Setup transformations and constraints. */
|
||||
i = 0;
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
|
||||
AbcObjectReader *reader = *iter;
|
||||
reader->setupObjectTransform(0.0f);
|
||||
|
||||
|
@ -782,7 +782,7 @@ static void import_endjob(void *user_data)
|
|||
|
||||
/* Delete objects on cancellation. */
|
||||
if (data->was_cancelled) {
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
|
||||
Object *ob = (*iter)->object();
|
||||
|
||||
/* It's possible that cancellation occurred between the creation of
|
||||
|
@ -804,7 +804,7 @@ static void import_endjob(void *user_data)
|
|||
|
||||
lc = BKE_layer_collection_get_active(view_layer);
|
||||
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
|
||||
Object *ob = (*iter)->object();
|
||||
|
||||
BKE_collection_object_add(data->bmain, lc->collection, ob);
|
||||
|
@ -824,7 +824,7 @@ static void import_endjob(void *user_data)
|
|||
DEG_relations_tag_update(data->bmain);
|
||||
}
|
||||
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
|
||||
for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
|
||||
AbcObjectReader *reader = *iter;
|
||||
reader->decref();
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ bool AnimationExporter::exportAnimations()
|
|||
openLibrary();
|
||||
|
||||
BCObjectSet::iterator it;
|
||||
for (it = animated_subset.begin(); it != animated_subset.end(); it++) {
|
||||
for (it = animated_subset.begin(); it != animated_subset.end(); ++it) {
|
||||
Object *ob = *it;
|
||||
exportAnimation(ob, animation_sampler);
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ void AnimationExporter::export_curve_animation_set(Object *ob,
|
|||
bool keep_flat_curves = this->export_settings.get_keep_flat_curves();
|
||||
|
||||
BCAnimationCurveMap::iterator it;
|
||||
for (it = curves->begin(); it != curves->end(); it++) {
|
||||
for (it = curves->begin(); it != curves->end(); ++it) {
|
||||
BCAnimationCurve &curve = *it->second;
|
||||
std::string channel_type = curve.get_channel_type();
|
||||
if (channel_type == "rotation_quaternion") {
|
||||
|
@ -310,7 +310,7 @@ BCAnimationCurve *AnimationExporter::get_modified_export_curve(Object *ob,
|
|||
}
|
||||
|
||||
BCValueMap::const_iterator vit;
|
||||
for (vit = lens_values.begin(); vit != lens_values.end(); vit++) {
|
||||
for (vit = lens_values.begin(); vit != lens_values.end(); ++vit) {
|
||||
int frame = vit->first;
|
||||
float lens_value = vit->second;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ BCAnimationSampler::BCAnimationSampler(BCExportSettings &export_settings, BCObje
|
|||
: export_settings(export_settings)
|
||||
{
|
||||
BCObjectSet::iterator it;
|
||||
for (it = object_set.begin(); it != object_set.end(); it++) {
|
||||
for (it = object_set.begin(); it != object_set.end(); ++it) {
|
||||
Object *ob = *it;
|
||||
add_object(ob);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ BCAnimationSampler::BCAnimationSampler(BCExportSettings &export_settings, BCObje
|
|||
BCAnimationSampler::~BCAnimationSampler()
|
||||
{
|
||||
BCAnimationObjectMap::iterator it;
|
||||
for (it = objects.begin(); it != objects.end(); it++) {
|
||||
for (it = objects.begin(); it != objects.end(); ++it) {
|
||||
BCAnimation *animation = it->second;
|
||||
delete animation;
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ void BCAnimationSampler::update_animation_curves(BCAnimation &animation,
|
|||
int frame)
|
||||
{
|
||||
BCAnimationCurveMap::iterator it;
|
||||
for (it = animation.curve_map.begin(); it != animation.curve_map.end(); it++) {
|
||||
for (it = animation.curve_map.begin(); it != animation.curve_map.end(); ++it) {
|
||||
BCAnimationCurve *curve = it->second;
|
||||
if (curve->is_transform_curve()) {
|
||||
curve->add_value_from_matrix(sample, frame);
|
||||
|
@ -212,7 +212,7 @@ void BCAnimationSampler::sample_scene(BCExportSettings &export_settings, bool ke
|
|||
}
|
||||
|
||||
BCAnimationObjectMap::iterator obit;
|
||||
for (obit = objects.begin(); obit != objects.end(); obit++) {
|
||||
for (obit = objects.begin(); obit != objects.end(); ++obit) {
|
||||
Object *ob = obit->first;
|
||||
BCAnimation *animation = obit->second;
|
||||
BCFrameSet &object_keyframes = animation->frame_set;
|
||||
|
@ -268,7 +268,7 @@ void BCAnimationSampler::find_depending_animated(std::set<Object *> &animated_ob
|
|||
do {
|
||||
found_more = false;
|
||||
std::set<Object *>::iterator it;
|
||||
for (it = candidates.begin(); it != candidates.end(); it++) {
|
||||
for (it = candidates.begin(); it != candidates.end(); ++it) {
|
||||
Object *cob = *it;
|
||||
ListBase *conlist = get_active_constraints(cob);
|
||||
if (is_animated_by_constraint(cob, conlist, animated_objects)) {
|
||||
|
@ -353,7 +353,7 @@ void BCAnimationSampler::add_value_set(BCAnimationCurve &curve,
|
|||
const BC_animation_transform_type tm_type = curve.get_transform_type();
|
||||
|
||||
BCFrameSampleMap::iterator it;
|
||||
for (it = samples.begin(); it != samples.end(); it++) {
|
||||
for (it = samples.begin(); it != samples.end(); ++it) {
|
||||
const int frame_index = nearbyint(it->first);
|
||||
if (animation_type == BC_ANIMATION_EXPORT_SAMPLES || curve.is_keyframe(frame_index)) {
|
||||
|
||||
|
@ -585,7 +585,7 @@ const int BCSampleFrameContainer::get_frames(std::vector<int> &frames) const
|
|||
{
|
||||
frames.clear(); // safety;
|
||||
BCSampleFrameMap::const_iterator it;
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
|
||||
frames.push_back(it->first);
|
||||
}
|
||||
return frames.size();
|
||||
|
@ -595,7 +595,7 @@ const int BCSampleFrameContainer::get_frames(Object *ob, BCFrames &frames) const
|
|||
{
|
||||
frames.clear(); // safety;
|
||||
BCSampleFrameMap::const_iterator it;
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
|
||||
const BCSampleFrame &frame = it->second;
|
||||
if (frame.has_sample_for(ob)) {
|
||||
frames.push_back(it->first);
|
||||
|
@ -608,7 +608,7 @@ const int BCSampleFrameContainer::get_frames(Object *ob, Bone *bone, BCFrames &f
|
|||
{
|
||||
frames.clear(); // safety;
|
||||
BCSampleFrameMap::const_iterator it;
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
|
||||
const BCSampleFrame &frame = it->second;
|
||||
if (frame.has_sample_for(ob, bone)) {
|
||||
frames.push_back(it->first);
|
||||
|
@ -621,7 +621,7 @@ const int BCSampleFrameContainer::get_samples(Object *ob, BCFrameSampleMap &samp
|
|||
{
|
||||
samples.clear(); // safety;
|
||||
BCSampleFrameMap::const_iterator it;
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
|
||||
const BCSampleFrame &frame = it->second;
|
||||
const BCSample *sample = frame.get_sample(ob);
|
||||
if (sample) {
|
||||
|
@ -635,7 +635,7 @@ const int BCSampleFrameContainer::get_matrices(Object *ob, BCMatrixSampleMap &sa
|
|||
{
|
||||
samples.clear(); // safety;
|
||||
BCSampleFrameMap::const_iterator it;
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
|
||||
const BCSampleFrame &frame = it->second;
|
||||
const BCMatrix *matrix = frame.get_sample_matrix(ob);
|
||||
if (matrix) {
|
||||
|
@ -651,7 +651,7 @@ const int BCSampleFrameContainer::get_matrices(Object *ob,
|
|||
{
|
||||
samples.clear(); // safety;
|
||||
BCSampleFrameMap::const_iterator it;
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
|
||||
for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
|
||||
const BCSampleFrame &frame = it->second;
|
||||
const BCMatrix *sample = frame.get_sample_matrix(ob, bone);
|
||||
if (sample) {
|
||||
|
|
|
@ -47,7 +47,7 @@ class BCAnimation {
|
|||
~BCAnimation()
|
||||
{
|
||||
BCAnimationCurveMap::iterator it;
|
||||
for (it = curve_map.begin(); it != curve_map.end(); it++) {
|
||||
for (it = curve_map.begin(); it != curve_map.end(); ++it) {
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ class BCSampleFrame {
|
|||
~BCSampleFrame()
|
||||
{
|
||||
BCSampleMap::iterator it;
|
||||
for (it = sampleMap.begin(); it != sampleMap.end(); it++) {
|
||||
for (it = sampleMap.begin(); it != sampleMap.end(); ++it) {
|
||||
BCSample *sample = it->second;
|
||||
delete sample;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
BCSample::~BCSample()
|
||||
{
|
||||
BCBoneMatrixMap::iterator it;
|
||||
for (it = bonemats.begin(); it != bonemats.end(); it++) {
|
||||
for (it = bonemats.begin(); it != bonemats.end(); ++it) {
|
||||
delete it->second;
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ const bool BCSample::get_value(std::string channel_target, const int array_index
|
|||
bname = bname.substr(2);
|
||||
bname = bc_string_before(bname, "\"");
|
||||
BCBoneMatrixMap::const_iterator it;
|
||||
for (it = bonemats.begin(); it != bonemats.end(); it++) {
|
||||
for (it = bonemats.begin(); it != bonemats.end(); ++it) {
|
||||
Bone *bone = it->first;
|
||||
if (bname == bone->name) {
|
||||
matrix = it->second;
|
||||
|
|
|
@ -265,7 +265,7 @@ void ControllerExporter::export_skin_controller(Object *ob, Object *ob_arm)
|
|||
if (sumw > 0.0f) {
|
||||
float invsumw = 1.0f / sumw;
|
||||
vcounts.push_back(jw.size());
|
||||
for (std::map<int, float>::iterator m = jw.begin(); m != jw.end(); m++) {
|
||||
for (std::map<int, float>::iterator m = jw.begin(); m != jw.end(); ++m) {
|
||||
joints.push_back((*m).first);
|
||||
weights.push_back(invsumw * (*m).second);
|
||||
}
|
||||
|
@ -616,7 +616,7 @@ std::string ControllerExporter::add_weights_source(Mesh *me,
|
|||
|
||||
source.prepareToAppendValues();
|
||||
|
||||
for (std::list<float>::const_iterator i = weights.begin(); i != weights.end(); i++) {
|
||||
for (std::list<float>::const_iterator i = weights.begin(); i != weights.end(); ++i) {
|
||||
source.appendValues(*i);
|
||||
}
|
||||
|
||||
|
@ -658,7 +658,7 @@ void ControllerExporter::add_vertex_weights_element(const std::string &weights_s
|
|||
|
||||
/* write deformer index - weight index pairs */
|
||||
int weight_index = 0;
|
||||
for (std::list<int>::const_iterator i = joints.begin(); i != joints.end(); i++) {
|
||||
for (std::list<int>::const_iterator i = joints.begin(); i != joints.end(); ++i) {
|
||||
weightselem.appendValues(*i, weight_index++);
|
||||
}
|
||||
|
||||
|
|
|
@ -525,7 +525,7 @@ BoneExtensionMap &BoneExtensionManager::getExtensionMap(bArmature *armature)
|
|||
BoneExtensionManager::~BoneExtensionManager()
|
||||
{
|
||||
std::map<std::string, BoneExtensionMap *>::iterator map_it;
|
||||
for (map_it = extended_bone_maps.begin(); map_it != extended_bone_maps.end(); map_it++) {
|
||||
for (map_it = extended_bone_maps.begin(); map_it != extended_bone_maps.end(); ++map_it) {
|
||||
BoneExtensionMap *extended_bones = map_it->second;
|
||||
for (BoneExtensionMap::iterator ext_it = extended_bones->begin();
|
||||
ext_it != extended_bones->end();
|
||||
|
@ -916,7 +916,7 @@ bool bc_is_animated(BCMatrixSampleMap &values)
|
|||
|
||||
BCMatrixSampleMap::iterator it;
|
||||
const BCMatrix *refmat = NULL;
|
||||
for (it = values.begin(); it != values.end(); it++) {
|
||||
for (it = values.begin(); it != values.end(); ++it) {
|
||||
const BCMatrix *matrix = it->second;
|
||||
|
||||
if (refmat == NULL) {
|
||||
|
|
|
@ -160,7 +160,7 @@ void NodeGraph::add_bNode(const CompositorContext &context,
|
|||
NodeGraph::NodeInputs NodeGraph::find_inputs(const NodeRange &node_range, bNodeSocket *b_socket)
|
||||
{
|
||||
NodeInputs result;
|
||||
for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; it++) {
|
||||
for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; ++it) {
|
||||
Node *node = *it;
|
||||
for (int index = 0; index < node->getNumberOfInputSockets(); index++) {
|
||||
NodeInput *input = node->getInputSocket(index);
|
||||
|
@ -174,7 +174,7 @@ NodeGraph::NodeInputs NodeGraph::find_inputs(const NodeRange &node_range, bNodeS
|
|||
|
||||
NodeOutput *NodeGraph::find_output(const NodeRange &node_range, bNodeSocket *b_socket)
|
||||
{
|
||||
for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; it++) {
|
||||
for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; ++it) {
|
||||
Node *node = *it;
|
||||
for (int index = 0; index < node->getNumberOfOutputSockets(); index++) {
|
||||
NodeOutput *output = node->getOutputSocket(index);
|
||||
|
@ -206,7 +206,7 @@ void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink
|
|||
}
|
||||
|
||||
NodeInputs inputs = find_inputs(node_range, b_nodelink->tosock);
|
||||
for (NodeInputs::const_iterator it = inputs.begin(); it != inputs.end(); it++) {
|
||||
for (NodeInputs::const_iterator it = inputs.begin(); it != inputs.end(); ++it) {
|
||||
NodeInput *input = *it;
|
||||
if (input->isLinked()) {
|
||||
continue;
|
||||
|
|
|
@ -152,7 +152,7 @@ NodeOperation *NodeOperation::getInputOperation(unsigned int inputSocketIndex)
|
|||
|
||||
void NodeOperation::getConnectedInputSockets(Inputs *sockets)
|
||||
{
|
||||
for (Inputs::const_iterator it = m_inputs.begin(); it != m_inputs.end(); it++) {
|
||||
for (Inputs::const_iterator it = m_inputs.begin(); it != m_inputs.end(); ++it) {
|
||||
NodeOperationInput *input = *it;
|
||||
if (input->isConnected()) {
|
||||
sockets->push_back(input);
|
||||
|
|
|
@ -70,7 +70,7 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
|
|||
* so multiple operations can use the same node input.
|
||||
*/
|
||||
OpInputInverseMap inverse_input_map;
|
||||
for (InputSocketMap::const_iterator it = m_input_map.begin(); it != m_input_map.end(); it++) {
|
||||
for (InputSocketMap::const_iterator it = m_input_map.begin(); it != m_input_map.end(); ++it) {
|
||||
inverse_input_map[it->second].push_back(it->first);
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
|
|||
continue;
|
||||
}
|
||||
|
||||
for (OpInputs::const_iterator it = op_to_list.begin(); it != op_to_list.end(); it++) {
|
||||
for (OpInputs::const_iterator it = op_to_list.begin(); it != op_to_list.end(); ++it) {
|
||||
NodeOperationInput *op_to = *it;
|
||||
addLink(op_from, op_to);
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ void NodeOperationBuilder::addLink(NodeOperationOutput *from, NodeOperationInput
|
|||
|
||||
void NodeOperationBuilder::removeInputLink(NodeOperationInput *to)
|
||||
{
|
||||
for (Links::iterator it = m_links.begin(); it != m_links.end(); it++) {
|
||||
for (Links::iterator it = m_links.begin(); it != m_links.end(); ++it) {
|
||||
Link &link = *it;
|
||||
if (link.to() == to) {
|
||||
/* unregister with the input */
|
||||
|
@ -274,7 +274,7 @@ void NodeOperationBuilder::registerViewer(ViewerOperation *viewer)
|
|||
void NodeOperationBuilder::add_datatype_conversions()
|
||||
{
|
||||
Links convert_links;
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); it++) {
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
|
||||
/* proxy operations can skip data type conversion */
|
||||
|
@ -288,7 +288,7 @@ void NodeOperationBuilder::add_datatype_conversions()
|
|||
convert_links.push_back(link);
|
||||
}
|
||||
}
|
||||
for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); it++) {
|
||||
for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
NodeOperation *converter = Converter::convertDataType(link.from(), link.to());
|
||||
if (converter) {
|
||||
|
@ -308,16 +308,16 @@ void NodeOperationBuilder::add_operation_input_constants()
|
|||
*/
|
||||
typedef std::vector<NodeOperationInput *> Inputs;
|
||||
Inputs pending_inputs;
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
for (int k = 0; k < op->getNumberOfInputSockets(); k++) {
|
||||
for (int k = 0; k < op->getNumberOfInputSockets(); ++k) {
|
||||
NodeOperationInput *input = op->getInputSocket(k);
|
||||
if (!input->isConnected()) {
|
||||
pending_inputs.push_back(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Inputs::const_iterator it = pending_inputs.begin(); it != pending_inputs.end(); it++) {
|
||||
for (Inputs::const_iterator it = pending_inputs.begin(); it != pending_inputs.end(); ++it) {
|
||||
NodeOperationInput *input = *it;
|
||||
add_input_constant_value(input, find_node_input(m_input_map, input));
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input,
|
|||
void NodeOperationBuilder::resolve_proxies()
|
||||
{
|
||||
Links proxy_links;
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); it++) {
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
/* don't replace links from proxy to proxy, since we may need them for replacing others! */
|
||||
if (link.from()->getOperation().isProxyOperation() &&
|
||||
|
@ -387,7 +387,7 @@ void NodeOperationBuilder::resolve_proxies()
|
|||
}
|
||||
}
|
||||
|
||||
for (Links::const_iterator it = proxy_links.begin(); it != proxy_links.end(); it++) {
|
||||
for (Links::const_iterator it = proxy_links.begin(); it != proxy_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
|
||||
NodeOperationInput *to = link.to();
|
||||
|
@ -410,7 +410,7 @@ void NodeOperationBuilder::resolve_proxies()
|
|||
void NodeOperationBuilder::determineResolutions()
|
||||
{
|
||||
/* determine all resolutions of the operations (Width/Height) */
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
if (op->isOutputOperation(m_context->isRendering()) && !op->isPreviewOperation()) {
|
||||
|
@ -421,7 +421,7 @@ void NodeOperationBuilder::determineResolutions()
|
|||
}
|
||||
}
|
||||
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
if (op->isOutputOperation(m_context->isRendering()) && op->isPreviewOperation()) {
|
||||
|
@ -435,7 +435,7 @@ void NodeOperationBuilder::determineResolutions()
|
|||
/* add convert resolution operations when needed */
|
||||
{
|
||||
Links convert_links;
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); it++) {
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
|
||||
if (link.to()->getResizeMode() != COM_SC_NO_RESIZE) {
|
||||
|
@ -446,7 +446,7 @@ void NodeOperationBuilder::determineResolutions()
|
|||
}
|
||||
}
|
||||
}
|
||||
for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); it++) {
|
||||
for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
Converter::convertResolution(*this, link.from(), link.to());
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ NodeOperationBuilder::OpInputs NodeOperationBuilder::cache_output_links(
|
|||
NodeOperationOutput *output) const
|
||||
{
|
||||
OpInputs inputs;
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); it++) {
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
if (link.from() == output) {
|
||||
inputs.push_back(link.to());
|
||||
|
@ -469,7 +469,7 @@ NodeOperationBuilder::OpInputs NodeOperationBuilder::cache_output_links(
|
|||
WriteBufferOperation *NodeOperationBuilder::find_attached_write_buffer_operation(
|
||||
NodeOperationOutput *output) const
|
||||
{
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); it++) {
|
||||
for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
if (link.from() == output) {
|
||||
NodeOperation &op = link.to()->getOperation();
|
||||
|
@ -529,7 +529,7 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation,
|
|||
}
|
||||
|
||||
WriteBufferOperation *writeOperation = NULL;
|
||||
for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); it++) {
|
||||
for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) {
|
||||
NodeOperationInput *target = *it;
|
||||
|
||||
/* try to find existing write buffer operation */
|
||||
|
@ -555,7 +555,7 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation,
|
|||
writeOperation->readResolutionFromInputSocket();
|
||||
|
||||
/* add readbuffer op for every former connected input */
|
||||
for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); it++) {
|
||||
for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) {
|
||||
NodeOperationInput *target = *it;
|
||||
if (&target->getOperation() == writeOperation) {
|
||||
continue; /* skip existing write op links */
|
||||
|
@ -578,13 +578,13 @@ void NodeOperationBuilder::add_complex_operation_buffers()
|
|||
* will invalidate iterators over the main m_operations
|
||||
*/
|
||||
Operations complex_ops;
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
if ((*it)->isComplex()) {
|
||||
complex_ops.push_back(*it);
|
||||
}
|
||||
}
|
||||
|
||||
for (Operations::const_iterator it = complex_ops.begin(); it != complex_ops.end(); it++) {
|
||||
for (Operations::const_iterator it = complex_ops.begin(); it != complex_ops.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
DebugInfo::operation_read_write_buffer(op);
|
||||
|
@ -626,7 +626,7 @@ static void find_reachable_operations_recursive(Tags &reachable, NodeOperation *
|
|||
void NodeOperationBuilder::prune_operations()
|
||||
{
|
||||
Tags reachable;
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
/* output operations are primary executed operations */
|
||||
|
@ -637,7 +637,7 @@ void NodeOperationBuilder::prune_operations()
|
|||
|
||||
/* delete unreachable operations */
|
||||
Operations reachable_ops;
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
if (reachable.find(op) != reachable.end()) {
|
||||
|
@ -677,7 +677,7 @@ void NodeOperationBuilder::sort_operations()
|
|||
sorted.reserve(m_operations.size());
|
||||
Tags visited;
|
||||
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
sort_operations_recursive(sorted, visited, *it);
|
||||
}
|
||||
|
||||
|
@ -717,7 +717,7 @@ ExecutionGroup *NodeOperationBuilder::make_group(NodeOperation *op)
|
|||
|
||||
void NodeOperationBuilder::group_operations()
|
||||
{
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
|
||||
for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
|
||||
NodeOperation *op = *it;
|
||||
|
||||
if (op->isOutputOperation(m_context->isRendering())) {
|
||||
|
|
|
@ -92,7 +92,7 @@ void deg_graph_transitive_reduction(Depsgraph *graph)
|
|||
* set/cleared. */
|
||||
/* TODO: there will be other types in future, so iterators above
|
||||
* need modifying. */
|
||||
it_rel++;
|
||||
++it_rel;
|
||||
}
|
||||
else if (rel->from->custom_flags & OP_REACHABLE) {
|
||||
rel->unlink();
|
||||
|
@ -100,7 +100,7 @@ void deg_graph_transitive_reduction(Depsgraph *graph)
|
|||
num_removed_relations++;
|
||||
}
|
||||
else {
|
||||
it_rel++;
|
||||
++it_rel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ struct IK_Scene {
|
|||
if (scene) {
|
||||
delete scene;
|
||||
}
|
||||
for (std::vector<IK_Target *>::iterator it = targets.begin(); it != targets.end(); it++) {
|
||||
for (std::vector<IK_Target *>::iterator it = targets.begin(); it != targets.end(); ++it) {
|
||||
delete (*it);
|
||||
}
|
||||
targets.clear();
|
||||
|
|
|
@ -718,7 +718,7 @@ void IMB_exr_add_view(void *handle, const char *name)
|
|||
static int imb_exr_get_multiView_id(StringVector &views, const std::string &name)
|
||||
{
|
||||
int count = 0;
|
||||
for (StringVector::const_iterator i = views.begin(); count < views.size(); i++) {
|
||||
for (StringVector::const_iterator i = views.begin(); count < views.size(); ++i) {
|
||||
if (name == *i) {
|
||||
return count;
|
||||
}
|
||||
|
@ -736,7 +736,7 @@ static void imb_exr_get_views(MultiPartInputFile &file, StringVector &views)
|
|||
if (exr_has_multipart_file(file) == false) {
|
||||
if (exr_has_multiview(file)) {
|
||||
StringVector sv = multiView(file.header(0));
|
||||
for (StringVector::const_iterator i = sv.begin(); i != sv.end(); i++) {
|
||||
for (StringVector::const_iterator i = sv.begin(); i != sv.end(); ++i) {
|
||||
views.push_back(*i);
|
||||
}
|
||||
}
|
||||
|
@ -1686,7 +1686,7 @@ static void exr_print_filecontents(MultiPartInputFile &file)
|
|||
const StringVector views = multiView(file.header(0));
|
||||
printf("OpenEXR-load: MultiView file\n");
|
||||
printf("OpenEXR-load: Default view: %s\n", defaultViewName(views).c_str());
|
||||
for (StringVector::const_iterator i = views.begin(); i != views.end(); i++) {
|
||||
for (StringVector::const_iterator i = views.begin(); i != views.end(); ++i) {
|
||||
printf("OpenEXR-load: Found view %s\n", (*i).c_str());
|
||||
}
|
||||
}
|
||||
|
@ -1701,7 +1701,7 @@ static void exr_print_filecontents(MultiPartInputFile &file)
|
|||
|
||||
for (int j = 0; j < numparts; j++) {
|
||||
const ChannelList &channels = file.header(j).channels();
|
||||
for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); i++) {
|
||||
for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i) {
|
||||
const Channel &channel = i.channel();
|
||||
printf("OpenEXR-load: Found channel %s of type %d\n", i.name(), channel.type);
|
||||
}
|
||||
|
@ -1713,7 +1713,7 @@ static const char *exr_rgba_channelname(MultiPartInputFile &file, const char *ch
|
|||
{
|
||||
const ChannelList &channels = file.header(0).channels();
|
||||
|
||||
for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); i++) {
|
||||
for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i) {
|
||||
/* const Channel &channel = i.channel(); */ /* Not used yet */
|
||||
const char *str = i.name();
|
||||
int len = strlen(str);
|
||||
|
|
Loading…
Reference in New Issue