From c1f8359fbd594c2e96b61f2cbc9088a7d91c7d86 Mon Sep 17 00:00:00 2001 From: Bastiaan Veelo Date: Tue, 23 Jun 2026 16:37:56 +0200 Subject: [PATCH] Remove deprecated code in preparation for Coin 5. --- include/Inventor/SoInput.h | 4 - include/Inventor/SoRenderManager.h | 2 - .../elements/SoGLTexture3EnabledElement.h | 38 ---------- .../elements/SoTexture3EnabledElement.h | 38 ---------- src/io/SoInput.cpp | 76 ------------------- src/io/SoInput_FileInfo.cpp | 69 ----------------- src/io/SoInput_FileInfo.h | 6 -- src/rendering/SoRenderManager.cpp | 42 ---------- 8 files changed, 275 deletions(-) delete mode 100644 include/Inventor/elements/SoGLTexture3EnabledElement.h delete mode 100644 include/Inventor/elements/SoTexture3EnabledElement.h diff --git a/include/Inventor/SoInput.h b/include/Inventor/SoInput.h index a9f2993fd6c..83a1da66ad6 100644 --- a/include/Inventor/SoInput.h +++ b/include/Inventor/SoInput.h @@ -94,7 +94,6 @@ class COIN_DLL_API SoInput { virtual SbBool get(char & c); virtual SbBool getASCIIBuffer(char & c); virtual SbBool getASCIIFile(char & c); - virtual SbBool readHex(uint32_t & l); virtual SbBool read(char & c); virtual SbBool read(char & c, SbBool skip); virtual SbBool read(SbString & s); @@ -165,9 +164,6 @@ class COIN_DLL_API SoInput { SbBool readInteger(int32_t & l); SbBool readUnsignedInteger(uint32_t & l); SbBool readReal(double & d); - SbBool readUnsignedIntegerString(char * str); - int readDigits(char * str); - int readHexDigits(char * str); int readChar(char * str, char charToRead); SbBool makeRoomInBuf(size_t nBytes); diff --git a/include/Inventor/SoRenderManager.h b/include/Inventor/SoRenderManager.h index bb0b80a9e56..142e8fc28b3 100644 --- a/include/Inventor/SoRenderManager.h +++ b/include/Inventor/SoRenderManager.h @@ -221,9 +221,7 @@ class COIN_DLL_API SoRenderManager { private: void attachRootSensor(SoNode * const sceneroot); - void attachClipSensor(SoNode * const sceneroot); void detachRootSensor(void); - void detachClipSensor(void); static void nodesensorCB(void * data, SoSensor *); static void prerendercb(void * userdata, SoGLRenderAction * action); diff --git a/include/Inventor/elements/SoGLTexture3EnabledElement.h b/include/Inventor/elements/SoGLTexture3EnabledElement.h deleted file mode 100644 index 7c8c7aa1430..00000000000 --- a/include/Inventor/elements/SoGLTexture3EnabledElement.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef COIN_SOGLTEXTURE3ENABLEDELEMENT_H -#define COIN_SOGLTEXTURE3ENABLEDELEMENT_H - -/**************************************************************************\ - * Copyright (c) Kongsberg Oil & Gas Technologies AS - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -\**************************************************************************/ - -#error Deprecated: use SoMultiTextureEnabledElement instead - -#endif // !COIN_SOGLTEXTURE3ENABLEDELEMENT_H diff --git a/include/Inventor/elements/SoTexture3EnabledElement.h b/include/Inventor/elements/SoTexture3EnabledElement.h deleted file mode 100644 index 61bbce0fb3b..00000000000 --- a/include/Inventor/elements/SoTexture3EnabledElement.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef COIN_SOTEXTURE3ENABLEDELEMENT_H -#define COIN_SOTEXTURE3ENABLEDELEMENT_H - -/**************************************************************************\ - * Copyright (c) Kongsberg Oil & Gas Technologies AS - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -\**************************************************************************/ - -#error Deprecated: use SoMultiTextureEnabledElement instead - -#endif // !COIN_SOTEXTURE3ENABLEDELEMENT_H diff --git a/src/io/SoInput.cpp b/src/io/SoInput.cpp index c91493ca6bc..164b8ba4ef3 100644 --- a/src/io/SoInput.cpp +++ b/src/io/SoInput.cpp @@ -859,37 +859,6 @@ SoInput::getASCIIFile(char & c) return this->get(c); } -/*! - Reads an unsigned integer in hexadecimal format from the current stream. - Note that no error checking is done to see if it actually is a hex - format value. - - A number in hexadecimal format must have the "0x" prefix. - - Returns \c FALSE if end of file is encountered. -*/ -SbBool -SoInput::readHex(uint32_t & l) -{ - assert(!this->isBinary()); - - // FIXME: this is a tremendously stupid function. Should obsolete it. - - // FIXME: no checking for array overwriting. Dangerous. 19990625 mortene. - char buffer[1024]; - char * bufptr = buffer; - - if (this->readChar(bufptr, '0')) { - if (this->readChar(bufptr + 1, 'x')) { - bufptr += 2 + this->readHexDigits(bufptr + 2); - } - } - - *bufptr = '\0'; - sscanf(buffer, "%x", &l); - return TRUE; -} - /*! Skips whitespace and reads next character in input stream. Returns \c FALSE if encountering end of file. @@ -2243,51 +2212,6 @@ SoInput::readReal(double & d) return fi->readReal(d); } -/*! - Reads a set of bytes from the stream making up an unsigned integer and - puts them at \a str. - - Returns \c FALSE if no string representing an unsigned integer could be - read. - - \deprecated Will not be available in Coin 5 due to absence of bounds checking. - */ -SbBool -SoInput::readUnsignedIntegerString(char * str) -{ - SoInput_FileInfo * fi = PRIVATE(this)->getTopOfStackPopOnEOF(); - if (!fi) return FALSE; - return fi->readUnsignedIntegerString(str); -} - -/*! - Read decimal base digits from the current input stream into \a str and - returns the number of characters read. - - \deprecated Will not be available in Coin 5 due to absence of bounds checking. - */ -int -SoInput::readDigits(char * str) -{ - SoInput_FileInfo * fi = PRIVATE(this)->getTopOfStackPopOnEOF(); - if (!fi) return FALSE; - return fi->readDigits(str); -} - -/*! - Read hexadecimal base digits from the current input stream into \a str and - returns the number of characters read. - - \deprecated Will not be available in Coin 5 due to absence of bounds checking. - */ -int -SoInput::readHexDigits(char * str) -{ - SoInput_FileInfo * fi = PRIVATE(this)->getTopOfStackPopOnEOF(); - if (!fi) return FALSE; - return fi->readHexDigits(str); -} - /*! Reads the next character in stream and compares it to \a charToRead. Returns \c 1 on success, \c 0 on failure. Failure may come from either diff --git a/src/io/SoInput_FileInfo.cpp b/src/io/SoInput_FileInfo.cpp index 4cffb982254..74f6270275c 100644 --- a/src/io/SoInput_FileInfo.cpp +++ b/src/io/SoInput_FileInfo.cpp @@ -517,34 +517,6 @@ SoInput_FileInfo::readUnsignedIntegerString() return TRUE; } -/*! - \deprecated Will not be available in Coin 5 due to absence of bounds checking. - */ -SbBool -SoInput_FileInfo::readUnsignedIntegerString(char * str) -{ - assert(!this->isBinary()); - int minSize = 1; - char * s = str; - - if (this->readChar(s, '0')) { - if (this->readChar(s + 1, 'x')) { - s += 2 + this->readHexDigits(s + 2); - minSize = 3; - } - else - s += 1 + this->readDigits(s + 1); - } - else - s += this->readDigits(s); - - if (s - str < minSize) - return FALSE; - - *s = '\0'; - return TRUE; -} - SbBool SoInput_FileInfo::readUnsignedInteger(uint32_t & l) { @@ -735,27 +707,6 @@ SoInput_FileInfo::readDigits() return (int)offset; } -/*! - \deprecated Will not be available in Coin 5 due to absence of bounds checking. - */ -int -SoInput_FileInfo::readDigits(char * str) -{ - assert(!this->isBinary()); - char c, * s = str; - - while (this->get(c)) { - if (isdigit(c)) - *s++ = c; - else { - this->putBack(c); - break; - } - } - const ptrdiff_t offset = s - str; - return (int)offset; -} - int SoInput_FileInfo::readHexDigits() { @@ -774,23 +725,3 @@ SoInput_FileInfo::readHexDigits() const ptrdiff_t offset = readString.length() - oldLength; return (int)offset; } - -/*! - \deprecated Will not be available in Coin 5 due to absence of bounds checking. - */ -int -SoInput_FileInfo::readHexDigits(char * str) -{ - assert(!this->isBinary()); - char c, * s = str; - while (this->get(c)) { - - if (isxdigit(c)) *s++ = c; - else { - this->putBack(c); - break; - } - } - const ptrdiff_t offset = s - str; - return (int)offset; -} diff --git a/src/io/SoInput_FileInfo.h b/src/io/SoInput_FileInfo.h index 250c36e2466..da1b083634d 100644 --- a/src/io/SoInput_FileInfo.h +++ b/src/io/SoInput_FileInfo.h @@ -203,13 +203,7 @@ class SoInput_FileInfo { void connectRoutes(SoInput * in); void unrefProtos(void); int readChar(char * s, char charToRead); - COIN_DEPRECATED("Unsafe, will be removed from Coin 5") - int readDigits(char * str); - COIN_DEPRECATED("Unsafe, will be removed from Coin 5") - int readHexDigits(char * str); - COIN_DEPRECATED("Unsafe, will be removed from Coin 5") - SbBool readUnsignedIntegerString(char * str); SbBool readUnsignedInteger(uint32_t & l); SbBool readInteger(int32_t & l); SbBool readReal(double & d); diff --git a/src/rendering/SoRenderManager.cpp b/src/rendering/SoRenderManager.cpp index afc721524f7..f8354f2c5f8 100644 --- a/src/rendering/SoRenderManager.cpp +++ b/src/rendering/SoRenderManager.cpp @@ -333,7 +333,6 @@ SoRenderManager::~SoRenderManager() void SoRenderManager::setSceneGraph(SoNode * const sceneroot) { - //this->detachClipSensor(); this->detachRootSensor(); // Don't unref() until after we've set up the new root, in case the // old root == the new sceneroot. (Just to be that bit more robust.) @@ -344,7 +343,6 @@ SoRenderManager::setSceneGraph(SoNode * const sceneroot) if (PRIVATE(this)->scene) { PRIVATE(this)->scene->ref(); this->attachRootSensor(PRIVATE(this)->scene); - //this->attachClipSensor(PRIVATE(this)->scene); } if (oldroot) oldroot->unref(); @@ -388,8 +386,6 @@ SoRenderManager::getCamera(void) const Internal callback \param[in] data Pointer to SoRenderManager - - \deprecated Will be made private in a later version of Coin */ void SoRenderManager::nodesensorCB(void * data, SoSensor * /* sensor */) @@ -405,8 +401,6 @@ SoRenderManager::nodesensorCB(void * data, SoSensor * /* sensor */) Attaches this SoRenderManagers root sensor to a scene \param[in] sceneroot scene to attach to - - \deprecated Will be private available in Coin 4 */ void SoRenderManager::attachRootSensor(SoNode * const sceneroot) @@ -427,8 +421,6 @@ SoRenderManager::attachRootSensor(SoNode * const sceneroot) /* Detaches the rootsensor from all tracked scenes - - \deprecated Will not be available in Coin 4 */ void SoRenderManager::detachRootSensor(void) @@ -438,38 +430,6 @@ SoRenderManager::detachRootSensor(void) } } -/* - Attaches this SoRenderManagers clipsensor to a scene - - \param[in] sceneroot scene to attach to - - \deprecated Will not be available in Coin 5 -*/ -void -SoRenderManager::attachClipSensor(SoNode * const sceneroot) -{ - //PRIVATE(this)->clipsensor->attach(sceneroot); - //if (PRIVATE(this)->autoclipping != SoRenderManager::NO_AUTO_CLIPPING) { - // PRIVATE(this)->clipsensor->schedule(); - //} -} - -/* - Detaches the clipsensor from all tracked scenes - - \deprecated Will not be available in Coin 5 -*/ -void -SoRenderManager::detachClipSensor(void) -{ - //if (PRIVATE(this)->clipsensor->isScheduled()) { - // PRIVATE(this)->clipsensor->unschedule(); - //} - //if (PRIVATE(this)->clipsensor->getAttachedNode()) { - // PRIVATE(this)->clipsensor->detach(); - //} -} - /*! Clears buffers with the background color set correctly @@ -492,8 +452,6 @@ SoRenderManager::clearBuffers(SbBool color, SbBool depth) \param[in] userdata GLbitfield mask \param[in] action Calling action - - \deprecated Will be made private in a later version of Coin */ void SoRenderManager::prerendercb(void * userdata, SoGLRenderAction * action)