MAGiC  V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
mg_primitive_boite.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_boite.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_boite.h"
26 
27 #include <TopoDS_Shape.hxx>
28 #include <BRepPrimAPI_MakeBox.hxx>
29 #include <gp_Pnt.hxx>
30 
31 
32 MG_PRIMITIVE_BOITE::MG_PRIMITIVE_BOITE(double x1, double y1, double z1, double x2, double y2, double z2):MG_PRIMITIVE(),xmin(x1),ymin(y1),zmin(z1),xmax(x2),ymax(y2),zmax(z2)
33 {
34 }
35 
36 
37 MG_PRIMITIVE_BOITE::MG_PRIMITIVE_BOITE(long unsigned int num, double x1, double y1, double z1, double x2, double y2, double z2): MG_PRIMITIVE(num),xmin(x1),ymin(y1),zmin(z1),xmax(x2),ymax(y2),zmax(z2)
38 {
39 
40 }
41 
42 MG_PRIMITIVE_BOITE::MG_PRIMITIVE_BOITE(MG_PRIMITIVE_BOITE& mdd):MG_PRIMITIVE(mdd),xmin(mdd.xmin),ymin(mdd.ymin),zmin(mdd.zmin),xmax(mdd.xmax),ymax(mdd.ymax),zmax(mdd.zmax)
43 {
44 }
45 
46 
47 
48 
49 MG_PRIMITIVE_BOITE::~MG_PRIMITIVE_BOITE()
50 {
51 
52 }
53 
54 void MG_PRIMITIVE_BOITE::enregistrer(std::ostream& o,double version)
55 {
56 o << "%" << get_id() << "=BOITE("<< xmin <<","<< ymin <<","<< zmin <<","<< xmax <<","<< ymax <<","<< zmax << ");" << std::endl;
57 }
58 
59 
60 void MG_PRIMITIVE_BOITE::construit(void)
61 {
62  coin_min = new gp_Pnt();
63  coin_min->SetX(xmin);
64  coin_min->SetY(ymin);
65  coin_min->SetZ(zmin);
66  coin_max = new gp_Pnt();
67  coin_max->SetX(xmax);
68  coin_max->SetY(ymax);
69  coin_max->SetZ(zmax);
70  forme = BRepPrimAPI_MakeBox(*coin_min,*coin_max).Shape();
71 }
72 
73 
74 
75 #endif
76