ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/polyexemple/src/main5.cpp
Revision: 416
Committed: Wed Aug 21 15:24:24 2013 UTC (11 years, 8 months ago) by cuillier
File size: 1264 byte(s)
Log Message:
Import initial

File Contents

# User Rev Content
1 cuillier 416 #include "line.h"
2     #include "segment.h"
3     #include "circle.h"
4     #include <iostream>
5     #include <vector>
6     #include <stdio.h>
7    
8     int main(void)
9     {
10     double point[3]={5.,5.,5.};
11     double dir[3]={0.,1.,0};
12    
13     LINE l1(point,dir);
14     double xyz[3];
15     l1.evaluer(-1.,xyz);
16    
17     printf("Sortie element par element\n");
18     std::cout << xyz[0] << " " << xyz[1] << " " << xyz[2] << " " << std::endl;
19    
20     double xyz2[3];
21     SEGMENT s1(point,dir,0.,3.);
22     s1.evaluer(-1.,xyz2);
23     std::cout << xyz2[0] << " " << xyz2[1] << " " << xyz2[2] << " " << std::endl;
24    
25     double xyz3[3];
26     SEGMENT s2(point,dir,-1.,3.);
27     s2.evaluer(-1.,xyz3);
28     std::cout << xyz3[0] << " " << xyz3[1] << " " << xyz3[2] << " " << std::endl;
29    
30     double centcir[3]={2.,2.,7.};
31     double raycir=10.0;
32    
33     CIRCLE c1(centcir,raycir);
34     double xyz4[3];
35     c1.evaluer(-1.,xyz4);
36     std::cout << xyz4[0] << " " << xyz4[1] << " " << xyz4[2] << " " << std::endl;
37    
38     std::vector<CURVE*> tab;
39     tab.push_back(&l1);
40     tab.push_back(&s1);
41     tab.push_back(&s2);
42     tab.push_back(&c1);
43    
44     printf("\n");
45     printf("Sortie vector\n");
46    
47     for (int i=0;i<tab.size();i++)
48     {
49     double xyz5[3]={-100,-100,-100};
50     CURVE* c=tab[i];
51     c->evaluer(-1,xyz5);
52     std::cout << xyz5[0] << " " << xyz5[1] << " " << xyz5[2] << " " << std::endl;
53     }
54     }

Properties

Name Value
svn:executable