glm::mat4 AbstractNavigation::randomView() { float x = static_cast <float> (rand() % 180); float y = static_cast <float> (rand() % 180); float z = static_cast <float> (rand() % 180); return frontview() * glm::rotate(x, glm::vec3(1,0,0)) * glm::rotate(y, glm::vec3(0,1,0)) * glm::rotate(z, glm::vec3(0,0,1)); }
void lc_tankdlg::procesAction(Document_Interface *doc) { Q_UNUSED(doc); double leng, breadth,height,r,CH,x; // r=radius, CH=Cylinder Height, x=spacing QString layer1,layer2,layer3; leng= lengthedit->text().toDouble(); breadth= widthedit->text().toDouble(); height= heightedit->text().toDouble(); r= cycradius->text().toDouble(); CH= cycheight->text().toDouble(); x=spaceedit->text().toDouble(); QColor s,s1,s2; switch (topcoloredit->currentIndex()) { case 0: s= QColor(255, 0, 0, 127); break; case 1: s= QColor(0,0, 255, 127); break; case 2: s= QColor(0, 255,0, 127); break; case 3: s= QColor(255, 255,255, 127); break; } layer1=topedit->text(); doc->setLayer(layer1); doc->setCurrentLayerProperties(s,DPI::Width08 , DPI::SolidLine); topview(leng,breadth,r,doc); switch (frontcoloredit->currentIndex()) { case 0: s1= QColor(255, 0, 0, 127); break; case 1: s1= QColor(0,0, 255, 127); break; case 2: s1= QColor(0, 255,0, 127); break; case 3: s1= QColor(255, 255,255, 127); break; } layer2=frontedit->text(); doc->setLayer(layer2); doc->setCurrentLayerProperties(s1,DPI::Width08 , DPI::SolidLine); frontview(height,leng,x,CH,r,breadth,doc); switch (sidecoloredit->currentIndex()) { case 0: s2= QColor(255, 0, 0, 127); break; case 1: s2= QColor(0,0, 255, 127); break; case 2: s2= QColor(0, 255,0, 127); break; case 3: s2= QColor(255, 255,255, 127); break; } layer3=sideedit->text(); doc->setLayer(layer3); doc->setCurrentLayerProperties(s2,DPI::Width08 , DPI::SolidLine); sideview(leng,x,breadth,height,r,CH,doc); }
glm::mat4 AbstractNavigation::bottomLeftView() { return frontview() * glm::rotate(-30.f, glm::vec3(1,0,0)) * glm::rotate(-45.f, glm::vec3(0,1,0)); }
glm::mat4 AbstractNavigation::topRightView() { return frontview() * glm::rotate(30.f, glm::vec3(1,0,0)) * glm::rotate(45.f, glm::vec3(0,1,0)); }
glm::mat4 AbstractNavigation::bottomview() { return frontview() * glm::rotate(90.f, glm::vec3(1,0,0)); }
glm::mat4 AbstractNavigation::leftview() { return frontview() * glm::rotate(90.f, glm::vec3(0,1,0)); }
glm::mat4 AbstractNavigation::backview() { return frontview() * glm::rotate(180.0f, glm::vec3(0,1,0)); }
glm::mat4 AbstractNavigation::defaultView() { return frontview(); }