Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Type-OpenVolumeMesh
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenFlipper-Free
Type-OpenVolumeMesh
Compare Revisions
master...fixOVMPicking
Source
fixOVMPicking
Select Git revision
...
Target
master
Select Git revision
Compare
Commits (1)
only make deprecated opengl calls in compatibility profiles
· e9ca0423
Martin Schultz
authored
Mar 28, 2018
e9ca0423
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
61 deletions
+86
-61
ObjectTypes/VolumeMeshObject/VolumeMeshNodeT.cc
ObjectTypes/VolumeMeshObject/VolumeMeshNodeT.cc
+86
-61
No files found.
ObjectTypes/VolumeMeshObject/VolumeMeshNodeT.cc
View file @
e9ca0423
...
...
@@ -1216,25 +1216,28 @@ void VolumeMeshNodeT<VolumeMeshT>::pick(GLState& _state, PickTarget _target) {
lastPickTarget_
=
_target
;
// restore state
if
(
clientStateEnabledVertexArray
)
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
else
GLState
::
disableClientState
(
GL_VERTEX_ARRAY
);
if
(
clientStateEnabledColorArray
)
GLState
::
enableClientState
(
GL_COLOR_ARRAY
);
else
GLState
::
disableClientState
(
GL_COLOR_ARRAY
);
if
(
clientStateEnabledNormalArray
)
GLState
::
enableClientState
(
GL_NORMAL_ARRAY
);
else
GLState
::
disableClientState
(
GL_NORMAL_ARRAY
);
if
(
clientStateEnabledTexCoordArray
)
GLState
::
enableClientState
(
GL_TEXTURE_COORD_ARRAY
);
else
GLState
::
disableClientState
(
GL_TEXTURE_COORD_ARRAY
);
if
(
_state
.
compatibilityProfile
())
{
if
(
clientStateEnabledVertexArray
)
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
else
GLState
::
disableClientState
(
GL_VERTEX_ARRAY
);
if
(
clientStateEnabledColorArray
)
GLState
::
enableClientState
(
GL_COLOR_ARRAY
);
else
GLState
::
disableClientState
(
GL_COLOR_ARRAY
);
if
(
clientStateEnabledNormalArray
)
GLState
::
enableClientState
(
GL_NORMAL_ARRAY
);
else
GLState
::
disableClientState
(
GL_NORMAL_ARRAY
);
if
(
clientStateEnabledTexCoordArray
)
GLState
::
enableClientState
(
GL_TEXTURE_COORD_ARRAY
);
else
GLState
::
disableClientState
(
GL_TEXTURE_COORD_ARRAY
);
}
}
...
...
@@ -1278,15 +1281,17 @@ void VolumeMeshNodeT<VolumeMeshT>::pickVertices(GLState& _state) {
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
vertexPickBufferManager_
.
getPickBuffer
(
_state
,
0
));
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
GLState
::
vertexPointer
(
3
,
GL_FLOAT
,
vertexPickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
0
));
GLState
::
enableClientState
(
GL_COLOR_ARRAY
);
GLState
::
colorPointer
(
4
,
GL_UNSIGNED_BYTE
,
vertexPickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
vertexPickBufferManager_
.
getColorOffset
()));
GLState
::
shadeModel
(
GL_SMOOTH
);
GLState
::
disable
(
GL_LIGHTING
);
if
(
_state
.
compatibilityProfile
())
{
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
GLState
::
vertexPointer
(
3
,
GL_FLOAT
,
vertexPickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
0
));
GLState
::
enableClientState
(
GL_COLOR_ARRAY
);
GLState
::
colorPointer
(
4
,
GL_UNSIGNED_BYTE
,
vertexPickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
vertexPickBufferManager_
.
getColorOffset
()));
GLState
::
shadeModel
(
GL_SMOOTH
);
GLState
::
disable
(
GL_LIGHTING
);
}
float
oldPointSize
=
_state
.
point_size
();
_state
.
set_point_size
(
1.5
*
_state
.
point_size
());
...
...
@@ -1294,8 +1299,11 @@ void VolumeMeshNodeT<VolumeMeshT>::pickVertices(GLState& _state) {
_state
.
set_point_size
(
oldPointSize
);
GLState
::
disableClientState
(
GL_COLOR_ARRAY
);
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
0
);
if
(
_state
.
compatibilityProfile
())
{
GLState
::
disableClientState
(
GL_COLOR_ARRAY
);
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
0
);
}
}
...
...
@@ -1315,14 +1323,17 @@ void VolumeMeshNodeT<VolumeMeshT>::pickEdges(GLState& _state, unsigned int _offs
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
edgePickBufferManager_
.
getPickBuffer
(
_state
,
_offset
));
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
GLState
::
vertexPointer
(
3
,
GL_FLOAT
,
edgePickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
0
));
GLState
::
enableClientState
(
GL_COLOR_ARRAY
);
GLState
::
colorPointer
(
4
,
GL_UNSIGNED_BYTE
,
edgePickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
edgePickBufferManager_
.
getColorOffset
()));
GLState
::
shadeModel
(
GL_SMOOTH
);
GLState
::
disable
(
GL_LIGHTING
);
if
(
_state
.
compatibilityProfile
())
{
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
GLState
::
vertexPointer
(
3
,
GL_FLOAT
,
edgePickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
0
));
GLState
::
enableClientState
(
GL_COLOR_ARRAY
);
GLState
::
colorPointer
(
4
,
GL_UNSIGNED_BYTE
,
edgePickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
edgePickBufferManager_
.
getColorOffset
()));
GLState
::
shadeModel
(
GL_SMOOTH
);
GLState
::
disable
(
GL_LIGHTING
);
}
float
oldLineWidth
=
_state
.
line_width
();
_state
.
set_line_width
(
4.0
*
_state
.
line_width
());
...
...
@@ -1331,8 +1342,11 @@ void VolumeMeshNodeT<VolumeMeshT>::pickEdges(GLState& _state, unsigned int _offs
_state
.
set_line_width
(
oldLineWidth
);
GLState
::
disableClientState
(
GL_COLOR_ARRAY
);
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
0
);
if
(
_state
.
compatibilityProfile
())
{
GLState
::
disableClientState
(
GL_COLOR_ARRAY
);
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
0
);
}
}
...
...
@@ -1354,19 +1368,24 @@ void VolumeMeshNodeT<VolumeMeshT>::pickFaces(GLState& _state, unsigned int _offs
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
facePickBufferManager_
.
getPickBuffer
(
_state
,
_offset
));
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
GLState
::
vertexPointer
(
3
,
GL_FLOAT
,
facePickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
0
));
GLState
::
enableClientState
(
GL_COLOR_ARRAY
);
GLState
::
colorPointer
(
4
,
GL_UNSIGNED_BYTE
,
facePickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
facePickBufferManager_
.
getColorOffset
()));
GLState
::
shadeModel
(
GL_SMOOTH
);
GLState
::
disable
(
GL_LIGHTING
);
if
(
_state
.
compatibilityProfile
())
{
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
GLState
::
vertexPointer
(
3
,
GL_FLOAT
,
facePickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
0
));
GLState
::
enableClientState
(
GL_COLOR_ARRAY
);
GLState
::
colorPointer
(
4
,
GL_UNSIGNED_BYTE
,
facePickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
facePickBufferManager_
.
getColorOffset
()));
GLState
::
shadeModel
(
GL_SMOOTH
);
GLState
::
disable
(
GL_LIGHTING
);
}
glDrawArrays
(
GL_TRIANGLES
,
0
,
facePickBufferManager_
.
getNumOfVertices
());
GLState
::
disableClientState
(
GL_COLOR_ARRAY
);
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
0
);
if
(
_state
.
compatibilityProfile
())
{
GLState
::
disableClientState
(
GL_COLOR_ARRAY
);
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
0
);
}
}
//----------------------------------------------------------------------------
...
...
@@ -1381,19 +1400,25 @@ void VolumeMeshNodeT<VolumeMeshT>::pickCells(GLState& _state, unsigned int _offs
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
cellPickBufferManager_
.
getPickBuffer
(
_state
,
_offset
));
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
GLState
::
vertexPointer
(
3
,
GL_FLOAT
,
cellPickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
0
));
GLState
::
enableClientState
(
GL_COLOR_ARRAY
);
GLState
::
colorPointer
(
4
,
GL_UNSIGNED_BYTE
,
cellPickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
cellPickBufferManager_
.
getColorOffset
()));
GLState
::
shadeModel
(
GL_SMOOTH
);
GLState
::
disable
(
GL_LIGHTING
);
if
(
_state
.
compatibilityProfile
())
{
GLState
::
enableClientState
(
GL_VERTEX_ARRAY
);
GLState
::
vertexPointer
(
3
,
GL_FLOAT
,
cellPickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
0
));
GLState
::
enableClientState
(
GL_COLOR_ARRAY
);
GLState
::
colorPointer
(
4
,
GL_UNSIGNED_BYTE
,
cellPickBufferManager_
.
getStride
(),
reinterpret_cast
<
GLvoid
*>
(
cellPickBufferManager_
.
getColorOffset
()));
GLState
::
shadeModel
(
GL_SMOOTH
);
GLState
::
disable
(
GL_LIGHTING
);
}
glDrawArrays
(
GL_TRIANGLES
,
0
,
cellPickBufferManager_
.
getNumOfVertices
());
GLState
::
disableClientState
(
GL_COLOR_ARRAY
);
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
0
);
if
(
_state
.
compatibilityProfile
())
{
GLState
::
disableClientState
(
GL_COLOR_ARRAY
);
GLState
::
bindBuffer
(
GL_ARRAY_BUFFER
,
0
);
}
}
//----------------------------------------------------------------------------
...
...