Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Pitiot
CGoGN
Commits
87b0e875
Commit
87b0e875
authored
Feb 21, 2011
by
Kenneth Vanhoey
Browse files
Lightfield decimation improved + visualisation of frames
parent
182790ae
Changes
7
Hide whitespace changes
Inline
Side-by-side
include/Algo/Decimation/lightfieldApproximator.hpp
View file @
87b0e875
...
...
@@ -92,8 +92,6 @@ void Approximator_Frame<PFP>::approximate(Dart d)
assert
(
!
"Approximator_Frame::approximate"
)
;
}
// AutoAttributeHandler<VEC3> normals = this->m_map.template getAttribute<VEC3>(VERTEX_ORBIT, "normals") ;
// this->m_approx[d].getSubVectorH(2,0,normals[d]) ;
}
/************************************************************************************
...
...
@@ -164,8 +162,8 @@ void Approximator_RGBfunctions<PFP>::approximate(Dart d)
assert
(
-
3.15
<
alpha2
&&
alpha2
<=
3.15
)
;
// Create and sum quadrics
(
*
m_quadricRGBfunctions
)[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
d
],
gamma1
,
alpha1
)
;
(
*
m_quadricRGBfunctions
)[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
dd
],
gamma2
,
alpha2
)
;
(
*
m_quadricRGBfunctions
)[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
d
],
gamma1
,
alpha1
)
;
(
*
m_quadricRGBfunctions
)[
d
]
+=
QuadricRGBfunctions
<
REAL
>
(
this
->
m_attrV
[
dd
],
gamma2
,
alpha2
)
;
// Compute new function
if
(
!
(
*
m_quadricRGBfunctions
)[
d
].
findOptimizedRGBfunctions
(
this
->
m_approx
[
d
]))
...
...
include/Algo/Export/export.h
View file @
87b0e875
...
...
@@ -91,7 +91,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
* @return true
*/
template
<
typename
PFP
>
bool
exportPLYPTM
(
typename
PFP
::
MAP
&
map
,
const
char
*
filename
,
const
typename
PFP
::
TVEC3
&
Pos
,
const
typename
PFP
::
T
FRAME
&
Frame
,
const
typename
PFP
::
T
RGBFUNCS
&
RGBfuncs
,
const
FunctorSelect
&
good
=
SelectorTrue
())
;
bool
exportPLYPTM
(
typename
PFP
::
MAP
&
map
,
const
char
*
filename
,
const
typename
PFP
::
TVEC3
&
Pos
,
const
typename
PFP
::
T
MAT33
&
Frame
,
const
typename
PFP
::
T
MAT36
&
RGBfuncs
,
const
FunctorSelect
&
good
=
SelectorTrue
())
;
}
// namespace Export
...
...
include/Algo/Export/export.hpp
View file @
87b0e875
...
...
@@ -256,7 +256,7 @@ bool exportCTM(typename PFP::MAP& the_map, const typename PFP::TVEC3& position,
}
template
<
typename
PFP
>
bool
exportPLYPTM
(
typename
PFP
::
MAP
&
map
,
const
char
*
filename
,
const
typename
PFP
::
TVEC3
&
Pos
,
const
typename
PFP
::
T
FRAME
&
Frame
,
const
typename
PFP
::
T
RGBFUNCS
&
RGBfuncs
,
const
FunctorSelect
&
good
)
bool
exportPLYPTM
(
typename
PFP
::
MAP
&
map
,
const
char
*
filename
,
const
typename
PFP
::
TVEC3
&
Pos
,
const
typename
PFP
::
T
MAT33
&
Frame
,
const
typename
PFP
::
T
MAT36
&
RGBfuncs
,
const
FunctorSelect
&
good
)
{
typedef
typename
PFP
::
MAP
MAP
;
typedef
typename
PFP
::
VEC3
VEC3
;
...
...
include/Algo/Render/map_glRender.h
View file @
87b0e875
...
...
@@ -65,11 +65,14 @@ template <typename PFP>
void
renderTriQuadPoly
(
typename
PFP
::
MAP
&
the_map
,
RenderType
rt
,
float
explode
,
const
typename
PFP
::
TVEC3
&
position
,
const
typename
PFP
::
TVEC3
&
normal
,
const
typename
PFP
::
TVEC3
&
color
,
const
FunctorSelect
&
good
=
SelectorTrue
());
template
<
typename
PFP
>
void
renderNormalVertices
(
typename
PFP
::
MAP
&
the_map
,
const
typename
PFP
::
TVEC3
&
position
,
const
typename
PFP
::
TVEC3
&
normal
,
float
scale
,
const
FunctorSelect
&
good
=
SelectorTrue
());
template
<
typename
PFP
>
void
renderFrameVertices
(
typename
PFP
::
MAP
&
the_map
,
const
typename
PFP
::
TVEC3
&
position
,
const
typename
PFP
::
TMAT33
&
frames
,
float
scale
,
const
FunctorSelect
&
good
=
SelectorTrue
());
}
// namespace Direct
}
// namespace Render
...
...
include/Algo/Render/map_glRender.hpp
View file @
87b0e875
...
...
@@ -182,6 +182,18 @@ void renderNormalVertices(typename PFP::MAP& the_map, const typename PFP::TVEC3&
glEnd
();
}
template
<
typename
PFP
>
void
renderFrameVertices
(
typename
PFP
::
MAP
&
the_map
,
const
typename
PFP
::
TVEC3
&
position
,
const
typename
PFP
::
TMAT33
&
frame
,
float
scale
,
const
FunctorSelect
&
good
)
{
FunctorGLFrame
<
PFP
>
fgl_frame
(
the_map
,
good
,
position
,
frame
,
scale
)
;
glBegin
(
GL_LINES
)
;
the_map
.
foreach_orbit
(
VERTEX_ORBIT
,
fgl_frame
,
good
)
;
glEnd
();
}
}
// namespace Direct
}
// namespace Render
...
...
include/Algo/Render/renderFunctor.h
View file @
87b0e875
...
...
@@ -210,8 +210,8 @@ template<typename PFP>
class
FunctorGLNormal
:
public
CGoGN
::
FunctorMap
<
typename
PFP
::
MAP
>
{
typedef
typename
PFP
::
MAP
MAP
;
protected:
/**
* positions of vertices
...
...
@@ -240,6 +240,43 @@ public:
bool
operator
()
(
Dart
d
);
};
template
<
typename
PFP
>
class
FunctorGLFrame
:
public
CGoGN
::
FunctorMap
<
typename
PFP
::
MAP
>
{
typedef
typename
PFP
::
MAP
MAP
;
protected:
/**
* positions of vertices
*/
const
typename
PFP
::
TVEC3
&
m_positions
;
/**
* frame of vertices
*/
const
typename
PFP
::
TMAT33
&
m_frames
;
/**
* Dart selector to restrict the rendering
*/
const
FunctorSelect
&
m_selector
;
float
m_scale
;
public:
/**
* @param good dart selector
*/
FunctorGLFrame
(
MAP
&
map
,
const
FunctorSelect
&
good
,
const
typename
PFP
::
TVEC3
&
posi
,
const
typename
PFP
::
TMAT33
&
frames
,
float
scale
);
bool
operator
()
(
Dart
d
);
};
}
// namespace Direct
}
// namespace Render
...
...
include/Algo/Render/renderFunctor.hpp
View file @
87b0e875
...
...
@@ -361,8 +361,33 @@ bool FunctorGLNormal<PFP>::operator() (Dart d)
return
false
;
}
template
<
typename
PFP
>
FunctorGLFrame
<
PFP
>::
FunctorGLFrame
(
MAP
&
map
,
const
FunctorSelect
&
good
,
const
typename
PFP
::
TVEC3
&
posi
,
const
typename
PFP
::
TMAT33
&
frames
,
float
scale
)
:
FunctorMap
<
MAP
>
(
map
),
m_positions
(
posi
),
m_frames
(
frames
),
m_selector
(
good
),
m_scale
(
scale
)
{
}
template
<
typename
PFP
>
bool
FunctorGLFrame
<
PFP
>::
operator
()
(
Dart
d
)
{
if
(
m_selector
(
d
))
{
typename
PFP
::
VEC3
p
=
m_positions
[
d
]
;
for
(
unsigned
int
i
=
0
;
i
<
3
;
++
i
)
{
glVertex3fv
(
p
.
data
());
typename
PFP
::
VEC3
q
,
vec
;
m_frames
[
d
].
getSubVectorH
(
i
,
0
,
vec
)
;
q
=
p
;
q
+=
m_scale
*
vec
;
glVertex3fv
(
q
.
data
());
}
}
return
false
;
}
template
<
typename
PFP
>
FunctorGLFaceColor
<
PFP
>::
FunctorGLFaceColor
(
MAP
&
map
,
bool
lighted
,
bool
smooth
,
int
nbe
,
float
expl
,
bool
stor
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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