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
391cf7b0
Commit
391cf7b0
authored
Apr 13, 2016
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix schnapps selection with double
parent
6c2a7b92
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
60 deletions
+43
-60
CGoGN/include/Container/attributeMultiVector.hpp
CGoGN/include/Container/attributeMultiVector.hpp
+1
-1
CGoGN/include/Utils/vbo.hpp
CGoGN/include/Utils/vbo.hpp
+24
-5
CGoGN/include/Utils/vbo_base.h
CGoGN/include/Utils/vbo_base.h
+3
-1
CGoGN/src/Utils/GLSLShader.cpp
CGoGN/src/Utils/GLSLShader.cpp
+1
-37
README.md
README.md
+1
-4
SCHNApps/Plugins/CMakeLists.txt
SCHNApps/Plugins/CMakeLists.txt
+3
-2
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
+5
-5
SCHNApps/Plugins/surface_selection/src/surface_selection_dockTab.cpp
...ugins/surface_selection/src/surface_selection_dockTab.cpp
+4
-4
SCHNApps/src/view.cpp
SCHNApps/src/view.cpp
+1
-1
No files found.
CGoGN/include/Container/attributeMultiVector.hpp
View file @
391cf7b0
...
...
@@ -191,7 +191,7 @@ bool AttributeMultiVector<T>::copy(const AttributeMultiVectorGen* atmvg)
}
for
(
unsigned
int
i
=
0
;
i
<
atmv
->
m_tableData
.
size
();
++
i
)
std
::
memcpy
(
m_tableData
[
i
],
atmv
->
m_tableData
[
i
],
_BLOCKSIZE_
*
sizeof
(
T
));
std
::
memcpy
(
(
void
*
)
m_tableData
[
i
],
(
void
*
)
atmv
->
m_tableData
[
i
],
_BLOCKSIZE_
*
sizeof
(
T
));
return
true
;
}
...
...
CGoGN/include/Utils/vbo.hpp
View file @
391cf7b0
...
...
@@ -28,23 +28,42 @@ namespace CGoGN
namespace
Utils
{
template
<
typename
T
>
template
<
unsigned
int
VEC_DIM
,
typename
T
>
void
VBO
::
updateData
(
std
::
vector
<
T
>&
data
)
{
if
(
m_lock
)
{
CGoGNerr
<<
"Error locked VBO"
<<
CGoGNendl
;
CGoGNerr
<<
"
VBO::updateData :
Error locked VBO"
<<
CGoGNendl
;
return
;
}
if
(
data
.
empty
())
return
;
m_data_size
=
sizeof
(
T
)
/
sizeof
(
float
)
;
m_data_size
=
VEC_DIM
;
m_nbElts
=
uint32
(
data
.
size
());
glBindBuffer
(
GL_ARRAY_BUFFER
,
*
m_id
);
glBufferData
(
GL_ARRAY_BUFFER
,
m_nbElts
*
sizeof
(
T
),
&
(
data
[
0
]),
GL_STREAM_DRAW
);
if
(
sizeof
(
T
)
/
sizeof
(
double
)
==
VEC_DIM
)
{
unsigned
int
nbf
=
m_nbElts
*
m_data_size
;
float
*
buffer
=
new
float
[
nbf
];
float
*
ptr_out
=
buffer
;
double
*
ptr_in
=
reinterpret_cast
<
double
*>
(
&
(
data
[
0
]));
for
(
unsigned
int
i
=
0
;
i
<
nbf
;
++
i
)
*
ptr_out
++
=
float
(
*
ptr_in
++
);
glBufferData
(
GL_ARRAY_BUFFER
,
nbf
*
sizeof
(
float
),
buffer
,
GL_STREAM_DRAW
);
delete
[]
buffer
;
return
;
}
if
(
sizeof
(
T
)
/
sizeof
(
float
)
==
VEC_DIM
)
{
glBufferData
(
GL_ARRAY_BUFFER
,
m_nbElts
*
VEC_DIM
*
sizeof
(
float
),
&
(
data
[
0
]),
GL_STREAM_DRAW
);
return
;
}
// we should normally never reach this code
CGoGNerr
<<
"VBO::updateData : Error only float, double, VecXf, VecXd"
<<
CGoGNendl
;
}
}
// namespace Utils
...
...
CGoGN/include/Utils/vbo_base.h
View file @
391cf7b0
...
...
@@ -142,8 +142,10 @@ public:
/**
* update data from given data vector
* @warning use only with include vbo.h (not vbo_base.h)
* @tparam VEC_DIM dim of vec (1,2,3 or 4)
* @param data a vector of float/VecXf or double/VecXd
*/
template
<
typename
T
>
template
<
unsigned
int
VEC_DIM
,
typename
T
>
void
updateData
(
std
::
vector
<
T
>&
data
);
void
*
lockPtr
();
...
...
CGoGN/src/Utils/GLSLShader.cpp
View file @
391cf7b0
...
...
@@ -39,43 +39,7 @@ namespace CGoGN
namespace
Utils
{
//#ifdef CGOGN_USE_OGL_CORE_PROFILE
//unsigned int GLSLShader::CURRENT_OGL_VERSION = 3;
//unsigned int GLSLShader::MAJOR_OGL_CORE = 3;
//unsigned int GLSLShader::MINOR_OGL_CORE = 3;
//#else
//unsigned int GLSLShader::CURRENT_OGL_VERSION = 2;
//unsigned int GLSLShader::MAJOR_OGL_CORE = 2;
//unsigned int GLSLShader::MINOR_OGL_CORE = 1;
//#endif
//std::string GLSLShader::DEFINES_GL2=\
//"#version 110\n"
//"#define PRECISION float pipo_PRECISION\n"
//"#define ATTRIBUTE attribute\n"
//"#define VARYING_VERT varying\n"
//"#define VARYING_FRAG varying\n"
//"#define FRAG_OUT_DEF float pipo_FRAGDEF\n"
//"#define FRAG_OUT gl_FragColor\n"
//"#define INVARIANT_POS float pipo_INVARIANT\n"
//"#define TEXTURE2D texture2D\n";
//std::string GLSLShader::DEFINES_GL3=\
//"#version 150\n"
//"#define PRECISION precision highp float\n"
//"#define ATTRIBUTE in\n"
//"#define VARYING_VERT out\n"
//"#define VARYING_FRAG in\n"
//"#define FRAG_OUT_DEF out vec4 outFragColor\n"
//"#define FRAG_OUT outFragColor\n"
//"#define INVARIANT_POS invariant gl_Position\n"
//"#define TEXTURE2D texture\n";
//std::string* GLSLShader::DEFINES_GL = NULL;
std
::
vector
<
std
::
string
>
GLSLShader
::
m_pathes
;
...
...
README.md
View file @
391cf7b0
...
...
@@ -78,10 +78,7 @@ 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/dependencies.txt
*
http://cgogn.unistra.fr/Dependencies/windows_dependencies32.zip
*
http://cgogn.unistra.fr/Dependencies/windows_dependencies64.zip
*
Other Windows dependencies are furnished at: http://cgogn.unistra.fr/download
**Supported compilers: Visual C++ 2013 (12.0) or greater**
...
...
SCHNApps/Plugins/CMakeLists.txt
View file @
391cf7b0
...
...
@@ -24,11 +24,12 @@ ADD_SUBDIRECTORY(surface_subdivision)
ADD_SUBDIRECTORY
(
surface_selection
)
ADD_SUBDIRECTORY
(
surface_deformation
)
ADD_SUBDIRECTORY
(
surface_modelisation
)
ADD_SUBDIRECTORY
(
surface_radiance
)
ADD_SUBDIRECTORY
(
surface_distance
)
ADD_SUBDIRECTORY
(
volume_import
)
#ADD_SUBDIRECTORY(surface_tilings)
#ADD_SUBDIRECTORY(surface_radiance)
#ADD_SUBDIRECTORY(cage2D_deformation)
#ADD_SUBDIRECTORY(cage3D_deformation)
...
...
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
View file @
391cf7b0
...
...
@@ -110,7 +110,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
CellSelectorGen
*
selector
=
m_schnapps
->
getSelectedSelector
(
orbit
);
if
(
selector
)
{
unsigned
int
nbCells
=
map
->
getGenericMap
()
->
getNbCells
(
orbit
);
//
unsigned int nbCells = map->getGenericMap()->getNbCells(orbit);
switch
(
orbit
)
{
case
VERTEX
:
{
...
...
@@ -132,7 +132,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
{
std
::
vector
<
PFP2
::
VEC3
>
selectionPoint
;
selectionPoint
.
push_back
(
p
.
positionAttribute
[
m_selectingVertex
]);
m_selectionSphereVBO
->
updateData
(
selectionPoint
);
m_selectionSphereVBO
->
updateData
<
3
>
(
selectionPoint
);
m_pointSprite
->
setAttributePosition
(
m_selectionSphereVBO
);
m_pointSprite
->
setColor
(
CGoGN
::
Geom
::
Vec4f
(
0.0
f
,
0.0
f
,
1.0
f
,
0.5
f
));
m_pointSprite
->
setLightPosition
(
CGoGN
::
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
));
...
...
@@ -184,7 +184,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
// PFP2::MAP* m = static_cast<MapHandler<PFP2>*>(map)->getMap();
std
::
vector
<
PFP2
::
VEC3
>
selectionPoint
;
selectionPoint
.
push_back
(
p
.
positionAttribute
[
m_selectingEdge
.
dart
]);
m_selectionSphereVBO
->
updateData
(
selectionPoint
);
m_selectionSphereVBO
->
updateData
<
3
>
(
selectionPoint
);
m_pointSprite
->
setAttributePosition
(
m_selectionSphereVBO
);
m_pointSprite
->
setColor
(
CGoGN
::
Geom
::
Vec4f
(
0.0
f
,
0.0
f
,
1.0
f
,
0.5
f
));
...
...
@@ -237,7 +237,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
std
::
vector
<
PFP2
::
VEC3
>
selectionPoint
;
selectionPoint
.
push_back
(
p
.
positionAttribute
[
m_selectingFace
.
dart
]);
m_selectionSphereVBO
->
updateData
(
selectionPoint
);
m_selectionSphereVBO
->
updateData
<
3
>
(
selectionPoint
);
m_pointSprite
->
setAttributePosition
(
m_selectionSphereVBO
);
m_pointSprite
->
setColor
(
CGoGN
::
Geom
::
Vec4f
(
0.0
f
,
0.0
f
,
1.0
f
,
0.5
f
));
...
...
@@ -561,7 +561,7 @@ void Surface_Selection_Plugin::updateSelectedCellsRendering()
std
::
vector
<
PFP2
::
VEC3
>
selectedPoints
;
for
(
std
::
vector
<
Vertex
>::
const_iterator
v
=
selectedCells
.
begin
();
v
!=
selectedCells
.
end
();
++
v
)
selectedPoints
.
push_back
(
p
.
positionAttribute
[
*
v
]);
m_selectedVerticesVBO
->
updateData
(
selectedPoints
);
m_selectedVerticesVBO
->
updateData
<
3
>
(
selectedPoints
);
m_selectedVertices_dirty
=
false
;
break
;
}
...
...
SCHNApps/Plugins/surface_selection/src/surface_selection_dockTab.cpp
View file @
391cf7b0
...
...
@@ -178,11 +178,11 @@ void Surface_Selection_DockTab::clearPressed()
{
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
unsigned
int
orbit
=
m_schnapps
->
getCurrentOrbit
();
if
(
map
)
CellSelectorGen
*
sel
=
m_schnapps
->
getSelectedSelector
(
orbit
);
if
(
map
&&
sel
)
{
m_plugin
->
clearSelection
(
map
->
getName
(),
orbit
,
m_schnapps
->
getSelectedSelector
(
orbit
)
->
getName
());
m_plugin
->
pythonRecording
(
"clearSelection"
,
""
,
map
->
getName
(),
orbit
,
m_schnapps
->
getSelectedSelector
(
orbit
)
->
getName
());
m_plugin
->
clearSelection
(
map
->
getName
(),
orbit
,
sel
->
getName
());
m_plugin
->
pythonRecording
(
"clearSelection"
,
""
,
map
->
getName
(),
orbit
,
sel
->
getName
());
}
}
}
...
...
SCHNApps/src/view.cpp
View file @
391cf7b0
...
...
@@ -329,7 +329,7 @@ void View::init()
std
::
cout
<<
"using "
<<
glGetString
(
GL_VERSION
)
<<
std
::
endl
;
qglviewer
::
Camera
*
c
=
this
->
camera
();
//
qglviewer::Camera* c = this->camera();
this
->
setCamera
(
m_currentCamera
);
// delete c;
...
...
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