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

File Contents

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

Properties

Name Value
svn:executable