SOINPUT(3iv)
π SoInput(3IV) β the vibe check π
okay bestie, pull up a chair, we're reading SoInput(3IV) together and it's literally the little reader that goes through your Inventor data files. she's from the 3IV manual, she's iconic, she's giving file-parsing main character energy, and by the end of this you're gonna know her like the back of your hand. no cap. β¨
πΈ NAME πΈ
SoInput β used to read Inventor data files π«Ά
π¦ INHERITS FROM π¦
SoInput
(yes girl, she's her own ancestor situation, it's fine, we don't question it π )
β¨ SYNOPSIS β¨
#include <Inventor/SoInput.h>
Methods from class SoInput:
SoInput()
~SoInput()
static void addDirectoryFirst(const char *dirName)
static void addDirectoryLast(const char *dirName)
static void addEnvDirectoriesFirst(const char
*envVarName)
static void addEnvDirectoriesLast(const char *envVarName)
static void removeDirectory(const char *dirName)
static void clearDirectories()
static const SbStringList & getDirectories()
void setFilePointer(FILE *newFP)
SbBool openFile(const char *fileName, SbBool
okIfNotFound = FALSE)
SbBool pushFile(const char *fileName)
closeFile()
SbBool isValidFile()
FILE * getCurFile() const
const char * getCurFileName() const
void setBuffer(void *bufPointer, size_t bufSize)
SbString getHeader()
float getIVVersion()
π DESCRIPTION π
So listen. This class is what the SoDB reading routines use when they're out here reading Inventor data files. She supports both ASCII (that's the default, periodt) and binary Inventor formats. And you can even register extra valid file headers, which is such a slay. π
When she's reading, SoInput skips right over Inventor comments (that's from # all the way to end of line, bye π) and she can stack input files β like a little stack of snacks. And when EOF hits? The stack gets popped. Popped, bestie. π
She can also read from a buffer in memory. Versatile queen. π
π METHODS π
SoInput()~SoInput()
Constructor and destructor, the classic duo. The default SoInput reads from stdin. And the destructor closes any files that the SoInput opened β she cleans up after herself, we love a responsible icon. π§
static void addDirectoryFirst(const char *dirName)static void addDirectoryLast(const char *dirName)static void addEnvDirectoriesFirst(const char *envVarName)static void addEnvDirectoriesLast(const char *envVarName)
So the SoInput class keeps a global list of directories that gets searched to find files when opening them. Directories are searched in order, okay, order matters, don't come for her. Each of these routines adds directories to the list, either at the beginning ("First") or at the end ("Last"). The last two routines add directories named in the value of the given environment variable. And inside that variable's value, directories may be separated by colons or whitespace. π«
static void removeDirectory(const char *dirName)
Removes the named directory from the list. Gone. Not invited back. π
static void clearDirectories()
Clears the list of directories β and yes, that includes the current directory too. Full reset, no survivors. π
static const SbStringList & getDirectories()
Returns the list of directories as an SbStringList. Handing you the whole list, bestie. π
void setFilePointer(FILE *newFP)
Sets the file pointer to read from. And if necessary, she clears the stack of input files. Out with the old. β¨
SbBool openFile(const char *fileName, SbBool okIfNotFound = FALSE)
Opens the named file and sets the file pointer to the result. Clears the stack of input files if necessary. This returns FALSE on error. And here's the tea: if okIfNotFound is FALSE (which is the default), she prints an error message if the file could not be found. So don't be surprised, okay? π
SbBool pushFile(const char *fileName)
Opens the named file and pushes the resulting file pointer onto the stack. Returns FALSE on error. Stacked. π
closeFile()
Closes all files on the stack that were opened with openFile() or pushFile(). Every single one. π
SbBool isValidFile()
Returns TRUE if the currently open file is a valid Inventor file β meaning it begins with a valid Inventor header, or one that's been registered with SoDB::registerHeader. Validation check, we love to see it. π₯
FILE * getCurFile() const
Returns a pointer to the current file, or NULL if she's reading from a buffer. π¦
const char * getCurFileName() const
Returns the full name (including the directory path) of the current file, or NULL if she's reading from a buffer. Full name, no nicknames. π
void setBuffer(void *bufPointer, size_t bufSize)
Sets an in-memory buffer to read from, along with its size. Buffer era. πΈ
SbString getHeader()
Returns the header of the file being read. The header! π
float getIVVersion()
Returns the Inventor file version of the file being read (e.g. 2.1). And if the file has a header registered through SoDB::registerHeader(), then the returned version is the Inventor version registered with that header. Version check, slay. β
π SEE ALSO π
SoDB, SoOutput, SoTranReceiver
and that's the whole page, bestie!! π«Ά this was SoInput(3IV)() from the 3IV manual β version and date info live right there in that footer, so consider this your cute little sign-off: SoInput(3IV)(), mwah, go read some Inventor files, you've got this πβ¨π
π¦ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 Β· LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 Β· LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 Β· LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms