| 304 | |
| 305 | |
| 306 | void TaskProjGroup::turnViewToProjGroup() |
| 307 | { |
| 308 | App::Document* doc = view->getDocument(); |
| 309 | |
| 310 | std::string multiViewName = doc->getUniqueObjectName("ProjGroup"); |
| 311 | Gui::Command::doCommand(Gui::Command::Gui, "App.activeDocument().addObject('TechDraw::DrawProjGroup', '%s')", multiViewName.c_str()); |
| 312 | Gui::Command::doCommand(Gui::Command::Gui, "App.activeDocument().%s.addView(App.activeDocument().%s)", view->findParentPage()->getNameInDocument(), multiViewName.c_str()); |
| 313 | |
| 314 | auto* viewPart = static_cast<TechDraw::DrawViewPart*>(view); |
| 315 | |
| 316 | multiView = static_cast<TechDraw::DrawProjGroup*>(doc->getObject(multiViewName.c_str())); |
| 317 | multiView->Source.setValues(viewPart->Source.getValues()); |
| 318 | multiView->XSource.setValues(viewPart->XSource.getValues()); |
| 319 | multiView->X.setValue(viewPart->X.getValue()); |
| 320 | multiView->Y.setValue(viewPart->Y.getValue()); |
| 321 | multiView->Scale.setValue(viewPart->Scale.getValue()); |
| 322 | multiView->ScaleType.setValue(viewPart->ScaleType.getValue()); |
| 323 | multiView->ProjectionType.setValue(Preferences::projectionAngle()); |
| 324 | |
| 325 | multiView->addView(viewPart); |
| 326 | multiView->Anchor.setValue(viewPart); |
| 327 | multiView->Anchor.purgeTouched(); |
| 328 | multiView->AutoDistribute.setValue(ui->cbAutoDistribute->isChecked()); |
| 329 | |
| 330 | viewPart->X.setValue(0.0); |
| 331 | viewPart->Y.setValue(0.0); |
| 332 | viewPart->ScaleType.setValue("Custom"); |
| 333 | viewPart->ScaleType.setStatus(App::Property::Hidden, true); |
| 334 | viewPart->Scale.setStatus(App::Property::Hidden, true); |
| 335 | viewPart->Label.setValue("Front"); |
| 336 | viewPart->LockPosition.setValue(true); |
| 337 | viewPart->LockPosition.setStatus(App::Property::ReadOnly, true); //Front should stay locked. |
| 338 | viewPart->LockPosition.purgeTouched(); |
| 339 | |
| 340 | m_page->requestPaint(); |
| 341 | view = multiView; |
| 342 | m_page->removeView(viewPart); // prevent multiple entries in tree |
| 343 | |
| 344 | updateUi(); |
| 345 | } |
| 346 | |
| 347 | void TaskProjGroup::turnProjGroupToView() |
| 348 | { |
nothing calls this directly
no test coverage detected