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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Pitiot
CGoGN
Commits
7bbd4da3
Commit
7bbd4da3
authored
Jun 06, 2013
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
render topo3 primal final
parent
745e55e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
40 deletions
+65
-40
include/Algo/Render/GL2/topo3PrimalRender.h
include/Algo/Render/GL2/topo3PrimalRender.h
+7
-0
include/Algo/Render/GL2/topo3PrimalRender.hpp
include/Algo/Render/GL2/topo3PrimalRender.hpp
+51
-39
src/Algo/Render/topo3PrimalRender.cpp
src/Algo/Render/topo3PrimalRender.cpp
+7
-1
No files found.
include/Algo/Render/GL2/topo3PrimalRender.h
View file @
7bbd4da3
...
@@ -106,6 +106,11 @@ protected:
...
@@ -106,6 +106,11 @@ protected:
*/
*/
Geom
::
Vec3f
m_dartsColor
;
Geom
::
Vec3f
m_dartsColor
;
/**
* initial darts color for boundary (set in update)
*/
Geom
::
Vec3f
m_boundaryDartsColor
;
/**
/**
* attribute index to get easy correspondence dart/color
* attribute index to get easy correspondence dart/color
*/
*/
...
@@ -203,6 +208,8 @@ public:
...
@@ -203,6 +208,8 @@ public:
*/
*/
void
setInitialDartsColor
(
float
r
,
float
g
,
float
b
);
void
setInitialDartsColor
(
float
r
,
float
g
,
float
b
);
void
setInitialBoundaryDartsColor
(
float
r
,
float
g
,
float
b
);
/**
/**
* overdraw a dart with given width and color
* overdraw a dart with given width and color
* @param d the dart
* @param d the dart
...
...
include/Algo/Render/GL2/topo3PrimalRender.hpp
View file @
7bbd4da3
...
@@ -56,27 +56,24 @@ void Topo3PrimalRender::setDartsIdColor(typename PFP::MAP& map)
...
@@ -56,27 +56,24 @@ void Topo3PrimalRender::setDartsIdColor(typename PFP::MAP& map)
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
{
if
(
!
map
.
isBoundaryMarked3
(
d
))
// topo3 Render do not traverse boundary
if
(
nb
<
m_nbDarts
)
{
{
if
(
nb
<
m_nbDarts
)
float
r
,
g
,
b
;
{
dartToCol
(
d
,
r
,
g
,
b
);
float
r
,
g
,
b
;
dartToCol
(
d
,
r
,
g
,
b
);
float
*
local
=
colorBuffer
+
3
*
m_attIndex
[
d
];
// get the right position in VBO
*
local
++
=
r
;
float
*
local
=
colorBuffer
+
3
*
m_attIndex
[
d
];
// get the right position in VBO
*
local
++
=
g
;
*
local
++
=
r
;
*
local
++
=
b
;
*
local
++
=
g
;
*
local
++
=
r
;
*
local
++
=
b
;
*
local
++
=
g
;
*
local
++
=
r
;
*
local
++
=
b
;
*
local
++
=
g
;
nb
++
;
*
local
++
=
b
;
}
nb
++
;
else
}
{
else
CGoGNerr
<<
"Error buffer too small for color picking (change the selector parameter ?)"
<<
CGoGNendl
;
{
break
;
CGoGNerr
<<
"Error buffer too small for color picking (change the selector parameter ?)"
<<
CGoGNendl
;
break
;
}
}
}
}
}
glUnmapBuffer
(
GL_ARRAY_BUFFER
);
glUnmapBuffer
(
GL_ARRAY_BUFFER
);
...
@@ -91,18 +88,15 @@ void Topo3PrimalRender::updateColors(typename PFP::MAP& map, const VertexAttribu
...
@@ -91,18 +88,15 @@ void Topo3PrimalRender::updateColors(typename PFP::MAP& map, const VertexAttribu
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
{
if
(
!
map
.
isBoundaryMarked3
(
d
))
// topo3 Render do not traverse boundary
if
(
nb
<
m_nbDarts
)
{
{
if
(
nb
<
m_nbDarts
)
colorBuffer
[
m_attIndex
[
d
]]
=
colors
[
d
];
{
nb
++
;
colorBuffer
[
m_attIndex
[
d
]]
=
colors
[
d
];
}
nb
++
;
else
}
{
else
CGoGNerr
<<
"Error buffer too small for color picking (change the selector parameter ?)"
<<
CGoGNendl
;
{
break
;
CGoGNerr
<<
"Error buffer too small for color picking (change the selector parameter ?)"
<<
CGoGNendl
;
break
;
}
}
}
}
}
glUnmapBuffer
(
GL_ARRAY_BUFFER
);
glUnmapBuffer
(
GL_ARRAY_BUFFER
);
...
@@ -198,22 +192,40 @@ void Topo3PrimalRender::updateData(typename PFP::MAP& mapx, const VertexAttribut
...
@@ -198,22 +192,40 @@ void Topo3PrimalRender::updateData(typename PFP::MAP& mapx, const VertexAttribut
*
positionDartBuf
++
=
P
;
*
positionDartBuf
++
=
P
;
*
positionDartBuf
++
=
PP
;
*
positionDartBuf
++
=
PP
;
*
positionDartBuf
++
=
Q
;
if
(
map
.
isBoundaryMarked3
(
d
))
*
positionDartBuf
++
=
QQ
;
{
*
colorDartBuf
++
=
m_dartsColor
;
*
colorDartBuf
++
=
m_boundaryDartsColor
;
*
colorDartBuf
++
=
m_dartsColor
;
*
colorDartBuf
++
=
m_boundaryDartsColor
;
*
colorDartBuf
++
=
m_dartsColor
;
}
*
colorDartBuf
++
=
m_dartsColor
;
else
{
*
colorDartBuf
++
=
m_dartsColor
;
*
colorDartBuf
++
=
m_dartsColor
;
}
m_attIndex
[
d
]
=
posDBI
;
m_attIndex
[
d
]
=
posDBI
;
posDBI
+=
2
;
posDBI
+=
2
;
fv2
[
d
]
=
(
P
+
PP
)
*
0.5
f
;
fv2
[
d
]
=
(
P
+
PP
)
*
0.5
f
;
*
positionDartBuf
++
=
Q
;
*
positionDartBuf
++
=
QQ
;
Dart
dx
=
map
.
phi3
(
d
);
Dart
dx
=
map
.
phi3
(
d
);
fv2
[
dx
]
=
(
Q
+
QQ
)
*
0.5
f
;
if
(
map
.
isBoundaryMarked3
(
dx
))
{
*
colorDartBuf
++
=
m_boundaryDartsColor
;
*
colorDartBuf
++
=
m_boundaryDartsColor
;
}
else
{
*
colorDartBuf
++
=
m_dartsColor
;
*
colorDartBuf
++
=
m_dartsColor
;
}
m_attIndex
[
dx
]
=
posDBI
;
m_attIndex
[
dx
]
=
posDBI
;
posDBI
+=
2
;
posDBI
+=
2
;
fv2
[
dx
]
=
(
Q
+
QQ
)
*
0.5
f
;
d
=
mapx
.
phi1
(
d
);
d
=
mapx
.
phi1
(
d
);
}
}
...
...
src/Algo/Render/topo3PrimalRender.cpp
View file @
7bbd4da3
...
@@ -48,6 +48,7 @@ Topo3PrimalRender::Topo3PrimalRender():
...
@@ -48,6 +48,7 @@ Topo3PrimalRender::Topo3PrimalRender():
m_topo_relation_width
(
3.0
f
),
m_topo_relation_width
(
3.0
f
),
m_color_save
(
NULL
),
m_color_save
(
NULL
),
m_dartsColor
(
1.0
f
,
1.0
f
,
1.0
f
),
m_dartsColor
(
1.0
f
,
1.0
f
,
1.0
f
),
m_boundaryDartsColor
(
0.5
f
,
0.5
f
,
0.5
f
),
m_bufferDartPosition
(
NULL
)
m_bufferDartPosition
(
NULL
)
{
{
m_vbo0
=
new
Utils
::
VBO
();
m_vbo0
=
new
Utils
::
VBO
();
...
@@ -127,7 +128,6 @@ void Topo3PrimalRender::setAllDartsColor(float r, float g, float b)
...
@@ -127,7 +128,6 @@ void Topo3PrimalRender::setAllDartsColor(float r, float g, float b)
*
colorDartBuf
++
=
b
;
*
colorDartBuf
++
=
b
;
}
}
glUnmapBufferARB
(
GL_ARRAY_BUFFER
);
glUnmapBufferARB
(
GL_ARRAY_BUFFER
);
}
}
void
Topo3PrimalRender
::
setInitialDartsColor
(
float
r
,
float
g
,
float
b
)
void
Topo3PrimalRender
::
setInitialDartsColor
(
float
r
,
float
g
,
float
b
)
...
@@ -135,6 +135,12 @@ void Topo3PrimalRender::setInitialDartsColor(float r, float g, float b)
...
@@ -135,6 +135,12 @@ void Topo3PrimalRender::setInitialDartsColor(float r, float g, float b)
m_dartsColor
=
Geom
::
Vec3f
(
r
,
g
,
b
);
m_dartsColor
=
Geom
::
Vec3f
(
r
,
g
,
b
);
}
}
void
Topo3PrimalRender
::
setInitialBoundaryDartsColor
(
float
r
,
float
g
,
float
b
)
{
m_boundaryDartsColor
=
Geom
::
Vec3f
(
r
,
g
,
b
);
}
void
Topo3PrimalRender
::
drawDarts
()
void
Topo3PrimalRender
::
drawDarts
()
{
{
if
(
m_nbDarts
==
0
)
if
(
m_nbDarts
==
0
)
...
...
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