#include <iostream>
#include <stdlib.h>
#include <orocos_kdl/src/frames.hpp>
#include <cstring>
using namespace Std;
using namespace KDL;
Class ABC
{public:
Char name[20];
int m;
Vector2 Point[3];
ABC ()
{
for (int i=0;i<20;i++) name[i]=0;
m=0;
}
};
int main ()
{
Char i,j;
Char a[3][20];
Char b[6][10];
Double c[6]={0,0,0,0,0,0};
Char d[3][20];
Char e[2][10];
Double f[2];
cout<< "Please enter";
ABC P;
cin>>p.name;
cin>>p.m;
Switch (p.m.)
{
Case 1:
{
cin>>a[0];
For (i=1;i<=10&&a[0][i]!= ', '; i++) b[0][i-1]=a[0][i];
for (j=0,i++;j<10&&a[0][i]!= ') '; i++,j++) b[1][j]=a[0][i];
C[0]=atof (B[0]); C[1]=atof (b[1]);
P.point[0]= (Vector2 (c[0],c[1));
}
Break
Case 2:
{
cin>>a[0];
cin>>a[1];
For (i=1;i<=10&&a[0][i]!= ', '; i++) b[0][i-1]=a[0][i];
for (j=0,i++;j<10&&a[0][i]!= ') '; i++,j++) b[1][j]=a[0][i];
For (i=1;i<=10&&a[1][i]!= ', '; i++) b[2][i-1]=a[1][i];
for (j=0,i++;j<10&&a[1][i]!= ') '; i++,j++) b[3][j]=a[1][i];
C[0]=atof (B[0]); C[1]=atof (b[1]);
C[2]=atof (b[2]); C[3]=atof (b[3]);
P.point[0]= (Vector2 (c[0],c[1));
P.point[1]= (Vector2 (c[2],c[3));
}
Break
Case 3:
{
cin>>a[0];
cin>>a[1];
cin>>a[2];
For (i=1;i<=10&&a[0][i]!= ', '; i++) b[0][i-1]=a[0][i];
for (j=0,i++;j<10&&a[0][i]!= ') '; i++,j++) b[1][j]=a[0][i];
For (i=1;i<=10&&a[1][i]!= ', '; i++) b[2][i-1]=a[1][i];
for (j=0,i++;j<10&&a[1][i]!= ') '; i++,j++) b[3][j]=a[1][i];
For (i=1;i<=10&&a[2][i]!= ', '; i++) b[4][i-1]=a[2][i];
for (j=0,i++;j<10&&a[2][i]!= ') '; i++,j++) b[5][j]=a[2][i];
C[0]=atof (B[0]); C[1]=atof (b[1]);
C[2]=atof (b[2]); C[3]=atof (b[3]);
C[4]=atof (B[4]); C[5]=atof (b[5]);
P.point[0]= (Vector2 (c[0],c[1));
P.point[1]= (Vector2 (c[2],c[3));
P.point[2]= (Vector2 (c[4],c[5));
}
Break
default:cout<< "Error";
}
for (int k=0;k<20;k++) d[0][k]=0;
cin>>d[0];
if (d[0][0]== ' m ' &&d[0][1]== ' o ' &&d[0][2]== ' V ' &&d[0][3]== ' e ' &&d[0][4]==0)
{
for (int k=0;k<20;k++) d[1][k]=0;
cin>>d[1];
if (!strcmp (d[1],p.name))
{
cin>>d[2];
For (i=1;i<=10&&d[2][i]!= ', '; i++) e[0][i-1]=d[2][i];
for (j=0,i++;j<10&&d[2][i]!= ') '; i++,j++) e[1][j]=d[2][i];
F[0]=atof (E[0]); F[1]=atof (e[1]);
for (i=0;i<3;i++) P.point[i]+=vector2 (f[0],f[1]);
}
else cout<< "error/n";
}
else if (d[0][0]== ' R ' &&d[0][1]== ' o ' &&d[0][2]== ' t ' &&d[0][3]== ' a ' &&d[0][4]== ' t ' &&d[0][5]== ' E ' &&d[0][6]==0)
{
for (int k=0;k<20;k++) d[1][k]=0;
cin>>d[1];
if (!strcmp (d[1],p.name))
{
cin>>d[2];
F[0]=atof (d[2]);
Rotation2 rot (f[0]/180*3.1415926);
for (i=0;i<3;i++) P.point[i]=rot. Inverse (p.point[i]);
}
else cout<< "error/n";
}
else cout<< "error/n";
for (i=0;i<p.m;i++) cout<< ' (' <<p.point[i].x () << ', ' <<p.point[i].y () << ")";
cout<<endl;
}
Real-time control software design first time job