ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/sld_point.cpp
Revision: 283
Committed: Tue Sep 13 21:11:20 2011 UTC (13 years, 8 months ago) by francois
File size: 3133 byte(s)
Log Message:
structure de l'écriture

File Contents

# User Rev Content
1 foucault 27 //------------------------------------------------------------
2     //------------------------------------------------------------
3     // MAGiC
4 francois 283 // Jean Christophe Cuilli�re et Vincent FRANCOIS
5     // D�partement de G�nie M�canique - UQTR
6 foucault 27 //------------------------------------------------------------
7 francois 283 // 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 foucault 27 // des auteurs (contact : francois@uqtr.ca)
12     //------------------------------------------------------------
13     //------------------------------------------------------------
14     //
15     // sld_point.cpp
16     //
17     //------------------------------------------------------------
18     //------------------------------------------------------------
19     // COPYRIGHT 2000
20 francois 283 // Version du 02/03/2006 � 11H22
21 foucault 27 //------------------------------------------------------------
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 francois 283 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 foucault 27 }
50    
51     SLD_POINT::SLD_POINT(std::string idvertex,SLD_FONCTION& fonc):MG_POINT(),fonction(fonc)
52     {
53 francois 283 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 foucault 27 }
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 francois 283 coord[0]=xyz[0];
73     coord[1]=xyz[1];
74     coord[2]=xyz[2];
75 foucault 27 }
76    
77     void SLD_POINT::enregistrer(std::ostream& o)
78     {
79 francois 283 o << "%" << get_id() << "=POINT_SLD("<< idoriginal.c_str() << ");" << std::endl;
80 foucault 27 }
81    
82     int SLD_POINT::get_type_geometrique(TPL_LISTE_ENTITE<double> &param)
83     {
84 francois 283 param.ajouter(xyz[0]);
85     param.ajouter(xyz[1]);
86     param.ajouter(xyz[2]);
87     return MGCo_POINT;
88 foucault 27 }
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 francois 283 param.ajouter(0);
97 foucault 27 // the second parameter indicates the order of the point which should be one for a point
98 francois 283 param.ajouter(1);
99     param.ajouter(0);
100 foucault 27
101 francois 283 param.ajouter(1);
102     param.ajouter(0);
103 foucault 27
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 francois 283 // for a point, the weight it's �qual to one.
107 foucault 27
108 francois 283 param.ajouter(xyz[0]);
109     param.ajouter(xyz[1]);
110     param.ajouter(xyz[2]);
111 foucault 27
112 francois 283 param.ajouter(1);
113 foucault 27
114 francois 283 indx_premier_ptctr=5;
115 foucault 27
116    
117     }
118    
119     #endif
120