Chemical Data Processing Library C++ API - Version 1.3.0
Object3D.hpp
Go to the documentation of this file.
1 /*
2  * Object3D.hpp
3  *
4  * This file is part of the Visical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_VIS_OBJECT3D_HPP
30 #define CDPL_VIS_OBJECT3D_HPP
31 
32 #include <vector>
33 #include <memory>
34 
35 #include <boost/iterator/indirect_iterator.hpp>
36 
37 #include "CDPL/Vis/APIPrefix.hpp"
39 
40 
41 namespace CDPL
42 {
43 
44  namespace Vis
45  {
46 
52  {
53 
54 
55 
56  public:
60  typedef std::shared_ptr<Object3D> SharedPointer;
61 
62  private:
63  typedef std::vector<SharedPointer> Object3DList;
64  typedef boost::indirect_iterator<Object3DList::iterator, Object3D> Object3DIterator;
65  typedef boost::indirect_iterator<Object3DList::const_iterator, const Object3D> ConstObject3DIterator;
66 
67  public:
72 
77  Object3D(const Object3D& obj);
78 
82  virtual ~Object3D() {}
83 
89  Object3D& operator=(const Object3D& obj);
90 
91  void clear();
92 
93  std::size_t getNumSubObjects() const;
94 
99  ConstObject3DIterator getSubObjectsBegin() const;
100 
105  Object3DIterator getSubObjectsBegin();
106 
111  ConstObject3DIterator getSubObjectsEnd() const;
112 
117  Object3DIterator getSubObjectsEnd();
118 
123  ConstObject3DIterator begin() const;
124 
129  Object3DIterator begin();
130 
135  ConstObject3DIterator end() const;
136 
141  Object3DIterator end();
142 
143  const Object3D& getSubObject(std::size_t idx) const;
144 
145  Object3D& getSubObject(std::size_t idx);
146 
148 
150 
151  void removeSubObject(std::size_t idx);
152 
161  Object3DIterator removeSubObject(const Object3DIterator& it);
162 
163  private:
164  Object3DList subObjects;
165  };
166  } // namespace Vis
167 } // namespace CDPL
168 
169 #endif // CDPL_VIS_OBJECT3D_HPP
Definition of the class CDPL::Base::PropertyContainer.
Definition of the preprocessor macro CDPL_VIS_API.
#define CDPL_VIS_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
A class providing methods for the storage and lookup of object properties.
Definition: PropertyContainer.hpp:75
Object3D.
Definition: Object3D.hpp:52
ConstObject3DIterator getSubObjectsBegin() const
Returns a constant iterator pointing to the beginning of the sub-objects.
const Object3D & getSubObject(std::size_t idx) const
Object3D & getSubObject(std::size_t idx)
virtual ~Object3D()
Virtual destructor.
Definition: Object3D.hpp:82
std::shared_ptr< Object3D > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated Object3D instances.
Definition: Object3D.hpp:60
Object3DIterator getSubObjectsEnd()
Returns a mutable iterator pointing to the end of the sub-objects.
Object3D(const Object3D &obj)
Constructs a copy of the Object3D instance obj.
ConstObject3DIterator end() const
Returns a constant iterator pointing to the end of the sub-objects.
Object3D()
Default constructor.
Object3DIterator begin()
Returns a mutable iterator pointing to the beginning of the sub-objects.
Object3DIterator getSubObjectsBegin()
Returns a mutable iterator pointing to the beginning of the sub-objects.
Object3D & operator=(const Object3D &obj)
Assignment operator.
ConstObject3DIterator getSubObjectsEnd() const
Returns a constant iterator pointing to the end of the sub-objects.
std::size_t getNumSubObjects() const
void removeSubObject(std::size_t idx)
Object3D & addSubObject()
ConstObject3DIterator begin() const
Returns a constant iterator pointing to the beginning of the sub-objects.
Object3D & addSubObject(const SharedPointer &object)
Object3DIterator removeSubObject(const Object3DIterator &it)
Removes the sub-object specified by the iterator it.
Object3DIterator end()
Returns a mutable iterator pointing to the end of the sub-objects.
The namespace of the Chemical Data Processing Library.