26 #include <TopoDS_Shape.hxx>
27 #include <BRepPrimAPI_MakeTorus.hxx>
32 MG_PRIMITIVE_TORE::MG_PRIMITIVE_TORE(
double centre_x,
double centre_y,
double centre_z,
33 double longitude,
double latitude,
34 double rayon_cercle,
double rayon_tore): MG_PRIMITIVE(),
35 x(centre_x),y(centre_y),z(centre_z),
36 angle_longitude(longitude),angle_latitude(latitude),
37 r1(rayon_cercle),r2(rayon_tore)
42 MG_PRIMITIVE_TORE::MG_PRIMITIVE_TORE(
long unsigned int num,
43 double centre_x,
double centre_y,
double centre_z,
44 double longitude,
double latitude,
45 double rayon_cercle,
double rayon_tore): MG_PRIMITIVE(num),
46 x(centre_x),y(centre_y),z(centre_z),
47 angle_longitude(longitude),angle_latitude(latitude),
48 r1(rayon_cercle),r2(rayon_tore)
53 MG_PRIMITIVE_TORE::MG_PRIMITIVE_TORE(MG_PRIMITIVE_TORE& 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),
61 MG_PRIMITIVE_TORE::~MG_PRIMITIVE_TORE()
66 void MG_PRIMITIVE_TORE::enregistrer(std::ostream& o,
double version)
68 o <<
"%" << get_id() <<
"=TORE("<< x <<
","<< y <<
","<< z <<
","<< angle_longitude <<
","<< angle_latitude<<
","<< r1 <<
","<< r2 <<
");" << std::endl;
71 void MG_PRIMITIVE_TORE::construit(
void)
73 double dir_x,dir_y,dir_z;
74 dir_x =
cos(angle_latitude)*
cos(angle_longitude);
75 dir_y =
cos(angle_latitude)*
sin(angle_longitude);
76 dir_z =
sin(angle_latitude);
77 direction =
new gp_Dir(dir_x,dir_y,dir_z);
78 point =
new gp_Pnt(x,y,z);
79 axe =
new gp_Ax2(*point,*direction);
80 forme = BRepPrimAPI_MakeTorus(*axe,r1,r2).Shape();
double2 sin(double2 &val)
double2 cos(double2 &val)