Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
openCARP
meshalyzer
Commits
4c9fb4ac
Commit
4c9fb4ac
authored
Jul 16, 2020
by
Edward Vigmond
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'VBO' of
https://git.opencarp.org/openCARP/meshalyzer
into VBO
parents
7da80e2e
aa4e9168
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
75 deletions
+94
-75
CMakeLists.txt
CMakeLists.txt
+14
-0
manual/manual.tex
manual/manual.tex
+13
-2
src/CMakeLists.txt
src/CMakeLists.txt
+58
-71
src/Model.cc
src/Model.cc
+9
-1
src/Surfaces.cc
src/Surfaces.cc
+0
-1
No files found.
CMakeLists.txt
View file @
4c9fb4ac
...
...
@@ -6,3 +6,17 @@ project(meshalyzer
)
add_subdirectory
(
src
)
if
(
APPLE
)
set
(
MESHALYZER_EXE
"meshalyzer.app/Contents/MacOS/meshalyzer"
)
elseif
(
UNIX
)
set
(
MESHALYZER_EXE
"meshalyzer"
)
endif
()
add_custom_target
(
link_exe ALL
COMMAND ln -sf
${
CMAKE_BINARY_DIR
}
/src/
${
MESHALYZER_EXE
}
${
CMAKE_CURRENT_LIST_DIR
}
COMMENT
"Create link to meshalyzer executable"
VERBATIM
)
add_dependencies
(
link_exe meshalyzer
)
manual/manual.tex
View file @
4c9fb4ac
...
...
@@ -167,8 +167,8 @@ The same rule regarding lines holds in the mixed element files.
A line is an entity which can be highlighted.
\begin{figure}
\centerline
{
\includegraphics
[width=4cm]
{
linejoint
.png
}
\includegraphics
[width=4cm]
{
two
seg.pn
g
}}
\centerline
{
\includegraphics
[width=4cm]
{
linejoint
}
\includegraphics
[width=4cm]
{
two
Se
g
}}
\caption
{
\textbf
{
Left
}
: Joint between two segments when part of a line.
\textbf
{
Right
}
: Two independent segments.
}
\label
{
fig:joint
}
\end{figure}
...
...
@@ -774,6 +774,17 @@ Note that surface material properties may also be set, which depend on lighting.
\label
{
fig:lightDiag
}
\end{figure}
As a general outline, the following table gives the lighting settings to achieve material effects (L=low, M=medium, H=high, V=very):
\begin{longtable}
{
|l|c|c|c|c|
}
\hline
material
&
Ambient
&
Diffuse
&
Specular
&
Shiny
\\
\hline
Glass
&
L
&
H
&
H
&
H
\\
Stone
&
L
&
VH
&
L
&
VL
\\
Metal
&
L
&
M
&
H
&
H
\\
Plastic
&
VL
&
VL
&
M
&
L
\\
Rubber
&
VL
&
M
&
M
&
VL
\\
\hline
\end{longtable}
\subsubsection
{
Scalar Data
}
...
...
src/CMakeLists.txt
View file @
4c9fb4ac
# for MacOS
if
(
APPLE
)
option
(
HAVE_RETINA
"Set TRUE if the display is retina"
TRUE
)
if
(
HAVE_RETINA
)
add_definitions
(
-D
IS_RETINA=1
)
add_
compile_
definitions
(
IS_RETINA=1
)
endif
(
HAVE_RETINA
)
endif
(
APPLE
)
# for Linux
if
(
UNIX AND NOT APPLE
)
find_package
(
GLUT REQUIRED
)
find_package
(
GLEW REQUIRED
)
endif
(
UNIX AND NOT APPLE
)
find_package
(
Threads REQUIRED
)
find_package
(
PNG REQUIRED
)
find_package
(
ZLIB REQUIRED
)
find_package
(
OpenGL REQUIRED
)
find_package
(
OpenMP
)
# FLTK
find_package
(
FLTK REQUIRED
)
include_directories
(
${
FLTK_INCLUDE_DIR
}
)
get_filename_component
(
FLTK_BIN_DIR
"
${
FLTK_FLUID_EXECUTABLE
}
"
PATH
)
find_program
(
FLTK_CONFIG_SCRIPT fltk-config PATHS
${
FLTK_BIN_DIR
}
)
find_package
(
X11 REQUIRED
)
include_directories
(
${
X11_INCLUDE_DIR
}
)
link_libraries
(
${
X11_LIBRARIES
}
)
find_package
(
ZLIB REQUIRED
)
include
(
FindZLIB
)
if
(
ZLIB_FOUND
)
include_directories
(
${
ZLIB_INCLUDE_DIR
}
)
link_libraries
(
${
ZLIB_LIBRARIES
}
)
else
(
ZLIB_FOUND
)
message
(
FATAL_ERROR
"Couldn't find development files for zlib"
)
endif
(
ZLIB_FOUND
)
# same FLTK linking flags as Makefile
execute_process
(
COMMAND
${
FLTK_CONFIG_SCRIPT
}
--use-images --use-glut --use-gl --ldflags
OUTPUT_VARIABLE FLTK_LD_FLAGS
)
string
(
STRIP
${
FLTK_LD_FLAGS
}
FLTK_LD_FLAGS
)
message
(
STATUS
"Found FLTK linking flags:
${
FLTK_LD_FLAGS
}
"
)
find_package
(
PNG REQUIRED
)
include
(
FindPNG
)
if
(
PNG_FOUND
)
include_directories
(
${
PNG_INCLUDE_DIR
}
)
link_libraries
(
${
PNG_LIBRARIES
}
)
add_definitions
(
${
PNG_DEFINITIONS
}
)
else
(
PNG_FOUND
)
message
(
FATAL_ERROR
"Couldn't find development files for PNG"
)
endif
(
PNG_FOUND
)
if
(
CYGWIN
)
add_definitions
(
-DNOMINMAX
)
endif
(
CYGWIN
)
# No common library for pthreads yet.
find_library
(
PTHREAD_LIB pthread
)
if
(
PTHREAD_LIB
)
link_libraries
(
${
PTHREAD_LIB
}
)
else
(
PTHREAD_LIB
)
message
(
FATAL_ERROR
"Couldn't find pthread library"
)
endif
(
PTHREAD_LIB
)
#VTK
# VTK
option
(
USE_VTK
"Build with VTK"
TRUE
)
if
(
USE_VTK
)
set
(
MESHALYZER_VTK_COMPONENTS
...
...
@@ -62,41 +48,9 @@ if (USE_VTK)
list
(
GET VTK_INCLUDE_DIRS 0 VTK_INCLUDE_DIRS_ONLY
)
message
(
STATUS
"Found VTK only includes:
${
VTK_INCLUDE_DIRS_ONLY
}
"
)
include_directories
(
${
VTK_INCLUDE_DIRS_ONLY
}
)
link_libraries
(
${
VTK_LIBRARIES
}
)
add_definitions
(
-DUSE_VTK
)
else
(
VTK_FOUND
)
message
(
FATAL_ERROR
"Couldn't find VTK library"
)
endif
(
VTK_FOUND
)
endif
(
USE_VTK
)
#Check for GLUT
find_package
(
OpenGL REQUIRED
)
find_package
(
GLUT REQUIRED
)
find_package
(
GLEW REQUIRED
)
include_directories
(
${
OPENGL_INCLUDE_DIRS
}
${
GLUT_INCLUDE_DIRS
}
${
GLEW_INCLUDE_DIRS
}
)
option
(
USE_GLFRAMEBUFFERS
"Use the glFramebuffer* extensions to render PNG images. It should be superior to onscreen rendering, but on nvidia cards it has problems."
OFF
)
if
(
NOT USE_GLFRAMEBUFFERS
)
add_definitions
(
-DONSCREEN_DUMP
)
endif
(
NOT USE_GLFRAMEBUFFERS
)
# ok, now adding everything else
add_definitions
(
-DOBJ_CLASS
-D_REENTRANT
-DNOMINMAX
-MMD
)
find_package
(
OpenMP
)
if
(
OpenMP_CXX_FOUND
)
add_definitions
(
${
OpenMP_CXX_FLAGS
}
)
endif
(
OpenMP_CXX_FOUND
)
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
)
# copy images to cmake build tree
set
(
MESHALYZER_IMAGE_FOLDER
"images"
)
if
(
NOT EXISTS
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
MESHALYZER_IMAGE_FOLDER
}
)
...
...
@@ -173,11 +127,44 @@ add_executable(meshalyzer
)
add_dependencies
(
meshalyzer create_hdf5_data_browser
)
target_link_libraries
(
meshalyzer
${
OPENGL_LIBRARIES
}
${
GLUT_LIBRARIES
}
${
GLEW_LIBRARIES
}
${
FLTK_LIBRARIES
}
)
target_compile_options
(
meshalyzer PRIVATE -MMD
)
target_compile_definitions
(
meshalyzer PRIVATE
_REENTRANT
NOMINMAX
)
target_include_directories
(
meshalyzer PRIVATE
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
$<BUILD_INTERFACE:
${
FLTK_INCLUDE_DIR
}
>
)
target_link_libraries
(
meshalyzer PRIVATE
${
FLTK_LD_FLAGS
}
Threads::Threads
PNG::PNG
ZLIB::ZLIB
OpenGL::GL
)
if
(
GLUT_FOUND
)
target_link_libraries
(
meshalyzer PRIVATE GLUT::GLUT
)
endif
(
GLUT_FOUND
)
if
(
GLEW_FOUND
)
target_link_libraries
(
meshalyzer PRIVATE GLEW::GLEW
)
endif
(
GLEW_FOUND
)
if
(
OpenMP_CXX_FOUND
)
target_link_libraries
(
meshalyzer
${
OpenMP_CXX_LIBRARIES
}
)
target_link_libraries
(
meshalyzer
PRIVATE OpenMP::OpenMP_CXX
)
endif
(
OpenMP_CXX_FOUND
)
if
(
VTK_FOUND
)
target_compile_definitions
(
meshalyzer PRIVATE USE_VTK
)
target_include_directories
(
meshalyzer PRIVATE $<BUILD_INTERFACE:
${
VTK_INCLUDE_DIRS_ONLY
}
>
)
target_link_libraries
(
meshalyzer PRIVATE
${
VTK_LIBRARIES
}
)
endif
(
VTK_FOUND
)
set_property
(
TARGET meshalyzer PROPERTY CXX_STANDARD 17
)
add_custom_command
(
TARGET meshalyzer POST_BUILD
...
...
src/Model.cc
View file @
4c9fb4ac
...
...
@@ -491,6 +491,7 @@ Model:: read_objects(vtkUnstructuredGrid* grid, bool no_velem )
if
(
no_velem
)
nvol
=
0
;
_vol
.
resize
(
nvol
);
nvol
=
0
;
if
(
nsurf
)
{
Surfaces
*
newSurf
=
new
Surfaces
(
&
pt
);
...
...
@@ -511,11 +512,18 @@ Model:: read_objects(vtkUnstructuredGrid* grid, bool no_velem )
const
char
*
eletype
=
VTK2CARP_etype
[
grid
->
GetCellType
(
i
)];
// convert points to int
int
n
[
10
];
#if VTK_MAJOR_VERSION <= 8
vtkIdType
*
nvtk
,
nn
;
grid
->
GetCellPoints
(
i
,
nn
,
nvtk
);
int
n
[
10
];
for
(
int
j
=
0
;
j
<
nn
;
j
++
)
n
[
j
]
=
nvtk
[
j
];
#else
vtkIdList
nl
;
grid
->
GetCellPoints
(
i
,
&
nl
);
for
(
int
j
=
0
;
j
<
nl
.
GetNumberOfIds
();
j
++
)
n
[
j
]
=
nl
.
GetId
(
j
);
#endif
if
(
regdata
)
reg
=
(
int
)(
regdata
->
GetTuple1
(
i
)
);
...
...
src/Surfaces.cc
View file @
4c9fb4ac
...
...
@@ -67,7 +67,6 @@ void Surfaces::determine_vert_norms( PPoint& pt )
memset
(
tvn
,
0
,
pt
.
num
()
*
3
*
sizeof
(
GLfloat
)
);
const
GLfloat
*
n
;
for
(
auto
ele
:
_ele
)
{
if
(
(
n
=
ele
->
nrml
(
0
))
==
NULL
)
continue
;
const
int
*
pnt
=
ele
->
obj
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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