[2798] | 1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
[601] | 2 | /** |
---|
| 3 | * ---------------------------------------------------------------------- |
---|
| 4 | * @class NvZincBlendeReconstructor |
---|
| 5 | * |
---|
| 6 | * ====================================================================== |
---|
| 7 | * @author Insoo Woo (iwoo@purdue.edu) |
---|
| 8 | * @author Purdue Rendering and Perceptualization Lab (PURPL) |
---|
| 9 | * |
---|
[3177] | 10 | * Copyright (c) 2004-2012 HUBzero Foundation, LLC |
---|
[601] | 11 | * |
---|
| 12 | * See the file "license.terms" for information on usage and |
---|
| 13 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
| 14 | * ====================================================================== |
---|
| 15 | */ |
---|
[2884] | 16 | #ifndef NV_ZINC_BLENDE_RECONSTRUCTOR_H |
---|
| 17 | #define NV_ZINC_BLENDE_RECONSTRUCTOR_H |
---|
[601] | 18 | |
---|
[617] | 19 | #include <stdio.h> |
---|
| 20 | #include <ostream> |
---|
| 21 | #include <sstream> |
---|
| 22 | #include <fstream> |
---|
[601] | 23 | |
---|
| 24 | #include "Vector3.h" |
---|
| 25 | |
---|
| 26 | class ZincBlendeVolume; |
---|
| 27 | |
---|
[2822] | 28 | class NvZincBlendeReconstructor |
---|
| 29 | { |
---|
| 30 | public: |
---|
[601] | 31 | /** |
---|
| 32 | * @brief Load Zinc blende binary volume data and create ZincBlendeVolume with the file |
---|
| 33 | * @param fileName Zinc blende file name, which data is generated by NEMO-3D |
---|
| 34 | */ |
---|
[2844] | 35 | ZincBlendeVolume *loadFromFile(const char *fileName); |
---|
[601] | 36 | |
---|
| 37 | /** |
---|
[617] | 38 | * @brief Load Zinc blende binary volume data and create ZincBlendeVolume with the file |
---|
[2877] | 39 | * @param stream Zinc blende binary volume data, which data is generated by NEMO-3D and transferred from nanoscale |
---|
[617] | 40 | */ |
---|
[2822] | 41 | ZincBlendeVolume *loadFromStream(std::istream& stream); |
---|
[2844] | 42 | |
---|
[2822] | 43 | ZincBlendeVolume *loadFromMemory(void *dataBlock); |
---|
[617] | 44 | |
---|
| 45 | /** |
---|
[601] | 46 | * @brief Create ZincBlendVolume with output data of NEMO-3D |
---|
| 47 | * @param origin the start position of the volume data |
---|
| 48 | * @param delta the delta value among atoms |
---|
| 49 | * @param width the width of unit cells in the data |
---|
| 50 | * @param height the height of unit cells in the data |
---|
| 51 | * @param depth the depth of unit cells in the data |
---|
| 52 | * @param data the memory block of output data of NEMO-3D |
---|
| 53 | */ |
---|
[2822] | 54 | ZincBlendeVolume *buildUp(const Vector3& origin, const Vector3& delta, |
---|
| 55 | int width, int height, int depth, void *data); |
---|
[2844] | 56 | |
---|
[2822] | 57 | ZincBlendeVolume *buildUp(const Vector3& origin, const Vector3& delta, |
---|
| 58 | int width, int height, int depth, |
---|
| 59 | int datacount, double emptyvalue, void *data); |
---|
[2844] | 60 | |
---|
| 61 | /** |
---|
| 62 | * @brief Return a singleton instance |
---|
| 63 | */ |
---|
[2884] | 64 | static NvZincBlendeReconstructor *getInstance(); |
---|
[2844] | 65 | |
---|
| 66 | private: |
---|
| 67 | NvZincBlendeReconstructor(); |
---|
| 68 | |
---|
| 69 | ~NvZincBlendeReconstructor(); |
---|
| 70 | |
---|
| 71 | /** |
---|
| 72 | * @brief Get a line from file. It is used for reading header because header is written in ascii. |
---|
| 73 | */ |
---|
| 74 | void getLine(std::istream& stream); |
---|
| 75 | void getLine(unsigned char*& stream); |
---|
| 76 | |
---|
| 77 | char buff[255]; |
---|
| 78 | |
---|
| 79 | /// A ZincBlendeReconstructor Singleton instance |
---|
[2884] | 80 | static NvZincBlendeReconstructor *_instance; |
---|
[601] | 81 | }; |
---|
| 82 | |
---|
| 83 | #endif |
---|