Graphite  Version 3
An experimental 3D geometry processing program
voxel_grob_editor_interface.h
1 /*
2  * OGF/Graphite: Geometry and Graphics Programming Library + Utilities
3  * Copyright (C) 2000-2009 INRIA - Project ALICE
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  * If you modify this software, you should include a notice giving the
20  * name of the person performing the modification, the date of modification,
21  * and the reason for such modification.
22  *
23  * Contact: Bruno Levy - levy@loria.fr
24  *
25  * Project ALICE
26  * LORIA, INRIA Lorraine,
27  * Campus Scientifique, BP 239
28  * 54506 VANDOEUVRE LES NANCY CEDEX
29  * FRANCE
30  *
31  * Note that the GNU General Public License does not permit incorporating
32  * the Software into proprietary programs.
33  *
34  * As an exception to the GPL, Graphite can be linked with the
35  * following (non-GPL) libraries: Qt, SuperLU, WildMagic and CGAL
36  */
37 
38 #ifndef H_OGF_VOXEL_INTERFACES_VOXEL_GROB_EDITOR_INTERFACE_H
39 #define H_OGF_VOXEL_INTERFACES_VOXEL_GROB_EDITOR_INTERFACE_H
40 
45 
46 namespace OGF {
47 
48  namespace NL {
49  class Vector;
50  }
51 
56  gom_class VOXEL_API VoxelGrobEditor : public Interface {
57  public:
62 
66  ~VoxelGrobEditor() override;
67 
72  VoxelGrob* voxel_grob() const {
73  return dynamic_cast<VoxelGrob*>(grob());
74  }
75 
76  gom_properties:
77 
78  const vec3& get_origin() const {
79  return voxel_grob()->origin();
80  }
81 
82  const vec3& get_U() const {
83  return voxel_grob()->U();
84  }
85 
86  const vec3& get_V() const {
87  return voxel_grob()->V();
88  }
89 
90  const vec3& get_W() const {
91  return voxel_grob()->W();
92  }
93 
94  index_t get_nu() const {
95  return voxel_grob()->nu();
96  }
97 
98  index_t get_nv() const {
99  return voxel_grob()->nv();
100  }
101 
102  index_t get_nw() const {
103  return voxel_grob()->nw();
104  }
105 
106 
107  gom_slots:
108 
117  NL::Vector* find_attribute(
118  const std::string& attribute_name, bool quiet=false
119  );
120 
130  const std::string& attribute_name,
131  index_t dimension=1, MetaType* type=nullptr
132  );
133 
143  const std::string& attribute_name,
144  index_t dimension=1, MetaType* type=nullptr
145  );
146 
153  bool has_attribute(const std::string& attribute_name) const;
154 
155 
156  protected:
157 
164  bool check_voxel_grob() const;
165 
169  void update();
170  };
171 }
172 
173 #endif
Generic mechanism for attributes.
Represents additional functions that can be attached to an object.
Definition: commands.h:72
The representation of a type in the Meta repository.
Definition: meta_type.h:221
A scriptable Vector objects.
Definition: vector.h:54
A wrapper to script low-level editing operations on a VoxelGrob.
VoxelGrob * voxel_grob() const
Gets the wrapped VoxelGrob.
bool has_attribute(const std::string &attribute_name) const
Tests whether the voxel has an attribute.
bool check_voxel_grob() const
Checks whether VoxelGrob is valid.
NL::Vector * find_or_create_attribute(const std::string &attribute_name, index_t dimension=1, MetaType *type=nullptr)
Creates an attribute.
NL::Vector * create_attribute(const std::string &attribute_name, index_t dimension=1, MetaType *type=nullptr)
Creates an attribute.
void update()
Redisplays the wrapped VoxelGrob.
VoxelGrobEditor()
VoxelGrobEditor constructor.
~VoxelGrobEditor() override
VoxelGrobEditor destrutor.
A Grob class for voxel grids.
Definition: voxel_grob.h:56
class that gathers commands with menu and dialogs.
vecng< 3, Numeric::float64 > vec3
Represents points and vectors in 3d.
Definition: geometry.h:65
geo_index_t index_t
The type for storing and manipulating indices.
Definition: numeric.h:329
Global Graphite namespace.
Definition: common.h:76
Definitions common to all include files in the voxel library.
the VoxelGrob class.