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
Hurstel
CGoGN
Commits
39cfb89e
Commit
39cfb89e
authored
Jan 13, 2012
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modifs in examples (save/load map...)
parent
f548bb67
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
67 additions
and
20 deletions
+67
-20
Apps/Examples/clipping.h
Apps/Examples/clipping.h
+0
-3
Apps/Examples/viewer.cpp
Apps/Examples/viewer.cpp
+44
-3
Apps/Examples/viewer.h
Apps/Examples/viewer.h
+7
-0
Apps/Tuto/tuto5.cpp
Apps/Tuto/tuto5.cpp
+1
-0
Apps/Tuto/tuto5.h
Apps/Tuto/tuto5.h
+2
-1
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+1
-0
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
+2
-2
include/Algo/Render/GL2/topoRender.hpp
include/Algo/Render/GL2/topoRender.hpp
+7
-7
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
+1
-2
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+2
-2
No files found.
Apps/Examples/clipping.h
View file @
39cfb89e
...
...
@@ -99,9 +99,6 @@ public:
Utils
::
ShaderSimpleColor
*
m_shader
;
Utils
::
Drawer
*
influence_area
;
Utils
::
Drawer
*
chips_area
;
Geom
::
Vec3f
m_coeffTopoExplod
;
Geom
::
Vec3f
gPosObj
;
float
gWidthObj
;
...
...
Apps/Examples/viewer.cpp
View file @
39cfb89e
...
...
@@ -35,7 +35,8 @@ Viewer::Viewer() :
m_flatShader
(
NULL
),
m_vectorShader
(
NULL
),
m_simpleColorShader
(
NULL
),
m_pointSprite
(
NULL
)
m_pointSprite
(
NULL
),
m_strings
(
NULL
)
{
normalScaleFactor
=
1.0
f
;
vertexScaleFactor
=
0.1
f
;
...
...
@@ -110,15 +111,21 @@ void Viewer::cb_initGL()
m_pointSprite
=
new
Utils
::
PointSprite
()
;
m_pointSprite
->
setAttributePosition
(
m_positionVBO
)
;
m_strings
=
new
Utils
::
Strings3D
(
true
,
Geom
::
Vec3f
(
0.1
f
,
0.0
f
,
0.3
f
));
storeVerticesInfo
();
m_strings
->
sendToVBO
();
registerShader
(
m_phongShader
)
;
registerShader
(
m_flatShader
)
;
registerShader
(
m_vectorShader
)
;
registerShader
(
m_simpleColorShader
)
;
registerShader
(
m_pointSprite
)
;
registerShader
(
m_strings
);
}
void
Viewer
::
cb_redraw
()
{
glClearColor
(
1
,
1
,
1
,
0
);
if
(
m_drawVertices
)
{
float
size
=
vertexScaleFactor
;
...
...
@@ -126,6 +133,7 @@ void Viewer::cb_redraw()
m_pointSprite
->
predraw
(
Geom
::
Vec3f
(
0.0
f
,
0.0
f
,
1.0
f
))
;
m_render
->
draw
(
m_pointSprite
,
Algo
::
Render
::
GL2
::
POINTS
)
;
m_pointSprite
->
postdraw
()
;
m_strings
->
drawAll
(
Geom
::
Vec3f
(
0.0
f
,
1.0
f
,
1.0
f
));
}
if
(
m_drawEdges
)
...
...
@@ -175,9 +183,10 @@ void Viewer::cb_Open()
void
Viewer
::
cb_Save
()
{
std
::
string
filters
(
"off (*.off)"
)
;
std
::
string
filters
(
"off (*.off)
;; map (*.map)
"
)
;
std
::
string
filename
=
selectFileSave
(
"Save Mesh"
,
""
,
filters
)
;
Algo
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
filename
.
c_str
(),
allDarts
)
;
exportMesh
(
filename
);
}
void
Viewer
::
importMesh
(
std
::
string
&
filename
)
...
...
@@ -220,10 +229,41 @@ void Viewer::importMesh(std::string& filename)
m_positionVBO
->
updateData
(
position
)
;
m_normalVBO
->
updateData
(
normal
)
;
storeVerticesInfo
();
m_strings
->
sendToVBO
();
setParamObject
(
bb
.
maxSize
(),
bb
.
center
().
data
())
;
updateGLMatrices
()
;
}
void
Viewer
::
exportMesh
(
std
::
string
&
filename
)
{
size_t
pos
=
filename
.
rfind
(
"."
);
// position of "." in filename
std
::
string
extension
=
filename
.
substr
(
pos
);
if
(
extension
==
std
::
string
(
".map"
))
myMap
.
saveMapBin
(
filename
);
else
Algo
::
Export
::
exportOFF
<
PFP
>
(
myMap
,
position
,
filename
.
c_str
(),
allDarts
)
;
}
void
Viewer
::
storeVerticesInfo
()
{
CellMarker
mv
(
myMap
,
VERTEX
);
for
(
Dart
d
=
myMap
.
begin
();
d
!=
myMap
.
end
();
myMap
.
next
(
d
))
{
if
(
!
mv
.
isMarked
(
d
))
{
mv
.
mark
(
d
);
std
::
stringstream
ss
;
ss
<<
d
<<
" : "
<<
position
[
d
];
m_strings
->
addString
(
ss
.
str
(),
position
[
d
]);
}
}
}
void
Viewer
::
slot_drawVertices
(
bool
b
)
{
m_drawVertices
=
b
;
...
...
@@ -233,6 +273,7 @@ void Viewer::slot_drawVertices(bool b)
void
Viewer
::
slot_verticesSize
(
int
i
)
{
vertexScaleFactor
=
i
/
500.0
f
;
m_strings
->
setScale
(
0.02
f
*
i
);
updateGL
()
;
}
...
...
Apps/Examples/viewer.h
View file @
39cfb89e
...
...
@@ -44,6 +44,7 @@
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderVectorPerVertex.h"
#include "Utils/pointSprite.h"
#include "Utils/text3d.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Geometry/normal.h"
...
...
@@ -102,6 +103,7 @@ public:
Utils
::
ShaderVectorPerVertex
*
m_vectorShader
;
Utils
::
ShaderSimpleColor
*
m_simpleColorShader
;
Utils
::
PointSprite
*
m_pointSprite
;
Utils
::
Strings3D
*
m_strings
;
Viewer
()
;
...
...
@@ -113,6 +115,11 @@ public:
void
cb_Save
()
;
void
importMesh
(
std
::
string
&
filename
)
;
void
exportMesh
(
std
::
string
&
filename
);
protected:
void
storeVerticesInfo
();
public
slots
:
void
slot_drawVertices
(
bool
b
)
;
...
...
Apps/Tuto/tuto5.cpp
View file @
39cfb89e
...
...
@@ -93,6 +93,7 @@ void MyQT::animate()
// transfoMatrix() = glm::rotate(transfoMatrix(), 0.5f, glm::vec3(0.5773f,0.5773f,0.5773f));
transfoRotate
(
0.5
f
,
0.5773
f
,
0.5773
f
,
0.5773
f
);
updateGLMatrices
();
updateGL
();
}
...
...
Apps/Tuto/tuto5.h
View file @
39cfb89e
...
...
@@ -39,7 +39,7 @@
#include "Geometry/vector_gen.h"
#include "Algo/Geometry/boundingbox.h"
#include "Algo/Render/GL2/mapRender.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Algo/Render/GL2/topo3Render.h"
...
...
@@ -47,6 +47,7 @@
#include "Utils/text3d.h"
#include "Utils/pointSprite.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/Shaders/shaderVectorPerVertex.h"
#include "Utils/cgognStream.h"
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
39cfb89e
...
...
@@ -514,6 +514,7 @@ inline unsigned int ImplicitHierarchicalMap3::edgeLevel(Dart d)
return
r
;
}
/***************************************************
* ATTRIBUTE HANDLER *
***************************************************/
...
...
include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp
View file @
39cfb89e
...
...
@@ -354,8 +354,8 @@ Dart subdivideVolumeClassic(typename PFP::MAP& map, Dart d, typename PFP::TVEC3&
dd
=
map
.
phi1
(
map
.
phi1
(
map
.
phi1
(
ne
)));
map
.
splitFace
(
ne
,
dd
)
;
//
unsigned int idface = map.getNewFaceId();
//
map.setFaceId(dd,idface, FACE);
unsigned
int
idface
=
map
.
getNewFaceId
();
map
.
setFaceId
(
dd
,
idface
,
FACE
);
newEdges
.
push_back
(
map
.
phi1
(
dd
));
...
...
include/Algo/Render/GL2/topoRender.hpp
View file @
39cfb89e
...
...
@@ -365,10 +365,10 @@ void TopoRender::setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& go
unsigned
int
nb
=
0
;
for
(
Dart
d
=
map
.
begin
();
d
!=
map
.
end
();
map
.
next
(
d
))
{
if
(
nb
<
m_nbDarts
)
{
if
(
good
(
d
))
{
if
(
nb
<
m_nbDarts
)
{
float
r
,
g
,
b
;
dartToCol
(
d
,
r
,
g
,
b
);
...
...
@@ -382,13 +382,13 @@ void TopoRender::setDartsIdColor(typename PFP::MAP& map, const FunctorSelect& go
nb
++
;
}
}
else
{
CGoGNerr
<<
"Error buffer too small for color picking (change the good parameter ?)"
<<
CGoGNendl
;
d
=
map
.
end
();
}
}
}
glUnmapBuffer
(
GL_ARRAY_BUFFER
);
}
...
...
src/Algo/ImplicitHierarchicalMesh/ihm3.cpp
View file @
39cfb89e
...
...
@@ -509,11 +509,10 @@ Dart ImplicitHierarchicalMap3::volumeOldestDart(Dart d)
std
::
vector
<
Dart
>
visitedFaces
;
// Faces that are traversed
visitedFaces
.
reserve
(
512
);
visitedFaces
.
push_back
(
d
);
// Start with the face of d
std
::
vector
<
Dart
>::
iterator
face
;
// For every face added to the list
//the oldest dart from a volume is the oldest dart from all faces of this volume
mark
.
markOrbit
(
FACE
,
d
)
;
mark
.
markOrbit
(
ORIENTED_
FACE
,
d
)
;
for
(
unsigned
int
i
=
0
;
i
<
visitedFaces
.
size
();
++
i
)
{
...
...
src/Topology/map/map3.cpp
View file @
39cfb89e
...
...
@@ -656,13 +656,13 @@ bool Map3::isBoundaryVolume(Dart d)
DartMarkerStore
mark
(
*
this
);
// Lock a marker
std
::
vector
<
Dart
>
visitedFaces
;
visitedFaces
.
reserve
(
128
)
;
visitedFaces
.
reserve
(
512
)
;
visitedFaces
.
push_back
(
d
)
;
mark
.
markOrbit
(
ORIENTED_FACE
,
d
)
;
for
(
unsigned
int
i
=
0
;
i
<
visitedFaces
.
size
();
++
i
)
{
if
(
isBoundaryMarked
(
phi3
(
visitedFaces
[
i
])))
if
(
isBoundaryMarked
(
phi3
(
visitedFaces
[
i
])))
return
true
;
Dart
e
=
visitedFaces
[
i
]
;
...
...
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