ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/sld_point.cpp
Revision: 27
Committed: Thu Jul 5 15:26:40 2007 UTC (17 years, 10 months ago) by foucault
Original Path: magic/lib/geometrie/geometrie/src/sld_point.cpp
File size: 2967 byte(s)
Log Message:

File Contents

# User Rev Content
1 foucault 27 //------------------------------------------------------------
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     // sld_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     #ifdef BREP_SLD
28     #include <system.hpp>
29     #include "sld_point.h"
30     #include "constantegeo.h"
31     #include "sld_fonction.h"
32    
33     #include <atl\atlmod.h>
34     #include "smartvars.h"
35    
36    
37    
38    
39     SLD_POINT::SLD_POINT(unsigned long num,std::string idvertex,SLD_FONCTION& fonc):MG_POINT(num),fonction(fonc)
40     {
41     idoriginal=idvertex;
42     fonction.GetParID((char*)idvertex.c_str(),swVertex);
43     CComVariant vretval;
44     swVertex->GetPoint(&vretval) ;
45     SafeDoubleArray retval(vretval);
46     xyz[0]=retval[0];
47     xyz[1]=retval[1];
48     xyz[2]=retval[2];
49     }
50    
51     SLD_POINT::SLD_POINT(std::string idvertex,SLD_FONCTION& fonc):MG_POINT(),fonction(fonc)
52     {
53     idoriginal=idvertex;
54     fonction.GetParID((char*)idvertex.c_str(),swVertex);
55     CComVariant vretval;
56     swVertex->GetPoint(&vretval) ;
57     SafeDoubleArray retval(vretval);
58     xyz[0]=retval[0];
59     xyz[1]=retval[1];
60     xyz[2]=retval[2];
61     }
62    
63    
64     SLD_POINT::~SLD_POINT()
65     {
66     if (swVertex.p)
67     swVertex.p = NULL;
68     }
69    
70     void SLD_POINT::evaluer(double *coord)
71     {
72     coord[0]=xyz[0];
73     coord[1]=xyz[1];
74     coord[2]=xyz[2];
75     }
76    
77     void SLD_POINT::enregistrer(std::ostream& o)
78     {
79     o << "%" << get_id() << "=POINT_SLD("<< idoriginal.c_str() << ");" << std::endl;
80     }
81    
82     int SLD_POINT::get_type_geometrique(TPL_LISTE_ENTITE<double> &param)
83     {
84     param.ajouter(xyz[0]);
85     param.ajouter(xyz[1]);
86     param.ajouter(xyz[2]);
87     return MGCo_POINT;
88     }
89    
90    
91    
92     void SLD_POINT::get_param_NURBS(int& indx_premier_ptctr,TPL_LISTE_ENTITE<double> &param)
93     {
94    
95     // the first parameter indicates the acces code
96     param.ajouter(0);
97     // the second parameter indicates the order of the point which should be one for a point
98     param.ajouter(1);
99     param.ajouter(0);
100    
101     param.ajouter(1);
102     param.ajouter(0);
103    
104     // the third parameter presente the number of the controls point wich correspond to the cordinate point
105     // note that the cordinate of the control points are given in homogeneous cordinates
106     // for a point, the weight it's équal to one.
107    
108     param.ajouter(xyz[0]);
109     param.ajouter(xyz[1]);
110     param.ajouter(xyz[2]);
111    
112     param.ajouter(1);
113    
114     indx_premier_ptctr=5;
115    
116    
117     }
118    
119     #endif
120