source: trunk/packages/vizservers/nanovis/ZincBlendeReconstructor.h @ 3611

Last change on this file since 3611 was 3611, checked in by ldelgass, 6 years ago

Use nv namespace for classes in nanovis rather than prefixing class names with
Nv (still need to convert shader classes).

  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/**
3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
4 *
5 * Authors:
6 *   Insoo Woo <iwoo@purdue.edu>
7 */
8#ifndef NV_ZINC_BLENDE_RECONSTRUCTOR_H
9#define NV_ZINC_BLENDE_RECONSTRUCTOR_H
10
11#include <stdio.h>
12#include <ostream>
13#include <sstream>
14#include <fstream>
15
16#include <vrmath/Vector3f.h>
17
18namespace nv {
19
20class ZincBlendeVolume;
21
22class ZincBlendeReconstructor
23{
24public:
25    /**
26     * @brief Load Zinc blende binary volume data and create ZincBlendeVolume with the file
27     * @param fileName Zinc blende file name, which data is generated by NEMO-3D
28     */
29    ZincBlendeVolume *loadFromFile(const char *fileName);
30
31    /**
32     * @brief Load Zinc blende binary volume data and create ZincBlendeVolume with the file
33     * @param stream Zinc blende binary volume data, which data is generated by NEMO-3D and transferred from nanoscale
34     */
35    ZincBlendeVolume *loadFromStream(std::istream& stream);
36
37    ZincBlendeVolume *loadFromMemory(void *dataBlock);
38
39    /**
40     * @brief Create ZincBlendVolume with output data of NEMO-3D
41     * @param origin the start position of the volume data
42     * @param delta  the delta value among atoms
43     * @param width  the width of unit cells in the data
44     * @param height the height of unit cells in the data
45     * @param depth  the depth of unit cells in the data
46     * @param data the memory block of output data of NEMO-3D
47     */
48    ZincBlendeVolume *buildUp(const vrmath::Vector3f& origin, const vrmath::Vector3f& delta,
49                              int width, int height, int depth, void *data);
50
51    ZincBlendeVolume *buildUp(const vrmath::Vector3f& origin, const vrmath::Vector3f& delta,
52                              int width, int height, int depth,
53                              int datacount, double emptyvalue, void *data);
54
55    /**
56     * @brief Return a singleton instance
57     */
58    static ZincBlendeReconstructor *getInstance();
59
60private:
61    ZincBlendeReconstructor();
62
63    ~ZincBlendeReconstructor();
64
65    /**
66     * @brief Get a line from file. It is used for reading header because header is written in ascii.
67     */
68    void getLine(std::istream& stream);
69    void getLine(unsigned char*& stream);
70
71    char buff[255];
72
73    /// A ZincBlendeReconstructor Singleton instance
74    static ZincBlendeReconstructor *_instance;
75};
76
77}
78
79#endif
Note: See TracBrowser for help on using the repository browser.