MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
occ_cg_forme_arete_droite.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_cg_forme_arete_droite.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:54 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 #ifdef ALL_OCC
24 #include "mg_definition.h"
25 #include "mg_cg_modele.h"
26 #include "occ_fonction_v2017.h"
27 #include <BRepBuilderAPI_MakeEdge.hxx>
28 #include <gp_Pnt.hxx>
30  double x1, double y1, double z1,
31  double x2, double y2, double z2): MG_CG_FORME_ARETE_DROITE(mgcg_modele,x1, y1, z1, x2, y2, z2)
32 {
33 
34 }
35 
37  int etat,
38  long unsigned int num,
39  MG_ARETE* mg_arete,
40  double x1, double y1, double z1,
41  double x2, double y2, double z2): MG_CG_FORME_ARETE_DROITE(mgcg_modele,etat, num, mg_arete, x1, y1, z1, x2, y2, z2)
42 {
43 
44 }
45 
47 {
48 
49 }
50 
52 {
53 
54 }
55 
57 {
58  if(m_mgcg_modele==NULL)
59  {
60  std::cout << "*** ERREUR : OCC_CG_FORME_ARETE_DROITE::construire_forme -> MG_CG_MODELE NULL ***" << std::endl;
61  return FAIL;
62  }
67 }
68 
69 int OCC_CG_FORME_ARETE_DROITE::construire(bool fusionner_entite_similaire, double precision, bool importer_triangulation, double epsilon_triangulation)
70 {
71  if(m_mgcg_modele==NULL)
72  {
73  std::cout << "*** ERREUR : OCC_CG_FORME_ARETE_DROITE::construire_forme -> MG_CG_MODELE NULL ***" << std::endl;
74  return FAIL;
75  }
76  gp_Pnt gp_pnt1(m_xyz1[0],m_xyz1[1],m_xyz1[2]);
77  gp_Pnt gp_pnt2(m_xyz2[0],m_xyz2[1],m_xyz2[2]);
78  TopoDS_Shape topods_shape = BRepBuilderAPI_MakeEdge(gp_pnt1,gp_pnt2).Shape();
80  if(occ_fonction->get_version()=="OCCV2017")
81  {
82  OCC_FONCTION_V2017* occ_fonction_v2017 = (OCC_FONCTION_V2017*)occ_fonction;
83  m_mg_arete = occ_fonction_v2017->importer_TopoDS_Edge(TopoDS::Edge(topods_shape),
84  NULL,
85  NULL,
86  NULL,
87  NULL,
88  NULL,
90  fusionner_entite_similaire,
91  precision);
92  }
93  change_etat(MG_CG_FORME::ETAT_FORME::CONSTRUITE);
95  return OK;
96 }
97 #endif
MG_CG_FORME_ARETE_DROITE::m_xyz2
double m_xyz2[3]
Definition: mg_cg_forme_arete_droite.h:69
FAIL
const int FAIL
Definition: mg_definition.h:39
MG_CG_MODELE::get_epsilon_triangulation
virtual double get_epsilon_triangulation(void)
Definition: mg_cg_modele.cpp:1119
MG_CG_FORME_ARETE::m_mg_arete
MG_ARETE * m_mg_arete
Definition: mg_cg_forme_arete.h:65
MG_CG_FORME::change_etat
virtual void change_etat(int etat_forme)
Definition: mg_cg_forme.cpp:81
OK
const int OK
Definition: mg_definition.h:38
MG_CG_MODELE::mise_a_jout_lien_mg_element_mgcg_forme
virtual void mise_a_jout_lien_mg_element_mgcg_forme(MG_CG_FORME *mgcg_forme)
Definition: mg_cg_modele.cpp:987
MG_CG_MODELE::get_mg_geometrie
virtual MG_GEOMETRIE * get_mg_geometrie(void)
Definition: mg_cg_modele.cpp:98
MG_CG_FORME_ARETE_DROITE::m_xyz1
double m_xyz1[3]
Definition: mg_cg_forme_arete_droite.h:68
MG_CG_MODELE::get_precision
virtual double get_precision(void)
Definition: mg_cg_modele.cpp:1099
OCC_CG_FORME_ARETE_DROITE::OCC_CG_FORME_ARETE_DROITE
OCC_CG_FORME_ARETE_DROITE(MG_CG_MODELE *mgcg_modele, double x1, double y1, double z1, double x2, double y2, double z2)
Definition: occ_cg_forme_arete_droite.cpp:29
OCC_FONCTION_V2017::importer_TopoDS_Edge
MG_ARETE * importer_TopoDS_Edge(TopoDS_Edge topods_edge, TopoDS_Wire *topods_wire, std::map< MG_ELEMENT_TOPOLOGIQUE *, MG_ELEMENT_TOPOLOGIQUE * > *map_nouveau_mg_element_topologique, std::map< MG_ELEMENT_COTOPOLOGIQUE *, MG_ELEMENT_COTOPOLOGIQUE * > *map_nouveau_mg_element_cotopologique, std::map< MG_ELEMENT_GEOMETRIQUE *, MG_ELEMENT_GEOMETRIQUE * > *map_nouveau_mg_element_geometrique, MG_BOUCLE *mg_boucle=NULL, MG_GEOMETRIE *mg_geometrie=NULL, bool fusionner_entite_similaire=false, double precision=1e-6)
Definition: occ_fonction_v2017.cpp:807
MG_CG_FORME::m_mgcg_modele
MG_CG_MODELE * m_mgcg_modele
Definition: mg_cg_forme.h:87
MG_CG_MODELE
Definition: mg_cg_modele.h:41
occ_fonction_v2017.h
mg_cg_modele.h
MG_CG_MODELE::get_fusionner_entite_similaire
virtual bool get_fusionner_entite_similaire(void)
Definition: mg_cg_modele.cpp:1089
MG_CG_MODELE::get_importer_triangulation
virtual bool get_importer_triangulation(void)
Definition: mg_cg_modele.cpp:1109
mg_definition.h
OCC_CG_FORME_ARETE_DROITE::~OCC_CG_FORME_ARETE_DROITE
virtual ~OCC_CG_FORME_ARETE_DROITE()
Definition: occ_cg_forme_arete_droite.cpp:51
OCC_CG_FORME_ARETE_DROITE
Definition: occ_cg_forme_arete_droite.h:38
MG_CG_FORME_ARETE_DROITE
Definition: mg_cg_forme_arete_droite.h:36
MG_ARETE
Definition: mg_arete.h:36
OCC_FONCTION_V2017
Definition: occ_fonction_v2017.h:104
OCC_FONCTION
Definition: occ_fonction.h:40
OCC_CG_FORME_ARETE_DROITE::construire
virtual int construire(void)
Definition: occ_cg_forme_arete_droite.cpp:56
MG_GEOMETRIE::get_occ_fonction
class OCC_FONCTION & get_occ_fonction(void)
Definition: mg_geometrie.cpp:2701
OCC_FONCTION::get_version
virtual std::string get_version(void)
Definition: occ_fonction.cpp:88
occ_cg_forme_arete_droite.h