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
c8942970
Commit
c8942970
authored
May 15, 2012
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
begin vertexSplit and PM multires
parent
2e2ac038
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
139 additions
and
2 deletions
+139
-2
Apps/Examples/viewer.cpp
Apps/Examples/viewer.cpp
+15
-0
Apps/Examples/viewer.h
Apps/Examples/viewer.h
+2
-0
Apps/Examples/volumeExplorer.cpp
Apps/Examples/volumeExplorer.cpp
+12
-0
Apps/Tuto/tuto_oper2.cpp
Apps/Tuto/tuto_oper2.cpp
+1
-1
Apps/Tuto/tuto_oper3.cpp
Apps/Tuto/tuto_oper3.cpp
+13
-0
Apps/Tuto/tuto_oper3.ui
Apps/Tuto/tuto_oper3.ui
+5
-0
include/Topology/map/embeddedMap3.h
include/Topology/map/embeddedMap3.h
+6
-0
include/Topology/map/map2MR/filters_Primal.h
include/Topology/map/map2MR/filters_Primal.h
+25
-0
include/Topology/map/map2MR/map2MR_PM.h
include/Topology/map/map2MR/map2MR_PM.h
+2
-0
include/Topology/map/map3.h
include/Topology/map/map3.h
+9
-0
src/Topology/map/embeddedMap3.cpp
src/Topology/map/embeddedMap3.cpp
+24
-0
src/Topology/map/map2.cpp
src/Topology/map/map2.cpp
+1
-1
src/Topology/map/map3.cpp
src/Topology/map/map3.cpp
+24
-0
No files found.
Apps/Examples/viewer.cpp
View file @
c8942970
...
...
@@ -309,6 +309,21 @@ void Viewer::slot_normalsSize(int i)
updateGL
()
;
}
void
Viewer
::
cb_keyPress
(
int
keycode
)
{
switch
(
keycode
)
{
case
'c'
:
myMap
.
check
();
break
;
default:
break
;
}
updateGLMatrices
()
;
updateGL
();
}
/**********************************************************************************************
* MAIN FUNCTION *
**********************************************************************************************/
...
...
Apps/Examples/viewer.h
View file @
c8942970
...
...
@@ -117,6 +117,8 @@ public:
void
cb_Open
()
;
void
cb_Save
()
;
void
cb_keyPress
(
int
keycode
);
void
importMesh
(
std
::
string
&
filename
)
;
void
exportMesh
(
std
::
string
&
filename
,
bool
askExportMode
=
true
);
...
...
Apps/Examples/volumeExplorer.cpp
View file @
c8942970
...
...
@@ -319,6 +319,18 @@ int main(int argc, char **argv)
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
}
if
(
extension
==
std
::
string
(
".node"
))
{
if
(
!
Algo
::
Import
::
importMeshV
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
,
Algo
::
Import
::
ImportVolumique
::
NODE
))
{
std
::
cerr
<<
"could not import "
<<
argv
[
1
]
<<
std
::
endl
;
return
1
;
}
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
}
if
(
extension
==
std
::
string
(
".off"
))
{
if
(
!
Algo
::
Import
::
importMeshToExtrude
<
PFP
>
(
myMap
,
argv
[
1
],
attrNames
))
...
...
Apps/Tuto/tuto_oper2.cpp
View file @
c8942970
...
...
@@ -74,7 +74,7 @@ void MyQT::operation(int x)
PFP
::
VEC3
c1
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected
,
position
);
PFP
::
VEC3
c2
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
m_selected2
,
position
);
position
[
m_selected
]
=
position
[
m_selected
]
*
0.7
f
+
c1
*
0.3
f
;
position
[
m_selected2
]
=
position
[
m_selected2
]
*
0.7
f
+
c2
*
0.3
f
;
position
[
m_selected2
]
=
position
[
m_sel
ected2
]
*
0.7
f
+
c2
*
0.3
f
;
updateMap
();
}
break
;
...
...
Apps/Tuto/tuto_oper3.cpp
View file @
c8942970
...
...
@@ -27,6 +27,7 @@
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Modelisation/primitives3d.h"
#include "Algo/Geometry/centroid.h"
#include "Algo/Geometry/normal.h"
#include "Algo/Import/import.h"
#include "Algo/Export/export.h"
...
...
@@ -177,6 +178,18 @@ void MyQT::operation(int x)
updateMap
();
}
break
;
case
10
:
CGoGNout
<<
"split vertex"
<<
CGoGNendl
;
if
(
m_selected
!=
NIL
&&
m_selected2
!=
NIL
)
{
PFP
::
VEC3
c1
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
myMap
.
findBoundaryFaceOfEdge
(
m_selected
),
position
);
PFP
::
VEC3
c2
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
myMap
.
findBoundaryFaceOfEdge
(
m_selected2
),
position
);
myMap
.
splitVertex
(
m_selected
,
m_selected2
);
position
[
m_selected
]
=
position
[
m_selected
]
*
0.7
f
+
c1
*
0.3
f
;
position
[
m_selected2
]
=
position
[
m_selected2
]
*
0.7
f
+
c2
*
0.3
f
;
updateMap
();
}
break
;
default:
break
;
}
...
...
Apps/Tuto/tuto_oper3.ui
View file @
c8942970
...
...
@@ -99,6 +99,11 @@
<string>
collapseVolume
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
splitVertex
</string>
</property>
</item>
</widget>
</item>
<item>
...
...
include/Topology/map/embeddedMap3.h
View file @
c8942970
...
...
@@ -37,6 +37,12 @@ class EmbeddedMap3 : public Map3
public:
typedef
Map3
TOPO_MAP
;
//!
/*!
*
*/
virtual
void
splitVertex
(
Dart
d
,
Dart
e
);
//!
/*!
*/
...
...
include/Topology/map/map2MR/filters_Primal.h
View file @
c8942970
...
...
@@ -546,6 +546,31 @@ public:
}
}
;
/*********************************************************************************
* PROGRESSIVE MESHES FUNCTORS
*********************************************************************************/
template
<
typename
PFP
>
class
pipoPMAnalysisFilter
{
protected:
typename
PFP
::
MAP
&
m_map
;
typename
PFP
::
TVEC3
&
m_position
;
//Algo::PMesh::ProgressiveMesh<PFP> *m_pmesh;
public:
pipoPMAnalysisFilter
(
typename
PFP
::
MAP
&
m
,
typename
PFP
::
TVEC3
&
p
)
:
m_map
(
m
),
m_position
(
p
)
{}
bool
operator
()
()
{
for
(
Dart
dit
=
m_map
.
begin
()
;
dit
!=
m_map
.
end
()
;
dit
=
m_map
.
next
())
{
return
false
;
}
}
};
}
// namespace Multiresolution
}
// namespace CGoGN
...
...
include/Topology/map/map2MR/map2MR_PM.h
View file @
c8942970
...
...
@@ -60,6 +60,8 @@ public:
Map2MR_PM
()
;
virtual
std
::
string
mapTypeName
()
const
{
return
"Map2MR_PM"
;
}
//add a coarse level
void
addNewLevel
(
bool
embedNewVertices
=
true
)
;
void
addSynthesisFilter
(
Multiresolution
::
MRFilter
*
f
)
{
synthesisFilters
.
push_back
(
f
)
;
}
...
...
include/Topology/map/map3.h
View file @
c8942970
...
...
@@ -137,6 +137,15 @@ public:
*************************************************************************/
//@{
//! Split the vertex
/*! \per Darts d & e MUST belong to the same vertex
* \per Darts d & e MUST belong to different volumes
* \per Works only on the boundary
* @param d first dart in vertex v
* @param e second dart in vertex v
*/
virtual
void
splitVertex
(
Dart
d
,
Dart
e
);
//! Delete the vertex of d
/*! All the volumes around the vertex are merged into one volume
* @param d a dart of the vertex to delete
...
...
src/Topology/map/embeddedMap3.cpp
View file @
c8942970
...
...
@@ -27,6 +27,30 @@
namespace
CGoGN
{
void
EmbeddedMap3
::
splitVertex
(
Dart
d
,
Dart
e
)
{
Map3
::
splitVertex
(
d
,
e
);
if
(
isOrbitEmbedded
(
VERTEX
))
{
embedOrbit
(
VERTEX
,
d
,
getEmbedding
(
VERTEX
,
d
));
embedNewCell
(
VERTEX
,
phi2
(
phi1
(
phi2
(
d
))));
copyCell
(
VERTEX
,
phi2
(
phi1
(
phi2
(
d
))),
d
);
}
if
(
isOrbitEmbedded
(
EDGE
))
{
}
if
(
isOrbitEmbedded
(
VOLUME
))
{
embedOrbit
(
VOLUME
,
d
,
getEmbedding
(
VOLUME
,
d
))
;
embedOrbit
(
VOLUME
,
e
,
getEmbedding
(
VOLUME
,
e
))
;
}
}
Dart
EmbeddedMap3
::
deleteVertex
(
Dart
d
)
{
Dart
v
=
Map3
::
deleteVertex
(
d
)
;
...
...
src/Topology/map/map2.cpp
View file @
c8942970
...
...
@@ -196,7 +196,7 @@ void Map2::fillHole(Dart d)
void
Map2
::
splitVertex
(
Dart
d
,
Dart
e
)
{
assert
(
same
Oriented
Vertex
(
d
,
e
))
;
assert
(
sameVertex
(
d
,
e
))
;
Dart
d2
=
phi2
(
d
)
;
assert
(
d
!=
d2
)
;
Dart
e2
=
phi2
(
e
)
;
assert
(
e
!=
e2
)
;
Dart
nd
=
Map1
::
cutEdge
(
d2
)
;
// Cut the edge of dd (make a new half edge)
...
...
src/Topology/map/map3.cpp
View file @
c8942970
...
...
@@ -129,6 +129,30 @@ void Map3::fillHole(Dart d)
* Topological operations on 3-maps
*************************************************************************/
void
Map3
::
splitVertex
(
Dart
d
,
Dart
e
)
{
assert
(
sameVertex
(
d
,
e
));
assert
(
!
sameVolume
(
d
,
e
));
if
(
isBoundaryVertex
(
d
))
{
unsewVolumes
(
d
);
unsewVolumes
(
e
);
Dart
dc
=
phi1
(
phi2
(
d
));
//unsewVolumes(phi2(dc));
Map2
::
splitVertex
(
d
,
phi1
(
phi2
(
dc
)));
// Map2::splitFace(d, phi2(dc));
// Dart ec = phi_1(phi2(e));
// Map2::splitVertex(e, ec);
// //Map2::splitFace(e, phi2(ec));
}
}
Dart
Map3
::
deleteVertex
(
Dart
d
)
{
if
(
isBoundaryVertex
(
d
))
...
...
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