HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor Class Reference

#include <GridDescriptor.h>

Public Member Functions

 GridDescriptor ()
 
 GridDescriptor (const Name &name, const Name &gridType, bool saveFloatAsHalf=false)
 
 GridDescriptor (const GridDescriptor &)=default
 
GridDescriptoroperator= (const GridDescriptor &)=default
 
 ~GridDescriptor ()
 
const NamegridType () const
 
const NamegridName () const
 
const NameuniqueName () const
 
const NameinstanceParentName () const
 
void setInstanceParentName (const Name &name)
 
bool isInstance () const
 
bool saveFloatAsHalf () const
 
void setGridPos (int64_t pos)
 
int64_t getGridPos () const
 
void setBlockPos (int64_t pos)
 
int64_t getBlockPos () const
 
void setEndPos (int64_t pos)
 
int64_t getEndPos () const
 
void seekToGrid (std::istream &) const
 
void seekToBlocks (std::istream &) const
 
void seekToEnd (std::istream &) const
 
void seekToGrid (std::ostream &) const
 
void seekToBlocks (std::ostream &) const
 
void seekToEnd (std::ostream &) const
 
void writeHeader (std::ostream &) const
 Write out this descriptor's header information (all data except for stream offsets). More...
 
void writeStreamPos (std::ostream &) const
 Since positions into the stream are known at a later time, they are written out separately. More...
 
GridBase::Ptr read (std::istream &)
 Read a grid descriptor from the given stream. More...
 

Static Public Member Functions

static Name addSuffix (const Name &, int n)
 Append the number n to the given name (separated by an ASCII "record separator" character) and return the resulting name. More...
 
static Name stripSuffix (const Name &)
 Strip from the given name any suffix that is separated by an ASCII "record separator" character and return the resulting name. More...
 
static std::string nameAsString (const Name &)
 Given a name with suffix N, return "name[N]", otherwise just return "name". Use this to produce a human-readable string from a descriptor's unique name. More...
 
static Name stringAsUniqueName (const std::string &)
 Given a string of the form "name[N]", return "name" with the suffix N separated by an ASCII "record separator" character). Otherwise just return the string as is. More...
 

Detailed Description

This structure stores useful information that describes a grid on disk. It can be used to retrieve I/O information about the grid such as offsets into the file where the grid is located, its type, etc.

Definition at line 46 of file GridDescriptor.h.

Constructor & Destructor Documentation

openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::GridDescriptor ( )
openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::GridDescriptor ( const Name name,
const Name gridType,
bool  saveFloatAsHalf = false 
)
openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::GridDescriptor ( const GridDescriptor )
default
openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::~GridDescriptor ( )

Member Function Documentation

static Name openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::addSuffix ( const Name ,
int  n 
)
static

Append the number n to the given name (separated by an ASCII "record separator" character) and return the resulting name.

int64_t openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::getBlockPos ( ) const
inline

Definition at line 69 of file GridDescriptor.h.

int64_t openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::getEndPos ( ) const
inline

Definition at line 72 of file GridDescriptor.h.

int64_t openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::getGridPos ( ) const
inline

Definition at line 66 of file GridDescriptor.h.

const Name& openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::gridName ( ) const
inline

Definition at line 56 of file GridDescriptor.h.

const Name& openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::gridType ( ) const
inline

Definition at line 55 of file GridDescriptor.h.

const Name& openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::instanceParentName ( ) const
inline

Definition at line 59 of file GridDescriptor.h.

bool openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::isInstance ( ) const
inline

Definition at line 61 of file GridDescriptor.h.

static std::string openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::nameAsString ( const Name )
static

Given a name with suffix N, return "name[N]", otherwise just return "name". Use this to produce a human-readable string from a descriptor's unique name.

GridDescriptor& openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::operator= ( const GridDescriptor )
default
GridBase::Ptr openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::read ( std::istream &  )

Read a grid descriptor from the given stream.

Returns
an empty grid of the type specified by the grid descriptor.
bool openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::saveFloatAsHalf ( ) const
inline

Definition at line 63 of file GridDescriptor.h.

void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::seekToBlocks ( std::istream &  ) const
void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::seekToBlocks ( std::ostream &  ) const
void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::seekToEnd ( std::istream &  ) const
void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::seekToEnd ( std::ostream &  ) const
void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::seekToGrid ( std::istream &  ) const
void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::seekToGrid ( std::ostream &  ) const
void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::setBlockPos ( int64_t  pos)
inline

Definition at line 68 of file GridDescriptor.h.

void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::setEndPos ( int64_t  pos)
inline

Definition at line 71 of file GridDescriptor.h.

void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::setGridPos ( int64_t  pos)
inline

Definition at line 65 of file GridDescriptor.h.

void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::setInstanceParentName ( const Name name)
inline

Definition at line 60 of file GridDescriptor.h.

static Name openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::stringAsUniqueName ( const std::string )
static

Given a string of the form "name[N]", return "name" with the suffix N separated by an ASCII "record separator" character). Otherwise just return the string as is.

static Name openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::stripSuffix ( const Name )
static

Strip from the given name any suffix that is separated by an ASCII "record separator" character and return the resulting name.

const Name& openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::uniqueName ( ) const
inline

Definition at line 57 of file GridDescriptor.h.

void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::writeHeader ( std::ostream &  ) const

Write out this descriptor's header information (all data except for stream offsets).

void openvdb::OPENVDB_VERSION_NAME::io::GridDescriptor::writeStreamPos ( std::ostream &  ) const

Since positions into the stream are known at a later time, they are written out separately.


The documentation for this class was generated from the following file: