ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/acismesh/oc_boite_ellipse.cpp
Revision: 1
Committed: Mon Jun 11 22:53:07 2007 UTC (17 years, 11 months ago)
File size: 2642 byte(s)
Log Message:

File Contents

# User Rev Content
1 1 /*****************************************************************
2    
3     oc_boite_ellipse.c Type:Func
4    
5     Mise en boite d une ellipse
6    
7     Date de creation : Wed Jun 25 15:37:09 1997
8    
9     Derniere version : Tue Aug 5 11:15:53 1997
10    
11    
12    
13    
14     Vincent FRANCOIS
15    
16     *****************************************************************/
17    
18    
19    
20    
21    
22     /**************************/
23     /* include */
24     #include <stdio.h>
25     #include <string.h>
26     #include "const.h"
27     #include "memoire.h"
28     #include "struct.h"
29     #include "prototype.h"
30    
31     /**************************/
32     /* variables globales */
33     extern struct s_acis *acis;
34     extern struct environnement env;
35     extern struct s_mesh *mesh;
36     extern struct s_param *para;
37    
38    
39    
40     /**************************/
41     /* programme principal */
42    
43     void oc_boite_ellipse(struct s_edge *edge,struct s_ellipse *ellipse,float *bxmin,float *bymin,float *bzmin,float *bxmax,float *bymax,float *bzmax)
44     {
45     struct s_vertex *vertex1,*vertex2;
46     int i;
47     float coord[4],para[4];
48    
49    
50     vertex1=edge->start_vertex;
51     vertex2=edge->end_vertex;
52     MINI(*bxmin,*bxmin,vertex1->point->coord[0]);
53     MINI(*bymin,*bymin,vertex1->point->coord[1]);
54     MINI(*bzmin,*bzmin,vertex1->point->coord[2]);
55     MAXI(*bxmax,*bxmax,vertex1->point->coord[0]);
56     MAXI(*bymax,*bymax,vertex1->point->coord[1]);
57     MAXI(*bzmax,*bzmax,vertex1->point->coord[2]);
58     MINI(*bxmin,*bxmin,vertex2->point->coord[0]);
59     MINI(*bymin,*bymin,vertex2->point->coord[1]);
60     MINI(*bzmin,*bzmin,vertex2->point->coord[2]);
61     MAXI(*bxmax,*bxmax,vertex2->point->coord[0]);
62     MAXI(*bymax,*bymax,vertex2->point->coord[1]);
63     MAXI(*bzmax,*bzmax,vertex2->point->coord[2]);
64     eval_ellipse(ellipse->param,0.,ZERO_DERIVE,para);
65     for (i=0;i<4;i++)
66     {
67     if (para[i]<edge->t1) para[i]=para[i]+2*PI;
68     if (edge->t1+edge->t2>=para[i])
69     {
70     eval_ellipse(ellipse->param,para[i],FONCTION,coord);
71     MINI(*bxmin,*bxmin,coord[0]);
72     MINI(*bymin,*bymin,coord[1]);
73     MINI(*bzmin,*bzmin,coord[2]);
74     MAXI(*bxmax,*bxmax,coord[0]);
75     MAXI(*bymax,*bymax,coord[1]);
76     MAXI(*bzmax,*bzmax,coord[2]);
77     }
78     }
79     }