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