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