OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
symmetry_node.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_GFX_SYMMETRY_NODE_HH
20 #define OST_GFX_SYMMETRY_NODE_HH
21 
22 #include <ost/geom/geom.hh>
23 #include <ost/gfx/module_config.hh>
24 #include <ost/gfx/gfx_node.hh>
25 
26 namespace ost { namespace gfx {
27 
28 // temporary symmetry op class. This will be moved to base (or geom).
30 public:
31  SymmetryOp(const geom::Mat3& rot,
32  const geom::Vec3& trans=geom::Vec3(0, 0, 0));
33  SymmetryOp(const geom::Mat4& transform);
34  // push onto GL_MODELVIEW stack
35  void Push();
36  // pop from GL_MODELVIEW stack
37  void Pop();
38 
39  bool operator==(const SymmetryOp& rhs) const { return tf_==rhs.tf_; }
40  bool operator!=(const SymmetryOp& rhs) const { return tf_!=rhs.tf_; }
41 private:
42  geom::Mat4 tf_;
43 };
44 
45 typedef std::vector<SymmetryOp> SymmetryOpList;
46 
49 public:
50  SymmetryNode(const String& name, const SymmetryOpList& sym_ops);
51 
52  virtual void RenderGL(RenderPass pass);
53 private:
54  SymmetryOpList sym_ops_;
55 };
56 
64 }}
65 
66 #endif