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
b5bd8dca
Commit
b5bd8dca
authored
Jul 10, 2015
by
Sylvain Thery
Browse files
import_Plugin: loading several times the same mesh
parent
7693a255
Changes
2
Hide whitespace changes
Inline
Side-by-side
SCHNApps/Plugins/surface_import/src/surface_import.cpp
View file @
b5bd8dca
...
...
@@ -38,8 +38,6 @@ MapHandlerGen* Surface_Import_Plugin::importMeshFromFile(const QString& nameOfFi
QFileInfo
fi
(
fileName
);
if
(
fi
.
exists
())
{
pythonRecording
(
"importMeshFromFile"
,
fi
.
baseName
(),
fileName
);
MapHandlerGen
*
mhg
=
m_schnapps
->
addMap
(
fi
.
baseName
(),
2
);
if
(
mhg
)
{
...
...
@@ -60,6 +58,7 @@ MapHandlerGen* Surface_Import_Plugin::importMeshFromFile(const QString& nameOfFi
mhg
->
registerAttribute
(
orbit
,
QString
::
fromStdString
(
names
[
i
]),
QString
::
fromStdString
(
types
[
i
]));
}
}
pythonRecording
(
"importMeshFromFile"
,
mhg
->
getName
(),
fileName
);
return
mhg
;
}
else
...
...
SCHNApps/src/schnapps.cpp
View file @
b5bd8dca
...
...
@@ -727,25 +727,33 @@ MapHandlerGen* SCHNApps::duplicateMap(const QString& name, bool properties)
MapHandlerGen
*
SCHNApps
::
addMap
(
const
QString
&
name
,
unsigned
int
dim
)
{
QString
finalName
=
name
;
if
(
m_maps
.
contains
(
name
))
return
NULL
;
{
int
i
=
1
;
do
{
finalName
=
name
+
QString
(
"_"
)
+
QString
::
number
(
i
);
++
i
;
}
while
(
m_maps
.
contains
(
finalName
));
}
MapHandlerGen
*
mh
=
NULL
;
switch
(
dim
)
{
case
2
:
{
PFP2
::
MAP
*
map
=
new
PFP2
::
MAP
();
mh
=
new
MapHandler
<
PFP2
>
(
n
ame
,
this
,
map
);
mh
=
new
MapHandler
<
PFP2
>
(
finalN
ame
,
this
,
map
);
break
;
}
case
3
:
{
PFP3
::
MAP
*
map
=
new
PFP3
::
MAP
();
mh
=
new
MapHandler
<
PFP3
>
(
n
ame
,
this
,
map
);
mh
=
new
MapHandler
<
PFP3
>
(
finalN
ame
,
this
,
map
);
break
;
}
}
m_maps
.
insert
(
n
ame
,
mh
);
m_maps
.
insert
(
finalN
ame
,
mh
);
DEBUG_EMIT
(
"mapAdded"
);
emit
(
mapAdded
(
mh
));
...
...
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