Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Type-OpenMesh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenFlipper-Free
Type-OpenMesh
Commits
e9ddfdad
Commit
e9ddfdad
authored
1 month ago
by
Daniel Savchenko
Browse files
Options
Downloads
Patches
Plain Diff
compute BB over mesh instead of SceneGraph
parent
51fc72a6
No related branches found
No related tags found
1 merge request
!5
compute BB over mesh instead of SceneGraph
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ObjectTypes/MeshObject/MeshObjectT_impl.hh
+11
-5
11 additions, 5 deletions
ObjectTypes/MeshObject/MeshObjectT_impl.hh
with
11 additions
and
5 deletions
ObjectTypes/MeshObject/MeshObjectT_impl.hh
+
11
−
5
View file @
e9ddfdad
...
...
@@ -642,12 +642,18 @@
*/
template
<
class
MeshT
>
void
MeshObject
<
MeshT
>::
boundingBox
(
ACG
::
Vec3d
&
_bbMin
,
ACG
::
Vec3d
&
_bbMax
)
{
if
(
meshNode_
)
{
_bbMin
=
ACG
::
Vec3d
(
FLT_MAX
,
FLT_MAX
,
FLT_MAX
);
_bbMax
=
ACG
::
Vec3d
(
-
FLT_MAX
,
-
FLT_MAX
,
-
FLT_MAX
);
meshNode_
->
boundingBox
(
_bbMin
,
_bbMax
);
if
(
mesh_
)
{
_bbMin
=
mesh_
->
point
(
mesh_
->
vertex_handle
(
0
));
_bbMax
=
mesh_
->
point
(
mesh_
->
vertex_handle
(
0
));
for
(
auto
v_it
:
mesh_
->
vertices
())
{
const
ACG
::
Vec3d
p
=
mesh_
->
point
(
v_it
);
_bbMin
.
minimize
(
p
);
_bbMax
.
maximize
(
p
);
}
}
else
{
std
::
cerr
<<
"Error: Bounding box computation via Scenegraph not available without gui"
<<
std
::
endl
;
// This is basicly impossible, but just in case
std
::
cerr
<<
"Error: No Mesh found"
<<
std
::
endl
;
}
}
...
...
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