Graphite  Version 3
An experimental 3D geometry processing program
mesh_grob_attributes_commands.h
Go to the documentation of this file.
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 following
35  * (non-GPL) libraries: Qt, SuperLU, WildMagic and CGAL
36  */
37 
38 
39 #ifndef H_OGF_MESH_COMMANDS_MESH_GROB_ATTRIBUTES_COMMANDS_H
40 #define H_OGF_MESH_COMMANDS_MESH_GROB_ATTRIBUTES_COMMANDS_H
41 
42 #include <OGF/mesh/common/common.h>
44 
50 namespace OGF {
51 
52 
56  gom_class MESH_API MeshGrobAttributesCommands : public MeshGrobCommands {
57  public:
58 
63 
68 
69  gom_slots:
70 
79  gom_arg_attribute(where, handler, "combo_box")
80  gom_arg_attribute(where, values, "vertices;edges;facets;cells")
81  gom_arg_attribute(type, handler, "combo_box")
82  gom_arg_attribute(type, values, "bool;uint32;int32;float64")
83  void create_attribute(
84  const std::string& name,
85  const std::string& where = "points",
86  const std::string& type = "float64",
87  index_t dimension = 1
88  );
89 
95  gom_arg_attribute(name, handler, "combo_box")
96  gom_arg_attribute(name, values, "$grob.attributes")
97  void delete_attribute(const std::string& name);
98 
99 
105  void compute_vertices_id(const std::string& attribute="id");
106 
112  void compute_edges_id(const std::string& attribute="id");
113 
119  void compute_facets_id(const std::string& attribute="id");
120 
126  void compute_chart_id(const std::string& attribute="chart");
127 
133  void compute_cells_id(const std::string& attribute="id");
134 
141  void compute_distance_to_surface(
142  const MeshGrobName& surface,
143  const std::string& attribute="distance"
144  );
145 
153  void compute_local_feature_size(
154  const MeshGrobName& surface,
155  const std::string& attribute="lfs"
156  );
157 
165  void copy_texture_colors(
166  const MeshGrobName& surface,
167  const ImageFileName& texture,
168  bool copy_tex_coords=false
169  );
170 
171 
181  void compute_ambient_occlusion(
182  const std::string& attribute="AO",
183  index_t nb_rays_per_vertex = 100,
184  index_t nb_smoothing_iterations = 2
185  );
186 
192  void compute_vertices_normals(
193  const std::string& attribute = "normal"
194  );
195 
196 
197  /*********************************************************************/
198 
199  protected:
200  void compute_sub_elements_id(
201  MeshElementsFlags what, const std::string& attribute
202  );
203 
204  };
205 
206 }
207 #endif
Commands that manipulate mesh attributes.
MeshGrobAttributesCommands()
MeshGrobAttributesCommands constructor.
~MeshGrobAttributesCommands() override
MeshGrobAttributesCommands destructor.
Base class for Commands related with a MeshGrob object.
A template class for strings that need to have a specific type in the GOM system.
Definition: properties.h:218
Base class for Commands related with a MeshGrob object.
double distance(const COORD_T *p1, const COORD_T *p2, coord_index_t dim)
Computes the distance between two nd points.
Definition: geometry_nd.h:84
double float64
Definition: numeric.h:150
int32_t int32
Definition: numeric.h:129
uint32_t uint32
Definition: numeric.h:141
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 mesh library.