source: nanovis/branches/1.1/FlowBox.h @ 4923

Last change on this file since 4923 was 4893, checked in by ldelgass, 5 years ago

merge r4056 from trunk

  • Property svn:eol-style set to native
File size: 1.5 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 *   Wei Qiao <qiaow@purdue.edu>
7 *   Insoo Woo <iwoo@purdue.edu>
8 *   George A. Howlett <gah@purdue.edu>
9 *   Leif Delgass <ldelgass@purdue.edu>
10 */
11#ifndef NV_FLOWBOX_H
12#define NV_FLOWBOX_H
13
14#include <string>
15
16#include <tcl.h>
17
18#include <vrmath/Vector3f.h>
19
20#include "FlowTypes.h"
21#include "Switch.h"
22#include "Volume.h"
23
24namespace nv {
25
26struct FlowBoxValues {
27    FlowPoint corner1, corner2;    ///< Coordinates of the box.
28    FlowColor color;               ///< Color of box
29    float lineWidth;
30    int isHidden;
31};
32
33class FlowBox
34{
35public:
36    FlowBox(const char *name);
37    ~FlowBox();
38
39    const char *name() const
40    {
41        return _name.c_str();
42    }
43
44    bool visible() const
45    {
46        return !_sv.isHidden;
47    }
48
49    int parseSwitches(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv)
50    {
51        if (nv::ParseSwitches(interp, _switches, objc, objv, &_sv, 
52                              SWITCH_DEFAULTS) < 0) {
53            return TCL_ERROR;
54        }
55        return TCL_OK;
56    }
57
58    void render(Volume *volume);
59
60    const FlowBoxValues *getValues() const
61    {
62        return &_sv;
63    }
64
65    void getWorldSpaceBounds(vrmath::Vector3f& min,
66                             vrmath::Vector3f& max,
67                             const Volume *volume) const;
68
69private:
70    std::string _name;          ///< Name of this box in the hash table.
71    FlowBoxValues _sv;
72    static SwitchSpec _switches[];
73};
74
75}
76
77#endif
Note: See TracBrowser for help on using the repository browser.