source: trunk/packages/vizservers/vtkvis/RpGroup.h @ 3177

Last change on this file since 3177 was 3177, checked in by mmc, 12 years ago

Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (C) 2004-2012  HUBzero Foundation, LLC
4 *
5 * Author: Leif Delgass <ldelgass@purdue.edu>
6 */
7
8#ifndef __RAPPTURE_VTKVIS_GROUP_H__
9#define __RAPPTURE_VTKVIS_GROUP_H__
10
11#include <tr1/unordered_map>
12
13#include <vtkProp3D.h>
14
15#include "RpVtkGraphicsObject.h"
16
17namespace Rappture {
18namespace VtkVis {
19
20/**
21 * \brief Collection of shapes with grouping
22 */
23class Group : public VtkGraphicsObject {
24public:
25    typedef std::string NodeId;
26    typedef std::tr1::unordered_map<NodeId, VtkGraphicsObject *> NodeHashmap;
27
28    Group();
29    virtual ~Group();
30
31    virtual const char *getClassName() const
32    {
33        return "Group";
34    }
35
36    virtual void setDataSet(DataSet *dataSet,
37                            Renderer *renderer)
38    {
39        assert(dataSet == NULL);
40        update();
41    }
42
43    virtual void setClippingPlanes(vtkPlaneCollection *planes);
44
45    void addChild(const NodeId& name, VtkGraphicsObject *obj);
46
47    VtkGraphicsObject *getChild(const NodeId& name);
48
49    void getChildren(std::vector<VtkGraphicsObject *>& children)
50    {
51        for (NodeHashmap::iterator itr = _nodes.begin();
52             itr != _nodes.end(); ++itr) {
53            children.push_back(itr->second);
54        }
55    }
56
57    void removeChild(const NodeId& name);
58
59private:
60    virtual void initProp();
61
62    virtual void update();
63
64    NodeHashmap _nodes;
65};
66
67}
68}
69
70#endif
Note: See TracBrowser for help on using the repository browser.