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