251 size_t fileWrite(
void* buffer,
size_t elemSize,
size_t count );
298 virtual void setBuffer(
void *bufPointer,
size_t initSize,
379 virtual void flushFile();
388 void setStage(Stage stage) { curStage = stage; }
389 Stage getStage()
const {
return curStage; }
393 void incrementIndent(
int amount = 1)
394 { indentLevel += amount; }
395 void decrementIndent(
int amount = 1)
396 { indentLevel -= amount; }
398 int getIndentLevel(){
return indentLevel; }
401 virtual void write(
bool b);
402 virtual void write(
char c);
403 virtual void write(
unsigned char c);
404 virtual void write(
const char *s);
405 virtual void write(
const SbString &s);
406 virtual void write(
const SbName &n);
407 virtual void write(int32_t i);
411 virtual void write(int64_t i);
415 virtual void write(uint32_t i);
419 virtual void write(uint64_t i);
420 virtual void write(
short s);
424 virtual void write(
unsigned short s);
425 virtual void write(
float f);
426 virtual void write(
double d);
427 virtual void writeBinaryArray(
unsigned char *c,
int length);
428 virtual void writeBinaryArray(int32_t *l,
int length);
429 virtual void writeBinaryArray(int64_t *l,
int length);
430 virtual void writeBinaryArray(
float *f,
int length);
431 virtual void writeBinaryArray(
double *d,
int length);
432 virtual void writeBinaryArray(
short *s,
int length);
435 virtual void indent();
439 SbBool isOutFileVRML2() {
return vrmlFileOut;}
440 SbBool isOutFileX3D() {
return x3dFileOut;}
441 SbBool isHeaderWritten() {
return wroteHeader;}
442 void incrementRefOut(
int amount = 1)
443 { refOut += amount; }
444 int getRefOut() {
return refOut;}
448 virtual void writeLargeBinaryArray(
unsigned char *c,
size_t length);
451 virtual void reset();
455 void setCompact(
SbBool flag) { compact = flag; }
456 SbBool isCompact()
const {
return compact; }
464 void setAnnotation(uint32_t bits)
465 { annotation = bits; }
466 uint32_t getAnnotation()
467 {
return (isCompact() ||
isBinary()) ? 0 : annotation; }
472 int findReferenceIfVRML2(
const SoBase *base)
const;
475 int addReferenceIfVRML2(
const SoBase *base);
478 virtual void addToVRML2Dict(
const SbString name,
const SoBase *base);
484 virtual void addToVRMLName(
const SoBase *base,
const char *name);
489 virtual char * findInVRMLName(
const SoBase *base)
const;
492 SbDict *PROTOToWrite;
495 int32_t isWritingBinArrayAsMemObj()
const;
497 SoOutputImpl* m_soOutputImpl;
503 struct SoOutputEntry {
511 float getIVVersion();
551 virtual SbBool setupFileProperties();
554 size_t bytesInBuf()
const
555 {
return (curBuf -
static_cast<char *
>(buffer) ); }
558 SbBool makeRoomInBuf(
size_t nBytes);
561 SbBool makeRoomInTmpBuf(
size_t nBytes);
565 int addReference(
const SoBase *base);
569 int findReference(
const SoBase *base)
const;
572 void convertShort(
short s,
char *to);
573 void convertInt32(int32_t l,
char *to);
574 void convertInt64(int64_t l,
char *to);
575 void convertFloat(
float f,
char *to);
576 void convertDouble(
double d,
char *to);
577 void convertShortArray(
short *from,
char *to,
int len);
578 void convertInt32Array( int32_t *from,
char *to,
int len);
579 void convertInt64Array( int64_t *from,
char *to,
int len);
580 void convertFloatArray(
float *from,
char *to,
int len);
581 void convertDoubleArray(
double *from,
char *to,
int len);
583 const char* getDoublesFormatString()
const;
585 const char* getFloatsFormatString()
const;
593 char m_floatsFmtString[16];
594 char m_doublesFmtString[16];
void * SoOutputReallocCB(void *ptr, size_t newSize)
Character string stored in a hash table.
List of generic (void *) pointers.
Class for smart character strings.
Base class for all nodes, paths, and engines.
Scene graph database class.
Used to write Open Inventor data files.
virtual FILE * getFilePointer() const
Returns the file pointer in use, or NULL if using a buffer.
int filePutc(int)
Write a byte to the currently open file.
static SbString getDefaultASCIIHeader()
Returns the string representing the default ASCII header.
virtual void resetBuffer()
Resets buffer for output again.
size_t fileWrite(void *buffer, size_t elemSize, size_t count)
Write a buffer to the currently open file.
virtual void resetHeaderString()
Resets the header for output files to be the default header.
int filePuts(const char *)
Write a string to the currently open file.
virtual void setHeaderString(const SbString &str)
Sets the header for output files.
virtual SoNONUNICODE SbBool openFile(const char *fileName)
Opens named file, sets current file to result.
virtual void closeFile()
Closes current file if opened with openFile().
virtual void setFilePointer(FILE *newFP)
Sets file pointer to write to.
virtual void setBuffer(void *bufPointer, size_t initSize, SoOutputReallocCB *reallocFunc, int32_t offset=0)
Sets up memory buffer to write to, initial size, reallocation function (which is called if there is n...
virtual ~SoOutput()
Destructor.
virtual size_t getBufferSize() const
The total number of bytes allocated to a memory buffer may be larger than the number of bytes written...
static SbString getDefaultBinaryHeader()
Returns the string representing the default binary header.
virtual SbBool openFile(const SbString &fileName)
Opens named file, sets current file to result.
virtual void setFloatPrecision(int precision)
Sets the precision for writing floating point numbers (type float), i.e. the number of significant di...
virtual SbBool isBinary() const
Returns current state of binary flag.
virtual void setBinary(SbBool flag)
Sets whether output should be ASCII (default) or binary.
virtual void setFileProperty(const FileProperty properties)
Sets a combination of properties for the current file.
FileProperty getFileProperty() const
Returns the current properties used by SoOutput.
virtual SbBool getBuffer(void *&bufPointer, size_t &nBytes) const
Returns memory buffer being written to and the new size of the buffer.
FileProperty
This enum defines the properties used when data are written to a file.
@ DefaultProperty
Regular ascii or binary output.
@ CompressedZlib
Compressed ascii or binary output using the zlib module.
virtual void setDoublePrecision(int precision)
Sets the precision for writing floating point numbers (type double), i.e. the number of significant d...
SbBool isWritingForScaleViz() const
Returns TRUE if ScaleViz is currently writing data for synchronization.
Stores runtime type information.