ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/sld_point.cpp
Revision: 19
Committed: Wed Jun 20 17:47:45 2007 UTC (17 years, 10 months ago) by francois
Original Path: magic/lib/geometrie/geometrie/src/sld_point.cpp
File size: 3038 byte(s)
Log Message:
ajout d'un index dans les param NURBS

File Contents

# User Rev Content
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     // 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     }
67    
68     void SLD_POINT::evaluer(double *coord)
69     {
70     coord[0]=xyz[0];
71     coord[1]=xyz[1];
72     coord[2]=xyz[2];
73     }
74    
75     void SLD_POINT::enregistrer(std::ostream& o)
76     {
77     o << "%" << get_id() << "=POINT_SLD("<< idoriginal.c_str() << ");" << std::endl;
78     }
79    
80     int SLD_POINT::get_type_geometrique(TPL_LISTE_ENTITE<double> &param)
81     {
82     param.ajouter(xyz[0]);
83     param.ajouter(xyz[1]);
84     param.ajouter(xyz[2]);
85     return MGCo_POINT;
86     }
87    
88    
89    
90 francois 19 void SLD_POINT::get_param_NURBS(int& indx_premier_ptctr,TPL_LISTE_ENTITE<double> &param)
91 5 {
92 francois 19
93 5 // the first parameter indicates the acces code
94     param.ajouter(0);
95     // the second parameter indicates the order of the point which should be one for a point
96     param.ajouter(1);
97     param.ajouter(0);
98    
99     param.ajouter(1);
100     param.ajouter(0);
101    
102     // the third parameter presente the number of the controls point wich correspond to the cordinate point
103     // note that the cordinate of the control points are given in homogeneous cordinates
104     // for a point, the weight it's équal to one.
105    
106     param.ajouter(xyz[0]);
107     param.ajouter(xyz[1]);
108     param.ajouter(xyz[2]);
109    
110     param.ajouter(1);
111    
112 francois 19 indx_premier_ptctr=5;
113 5
114 francois 19
115 5 }
116    
117     #endif
118