void GroundEyeshot::drawTileLine() { int nViewTopX = m_Eyeshot.getViewTopX(); int nViewTopY = m_Eyeshot.getViewTopY(); xs::Point ktl(nViewTopX / 64,nViewTopY / 32); int col = m_Eyeshot.getViewWidth() / 64 + 2; int row = m_Eyeshot.getViewHeight() / 32 + 2; int w = col * 64; int h = col * 32; IRenderEngine *pRenderEngine = getRenderEngine(); IRenderSystem *pRenderSystem = pRenderEngine->getRenderSystem(); ColorValue color = pRenderSystem->getColor(); pRenderSystem->beginPrimitive(PT_LINES); // 绿色 pRenderSystem->setColor(ColorValue(0,0.48f,0)); int x = -(nViewTopX - ktl.x * 64); int y = -(nViewTopY - ktl.y * 32) - h + 16; for(int i = 0; i < col; i++) { xs::Point ptFrom (x,y); xs::Point ptTo (x + w, y + h); pRenderSystem->sendVertex(Vector3(ptFrom.x,ptFrom.y,-0.998)); pRenderSystem->sendVertex(Vector3(ptTo.x,ptTo.y,-0.998)); y += 32; } for(int i = 0; i < row; i++) { xs::Point ptFrom (x,y); xs::Point ptTo (x + w, y + h); pRenderSystem->sendVertex(Vector3(ptFrom.x,ptFrom.y,-0.998)); pRenderSystem->sendVertex(Vector3(ptTo.x,ptTo.y,-0.998)); ptFrom.x = x; ptFrom.y = y; ptTo.x = x + w; ptTo.y = y - h; pRenderSystem->sendVertex(Vector3(ptFrom.x,ptFrom.y,-0.998)); pRenderSystem->sendVertex(Vector3(ptTo.x,ptTo.y,-0.998)); y += 32; } for(int i = 0; i < col; i++) { xs::Point ptFrom (x,y); xs::Point ptTo (x + w, y - h); pRenderSystem->sendVertex(Vector3(ptFrom.x,ptFrom.y,-0.998)); pRenderSystem->sendVertex(Vector3(ptTo.x,ptTo.y,-0.998)); y += 32; } pRenderSystem->endPrimitive(); pRenderSystem->setColor(color); }
/* * Constructs a FormView as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ FormZastav::FormZastav( QWidget* parent, char * kat) : QDialog( parent) { setMinimumSize( QSize( 600, 370 ) ); setMaximumSize( QSize( 600, 370 ) ); setAcceptDrops( FALSE ); setSizeGripEnabled( FALSE ); setModal( FALSE ); QTextCodec::setCodecForTr(QTextCodec::codecForName ("Windows-1251")); QPixmap zs; QString ktl(kat); if (ktl=="") { #ifdef LINUX_D ktl = "/usr/share/smartcar/"; ktl =ktl + "umki_logo.png"; QFile mfl(ktl); if (!mfl.exists()){ ktl ="umki_logo.png"; } #endif #ifdef WIN_D ktl ="umki_logo.png"; #endif }else { ktl = ktl+"umki_logo.png"; } // qDebug()<<ktl; zs.load(ktl); TextLabel = new QLabel( trUtf8(""),this ); TextLabel->setGeometry( QRect( 0, 0, 600, 340 ) ); TextLabel->setPixmap(zs); TextLabel1 = new QLabel( tr(" Н А Ж М И Т Е Л Ю Б У Ю К Л А В И Ш У"),this ); TextLabel1->setGeometry( QRect( 100, 0, 600, 710 ) ); languageChange(); resize( QSize(300, 200).expandedTo(minimumSizeHint()) ); // signals and slots connections init(); }
int main() { ktl(); int n; while(scanf("%d", &n) != EOF) { if(n==0) break; for(int i=a[n][0]; i>0; i--) { printf("%d", a[n][i]); } printf("\n"); } }
void Membrane::addIntraStiffnesses(const shared_ptr<Node>& n,Vector3r& ktrans, Vector3r& krot) const { if(!hasRefConf()) return; int i=-1; for(int j=0; j<3; j++){ if(nodes[j].get()==n.get()){ i=j; break; }} if(i<0) throw std::logic_error("Membrane::addIntraStiffness:: node "+n->pyStr()+" not found within nodes of "+this->pyStr()+"."); if(KKcst.size()==0) return; bool dkt=(KKdkt.size()>0); // local translational stiffness diagonal Vector3r ktl(KKcst(2*i,2*i),KKcst(2*i+1,2*i+1),dkt?abs(KKdkt(3*i)):0); ktrans+=node->ori*ktl; // local rotational stiffness, if needed if(dkt){ #ifdef MEMBRANE_CONDENSE_DKT Vector3r krl(abs(KKdkt(3*i,2*i)),abs(KKdkt(3*i+1,2*i+1)),0); #else Vector3r krl(abs(KKdkt(3*i,3*i)),abs(KKdkt(3*i+1,3*i+1)),0); #endif krot+=node->ori*krl; } }
int main() { while (scanf("%d", &n) != EOF && n != 0) { printf("%I64d\n", ktl(n)); } return 0; }