本文整理汇总了C++中py::Dict::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Dict::end方法的具体用法?C++ Dict::end怎么用?C++ Dict::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py::Dict
的用法示例。
在下文中一共展示了Dict::end方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setNodeColor
void ViewProviderFemMeshPy::setNodeColor(Py::Dict arg)
{
long size = arg.size();
if(size == 0)
this->getViewProviderFemMeshPtr()->resetColorByNodeId();
else {
Base::TimeInfo Start;
Base::Console().Log("Start: ViewProviderFemMeshPy::setNodeColor() =================================\n");
//std::map<long,App::Color> NodeColorMap;
//for( Py::Dict::iterator it = arg.begin(); it!= arg.end();++it){
// Py::Int id((*it).first);
// Py::Tuple color((*it).second);
// NodeColorMap[id] = App::Color(Py::Float(color[0]),Py::Float(color[1]),Py::Float(color[2]),0);
//}
std::vector<long> NodeIds(size);
std::vector<App::Color> NodeColors(size);
long i = 0;
for( Py::Dict::iterator it = arg.begin(); it!= arg.end(); ++it,i++) {
Py::Int id((*it).first);
Py::Tuple color((*it).second);
NodeIds[i] = id;
NodeColors[i] = App::Color(Py::Float(color[0]),Py::Float(color[1]),Py::Float(color[2]),0);
}
Base::Console().Log(" %f: Start ViewProviderFemMeshPy::setNodeColor() call \n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
//this->getViewProviderFemMeshPtr()->setColorByNodeId(NodeColorMap);
this->getViewProviderFemMeshPtr()->setColorByNodeId(NodeIds,NodeColors);
Base::Console().Log(" %f: Finish ViewProviderFemMeshPy::setNodeColor() call \n",Base::TimeInfo::diffTimeF(Start,Base::TimeInfo()));
}
}
示例2: setElementColor
void ViewProviderFemMeshPy::setElementColor(Py::Dict arg)
{
if(arg.size() == 0)
this->getViewProviderFemMeshPtr()->resetColorByNodeId();
else {
std::map<long,App::Color> NodeColorMap;
for( Py::Dict::iterator it = arg.begin(); it!= arg.end(); ++it) {
Py::Int id((*it).first);
Py::Tuple color((*it).second);
NodeColorMap[id] = App::Color(Py::Float(color[0]),Py::Float(color[1]),Py::Float(color[2]),0);
}
this->getViewProviderFemMeshPtr()->setColorByElementId(NodeColorMap);
}
}
示例3: setNodeDisplacement
void ViewProviderFemMeshPy::setNodeDisplacement(Py::Dict arg)
{
if(arg.size() == 0)
this->getViewProviderFemMeshPtr()->resetColorByNodeId();
else {
std::map<long,Base::Vector3d> NodeDispMap;
union PyType_Object pyType = {&(Base::VectorPy::Type)};
Py::Type vType(pyType.o);
for( Py::Dict::iterator it = arg.begin(); it!= arg.end(); ++it) {
Py::Int id((*it).first);
if ((*it).second.isType(vType)) {
Py::Vector p((*it).second);
NodeDispMap[id] = p.toVector();
}
}
this->getViewProviderFemMeshPtr()->setDisplacementByNodeId(NodeDispMap);
}
}