MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
mg_primitive_cylindre.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 //####// mg_primitive_cylindre.cpp
15 //####//
16 //####//------------------------------------------------------------
17 //####//------------------------------------------------------------
18 //####// COPYRIGHT 2000-2024
19 //####// jeu 13 jun 2024 11:58:54 EDT
20 //####//------------------------------------------------------------
21 //####//------------------------------------------------------------
22 #ifdef CSG_OCC
23 
24 #include "gestionversion.h"
25 #include "mg_primitive_cylindre.h"
26 #include <TopoDS_Shape.hxx>
27 #include <BRepPrimAPI_MakeCylinder.hxx>
28 #include <gp_Pnt.hxx>
29 #include <gp_Ax2.hxx>
30 #include <gp_Dir.hxx>
31 
32 MG_PRIMITIVE_CYLINDRE::MG_PRIMITIVE_CYLINDRE(double extremite_x, double extremite_y,double extremite_z,
33  double longitude, double latitude,
34  double rayon,double longueur):MG_PRIMITIVE(),
35  x(extremite_x),y(extremite_y),z(extremite_z),
36  angle_longitude(longitude),angle_latitude(latitude),
37  r(rayon),l(longueur)
38 {
39 
40 }
41 
42 MG_PRIMITIVE_CYLINDRE::MG_PRIMITIVE_CYLINDRE(long unsigned int num,
43  double extremite_x, double extremite_y,double extremite_z,
44  double longitude, double latitude,
45  double rayon,double longueur):MG_PRIMITIVE(num),
46  x(extremite_x),y(extremite_y),z(extremite_z),
47  angle_longitude(longitude),angle_latitude(latitude),
48  r(rayon),l(longueur)
49 {
50 
51 }
52 
53 MG_PRIMITIVE_CYLINDRE::MG_PRIMITIVE_CYLINDRE(MG_PRIMITIVE_CYLINDRE& mdd):MG_PRIMITIVE(mdd),
54  x(mdd.x),y(mdd.y),z(mdd.z),
55  angle_longitude(mdd.angle_longitude),angle_latitude(mdd.angle_latitude),
56  r(mdd.r),l(mdd.l)
57 {
58 
59 }
60 
61 
62 
63 MG_PRIMITIVE_CYLINDRE::~MG_PRIMITIVE_CYLINDRE()
64 {
65 
66 }
67 
68 void MG_PRIMITIVE_CYLINDRE::enregistrer(std::ostream& o,double version)
69 {
70 o << "%" << get_id() << "=CYLINDRE("<< x <<","<< y <<","<< z <<","<< angle_longitude <<","<< angle_latitude<<","<< r <<","<< l << ");" << std::endl;
71 }
72 
73 
74 void MG_PRIMITIVE_CYLINDRE::construit(void)
75 {
76  double dir_x,dir_y,dir_z;
77  dir_x = cos(angle_latitude)*cos(angle_longitude);
78  dir_y = cos(angle_latitude)*sin(angle_longitude);
79  dir_z = sin(angle_latitude);
80  direction = new gp_Dir(dir_x,dir_y,dir_z);
81  point = new gp_Pnt(x,y,z);
82  axe = new gp_Ax2(*point,*direction);
83  forme = BRepPrimAPI_MakeCylinder(*axe,r,l).Shape();
84 }
85 
86 
87 
88 #endif
double2 sin(double2 &val)
double2 cos(double2 &val)