Skip to content

Commit

Permalink
Create another rope space by positions or torsions depending on parent
Browse files Browse the repository at this point in the history
  • Loading branch information
helenginn committed Jul 24, 2023
1 parent 1939865 commit f219121
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions vagabond/gui/RopeSpaceItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,11 @@ RopeSpaceItem *RopeSpaceItem::newFrom(std::vector<HasMetadata *> &whiteList,
std::string title)
{
RopeSpaceItem *subset = new RopeSpaceItem(_entity);
subset->setMode(_type);
subset->setFixedTitle(title);
subset->setWhiteList(whiteList);
addItem(subset);
subset->makeView(_confView);
subset->setMode(_type);

subset->inheritAxis(this);

Expand All @@ -330,29 +330,42 @@ void RopeSpaceItem::inheritAxis(RopeSpaceItem *parent)

if (mg->indexOfObject(hm) >= 0)
{
TorsionCluster *tc = static_cast<TorsionCluster *>(_cluster);
_axes = new Axes(tc, old->instance());
_axes->takeOldAxes(old);
if (_type == ConfTorsions)
{
TorsionCluster *tc = static_cast<TorsionCluster *>(_cluster);
_axes = new Axes(tc, old->instance());
_axes->takeOldAxes(old);
}
else if (_type == ConfPositional)
{
PositionalCluster *pc = static_cast<PositionalCluster *>(_cluster);
_axes = new Axes(pc, old->instance());
_axes->takeOldAxes(old);

}
}
}

Axes *RopeSpaceItem::createReference(Instance *inst)
{
if (_type != ConfTorsions)
{
return nullptr;
}

Axes *old = _axes;
if (_axes != nullptr)
{
_confView->removeObject(_axes);
_confView->removeResponder(_axes);
}

TorsionCluster *tc = static_cast<TorsionCluster *>(_cluster);

_axes = new Axes(tc, inst);
if (_type == ConfTorsions)
{
TorsionCluster *tc = static_cast<TorsionCluster *>(_cluster);
_axes = new Axes(tc, inst);
}
else if (_type == ConfPositional)
{
PositionalCluster *pc = static_cast<PositionalCluster *>(_cluster);
_axes = new Axes(pc, inst);
}

_axes->setScene(_confView);
_axes->setIndexResponseView(_confView);

Expand Down

0 comments on commit f219121

Please sign in to comment.