Commit 5ad110ec authored by T.J. Corona's avatar T.J. Corona

Registrars: unregister operations from groups

parent b534a8b0
......@@ -44,6 +44,10 @@ void Registrar::registerTo(const smtk::operation::Manager::Ptr& operationManager
void Registrar::unregisterFrom(const smtk::operation::Manager::Ptr& operationManager)
{
smtk::operation::ReaderGroup(operationManager).unregisterOperation<smtk::attribute::Read>();
smtk::operation::WriterGroup(operationManager).unregisterOperation<smtk::attribute::Write>();
operationManager->unregisterOperations<OperationList>();
}
......
......@@ -61,6 +61,14 @@ void Registrar::registerTo(const smtk::operation::Manager::Ptr& operationManager
void Registrar::unregisterFrom(const smtk::operation::Manager::Ptr& operationManager)
{
smtk::operation::ImporterGroup(operationManager).unregisterOperation<smtk::mesh::Import>();
smtk::operation::ExporterGroup(operationManager).unregisterOperation<smtk::mesh::Export>();
smtk::operation::ReaderGroup(operationManager).unregisterOperation<smtk::mesh::Read>();
smtk::operation::WriterGroup(operationManager).unregisterOperation<smtk::mesh::Write>();
operationManager->unregisterOperations<OperationList>();
}
......
......@@ -42,6 +42,7 @@ public:
using Group::operationNames;
using Group::operationName;
using Group::operationLabel;
using Group::unregisterOperation;
static constexpr const char* const type_name = "creator";
......
......@@ -40,6 +40,7 @@ public:
using Group::has;
using Group::operations;
using Group::operationNames;
using Group::unregisterOperation;
ResourceIOGroup(const std::string& name, std::shared_ptr<smtk::operation::Manager> manager)
: Group(name, manager)
......@@ -142,8 +143,8 @@ bool ResourceIOGroup::registerOperation(
return false;
}
}
return (Group::registerOperation(typeName, { smtk::common::typeName<ResourceType>() }) &&
m_fileItemName.registerOperation(typeName, { fileItemName }));
return (m_fileItemName.registerOperation(typeName, { fileItemName }) &&
Group::registerOperation(typeName, { smtk::common::typeName<ResourceType>() }));
}
template <typename ResourceType>
......@@ -179,8 +180,8 @@ bool ResourceIOGroup::registerOperation(
return false;
}
}
return (Group::registerOperation(index, { smtk::common::typeName<ResourceType>() }) &&
m_fileItemName.registerOperation(index, { fileItemName }));
return (m_fileItemName.registerOperation(index, { fileItemName }) &&
Group::registerOperation(index, { smtk::common::typeName<ResourceType>() }));
}
template <typename ResourceType, typename OperationType>
......@@ -216,10 +217,10 @@ bool ResourceIOGroup::registerOperation(const std::string& fileItemName)
return false;
}
}
return (Group::registerOperation(std::type_index(typeid(OperationType)).hash_code(),
{ smtk::common::typeName<ResourceType>() }) &&
m_fileItemName.registerOperation(
std::type_index(typeid(OperationType)).hash_code(), { fileItemName }));
return (m_fileItemName.registerOperation(
std::type_index(typeid(OperationType)).hash_code(), { fileItemName }) &&
Group::registerOperation(std::type_index(typeid(OperationType)).hash_code(),
{ smtk::common::typeName<ResourceType>() }));
}
template <typename OperationType>
......
......@@ -84,6 +84,18 @@ void Registrar::unregisterFrom(const smtk::resource::Manager::Ptr& resourceManag
void Registrar::unregisterFrom(const smtk::operation::Manager::Ptr& operationManager)
{
smtk::operation::ImporterGroup(operationManager)
.unregisterOperation<smtk::session::discrete::ImportOperation>();
smtk::operation::ImporterGroup(operationManager)
.unregisterOperation<smtk::session::discrete::ReadOperation>();
smtk::operation::ReaderGroup(operationManager)
.unregisterOperation<smtk::session::discrete::ReadResource>();
smtk::operation::ReaderGroup(operationManager).unregisterOperation<LegacyReadResource>();
smtk::operation::WriterGroup(operationManager)
.unregisterOperation<smtk::session::discrete::WriteResource>();
operationManager->unregisterOperations<OperationList>();
}
}
......
......@@ -69,6 +69,16 @@ void Registrar::unregisterFrom(const smtk::resource::Manager::Ptr& resourceManag
void Registrar::unregisterFrom(const smtk::operation::Manager::Ptr& operationManager)
{
smtk::operation::CreatorGroup(operationManager)
.unregisterOperation<smtk::session::mesh::CreateUniformGrid>();
smtk::operation::ImporterGroup(operationManager)
.unregisterOperation<smtk::session::mesh::Import>();
smtk::operation::ReaderGroup(operationManager).unregisterOperation<smtk::session::mesh::Read>();
smtk::operation::WriterGroup(operationManager).unregisterOperation<smtk::session::mesh::Write>();
operationManager->unregisterOperations<OperationList>();
}
}
......
......@@ -72,6 +72,16 @@ void Registrar::unregisterFrom(const smtk::resource::Manager::Ptr& resourceManag
void Registrar::unregisterFrom(const smtk::operation::Manager::Ptr& operationManager)
{
smtk::operation::CreatorGroup(operationManager)
.unregisterOperation("smtk.session.multiscale.import_from_deform.import_from_deform");
smtk::operation::ImporterGroup(operationManager)
.unregisterOperation<smtk::session::mesh::Import>();
smtk::operation::ReaderGroup(operationManager).unregisterOperation<smtk::session::mesh::Read>();
smtk::operation::WriterGroup(operationManager).unregisterOperation<smtk::session::mesh::Write>();
operationManager->unregisterOperations<OperationList>();
operationManager->unregisterOperation(
"smtk.session.multiscale.import_from_deform.import_from_deform");
......
......@@ -79,6 +79,15 @@ void Registrar::unregisterFrom(const smtk::resource::Manager::Ptr& resourceManag
void Registrar::unregisterFrom(const smtk::operation::Manager::Ptr& operationManager)
{
smtk::operation::CreatorGroup(operationManager)
.unregisterOperation<smtk::session::oscillator::EditDomain>();
smtk::operation::ReaderGroup(operationManager)
.unregisterOperation<smtk::session::oscillator::Read>();
smtk::operation::WriterGroup(operationManager)
.unregisterOperation<smtk::session::oscillator::Write>();
operationManager->unregisterOperations<OperationList>();
}
}
......
......@@ -93,6 +93,22 @@ void Registrar::unregisterFrom(const smtk::resource::Manager::Ptr& resourceManag
void Registrar::unregisterFrom(const smtk::operation::Manager::Ptr& operationManager)
{
smtk::operation::CreatorGroup(operationManager)
.unregisterOperation<smtk::session::polygon::CreateModel>();
#ifdef VTK_SUPPORT
smtk::operation::ImporterGroup(operationManager)
.unregisterOperation<smtk::session::polygon::Import>();
#endif
smtk::operation::ReaderGroup(operationManager)
.unregisterOperation<smtk::session::polygon::Read>();
smtk::operation::ReaderGroup(operationManager)
.unregisterOperation<smtk::session::polygon::LegacyRead>();
smtk::operation::WriterGroup(operationManager)
.unregisterOperation<smtk::session::polygon::Write>();
operationManager->unregisterOperations<OperationList>();
}
}
......
......@@ -88,6 +88,24 @@ void Registrar::unregisterFrom(const smtk::resource::Manager::Ptr& resourceManag
void Registrar::unregisterFrom(const smtk::operation::Manager::Ptr& operationManager)
{
#ifdef ENABLE_PYARC_BINDINGS
smtk::operation::ExporterGroup(operationManager)
.unregisterOperation("smtk.session.rgg.export_to_pyarc.export_to_pyarc");
#endif
smtk::operation::CreatorGroup(operationManager)
.unregisterOperation<smtk::session::rgg::CreateModel>();
// smtk::operation::ImporterGroup(operationManager)
// .unregisterOperation<smtk::session::rgg::ReadRXFFile>();
// smtk::operation::ReaderGroup(operationManager)
// .unregisterOperation<smtk::session::rgg::Read>();
// smtk::operation::WriterGroup(operationManager)
// .unregisterOperation<smtk::session::rgg::Write>();
operationManager->unregisterOperations<OperationList>();
}
}
......
......@@ -68,6 +68,19 @@ void Registrar::unregisterFrom(const smtk::resource::Manager::Ptr& resourceManag
void Registrar::unregisterFrom(const smtk::operation::Manager::Ptr& operationManager)
{
smtk::operation::ReaderGroup(operationManager).unregisterOperation<smtk::session::vtk::Read>();
smtk::operation::ReaderGroup(operationManager)
.unregisterOperation<smtk::session::vtk::LegacyRead>();
smtk::operation::WriterGroup(operationManager).unregisterOperation<smtk::session::vtk::Write>();
smtk::operation::ExporterGroup(operationManager)
.unregisterOperation<smtk::session::vtk::Export>();
smtk::operation::ImporterGroup(operationManager)
.unregisterOperation<smtk::session::vtk::Import>();
operationManager->unregisterOperations<OperationList>();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment