Graphite  Version 3
An experimental 3D geometry processing program
mesh_grob_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 (non-GPL) libraries:
35  * Qt, SuperLU, WildMagic and CGAL
36  */
37 
38 
39 #ifndef H_OGF_MESH_COMMANDS_MESH_GROB_COMMANDS_H
40 #define H_OGF_MESH_COMMANDS_MESH_GROB_COMMANDS_H
41 
42 #include <OGF/mesh/common/common.h>
45 
50 namespace OGF {
51 
55  gom_attribute(abstract,"true")
56  gom_class MESH_API MeshGrobCommands : public Commands {
57  public:
58 
63 
67  ~MeshGrobCommands() override;
68 
74  MeshGrob* mesh_grob() const {
75  return dynamic_cast<MeshGrob*>(grob());
76  }
77 
78  protected:
79 
83  virtual void hide_attribute();
84 
91  virtual void show_attribute(
92  const std::string& attribute_name, MeshGrob* M = nullptr
93  );
94 
95 
99  virtual void show_charts(const std::string& attribute="chart");
100 
105  virtual void show_mesh(MeshGrob* M = nullptr);
106 
112  virtual void set_vertices_visibility(bool visible);
113 
117  void show_vertices() {
118  set_vertices_visibility(true);
119  }
120 
124  void hide_vertices() {
125  set_vertices_visibility(false);
126  }
127 
128 
135  virtual void show_UV(
136  const std::string& UV_attribute_name = "facet_corners.tex_coord",
137  MeshGrob* M = nullptr
138  );
139 
145  virtual void show_colors(
146  const std::string& attribute = "vertices.colors",
147  MeshGrob* M = nullptr
148  );
149 
150  };
151 }
152 #endif
153 
Represents a set of commands.
Definition: commands.h:155
Base class for Commands related with a MeshGrob object.
virtual void hide_attribute()
Hides an attribute shown by show_attribute().
virtual void show_charts(const std::string &attribute="chart")
Shows the charts, stored in the "chart" facet attribute.
void show_vertices()
Shows the vertices in the current shader.
~MeshGrobCommands() override
MeshGrobCommands destructor.
virtual void show_attribute(const std::string &attribute_name, MeshGrob *M=nullptr)
Shows an attribute.
virtual void show_colors(const std::string &attribute="vertices.colors", MeshGrob *M=nullptr)
Shows the colors of a mesh.
MeshGrobCommands()
MeshGrobCommands constructor.
virtual void set_vertices_visibility(bool visible)
Shows or hides the vertices in the current shader.
void hide_vertices()
Hides the vertices in the current shader.
MeshGrob * mesh_grob() const
Gets the MeshGrob.
virtual void show_mesh(MeshGrob *M=nullptr)
Shows the mesh.
virtual void show_UV(const std::string &UV_attribute_name="facet_corners.tex_coord", MeshGrob *M=nullptr)
Shows the parameterization of a mesh.
A Grob wrapper around Geogram's Mesh class.
Definition: mesh_grob.h:56
class that gathers commands with menu and dialogs.
the MeshGrob class.
Global Graphite namespace.
Definition: common.h:76
Definitions common to all include files in the mesh library.