1 |
francois |
1158 |
//####//------------------------------------------------------------ |
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 |
|
|
//####// occ_point.cpp |
15 |
|
|
//####// |
16 |
|
|
//####//------------------------------------------------------------ |
17 |
|
|
//####//------------------------------------------------------------ |
18 |
|
|
//####// COPYRIGHT 2000-2024 |
19 |
|
|
//####// jeu 13 jun 2024 11:58:54 EDT |
20 |
|
|
//####//------------------------------------------------------------ |
21 |
|
|
//####//------------------------------------------------------------ |
22 |
francois |
283 |
#pragma hdrstop |
23 |
|
|
#include "gestionversion.h" |
24 |
|
|
#ifdef BREP_OCC |
25 |
|
|
|
26 |
|
|
#include "occ_point.h" |
27 |
couturad |
906 |
#include "occ_fonction_v2017.h" |
28 |
francois |
283 |
#include "constantegeo.h" |
29 |
|
|
|
30 |
|
|
#pragma package(smart_init) |
31 |
couturad |
906 |
OCC_POINT::OCC_POINT(unsigned long num,TopoDS_Vertex pt, class OCC_FONCTION* fonc):MG_POINT(num),point(pt), fonction1(fonc) |
32 |
francois |
283 |
{ |
33 |
|
|
} |
34 |
couturad |
906 |
OCC_POINT::OCC_POINT(TopoDS_Vertex pt, class OCC_FONCTION* fonc):MG_POINT(),point(pt), fonction1(fonc) |
35 |
francois |
283 |
{ |
36 |
|
|
} |
37 |
couturad |
906 |
OCC_POINT::OCC_POINT(TopoDS_Vertex pt) :MG_POINT(),point(pt) |
38 |
|
|
{ |
39 |
|
|
} |
40 |
francois |
283 |
OCC_POINT::OCC_POINT(OCC_POINT& mdd):MG_POINT(mdd),point(mdd.point),fonction1(mdd.fonction1) |
41 |
|
|
{ |
42 |
|
|
} |
43 |
couturad |
906 |
|
44 |
francois |
283 |
OCC_POINT::~OCC_POINT() |
45 |
|
|
{ |
46 |
|
|
} |
47 |
|
|
void OCC_POINT::evaluer(double *xyz) |
48 |
|
|
{ |
49 |
|
|
gp_Pnt p=BRep_Tool::Pnt(point); |
50 |
|
|
p.Coord(xyz[0], xyz[1], xyz[2]); |
51 |
|
|
|
52 |
|
|
} |
53 |
|
|
|
54 |
francois |
763 |
void OCC_POINT::enregistrer(std::ostream& o,double version) |
55 |
francois |
283 |
{ |
56 |
couturad |
906 |
if(fonction1->get_version()=="OCCV2017") |
57 |
|
|
{ |
58 |
couturad |
908 |
#ifdef ALL_OCC |
59 |
couturad |
906 |
OCC_FONCTION_V2017* occ_fonction_v2017 = (OCC_FONCTION_V2017*)fonction1; |
60 |
|
|
MG_ELEMENT_TOPOLOGIQUE* sommet = occ_fonction_v2017->get_MG_ELEMENT_TOPOLOGIQUE(point); |
61 |
|
|
o << "%"<<get_id()<<"=POINT_OCC("<< sommet->get_id()<<");" << std::endl; |
62 |
couturad |
908 |
#else |
63 |
|
|
std::cerr << "OCC_POINT::enregistrer(std::ostream& o,double version) --> Non disponible" << std::endl; |
64 |
|
|
#endif |
65 |
|
|
|
66 |
couturad |
906 |
} |
67 |
|
|
else |
68 |
|
|
{ |
69 |
|
|
o << "%"<<get_id()<<"=POINT_OCC("<<fonction1->GetID(point)<< ");" << std::endl; |
70 |
|
|
} |
71 |
francois |
283 |
} |
72 |
|
|
|
73 |
|
|
int OCC_POINT::get_type_geometrique(TPL_LISTE_ENTITE<double> ¶m) |
74 |
|
|
{ |
75 |
|
|
gp_Pnt p=BRep_Tool::Pnt(point); |
76 |
|
|
|
77 |
|
|
|
78 |
|
|
double xyz[3]; |
79 |
|
|
param.ajouter(xyz[0]=p.X()); |
80 |
|
|
param.ajouter(xyz[1]=p.Y()); |
81 |
|
|
param.ajouter(xyz[2]=p.Z()); |
82 |
|
|
|
83 |
francois |
1149 |
return GEOMETRIE::CONST::Co_POINT; |
84 |
francois |
283 |
} |
85 |
|
|
void OCC_POINT::get_param_NURBS(int& indx_premier_ptctr,TPL_LISTE_ENTITE<double> ¶m) |
86 |
|
|
{ |
87 |
|
|
gp_Pnt p=BRep_Tool::Pnt(point); |
88 |
|
|
|
89 |
|
|
param.ajouter(0); |
90 |
|
|
param.ajouter(1); |
91 |
|
|
param.ajouter(0); |
92 |
|
|
|
93 |
|
|
param.ajouter(1); |
94 |
|
|
param.ajouter(0); |
95 |
|
|
|
96 |
|
|
|
97 |
|
|
param.ajouter(p.X()); |
98 |
|
|
param.ajouter(p.Y()); |
99 |
|
|
param.ajouter(p.Z()); |
100 |
|
|
|
101 |
|
|
param.ajouter(1.); |
102 |
|
|
|
103 |
|
|
indx_premier_ptctr =5; |
104 |
|
|
|
105 |
|
|
|
106 |
|
|
} |
107 |
couturad |
906 |
|
108 |
|
|
void OCC_POINT::change_occ_fonction(OCC_FONCTION* fonction) |
109 |
|
|
{ |
110 |
|
|
fonction1=fonction; |
111 |
|
|
} |
112 |
|
|
|
113 |
francois |
283 |
#endif |
114 |
|
|
|
115 |
|
|
|