MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
sld_point.cpp
Aller à la documentation de ce fichier.
1 //####//------------------------------------------------------------
2 //####//------------------------------------------------------------
3 //####// MAGiC
4 //####// Jean Christophe Cuilliere et Vincent FRANCOIS
5 //####// Departement de Genie Mecanique - UQTR
6 //####//------------------------------------------------------------
7 //####// MAGIC est un projet de recherche de l equipe ERICCA
8 //####// du departement de genie mecanique de l Universite du Quebec a Trois Rivieres
9 //####// http://www.uqtr.ca/ericca
10 //####// http://www.uqtr.ca/
11 //####//------------------------------------------------------------
12 //####//------------------------------------------------------------
13 //####//
14 //####// sld_point.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:54 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 
23 
24 #include "gestionversion.h"
25 
26 #ifdef BREP_SLD
27 #include <system.hpp>
28 #include "sld_point.h"
29 #include "constantegeo.h"
30 #include "sld_fonction.h"
31 
32 #include <atl\atlmod.h>
33 #include "smartvars.h"
34 
35 
36 
37 
38 SLD_POINT::SLD_POINT(unsigned long num,std::string idvertex,SLD_FONCTION& fonc):MG_POINT(num),fonction(fonc)
39 {
40  idoriginal=idvertex;
41  fonction.GetParID((char*)idvertex.c_str(),swVertex);
42  CComVariant vretval;
43  swVertex->GetPoint(&vretval) ;
44  SafeDoubleArray retval(vretval);
45  xyz[0]=retval[0];
46  xyz[1]=retval[1];
47  xyz[2]=retval[2];
48 }
49 
50 SLD_POINT::SLD_POINT(std::string idvertex,SLD_FONCTION& fonc):MG_POINT(),fonction(fonc)
51 {
52  idoriginal=idvertex;
53  fonction.GetParID((char*)idvertex.c_str(),swVertex);
54  CComVariant vretval;
55  swVertex->GetPoint(&vretval) ;
56  SafeDoubleArray retval(vretval);
57  xyz[0]=retval[0];
58  xyz[1]=retval[1];
59  xyz[2]=retval[2];
60 }
61 
62 
64 {
65  if (swVertex.p)
66  swVertex.p = NULL;
67 }
68 
69 void SLD_POINT::evaluer(double *coord)
70 {
71  coord[0]=xyz[0];
72  coord[1]=xyz[1];
73  coord[2]=xyz[2];
74 }
75 
76 void SLD_POINT::enregistrer(std::ostream& o,double version)
77 {
78  o << "%" << get_id() << "=POINT_SLD("<< idoriginal.c_str() << ");" << std::endl;
79 }
80 
82 {
83  param.ajouter(xyz[0]);
84  param.ajouter(xyz[1]);
85  param.ajouter(xyz[2]);
86  return MGCo_POINT;
87 }
88 
89 
90 
91 void SLD_POINT::get_param_NURBS(int& indx_premier_ptctr,TPL_LISTE_ENTITE<double> &param)
92 {
93 
94  param.ajouter(0);
95  param.ajouter(1);
96  param.ajouter(0);
97 
98  param.ajouter(1);
99  param.ajouter(0);
100 
101 
102  param.ajouter(xyz[0]);
103  param.ajouter(xyz[1]);
104  param.ajouter(xyz[2]);
105 
106  param.ajouter(1);
107 
108  indx_premier_ptctr=5;
109 
110 
111 }
112 
113 #endif
114 
gestionversion.h
sld_point.h
MG_IDENTIFICATEUR::get_id
unsigned long get_id()
Definition: mg_identificateur.cpp:53
SLD_FONCTION
Definition: sld_fonction.h:37
SLD_POINT::get_type_geometrique
virtual int get_type_geometrique(TPL_LISTE_ENTITE< double > &param)
Definition: sld_point.cpp:81
SLD_POINT::fonction
SLD_FONCTION & fonction
Definition: sld_point.h:50
SLD_POINT::xyz
double xyz[3]
Definition: sld_point.h:51
sld_fonction.h
SLD_POINT::idoriginal
std::string idoriginal
Definition: sld_point.h:52
SLD_POINT::get_param_NURBS
virtual void get_param_NURBS(int &indx_premier_ptctr, TPL_LISTE_ENTITE< double > &param)
Definition: sld_point.cpp:91
SLD_POINT::enregistrer
virtual void enregistrer(std::ostream &o, double version)
Definition: sld_point.cpp:76
constantegeo.h
TPL_LISTE_ENTITE::ajouter
virtual void ajouter(X x)
Definition: tpl_liste_entite.h:38
MG_POINT
Definition: mg_point.h:33
SLD_POINT::swVertex
CComPtr< IVertex > swVertex
Definition: sld_point.h:49
SLD_POINT::SLD_POINT
SLD_POINT(unsigned long num, std::string idvertex, class SLD_FONCTION &fonc)
Definition: sld_point.cpp:38
SLD_POINT::evaluer
virtual void evaluer(double *coord)
Definition: sld_point.cpp:69
SLD_POINT::~SLD_POINT
virtual ~SLD_POINT()
Definition: sld_point.cpp:63
TPL_LISTE_ENTITE< double >
SLD_FONCTION::GetParID
BOOL GetParID(char *ID, CComPtr< IFace2 > &)
Definition: sld_fonction.cpp:381