Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
ffb8a898
Commit
ffb8a898
authored
18 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
baafca15
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Geo/GModel.cpp
+14
-3
14 additions, 3 deletions
Geo/GModel.cpp
Geo/GModel.h
+1
-2
1 addition, 2 deletions
Geo/GModel.h
Geo/GModelIO.cpp
+0
-10
0 additions, 10 deletions
Geo/GModelIO.cpp
Geo/MVertex.h
+2
-0
2 additions, 0 deletions
Geo/MVertex.h
Parser/OpenFile.cpp
+2
-6
2 additions, 6 deletions
Parser/OpenFile.cpp
with
19 additions
and
21 deletions
Geo/GModel.cpp
+
14
−
3
View file @
ffb8a898
...
...
@@ -92,13 +92,24 @@ void GModel::getPhysicalGroups(std::map<int, std::vector<GEntity*> > groups[4])
addInGroup
(
*
it
,
groups
[
3
]);
}
SBoundingBox3d
GModel
::
recomputeB
ounds
()
SBoundingBox3d
GModel
::
b
ounds
()
{
SBoundingBox3d
bb
;
for
(
viter
it
=
firstVertex
();
it
!=
lastVertex
();
++
it
)
bb
+=
(
*
it
)
->
bounds
();
boundingBox
=
bb
;
return
boundingBox
;
// use the mesh instead of the geometry for now
for
(
eiter
it
=
firstEdge
();
it
!=
lastEdge
();
++
it
)
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
mesh_vertices
.
size
();
i
++
)
bb
+=
(
*
it
)
->
mesh_vertices
[
i
]
->
point
();
for
(
fiter
it
=
firstFace
();
it
!=
lastFace
();
++
it
)
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
mesh_vertices
.
size
();
i
++
)
bb
+=
(
*
it
)
->
mesh_vertices
[
i
]
->
point
();
for
(
riter
it
=
firstRegion
();
it
!=
lastRegion
();
++
it
)
for
(
unsigned
int
i
=
0
;
i
<
(
*
it
)
->
mesh_vertices
.
size
();
i
++
)
bb
+=
(
*
it
)
->
mesh_vertices
[
i
]
->
point
();
return
bb
;
}
int
GModel
::
getMeshStatus
()
...
...
This diff is collapsed.
Click to expand it.
Geo/GModel.h
+
1
−
2
View file @
ffb8a898
...
...
@@ -79,8 +79,7 @@ class GModel
void
getPhysicalGroups
(
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
groups
[
4
]);
// The bounding box
virtual
SBoundingBox3d
getBounds
()
{
return
boundingBox
;
}
virtual
SBoundingBox3d
recomputeBounds
();
virtual
SBoundingBox3d
bounds
();
// Returns the mesh status for the entire model.
virtual
int
getMeshStatus
();
...
...
This diff is collapsed.
Click to expand it.
Geo/GModelIO.cpp
+
0
−
10
View file @
ffb8a898
...
...
@@ -162,7 +162,6 @@ int GModel::readMSH(const std::string &name)
int
elementTypes
[
7
]
=
{
LGN1
,
TRI1
,
QUA1
,
TET1
,
HEX1
,
PRI1
,
PYR1
};
double
version
=
1.0
;
char
str
[
256
];
SBoundingBox3d
bbox
;
std
::
map
<
int
,
MVertex
*>
vertices
;
std
::
map
<
int
,
std
::
vector
<
MVertex
*>
>
points
;
std
::
map
<
int
,
std
::
vector
<
MElement
*>
>
elements
[
7
];
...
...
@@ -195,7 +194,6 @@ int GModel::readMSH(const std::string &name)
int
num
;
double
x
,
y
,
z
;
fscanf
(
fp
,
"%d %lf %lf %lf"
,
&
num
,
&
x
,
&
y
,
&
z
);
bbox
+=
SPoint3
(
x
,
y
,
z
);
if
(
vertices
.
count
(
num
))
Msg
(
WARNING
,
"Skipping duplicate vertex %d"
,
num
);
else
...
...
@@ -356,8 +354,6 @@ int GModel::readMSH(const std::string &name)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
storePhysicalTagsInEntities
(
this
,
i
,
physicals
[
i
]);
boundingBox
+=
bbox
;
fclose
(
fp
);
return
1
;
}
...
...
@@ -656,8 +652,6 @@ int GModel::readSTL(const std::string &name, double tolerance)
face
->
triangles
.
push_back
(
new
MTriangle
(
v
[
0
],
v
[
1
],
v
[
2
]));
}
boundingBox
+=
bbox
;
fclose
(
fp
);
return
1
;
}
...
...
@@ -881,7 +875,6 @@ int GModel::readMESH(const std::string &name)
std
::
map
<
int
,
MVertex
*>
vertices
;
int
elementTypes
[
2
]
=
{
TRI1
,
QUA1
};
std
::
map
<
int
,
std
::
vector
<
MElement
*>
>
elements
[
2
];
SBoundingBox3d
bbox
;
while
(
!
feof
(
fp
))
{
fgets
(
buffer
,
sizeof
(
buffer
),
fp
);
...
...
@@ -900,7 +893,6 @@ int GModel::readMESH(const std::string &name)
int
cl
;
double
x
,
y
,
z
;
sscanf
(
buffer
,
"%lf %lf %lf %d"
,
&
x
,
&
y
,
&
z
,
&
cl
);
bbox
+=
SPoint3
(
x
,
y
,
z
);
vertices
[
i
+
1
]
=
new
MVertex
(
x
,
y
,
z
);
}
}
...
...
@@ -944,8 +936,6 @@ int GModel::readMESH(const std::string &name)
// store the vertices in their associated geometrical entity
storeVerticesInEntities
(
vertices
);
boundingBox
+=
bbox
;
fclose
(
fp
);
return
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Geo/MVertex.h
+
2
−
0
View file @
ffb8a898
...
...
@@ -3,6 +3,7 @@
#include
<stdio.h>
#include
<algorithm>
#include
"SPoint3.h"
class
GEntity
;
...
...
@@ -39,6 +40,7 @@ class MVertex{
inline
double
&
x
()
{
return
_x
;}
inline
double
&
y
()
{
return
_y
;}
inline
double
&
z
()
{
return
_z
;}
inline
SPoint3
point
()
{
return
SPoint3
(
_x
,
_y
,
_z
);
}
// get/set the parent entity
inline
GEntity
*
onWhat
()
const
{
return
_ge
;}
...
...
This diff is collapsed.
Click to expand it.
Parser/OpenFile.cpp
+
2
−
6
View file @
ffb8a898
// $Id: OpenFile.cpp,v 1.10
8
2006-08-12 18:
10:25
geuzaine Exp $
// $Id: OpenFile.cpp,v 1.10
9
2006-08-12 18:
27:47
geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -142,10 +142,7 @@ void SetBoundingBox(void)
SBoundingBox3d
bb
;
bb
=
GMODEL
->
getBounds
();
if
(
bb
.
empty
())
bb
=
GMODEL
->
recomputeBounds
();
bb
=
GMODEL
->
bounds
();
if
(
bb
.
empty
()
&&
List_Nbr
(
CTX
.
post
.
list
))
{
for
(
int
i
=
0
;
i
<
List_Nbr
(
CTX
.
post
.
list
);
i
++
){
...
...
@@ -208,7 +205,6 @@ int ParseFile(char *f, int close, int warn_if_missing)
fclose
(
yyin
);
GMODEL
->
import
();
GMODEL
->
recomputeBounds
();
strncpy
(
yyname
,
yyname_old
,
255
);
yyin
=
yyin_old
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment