source: trunk/packages/vizservers/nanovis/NvZincBlendeReconstructor.h @ 2822

Last change on this file since 2822 was 2822, checked in by ldelgass, 13 years ago

Const correctness fixes, pass vector/matrix objects by reference, various
formatting and style cleanups, don't spam syslog and uncomment openlog() call.
Still needs to be compiled with -DWANT_TRACE to get tracing, but now trace
output will be output to file in /tmp.

  • Property svn:eol-style set to native
File size: 2.9 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-2007  Purdue Research Foundation
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 "Vector3.h"
25
26class ZincBlendeVolume;
27
28class NvZincBlendeReconstructor
29{
30    char buff[255];
31
32    /**
33     * @brief A ZincBlendeReconstructor Singleton instance
34     */
35    static NvZincBlendeReconstructor* _instance;
36private:
37    /**
38     * @brief Constructor
39     */
40    NvZincBlendeReconstructor();
41
42    /**
43     * @brief Destructor
44     */
45    ~NvZincBlendeReconstructor();
46
47public:
48    /**
49     * @brief Return a singleton instance
50     */
51    static NvZincBlendeReconstructor* getInstance();
52
53private:
54    /**
55     * @brief Get a line from file. It is used for reading header because header is written in ascii.
56     * @param fp A file pointer of data file
57     */
58    void getLine(std::istream& stream);
59    void getLine(unsigned char*& stream);
60
61public:
62    /**
63     * @brief Load Zinc blende binary volume data and create ZincBlendeVolume with the file
64     * @param fileName Zinc blende file name, which data is generated by NEMO-3D
65     */
66    ZincBlendeVolume *loadFromFile(const char* fileName);
67
68    /**
69     * @brief Load Zinc blende binary volume data and create ZincBlendeVolume with the file
70     * @param data Zinc blende binary volume data, which data is generated by NEMO-3D and transferred from nanoscale
71     */
72    ZincBlendeVolume *loadFromStream(std::istream& stream);
73    ZincBlendeVolume *loadFromMemory(void *dataBlock);
74
75    /**
76     * @brief Create ZincBlendVolume with output data of NEMO-3D
77     * @param origin the start position of the volume data
78     * @param delta  the delta value among atoms
79     * @param width  the width of unit cells in the data
80     * @param height the height of unit cells in the data
81     * @param depth  the depth of unit cells in the data
82     * @param data the memory block of output data of NEMO-3D
83     */
84    ZincBlendeVolume *buildUp(const Vector3& origin, const Vector3& delta,
85                              int width, int height, int depth, void *data);
86    ZincBlendeVolume *buildUp(const Vector3& origin, const Vector3& delta,
87                              int width, int height, int depth,
88                              int datacount, double emptyvalue, void *data);
89};
90
91#endif
Note: See TracBrowser for help on using the repository browser.