Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
CGoGN
CGoGN
Commits
d5d75bd3
Commit
d5d75bd3
authored
Mar 13, 2015
by
Sylvain Thery
Committed by
Pierre Kraemer
Apr 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove clipping using std::regex for gcc 4.8 (see volumeExplorer for clippig topo)
parent
87ffd3a7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
120 additions
and
25 deletions
+120
-25
Apps/Examples/CMakeLists.txt
Apps/Examples/CMakeLists.txt
+1
-1
CGoGN/include/Utils/Shaders/shaderSimpleColor.h
CGoGN/include/Utils/Shaders/shaderSimpleColor.h
+0
-3
CGoGN/src/Utils/Shaders/shaderColorPerVertex.cpp
CGoGN/src/Utils/Shaders/shaderColorPerVertex.cpp
+5
-9
CGoGN/src/Utils/Shaders/shaderSimpleColor.cpp
CGoGN/src/Utils/Shaders/shaderSimpleColor.cpp
+4
-6
CGoGN/src/Utils/shaderMutator.cpp
CGoGN/src/Utils/shaderMutator.cpp
+102
-0
CMakeLists.txt
CMakeLists.txt
+8
-6
No files found.
Apps/Examples/CMakeLists.txt
View file @
d5d75bd3
...
...
@@ -40,7 +40,7 @@ qt_wrap_cpp( viewer_moc viewer.h )
add_executable
(
viewer viewer.cpp
${
viewer_moc
}
${
viewer_ui
}
)
target_link_libraries
(
viewer
${
CGoGN_LIBS
}
${
NUMERICAL_LIBS
}
${
CGoGN_EXT_LIBS
}
)
IF
(
HAS_CPP11_REGEX
)
IF
(
CGoGN_GCC_4_9
)
qt_wrap_ui
(
clipping_ui clipping.ui
)
qt_wrap_cpp
(
clipping_moc clipping.h
)
add_executable
(
clipping clipping.cpp
${
clipping_ui
}
${
clipping_moc
}
)
...
...
CGoGN/include/Utils/Shaders/shaderSimpleColor.h
View file @
d5d75bd3
...
...
@@ -67,9 +67,6 @@ public:
unsigned
int
setAttributePosition
(
VBO
*
vbo
);
void
setClippingPlane
(
const
Geom
::
Vec4f
&
plane
);
inline
void
setNoClippingPlane
()
{
setClippingPlane
(
Geom
::
Vec4f
(
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
));
}
};
}
// namespace Utils
...
...
CGoGN/src/Utils/Shaders/shaderColorPerVertex.cpp
View file @
d5d75bd3
...
...
@@ -21,10 +21,10 @@
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#define CGoGN_UTILS_DLL_EXPORT 1
#include "Utils/Shaders/shaderColorPerVertex.h"
namespace
CGoGN
{
...
...
@@ -36,7 +36,6 @@ namespace Utils
#include "shaderColorPerVertexClip.vert"
#include "shaderColorPerVertexClip.frag"
ShaderColorPerVertex
::
ShaderColorPerVertex
(
bool
withClipping
,
bool
black_is_transparent
)
{
if
(
withClipping
)
...
...
@@ -45,10 +44,10 @@ ShaderColorPerVertex::ShaderColorPerVertex(bool withClipping, bool black_is_tran
m_nameFS
=
"ShaderColorPerVertexClip_fs"
;
m_nameGS
=
""
;
std
::
string
glxvert
(
GLSLShader
::
defines_gl
()
);
std
::
string
glxvert
(
*
GLSLShader
::
DEFINES_GL
);
glxvert
.
append
(
vertexShaderClipText
);
std
::
string
glxfrag
(
GLSLShader
::
defines_gl
()
);
std
::
string
glxfrag
(
*
GLSLShader
::
DEFINES_GL
);
if
(
black_is_transparent
)
glxfrag
.
append
(
"#define BLACK_TRANSPARENCY 1
\n
"
);
glxfrag
.
append
(
fragmentShaderClipText
);
...
...
@@ -65,10 +64,10 @@ ShaderColorPerVertex::ShaderColorPerVertex(bool withClipping, bool black_is_tran
m_nameFS
=
"ShaderColorPerVertex_fs"
;
m_nameGS
=
"ShaderColorPerVertex_gs"
;
std
::
string
glxvert
(
GLSLShader
::
defines_gl
()
);
std
::
string
glxvert
(
*
GLSLShader
::
DEFINES_GL
);
glxvert
.
append
(
vertexShaderText
);
std
::
string
glxfrag
(
GLSLShader
::
defines_gl
()
);
std
::
string
glxfrag
(
*
GLSLShader
::
DEFINES_GL
);
if
(
black_is_transparent
)
glxfrag
.
append
(
"#define BLACK_TRANSPARENCY 1
\n
"
);
glxfrag
.
append
(
fragmentShaderText
);
...
...
@@ -102,7 +101,6 @@ unsigned int ShaderColorPerVertex::setAttributeColor(VBO* vbo)
return
id
;
}
void
ShaderColorPerVertex
::
restoreUniformsAttribs
()
{
bind
();
...
...
@@ -129,8 +127,6 @@ void ShaderColorPerVertex::setClippingPlane(const Geom::Vec4f& plane)
unbind
();
}
}
// namespace Utils
}
// namespace CGoGN
CGoGN/src/Utils/Shaders/shaderSimpleColor.cpp
View file @
d5d75bd3
...
...
@@ -46,10 +46,10 @@ ShaderSimpleColor::ShaderSimpleColor(bool withClipping, bool black_is_transparen
// chose GL defines (2 or 3)
// and compile shaders
std
::
string
glxvert
(
GLSLShader
::
defines_gl
()
);
std
::
string
glxvert
(
*
GLSLShader
::
DEFINES_GL
);
glxvert
.
append
(
vertexShaderClipText
);
std
::
string
glxfrag
(
GLSLShader
::
defines_gl
()
);
std
::
string
glxfrag
(
*
GLSLShader
::
DEFINES_GL
);
if
(
black_is_transparent
)
glxfrag
.
append
(
"#define BLACK_TRANSPARENCY 1
\n
"
);
glxfrag
.
append
(
fragmentShaderClipText
);
...
...
@@ -67,10 +67,10 @@ ShaderSimpleColor::ShaderSimpleColor(bool withClipping, bool black_is_transparen
// chose GL defines (2 or 3)
// and compile shaders
std
::
string
glxvert
(
GLSLShader
::
defines_gl
()
);
std
::
string
glxvert
(
*
GLSLShader
::
DEFINES_GL
);
glxvert
.
append
(
vertexShaderText
);
std
::
string
glxfrag
(
GLSLShader
::
defines_gl
()
);
std
::
string
glxfrag
(
*
GLSLShader
::
DEFINES_GL
);
if
(
black_is_transparent
)
glxfrag
.
append
(
"#define BLACK_TRANSPARENCY 1
\n
"
);
glxfrag
.
append
(
fragmentShaderText
);
...
...
@@ -92,7 +92,6 @@ void ShaderSimpleColor::setColor(const Geom::Vec4f& color)
unbind
();
}
void
ShaderSimpleColor
::
setClippingPlane
(
const
Geom
::
Vec4f
&
plane
)
{
m_planeClip
=
plane
;
...
...
@@ -101,7 +100,6 @@ void ShaderSimpleColor::setClippingPlane(const Geom::Vec4f& plane)
unbind
();
}
unsigned
int
ShaderSimpleColor
::
setAttributePosition
(
VBO
*
vbo
)
{
m_vboPos
=
vbo
;
...
...
CGoGN/src/Utils/shaderMutator.cpp
View file @
d5d75bd3
...
...
@@ -46,6 +46,8 @@ namespace Utils
*
***********************************************/
#ifdef CGOGN_GCC_4_9
ShaderMutator
::
ShaderMutator
(
const
std
::
string
&
shaderName
,
const
std
::
string
&
vertShaderSrc
,
const
std
::
string
&
fragShaderSrc
,
const
std
::
string
&
geomShaderSrc
)
{
...
...
@@ -788,6 +790,106 @@ bool ShaderMutator::srcInsertCodeAtMainFunctionEnd(const std::string& insertedCo
return
true
;
}
#else
ShaderMutator
::
ShaderMutator
(
const
std
::
string
&
/*shaderName*/
,
const
std
::
string
&
/*vertShaderSrc*/
,
const
std
::
string
&
/*fragShaderSrc*/
,
const
std
::
string
&
/*geomShaderSrc*/
)
{
}
bool
ShaderMutator
::
containsVariableDeclaration
(
shaderSrcType
/*srcType*/
,
const
std
::
string
&
/*variableName*/
)
{
bool
result
=
false
;
return
result
;
}
bool
ShaderMutator
::
setMinShadingLanguageVersion
(
shaderSrcType
/*srcType*/
,
int
/*version*/
)
{
bool
result
=
false
;
return
result
;
}
bool
ShaderMutator
::
changeIntConstantValue
(
shaderSrcType
/*srcType*/
,
const
std
::
string
&
/*constantName*/
,
int
/*newVal*/
)
{
return
true
;
}
bool
ShaderMutator
::
changeFloatConstantValue
(
shaderSrcType
/*srcType*/
,
const
std
::
string
&
/*constantName*/
,
float
/*newVal*/
)
{
return
true
;
}
bool
ShaderMutator
::
insertCodeBeforeMainFunction
(
shaderSrcType
/*srcType*/
,
const
std
::
string
&
/*insertedCode*/
)
{
return
true
;
}
bool
ShaderMutator
::
insertCodeAtMainFunctionBeginning
(
shaderSrcType
/*srcType*/
,
const
std
::
string
&
/*insertedCode*/
)
{
return
true
;
}
bool
ShaderMutator
::
insertCodeAtMainFunctionEnd
(
shaderSrcType
/*srcType*/
,
const
std
::
string
&
/*insertedCode*/
)
{
return
true
;
}
/***********************************************
*
* Private Section
*
***********************************************/
bool
ShaderMutator
::
srcIsCommented
(
size_t
/*pos*/
,
const
std
::
string
&
/*src*/
)
{
return
false
;
}
bool
ShaderMutator
::
srcIsOneLineCommented
(
size_t
/*pos*/
,
const
std
::
string
&
/*src*/
)
{
return
false
;
}
bool
ShaderMutator
::
srcContainsVariableDeclaration
(
const
std
::
string
&
/*variableName*/
,
std
::
string
&
/*src*/
)
{
return
false
;
}
bool
ShaderMutator
::
srcSetMinShadingLanguageVersion
(
int
/*version*/
,
std
::
string
&
/*modifiedSrc*/
)
{
return
true
;
}
bool
ShaderMutator
::
srcChangeIntConstantValue
(
int
/*newVal*/
,
const
std
::
string
&
/*constantName*/
,
std
::
string
&
/*modifiedSrc*/
)
{
return
false
;
}
bool
ShaderMutator
::
srcChangeFloatConstantValue
(
float
/*newVal*/
,
const
std
::
string
&
/*constantName*/
,
std
::
string
&
/*modifiedSrc*/
)
{
return
false
;
}
bool
ShaderMutator
::
srcInsertCodeBeforeMainFunction
(
const
std
::
string
&
/*insertedCode*/
,
std
::
string
&
/*modifiedSrc*/
)
{
return
false
;
}
bool
ShaderMutator
::
srcInsertCodeAtMainFunctionBeginning
(
const
std
::
string
&
/*insertedCode*/
,
std
::
string
&
/*modifiedSrc*/
)
{
return
false
;
}
bool
ShaderMutator
::
srcInsertCodeAtMainFunctionEnd
(
const
std
::
string
&
/*insertedCode*/
,
std
::
string
&
/*modifiedSrc*/
)
{
return
true
;
}
#endif
}
// namespace Utils
}
// namespace CGoGN
CMakeLists.txt
View file @
d5d75bd3
...
...
@@ -35,6 +35,12 @@ IF (WIN32)
SET
(
CGoGN_WITH_QTCREATOR OFF CACHE BOOL
"use QtCreator to compile (Experimental"
)
ENDIF
()
IF
(
LINUX
)
SET
(
CGoGN_GCC_4_9 OFF CACHE BOOL
"using gcc version > 4.9 (std::regex ok !)"
)
ENDIF
()
SET
(
BUILD_SHARED_LIBS ON CACHE BOOL
"if used all library are build as shared type (.so/.dylib/.dll)"
)
checkCpp11Support
()
checkCpp11Feature
(
"regex"
HAS_CPP11_REGEX
"False"
)
...
...
@@ -166,12 +172,8 @@ IF(WIN32)
ENDIF
()
IF
(
APPLE
)
LIST
(
APPEND CGoGN_DEFS -DCGOGN_APPLE
)
ENDIF
()
IF
(
HAS_CPP11_REGEX
)
LIST
(
APPEND CGoGN_DEFS -DHAS_CPP11_REGEX
)
IF
(
CGoGN_GCC_4_9
)
LIST
(
APPEND CGoGN_DEFS -DCGOGN_GCC_4_9
)
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