// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 #pragma once #include #include #include #include class KrakatoaParticleOStream : public frantic::max3d::fnpublish::StandaloneInterface { public: KrakatoaParticleOStream( const frantic::tstring& path, const frantic::channels::channel_map& outMap ); void close(); void write_particle( Value* pParticleValue ); private: virtual ThisInterfaceDesc* GetDesc(); private: boost::shared_ptr m_pImpl; // Store a function for each channel that can convert from a MAXScript Value* into the appropriate channel type. std::vector m_writeFunctions; bool m_isOpen; }; class KrakatoaParticleIStream : public frantic::max3d::fnpublish::StandaloneInterface { public: KrakatoaParticleIStream( frantic::particles::particle_istream_ptr pStream ); boost::int64_t get_count(); TYPE_STRING_TAB_BV_TYPE get_channels(); void close(); void skip_particles( int numParticlesToSkip ); Value* read_particle(); private: virtual ThisInterfaceDesc* GetDesc(); private: boost::shared_ptr m_pImpl; // Store a function for each channel that can convert from a MAXScript Value* into the appropriate channel type. std::vector m_readFunctions; // Provide persistent storage for the strings returned by get_channels() since Max doesn't bother to manage the // memory of object contained in Tab<> objects. std::vector m_channelStrings; bool m_isOpen; };