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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
8167cd1c
Commit
8167cd1c
authored
Apr 01, 2015
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fixes
parent
c165b337
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
124 additions
and
93 deletions
+124
-93
CGoGN/include/Geometry/bounding_box.h
CGoGN/include/Geometry/bounding_box.h
+60
-60
SCHNApps/Plugins/surface_radiance/src/surface_radiance.cpp
SCHNApps/Plugins/surface_radiance/src/surface_radiance.cpp
+44
-28
SCHNApps/Plugins/surface_render/src/surface_render.cpp
SCHNApps/Plugins/surface_render/src/surface_render.cpp
+6
-0
SCHNApps/Plugins/surface_render/src/surface_render_dockTab.cpp
...pps/Plugins/surface_render/src/surface_render_dockTab.cpp
+5
-2
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
+2
-2
SCHNApps/include/mapHandler.hpp
SCHNApps/include/mapHandler.hpp
+7
-1
No files found.
CGoGN/include/Geometry/bounding_box.h
View file @
8167cd1c
...
...
@@ -37,95 +37,95 @@ namespace Geom
template
<
typename
VEC
>
class
BoundingBox
{
public:
/**********************************************/
/* CONSTRUCTORS */
/**********************************************/
public:
/**********************************************/
/* CONSTRUCTORS */
/**********************************************/
BoundingBox
()
;
BoundingBox
()
;
// initialize the bounding box with one first point
BoundingBox
(
const
VEC
&
p
)
;
// initialize the bounding box with one first point
BoundingBox
(
const
VEC
&
p
)
;
/**********************************************/
/* ACCESSORS */
/**********************************************/
/**********************************************/
/* ACCESSORS */
/**********************************************/
VEC
&
min
()
;
VEC
&
min
()
;
const
VEC
&
min
()
const
;
const
VEC
&
min
()
const
;
VEC
&
max
()
;
VEC
&
max
()
;
const
VEC
&
max
()
const
;
const
VEC
&
max
()
const
;
typename
VEC
::
DATA_TYPE
size
(
unsigned
int
coord
)
const
;
typename
VEC
::
DATA_TYPE
size
(
unsigned
int
coord
)
const
;
typename
VEC
::
DATA_TYPE
maxSize
()
const
;
typename
VEC
::
DATA_TYPE
maxSize
()
const
;
typename
VEC
::
DATA_TYPE
minSize
()
const
;
typename
VEC
::
DATA_TYPE
minSize
()
const
;
VEC
diag
()
const
;
VEC
diag
()
const
;
typename
VEC
::
DATA_TYPE
diagSize
()
const
;
typename
VEC
::
DATA_TYPE
diagSize
()
const
;
VEC
center
()
const
;
VEC
center
()
const
;
bool
isInitialized
()
const
;
bool
isInitialized
()
const
;
/**********************************************/
/* FUNCTIONS */
/**********************************************/
/**********************************************/
/* FUNCTIONS */
/**********************************************/
// reinitialize the bounding box
void
reset
()
;
// reinitialize the bounding box
void
reset
()
;
// add a point to the bounding box
void
addPoint
(
const
VEC
&
p
)
;
// add a point to the bounding box
void
addPoint
(
const
VEC
&
p
)
;
// return true if bb intersects the bounding box
bool
intersects
(
const
BoundingBox
<
VEC
>&
bb
)
;
// return true if bb intersects the bounding box
bool
intersects
(
const
BoundingBox
<
VEC
>&
bb
)
;
// fusion with the given bounding box
void
fusion
(
const
BoundingBox
<
VEC
>&
bb
)
;
// fusion with the given bounding box
void
fusion
(
const
BoundingBox
<
VEC
>&
bb
)
;
// return true if the point belongs strictly to a bounding box
bool
contains
(
const
VEC
&
p
);
// return true if the point belongs strictly to a bounding box
bool
contains
(
const
VEC
&
p
);
// return true if the segment belongs strictly to a bounding box
bool
contains
(
const
VEC
&
a
,
const
VEC
&
b
);
// return true if the segment belongs strictly to a bounding box
bool
contains
(
const
VEC
&
a
,
const
VEC
&
b
);
// return true if the bounding box belongs strictly to a bounding box
bool
contains
(
const
BoundingBox
<
VEC
>
&
bb
);
// return true if the bounding box belongs strictly to a bounding box
bool
contains
(
const
BoundingBox
<
VEC
>
&
bb
);
// scale the bounding box
void
scale
(
typename
VEC
::
DATA_TYPE
size
);
// scale the bounding box
void
scale
(
typename
VEC
::
DATA_TYPE
size
);
// 0-centered scale of the bounding box
void
centeredScale
(
typename
VEC
::
DATA_TYPE
size
);
// 0-centered scale of the bounding box
void
centeredScale
(
typename
VEC
::
DATA_TYPE
size
);
/// test if bb is intersected by a ray
bool
rayIntersect
(
const
VEC
&
P
,
const
VEC
&
V
)
const
;
/// test if bb is intersected by a ray
bool
rayIntersect
(
const
VEC
&
P
,
const
VEC
&
V
)
const
;
/**********************************************/
/* STREAM OPERATORS */
/**********************************************/
/**********************************************/
/* STREAM OPERATORS */
/**********************************************/
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
BoundingBox
<
VEC
>&
bb
)
{
out
<<
bb
.
min
()
<<
" "
<<
bb
.
max
()
;
return
out
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
BoundingBox
<
VEC
>&
bb
)
{
out
<<
bb
.
min
()
<<
" "
<<
bb
.
max
()
;
return
out
;
}
friend
std
::
istream
&
operator
>>
(
std
::
istream
&
in
,
BoundingBox
<
VEC
>&
bb
)
{
in
>>
bb
.
min
()
>>
bb
.
max
()
;
return
in
;
}
friend
std
::
istream
&
operator
>>
(
std
::
istream
&
in
,
BoundingBox
<
VEC
>&
bb
)
{
in
>>
bb
.
min
()
>>
bb
.
max
()
;
return
in
;
}
private:
bool
m_initialized
;
VEC
m_pMin
,
m_pMax
;
private:
bool
m_initialized
;
VEC
m_pMin
,
m_pMax
;
}
;
}
// namespace Geom
...
...
SCHNApps/Plugins/surface_radiance/src/surface_radiance.cpp
View file @
8167cd1c
...
...
@@ -259,7 +259,9 @@ MapHandlerGen* Surface_Radiance_Plugin::importFromFile(const QString& fileName)
mapParams
.
radianceTexture
->
update
();
map
->
removeAttribute
(
mapParams
.
radiance
);
// uncomment this line to be able to load multiple objects with different SH basis
// (decimation will be unavailable)
// map->removeAttribute(mapParams.radiance);
mapParams
.
paramVBO
=
new
Utils
::
VBO
();
mapParams
.
paramVBO
->
updateData
(
mapParams
.
param
);
...
...
@@ -333,39 +335,53 @@ void Surface_Radiance_Plugin::decimate(const QString& mapName, const QString& po
mapParams
.
positionApproximator
=
new
Algo
::
Surface
::
Decimation
::
Approximator_QEM
<
PFP2
>
(
*
map
,
position
);
}
if
(
mapParams
.
normalApproximator
==
NULL
)
{
mapParams
.
normalApproximator
=
new
Algo
::
Surface
::
Decimation
::
Approximator_InterpolateAlongEdge
<
PFP2
,
PFP2
::
VEC3
>
(
*
map
,
normal
,
position
,
((
Algo
::
Surface
::
Decimation
::
Approximator
<
PFP2
,
PFP2
::
VEC3
,
EDGE
>*
)(
mapParams
.
positionApproximator
))
->
getApproximationResultAttribute
()
);
}
if
(
mapParams
.
radianceApproximator
==
NULL
)
{
mapParams
.
radianceApproximator
=
new
Algo
::
Surface
::
Decimation
::
Approximator_InterpolateAlongEdge
<
PFP2
,
Utils
::
SphericalHarmonics
<
PFP2
::
REAL
,
PFP2
::
VEC3
>
>
(
*
map
,
mapParams
.
radiance
,
position
,
((
Algo
::
Surface
::
Decimation
::
Approximator
<
PFP2
,
PFP2
::
VEC3
,
EDGE
>*
)(
mapParams
.
positionApproximator
))
->
getApproximationResultAttribute
()
);
}
//
if (mapParams.normalApproximator == NULL)
//
{
//
mapParams.normalApproximator =
//
new Algo::Surface::Decimation::Approximator_InterpolateAlongEdge<PFP2, PFP2::VEC3>(
//
*map,
//
normal,
//
position,
//
((Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator))->getApproximationResultAttribute()
//
);
//
}
//
if (mapParams.radianceApproximator == NULL)
//
{
//
mapParams.radianceApproximator =
//
new Algo::Surface::Decimation::Approximator_InterpolateAlongEdge<PFP2, Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3> >(
//
*map,
//
mapParams.radiance,
//
position,
//
((Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator))->getApproximationResultAttribute()
//
);
//
}
if
(
mapParams
.
selector
==
NULL
)
{
// mapParams.selector =
// new EdgeSelector_Radiance<PFP2>(
// *map,
// position,
// normal,
// mapParams.radiance,
// *(Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator),
// *(Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.normalApproximator),
// *(Algo::Surface::Decimation::Approximator<PFP2, Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3>, EDGE>*)(mapParams.radianceApproximator)
// );
// mapParams.selector =
// new Algo::Surface::Decimation::EdgeSelector_QEM<PFP2>(
// *map,
// position,
// *(Algo::Surface::Decimation::Approximator<PFP2, PFP2::VEC3, EDGE>*)(mapParams.positionApproximator)
// );
mapParams
.
selector
=
new
EdgeSelector_Radianc
e
<
PFP2
>
(
new
Algo
::
Surface
::
Decimation
::
EdgeSelector_ColorNaiv
e
<
PFP2
>
(
*
map
,
position
,
normal
,
mapParams
.
radiance
,
*
(
Algo
::
Surface
::
Decimation
::
Approximator
<
PFP2
,
PFP2
::
VEC3
,
EDGE
>*
)(
mapParams
.
positionApproximator
),
*
(
Algo
::
Surface
::
Decimation
::
Approximator
<
PFP2
,
PFP2
::
VEC3
,
EDGE
>*
)(
mapParams
.
normalApproximator
),
*
(
Algo
::
Surface
::
Decimation
::
Approximator
<
PFP2
,
Utils
::
SphericalHarmonics
<
PFP2
::
REAL
,
PFP2
::
VEC3
>
,
EDGE
>*
)(
mapParams
.
radianceApproximator
)
*
(
Algo
::
Surface
::
Decimation
::
Approximator
<
PFP2
,
PFP2
::
VEC3
,
EDGE
>*
)(
mapParams
.
positionApproximator
)
);
}
}
...
...
SCHNApps/Plugins/surface_render/src/surface_render.cpp
View file @
8167cd1c
...
...
@@ -197,6 +197,7 @@ void Surface_Render_Plugin::vboRemoved(Utils::VBO *vbo)
{
m_dockTab
->
removePositionVBO
(
QString
::
fromStdString
(
vbo
->
name
()));
m_dockTab
->
removeNormalVBO
(
QString
::
fromStdString
(
vbo
->
name
()));
m_dockTab
->
removeColorVBO
(
QString
::
fromStdString
(
vbo
->
name
()));
}
}
...
...
@@ -218,6 +219,11 @@ void Surface_Render_Plugin::vboRemoved(Utils::VBO *vbo)
mapParam
.
normalVBO
=
NULL
;
if
(
view
->
isLinkedToMap
(
map
))
viewsToUpdate
.
insert
(
view
);
}
if
(
mapParam
.
colorVBO
==
vbo
)
{
mapParam
.
colorVBO
=
NULL
;
if
(
view
->
isLinkedToMap
(
map
))
viewsToUpdate
.
insert
(
view
);
}
}
foreach
(
View
*
v
,
viewsToUpdate
)
...
...
SCHNApps/Plugins/surface_render/src/surface_render_dockTab.cpp
View file @
8167cd1c
...
...
@@ -13,8 +13,8 @@ namespace SCHNApps
Surface_Render_DockTab
::
Surface_Render_DockTab
(
SCHNApps
*
s
,
Surface_Render_Plugin
*
p
)
:
m_schnapps
(
s
),
m_plugin
(
p
),
b_updatingUI
(
false
),
m_currentColorDial
(
0
)
m_currentColorDial
(
0
),
b_updatingUI
(
false
)
{
setupUi
(
this
);
...
...
@@ -326,6 +326,9 @@ void Surface_Render_DockTab::updateMapParameters()
combo_normalVBO
->
clear
();
combo_normalVBO
->
addItem
(
"- select VBO -"
);
combo_colorVBO
->
clear
();
combo_colorVBO
->
addItem
(
"- select VBO -"
);
View
*
view
=
m_schnapps
->
getSelectedView
();
MapHandlerGen
*
map
=
m_schnapps
->
getSelectedMap
();
...
...
SCHNApps/Plugins/surface_selection/src/surface_selection.cpp
View file @
8167cd1c
...
...
@@ -105,7 +105,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
m_pointSprite
->
setAttributePosition
(
m_selectedVerticesVBO
);
m_pointSprite
->
setColor
(
CGoGN
::
Geom
::
Vec4f
(
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
));
m_pointSprite
->
setLightPosition
(
CGoGN
::
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
));
m_pointSprite
->
setSize
(
20
*
map
->
getBBdiagSize
()
/
nbCells
);
m_pointSprite
->
setSize
(
map
->
getBBdiagSize
()
/
75.0
f
);
m_pointSprite
->
enableVertexAttribs
();
glDrawArrays
(
GL_POINTS
,
0
,
selector
->
getNbSelectedCells
());
...
...
@@ -126,7 +126,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
{
case
NormalAngle
:
case
SingleCell
:
{
m_pointSprite
->
setSize
(
30
*
map
->
getBBdiagSize
()
/
nbCells
);
m_pointSprite
->
setSize
(
map
->
getBBdiagSize
()
/
60.0
f
);
break
;
}
case
WithinSphere
:
{
...
...
SCHNApps/include/mapHandler.hpp
View file @
8167cd1c
...
...
@@ -100,7 +100,10 @@ void MapHandler<PFP>::updateBB()
VertexAttribute
<
VEC3
,
MAP
>
bbVertexAttribute
(
map
,
dynamic_cast
<
AttributeMultiVector
<
VEC3
>*>
(
m_bbVertexAttribute
));
m_bb
=
CGoGN
::
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
*
map
,
bbVertexAttribute
);
m_bbDiagSize
=
m_bb
.
diagSize
();
if
(
m_bb
.
isInitialized
())
m_bbDiagSize
=
m_bb
.
diagSize
();
else
m_bbDiagSize
=
0
;
}
else
{
...
...
@@ -117,6 +120,9 @@ void MapHandler<PFP>::updateBB()
template
<
typename
PFP
>
void
MapHandler
<
PFP
>::
updateBBDrawer
()
{
if
(
!
m_bb
.
isInitialized
())
return
;
if
(
!
m_bbDrawer
)
m_bbDrawer
=
new
Utils
::
Drawer
();
...
...
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