Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CGoGN
CGoGN
Commits
6126aa17
Commit
6126aa17
authored
May 18, 2012
by
untereiner
Browse files
vertexSplit next
parent
0b827205
Changes
8
Hide whitespace changes
Inline
Side-by-side
Apps/Tuto/tuto_oper3.cpp
View file @
6126aa17
...
...
@@ -150,6 +150,7 @@ void MyQT::operation(int x)
if
(
!
m_selecteds
.
empty
())
{
myMap
.
splitVolume
(
m_selecteds
);
m_selecteds
.
clear
();
dm
.
markAll
();
updateMap
();
}
...
...
@@ -182,11 +183,15 @@ void MyQT::operation(int x)
CGoGNout
<<
"split vertex"
<<
CGoGNendl
;
if
(
!
m_selecteds
.
empty
())
{
std
::
cout
<<
"nb darts before = "
<<
myMap
.
getNbDarts
()
<<
std
::
endl
;
Dart
dit
=
m_selecteds
.
front
();
PFP
::
VEC3
c1
=
Algo
::
Geometry
::
faceCentroid
<
PFP
>
(
myMap
,
dit
,
position
);
myMap
.
splitVertex
(
m_selecteds
);
position
[
dit
]
=
position
[
dit
]
*
0.7
f
+
c1
*
0.3
f
;
PFP
::
VEC3
c1
=
Algo
::
Geometry
::
volumeCentroid
<
PFP
>
(
myMap
,
dit
,
position
);
Dart
dres
=
myMap
.
splitVertex
(
m_selecteds
);
position
[
dres
]
=
position
[
dit
]
*
0.5
f
-
c1
*
0.5
f
;
m_selecteds
.
clear
();
dm
.
markAll
();
updateMap
();
std
::
cout
<<
"nb darts after = "
<<
myMap
.
getNbDarts
()
<<
std
::
endl
;
}
break
;
default:
...
...
include/Topology/map/embeddedMap3.h
View file @
6126aa17
...
...
@@ -41,7 +41,7 @@ public:
/*!
*
*/
virtual
void
splitVertex
(
std
::
vector
<
Dart
>&
vd
);
virtual
Dart
splitVertex
(
std
::
vector
<
Dart
>&
vd
);
//!
/*!
...
...
include/Topology/map/map2MR/filters_Primal.h
View file @
6126aa17
...
...
@@ -26,6 +26,7 @@
#define __MR_FILTERS_PRIMAL__
#include
<cmath>
//#include "Algo/Decimation/decimation.h"
namespace
CGoGN
{
...
...
@@ -547,28 +548,43 @@ public:
}
;
/*********************************************************************************
* PROGRESSIVE MESHES FUNCTOR
S
*
MR
PROGRESSIVE MESHES FUNCTOR
*********************************************************************************/
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
)
{}
//template <typename PFP>
//class DecimateFilter
//{
//protected:
// typename PFP::MAP& m_map;
// typename PFP::TVEC3& m_position;
// //Algo::Decimation::SelectorType m_s;
// //Algo::Decimation::ApproximatorType m_a;
// unsigned int m_nbWantedVertices;
// FunctorSelect& m_selected;
//
//
//public:
// DecimateFilter(typename PFP::MAP& m, typename PFP::TVEC3& p,
// //Algo::Decimation::SelectorType s, Algo::Decimation::ApproximatorType a,
// unsigned int nbWantedVertices, const FunctorSelect& selected) :
// m_map(m), m_position(p), m_s(s), m_a(a), m_nbWantedVertices(nbWantedVertices), m_selected(selected) {}
//
// void decimate ()
// {
// // Algo::Decimation::decimate<PFP>(m_map, m_s, m_a, m_position, m_nbWantedVertices, m_selected);
// }
//
// void coarsen()
// {
//
// }
//
// void refine()
// {
//
// }
//} ;
bool
operator
()
()
{
for
(
Dart
dit
=
m_map
.
begin
()
;
dit
!=
m_map
.
end
()
;
dit
=
m_map
.
next
())
{
return
false
;
}
}
};
}
// namespace Multiresolution
...
...
include/Topology/map/map2MR/map2MR_PM.h
View file @
6126aa17
...
...
@@ -31,7 +31,6 @@
#include
"Topology/map/map2MR/filters_Primal.h"
#include
"Algo/Modelisation/subdivision.h"
namespace
CGoGN
{
...
...
@@ -51,8 +50,7 @@ class Map2MR_PM : public EmbeddedMap2
protected:
bool
shareVertexEmbeddings
;
std
::
vector
<
Multiresolution
::
MRFilter
*>
synthesisFilters
;
std
::
vector
<
Multiresolution
::
MRFilter
*>
analysisFilters
;
//Multiresolution::DecimateFilter* filter ;
DartMarkerStore
*
selectedEdges
;
...
...
@@ -64,11 +62,7 @@ public:
//add a coarse level
void
addNewLevel
(
bool
embedNewVertices
=
true
)
;
void
addSynthesisFilter
(
Multiresolution
::
MRFilter
*
f
)
{
synthesisFilters
.
push_back
(
f
)
;
}
void
addAnalysisFilter
(
Multiresolution
::
MRFilter
*
f
)
{
analysisFilters
.
push_back
(
f
)
;
}
void
clearSynthesisFilters
()
{
synthesisFilters
.
clear
()
;
}
void
clearAnalysisFilters
()
{
analysisFilters
.
clear
()
;
}
//void addDecimationFilter(Multiresolution::DecimateFilter *f) { filter = f; }
void
analysis
()
;
void
synthesis
()
;
...
...
include/Topology/map/map3.h
View file @
6126aa17
...
...
@@ -143,7 +143,7 @@ public:
* \per Works only on the boundary
* @param vd a vector of darts
*/
virtual
void
splitVertex
(
std
::
vector
<
Dart
>&
vd
);
virtual
Dart
splitVertex
(
std
::
vector
<
Dart
>&
vd
);
//! Delete the vertex of d
/*! All the volumes around the vertex are merged into one volume
...
...
src/Topology/map/embeddedMap3.cpp
View file @
6126aa17
...
...
@@ -27,18 +27,18 @@
namespace
CGoGN
{
void
EmbeddedMap3
::
splitVertex
(
std
::
vector
<
Dart
>&
vd
)
Dart
EmbeddedMap3
::
splitVertex
(
std
::
vector
<
Dart
>&
vd
)
{
Dart
d
=
vd
.
front
();
Dart
d
3
=
phi
2
(
phi
3
(
d
));
Dart
d
2
=
phi
1
(
phi
2
(
d
));
Map3
::
splitVertex
(
vd
);
Dart
dres
=
Map3
::
splitVertex
(
vd
);
if
(
isOrbitEmbedded
(
VERTEX
))
{
embedNewCell
(
VERTEX
,
d2
);
copyCell
(
VERTEX
,
d2
,
d
);
embedOrbit
(
VERTEX
,
d
,
getEmbedding
(
VERTEX
,
d
));
embedNewCell
(
VERTEX
,
d3
);
copyCell
(
VERTEX
,
d3
,
d
);
}
if
(
isOrbitEmbedded
(
EDGE
))
...
...
@@ -53,6 +53,8 @@ void EmbeddedMap3::splitVertex(std::vector<Dart>& vd)
embedOrbit
(
VOLUME
,
*
it
,
getEmbedding
(
VOLUME
,
*
it
))
;
}
}
return
dres
;
}
Dart
EmbeddedMap3
::
deleteVertex
(
Dart
d
)
...
...
src/Topology/map/map2MR/map2MR_PM.cpp
View file @
6126aa17
...
...
@@ -60,7 +60,6 @@ void Map2MR_PM::addNewLevel(bool embedNewVertices)
setCurrentLevel
(
0
);
//DartMarker me(*this);
selectedEdges
=
new
DartMarkerStore
(
*
this
);
TraversorE
<
Map2MR_PM
>
travE
(
*
this
);
...
...
@@ -103,6 +102,8 @@ void Map2MR_PM::addNewLevel(bool embedNewVertices)
}
}
}
//(*filter).decimate() ;
}
void
Map2MR_PM
::
analysis
()
...
...
@@ -111,16 +112,14 @@ void Map2MR_PM::analysis()
decCurrentLevel
()
;
for
(
unsigned
int
i
=
0
;
i
<
analysisFilters
.
size
();
++
i
)
(
*
analysisFilters
[
i
])()
;
//(*filter).coarsen() ;
}
void
Map2MR_PM
::
synthesis
()
{
assert
(
getCurrentLevel
()
<
getMaxLevel
()
||
!
"synthesis : called on max level"
)
;
for
(
unsigned
int
i
=
0
;
i
<
synthesisFilters
.
size
();
++
i
)
(
*
synthesisFilters
[
i
])()
;
//(*filter).refine() ;
incCurrentLevel
()
;
}
...
...
src/Topology/map/map3.cpp
View file @
6126aa17
...
...
@@ -129,17 +129,80 @@ void Map3::fillHole(Dart d)
* Topological operations on 3-maps
*************************************************************************/
void
Map3
::
splitVertex
(
std
::
vector
<
Dart
>&
vd
)
Dart
Map3
::
splitVertex
(
std
::
vector
<
Dart
>&
vd
)
{
//assert(checkPathAroundVertex(vd)) ; assert(sameVertex(d,e));
//unsew the face path
for
(
std
::
vector
<
Dart
>::
iterator
it
=
vd
.
begin
()
;
it
!=
vd
.
end
()
;
++
it
)
//case BoundaryVertex ??
Dart
prev
=
vd
.
front
();
//elt 0
Dart
fs
=
phi_1
(
phi2
(
phi_1
(
prev
)));
//first side
Dart
ss
=
phi2
(
prev
);
//second side
Map2
::
splitVertex
(
prev
,
phi2
(
fs
));
// Map1::cutEdge(fs); //comme un vertexSplit
// Map1::cutEdge(ss);
// phi2sew(phi1(ss), phi1(fs));
for
(
unsigned
int
i
=
1
;
i
<
vd
.
size
();
++
i
)
{
Dart
d3
=
phi1
(
ss
);
prev
=
vd
[
i
];
Dart
fs
=
phi_1
(
phi2
(
phi_1
(
prev
)));
//first side
Dart
ss
=
phi2
(
prev
);
//second side
Map2
::
splitVertex
(
prev
,
phi2
(
fs
));
// Map1::cutEdge(fs); //comme un vertexSplit
// Map1::cutEdge(ss);
// phi2sew(phi1(ss), phi1(fs));
}
for
(
unsigned
int
i
=
0
;
i
<
vd
.
size
()
;
++
i
)
{
unsewVolumes
(
*
it
);
Dart
d1
=
phi_1
(
phi2
(
phi_1
(
vd
[
i
])));
Dart
d2
=
phi1
(
phi3
(
phi2
(
phi_1
(
vd
[
i
]))));
phi3sew
(
d1
,
d2
);
}
return
phi_1
(
phi2
(
phi_1
(
prev
)));
}
// //unsew the face path
// for(std::vector<Dart>::iterator it = vd.begin() ; it != vd.end() ; ++it)
// {
// Dart dit = *it;
//
// Map1::cutEdge(phi_1(phi2(phi_1(dit)))); //comme un vertexSplit
// Map1::cutEdge(phi2(phi1(phi2(dit))));
// Map2::sewFaces(phi1(phi2(phi1(phi2(dit)))), phi_1(phi2(phi_1(dit))), false);
//
//
//
// Dart dit3 = phi3(dit);
// unsewVolumes(dit);
// Dart f1 = newFace(3,false);
// Dart f2 = newFace(3,false);
// Dart f3 = newFace(3,false);
// Dart f4 = newFace(3,false);
//
// sewFaces(f1,f2,false);
// sewFaces(phi_1(f1), f3, false);
// sewFaces(phi1(f1), f4, false);
// sewFaces(phi_1(f2), phi1(f4), false);
// sewFaces(phi_1(f3), phi1(f2), false);
// sewFaces(phi1(f3), phi_1(f4), false);
//
// sewVolumes(dit,f3);
// sewVolumes(dit3,f4);
// }
/*
if(isBoundaryVertex(d))
{
...
...
@@ -159,7 +222,7 @@ void Map3::splitVertex(std::vector<Dart>& vd)
// //Map2::splitFace(e, phi2(ec));
}
*/
}
Dart
Map3
::
deleteVertex
(
Dart
d
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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