Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
4a11dd11
Commit
4a11dd11
authored
Nov 24, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into 'develop'
Develop See merge request
!77
parents
0df500ca
d67fd741
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
109 additions
and
167 deletions
+109
-167
Apps/Tests/Utils/quantization.cpp
Apps/Tests/Utils/quantization.cpp
+6
-6
Apps/Tuto/tuto5.cpp
Apps/Tuto/tuto5.cpp
+3
-3
CGoGN/include/Algo/Render/GL2/topoRender.h
CGoGN/include/Algo/Render/GL2/topoRender.h
+8
-0
CGoGN/include/Algo/Render/GL2/topoRender.hpp
CGoGN/include/Algo/Render/GL2/topoRender.hpp
+30
-12
CGoGN/include/Utils/text3d.frag
CGoGN/include/Utils/text3d.frag
+1
-1
CGoGN/include/Utils/textures.hpp
CGoGN/include/Utils/textures.hpp
+1
-1
CGoGN/src/Utils/text3d.cpp
CGoGN/src/Utils/text3d.cpp
+41
-8
CGoGN/src/Utils/textureSticker.cpp
CGoGN/src/Utils/textureSticker.cpp
+3
-3
README.TXT
README.TXT
+0
-132
README.md
README.md
+4
-1
cmake_modules/FindSuiteSparse.cmake
cmake_modules/FindSuiteSparse.cmake
+12
-0
No files found.
Apps/Tests/Utils/quantization.cpp
View file @
4a11dd11
...
...
@@ -3,15 +3,15 @@
using
namespace
CGoGN
;
template
struct
Utils
::
CodeVector
<
Geom
::
Vec3f
>;
template
struct
Utils
::
CodeVector
<
Geom
::
Vec3d
>;
template
struct
Utils
::
CodeVector
<
Geom
::
Vec4d
>;
//
template struct Utils::CodeVector<Geom::Vec3f>;
//
template struct Utils::CodeVector<Geom::Vec3d>;
//
template struct Utils::CodeVector<Geom::Vec4d>;
template
class
Utils
::
Quantization
<
Geom
::
Vec3f
>;
template
class
Utils
::
Quantization
<
Geom
::
Vec3d
>;
template
class
Utils
::
Quantization
<
Geom
::
Vec4d
>;
//
template class Utils::Quantization<Geom::Vec3f>;
//
template class Utils::Quantization<Geom::Vec3d>;
//
template class Utils::Quantization<Geom::Vec4d>;
int
test_quantization
()
...
...
Apps/Tuto/tuto5.cpp
View file @
4a11dd11
...
...
@@ -130,9 +130,9 @@ void MyQT::cb_initGL()
m_sprite
->
setAttributePosition
(
m_positionVBO
);
m_sprite
->
setColor
(
Geom
::
Vec4f
(
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
));
m_strings
=
new
Utils
::
Strings3D
(
true
,
Geom
::
Vec3f
(
0.1
f
,
0.0
f
,
0.3
f
));
storeVerticesInfo
();
m_strings
->
sendToVBO
();
m_strings
=
new
Utils
::
Strings3D
(
true
,
Geom
::
Vec3f
(
0.1
f
,
0.0
f
,
0.3
f
));
storeVerticesInfo
();
m_strings
->
sendToVBO
();
// copy de contenu de VBO a la creation
m_dataVBO
=
new
Utils
::
VBO
(
*
m_positionVBO
);
...
...
CGoGN/include/Algo/Render/GL2/topoRender.h
View file @
4a11dd11
...
...
@@ -383,6 +383,14 @@ public:
template
<
typename
MAP
>
void
drawColoredDarts
(
MAP
&
map
);
/**
* Get back middle position of drawn darts
* @param map the map
* @param posExpl the output positions
*/
template
<
typename
PFP
>
void
computeDartMiddlePositions
(
typename
PFP
::
MAP
&
map
,
DartAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
posExpl
);
};
...
...
CGoGN/include/Algo/Render/GL2/topoRender.hpp
View file @
4a11dd11
...
...
@@ -622,25 +622,43 @@ Dart TopoRender::raySelection(MAP& map, const Geom::Vec3f& rayA, const Geom::Vec
double
dist2
=
std
::
numeric_limits
<
double
>::
max
();
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
// get back position of segment PQ
const
Geom
::
Vec3f
&
P
=
m_bufferDartPosition
[
attIndex
[
d
]];
const
Geom
::
Vec3f
&
Q
=
m_bufferDartPosition
[
attIndex
[
d
]
+
1
];
float
ld2
=
Geom
::
squaredDistanceLine2Seg
(
rayA
,
rayAB
,
AB2
,
P
,
Q
);
if
(
ld2
<
dm2
)
if
(
!
map
.
isBoundaryMarkedCurrent
(
d
))
{
Geom
::
Vec3f
V
=
(
P
+
Q
)
/
2.0
f
-
rayA
;
double
d2
=
double
(
V
*
V
);
if
(
d2
<
dist2
)
// get back position of segment PQ
const
Geom
::
Vec3f
&
P
=
m_bufferDartPosition
[
attIndex
[
d
]];
const
Geom
::
Vec3f
&
Q
=
m_bufferDartPosition
[
attIndex
[
d
]
+
1
];
float
ld2
=
Geom
::
squaredDistanceLine2Seg
(
rayA
,
rayAB
,
AB2
,
P
,
Q
);
if
(
ld2
<
dm2
)
{
dist2
=
d2
;
dFinal
=
d
;
Geom
::
Vec3f
V
=
(
P
+
Q
)
/
2.0
f
-
rayA
;
double
d2
=
double
(
V
*
V
);
if
(
d2
<
dist2
)
{
dist2
=
d2
;
dFinal
=
d
;
}
}
}
}
return
dFinal
;
}
template
<
typename
PFP
>
void
TopoRender
::
computeDartMiddlePositions
(
typename
PFP
::
MAP
&
map
,
DartAttribute
<
typename
PFP
::
VEC3
,
typename
PFP
::
MAP
>&
posExpl
)
{
DartAttribute
<
unsigned
int
,
typename
PFP
::
MAP
>
attIndex
=
map
.
template
getAttribute
<
unsigned
int
,
DART
,
typename
PFP
::
MAP
>(
m_nameIndex
);
if
(
!
attIndex
.
isValid
())
attIndex
=
map
.
template
addAttribute
<
unsigned
int
,
DART
,
typename
PFP
::
MAP
>(
m_nameIndex
);
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
const
Geom
::
Vec3f
&
P
=
m_bufferDartPosition
[
attIndex
[
d
]];
const
Geom
::
Vec3f
&
Q
=
m_bufferDartPosition
[
attIndex
[
d
]
+
1
];
posExpl
[
d
]
=
(
P
+
Q
)
*
0.5
f
;
}
}
}
// namespace GL2
}
// namespace Algo
...
...
CGoGN/include/Utils/text3d.frag
View file @
4a11dd11
...
...
@@ -6,5 +6,5 @@ uniform vec4 color;
FRAG_OUT_DEF
;
void
main
(
void
)
{
float
lum
=
TEXTURE2D
(
FontTexture
,
tex_coord
).
s
;
;
float
lum
=
TEXTURE2D
(
FontTexture
,
tex_coord
).
s
;
// no } because it is added in the shader class code (with other things)
CGoGN/include/Utils/textures.hpp
View file @
4a11dd11
...
...
@@ -353,7 +353,7 @@ bool Image<DIM,TYPE>::load(const std::string& filename)
QImage
*
ptr
=
new
QImage
(
filename
.
c_str
());
if (ptr
== NULL
)
if
(
ptr
->
isNull
()
)
{
CGoGNout
<<
"Impossible to load "
<<
filename
<<
CGoGNendl
;
return
false
;
...
...
CGoGN/src/Utils/text3d.cpp
View file @
4a11dd11
...
...
@@ -62,9 +62,12 @@ Strings3D::Strings3D(bool withBackground, const Geom::Vec3f& bgc, bool with_plan
glGenTextures
(
1
,
&
(
*
m_idTexture
));
glBindTexture
(
GL_TEXTURE_2D
,
*
m_idTexture
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_
LUMINANCE
,
WIDTHTEXTURE
,
HEIGHTTEXTURE
,
0
,
GL_LUMINANCE
,
GL_UNSIGNED_BYTE
,
(
GLvoid
*
)(
buff
));
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_
RED
,
WIDTHTEXTURE
,
HEIGHTTEXTURE
,
0
,
GL_RED
,
GL_UNSIGNED_BYTE
,
(
GLvoid
*
)(
buff
));
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_S
,
GL_CLAMP_TO_EDGE
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP_TO_EDGE
);
glTexParameteri
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_R
,
GL_CLAMP_TO_EDGE
);
delete
[]
buff
;
}
else
...
...
@@ -88,8 +91,7 @@ Strings3D::Strings3D(bool withBackground, const Geom::Vec3f& bgc, bool with_plan
else
{
std
::
stringstream
ss
;
ss
<<
"vec4 backColor = vec4("
<<
bgc
[
0
]
<<
","
<<
bgc
[
1
]
<<
","
<<
bgc
[
2
]
<<
",color[3]);
\n
"
;
// ss << "vec4 backColor = vec4(0.2,0.1,0.4);\n";
ss
<<
" vec4 backColor = vec4("
<<
bgc
[
0
]
<<
","
<<
bgc
[
1
]
<<
","
<<
bgc
[
2
]
<<
",color[3]);
\n
"
;
glxfrag
.
append
(
ss
.
str
());
glxfrag
.
append
(
fragmentShaderText3
);
}
...
...
@@ -178,6 +180,7 @@ unsigned int Strings3D::sendOneStringToVBO(const std::string& str, float **buffe
float
u2
=
u
+
float
(
REALWIDTHFONT
)
/
float
(
WIDTHTEXTURE
);
float
v2
=
v
+
float
(
WIDTHFONT
-
1
)
/
float
(
HEIGHTTEXTURE
);
// 0
*
buffer
++
=
x
;
*
buffer
++
=
0
;
*
buffer
++
=
u
;
...
...
@@ -185,16 +188,31 @@ unsigned int Strings3D::sendOneStringToVBO(const std::string& str, float **buffe
float
xf
=
x
+
float
(
REALWIDTHFONT
)
/
25.
f
;
// 1
*
buffer
++
=
xf
;
*
buffer
++
=
0
;
*
buffer
++
=
u2
;
*
buffer
++
=
v2
;
// 2
*
buffer
++
=
xf
;
*
buffer
++
=
float
(
WIDTHFONT
)
/
25.
f
;
*
buffer
++
=
u2
;
*
buffer
++
=
v
;
// 0
*
buffer
++
=
x
;
*
buffer
++
=
0
;
*
buffer
++
=
u
;
*
buffer
++
=
v2
;
// 2
*
buffer
++
=
xf
;
*
buffer
++
=
float
(
WIDTHFONT
)
/
25.
f
;
*
buffer
++
=
u2
;
*
buffer
++
=
v
;
// 3
*
buffer
++
=
x
;
*
buffer
++
=
float
(
WIDTHFONT
)
/
25.
f
;
*
buffer
++
=
u
;
...
...
@@ -205,7 +223,7 @@ unsigned int Strings3D::sendOneStringToVBO(const std::string& str, float **buffe
*
buffervbo
=
buffer
;
return
4
*
nbc
;
return
6
*
nbc
;
}
void
Strings3D
::
sendToVBO
()
...
...
@@ -214,7 +232,7 @@ void Strings3D::sendToVBO()
// alloc buffer
m_vbo1
->
bind
();
glBufferData
(
GL_ARRAY_BUFFER
,
m_nbChars
*
16
*
sizeof
(
float
),
0
,
GL_STREAM_DRAW
);
glBufferData
(
GL_ARRAY_BUFFER
,
m_nbChars
*
24
*
sizeof
(
float
),
0
,
GL_STREAM_DRAW
);
float
*
buffer
=
reinterpret_cast
<
float
*>
(
glMapBuffer
(
GL_ARRAY_BUFFER
,
GL_READ_WRITE
));
// fill buffer
...
...
@@ -269,7 +287,7 @@ void Strings3D::postdraw()
void
Strings3D
::
draw
(
unsigned
int
idSt
,
const
Geom
::
Vec3f
&
pos
)
{
glUniform3fv
(
*
m_uniform_position
,
1
,
pos
.
data
());
glDrawArrays
(
GL_
QUAD
S
,
m_strpos
[
idSt
].
first
,
m_strpos
[
idSt
].
second
);
glDrawArrays
(
GL_
TRIANGLE
S
,
m_strpos
[
idSt
].
first
,
m_strpos
[
idSt
].
second
);
}
void
Strings3D
::
drawAll
(
const
Geom
::
Vec4f
&
color
)
...
...
@@ -290,7 +308,7 @@ void Strings3D::drawAll(const Geom::Vec4f& color)
for
(
unsigned
int
idSt
=
0
;
idSt
<
nb
;
++
idSt
)
{
glUniform3fv
(
*
m_uniform_position
,
1
,
m_strTranslate
[
idSt
].
data
());
glDrawArrays
(
GL_
QUAD
S
,
m_strpos
[
idSt
].
first
,
m_strpos
[
idSt
].
second
);
glDrawArrays
(
GL_
TRIANGLE
S
,
m_strpos
[
idSt
].
first
,
m_strpos
[
idSt
].
second
);
}
postdraw
();
}
...
...
@@ -316,23 +334,38 @@ void Strings3D::updateString(unsigned int idSt, const std::string& str)
float
u2
=
u
+
float
(
REALWIDTHFONT
)
/
float
(
WIDTHTEXTURE
);
float
v2
=
v
+
float
(
WIDTHFONT
-
1
)
/
float
(
HEIGHTTEXTURE
);
// 0
*
buffer
++
=
x
;
*
buffer
++
=
0
;
*
buffer
++
=
u
;
*
buffer
++
=
v2
;
float
xf
=
x
+
float
(
REALWIDTHFONT
)
/
25.
f
;
// 1
*
buffer
++
=
xf
;
*
buffer
++
=
0
;
*
buffer
++
=
u2
;
*
buffer
++
=
v2
;
// 2
*
buffer
++
=
xf
;
*
buffer
++
=
float
(
WIDTHFONT
)
/
25.
f
;
*
buffer
++
=
u2
;
*
buffer
++
=
v
;
// 0
*
buffer
++
=
x
;
*
buffer
++
=
0
;
*
buffer
++
=
u
;
*
buffer
++
=
v2
;
// 2
*
buffer
++
=
xf
;
*
buffer
++
=
float
(
WIDTHFONT
)
/
25.
f
;
*
buffer
++
=
u2
;
*
buffer
++
=
v
;
// 3
*
buffer
++
=
x
;
*
buffer
++
=
float
(
WIDTHFONT
)
/
25.
f
;
*
buffer
++
=
u
;
...
...
CGoGN/src/Utils/textureSticker.cpp
View file @
4a11dd11
...
...
@@ -86,7 +86,7 @@ void TextureSticker::fullScreenTexture(CGoGNGLuint texId)
// Draw quad
sm_textureMappingShader
->
enableVertexAttribs
();
glDrawArrays
(
GL_
QUADS
,
0
,
4
);
glDrawArrays
(
GL_
TRIANGLE_FAN
,
0
,
4
);
sm_textureMappingShader
->
disableVertexAttribs
();
// Unbind texture mapping shader
...
...
@@ -134,7 +134,7 @@ void TextureSticker::fullScreenTextureDepth(CGoGNGLuint texId, CGoGNGLuint dtexI
// Draw quad
sm_depthtextureMappingShader
->
enableVertexAttribs
();
glDrawArrays
(
GL_
QUADS
,
0
,
4
);
glDrawArrays
(
GL_
TRIANGLE_FAN
,
0
,
4
);
sm_depthtextureMappingShader
->
disableVertexAttribs
();
// Unbind texture mapping shader
...
...
@@ -175,7 +175,7 @@ void TextureSticker::fullScreenShader(Utils::GLSLShader* shader)
// Draw quad
shader
->
enableVertexAttribs
();
glDrawArrays
(
GL_
QUADS
,
0
,
4
);
glDrawArrays
(
GL_
TRIANGLE_FAN
,
0
,
4
);
shader
->
disableVertexAttribs
();
// Unbind shader
...
...
README.TXT
deleted
100644 → 0
View file @
0df500ca
English version bellow
Dépendences Linux
=================
installer les paquets suivants:
cmake cmake-curses-gui cmake-qt-gui libXi-dev libXmu-dev libglew-dev libtinyxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev
Pour compiler CGoGN
===================
* on compile tout d'abord les bibliothèques third-party :
cd CGoGN/ThirdParty/build
cmake ..
make (-j x si vous avez x cores)
make install
La même chose en debug:
cd ../buildDebug
cmake ..
make (-j x si vous avez x cores)
On peut fixer certaines option pour ne pas tout compiler:
* WITH_ASSIMP -> compile et utilise la librairie Assimp
* WITH_ZINRI -> compile et utilise la librairie Zinri
* WITH_PYTHONQT -> pour SCHNApps
* ensuite on compile CGoGN :
cd CGoGN/build
cmake ..
make (-j x si vous avez x cores)
Et en Debug avec:
cd ../buildDebug
cmake ..
make (-j x si vous avez x cores)
Certaines options sont disponibles :
* BUILD_SHARED_LIBS -Q experimental !
* ONELIB -> compilation en une seule lib (libcgogn.a) au lieu de 4
* WITH_ASSIMP -> utilise Assimp (auto set par third party compil)
* WITH_ZINRI -> utilise Zinri (auto set par third party compil)
* WITH_QT -> minimize les dependence si pas besoin de Qt (VRJuggler)
* WITH_GLEWMX -> pour utiliser GLEWMX a la place de GELW (pour VRJuggler)
Les librairies sont generees dans lib/Release et lib/Debug
Les binaires sont generes dans bin/Release et bin/Debug
* on peut ensuite compiler SCHNApps ainsi que les plugins fournis :
cd CGoGN/SCHNApps/build
cmake ..
make (-j x si vous avez x cores)
Et en Debug avec:
cd ../buildDebug
cmake ..
make (-j x si vous avez x cores)
Des exemples de données (fichiers trianbgz, off, etc..) sont accessible à l'adresse suivante:
https://iggservis.u-strasbg.fr/Data/data.zip
ENGLISH VERSION
===============
Linux dependencies
==================
install the following packages:
cmake cmake-curses-gui cmake-qt-gui libXi-dev libXmu-dev libglew-dev libxml2-dev libboost-all-dev zlib1g-dev qt4-designer qt4-dev-tools uuid-dev libgsl0-dev libsuitesparse-dev
To compile CGoGN
================
* first compile third-party libraries:
cd CGoGN/ThirdParty/build
cmake ..
make (-j x if you have x cores)
make install
In debug mode:
cd ../buildDebug
cmake ..
make
Some options are available to not compile everything:
* WITH_ASSIMP -> compile and use Assimp library
* WITH_ZINRI -> compile and use Zinri library
* WITH_PYTHONQT -> needed by SCHNApps
* then compile CGoGN (the libs are generated in CGoGN/lib and some examples in CGoGN/bin):
cd CGoGN/build
cmake ..
make (-j x if you have x cores)
in debug mode:
cd ../buildDebug
cmake ..
make
Some options are available:
* BUILD_SHARED_LIBS (F) experimental !
* ONELIB -> allow compilation in one lib (libcgogn.a) instead of four.
* WITH_ASSIMP -> use Assimp library (auto setted by third party compiling)
* WITH_ZINRI -> use Zinri library (auto setted by third party compiling)
* WITH_QT -> to minimize dependencies and compilation time
* WITH_GLEWMX -> to use GLEWMX (for VRJuggler users)
* we can then compile SCHNApps and the provided plugins :
cd CGoGN/SCHNApps/build
cmake ..
make (-j x if you have x cores)
in debug mode:
cd ../buildDebug
cmake ..
make
Libraries are generated in lib/Release and lib/Debug
Binaries are generated in bin/Release and bin/Debug
Examples of data (trianbgz, off, etc.. files) are available at the following address:
https://iggservis.u-strasbg.fr/Data/data.zip
README.md
View file @
4a11dd11
...
...
@@ -78,7 +78,10 @@ Dependencies
------------
*
install (or compile) Qt (choose 32/64 bits)
*
install python 2.7 (choose 32/64 bits) (Needed for SCHNApps)
*
Other Windows dependencies are furnished at http://cgogn.unistra.fr/Dependencies/
*
Other Windows dependencies are furnished at:
*
http://cgogn.unistra.fr/Dependencies/dependencies.txt
*
http://cgogn.unistra.fr/Dependencies/windows_dependencies32.zip
*
http://cgogn.unistra.fr/Dependencies/windows_dependencies64.zip
**Supported compilers: Visual C++ 2013 (12.0) or greater**
...
...
cmake_modules/FindSuiteSparse.cmake
View file @
4a11dd11
...
...
@@ -390,6 +390,18 @@ if(SUITESPARSE_USE_LAPACK_BLAS)
endif
()
find_library
(
SSPARSE_CONFIG_LIB
NAMES libsuitesparseconfig suitesparseconfig
PATHS /opt/local/lib
${
SUITESPARSE_SEARCH_LIB_POSTFIX
}
/usr/lib
${
SUITESPARSE_SEARCH_LIB_POSTFIX
}
/usr/local/lib
${
SUITESPARSE_SEARCH_LIB_POSTFIX
}
${
SUITESPARSE_DIR
}
PATH_SUFFIXES Release Debug
)
if
(
SSPARSE_CONFIG_LIB
)
list
(
APPEND SUITESPARSE_LIBRARIES
${
SSPARSE_CONFIG_LIB
}
)
endif
()
if
(
SUITESPARSE_INCLUDE_DIRS
)
list
(
REMOVE_DUPLICATES SUITESPARSE_INCLUDE_DIRS
)
endif
()
...
...
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