本文整理汇总了C++中nodes_t::end方法的典型用法代码示例。如果您正苦于以下问题:C++ nodes_t::end方法的具体用法?C++ nodes_t::end怎么用?C++ nodes_t::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nodes_t
的用法示例。
在下文中一共展示了nodes_t::end方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_nodes_entry
void TORRENT_EXTRA_EXPORT write_nodes_entry(entry& r, nodes_t const& nodes)
{
bool ipv6_nodes = false;
entry& n = r["nodes"];
std::back_insert_iterator<std::string> out(n.string());
for (nodes_t::const_iterator i = nodes.begin()
, end(nodes.end()); i != end; ++i)
{
if (!i->addr().is_v4())
{
ipv6_nodes = true;
continue;
}
std::copy(i->id.begin(), i->id.end(), out);
write_endpoint(udp::endpoint(i->addr(), i->port()), out);
}
if (ipv6_nodes)
{
entry& p = r["nodes2"];
std::string endpoint;
for (nodes_t::const_iterator i = nodes.begin()
, end(nodes.end()); i != end; ++i)
{
if (!i->addr().is_v6()) continue;
endpoint.resize(18 + 20);
std::string::iterator out = endpoint.begin();
std::copy(i->id.begin(), i->id.end(), out);
out += 20;
write_endpoint(udp::endpoint(i->addr(), i->port()), out);
endpoint.resize(out - endpoint.begin());
p.list().push_back(entry(endpoint));
}
}
}
示例2: merge_interactive_selection
void merge_interactive_selection(const nodes_t& Nodes, const UpdatePolicyT& UpdatePolicy, const k3d::selection::records& InteractiveSelection)
{
for(nodes_t::const_iterator node = Nodes.begin(); node != Nodes.end(); ++node)
{
if(classes::MeshInstance() != (*node)->factory().factory_id())
continue;
imesh_selection_sink* const mesh_selection_sink = dynamic_cast<imesh_selection_sink*>(*node);
if(!mesh_selection_sink)
continue;
imesh_source* const mesh_source = dynamic_cast<imesh_source*>(*node);
if(!mesh_source)
continue;
const k3d::mesh* const mesh = boost::any_cast<k3d::mesh*>(mesh_source->mesh_source_output().property_internal_value());
if(!mesh)
continue;
const k3d::selection::set current_selection =
boost::any_cast<k3d::selection::set>(mesh_selection_sink->mesh_selection_sink_input().property_internal_value());
property::set_internal_value(mesh_selection_sink->mesh_selection_sink_input(), UpdatePolicy(*node, *mesh, current_selection, InteractiveSelection));
property::set_internal_value(**node, "show_component_selection", true);
}
}
示例3: write_tree
void tree::write_tree( ostream& os ) const
{
for( const_iterator i = nodes.begin(),
e = nodes.end();
i != e; ++i )
{
i->write_value( os );
if( const inner_node* p = dynamic_cast<const inner_node*>( &*i ) )
p->write_tree( os );
}
}
示例4: size
size_t tree::size() const
{
size_t res = 1;
for( const_iterator i = nodes.begin(),
e = nodes.end();
i != e; ++i )
{
res += i->node_size();
}
return res;
}
示例5: write_way
void xml_formatter::write_way(const element_info &elem, const nodes_t &nodes,
const tags_t &tags) {
writer->start("way");
write_common(elem);
for (nodes_t::const_iterator itr = nodes.begin(); itr != nodes.end(); ++itr) {
writer->start("nd");
writer->attribute("ref", *itr);
writer->end();
}
write_tags(tags);
writer->end();
}
示例6: write_way
void json_formatter::write_way(const element_info &elem, const nodes_t &nodes,
const tags_t &tags) {
writer->start_object();
write_common(elem);
writer->object_key("nds");
writer->start_array();
for (nodes_t::const_iterator itr = nodes.begin(); itr != nodes.end(); ++itr) {
writer->entry_int(*itr);
}
writer->end_array();
write_tags(tags);
writer->end_object();
}
示例7: find
tree::iterator tree::find( const string& match )
{
for( iterator i = nodes.begin(),
e = nodes.end();
i != e; ++i )
{
if( i->description() == match )
return i;
if( inner_node* p = dynamic_cast<inner_node*>( &*i ) )
{
iterator j = p->find( match );
if( j != p->child_end() )
return j;
}
}
return child_end();
}
示例8:
inline tree::const_iterator tree::child_end() const
{
return nodes.end();
}
示例9: remove
inline void tree::remove( iterator n )
{
BOOST_ASSERT( n != nodes.end() );
nodes.erase( n );
}
示例10: modify_selected_meshes
void modify_selected_meshes(document_state& DocumentState, iplugin_factory* Modifier)
{
return_if_fail(Modifier);
idocument& document = DocumentState.document();
if (Modifier->implements(typeid(imulti_mesh_sink)))
{ // Mesh modifier taking multiple inputs
uint_t count = 0;
ipipeline::dependencies_t dependencies;
const nodes_t selected_nodes = selection::state(DocumentState.document()).selected_nodes();
// Create the node
inode* multi_sink = pipeline::create_node(document, *Modifier);
record_state_change_set changeset(document, string_cast(boost::format(_("Add Modifier %1%")) % Modifier->name()), K3D_CHANGE_SET_CONTEXT);
nodes_t nodes_to_delete;
for(nodes_t::const_iterator node = selected_nodes.begin(); node != selected_nodes.end(); ++node)
{
imesh_sink* const mesh_sink = dynamic_cast<imesh_sink*>(*node);
if(!mesh_sink)
continue;
imatrix_sink* const matrix_sink = dynamic_cast<imatrix_sink*>(*node);
iproperty* source_mesh = document.pipeline().dependency(mesh_sink->mesh_sink_input());
if (!source_mesh)
continue;
if (matrix_sink) // Insert a transform node
{
iproperty* const source_transformation = document.pipeline().dependency(matrix_sink->matrix_sink_input());
if (source_transformation)
{
inode* transform_points = plugin::create<inode>("TransformPoints", document, unique_name(document.nodes(), "TransformPoints"));
return_if_fail(transform_points);
imatrix_sink* transform_points_matrix_sink = dynamic_cast<imatrix_sink*>(transform_points);
return_if_fail(transform_points_matrix_sink);
imesh_sink* transform_points_mesh_sink = dynamic_cast<imesh_sink*>(transform_points);
return_if_fail(transform_points_mesh_sink);
dependencies.insert(std::make_pair(&transform_points_matrix_sink->matrix_sink_input(), source_transformation));
dependencies.insert(std::make_pair(&transform_points_mesh_sink->mesh_sink_input(), source_mesh));
imesh_source* transform_points_mesh_source = dynamic_cast<imesh_source*>(transform_points);
return_if_fail(transform_points_mesh_source);
source_mesh = &transform_points_mesh_source->mesh_source_output();
imesh_selection_sink* selection_sink = dynamic_cast<imesh_selection_sink*>(transform_points);
return_if_fail(selection_sink);
property::set_internal_value(selection_sink->mesh_selection_sink_input(), k3d::geometry::selection::create(1.0));
}
}
++count;
// Create a new user property
std::stringstream name, label;
name << "input_mesh" << count;
label << "Input Mesh " << count;
iproperty* sink = property::get(*multi_sink, name.str());
if (!sink)
sink = property::create<mesh*>(*multi_sink, name.str(), label.str(), "", static_cast<mesh*>(0));
// Store the connection
dependencies.insert(std::make_pair(sink, source_mesh));
// Delete the input node
nodes_to_delete.push_back(*node);
}
document.pipeline().set_dependencies(dependencies);
delete_nodes(document, nodes_to_delete);
// Give nodes a chance to initialize their property values based on their inputs, if any ...
if(ireset_properties* const reset_properties = dynamic_cast<ireset_properties*>(multi_sink))
reset_properties->reset_properties();
panel::mediator(DocumentState.document()).set_focus(*multi_sink);
}
else
{ // Normal mesh modifier
nodes_t new_modifiers;
const nodes_t selected_nodes = selection::state(DocumentState.document()).selected_nodes();
for(nodes_t::const_iterator node = selected_nodes.begin(); node != selected_nodes.end(); ++node)
{
new_modifiers.push_back(modify_mesh(DocumentState, **node, Modifier));
assert_warning(new_modifiers.back());
}
// Show the new modifier properties if only one was processed
if(selected_nodes.size() == 1)
{
panel::mediator(DocumentState.document()).set_focus(*new_modifiers.front());
}
else // otherwise connect all parameter properties to the first node and show that one
{
iproperty_collection* first_property_collection = dynamic_cast<iproperty_collection*>(new_modifiers.front());
if (first_property_collection)
{
// Get the in-and output property names, to exclude them from the connections
imesh_sink* const modifier_sink = dynamic_cast<imesh_sink*>(new_modifiers.front());
return_if_fail(modifier_sink);
imesh_source* const modifier_source = dynamic_cast<imesh_source*>(new_modifiers.front());
return_if_fail(modifier_source);
const std::string sink_name = modifier_sink->mesh_sink_input().property_name();
const std::string source_name = modifier_source->mesh_source_output().property_name();
ipipeline::dependencies_t dependencies;
const iproperty_collection::properties_t& first_properties = first_property_collection->properties();
nodes_t::iterator modifier = new_modifiers.begin();
++modifier;
for (modifier; modifier != new_modifiers.end(); ++modifier)
//.........这里部分代码省略.........
示例11: end
const_iterator end() const
{
return nodes_.end();
}