Commit e984306e authored by David Thompson's avatar David Thompson
Browse files

Fixes.

parent a1b3e753
......@@ -38,7 +38,6 @@ public:
template<typename... Args>
AssignedIds(const std::shared_ptr<IdSpace>& space, Nature nature, IdType begin, IdType end, Args&&... args)
// : smtk::markup::Component(std::forward<Args>(args)...)
: m_space(space)
, m_range(IdRange{begin, end})
, m_nature(nature)
......
......@@ -10,14 +10,14 @@
#include "nlohmann/json.hpp"
namespace smtk {namespace markup { class Group; } }
namespace smtk {namespace markup { class Label; } }
namespace smtk
{
namespace markup
{
class Group;
class Label;
class SMTKMARKUP_EXPORT Component : public smtk::graph::Component
{
public:
......
......@@ -38,7 +38,7 @@ void Registrar::registerTo(const smtk::resource::Manager::Ptr& resourceManager)
// Providing a write method to the resource manager is what allows
// modelbuilder's pqSMTKSaveResourceBehavior to determine how to write
// the resource when users click "Save Resource" or ⌘S/⌃S.
resourceManager->registerResource<smtk::markup::Resource>(read, write);
resourceManager->registerResource<smtk::markup::Resource>(read, write, create);
// Beyond registering the resource type, we now prepare the resource by
// registering domain and node types to their respective factories.
......
// Copyright © Kitware Inc under the [BSD-3-clause license](https://opensource.org/licenses/BSD-3-Clause).
#ifndef smtk_markup_Groups_h
#define smtk_markup_Groups_h
#include "smtk/markup/Exports.h"
namespace smtk
{
namespace markup
{
// Node types
class Component;
class Group;
// Forward declare arc types
class Groups; // 1 Component → N Group
class Members; // 1 Group → M Component
class SMTKMARKUP_EXPORT Groups : public smtk::graph::Arcs<Component, Group, Groups>
{
public:
using InverseArcType = Members;
using smtk::graph::Arcs<Component, Group, Groups>::Arcs;
};
class SMTKMARKUP_EXPORT Members : public smtk::graph::Arcs<Group, Component, Members>
{
public:
using InverseArcType = Groups;
using smtk::graph::Arcs<Group, Component, Members>::Arcs;
};
} // namespace markup
} // namespace smtk
#endif // smtk_markup_Groups_h
......@@ -35,7 +35,6 @@ void to_json(nlohmann::json& j, const smtk::markup::Resource::Ptr& resource)
// Some nodes may use string tokens, so we must serialize that map if it exists.
auto& tokenManager = smtk::string::Token::manager();
std::cout << "token manager " << &tokenManager << " " << (tokenManager.empty() ? "E" : "F") << "\n";
if (!tokenManager.empty())
{
j["tokens"] = tokenManager.shared_from_this();
......
......@@ -22,9 +22,13 @@ int TestResource(int argc, char** argv)
auto label = resource->createNode<Label>();
label->setName("foo");
/*
auto group = std::make_shared<Group>(nullptr, smtk::common::UUID::random());
group->setName("barf");
resource->add(group);
*/
auto group = resource->createNode<Group>();
group->setName("barf");
auto components = resource->filter("*");
std::size_t nn = components.size();
std::cout << "Created " << resource << " with " << nn << " components.\n";
......
Supports Markdown
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