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
6e88e219
Commit
6e88e219
authored
Feb 06, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new rendering cells in drawer (for debug essentially
parent
756266e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
336 additions
and
0 deletions
+336
-0
include/Algo/Render/GL2/drawerCells.h
include/Algo/Render/GL2/drawerCells.h
+185
-0
include/Algo/Render/GL2/drawerCells.hpp
include/Algo/Render/GL2/drawerCells.hpp
+151
-0
No files found.
include/Algo/Render/GL2/drawerCells.h
0 → 100644
View file @
6e88e219
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2011, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.u-strasbg.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __DRAWER_CELLS__
#define __DRAWER_CELLS__
#include "Utils/drawer.h"
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
/**
* add a set of vertices to a drawer
* @param dr the drawer to use
* @param map the map
* @param vd the darts
* @param positions attribute of positions
*/
template
<
typename
PFP
>
void
drawerVertices
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
std
::
vector
<
Dart
>&
vd
,
const
typename
PFP
::
TVEC3
&
positions
);
/**
* add a set of edges to a drawer
* @param dr the drawer to use
* @param map the map
* @param vd the darts
* @param positions attribute of positions
* @param k shrinking factor
*/
template
<
typename
PFP
>
void
drawerEdges
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
std
::
vector
<
Dart
>&
vd
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
);
/**
* add a set of faces to a drawer
* @param dr the drawer to use
* @param map the map
* @param vd the darts
* @param positions attribute of positions
* @param k shrinking factor
*/
template
<
typename
PFP
>
void
drawerFaces
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
std
::
vector
<
Dart
>&
vd
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
);
/**
* add a set of volumes to a drawer
* @param dr the drawer to use
* @param map the map
* @param vd the darts
* @param positions attribute of positions
* @param k shrinking factor
*/
template
<
typename
PFP
>
void
drawerVolumes
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
std
::
vector
<
Dart
>&
vd
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
);
/**
* add a vertex to a drawer
* @param dr the drawer to use
* @param map the map
* @param d the dart
* @param positions attribute of positions
* @param k shrinking factor
*/
template
<
typename
PFP
>
void
drawerVertex
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
);
/**
* add an edge to a drawer
* @param dr the drawer to use
* @param map the map
* @param d the dart
* @param positions attribute of positions
*/
template
<
typename
PFP
>
void
drawerEdge
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
);
/**
* add a face to a drawer
* @param dr the drawer to use
* @param map the map
* @param d the dart
* @param positions attribute of positions
* @param k shrinking factor
*/
template
<
typename
PFP
>
void
drawerFace
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
);
/**
* add a volume to a drawer
* @param dr the drawer to use
* @param map the map
* @param d the dart
* @param positions attribute of positions
* @param k shrinking factor
*/
template
<
typename
PFP
>
void
drawerVolume
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
);
/**
* add an edge to a drawer, use between begin / end
* @param dr the drawer to use
* @param map the map
* @param d the dart
* @param positions attribute of positions
* @param k shrinking factor
*/
template
<
typename
PFP
>
void
drawerAddEdge
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
);
/**
* add an shrinked edge from center to a drawer, use between begin / end
* @param dr the drawer to use
* @param map the map
* @param d the dart
* @param positions attribute of positions
* @param C center of cell to draw
* @param k shrinking factor
*/
template
<
typename
PFP
>
void
drawerAddEdgeShrink
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
const
typename
PFP
::
VEC3
&
C
,
float
k
);
/**
* add an face to a drawer, use between begin / end
* @param dr the drawer to use
* @param map the map
* @param d the dart
* @param positions attribute of positions
* @param k shrinking factor
*/
template
<
typename
PFP
>
void
drawerAddFace
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
);
/**
* add a volume to a drawer, use between begin / end
* @param dr the drawer to use
* @param map the map
* @param d the dart
* @param positions attribute of positions
* @param k shrinking factor
*/
template
<
typename
PFP
>
void
drawerAddVolume
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
);
}
}
}
#include "Algo/Render/GL2/drawerCells.hpp"
#endif
include/Algo/Render/GL2/drawerCells.hpp
0 → 100644
View file @
6e88e219
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2011, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.u-strasbg.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
namespace
CGoGN
{
namespace
Algo
{
namespace
Render
{
template
<
typename
PFP
>
void
drawerAddEdge
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
)
{
const
typename
PFP
::
VEC3
&
P
=
positions
[
d
];
Dart
e
=
map
.
phi1
(
d
);
const
typename
PFP
::
VEC3
&
Q
=
positions
[
e
];
typename
PFP
::
VEC3
C
=
(
P
+
Q
)
/
typename
PFP
::
REAL
(
2.0
);
dr
.
vertex
(
C
*
(
1.0
f
-
k
)
+
k
*
P
);
dr
.
vertex
(
C
*
(
1.0
f
-
k
)
+
k
*
Q
);
}
template
<
typename
PFP
>
void
drawerAddEdgeShrink
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
const
typename
PFP
::
VEC3
&
C
,
float
k
)
{
const
typename
PFP
::
VEC3
&
P
=
positions
[
d
];
Dart
e
=
map
.
phi1
(
d
);
const
typename
PFP
::
VEC3
&
Q
=
positions
[
e
];
dr
.
vertex
(
C
*
(
1.0
f
-
k
)
+
k
*
P
);
dr
.
vertex
(
C
*
(
1.0
f
-
k
)
+
k
*
Q
);
}
template
<
typename
PFP
>
void
drawerAddFace
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
)
{
typename
PFP
::
VEC3
C
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
map
,
d
,
positions
);
Traversor2FE
<
typename
PFP
::
MAP
>
trav
(
map
,
d
);
for
(
Dart
e
=
trav
.
begin
();
e
!=
trav
.
end
();
e
=
trav
.
next
())
{
drawerAddEdgeShrink
<
PFP
>
(
dr
,
map
,
e
,
positions
,
C
,
k
);
}
}
template
<
typename
PFP
>
void
drawerAddVolume
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
)
{
typename
PFP
::
VEC3
C
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
map
,
d
,
positions
);
Traversor3WE
<
typename
PFP
::
MAP
>
trav
(
map
,
d
);
for
(
Dart
e
=
trav
.
begin
();
e
!=
trav
.
end
();
e
=
trav
.
next
())
drawerAddEdgeShrink
<
PFP
>
(
dr
,
map
,
e
,
positions
,
C
,
k
);
}
template
<
typename
PFP
>
void
drawerVertices
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
std
::
vector
<
Dart
>&
vd
,
const
typename
PFP
::
TVEC3
&
positions
)
{
dr
.
begin
(
GL_POINTS
);
for
(
std
::
vector
<
Dart
>::
iterator
it
=
vd
.
begin
();
it
!=
vd
.
end
();
++
it
)
dr
.
vertex
(
positions
[
*
it
]);
dr
.
end
();
}
template
<
typename
PFP
>
void
drawerEdges
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
std
::
vector
<
Dart
>&
vd
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
)
{
dr
.
begin
(
GL_LINES
);
for
(
std
::
vector
<
Dart
>::
iterator
it
=
vd
.
begin
();
it
!=
vd
.
end
();
++
it
)
drawerAddEdge
<
PFP
>
(
dr
,
map
,
*
it
,
positions
,
k
);
dr
.
end
();
}
template
<
typename
PFP
>
void
drawerFaces
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
std
::
vector
<
Dart
>&
vd
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
)
{
dr
.
begin
(
GL_LINES
);
for
(
std
::
vector
<
Dart
>::
iterator
it
=
vd
.
begin
();
it
!=
vd
.
end
();
++
it
)
drawerAddFace
<
PFP
>
(
dr
,
map
,
*
it
,
positions
,
k
);
dr
.
end
();
}
template
<
typename
PFP
>
void
drawerVolumes
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
std
::
vector
<
Dart
>&
vd
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
)
{
dr
.
begin
(
GL_LINES
);
for
(
std
::
vector
<
Dart
>::
iterator
it
=
vd
.
begin
();
it
!=
vd
.
end
();
++
it
)
drawerAddVolume
<
PFP
>
(
dr
,
map
,
*
it
,
positions
,
k
);
dr
.
end
();
}
template
<
typename
PFP
>
void
drawerVertex
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
)
{
dr
.
begin
(
GL_POINTS
);
dr
.
vertex
(
positions
[
d
]);
dr
.
end
();
}
template
<
typename
PFP
>
void
drawerEdge
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
)
{
dr
.
begin
(
GL_LINES
);
drawerAddEdge
<
PFP
>
(
dr
,
map
,
d
,
positions
,
k
);
dr
.
end
();
}
template
<
typename
PFP
>
void
drawerFace
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
)
{
dr
.
begin
(
GL_LINES
);
drawerAddFace
<
PFP
>
(
dr
,
map
,
d
,
positions
,
k
);
dr
.
end
();
}
template
<
typename
PFP
>
void
drawerVolume
(
Utils
::
Drawer
&
dr
,
typename
PFP
::
MAP
&
map
,
Dart
d
,
const
typename
PFP
::
TVEC3
&
positions
,
float
k
)
{
dr
.
begin
(
GL_LINES
);
drawerAddVolume
<
PFP
>
(
dr
,
map
,
d
,
positions
,
k
);
dr
.
end
();
}
}
}
}
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