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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
e7e37ad9
Commit
e7e37ad9
authored
Jan 20, 2012
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import surface meshes in a 3-map with an extruding step
parent
c19f14b8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
29 deletions
+57
-29
Apps/Examples/viewer.cpp
Apps/Examples/viewer.cpp
+33
-0
Apps/Examples/viewer.h
Apps/Examples/viewer.h
+5
-0
include/Algo/ImplicitHierarchicalMesh/ihm3.h
include/Algo/ImplicitHierarchicalMesh/ihm3.h
+5
-0
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
+3
-0
include/Algo/Import/import.h
include/Algo/Import/import.h
+4
-1
include/Algo/Import/importMesh.hpp
include/Algo/Import/importMesh.hpp
+6
-27
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+1
-1
No files found.
Apps/Examples/viewer.cpp
View file @
e7e37ad9
...
...
@@ -30,7 +30,9 @@ Viewer::Viewer() :
m_drawEdges
(
false
),
m_drawFaces
(
true
),
m_drawNormals
(
false
),
m_drawTopo
(
false
),
m_render
(
NULL
),
m_renderTopo
(
NULL
),
m_phongShader
(
NULL
),
m_flatShader
(
NULL
),
m_vectorShader
(
NULL
),
...
...
@@ -80,6 +82,7 @@ void Viewer::cb_initGL()
setFocal
(
5.0
f
)
;
m_render
=
new
Algo
::
Render
::
GL2
::
MapRender
()
;
m_renderTopo
=
new
Algo
::
Render
::
GL2
::
TopoRender
();
m_positionVBO
=
new
Utils
::
VBO
()
;
m_normalVBO
=
new
Utils
::
VBO
()
;
...
...
@@ -168,6 +171,9 @@ void Viewer::cb_redraw()
}
glDisable
(
GL_POLYGON_OFFSET_FILL
)
;
}
if
(
m_drawTopo
)
m_renderTopo
->
drawTopo
();
}
void
Viewer
::
cb_Open
()
...
...
@@ -189,6 +195,31 @@ void Viewer::cb_Save()
exportMesh
(
filename
);
}
void
Viewer
::
cb_mousePress
(
int
button
,
int
x
,
int
y
)
{
if
(
Shift
())
{
std
::
cout
<<
"shift"
<<
std
::
endl
;
m_renderTopo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
,
0.9
,
allDarts
);
Dart
d
=
m_renderTopo
->
picking
<
PFP
>
(
myMap
,
x
,
y
,
allDarts
);
if
(
d
!=
Dart
::
nil
())
{
statusMsg
(
"dart picked"
);
}
else
{
statusMsg
(
"No dart was picked"
);
}
}
updateGL
();
}
void
Viewer
::
importMesh
(
std
::
string
&
filename
)
{
myMap
.
clear
(
true
)
;
...
...
@@ -217,6 +248,8 @@ void Viewer::importMesh(std::string& filename)
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
LINES
)
;
m_render
->
initPrimitives
<
PFP
>
(
myMap
,
allDarts
,
Algo
::
Render
::
GL2
::
TRIANGLES
)
;
m_renderTopo
->
updateData
<
PFP
>
(
myMap
,
position
,
0.9
,
0.9
,
allDarts
);
bb
=
Algo
::
Geometry
::
computeBoundingBox
<
PFP
>
(
myMap
,
position
)
;
normalBaseSize
=
bb
.
diagSize
()
/
100.0
f
;
// vertexBaseSize = normalBaseSize /5.0f ;
...
...
Apps/Examples/viewer.h
View file @
e7e37ad9
...
...
@@ -38,6 +38,7 @@
#include "Algo/Export/export.h"
#include "Algo/Render/GL2/mapRender.h"
#include "Algo/Render/GL2/topoRender.h"
#include "Utils/Shaders/shaderPhong.h"
#include "Utils/Shaders/shaderFlat.h"
...
...
@@ -85,6 +86,7 @@ public:
float
faceShrinkage
;
int
m_renderStyle
;
bool
m_drawTopo
;
bool
m_drawVertices
;
bool
m_drawEdges
;
bool
m_drawFaces
;
...
...
@@ -94,6 +96,7 @@ public:
PFP
::
TVEC3
normal
;
Algo
::
Render
::
GL2
::
MapRender
*
m_render
;
Algo
::
Render
::
GL2
::
TopoRender
*
m_renderTopo
;
Utils
::
VBO
*
m_positionVBO
;
Utils
::
VBO
*
m_normalVBO
;
...
...
@@ -114,6 +117,8 @@ public:
void
cb_Open
()
;
void
cb_Save
()
;
void
cb_mousePress
(
int
button
,
int
x
,
int
y
);
void
importMesh
(
std
::
string
&
filename
)
;
void
exportMesh
(
std
::
string
&
filename
);
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.h
View file @
e7e37ad9
...
...
@@ -59,6 +59,11 @@ public:
~
ImplicitHierarchicalMap3
()
;
//!
/*!
*
*/
void
update_topo_shortcuts
();
//!
...
...
include/Algo/ImplicitHierarchicalMesh/ihm3.hpp
View file @
e7e37ad9
...
...
@@ -70,6 +70,9 @@ inline void ImplicitHierarchicalMap3::update_topo_shortcuts()
m_dartLevel
=
Map3
::
getAttribute
<
unsigned
int
>
(
DART
,
"dartLevel"
)
;
m_faceId
=
Map3
::
getAttribute
<
unsigned
int
>
(
DART
,
"faceId"
)
;
m_edgeId
=
Map3
::
getAttribute
<
unsigned
int
>
(
DART
,
"edgeId"
)
;
//AttributeContainer& cont = m_attribs[DART] ;
//m_nextLevelCell = cont.getDataVector<unsigned int>(cont.getAttributeIndex("nextLevelCell")) ;
}
...
...
include/Algo/Import/import.h
View file @
e7e37ad9
...
...
@@ -54,7 +54,7 @@ template <typename PFP>
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
ImportSurfacique
::
ImportType
kind
=
ImportSurfacique
::
UNKNOWNSURFACE
,
bool
mergeCloseVertices
=
false
);
/**
* import a volumic mesh
* import a volum
etr
ic mesh
*/
//template <typename PFP>
//bool importMesh(typename PFP::MAP& map, const std::string& filename, typename PFP::TVEC3& positions, ImportVolumique::ImportType kind = ImportVolumique::UNKNOWNVOLUME);
...
...
@@ -63,6 +63,9 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
//bool importObjWithTex(typename PFP::MAP& map, const std::string& filename);
//
template
<
typename
PFP
>
bool
importMeshToExtrude
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
ImportSurfacique
::
ImportType
kind
=
ImportSurfacique
::
UNKNOWNSURFACE
);
/*
* TODO a transformer en utilisant un MeshTableVolume.
...
...
include/Algo/Import/importMesh.hpp
View file @
e7e37ad9
...
...
@@ -195,7 +195,7 @@ bool importMeshSToV(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts, float d
m
.
mark
(
d
)
;
// mark on the fly to unmark on second loop
vecDartsPerVertex
[
em
].
push_back
(
d
);
// store incident darts for fast adjacency reconstruction
d
=
map
.
phi1
(
d
);
d
=
map
.
phi
_
1
(
d
);
}
}
...
...
@@ -549,36 +549,15 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
template
<
typename
PFP
>
bool
importMesh
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
ImportVolum
ique
::
ImportType
kind
)
bool
importMesh
ToExtrude
(
typename
PFP
::
MAP
&
map
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>&
attrNames
,
ImportSurfac
ique
::
ImportType
kind
)
{
float
dist
=
5.0
f
;
MeshTablesSurface
<
PFP
>
mts
(
map
);
if
(
kind
==
ImportVolumique
::
OBJ
)
{
MeshTablesSurface
<
PFP
>
mts
(
map
);
if
(
!
mts
.
importMesh
(
filename
,
attrNames
,
ImportSurfacique
::
OBJ
))
return
false
;
//if (mergeCloseVertices)
// mts.mergeCloseVertices();
return
importMeshSToV
<
PFP
>
(
map
,
mts
,
dist
);
}
else
if
(
!
mts
.
importMesh
(
filename
,
attrNames
,
kind
))
return
false
;
// else
// {
// MeshTablesVolume<PFP> mtv(map);
//
//
// if(!mtv.importMesh(filename, attrNames, kind))
// return false;
//
// return importMesh<PFP>(map, mtv);
// }
return
importMeshSToV
<
PFP
>
(
map
,
mts
,
dist
);
}
...
...
src/Topology/map/map3.cpp
View file @
e7e37ad9
...
...
@@ -475,7 +475,7 @@ bool Map3::mergeVolumes(Dart d)
void
Map3
::
splitVolume
(
std
::
vector
<
Dart
>&
vd
)
{
assert
(
checkSimpleOrientedPath
(
vd
))
;
//
assert(checkSimpleOrientedPath(vd)) ;
Dart
e
=
vd
.
front
();
Dart
e2
=
phi2
(
e
);
...
...
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