本文整理汇总了C++中Transform3f::translate方法的典型用法代码示例。如果您正苦于以下问题:C++ Transform3f::translate方法的具体用法?C++ Transform3f::translate怎么用?C++ Transform3f::translate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform3f
的用法示例。
在下文中一共展示了Transform3f::translate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: match
//.........这里部分代码省略.........
// push the neighbor edge to the queue
edge_queue.push();
edge_queue.top().idx = nei_edge_idx;
edge_queue.top().beg = edge_end;
edge_queue.top().end = other_end;
}
}
// do initial transform (impose first subgraph edge in the queue on corresponding one in the graph)
int beg2 = edge_queue[0].beg;
int end2 = edge_queue[0].end;
int beg1 = _mapping[beg2];
int end1 = _mapping[end2];
Vec3f g1_v1, g1_v2, g2_v1, g2_v2, diff1, diff2;
Transform3f matr;
cb_get_xyz(_supergraph, beg1, g1_v1);
cb_get_xyz(_supergraph, end1, g1_v2);
cb_get_xyz(_subgraph, beg2, g2_v1);
cb_get_xyz(_subgraph, end2, g2_v2);
g2_v1.scale(scale);
g2_v2.scale(scale);
diff1.diff(g1_v2, g1_v1);
diff2.diff(g2_v2, g2_v1);
matr.identity();
if (!matr.rotationVecVec(diff2, diff1))
throw Error("error calling RotationVecVec()");
matr.translateLocal(-g2_v1.x, -g2_v1.y, -g2_v1.z);
matr.translate(g1_v1);
for (k = 0; k < xyz_sub.size(); k++)
xyz_sub[k].transformPoint(matr);
// for all edges in queue that are subject to rotate...
for (i = 0; i < edge_queue.size(); i++)
{
int edge_beg = edge_queue[i].beg;
int edge_end = edge_queue[i].end;
int edge_idx = edge_queue[i].idx;
if (in_cycle[edge_idx])
continue;
if (cb_can_rotate != 0 && !cb_can_rotate(_subgraph, edge_idx))
continue;
// start BFS from the end of the edge
states.zerofill();
states[edge_end] = 1;
vertex_queue.clear();
vertex_queue.push(edge_end);
bottom = 0;
while (vertex_queue.size() != bottom)
{
// extract vertex from queue
const Vertex &vertex = _subgraph.getVertex(vertex_queue[bottom]);
states[vertex_queue[bottom]] = 2;