MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
mg_primitive_sphere.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_sphere.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_sphere.h"
26 #include <TopoDS_Shape.hxx>
27 #include <BRepPrimAPI_MakeSphere.hxx>
28 #include <gp_Pnt.hxx>
29 
30 MG_PRIMITIVE_SPHERE::MG_PRIMITIVE_SPHERE(double centre_x, double centre_y, double centre_z, double rayon):MG_PRIMITIVE(),x(centre_x),y(centre_y),z(centre_z),r(rayon)
31 {
32 
33 }
34 
35 MG_PRIMITIVE_SPHERE::MG_PRIMITIVE_SPHERE(long unsigned int num, double centre_x, double centre_y, double centre_z, double rayon): MG_PRIMITIVE(num),x(centre_x),y(centre_y),z(centre_z),r(rayon)
36 {
37 
38 }
39 
40 MG_PRIMITIVE_SPHERE::MG_PRIMITIVE_SPHERE(MG_PRIMITIVE_SPHERE& mdd):MG_PRIMITIVE(mdd),x(mdd.x),y(mdd.y),z(mdd.z),r(mdd.r)
41 {
42 
43 }
44 
45 MG_PRIMITIVE_SPHERE::~MG_PRIMITIVE_SPHERE()
46 {
47 
48 }
49 
50 void MG_PRIMITIVE_SPHERE::enregistrer(std::ostream& o,double version)
51 {
52  o << "%" << get_id() << "=SPHERE("<< x <<","<< y <<","<< z <<","<< r << ");" << std::endl;
53 }
54 
55 void MG_PRIMITIVE_SPHERE::construit(void)
56 {
57  centre = new gp_Pnt();
58  centre->SetX(x);
59  centre->SetY(y);
60  centre->SetZ(z);
61  forme = BRepPrimAPI_MakeSphere(*centre,r).Shape();
62 }
63 
64 
65 
66 
67 #endif