MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
occ_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 //####// occ_point.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:54 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 #pragma hdrstop
23 #include "gestionversion.h"
24 #ifdef BREP_OCC
25 
26 #include "occ_point.h"
27 #include "occ_fonction_v2017.h"
28 #include "constantegeo.h"
29 
30 #pragma package(smart_init)
31 OCC_POINT::OCC_POINT(unsigned long num,TopoDS_Vertex pt, class OCC_FONCTION* fonc):MG_POINT(num),point(pt), fonction1(fonc)
32 {
33 }
34 OCC_POINT::OCC_POINT(TopoDS_Vertex pt, class OCC_FONCTION* fonc):MG_POINT(),point(pt), fonction1(fonc)
35 {
36 }
37 OCC_POINT::OCC_POINT(TopoDS_Vertex pt) :MG_POINT(),point(pt)
38 {
39 }
40 OCC_POINT::OCC_POINT(OCC_POINT& mdd):MG_POINT(mdd),point(mdd.point),fonction1(mdd.fonction1)
41 {
42 }
43 
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 void OCC_POINT::enregistrer(std::ostream& o,double version)
55 {
56  if(fonction1->get_version()=="OCCV2017")
57  {
58 #ifdef ALL_OCC
59  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 #else
63  std::cerr << "OCC_POINT::enregistrer(std::ostream& o,double version) --> Non disponible" << std::endl;
64 #endif
65 
66  }
67  else
68  {
69  o << "%"<<get_id()<<"=POINT_OCC("<<fonction1->GetID(point)<< ");" << std::endl;
70  }
71 }
72 
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 
84 }
85 void OCC_POINT::get_param_NURBS(int& indx_premier_ptctr,TPL_LISTE_ENTITE<double> &param)
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 
109 {
110  fonction1=fonction;
111 }
112 
113 #endif
114 
115 
OCC_POINT::~OCC_POINT
virtual ~OCC_POINT()
Definition: occ_point.cpp:44
occ_point.h
gestionversion.h
OCC_POINT::get_param_NURBS
virtual void get_param_NURBS(int &indx_premier_ptctr, TPL_LISTE_ENTITE< double > &param)
Definition: occ_point.cpp:85
GEOMETRIE::CONST::Co_POINT
@ Co_POINT
Definition: constantegeo.h:32
MG_IDENTIFICATEUR::get_id
unsigned long get_id()
Definition: mg_identificateur.cpp:53
OCC_POINT::evaluer
virtual void evaluer(double *xyz)
Definition: occ_point.cpp:47
MG_ELEMENT_TOPOLOGIQUE
Definition: mg_element_topologique.h:51
OCC_FONCTION_V2017::get_MG_ELEMENT_TOPOLOGIQUE
MG_ELEMENT_TOPOLOGIQUE * get_MG_ELEMENT_TOPOLOGIQUE(TopoDS_Shape topods_shape)
Definition: occ_fonction_v2017.cpp:1229
OCC_POINT::OCC_POINT
OCC_POINT(unsigned long num, TopoDS_Vertex pt, class OCC_FONCTION *fonc)
Definition: occ_point.cpp:31
OCC_POINT::enregistrer
virtual void enregistrer(std::ostream &o, double version)
Definition: occ_point.cpp:54
OCC_POINT::get_type_geometrique
virtual int get_type_geometrique(TPL_LISTE_ENTITE< double > &param)
Definition: occ_point.cpp:73
constantegeo.h
TPL_LISTE_ENTITE::ajouter
virtual void ajouter(X x)
Definition: tpl_liste_entite.h:38
occ_fonction_v2017.h
OCC_POINT::fonction1
class OCC_FONCTION * fonction1
Definition: occ_point.h:61
MG_POINT
Definition: mg_point.h:33
OCC_POINT
Definition: occ_point.h:45
TPL_LISTE_ENTITE< double >
OCC_FONCTION_V2017
Definition: occ_fonction_v2017.h:104
OCC_FONCTION::GetID
virtual int GetID(const TopoDS_Shape &shape)
Definition: occ_fonction.cpp:59
OCC_FONCTION
Definition: occ_fonction.h:40
OCC_POINT::point
TopoDS_Vertex point
Definition: occ_point.h:60
OCC_FONCTION::get_version
virtual std::string get_version(void)
Definition: occ_fonction.cpp:88
OCC_POINT::change_occ_fonction
virtual void change_occ_fonction(OCC_FONCTION *fonction)
Definition: occ_point.cpp:108