Salome HOME
projects
/
modules
/
geom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated copyright message
[modules/geom.git]
/
src
/
ARCHIMEDE
/
Archimede_VolumeSection.cxx
diff --git
a/src/ARCHIMEDE/Archimede_VolumeSection.cxx
b/src/ARCHIMEDE/Archimede_VolumeSection.cxx
index 667ec0994a0568c780dadc1086942b7ae9ec1c76..4409791c8e500df6a68a101cb3e9449fc621cf10 100644
(file)
--- a/
src/ARCHIMEDE/Archimede_VolumeSection.cxx
+++ b/
src/ARCHIMEDE/Archimede_VolumeSection.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-202
1
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-202
3
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-88,15
+88,14
@@
void VolumeSection::CenterOfGravity()
TopoDS_Face F = TopoDS::Face(ex.Current());
Handle(Poly_Triangulation) Tr = BRep_Tool::Triangulation(F, L);
if(Tr.IsNull())
TopoDS_Face F = TopoDS::Face(ex.Current());
Handle(Poly_Triangulation) Tr = BRep_Tool::Triangulation(F, L);
if(Tr.IsNull())
- MESSAGE("Error, null layer" )
+ MESSAGE("Error, null layer" )
;
nbNodes = Tr->NbNodes();
nbNodes = Tr->NbNodes();
- const TColgp_Array1OfPnt& Nodes = Tr->Nodes();
// Calcul des dimensions de la boite englobante du solide
for(i=1;i<=nbNodes;i++)
{
// Calcul des dimensions de la boite englobante du solide
for(i=1;i<=nbNodes;i++)
{
- InitPoint =
Nodes
(i).Transformed(L.Transformation());
+ InitPoint =
Tr->Node
(i).Transformed(L.Transformation());
if(InitPoint.X() < Xmin)
Xmin = InitPoint.X();
if(InitPoint.X() > Xmax)
if(InitPoint.X() < Xmin)
Xmin = InitPoint.X();
if(InitPoint.X() > Xmax)
@@
-113,8
+112,8
@@
void VolumeSection::CenterOfGravity()
}
}
}
}
- // Creation du point d'initialisation, c'est
\80
dire le centre de gravit
\89
- //
g
\89
om
\89
trique de la boite englobante
+ // Creation du point d'initialisation, c'est
e dire le centre de gravite
+ //
geome
trique de la boite englobante
InitPoint.SetX(0.5 * (Xmin + Xmax));
InitPoint.SetY(0.5 * (Ymin + Ymax));
InitPoint.SetX(0.5 * (Xmin + Xmax));
InitPoint.SetY(0.5 * (Ymin + Ymax));
@@
-131,9
+130,9
@@
Standard_Real VolumeSection::CalculateVolume(Standard_Real Elevation)
Standard_Real Volume=0;
Standard_Real Determinant=0;
gp_Pnt P[3];
Standard_Real Volume=0;
Standard_Real Determinant=0;
gp_Pnt P[3];
-
+
// Projection du point d'initialisation sur le plan de section
// Projection du point d'initialisation sur le plan de section
-
+
InitPoint.SetZ(Elevation);
for (ex.Init(myShape, TopAbs_FACE); ex.More(); ex.Next())
InitPoint.SetZ(Elevation);
for (ex.Init(myShape, TopAbs_FACE); ex.More(); ex.Next())
@@
-141,29
+140,26
@@
Standard_Real VolumeSection::CalculateVolume(Standard_Real Elevation)
TopoDS_Face F = TopoDS::Face(ex.Current());
Handle(Poly_Triangulation) Tr = BRep_Tool::Triangulation(F, L);
if(Tr.IsNull())
TopoDS_Face F = TopoDS::Face(ex.Current());
Handle(Poly_Triangulation) Tr = BRep_Tool::Triangulation(F, L);
if(Tr.IsNull())
- MESSAGE("Error, null layer" )
- const Poly_Array1OfTriangle& triangles = Tr->Triangles();
+ MESSAGE("Error, null layer" );
Standard_Integer nbTriangles = Tr->NbTriangles();
Standard_Integer nbTriangles = Tr->NbTriangles();
- //nbNodes = Tr->NbNodes();
- const TColgp_Array1OfPnt& Nodes = Tr->Nodes();
-
+
// Calcul des volumes de chaque triangle, de chaque face
// Calcul des volumes de chaque triangle, de chaque face
- //
en tenant compte des triangles coup
\89
s par le plan de section
-
- for (i=1;i<=nbTriangles;i++)
+ //
en tenant compte des triangles coupe
s par le plan de section
+
+ for (i=1;i<=nbTriangles;i++)
{
Determinant=0;
//Gardons la meme orientation des noeuds
if (F.Orientation() == TopAbs_REVERSED)
{
Determinant=0;
//Gardons la meme orientation des noeuds
if (F.Orientation() == TopAbs_REVERSED)
-
triangles
(i).Get(noeud[0], noeud[2], noeud[1]);
+
Tr->Triangle
(i).Get(noeud[0], noeud[2], noeud[1]);
else
else
-
triangles
(i).Get(noeud[0], noeud[1], noeud[2]);
+
Tr->Triangle
(i).Get(noeud[0], noeud[1], noeud[2]);
- P[0] =
Nodes
(noeud[0]).Transformed(L.Transformation());
+ P[0] =
Tr->Node
(noeud[0]).Transformed(L.Transformation());
z[0] = P[0].Z();
z[0] = P[0].Z();
- P[1] =
Nodes
(noeud[1]).Transformed(L.Transformation());
+ P[1] =
Tr->Node
(noeud[1]).Transformed(L.Transformation());
z[1] = P[1].Z();
z[1] = P[1].Z();
- P[2] =
Nodes
(noeud[2]).Transformed(L.Transformation());
+ P[2] =
Tr->Node
(noeud[2]).Transformed(L.Transformation());
z[2] = P[2].Z();
// Determination des cas aux limites pour les triangles
z[2] = P[2].Z();
// Determination des cas aux limites pour les triangles
@@
-234,7
+230,7
@@
Standard_Real VolumeSection::Archimede(Standard_Real Constante , Standard_Real E
Bsup = Zmax;
if(Binf>Bsup)
{
Bsup = Zmax;
if(Binf>Bsup)
{
- MESSAGE("error, Bound + < Bound - in dichotomy")
+ MESSAGE("error, Bound + < Bound - in dichotomy")
;
return -1;
}
tempBsupVolume = CalculateVolume(Bsup);
return -1;
}
tempBsupVolume = CalculateVolume(Bsup);
@@
-242,7
+238,7
@@
Standard_Real VolumeSection::Archimede(Standard_Real Constante , Standard_Real E
if (Constante>tempBsupVolume || Constante<tempBinfVolume)
{
if (Constante>tempBsupVolume || Constante<tempBinfVolume)
{
- MESSAGE("error, algorithm start Impossible. Wrong constant value" )
+ MESSAGE("error, algorithm start Impossible. Wrong constant value" )
;
return -1;
}
return -1;
}
@@
-286,7
+282,7
@@
Standard_Real VolumeSection::Archimede(Standard_Real Constante , Standard_Real E
}
endMethod:
}
endMethod:
- MESSAGE("La ligne de flottaison correspondant a la constante :"<<Constante<<" est a la cote Z = "<<c)
+ MESSAGE("La ligne de flottaison correspondant a la constante :"<<Constante<<" est a la cote Z = "<<c)
;
return c;
}
return c;
}
@@
-372,7
+368,7
@@
gp_Pnt VolumeSection::Intersection(gp_Pnt P1,gp_Pnt P2,Standard_Real Hauteur)
return Point;
}
return Point;
}
-//
Fonction calculant le volume
\89
l
\89
mentaire de chaque t
\89
traedre
\80
partir de 3 points
+//
Fonction calculant le volume elementaire de chaque tetraedre e
partir de 3 points
Standard_Real VolumeSection::ElementaryVolume(gp_Pnt P1,gp_Pnt P2,gp_Pnt P3)
{
Standard_Real Determinant;
Standard_Real VolumeSection::ElementaryVolume(gp_Pnt P1,gp_Pnt P2,gp_Pnt P3)
{
Standard_Real Determinant;