本文整理汇总了C++中Primitive::getSelectedCurveCenter方法的典型用法代码示例。如果您正苦于以下问题:C++ Primitive::getSelectedCurveCenter方法的具体用法?C++ Primitive::getSelectedCurveCenter怎么用?C++ Primitive::getSelectedCurveCenter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Primitive
的用法示例。
在下文中一共展示了Primitive::getSelectedCurveCenter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mousePressEvent
void Scene::mousePressEvent( QMouseEvent* e )
{
// Regular behavior
QGLViewer::mousePressEvent(e);
if ((e->button() == Qt::RightButton) && (e->modifiers() == Qt::ShiftModifier))
{
QMenu menu( this );
QAction* selectControllerAction = menu.addAction("Select controller");
QAction* selectCurveAction = menu.addAction("Select curve");
menu.addSeparator();
QAction* action = NULL;
/*switch (selectMode){
case CONTROLLER:
case CONTROLLER_ELEMENT:
if(selection.isEmpty()){
print("Please select some controllers.");
break;
}*/
Controller * ctrl = (Controller *)activeObject()->ptr["controller"];
QAction* symmGrp = menu.addAction("Create Symmetry group..");
QAction* concentricGrp = menu.addAction("Create Concentric group..");
QAction* coplanGrp = menu.addAction("Create Coplanar group..");
menu.addSeparator();
QAction* self1foldSymm = menu.addAction("Create 1-fold Self-Symmetry..");
QAction* self2foldSymm = menu.addAction("Create 2-fold Self-Symmetry..");
menu.addSeparator();
QAction* addFixedPoint = menu.addAction("Add fixed Point");
// == Deformer stuff ===
menu.addSeparator();
QAction* selectFFD = menu.addAction("FFD");
QAction* selectVoxelDeformer = menu.addAction("Voxel Deformer");
// == end deformer ===
// == Primitive geometry stuff ==
menu.addSeparator();
QMenu & mesh_menu = *menu.addMenu("Modify geometry");
QAction* simplifyAction = mesh_menu.addAction("Simplify");
QAction* remeshAction = mesh_menu.addAction("Re-mesh");
QAction* replaceAction = mesh_menu.addAction("Replace geometry...");
mesh_menu.addSeparator();
QAction* loopAction = mesh_menu.addAction("Loop");
QAction* longEdgeAction = mesh_menu.addAction("Longest Edge");
QAction* butterflyAction = mesh_menu.addAction("Modified Butterfly");
mesh_menu.addSeparator();
QAction* laplacianSmoothAction = mesh_menu.addAction("Laplacian smoothing");
QAction* scaleSmoothAction = mesh_menu.addAction("Scale dependent smoothing");
QAction* mcfSmoothAction = mesh_menu.addAction("MCF smoothing");
// == end ===
action = menu.exec(e->globalPos()); // show menu
// Selections
if(action == selectControllerAction) setSelectMode(CONTROLLER);
if(action == selectCurveAction) setSelectMode(CONTROLLER_ELEMENT);
if(action == selectFFD) setSelectMode(FFD_DEFORMER);
if(action == selectVoxelDeformer) setSelectMode(VOXEL_DEFORMER);
Group* newGroup = NULL;
int opt = 0;
if(action == symmGrp) newGroup = new SymmetryGroup(SYMMETRY);
if(action == self1foldSymm) ctrl->getSelectedPrimitive()->setSymmetryPlanes(1);
if(action == self2foldSymm) ctrl->getSelectedPrimitive()->setSymmetryPlanes(2);
if(action == addFixedPoint)
{
Primitive * prim = ctrl->getSelectedPrimitive();
Point pos = prim->getSelectedCurveCenter();
prim->addFixedPoint(pos);
}
if(newGroup)
{
newGroup->process(ctrl->getPrimitives(selection));
newGroup->id = QString::number(ctrl->groups.size());
ctrl->groups[newGroup->id] = newGroup;
emit(groupsChanged());
print("New group added.");
}
if(mesh_menu.actions().contains(action))
{
Primitive * prim = ctrl->getSelectedPrimitive();
if(prim){
QSurfaceMesh * mesh = prim->getMesh();
double avgEdge = mesh->getAverageEdgeLength();
if(action == simplifyAction) Decimater::simplify(mesh, 0.5);
//.........这里部分代码省略.........