1 |
|
5 |
//------------------------------------------------------------
|
2 |
|
|
//------------------------------------------------------------
|
3 |
|
|
// MAGiC
|
4 |
|
|
// Jean Christophe Cuillière et Vincent FRANCOIS
|
5 |
|
|
// Département de Génie Mécanique - UQTR
|
6 |
|
|
//------------------------------------------------------------
|
7 |
|
|
// Le projet MAGIC est un projet de recherche du département
|
8 |
|
|
// de génie mécanique de l'Université du Québec à
|
9 |
|
|
// Trois Rivières
|
10 |
|
|
// Les librairies ne peuvent être utilisées sans l'accord
|
11 |
|
|
// des auteurs (contact : francois@uqtr.ca)
|
12 |
|
|
//------------------------------------------------------------
|
13 |
|
|
//------------------------------------------------------------
|
14 |
|
|
//
|
15 |
|
|
// acis_courbe.cpp
|
16 |
|
|
//
|
17 |
|
|
//------------------------------------------------------------
|
18 |
|
|
//------------------------------------------------------------
|
19 |
|
|
// COPYRIGHT 2000
|
20 |
|
|
// Version du 02/03/2006 à 11H22
|
21 |
|
|
//------------------------------------------------------------
|
22 |
|
|
//------------------------------------------------------------
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
#include "gestionversion.h"
|
26 |
|
|
|
27 |
|
|
#ifdef BREP_SAT
|
28 |
|
|
|
29 |
|
|
#include "acis_courbe.h"
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
ACIS_COURBE::ACIS_COURBE(unsigned long num,SAT_COURBE *crb):MG_COURBE(num),courbe(crb)
|
36 |
|
|
{
|
37 |
|
|
t_min=courbe->get_tmin();
|
38 |
|
|
t_max=courbe->get_tmax();
|
39 |
|
|
}
|
40 |
|
|
|
41 |
|
|
ACIS_COURBE::ACIS_COURBE(SAT_COURBE *crb):MG_COURBE(),courbe(crb)
|
42 |
|
|
{
|
43 |
|
|
t_min=courbe->get_tmin();
|
44 |
|
|
t_max=courbe->get_tmax();
|
45 |
|
|
}
|
46 |
|
|
|
47 |
|
|
ACIS_COURBE::ACIS_COURBE(ACIS_COURBE& mdd):MG_COURBE(mdd),courbe(mdd.courbe)
|
48 |
|
|
{
|
49 |
|
|
t_min=mdd.t_min;
|
50 |
|
|
t_max=mdd.t_max;
|
51 |
|
|
}
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
ACIS_COURBE::~ACIS_COURBE()
|
56 |
|
|
{
|
57 |
|
|
}
|
58 |
|
|
|
59 |
|
|
void ACIS_COURBE::evaluer(double t,double *xyz)
|
60 |
|
|
{
|
61 |
|
|
courbe->evaluer(t,xyz);
|
62 |
|
|
}
|
63 |
|
|
|
64 |
|
|
void ACIS_COURBE::deriver(double t,double *xyz)
|
65 |
|
|
{
|
66 |
|
|
courbe->deriver(t,xyz);
|
67 |
|
|
}
|
68 |
|
|
|
69 |
|
|
void ACIS_COURBE::deriver_seconde(double t,double *ddxyz,double *dxyz,double *xyz)
|
70 |
|
|
{
|
71 |
|
|
double pt[3]={0,0,0};
|
72 |
|
|
double dt[3]={0,0,0};
|
73 |
|
|
double dtt[3]={0,0,0};
|
74 |
|
|
courbe->deriver_seconde(t,dtt,dt,pt);
|
75 |
|
|
if (xyz!=NULL)
|
76 |
|
|
{
|
77 |
|
|
xyz[0]=pt[0];
|
78 |
|
|
xyz[1]=pt[1];
|
79 |
|
|
xyz[2]=pt[2];
|
80 |
|
|
}
|
81 |
|
|
if (dxyz!=NULL)
|
82 |
|
|
{
|
83 |
|
|
dxyz[0]=dt[0];
|
84 |
|
|
dxyz[1]=dt[1];
|
85 |
|
|
dxyz[2]=dt[2];
|
86 |
|
|
}
|
87 |
|
|
ddxyz[0]=dtt[0];
|
88 |
|
|
ddxyz[1]=dtt[1];
|
89 |
|
|
ddxyz[2]=dtt[2];
|
90 |
|
|
}
|
91 |
|
|
|
92 |
|
|
void ACIS_COURBE::inverser(double& t,double *xyz,double precision)
|
93 |
|
|
{
|
94 |
|
|
courbe->inverser(t,xyz,precision);
|
95 |
|
|
}
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
double ACIS_COURBE::get_longueur(double t1,double t2,double precis)
|
101 |
|
|
{
|
102 |
|
|
return courbe->get_longueur(t1,t2);
|
103 |
|
|
}
|
104 |
|
|
|
105 |
|
|
int ACIS_COURBE::est_periodique(void)
|
106 |
|
|
{
|
107 |
|
|
return courbe->est_periodique();
|
108 |
|
|
}
|
109 |
|
|
|
110 |
|
|
double ACIS_COURBE::get_periode(void)
|
111 |
|
|
{
|
112 |
|
|
return courbe->get_periode();
|
113 |
|
|
}
|
114 |
|
|
|
115 |
|
|
void ACIS_COURBE::enregistrer(std::ostream& o)
|
116 |
|
|
{
|
117 |
|
|
o << "%" << get_id() << "=COURBE_SAT("<< courbe->get_id()<< ");" << std::endl;
|
118 |
|
|
}
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
int ACIS_COURBE::get_type_geometrique(TPL_LISTE_ENTITE<double> ¶m)
|
123 |
|
|
{
|
124 |
|
|
return courbe->get_type_geometrique(param);
|
125 |
|
|
}
|
126 |
|
|
|
127 |
francois |
19 |
void ACIS_COURBE::get_param_NURBS(int& indx_premier_ptctr,TPL_LISTE_ENTITE<double> ¶m)
|
128 |
|
5 |
{
|
129 |
francois |
19 |
return courbe->get_param_NURBS(indx_premier_ptctr,param);
|
130 |
|
5 |
}
|
131 |
|
|
|
132 |
|
|
|
133 |
|
|
#endif
|
134 |
|
|
|
135 |
|
|
|