MAGiC
V5.0
Mailleurs Automatiques de Géometries intégrés à la Cao
occ_fonction.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
//####// occ_fonction.cpp
15
//####//
16
//####//------------------------------------------------------------
17
//####//------------------------------------------------------------
18
//####// COPYRIGHT 2000-2024
19
//####// jeu 13 jun 2024 11:58:55 EDT
20
//####//------------------------------------------------------------
21
//####//------------------------------------------------------------
22
23
24
#include "
gestionversion.h
"
25
#ifdef BREP_OCC
26
#pragma hdrstop
27
28
29
#include "
occ_fonction.h
"
30
31
#pragma package(smart_init)
32
OCC_FONCTION::OCC_FONCTION
()
33
{
34
}
35
36
OCC_FONCTION::~OCC_FONCTION
()
37
{
38
}
39
40
void
OCC_FONCTION::OuvrirFichier
(
char
* file )
//ouvrir un fichier .brep
41
{
42
Standard_Boolean result=BRepTools::Read(
ashape
,file,
abuilder
);
43
}
44
void
OCC_FONCTION::OuvrirFichierStep
(
char
* file)
//ouvrir un fichier.step
45
{
46
47
reader
.ReadFile(file);
48
reader
.NbRootsForTransfer();
49
reader
.TransferRoots();
50
ashape
=
reader
.OneShape();
51
52
}
53
54
void
OCC_FONCTION::Sauvegarder
(
char
* file)
55
{
56
Standard_Boolean result1=BRepTools::Write(
ashape
, file);
57
}
58
59
int
OCC_FONCTION::GetID
(
const
TopoDS_Shape &shape)
60
{
61
if
(shape.IsNull())
return
0;
62
Standard_Integer index =
myShapes
.FindIndex(shape);
63
if
(index == 0)
64
{
65
for
(TopoDS_Iterator its(shape,Standard_False,Standard_False);its.More(); its.Next())
66
GetID
(its.Value());
67
index =
myShapes
.Add(shape);
68
}
69
return
index;
70
}
71
72
TopoDS_Shape&
OCC_FONCTION::GetShapePrincipale
(
void
)
73
{
74
return
ashape
;
75
}
76
77
const
TopoDS_Shape&
OCC_FONCTION::GetShape
(
const
int
id_shape)
78
{
79
GetID
(
ashape
);
80
return
myShapes
(id_shape);
81
}
82
83
void
OCC_FONCTION::marquer_sommet_pole
(
MG_FACE
* face,
double
precision)
84
{
85
//printf("void OCC_FONCTION::marquer_sommet_pole(MG_FACE* face, double precision) : Non supportee dans cette version de OCC_FONCTION\n");
86
}
87
88
std::string
OCC_FONCTION::get_version
(
void
)
89
{
90
return
"OCCV0"
;
91
}
92
93
void
OCC_FONCTION::change_precision
(
double
val)
94
{
95
precision
=val;
96
}
97
98
99
double
OCC_FONCTION::get_precision
(
void
)
100
{
101
return
precision
;
102
}
103
104
105
#endif
gestionversion.h
OCC_FONCTION::Sauvegarder
virtual void Sauvegarder(char *file)
Definition:
occ_fonction.cpp:54
OCC_FONCTION::change_precision
virtual void change_precision(double val)
Definition:
occ_fonction.cpp:93
OCC_FONCTION::abuilder
BRep_Builder abuilder
Definition:
occ_fonction.h:60
OCC_FONCTION::~OCC_FONCTION
virtual ~OCC_FONCTION(void)
Definition:
occ_fonction.cpp:36
OCC_FONCTION::reader
STEPControl_Reader reader
Definition:
occ_fonction.h:61
OCC_FONCTION::ashape
TopoDS_Shape ashape
Definition:
occ_fonction.h:59
OCC_FONCTION::GetShapePrincipale
virtual TopoDS_Shape & GetShapePrincipale(void)
Definition:
occ_fonction.cpp:72
OCC_FONCTION::OuvrirFichierStep
virtual void OuvrirFichierStep(char *file)
Definition:
occ_fonction.cpp:44
OCC_FONCTION::OCC_FONCTION
OCC_FONCTION(void)
Definition:
occ_fonction.cpp:32
OCC_FONCTION::myShapes
TopTools_IndexedMapOfShape myShapes
Definition:
occ_fonction.h:62
OCC_FONCTION::OuvrirFichier
virtual void OuvrirFichier(char *file)
Definition:
occ_fonction.cpp:40
OCC_FONCTION::precision
double precision
Definition:
occ_fonction.h:64
OCC_FONCTION::GetShape
virtual const TopoDS_Shape & GetShape(const int id_shape)
Definition:
occ_fonction.cpp:77
OCC_FONCTION::marquer_sommet_pole
virtual void marquer_sommet_pole(class MG_FACE *face, double precision=1.0e-06)
Definition:
occ_fonction.cpp:83
OCC_FONCTION::get_precision
virtual double get_precision(void)
Definition:
occ_fonction.cpp:99
MG_FACE
Definition:
mg_face.h:34
occ_fonction.h
OCC_FONCTION::GetID
virtual int GetID(const TopoDS_Shape &shape)
Definition:
occ_fonction.cpp:59
OCC_FONCTION::get_version
virtual std::string get_version(void)
Definition:
occ_fonction.cpp:88
home
francois
tmp
lib
mtu
src
occ_fonction.cpp
Généré le Mercredi 11 Juin 2025 23:00:09 pour MAGiC par
1.8.17