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 |
|
|
// lc_point.cpp
|
16 |
|
|
//
|
17 |
|
|
//------------------------------------------------------------
|
18 |
|
|
//------------------------------------------------------------
|
19 |
|
|
// COPYRIGHT 2000
|
20 |
|
|
// Version du 02/03/2006 à 11H22
|
21 |
|
|
//------------------------------------------------------------
|
22 |
|
|
//------------------------------------------------------------
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
#include "gestionversion.h"
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
#include "mg_point.h"
|
29 |
|
|
#include "lc_point.h"
|
30 |
|
|
#include "constantegeo.h"
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
LC_POINT::LC_POINT(unsigned long num,double coo[3]):MG_POINT(num),x(coo[0]),y(coo[1]),z(coo[2])
|
36 |
|
|
{
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
LC_POINT::LC_POINT(double coo[3]):MG_POINT(),x(coo[0]),y(coo[1]),z(coo[2])
|
40 |
|
|
{
|
41 |
|
|
}
|
42 |
|
|
|
43 |
|
|
LC_POINT::LC_POINT(LC_POINT& mdd):MG_POINT(mdd),x(mdd.x),y(mdd.y),z(mdd.z)
|
44 |
|
|
{
|
45 |
|
|
}
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
LC_POINT::~LC_POINT()
|
50 |
|
|
{
|
51 |
|
|
}
|
52 |
|
|
|
53 |
|
|
int LC_POINT::get_type_geometrique(TPL_LISTE_ENTITE<double> ¶m)
|
54 |
|
|
{
|
55 |
|
|
param.ajouter(x);
|
56 |
|
|
param.ajouter(y);
|
57 |
|
|
param.ajouter(z);
|
58 |
|
|
return MGCo_POINT;
|
59 |
|
|
}
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
void LC_POINT::evaluer(double *xyz)
|
63 |
|
|
{
|
64 |
|
|
xyz[0]=x;
|
65 |
|
|
xyz[1]=y;
|
66 |
|
|
xyz[2]=z;
|
67 |
|
|
}
|
68 |
|
|
|
69 |
|
|
void LC_POINT::enregistrer(std::ostream& o)
|
70 |
|
|
{
|
71 |
|
|
o << "%" << get_id() << "=POINT("<< x << "," << y << "," << z << ");" << std::endl;
|
72 |
|
|
}
|
73 |
|
|
|
74 |
|
|
void LC_POINT::get_param_NURBS(TPL_LISTE_ENTITE<double> ¶m)
|
75 |
|
|
{
|
76 |
|
|
double xyz[3];
|
77 |
|
|
// the first parameter indicates the acces code
|
78 |
|
|
param.ajouter(0);
|
79 |
|
|
// the second parameter indicates the order of the point which should be one for a point
|
80 |
|
|
param.ajouter(1);
|
81 |
|
|
param.ajouter(0);
|
82 |
|
|
// the number of the control point
|
83 |
|
|
param.ajouter(1);
|
84 |
|
|
param.ajouter(0);
|
85 |
|
|
|
86 |
|
|
// the third parameter presente the number of the controls point wich correspond to the cordinate point
|
87 |
|
|
// note that the cordinate of the control points are given in homogeneous cordinates
|
88 |
|
|
// for a point, the weight it's équal to one.
|
89 |
|
|
|
90 |
|
|
param.ajouter(xyz[0]);
|
91 |
|
|
param.ajouter(xyz[1]);
|
92 |
|
|
param.ajouter(xyz[2]);
|
93 |
|
|
|
94 |
|
|
param.ajouter(1);
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
}
|
99 |
|
|
|
100 |
|
|
|