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
639d734d
Commit
639d734d
authored
Dec 14, 2011
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update load/save
parent
073beee4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
29 deletions
+22
-29
Apps/Examples/clipping.cpp
Apps/Examples/clipping.cpp
+11
-0
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+1
-1
include/Topology/generic/genericmap.hpp
include/Topology/generic/genericmap.hpp
+4
-4
src/Container/attributeContainer.cpp
src/Container/attributeContainer.cpp
+4
-0
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+2
-24
No files found.
Apps/Examples/clipping.cpp
View file @
639d734d
...
...
@@ -819,6 +819,17 @@ void Clipping::importMesh(std::string& filename)
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
attrNames
[
0
])
;
}
if
(
extension
==
std
::
string
(
".map"
))
{
if
(
!
myMap
.
loadMapBin
(
filename
))
{
CGoGNerr
<<
"could not import "
<<
filename
<<
CGoGNendl
;
return
;
}
else
position
=
myMap
.
getAttribute
<
PFP
::
VEC3
>
(
VERTEX
,
"position"
)
;
}
updateVBOprimitives
(
Algo
::
Render
::
GL2
::
TRIANGLES
|
Algo
::
Render
::
GL2
::
LINES
|
Algo
::
Render
::
GL2
::
POINTS
)
;
...
...
include/Topology/generic/genericmap.h
View file @
639d734d
...
...
@@ -340,7 +340,7 @@ public:
* @param name the name
* @ return true if node has the good name
*/
bool
chechXmlNode
(
xmlNodePtr
node
,
const
std
::
string
&
name
)
;
//
bool chechXmlNode(xmlNodePtr node, const std::string& name) ;
/**
* update the pointer of embedding vector after loading
...
...
include/Topology/generic/genericmap.hpp
View file @
639d734d
...
...
@@ -25,10 +25,10 @@
namespace
CGoGN
{
inline
bool
GenericMap
::
chechXmlNode
(
xmlNodePtr
node
,
const
std
::
string
&
name
)
{
return
(
strcmp
((
char
*
)(
node
->
name
),(
char
*
)(
name
.
c_str
()))
==
0
);
}
//
inline bool GenericMap::chechXmlNode(xmlNodePtr node, const std::string& name)
//
{
//
return (strcmp((char*)(node->name),(char*)(name.c_str())) == 0);
//
}
/****************************************
* DARTS MANAGEMENT *
...
...
src/Container/attributeContainer.cpp
View file @
639d734d
...
...
@@ -594,12 +594,16 @@ void AttributeContainer::saveBin(CGoGNostream& fs, unsigned int id)
fs
.
write
(
reinterpret_cast
<
const
char
*>
(
&
bufferui
[
0
]),
bufferui
.
size
()
*
sizeof
(
unsigned
int
));
unsigned
int
i
=
0
;
for
(
std
::
vector
<
AttributeMultiVectorGen
*>::
iterator
it
=
m_tableAttribs
.
begin
();
it
!=
m_tableAttribs
.
end
();
++
it
)
{
if
(
*
it
!=
NULL
)
(
*
it
)
->
saveBin
(
fs
,
i
++
);
else
{
CGoGNerr
<<
"PB saving, NULL ptr in m_tableAttribs"
<<
CGoGNendl
;
i
++
;
}
}
//en binaire les blocks de ref
...
...
src/Topology/generic/genericmap.cpp
View file @
639d734d
...
...
@@ -336,19 +336,6 @@ bool GenericMap::saveMapBin(const std::string& filename)
m_attribs
[
i
].
saveBin
(
fs
,
i
);
}
// save marksets and boundary marker
// std::vector<unsigned int> buffer;
// buffer.reserve(NB_ORBITS+1);
// for (unsigned int i=0; i<NB_ORBITS; ++i)
// {
// buffer.push_back(m_marksets[i][0].getMarkVal());
// }
// buffer.push_back(m_boundaryMarker.getMarkVal()); // save m_boundaryMarker
// fs.write(reinterpret_cast<const char*>(&(buffer[0])), buffer.size()*sizeof(unsigned int));
unsigned
int
mv
=
m_boundaryMarker
.
getMarkVal
();
fs
.
write
(
reinterpret_cast
<
const
char
*>
(
&
mv
),
sizeof
(
unsigned
int
));
return
true
;
}
...
...
@@ -379,15 +366,11 @@ bool GenericMap::loadMapBin(const std::string& filename)
// Check map type
buff_str
=
std
::
string
(
buff
+
32
);
// CGoGNout << "Map type file = "<< buff_str<< CGoGNendl;
std
::
string
localType
=
this
->
mapTypeName
();
// localType = localType.substr(0,localType.size()-1);
std
::
string
fileType
=
buff_str
;
std
::
cout
<<
"localType = "
<<
localType
<<
" / fileType = "
<<
fileType
<<
std
::
endl
;
if
(
fileType
!=
localType
)
{
CGoGNerr
<<
"Not possible to load "
<<
fileType
<<
" into "
<<
localType
<<
" object"
<<
CGoGNendl
;
...
...
@@ -410,15 +393,10 @@ bool GenericMap::loadMapBin(const std::string& filename)
m_attribs
[
id
].
loadBin
(
fs
);
}
// load boundary marker
unsigned
int
mv
;
fs
.
read
(
reinterpret_cast
<
char
*>
(
&
mv
),
sizeof
(
unsigned
int
));
m_boundaryMarker
.
setMarkVal
(
mv
);
// retrieve m_embeddings (from m_attribs[DART]
update_m_emb_afterLoad
();
update_topo_shortcuts
();
// recursive call from real type of map down to GenericMap
// recursive call from real type of map (for topo relation attributes pointers) down to GenericMap ( for Marker_cleaning & pointers)
update_topo_shortcuts
();
return
true
;
...
...
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