Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Francesca
Ginkgo
Commits
d92b15dc
Commit
d92b15dc
authored
Nov 28, 2019
by
FPoupon
Browse files
Add a method to unregister an object from Anatomist
parent
209dc9b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
anatomist-plugin/src/library/gkg-anatomist-plugin-server/AnatomistServer.cxx
View file @
d92b15dc
...
...
@@ -8,6 +8,7 @@
#include <anatomist/commands/cCreateWindow.h>
#include <anatomist/commands/cCloseWindow.h>
#include <anatomist/commands/cDeleteAll.h>
#include <anatomist/commands/cRemoveObject.h>
#include <anatomist/commands/cAddObject.h>
#include <anatomist/commands/cCamera.h>
#include <anatomist/commands/cSetObjectPalette.h>
...
...
@@ -392,15 +393,10 @@ void gkg::AnatomistServer::removeAllObjects()
while
(
o
!=
oe
)
{
if
(
*
o
)
if
(
theAnatomist
->
hasObject
(
*
o
)
&&
(
*
o
)
->
CanBeDestroyed
()
)
{
if
(
(
*
o
)
->
CanBeDestroyed
()
)
{
n
+=
theAnatomist
->
destroyObject
(
*
o
);
}
n
+=
theAnatomist
->
destroyObject
(
*
o
);
}
...
...
@@ -684,7 +680,7 @@ void gkg::AnatomistServer::addObject( anatomist::AObject* aObject,
}
theAnatomist
->
registerObject
(
aObject
);
theAnatomist
->
registerObject
(
aObject
,
0
);
}
...
...
@@ -696,6 +692,42 @@ void gkg::AnatomistServer::addObject( anatomist::AObject* aObject,
}
void
gkg
::
AnatomistServer
::
removeObject
(
const
std
::
string
&
name
)
{
try
{
if
(
name
.
empty
()
)
{
throw
std
::
runtime_error
(
"object name must be specified"
);
}
if
(
theAnatomist
)
{
std
::
map
<
std
::
string
,
anatomist
::
AObject
*
>::
iterator
o
=
_objects
.
find
(
name
);
if
(
o
!=
_objects
.
end
()
)
{
theAnatomist
->
unregisterObject
(
o
->
second
);
_objects
.
erase
(
o
);
}
}
}
GKG_CATCH
(
"void gkg::AnatomistServer::removeObject( "
"const std::string& name )"
);
}
void
gkg
::
AnatomistServer
::
fusion2D
(
const
std
::
string
&
vol1
,
const
std
::
string
&
vol2
,
const
std
::
string
&
method
,
...
...
anatomist-plugin/src/library/gkg-anatomist-plugin-server/AnatomistServer.h
View file @
d92b15dc
...
...
@@ -82,6 +82,7 @@ class AnatomistServer : public Singleton< AnatomistServer >
bool
absmode
=
false
);
void
addObject
(
anatomist
::
AObject
*
aObject
,
const
std
::
string
&
name
);
void
removeObject
(
const
std
::
string
&
name
);
void
fusion2D
(
const
std
::
string
&
vol1
,
const
std
::
string
&
vol2
,
...
...
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