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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
David Cazier
CGoGN
Commits
6765bb2a
Commit
6765bb2a
authored
Apr 07, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
duplicate & remove maps in schnapps
parent
13852a54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
10 deletions
+40
-10
SCHNApps/src/controlDock_mapTab.cpp
SCHNApps/src/controlDock_mapTab.cpp
+3
-8
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+37
-2
No files found.
SCHNApps/src/controlDock_mapTab.cpp
View file @
6765bb2a
...
...
@@ -81,8 +81,8 @@ void ControlDock_MapTab::setSelectedMap(const QString& mapName)
if
(
!
items
.
empty
())
{
items
[
0
]
->
setSelected
(
false
);
m_selectedMap
=
NULL
;
}
m_selectedMap
=
NULL
;
updateSelectedMapInfo
();
return
;
}
...
...
@@ -149,7 +149,7 @@ void ControlDock_MapTab::showBBChanged(bool b)
// RECORDING
QTextStream
*
rec
=
m_schnapps
->
pythonStreamRecorder
();
if
(
rec
)
*
rec
<<
m_selectedMap
->
getName
()
<<
".showBB(
\"
"
<<
b
<<
"
\
"
);"
<<
endl
;
*
rec
<<
m_selectedMap
->
getName
()
<<
".showBB(
"
<<
b
<<
");"
<<
endl
;
}
}
...
...
@@ -162,11 +162,7 @@ void ControlDock_MapTab::duplicateCurrentMap()
{
if
(
m_selectedMap
)
{
m_schnapps
->
duplicateMap
(
m_selectedMap
->
getName
(),
true
);
// RECORDING
QTextStream
*
rec
=
m_schnapps
->
pythonStreamRecorder
();
if
(
rec
)
*
rec
<<
"schnapps.duplicateMap("
<<
m_selectedMap
->
getName
()
<<
".getName(),1);"
<<
endl
;
/*MapHandlerGen* mhg = */
m_schnapps
->
duplicateMap
(
m_selectedMap
->
getName
(),
true
);
}
}
}
...
...
@@ -182,7 +178,6 @@ void ControlDock_MapTab::removeCurrentMap()
QTextStream
*
rec
=
m_schnapps
->
pythonStreamRecorder
();
if
(
rec
)
*
rec
<<
"schnapps.removeMap("
<<
m_selectedMap
->
getName
()
<<
".getName());"
<<
endl
;
setSelectedMap
(
"NONE"
);
}
}
}
...
...
SCHNApps/src/schnapps.cpp
View file @
6765bb2a
...
...
@@ -553,6 +553,11 @@ MapHandlerGen* SCHNApps::duplicateMap(const QString& name, bool properties)
if
(
m_maps
.
contains
(
newName
))
return
NULL
;
// RECORDING
QTextStream
*
rec
=
this
->
pythonStreamRecorder
();
if
(
rec
)
*
rec
<<
newName
<<
" = schnapps.duplicateMap("
<<
name
<<
".getName(),1);"
<<
endl
;
MapHandlerGen
*
maph
=
m_maps
[
name
];
MapHandlerGen
*
new_mh
;
...
...
@@ -564,16 +569,40 @@ MapHandlerGen* SCHNApps::duplicateMap(const QString& name, bool properties)
PFP2
::
MAP
*
map
=
new
PFP2
::
MAP
();
map
->
copyFrom
(
*
(
maph
->
getGenericMap
()));
new_mh
=
new
MapHandler
<
PFP2
>
(
newName
,
this
,
map
);
for
(
unsigned
int
orbit
=
VERTEX
;
orbit
<=
VOLUME
;
orbit
++
)
{
AttributeContainer
&
cont
=
map
->
getAttributeContainer
(
orbit
);
std
::
vector
<
std
::
string
>
names
;
std
::
vector
<
std
::
string
>
types
;
cont
.
getAttributesNames
(
names
);
cont
.
getAttributesTypes
(
types
);
for
(
unsigned
int
i
=
0
;
i
<
names
.
size
();
++
i
)
new_mh
->
registerAttribute
(
orbit
,
QString
::
fromStdString
(
names
[
i
]),
QString
::
fromStdString
(
types
[
i
]));
}
break
;
}
case
3
:
{
PFP3
::
MAP
*
map
=
new
PFP3
::
MAP
();
map
->
copyFrom
(
*
(
maph
->
getGenericMap
()));
new_mh
=
new
MapHandler
<
PFP3
>
(
newName
,
this
,
map
);
for
(
unsigned
int
orbit
=
VERTEX
;
orbit
<=
VOLUME
;
orbit
++
)
{
AttributeContainer
&
cont
=
map
->
getAttributeContainer
(
orbit
);
std
::
vector
<
std
::
string
>
names
;
std
::
vector
<
std
::
string
>
types
;
cont
.
getAttributesNames
(
names
);
cont
.
getAttributesTypes
(
types
);
for
(
unsigned
int
i
=
0
;
i
<
names
.
size
();
++
i
)
new_mh
->
registerAttribute
(
orbit
,
QString
::
fromStdString
(
names
[
i
]),
QString
::
fromStdString
(
types
[
i
]));
}
break
;
}
}
m_maps
.
insert
(
newName
,
new_mh
);
DEBUG_EMIT
(
"mapAdded"
);
emit
(
mapAdded
(
new_mh
));
...
...
@@ -591,6 +620,8 @@ MapHandlerGen* SCHNApps::duplicateMap(const QString& name, bool properties)
}
}
pythonVarDeclare
(
new_mh
->
getName
());
return
new_mh
;
}
...
...
@@ -642,8 +673,9 @@ void SCHNApps::removeMap(const QString& name)
// unselect map if it is removed
if
(
this
->
getSelectedMap
()
==
map
)
{
setSelectedMap
(
QString
(
"NONE"
));
}
delete
map
;
}
}
...
...
@@ -905,6 +937,7 @@ void SCHNApps::beginPyRecording()
m_pyRecording
=
NULL
;
m_pyRecFile
=
NULL
;
statusbar
->
showMessage
(
QString
(
" Stop recording python"
),
2000
);
action_Python_Recording
->
setText
(
"Python Recording"
);
return
;
}
...
...
@@ -927,6 +960,7 @@ void SCHNApps::beginPyRecording()
statusbar
->
showMessage
(
QString
(
" Recording python in "
)
+
fileName
);
pythonVarsClear
();
action_Python_Recording
->
setText
(
"Stop Python Recording"
);
}
else
{
...
...
@@ -954,6 +988,7 @@ void SCHNApps::appendPyRecording()
m_pyRecording
=
NULL
;
m_pyRecFile
=
NULL
;
statusbar
->
showMessage
(
QString
(
" Stop recording python"
),
2000
);
action_Append_Python_Recording
->
setText
(
"Append Python Recording"
);
return
;
}
...
...
@@ -978,7 +1013,7 @@ void SCHNApps::appendPyRecording()
}
statusbar
->
showMessage
(
QString
(
" Append recording python in "
)
+
fileName
);
action_Append_Python_Recording
->
setText
(
"Stop Append Python Recording"
);
}
else
{
...
...
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