Will attach if not currently attached.
1837{
1840 +QString(unpickable?"true":"false"));
1841 if (!simple||!detailed) {
1842 VP1Msg::messageVerbose(
"AssocObjAttachmentHandle::setPickableStateOfNodes ERROR: Called with null pointers!");
1843 return;
1844 }
1845 }
1847 int isimple =
m_d->septrack_simple->findChild(simple);
1849 if (
m_d->septrack_simple->getNumChildren()!=
m_d->septrack_detailed->getNumChildren()) {
1850 VP1Msg::message(
"ERROR: AssocObjAttachmentHandle::setPickableStateOfNodes septrack_simple->getNumChildren()"
1851 "!=m_d->septrack_detailed->getNumChildren().");
1852 return;
1853 }
1854 int idetailed =
m_d->septrack_detailed->findChild(detailed);
1855 if (idetailed!=isimple) {
1856 VP1Msg::message(
"ERROR: AssocObjAttachmentHandle::setPickableStateOfNodes"
1857 " called with simple and detailed nodes that are not at same child idx!");
1858 return;
1859 }
1862 VP1Msg::message(
"ERROR: AssocObjAttachmentHandle::setPickableStateOfNodes detected wrong pickStyleChildIdx");
1863 return;
1864 }
1865 }
1866 if (isimple<0) {
1868 " called with nodes that are not currently children. Calling attachNodes(..)." );
1870 return;
1871 }
1872 if (unpickable == (
m_d->pickStyleChildIdx>-1&&isimple>
m_d->pickStyleChildIdx)) {
1874 " already in correct state.");
1875 return;
1876 }
1877
1878 simple->ref();
1879 detailed->ref();
1880 if (unpickable) {
1881 m_d->septrack_simple->removeChild(simple);
1882 m_d->septrack_detailed->removeChild(detailed);
1883 if (
m_d->pickStyleChildIdx==-1) {
1884 m_d->pickStyleChildIdx =
m_d->septrack_simple->getNumChildren();
1887 } else {
1888 --(
m_d->pickStyleChildIdx);
1889 }
1890 m_d->septrack_simple->addChild(simple);
1891 m_d->septrack_detailed->addChild(detailed);
1892 } else {
1893 if (
m_d->pickStyleChildIdx==-1) {
1894 VP1Msg::message(
"ERROR: AssocObjAttachmentHandle::setPickableStateOfNodes Inconsistent logic");
1895 simple->unref();
1896 detailed->unref();
1897 return;
1898 }
1899 if (
m_d->pickStyleChildIdx==isimple-1&&isimple==
m_d->septrack_simple->getNumChildren()-1) {
1900
1904 m_d->pickStyleChildIdx = -1;
1905 } else {
1906
1907 m_d->septrack_simple->removeChild(simple);
1908 m_d->septrack_detailed->removeChild(detailed);
1909 m_d->septrack_simple->insertChild(simple,
m_d->pickStyleChildIdx);
1910 m_d->septrack_detailed->insertChild(detailed,
m_d->pickStyleChildIdx);
1911 ++(
m_d->pickStyleChildIdx);
1912 }
1913 }
1914 simple->unref();
1915 detailed->unref();
1916}
void attachNodes(SoNode *simple, SoNode *detailed, bool unpickable)
static void messageDebug(const QString &)