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
244d50f3
Commit
244d50f3
authored
Apr 22, 2013
by
untereiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
relaxation + new id management IHM2 ok
parent
42e2ef2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
25 deletions
+52
-25
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
+29
-4
include/Algo/Modelisation/subdivision3.hpp
include/Algo/Modelisation/subdivision3.hpp
+8
-7
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
+15
-14
No files found.
include/Algo/ImplicitHierarchicalMesh/subdivision.hpp
View file @
244d50f3
...
...
@@ -72,6 +72,8 @@ void subdivideFace(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP:
unsigned
int
cur
=
map
.
getCurrentLevel
()
;
map
.
setCurrentLevel
(
fLevel
)
;
// go to the level of the face to subdivide its edges
std
::
cout
<<
"subdiv"
<<
std
::
endl
;
unsigned
int
degree
=
0
;
typename
PFP
::
VEC3
p
;
Dart
it
=
old
;
...
...
@@ -111,7 +113,8 @@ void subdivideFace(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP:
//map.setEdgeId(map.phi_1(e), id) ;
Dart
dit
=
map
.
phi2
(
map
.
phi_1
(
dd
));
Dart
stop
=
map
.
phi2
(
map
.
phi1
(
old
));
Dart
dit
=
stop
;
do
{
unsigned
int
dId
=
map
.
getEdgeId
(
map
.
phi_1
(
map
.
phi2
(
dit
)));
...
...
@@ -119,21 +122,38 @@ void subdivideFace(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP:
unsigned
int
t
=
dId
+
eId
;
if
(
t
==
1
)
if
(
t
==
0
)
{
map
.
setEdgeId
(
dit
,
1
);
map
.
setEdgeId
(
map
.
phi2
(
dit
),
1
);
}
else
if
(
t
==
1
)
{
map
.
setEdgeId
(
dit
,
2
);
map
.
setEdgeId
(
map
.
phi2
(
dit
),
2
);
}
else
if
(
t
==
2
)
{
if
(
dId
==
eId
)
{
std
::
cout
<<
"plop"
<<
std
::
endl
;
map
.
setEdgeId
(
dit
,
0
);
map
.
setEdgeId
(
map
.
phi2
(
dit
),
0
);
}
else
{
map
.
setEdgeId
(
dit
,
1
);
map
.
setEdgeId
(
map
.
phi2
(
dit
),
1
);
}
}
else
if
(
t
==
3
)
{
map
.
setEdgeId
(
dit
,
0
);
map
.
setEdgeId
(
map
.
phi2
(
dit
),
0
);
}
dit
=
map
.
phi1
(
dit
);
}
while
(
dit
!=
map
.
phi2
(
map
.
phi_1
(
dd
))
);
}
while
(
dit
!=
stop
);
}
else
// if subdividing a polygonal face
...
...
@@ -170,10 +190,15 @@ void subdivideFace(typename PFP::MAP& map, Dart d, VertexAttribute<typename PFP:
{
unsigned
int
eId
=
map
.
getEdgeId
(
map
.
phi1
(
dit
));
if
(
eId
==
0
)
{
map
.
setEdgeId
(
dit
,
1
);
map
.
setEdgeId
(
map
.
phi2
(
dit
),
1
);
}
else
if
(
eId
==
1
)
{
map
.
setEdgeId
(
dit
,
0
);
map
.
setEdgeId
(
map
.
phi2
(
dit
),
0
);
}
dit
=
map
.
phi2
(
map
.
phi_1
(
dit
));
}
while
(
dit
!=
map
.
phi2
(
ne
));
...
...
include/Algo/Modelisation/subdivision3.hpp
View file @
244d50f3
...
...
@@ -873,7 +873,7 @@ void relaxation(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& pos
nlSolverParameteri
(
NL_LEAST_SQUARES
,
NL_TRUE
);
nlSolverParameteri
(
NL_SOLVER
,
NL_CHOLMOD_EXT
);
nlMakeCurrent
(
nlContext
);
//
nlMakeCurrent(nlContext);
if
(
nlGetCurrentState
()
==
NL_STATE_INITIAL
)
nlBegin
(
NL_SYSTEM
)
;
...
...
@@ -894,14 +894,14 @@ void relaxation(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& pos
nlBegin
(
NL_MATRIX
)
;
nlEnable
(
NL_NORMALIZE_ROWS
)
;
TraversorV
<
typename
PFP
::
MAP
>
tv2
(
map
);
for
(
Dart
dit
=
tv2
.
begin
()
;
dit
!=
tv2
.
end
()
;
dit
=
tv2
.
next
())
{
if
(
!
map
.
isBoundaryVertex
(
dit
))
{
//nlEnable(NL_NORMALIZE_ROWS) ;
nlRowParameterd
(
NL_RIGHT_HAND_SIDE
,
indexV
[
dit
])
;
//b[i]
nlRowParameterd
(
NL_RIGHT_HAND_SIDE
,
0
)
;
//b[i]
//nlRowParameterd(NL_ROW_SCALING, weight) ;
nlBegin
(
NL_ROW
)
;
...
...
@@ -910,16 +910,17 @@ void relaxation(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& pos
Traversor3VVaE
<
typename
PFP
::
MAP
>
tvvae
(
map
,
dit
);
for
(
Dart
ditvvae
=
tvvae
.
begin
()
;
ditvvae
!=
tvvae
.
end
()
;
ditvvae
=
tvvae
.
next
())
{
nlCoefficient
(
indexV
[
ditvvae
],
weight
);
nlCoefficient
(
indexV
[
ditvvae
],
weight
);
sum
+=
weight
;
}
nlCoefficient
(
indexV
[
dit
],
-
sum
)
;
nlEnd
(
NL_ROW
)
;
//nlDisable(NL_NORMALIZE_ROWS) ;
}
}
nlDisable
(
NL_NORMALIZE_ROWS
)
;
nlEnd
(
NL_MATRIX
)
;
nlEnd
(
NL_SYSTEM
)
;
...
...
@@ -935,7 +936,7 @@ void relaxation(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& pos
position
[
dit
][
coord
]
=
nlGetVariable
(
indexV
[
dit
]);
}
nlReset
(
NL_
FALS
E
)
;
nlReset
(
NL_
TRU
E
)
;
std
::
cout
<<
"... done"
<<
std
::
endl
;
}
...
...
src/Algo/ImplicitHierarchicalMesh/ihm.cpp
View file @
244d50f3
...
...
@@ -168,20 +168,21 @@ unsigned int ImplicitHierarchicalMap::faceLevel(Dart d)
unsigned
int
cur
=
m_curLevel
;
m_curLevel
=
fLevel
;
unsigned
int
nbSubd
=
0
;
it
=
old
;
unsigned
int
eId
=
m_edgeId
[
old
]
;
// the particular case of a face
do
// with all neighboring faces regularly subdivided
{
// but not the face itself
++
nbSubd
;
// is treated here
it
=
phi1
(
it
)
;
}
while
(
m_edgeId
[
it
]
==
eId
)
;
while
(
nbSubd
>
1
)
{
nbSubd
/=
2
;
--
fLevel
;
}
// unsigned int nbSubd = 0 ;
// it = old ;
// unsigned int eId = m_edgeId[old] ; // the particular case of a face
// do // with all neighboring faces regularly subdivided
// { // but not the face itself
// ++nbSubd ; // is treated here
// std::cout << "plop" << std::endl;
// it = phi1(it) ;
// } while(m_edgeId[it] == eId) ;
// while(nbSubd > 1)
// {
// nbSubd /= 2 ;
// --fLevel ;
// }
m_curLevel
=
cur
;
...
...
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