Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
Type-OpenVolumeMesh
Commits
613183cd
Commit
613183cd
authored
Feb 19, 2019
by
Martin Heistermann
Browse files
Move duplicated plane to to ACG.
parent
19d00ec7
Changes
7
Hide whitespace changes
Inline
Side-by-side
ObjectTypes/VolumeMeshObject/VolumeMeshBufferManager.hh
View file @
613183cd
...
...
@@ -54,6 +54,7 @@
#include
<OpenVolumeMesh/Attribs/NormalAttrib.hh>
#include
<OpenVolumeMesh/Attribs/ColorAttrib.hh>
#include
<OpenVolumeMesh/Attribs/TexCoordAttrib.hh>
#include
<ACG/Geometry/Types/PlaneType.hh>
/*! \class VolumeMeshBufferManager
* \brief This class creates buffers that can be used to render open volume meshs.
...
...
@@ -74,6 +75,8 @@ class VolumeMeshBufferManager
typedef
OpenVolumeMesh
::
OpenVolumeMeshFace
Face
;
typedef
OpenVolumeMesh
::
OpenVolumeMeshCell
Cell
;
using
Plane
=
ACG
::
Geometry
::
Plane
;
public:
enum
PrimitiveMode
...
...
@@ -118,22 +121,6 @@ public:
TCM_SINGLE_2D
};
class
Plane
{
public:
Plane
(
const
ACG
::
Vec3d
&
_p
,
const
ACG
::
Vec3d
&
_n
,
const
ACG
::
Vec3d
&
_x
,
const
ACG
::
Vec3d
&
_y
)
:
position
(
_p
),
normal
(
_n
),
xdirection
(
_x
),
ydirection
(
_y
)
{
}
// position
ACG
::
Vec3d
position
;
// normal
ACG
::
Vec3d
normal
;
// xdirection scaled by 1.0/width -> [0,1] is inrange
ACG
::
Vec3d
xdirection
;
// ydirection scaled by 1.0/height -> [0,1] is inrange
ACG
::
Vec3d
ydirection
;
};
VolumeMeshBufferManager
(
const
VolumeMesh
&
mesh_
,
OpenVolumeMesh
::
StatusAttrib
&
statusAttrib_
,
OpenVolumeMesh
::
ColorAttrib
<
ACG
::
Vec4f
>&
colorAttrib_
,
OpenVolumeMesh
::
NormalAttrib
<
VolumeMesh
>&
normalAttrib_
,
...
...
@@ -297,7 +284,7 @@ public:
void
clearCutPlanes
();
/// Adds a cut plane
void
addCutPlane
(
const
typename
VolumeMeshBufferManager
<
VolumeMesh
>
::
Plane
&
_p
);
void
addCutPlane
(
const
ACG
::
Geometry
::
Plane
&
_p
);
/// Adds a cut plane
void
addCutPlane
(
const
ACG
::
Vec3d
&
_p
,
const
ACG
::
Vec3d
&
_n
,
const
ACG
::
Vec3d
&
_xsize
,
const
ACG
::
Vec3d
&
_ysize
);
...
...
@@ -478,7 +465,7 @@ private:
unsigned
char
mCurrentNormalOffset
;
unsigned
char
mCurrentColorOffset
;
std
::
vector
<
Plane
>
cut_planes_
;
std
::
vector
<
ACG
::
Geometry
::
Plane
>
cut_planes_
;
std
::
vector
<
ACG
::
Vec3d
>
mCogs
;
bool
mCogsValid
;
...
...
ObjectTypes/VolumeMeshObject/VolumeMeshBufferManagerT.cc
View file @
613183cd
...
...
@@ -429,7 +429,7 @@ void VolumeMeshBufferManager<VolumeMesh>::clearCutPlanes()
* @param _p The plane that is added.
*/
template
<
class
VolumeMesh
>
void
VolumeMeshBufferManager
<
VolumeMesh
>::
addCutPlane
(
const
typename
VolumeMeshBufferManager
<
VolumeMesh
>
::
Plane
&
_p
)
void
VolumeMeshBufferManager
<
VolumeMesh
>::
addCutPlane
(
const
ACG
::
Geometry
::
Plane
&
_p
)
{
cut_planes_
.
push_back
(
_p
);
invalidateGeometry
();
...
...
@@ -449,7 +449,7 @@ void VolumeMeshBufferManager<VolumeMesh>::addCutPlane(const typename VolumeMeshB
template
<
class
VolumeMesh
>
void
VolumeMeshBufferManager
<
VolumeMesh
>::
addCutPlane
(
const
ACG
::
Vec3d
&
_p
,
const
ACG
::
Vec3d
&
_n
,
const
ACG
::
Vec3d
&
_xsize
,
const
ACG
::
Vec3d
&
_ysize
)
{
addCutPlane
(
Plane
(
_p
,
_n
,
_xsize
,
_ysize
));
addCutPlane
(
ACG
::
Geometry
::
Plane
(
_p
,
_n
,
_xsize
,
_ysize
));
}
/**
...
...
@@ -467,8 +467,8 @@ bool VolumeMeshBufferManager<VolumeMesh>::is_inside(const ACG::Vec3d& _p)
ACG
::
Vec3d
pl
=
_p
-
it
->
position
;
// evaluate dot products
double
pn
=
(
pl
|
it
->
normal
);
double
px
=
(
pl
|
it
->
x
d
irection
);
double
py
=
(
pl
|
it
->
y
d
irection
);
double
px
=
(
pl
|
it
->
x
D
irection
);
double
py
=
(
pl
|
it
->
y
D
irection
);
if
(
pn
<
0.0
&&
px
>
-
0.5
&&
px
<
0.5
&&
py
>
-
0.5
&&
py
<
0.5
)
return
false
;
...
...
ObjectTypes/VolumeMeshObject/VolumeMeshNode.hh
View file @
613183cd
...
...
@@ -49,6 +49,7 @@
#include
<ACG/Scenegraph/BaseNode.hh>
#include
<ACG/Scenegraph/MaterialNode.hh>
#include
<ACG/Scenegraph/DrawModes.hh>
#include
<ACG/Geometry/Types/PlaneType.hh>
#include
<OpenVolumeMesh/Core/OpenVolumeMeshHandle.hh>
#include
<OpenVolumeMesh/Core/BaseEntities.hh>
#include
<OpenVolumeMesh/Attribs/StatusAttrib.hh>
...
...
@@ -94,7 +95,7 @@ public:
typedef
OpenVolumeMesh
::
OpenVolumeMeshFace
Face
;
typedef
OpenVolumeMesh
::
OpenVolumeMeshCell
Cell
;
typedef
typename
VolumeMeshBufferManager
<
VolumeMeshT
>::
Plane
Plane
;
using
Plane
=
ACG
::
Geometry
::
Plane
;
/// Constructor
...
...
ObjectTypes/VolumeMeshObject/VolumeMeshNodeT.cc
View file @
613183cd
...
...
@@ -56,6 +56,7 @@
#include
<ACG/GL/IRenderer.hh>
#include
<ACG/ShaderUtils/GLSLShader.hh>
#include
<ACG/GL/ShaderCache.hh>
#include
<ACG/Geometry/Types/PlaneType.hh>
#include
<OpenVolumeMesh/Mesh/HexahedralMesh.hh>
...
...
@@ -1447,7 +1448,7 @@ template<class VolumeMeshT>
void
VolumeMeshNodeT
<
VolumeMeshT
>::
add_cut_plane
(
const
Vec3d
&
_p
,
const
Vec3d
&
_n
,
const
Vec3d
&
_xsize
,
const
Vec3d
&
_ysize
)
{
add_cut_plane
(
VolumeMeshBufferManager
<
VolumeMeshT
>::
Plane
(
_p
,
_n
,
_xsize
,
_ysize
));
add_cut_plane
(
Plane
(
_p
,
_n
,
_xsize
,
_ysize
));
}
template
<
class
VolumeMeshT
>
...
...
Plugin-TypeHexahedralMesh/TypeHexahedralMesh.cc
View file @
613183cd
...
...
@@ -194,7 +194,6 @@ void TypeHexahedralMeshPlugin::slotUpdateContextMenu(int _objectId) {
void
TypeHexahedralMeshPlugin
::
slot_update_planes_in_scenegraph_node
(
int
_deletedObject
)
{
typedef
ACG
::
SceneGraph
::
VolumeMeshNodeT
<
HexahedralMesh
>::
Plane
Plane
;
std
::
vector
<
Plane
>
planes
;
// collect planes
...
...
Plugin-TypePolyhedralMesh/TypePolyhedralMesh.cc
View file @
613183cd
...
...
@@ -246,7 +246,6 @@ void TypePolyhedralMeshPlugin::setTranslucencyFactor() {
void
TypePolyhedralMeshPlugin
::
slot_update_planes_in_scenegraph_node
(
int
_deletedObject
)
{
typedef
ACG
::
SceneGraph
::
VolumeMeshNodeT
<
PolyhedralMesh
>::
Plane
Plane
;
std
::
vector
<
Plane
>
planes
;
// collect planes
...
...
Plugin-TypeTetrahedralMesh/TypeTetrahedralMesh.cc
View file @
613183cd
...
...
@@ -180,7 +180,6 @@ void TypeTetrahedralMeshPlugin::slotUpdateContextMenu(int _objectId) {
void
TypeTetrahedralMeshPlugin
::
slot_update_planes_in_scenegraph_node
(
int
_deletedObject
)
{
typedef
ACG
::
SceneGraph
::
VolumeMeshNodeT
<
TetrahedralMesh
>::
Plane
Plane
;
std
::
vector
<
Plane
>
planes
;
// collect planes
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment