Field3DFile.h
Go to the documentation of this file.
//----------------------------------------------------------------------------//
/*
* Copyright (c) 2014 Sony Pictures Imageworks Inc.,
* Pixar Animation Studios Inc.
*
* 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 Sony Pictures Imageworks 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 OWNER 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.
*/
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
#ifndef _INCLUDED_Field3D_Field3DFile_H_
#define _INCLUDED_Field3D_Field3DFile_H_
//----------------------------------------------------------------------------//
#include <list>
#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>
#include "EmptyField.h"
#include "Field.h"
#include "Field3DFileHDF5.h"
#include "FieldMetadata.h"
#include "ClassFactory.h"
#include "OgawaFwd.h"
//----------------------------------------------------------------------------//
#include "ns.h"
//----------------------------------------------------------------------------//
FIELD3D_NAMESPACE_OPEN
//----------------------------------------------------------------------------//
// Forward declarations
//----------------------------------------------------------------------------//
class Field3DInputFileHDF5;
class Field3DOutputFileHDF5;
//----------------------------------------------------------------------------//
// Layer
//----------------------------------------------------------------------------//
namespace File {
class Layer
{
public:
std::string name;
std::string parent;
};
} // namespace File
//----------------------------------------------------------------------------//
// Partition
//----------------------------------------------------------------------------//
namespace File {
class FIELD3D_API Partition : public RefBase
{
public:
typedef std::vector<Layer> LayerList;
typedef boost::intrusive_ptr<Partition> Ptr;
typedef boost::intrusive_ptr<const Partition> CPtr;
// RTTI replacement ----------------------------------------------------------
typedef Partition class_type;
DEFINE_FIELD_RTTI_CONCRETE_CLASS;
static const char *staticClassType()
{
return "Partition";
}
// Ctors, dtor ---------------------------------------------------------------
Partition()
: RefBase()
{ }
// From RefBase --------------------------------------------------------------
virtual std::string className() const;
// Main methods --------------------------------------------------------------
void addLayer(const File::Layer &layer);
const File::Layer* layer(const std::string &name) const;
void getLayerNames(std::vector<std::string> &names) const;
OgOGroup& group() const;
void setGroup(boost::shared_ptr<OgOGroup> ptr);
// Public data members -------------------------------------------------------
std::string name;
FieldMapping::Ptr mapping;
private:
// Private data members ------------------------------------------------------
LayerList m_layers;
boost::shared_ptr<OgOGroup> m_group;
// Typedefs ------------------------------------------------------------------
typedef RefBase base;
};
} // namespace File
//----------------------------------------------------------------------------//
// Field3DFileBase
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
class FIELD3D_API Field3DFileBase : public MetadataCallback
{
public:
// Structs -------------------------------------------------------------------
struct LayerInfo
{
std::string name;
std::string parentName;
int components;
LayerInfo(std::string par, std::string nm, int cpt)
: name(nm), parentName(par), components(cpt)
{ /* Empty */ }
};
// Typedefs ------------------------------------------------------------------
typedef std::map<std::string, std::string> GroupMembershipMap;
// Ctor, dtor ----------------------------------------------------------------
Field3DFileBase();
virtual ~Field3DFileBase() = 0;
// Main methods --------------------------------------------------------------
void clear();
bool close();
void getPartitionNames(std::vector<std::string> &names) const;
void getScalarLayerNames(std::vector<std::string> &names,
const std::string &partitionName) const;
void getVectorLayerNames(std::vector<std::string> &names,
const std::string &partitionName) const;
void addGroupMembership(const GroupMembershipMap &groupMembers);
// Access to metadata --------------------------------------------------------
FieldMetadata& metadata()
{
if (m_hdf5Base) {
return m_hdf5Base->metadata();
}
return m_metadata;
}
const FieldMetadata& metadata() const
{
if (m_hdf5Base) {
return m_hdf5Base->metadata();
}
return m_metadata;
}
virtual void metadataHasChanged(const std::string &/* name */)
{ /* Empty */ }
// Debug ---------------------------------------------------------------------
void printHierarchy() const;
protected:
// Internal typedefs ---------------------------------------------------------
typedef std::vector<File::Partition::Ptr> PartitionList;
typedef std::map<std::string, int> PartitionCountMap;
// Convenience methods -------------------------------------------------------
File::Partition::Ptr getPartition(const std::string &partitionName) const
{ return partition(partitionName); }
virtual void closeInternal() = 0;
File::Partition::Ptr partition(const std::string &partitionName);
File::Partition::Ptr partition(const std::string &partitionName) const;
void getIntPartitionNames(std::vector<std::string> &names) const;
void getIntScalarLayerNames(std::vector<std::string> &names,
const std::string &intPartitionName) const;
void getIntVectorLayerNames(std::vector<std::string> &names,
const std::string &intPartitionName) const;
int numIntPartitions(const std::string &partitionName) const;
std::string makeIntPartitionName(const std::string &partitionsName,
int i) const;
std::string intPartitionName(const std::string &partitionName,
const std::string &layerName,
FieldRes::Ptr field);
std::string removeUniqueId(const std::string &partitionName) const;
// Data members --------------------------------------------------------------
std::vector<LayerInfo> m_layerInfo;
PartitionList m_partitions;
std::vector<std::string> m_partitionNames;
PartitionCountMap m_partitionCount;
GroupMembershipMap m_groupMembership;
FieldMetadata m_metadata;
boost::shared_ptr<Field3DFileHDF5Base> m_hdf5Base;
private:
// Private member functions --------------------------------------------------
Field3DFileBase(const Field3DFileBase&);
void operator =(const Field3DFileBase&);
};
//----------------------------------------------------------------------------//
// Field3DInputFile
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
class FIELD3D_API Field3DInputFile : public Field3DFileBase
{
public:
// Ctors, dtor ---------------------------------------------------------------
Field3DInputFile();
virtual ~Field3DInputFile();
// Main interface ------------------------------------------------------------
bool open(const std::string &filename);
const std::string &encoding() const
{
const static std::string encodings[2] = { "Ogawa", "HDF5" };
return encodings[m_hdf5 ? 1 : 0];
}
template <class Data_T>
typename Field<Data_T>::Vec
readLayers(const std::string &layerName = std::string("")) const;
template <class Data_T>
typename Field<Data_T>::Vec
readLayers(const std::string &partitionName,
const std::string &layerName) const;
template <class Data_T>
typename Field<Data_T>::Vec
readScalarLayers(const std::string &layerName = std::string("")) const
{
if (m_hdf5) {
return m_hdf5->readScalarLayers<Data_T>(layerName);
}
return readLayers<Data_T>(layerName);
}
template <class Data_T>
typename Field<Data_T>::Vec
readScalarLayers(const std::string &partitionName,
const std::string &layerName) const
{
if (m_hdf5) {
return m_hdf5->readScalarLayers<Data_T>(partitionName, layerName);
}
return readLayers<Data_T>(partitionName, layerName);
}
template <class Data_T>
typename Field<FIELD3D_VEC3_T<Data_T> >::Vec
readVectorLayers(const std::string &layerName = std::string("")) const
{
if (m_hdf5) {
return m_hdf5->readVectorLayers<Data_T>(layerName);
}
return readLayers<FIELD3D_VEC3_T<Data_T> >(layerName);
}
template <class Data_T>
typename Field<FIELD3D_VEC3_T<Data_T> >::Vec
readVectorLayers(const std::string &partitionName,
const std::string &layerName) const
{
if (m_hdf5) {
return m_hdf5->readVectorLayers<Data_T>(partitionName, layerName);
}
return readLayers<FIELD3D_VEC3_T<Data_T> >(partitionName, layerName);
}
template <class Data_T>
typename EmptyField<Data_T>::Vec
readProxyLayer(const std::string &partitionName,
const std::string &layerName,
bool isVectorLayer) const;
template <class Data_T>
typename EmptyField<Data_T>::Vec
readProxyScalarLayers(const std::string &name = std::string("")) const;
template <class Data_T>
typename EmptyField<Data_T>::Vec
readProxyVectorLayers(const std::string &name = std::string("")) const;
private:
// From Field3DFileBase ------------------------------------------------------
virtual void closeInternal()
{
if (m_hdf5) {
m_hdf5->closeInternal();
return;
}
cleanup();
}
void cleanup()
{
// The destruction of the various Ogawa components must happen in the
// right order
// First, the partition groups
m_partitions.clear();
// Then the root group
m_root.reset();
// Finally, the archive
m_archive.reset();
}
// Convenience methods -------------------------------------------------------
template <class Data_T>
typename Field<Data_T>::Ptr
readLayer(const std::string &intPartitionName,
const std::string &layerName) const;
template <class Data_T>
typename EmptyField<Data_T>::Ptr
readProxyLayer(OgIGroup &location, const std::string &name,
const std::string &attribute,
FieldMapping::Ptr mapping) const;
bool readPartitionAndLayerInfo();
bool readMetadata(const OgIGroup &metadataGroup, FieldBase::Ptr field) const;
bool readMetadata(const OgIGroup &metadataGroup);
// Data members --------------------------------------------------------------
std::string m_filename;
boost::shared_ptr<Alembic::Ogawa::IArchive> m_archive;
boost::shared_ptr<OgIGroup> m_root;
boost::shared_ptr<Field3DInputFileHDF5> m_hdf5;
};
//----------------------------------------------------------------------------//
// Utility functions
//----------------------------------------------------------------------------//
bool fileExists(const std::string &filename);
//----------------------------------------------------------------------------//
// Field3DOutputFile
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
class FIELD3D_API Field3DOutputFile : public Field3DFileBase
{
public:
// Enums ---------------------------------------------------------------------
enum CreateMode {
OverwriteMode,
FailOnExisting
};
// Ctors, dtor ---------------------------------------------------------------
Field3DOutputFile();
virtual ~Field3DOutputFile();
// Main interface ------------------------------------------------------------
bool create(const std::string &filename, CreateMode cm = OverwriteMode);
static void useOgawa(const bool enabled)
{
// simple temporary endian check
union {
uint32_t l;
char c[4];
} u;
u.l = 0x01234567;
if (u.c[0] == 0x67) {
ms_doOgawa = enabled;
} else {
std::cerr << "WARNING: Field3D only supports Ogawa-backed files "
<< "on little-endian systems." << std::endl;
ms_doOgawa = false;
}
}
template <class Data_T>
bool writeLayer(const std::string &layerName,
typename Field<Data_T>::Ptr layer)
{
return writeLayer<Data_T>(std::string("default"), layerName, layer);
}
template <class Data_T>
bool writeLayer(const std::string &partitionName,
const std::string &layerName,
typename Field<Data_T>::Ptr layer);
template <class Data_T>
bool writeLayer(typename Field<Data_T>::Ptr layer)
{
return writeLayer<Data_T>(layer->name, layer->attribute, layer);
}
template <class Data_T>
bool writeScalarLayer(const std::string &layerName,
typename Field<Data_T>::Ptr layer)
{
if (m_hdf5) {
return m_hdf5->writeScalarLayer<Data_T>(layerName, layer);
}
return writeScalarLayer<Data_T>(std::string("default"), layerName, layer);
}
template <class Data_T>
bool writeScalarLayer(const std::string &partitionName,
const std::string &layerName,
typename Field<Data_T>::Ptr layer)
{
if (m_hdf5) {
return m_hdf5->writeScalarLayer<Data_T>(partitionName, layerName, layer);
}
return writeLayer<Data_T>(partitionName, layerName, layer);
}
template <class Data_T>
bool writeScalarLayer(typename Field<Data_T>::Ptr layer)
{
if (m_hdf5) {
return m_hdf5->writeScalarLayer<Data_T>(layer);
}
return writeLayer<Data_T>(layer);
}
template <class Data_T>
bool writeVectorLayer(const std::string &layerName,
typename Field<FIELD3D_VEC3_T<Data_T> >::Ptr layer)
{
if (m_hdf5) {
return m_hdf5->writeVectorLayer<Data_T>(layerName, layer);
}
return writeVectorLayer<Data_T>(std::string("default"), layerName, layer);
}
template <class Data_T>
bool writeVectorLayer(const std::string &partitionName,
const std::string &layerName,
typename Field<FIELD3D_VEC3_T<Data_T> >::Ptr layer)
{
if (m_hdf5) {
return m_hdf5->writeVectorLayer<Data_T>(partitionName, layerName, layer);
}
return writeLayer<FIELD3D_VEC3_T<Data_T> >(partitionName, layerName, layer);
}
template <class Data_T>
bool writeVectorLayer(typename Field<FIELD3D_VEC3_T<Data_T> >::Ptr layer)
{
if (m_hdf5) {
return m_hdf5->writeVectorLayer<Data_T>(layer);
}
return writeLayer<FIELD3D_VEC3_T<Data_T> >(layer);
}
bool writeGlobalMetadata();
bool writeGroupMembership();
private:
// From Field3DFileBase ------------------------------------------------------
virtual void closeInternal()
{
if (m_hdf5) {
m_hdf5->closeInternal();
return;
}
cleanup();
}
void cleanup()
{
// The destruction of the various Ogawa components must happen in the
// right order
// First, the partition groups
m_partitions.clear();
// Then the root group
m_root.reset();
// Finally, the archive
m_archive.reset();
}
// Convenience methods -------------------------------------------------------
std::string incrementPartitionName(std::string &pname);
File::Partition::Ptr
createNewPartition(const std::string &partitionName,
const std::string &layerName, FieldRes::Ptr field);
bool writeMapping(OgOGroup &partitionGroup, FieldMapping::Ptr mapping);
bool writeMetadata(OgOGroup &metadataGroup, FieldBase::Ptr layer);
bool writeMetadata(OgOGroup &metadataGroup);
// Data members --------------------------------------------------------------
static bool ms_doOgawa;
boost::shared_ptr<Alembic::Ogawa::OArchive> m_archive;
boost::shared_ptr<OgOGroup> m_root;
boost::shared_ptr<Field3DOutputFileHDF5> m_hdf5;
};
//----------------------------------------------------------------------------//
FIELD3D_NAMESPACE_HEADER_CLOSE
//----------------------------------------------------------------------------//
#endif
ClassFactory.h
Contains the ClassFactory class for registering Field3D classes.
EmptyField.h
Contains the EmptyField class.
Field3DFileHDF5.h
Contains the Field3DFileHDF5 classes.
fileExists
bool fileExists(const std::string &filename)
checks to see if a file/directory exists or not
Definition Field3DFile.cpp:1341
FieldMetadata.h
Basic container for metedata.
Field.h
Contains Field, WritableField and ResizableField classes.
OgawaFwd.h
Contains forward declarations for Ogawa classes.
FIELD3D_VEC3_T
#define FIELD3D_VEC3_T
Definition SpiMathLib.h:88
Ptr
EmptyField::Ptr
boost::intrusive_ptr< EmptyField > Ptr
Definition EmptyField.h:93
EmptyField::Vec
std::vector< Ptr > Vec
Definition EmptyField.h:94
Field3DFileBase::m_hdf5Base
boost::shared_ptr< Field3DFileHDF5Base > m_hdf5Base
HDF5 fallback.
Definition Field3DFile.h:388
Field3DFileBase::m_groupMembership
GroupMembershipMap m_groupMembership
Keeps track of group membership for each layer of partition name. The key is the "group" and the valu...
Definition Field3DFile.h:382
Field3DFileBase::removeUniqueId
std::string removeUniqueId(const std::string &partitionName) const
Strips any unique identifiers from the partition name and returns the original name.
Definition Field3DFile.cpp:479
Field3DFileBase::getIntPartitionNames
void getIntPartitionNames(std::vector< std::string > &names) const
Gets the names of all the -internal- partitions in the file.
Definition Field3DFile.cpp:564
Field3DFileBase::metadataHasChanged
virtual void metadataHasChanged(const std::string &)
This function should implemented by concrete classes to get the callback when metadata changes.
Definition Field3DFile.h:295
Field3DFileBase::getScalarLayerNames
void getScalarLayerNames(std::vector< std::string > &names, const std::string &partitionName) const
Gets the names of all the scalar layers in a given partition.
Definition Field3DFile.cpp:514
Field3DFileBase::partition
File::Partition::Ptr partition(const std::string &partitionName) const
Returns a pointer to the given partition.
Field3DFileBase::makeIntPartitionName
std::string makeIntPartitionName(const std::string &partitionsName, int i) const
Makes an internal partition name given the external partition name. Effectively just tacks on ....
Definition Field3DFile.cpp:665
Field3DFileBase::PartitionList
std::vector< File::Partition::Ptr > PartitionList
Definition Field3DFile.h:311
Field3DFileBase::Field3DFileBase
Field3DFileBase(const Field3DFileBase &)
Field3DFileBase::metadata
FieldMetadata & metadata()
accessor to the m_metadata class
Definition Field3DFile.h:276
Field3DFileBase::closeInternal
virtual void closeInternal()=0
Closes the file if open.
Field3DFileBase::getPartition
File::Partition::Ptr getPartition(const std::string &partitionName) const
Returns a pointer to the given partition.
Definition Field3DFile.h:321
Field3DFileBase::PartitionCountMap
std::map< std::string, int > PartitionCountMap
Definition Field3DFile.h:312
Field3DFileBase::m_metadata
FieldMetadata m_metadata
metadata
Definition Field3DFile.h:385
Field3DFileBase::getIntScalarLayerNames
void getIntScalarLayerNames(std::vector< std::string > &names, const std::string &intPartitionName) const
Gets the names of all the scalar layers in a given partition, but assumes that partition name is the ...
Definition Field3DFile.cpp:577
Field3DFileBase::clear
void clear()
Clear the data structures and close the file.
Definition Field3DFile.cpp:616
Field3DFileBase::m_partitions
PartitionList m_partitions
Vector of partitions.
Definition Field3DFile.h:371
Field3DFileBase::partition
File::Partition::Ptr partition(const std::string &partitionName)
Returns a pointer to the given partition.
Field3DFileBase::getPartitionNames
void getPartitionNames(std::vector< std::string > &names) const
Gets the names of all the partitions in the file.
Definition Field3DFile.cpp:492
Field3DFileBase::getVectorLayerNames
void getVectorLayerNames(std::vector< std::string > &names, const std::string &partitionName) const
Gets the names of all the vector layers in a given partition.
Definition Field3DFile.cpp:539
Field3DFileBase::m_partitionNames
std::vector< std::string > m_partitionNames
This stores partition names.
Definition Field3DFile.h:373
Field3DFileBase::numIntPartitions
int numIntPartitions(const std::string &partitionName) const
Returns the number of internal partitions for a given partition name.
Definition Field3DFile.cpp:644
Field3DFileBase::intPartitionName
std::string intPartitionName(const std::string &partitionName, const std::string &layerName, FieldRes::Ptr field)
Returns a unique partition name given the requested name. This ensures that partitions with matching ...
Definition Field3DFile.cpp:422
Field3DFileBase::Field3DFileBase
Field3DFileBase()
Definition Field3DFile.cpp:405
Field3DFileBase::m_partitionCount
PartitionCountMap m_partitionCount
Contains a counter for each partition name. This is used to keep multiple fields with the same name u...
Definition Field3DFile.h:377
Field3DFileBase::GroupMembershipMap
std::map< std::string, std::string > GroupMembershipMap
Definition Field3DFile.h:228
Field3DFileBase::addGroupMembership
void addGroupMembership(const GroupMembershipMap &groupMembers)
Add to the group membership.
Definition Field3DFile.cpp:674
Field3DFileBase::getIntVectorLayerNames
void getIntVectorLayerNames(std::vector< std::string > &names, const std::string &intPartitionName) const
Gets the names of all the vector layers in a given partition, but assumes that partition name is the ...
Definition Field3DFile.cpp:597
Field3DFileBase::close
bool close()
Closes the file. No need to call this unless you specifically want to close the file early....
Definition Field3DFile.cpp:630
Field3DFileBase::metadata
const FieldMetadata & metadata() const
Read only access to the m_metadata class.
Definition Field3DFile.h:285
Field3DFileBase::m_layerInfo
std::vector< LayerInfo > m_layerInfo
This stores layer info.
Definition Field3DFile.h:368
Field3DInputFileHDF5
Provides reading of .f3d (internally, hdf5) files.
Definition Field3DFileHDF5.h:438
Field3DInputFile::m_filename
std::string m_filename
Filename, only to be set by open().
Definition Field3DFile.h:600
Field3DInputFile::Field3DInputFile
Field3DInputFile()
Definition Field3DFile.cpp:700
Field3DInputFile::cleanup
void cleanup()
Definition Field3DFile.h:557
Field3DInputFile::readLayers
Field< Data_T >::Vec readLayers(const std::string &layerName=std::string("")) const
Definition Field3DFile.cpp:1608
Field3DInputFile::readScalarLayers
Field< Data_T >::Vec readScalarLayers(const std::string &layerName=std::string("")) const
Retrieves all the layers of scalar type and maintains their on-disk data types.
Definition Field3DFile.h:461
Field3DInputFile::readVectorLayers
Field< FIELD3D_VEC3_T< Data_T > >::Vec readVectorLayers(const std::string &layerName=std::string("")) const
Retrieves all the layers of vector type and maintains their on-disk data types.
Definition Field3DFile.h:487
Field3DInputFile::encoding
const std::string & encoding() const
Returns an encoding descriptor of the given file.
Definition Field3DFile.h:434
Field3DInputFile::m_root
boost::shared_ptr< OgIGroup > m_root
Pointer to root group.
Definition Field3DFile.h:604
Field3DInputFile::closeInternal
virtual void closeInternal()
Closes the file if open.
Definition Field3DFile.h:547
Field3DInputFile::m_hdf5
boost::shared_ptr< Field3DInputFileHDF5 > m_hdf5
HDF5 fallback.
Definition Field3DFile.h:607
Field3DInputFile::readScalarLayers
Field< Data_T >::Vec readScalarLayers(const std::string &partitionName, const std::string &layerName) const
This one allows the allows the partitionName to be passed in.
Definition Field3DFile.h:472
Field3DInputFile::m_archive
boost::shared_ptr< Alembic::Ogawa::IArchive > m_archive
Pointer to the Ogawa archive.
Definition Field3DFile.h:602
Field3DInputFile::open
bool open(const std::string &filename)
Opens the given file.
Definition Field3DFile.cpp:714
Field3DInputFile::readVectorLayers
Field< FIELD3D_VEC3_T< Data_T > >::Vec readVectorLayers(const std::string &partitionName, const std::string &layerName) const
This version allows you to pass in the partition name.
Definition Field3DFile.h:498
Field3DOutputFileHDF5
Provides writing of .f3d (internally, hdf5) files.
Definition Field3DFileHDF5.h:765
Field3DOutputFile
Provides writing of .f3d (internally, hdf5 or Ogawa) files.
Definition Field3DFile.h:637
Field3DOutputFile::ms_doOgawa
static bool ms_doOgawa
Whether to output ogawa files.
Definition Field3DFile.h:841
Field3DOutputFile::closeInternal
virtual void closeInternal()
Closes the file if open.
Definition Field3DFile.h:796
Field3DOutputFile::m_hdf5
boost::shared_ptr< Field3DOutputFileHDF5 > m_hdf5
HDF5 fallback.
Definition Field3DFile.h:849
Field3DOutputFile::writeLayer
bool writeLayer(const std::string &layerName, typename Field< Data_T >::Ptr layer)
Writes a scalar layer to the "Default" partition.
Definition Field3DFile.h:687
Field3DOutputFile::Field3DOutputFile
Field3DOutputFile()
Definition Field3DFile.cpp:963
Field3DOutputFile::CreateMode
CreateMode
Definition Field3DFile.h:642
Field3DOutputFile::FailOnExisting
@ FailOnExisting
Definition Field3DFile.h:644
Field3DOutputFile::OverwriteMode
@ OverwriteMode
Definition Field3DFile.h:643
Field3DOutputFile::cleanup
void cleanup()
Definition Field3DFile.h:805
Field3DOutputFile::useOgawa
static void useOgawa(const bool enabled)
Whether to output ogawa files.
Definition Field3DFile.h:663
Field3DOutputFile::m_root
boost::shared_ptr< OgOGroup > m_root
Pointer to root group.
Definition Field3DFile.h:846
Field3DOutputFile::writeScalarLayer
bool writeScalarLayer(const std::string &partitionName, const std::string &layerName, typename Field< Data_T >::Ptr layer)
Writes a layer to a specific partition. The partition will be created if not specified.
Definition Field3DFile.h:727
Field3DOutputFile::writeVectorLayer
bool writeVectorLayer(typename Field< FIELD3D_VEC3_T< Data_T > >::Ptr layer)
Writes a layer to a specific partition. The field name and attribute name are used for partition and ...
Definition Field3DFile.h:775
Field3DOutputFile::writeVectorLayer
bool writeVectorLayer(const std::string &partitionName, const std::string &layerName, typename Field< FIELD3D_VEC3_T< Data_T > >::Ptr layer)
Writes a layer to a specific partition. The partition will be created if not specified.
Definition Field3DFile.h:762
Field3DOutputFile::writeScalarLayer
bool writeScalarLayer(typename Field< Data_T >::Ptr layer)
Writes a layer to a specific partition. The field name and attribute name are used for partition and ...
Definition Field3DFile.h:740
Field3DOutputFile::m_archive
boost::shared_ptr< Alembic::Ogawa::OArchive > m_archive
Pointer to the Ogawa archive.
Definition Field3DFile.h:844
Field3DOutputFile::writeScalarLayer
bool writeScalarLayer(const std::string &layerName, typename Field< Data_T >::Ptr layer)
Writes a scalar layer to the "Default" partition.
Definition Field3DFile.h:715
Field3DOutputFile::writeLayer
bool writeLayer(typename Field< Data_T >::Ptr layer)
Writes a layer to a specific partition. The field name and attribute name are used for partition and ...
Definition Field3DFile.h:703
Field3DOutputFile::writeVectorLayer
bool writeVectorLayer(const std::string &layerName, typename Field< FIELD3D_VEC3_T< Data_T > >::Ptr layer)
Writes a scalar layer to the "Default" partition.
Definition Field3DFile.h:750
FieldBase::Ptr
boost::intrusive_ptr< FieldBase > Ptr
Definition Field.h:97
FieldBase::attribute
std::string attribute
Optional name of the attribute the field represents.
Definition Field.h:173
FieldBase::name
std::string name
Optional name of the field.
Definition Field.h:171
FieldMapping::Ptr
boost::intrusive_ptr< FieldMapping > Ptr
Definition FieldMapping.h:92
FieldMetadata
Definition FieldMetadata.h:85
FieldRes::Ptr
boost::intrusive_ptr< FieldRes > Ptr
Definition Field.h:213
Field
Definition Field.h:390
Field::Vec
std::vector< Ptr > Vec
This is a convenience typedef for the list that Field3DInputFile::readScalarLayers() and Field3DInput...
Definition Field.h:403
Field::Ptr
boost::intrusive_ptr< Field > Ptr
Definition Field.h:395
File::Layer
Definition Field3DFile.h:97
File::Layer::name
std::string name
The name of the layer (always available).
Definition Field3DFile.h:100
File::Layer::parent
std::string parent
The name of the parent partition. We need this in order to open its group.
Definition Field3DFile.h:103
File::Partition::m_group
boost::shared_ptr< OgOGroup > m_group
Group representing the partition.
Definition Field3DFile.h:186
File::Partition::m_layers
LayerList m_layers
The layers belonging to this partition.
Definition Field3DFile.h:184
File::Partition::name
std::string name
Name of the partition.
Definition Field3DFile.h:175
File::Partition::class_type
Partition class_type
Definition Field3DFile.h:132
File::Partition::LayerList
std::vector< Layer > LayerList
Definition Field3DFile.h:125
File::Partition::base
RefBase base
Convenience typedef for referring to base class.
Definition Field3DFile.h:191
File::Partition::mapping
FieldMapping::Ptr mapping
Pointer to the mapping object.
Definition Field3DFile.h:177
File::Partition::staticClassType
static const char * staticClassType()
Definition Field3DFile.h:135
File::Partition::Ptr
boost::intrusive_ptr< Partition > Ptr
Definition Field3DFile.h:127
File::Partition::DEFINE_FIELD_RTTI_CONCRETE_CLASS
DEFINE_FIELD_RTTI_CONCRETE_CLASS
Definition Field3DFile.h:133
File::Partition::Partition
Partition()
Ctor.
Definition Field3DFile.h:143
File::Partition::CPtr
boost::intrusive_ptr< const Partition > CPtr
Definition Field3DFile.h:128
MetadataCallback
Definition FieldMetadata.h:71
RefBase::operator=
RefBase & operator=(const RefBase &)
Assignment operator.
Definition RefCount.h:134
RefBase::RefBase
RefBase()
Definition RefCount.h:120
FIELD3D_NAMESPACE_OPEN
Definition FieldMapping.cpp:74
File
Namespace for file I/O specifics.
Definition Field3DFile.h:87
ns.h
FIELD3D_API
#define FIELD3D_API
Definition ns.h:77
FIELD3D_NAMESPACE_HEADER_CLOSE
#define FIELD3D_NAMESPACE_HEADER_CLOSE
Definition ns.h:58
Field3DFileBase::LayerInfo::LayerInfo
LayerInfo(std::string par, std::string nm, int cpt)
Definition Field3DFile.h:221
Field3DFileBase::LayerInfo::name
std::string name
Definition Field3DFile.h:218
Field3DFileBase::LayerInfo::components
int components
Definition Field3DFile.h:220
Field3DFileBase::LayerInfo::parentName
std::string parentName
Definition Field3DFile.h:219
Vec