I was preparing a Christmas present for those requesting to hide constraints selectively. However, when implementing SmSwitchboard as the node for the constraints I have hit a rock.
I was expecting that it would be nothing more than changing the SoGroup of the constraints by this new node and that all the rest of the Coin3d implementation would just follow. However:
1) When changing it and making the visibility of all constraints "enabled" it crashes during the traverse:
Code: Select all
void
SmSwitchboard::doAction(SoAction * action)
{
(...)
} else { // not a GetBoundingBoxAction
for ( int idx = 0; idx < this->enable.getNum(); idx++ ) {
if ( this->enable[idx] ) {
const int numchildren = this->children->getLength();
if ( numchildren > 0 )
action->traverse((*this->children)[idx % numchildren]);
}
}
}
}
3) If we just make visible the first 13 constraints, preselection does not work on them. When executing:
Code: Select all
bool ViewProviderSketch::mouseMove(const SbVec2s &cursorPos, Gui::View3DInventorViewer *viewer)
Code: Select all
bool ViewProviderSketch::detectPreselection(const SoPickedPoint *Point,
const Gui::View3DInventorViewer *viewer,
const SbVec2s &cursorPos)
With that modification it goes thru to:
Code: Select all
std::set<int> ViewProviderSketch::detectPreselectionConstr(const SoPickedPoint *Point,
const Gui::View3DInventorViewer *viewer,
const SbVec2s &cursorPos)
Code: Select all
if (edit->constrGroup->getChild(i) == tailFather) {
If you have read until here, you will realize that I am going nuts with this issue. I can not figure it out.
I have uploaded this branch:
https://github.com/abdullahtahiriyo/Fre ... d_problems
If somebody has to time to take a look at the code, maybe a second pair of eyes can see an obvious problem that I am totally missing.