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