source: nanovis/tags/1.1.1/NvZincBlendeReconstructor.h @ 4626

Last change on this file since 4626 was 3502, checked in by ldelgass, 11 years ago

Add basic VTK structured points reader to nanovis, update copyright dates.

  • Property svn:eol-style set to native
File size: 2.8 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/**
3 * ----------------------------------------------------------------------
4 * @class NvZincBlendeReconstructor
5 *
6 * ======================================================================
7 * @author Insoo Woo (iwoo@purdue.edu)
8 * @author Purdue Rendering and Perceptualization Lab (PURPL)
9 *
10 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
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 */
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 <vrmath/Vector3f.h>
25
26class ZincBlendeVolume;
27
28class NvZincBlendeReconstructor
29{
30public:
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     */
35    ZincBlendeVolume *loadFromFile(const char *fileName);
36
37    /**
38     * @brief Load Zinc blende binary volume data and create ZincBlendeVolume with the file
39     * @param stream Zinc blende binary volume data, which data is generated by NEMO-3D and transferred from nanoscale
40     */
41    ZincBlendeVolume *loadFromStream(std::istream& stream);
42
43    ZincBlendeVolume *loadFromMemory(void *dataBlock);
44
45    /**
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     */
54    ZincBlendeVolume *buildUp(const vrmath::Vector3f& origin, const vrmath::Vector3f& delta,
55                              int width, int height, int depth, void *data);
56
57    ZincBlendeVolume *buildUp(const vrmath::Vector3f& origin, const vrmath::Vector3f& delta,
58                              int width, int height, int depth,
59                              int datacount, double emptyvalue, void *data);
60
61    /**
62     * @brief Return a singleton instance
63     */
64    static NvZincBlendeReconstructor *getInstance();
65
66private:
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
80    static NvZincBlendeReconstructor *_instance;
81};
82
83#endif
Note: See TracBrowser for help on using the repository browser.