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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nico Schlömer
gmsh
Commits
07dfc7c0
Commit
07dfc7c0
authored
7 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
new command "BoundingBox GeoEntity { tag }" to retrieve the bbox of an entity
parent
56c18b6d
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Parser/Gmsh.tab.cpp
+3777
-3704
3777 additions, 3704 deletions
Parser/Gmsh.tab.cpp
Parser/Gmsh.tab.hpp
+1
-1
1 addition, 1 deletion
Parser/Gmsh.tab.hpp
Parser/Gmsh.y
+26
-1
26 additions, 1 deletion
Parser/Gmsh.y
with
3804 additions
and
3706 deletions
Parser/Gmsh.tab.cpp
+
3777
−
3704
View file @
07dfc7c0
This diff is collapsed.
Click to expand it.
Parser/Gmsh.tab.hpp
+
1
−
1
View file @
07dfc7c0
...
...
@@ -496,7 +496,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef
union
YYSTYPE
#line 16
4
"Gmsh.y"
#line 16
5
"Gmsh.y"
{
char
*
c
;
int
i
;
...
...
This diff is collapsed.
Click to expand it.
Parser/Gmsh.y
+
26
−
1
View file @
07dfc7c0
...
...
@@ -129,6 +129,7 @@ void getAllPhysicalTags(int dim, List_T *in);
void getElementaryTagsForPhysicalGroups(int dim, List_T *in, List_T *out);
void getElementaryTagsInBoundingBox(int dim, double x1, double y1, double z1,
double x2, double y2, double z2, List_T *out);
void getBoundingBox(int dim, int tag, List_T *out);
void setVisibility(int dim, int visible, bool recursive);
void setVisibility(const std::vector<std::pair<int, int> > &dimTags, int visible,
bool recursive);
...
...
@@ -5361,6 +5362,11 @@ FExpr_Multi :
$$ = List_Create(10, 10, sizeof(double));
getElementaryTagsInBoundingBox($1, $5, $7, $9, $11, $13, $15, $$);
}
| tBoundingBox GeoEntity '{' FExpr '}'
{
$$ = List_Create(10, 10, sizeof(double));
getBoundingBox($2, (int)$4, $$);
}
| Transform
{
$$ = List_Create(List_Nbr($1), 1, sizeof(double));
...
...
@@ -6651,6 +6657,25 @@ void getElementaryTagsInBoundingBox(int dim, double x1, double y1, double z1,
}
}
void getBoundingBox(int dim, int tag, List_T *out)
{
if(GModel::current()->getOCCInternals() &&
GModel::current()->getOCCInternals()->getChanged())
GModel::current()->getOCCInternals()->synchronize(GModel::current());
if(GModel::current()->getGEOInternals()->getChanged())
GModel::current()->getGEOInternals()->synchronize(GModel::current());
GEntity *ge = GModel::current()->getEntityByTag(dim, tag);
SBoundingBox3d box;
if(ge) box = ge->bounds();
if(!box.empty()){
double b[6] = {box.min().x(), box.min().y(), box.min().z(),
box.max().x(), box.max().y(), box.max().z()};
for(int i = 0; i < 6; i++)
List_Add(out, &b[i]);
}
}
void setVisibility(int dim, int visible, bool recursive)
{
if(GModel::current()->getOCCInternals() &&
...
...
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