OpenVDB 12.1.0

Loading...
Searching...
No Matches
GridDescriptor Class Reference

`#include <openvdb/io/GridDescriptor.h>`

## Public Member Functions
| GridDescriptor ()
| GridDescriptor (const Name &name, const Name &gridType, bool saveFloatAsHalf=false)
| GridDescriptor (const GridDescriptor &)=default
GridDescriptor & | operator= (const GridDescriptor &)=default
| ~GridDescriptor ()
const Name & | gridType () const
const Name & | gridName () const
const Name & | uniqueName () const
const Name & | instanceParentName () 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).
void | writeStreamPos (std::ostream &) const
| Since positions into the stream are known at a later time, they are written out separately.
GridBase::Ptr | read (std::istream &)
| Read a grid descriptor from the given stream.

## 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.
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.
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.
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.

## 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.

## Constructor & Destructor Documentation

## ◆ GridDescriptor() [1/3]

GridDescriptor | ( |  | ) |

## ◆ GridDescriptor() [2/3]

GridDescriptor | ( | const Name & | name,
|  | const Name & | gridType,
|  | bool | saveFloatAsHalf = false )

## ◆ GridDescriptor() [3/3]

GridDescriptor | ( | const GridDescriptor & |  | ) |
| default

## ◆ ~GridDescriptor()

~GridDescriptor | ( |  | ) |

## Member Function Documentation

## ◆ addSuffix()

Name 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.

## ◆ getBlockPos()

int64_t getBlockPos | ( |  | ) | const
| inline

## ◆ getEndPos()

int64_t getEndPos | ( |  | ) | const
| inline

## ◆ getGridPos()

int64_t getGridPos | ( |  | ) | const
| inline

## ◆ gridName()

const Name & gridName | ( |  | ) | const
| inline

## ◆ gridType()

const Name & gridType | ( |  | ) | const
| inline

## ◆ instanceParentName()

const Name & instanceParentName | ( |  | ) | const
| inline

## ◆ isInstance()

bool isInstance | ( |  | ) | const
| inline

## ◆ nameAsString()

std::string 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.

## ◆ operator=()

GridDescriptor & operator= | ( | const GridDescriptor & |  | ) |
| default

## ◆ read()

GridBase::Ptr read | ( | std::istream & |  | ) |

Read a grid descriptor from the given stream.

Returns
  an empty grid of the type specified by the grid descriptor.

## ◆ saveFloatAsHalf()

bool saveFloatAsHalf | ( |  | ) | const
| inline

## ◆ seekToBlocks() [1/2]

void seekToBlocks | ( | std::istream & |  | ) | const

## ◆ seekToBlocks() [2/2]

void seekToBlocks | ( | std::ostream & |  | ) | const

## ◆ seekToEnd() [1/2]

void seekToEnd | ( | std::istream & |  | ) | const

## ◆ seekToEnd() [2/2]

void seekToEnd | ( | std::ostream & |  | ) | const

## ◆ seekToGrid() [1/2]

void seekToGrid | ( | std::istream & |  | ) | const

## ◆ seekToGrid() [2/2]

void seekToGrid | ( | std::ostream & |  | ) | const

## ◆ setBlockPos()

void setBlockPos | ( | int64_t | pos | ) |
| inline

## ◆ setEndPos()

void setEndPos | ( | int64_t | pos | ) |
| inline

## ◆ setGridPos()

void setGridPos | ( | int64_t | pos | ) |
| inline

## ◆ setInstanceParentName()

void setInstanceParentName | ( | const Name & | name | ) |
| inline

## ◆ stringAsUniqueName()

Name 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.

## ◆ stripSuffix()

Name 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.

## ◆ uniqueName()

const Name & uniqueName | ( |  | ) | const
| inline

## ◆ writeHeader()

void writeHeader | ( | std::ostream & |  | ) | const

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

## ◆ writeStreamPos()

void writeStreamPos | ( | std::ostream & |  | ) | const

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