/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /** * Copyright (c) 2004-2013 HUBzero Foundation, LLC * * Authors: * Insoo Woo */ #ifndef NV_ZINC_BLENDE_RECONSTRUCTOR_H #define NV_ZINC_BLENDE_RECONSTRUCTOR_H #include #include #include #include #include namespace nv { class ZincBlendeVolume; class ZincBlendeReconstructor { public: /** * @brief Load Zinc blende binary volume data and create ZincBlendeVolume with the file * @param fileName Zinc blende file name, which data is generated by NEMO-3D */ ZincBlendeVolume *loadFromFile(const char *fileName); /** * @brief Load Zinc blende binary volume data and create ZincBlendeVolume with the file * @param stream Zinc blende binary volume data, which data is generated by NEMO-3D and transferred from nanoscale */ ZincBlendeVolume *loadFromStream(std::istream& stream); ZincBlendeVolume *loadFromMemory(const void *dataBlock); /** * @brief Create ZincBlendVolume with output data of NEMO-3D * @param origin the start position of the volume data * @param delta the delta value among atoms * @param width the width of unit cells in the data * @param height the height of unit cells in the data * @param depth the depth of unit cells in the data * @param data the memory block of output data of NEMO-3D */ ZincBlendeVolume *buildUp(const vrmath::Vector3f& origin, const vrmath::Vector3f& delta, int width, int height, int depth, void *data); ZincBlendeVolume *buildUp(const vrmath::Vector3f& origin, const vrmath::Vector3f& delta, int width, int height, int depth, int datacount, double emptyvalue, void *data); /** * @brief Return a singleton instance */ static ZincBlendeReconstructor *getInstance(); private: ZincBlendeReconstructor(); ~ZincBlendeReconstructor(); /** * @brief Get a line from file. It is used for reading header because header is written in ascii. */ void getLine(std::istream& stream); void getLine(const unsigned char*& stream); char _buff[255]; /// A ZincBlendeReconstructor Singleton instance static ZincBlendeReconstructor *_instance; }; } #endif