Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Hurstel
CGoGN
Commits
785f2c31
Commit
785f2c31
authored
Jun 16, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update tests load/save & copyFrom
parent
654ecb23
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
51 additions
and
15 deletions
+51
-15
Apps/CMakeLists.txt
Apps/CMakeLists.txt
+1
-1
Apps/Tests/Algo_Geom_inclusion.cpp
Apps/Tests/Algo_Geom_inclusion.cpp
+0
-0
Apps/Tests/CMakeLists.txt
Apps/Tests/CMakeLists.txt
+0
-0
Apps/Tests/Geom_inclusion.cpp
Apps/Tests/Geom_inclusion.cpp
+0
-0
Apps/Tests/Geom_intersection.cpp
Apps/Tests/Geom_intersection.cpp
+0
-0
Apps/Tests/Geom_orientation.cpp
Apps/Tests/Geom_orientation.cpp
+0
-0
Apps/Tests/copyfrom.cpp
Apps/Tests/copyfrom.cpp
+24
-5
Apps/Tests/loadSave.cpp
Apps/Tests/loadSave.cpp
+20
-5
include/Topology/generic/cellmarker.h
include/Topology/generic/cellmarker.h
+0
-2
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+4
-0
src/Topology/generic/mapMono.cpp
src/Topology/generic/mapMono.cpp
+2
-2
No files found.
Apps/CMakeLists.txt
View file @
785f2c31
...
...
@@ -33,7 +33,7 @@ IF (WITH_QT)
ENDIF
(
NOT DONOT_COMPILE_SANDBOX
)
ENDIF
(
WITH_QT
)
add_subdirectory
(
Examples/
Tests
)
add_subdirectory
(
Tests
)
add_subdirectory
(
Benches
)
...
...
Apps/
Examples/
Tests/Algo_Geom_inclusion.cpp
→
Apps/Tests/Algo_Geom_inclusion.cpp
View file @
785f2c31
File moved
Apps/
Examples/
Tests/CMakeLists.txt
→
Apps/Tests/CMakeLists.txt
View file @
785f2c31
File moved
Apps/
Examples/
Tests/Geom_inclusion.cpp
→
Apps/Tests/Geom_inclusion.cpp
View file @
785f2c31
File moved
Apps/
Examples/
Tests/Geom_intersection.cpp
→
Apps/Tests/Geom_intersection.cpp
View file @
785f2c31
File moved
Apps/
Examples/
Tests/Geom_orientation.cpp
→
Apps/Tests/Geom_orientation.cpp
View file @
785f2c31
File moved
Apps/
Examples/
Tests/copyfrom.cpp
→
Apps/Tests/copyfrom.cpp
View file @
785f2c31
...
...
@@ -64,18 +64,37 @@ int main()
color
[
w
]
=
position
[
w
.
dart
]
+
VEC3
(
0.5
,
0.5
,
0.5
);
});
MAP
myMap2
;
CGoGNout
.
toStd
(
false
);
CGoGNout
.
toFile
(
"map1.csv"
);
CGoGNout
.
toFile
(
"
cf_
map1.csv"
);
myMap
.
dumpCSV
();
std
::
cout
<<
"MAP 1 dumped in cf_map1.csv"
<<
std
::
endl
;
MAP
myMap2
;
VertexAttribute
<
VEC3
,
MAP
>
position2
=
myMap2
.
addAttribute
<
VEC3
,
VERTEX
,
MAP
>
(
"position"
);
DartMarker
<
MAP
>
dm
(
myMap2
);
myMap2
.
copyFrom
(
myMap
);
CGoGNout
.
toFile
(
"map2.csv"
);
CGoGNout
.
toFile
(
"cf_map2.csv"
);
myMap2
.
dumpCSV
();
std
::
cout
<<
"MAP 2 dumped in cf_map2.csv"
<<
std
::
endl
;
// DartMarker and CellMarker must be updated after copy
dm
.
update
();
dm
.
markOrbit
<
FACE
>
(
myMap2
.
begin
());
if
(
!
position2
.
isValid
())
{
std
::
cout
<<
"Attribute handlers are invalid after load or copy, get it agins"
<<
std
::
endl
;
// get it again (here attribute created in load)
position2
=
myMap2
.
getAttribute
<
VEC3
,
VERTEX
,
MAP
>
(
"position"
);
}
CGoGNout
.
toFile
(
"cf_map3.csv"
);
myMap2
.
dumpCSV
();
std
::
cout
<<
"MAP 2 dumped in cf_map3.csv"
<<
std
::
endl
;
std
::
cout
<<
" Volume Total ="
<<
Algo
::
Geometry
::
totalVolume
<
PFP
>
(
myMap2
,
position
)
<<
std
::
endl
;
std
::
cout
<<
" Volume Total ="
<<
Algo
::
Geometry
::
totalVolume
<
PFP
>
(
myMap2
,
position
2
)
<<
std
::
endl
;
return
0
;
}
Apps/
Examples/
Tests/loadSave.cpp
→
Apps/Tests/loadSave.cpp
View file @
785f2c31
...
...
@@ -66,20 +66,35 @@ int main()
});
CGoGNout
.
toStd
(
false
);
CGoGNout
.
toFile
(
"map1.csv"
);
CGoGNout
.
toFile
(
"
ls_
map1.csv"
);
myMap
.
dumpCSV
();
std
::
cout
<<
"MAP 1 dumped in ls_map1.csv"
<<
std
::
endl
;
myMap
.
saveMapBin
(
"pipo.map"
);
myMap
.
saveMapBin
(
"
ls_
pipo.map"
);
MAP
myMap2
;
VertexAttribute
<
VEC3
,
MAP
>
position2
=
myMap2
.
addAttribute
<
VEC3
,
VERTEX
,
MAP
>
(
"position"
);
CellMarker
<
MAP
,
VERTEX
>
cm
(
myMap2
);
myMap2
.
loadMapBin
(
"pipo.map"
);
myMap2
.
loadMapBin
(
"
ls_
pipo.map"
);
CGoGNout
.
toFile
(
"map2.csv"
);
if
(
!
position2
.
isValid
())
{
std
::
cout
<<
"Attribute handlers are invalid after load or copy, get it agin"
<<
std
::
endl
;
// get it again (here attribute created in load)
position2
=
myMap2
.
getAttribute
<
VEC3
,
VERTEX
,
MAP
>
(
"position"
);
}
CGoGNout
.
toFile
(
"ls_map2.csv"
);
myMap2
.
dumpCSV
();
std
::
cout
<<
"MAP 2 dumped in ls_map2.csv"
<<
std
::
endl
;
std
::
cout
<<
" Volume Total ="
<<
Algo
::
Geometry
::
totalVolume
<
PFP
>
(
myMap2
,
position
)
<<
std
::
endl
;
cm
.
update
();
if
(
cm
.
isMarked
(
myMap2
.
begin
()))
std
::
cout
<<
"MARKED"
<<
std
::
endl
;
std
::
cout
<<
" Volume Total ="
<<
Algo
::
Geometry
::
totalVolume
<
PFP
>
(
myMap2
,
position2
)
<<
std
::
endl
;
return
0
;
}
include/Topology/generic/cellmarker.h
View file @
785f2c31
...
...
@@ -57,8 +57,6 @@ public:
unsigned
int
getCell
()
{
return
m_cell
;
}
void
updateMarkVector
(
AttributeMultiVector
<
MarkerBool
>*
amv
)
{
m_markVector
=
amv
;
}
protected:
// protected copy constructor to forbid its usage
CellMarkerGen
(
const
CellMarkerGen
&
/*cm*/
)
...
...
src/Topology/generic/genericmap.cpp
View file @
785f2c31
...
...
@@ -179,8 +179,12 @@ void GenericMap::init(bool addBoundaryMarkers)
m_quickLocalIncidentTraversal
[
i
][
j
]
=
NULL
;
m_quickLocalAdjacentTraversal
[
i
][
j
]
=
NULL
;
}
for
(
unsigned
int
j
=
0
;
j
<
NB_THREAD
;
++
j
)
m_markVectors_free
[
i
][
j
].
clear
();
}
if
(
addBoundaryMarkers
)
{
m_boundaryMarkers
[
0
]
=
m_attribs
[
DART
].
addAttribute
<
MarkerBool
>
(
"BoundaryMark0"
)
;
...
...
src/Topology/generic/mapMono.cpp
View file @
785f2c31
...
...
@@ -128,14 +128,14 @@ bool MapMono::loadMapBin(const std::string& filename)
bool
MapMono
::
copyFrom
(
const
GenericMap
&
map
)
{
const
MapMono
&
mapM
=
reinterpret_cast
<
const
MapMono
&>
(
map
);
if
(
mapTypeName
()
!=
map
.
mapTypeName
())
{
CGoGNerr
<<
"try to copy from incompatible type map"
<<
CGoGNendl
;
return
false
;
}
const
MapMono
&
mapM
=
reinterpret_cast
<
const
MapMono
&>
(
map
);
// clear the map but do not insert boundary markers dart attribute
GenericMap
::
init
(
false
);
...
...
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