Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plugin-Slice
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
Plugin-Slice
Commits
dd6d83b4
Commit
dd6d83b4
authored
2 months ago
by
Daniel Savchenko
Browse files
Options
Downloads
Patches
Plain Diff
Slicer now uses Mesh for Boundingbox, instead of Scenegraph
parent
271c5079
Branches
boundingBoxError
No related tags found
1 merge request
!2
Draft: Slicer now uses Mesh for Boundingbox, instead of Scenegraph
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-1
2 additions, 1 deletion
CMakeLists.txt
SlicePlugin.cc
+19
-5
19 additions, 5 deletions
SlicePlugin.cc
with
21 additions
and
6 deletions
CMakeLists.txt
+
2
−
1
View file @
dd6d83b4
include
(
plugin
)
openflipper_plugin
(
INSTALLDATA Icons
)
openflipper_plugin
(
INSTALLDATA Icons
TYPES POLYMESH TRIANGLEMESH
)
This diff is collapsed.
Click to expand it.
SlicePlugin.cc
+
19
−
5
View file @
dd6d83b4
...
...
@@ -46,6 +46,9 @@
#include
"OpenFlipper/BasePlugin/PluginFunctions.hh"
#include
<OpenFlipper/common/GlobalOptions.hh>
#include
<ObjectTypes/PolyMesh/PolyMesh.hh>
#include
<ObjectTypes/TriangleMesh/TriangleMesh.hh>
#include
<MeshTools/MeshInfoT.hh>
SlicePlugin
::
SlicePlugin
()
:
tool_
(
nullptr
),
...
...
@@ -177,13 +180,24 @@ void SlicePlugin::getBoundingBox(ACG::Vec3d& bbmin, ACG::Vec3d& bbmax){
else
restriction
=
PluginFunctions
::
ALL_OBJECTS
;
for
(
PluginFunctions
::
ObjectIterator
o_it
(
restriction
,
DataType
(
DATA_
ALL
))
;
for
(
PluginFunctions
::
ObjectIterator
o_it
(
restriction
,
DataType
(
DATA_
TRIANGLE_MESH
|
DATA_POLY_MESH
));
o_it
!=
PluginFunctions
::
objectsEnd
();
++
o_it
)
{
// get scene size
ACG
::
Vec3d
cur_min
;
ACG
::
Vec3d
cur_max
;
o_it
->
getBoundingBox
(
cur_min
,
cur_max
);
if
(
o_it
->
dataType
(
DATA_TRIANGLE_MESH
)){
TriMesh
*
mesh
=
PluginFunctions
::
triMesh
(
*
o_it
);
MeshInfo
::
getBoundingBox
(
mesh
,
cur_min
,
cur_max
);
}
else
if
(
o_it
->
dataType
(
DATA_POLY_MESH
)){
PolyMesh
*
mesh
=
PluginFunctions
::
polyMesh
(
*
o_it
);
MeshInfo
::
getBoundingBox
(
mesh
,
cur_min
,
cur_max
);
}
else
{
std
::
cerr
<<
"Error: Object is not a mesh! This should not be possible."
<<
std
::
endl
;
continue
;
}
if
(
firstRound
){
bbmin
=
cur_min
;
...
...
@@ -200,7 +214,7 @@ void SlicePlugin::getBoundingBox(ACG::Vec3d& bbmin, ACG::Vec3d& bbmax){
}
if
((
bbmin
[
0
]
>
bbmax
[
0
])
||
(
bbmin
[
1
]
>
bbmax
[
1
])
||
(
bbmin
[
2
]
>
bbmax
[
2
]))
std
::
cerr
<<
"Error while computing bounding box!
"
;
std
::
cerr
<<
"Error while computing bounding box!
There is probably no Mesh selected!"
<<
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