Graphite  Version 3
An experimental 3D geometry processing program
mesh_grob_filters_commands.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 following
35  * (non-GPL) libraries: Qt, SuperLU, WildMagic and CGAL
36  */
37 
38 
39 #ifndef H_OGF_MESH_COMMANDS_MESH_GROB_FILTER_COMMANDS_H
40 #define H_OGF_MESH_COMMANDS_MESH_GROB_FILTER_COMMANDS_H
41 
42 #include <OGF/mesh/common/common.h>
44 
50 namespace OGF {
51 
52  /*******************************************************************/
53 
57  gom_class MESH_API MeshGrobFiltersCommands : public MeshGrobCommands {
58  public:
63 
68 
69  gom_slots:
70 
78  gom_arg_attribute(where, handler, "combo_box")
79  gom_arg_attribute(where, values, "vertices;facets;cells")
80  void set_filter(
81  const std::string& where, const std::string& filter="*",
82  bool propagate=true
83  );
84 
92  gom_arg_attribute(where, handler, "combo_box")
93  gom_arg_attribute(where, values, "vertices;facets;cells")
94  void add_to_filter(
95  const std::string& where, const std::string& filter,
96  bool propagate=true
97  );
98 
106  gom_arg_attribute(where, handler, "combo_box")
107  gom_arg_attribute(where, values, "vertices;facets;cells")
108  void remove_from_filter(
109  const std::string& where, const std::string& filter,
110  bool propagate=true
111  );
112 
118  gom_arg_attribute(attribute, handler, "combo_box")
119  gom_arg_attribute(attribute, values, "$grob.scalar_attributes")
120  void set_filter_from_attribute(
121  const std::string& attribute, const std::string& filter,
122  bool propagate=true
123  );
124 
130  gom_arg_attribute(attribute, handler, "combo_box")
131  gom_arg_attribute(attribute, values, "$grob.scalar_attributes")
132  void add_to_filter_attribute(
133  const std::string& attribute, const std::string& filter,
134  bool propagate=true
135  );
136 
142  gom_arg_attribute(attribute, handler, "combo_box")
143  gom_arg_attribute(attribute, values, "$grob.scalar_attributes")
144  void remove_from_filter_attribute(
145  const std::string& attribute, const std::string& filter,
146  bool propagate=true
147  );
148 
149 
155  gom_arg_attribute(from, handler, "combo_box")
156  gom_arg_attribute(from, values, "vertices;facets;cells")
157  void propagate_filter(const std::string& from);
158 
159  gom_arg_attribute(filter, handler, "combo_box")
160  gom_arg_attribute(filter, values, "$grob.filters")
161  void copy_filter_to_selection(const std::string& filter);
162 
163  gom_arg_attribute(selection, handler, "combo_box")
164  gom_arg_attribute(selection, values, "$grob.selections")
165  void copy_selection_to_filter(
166  const std::string& selection, bool propagate=true
167  );
168 
169  gom_arg_attribute(where, handler, "combo_box")
170  gom_arg_attribute(where, values, "vertices;facets;cells;all")
171  void delete_filters(const std::string& where="all");
172 
173  public:
184  static void propagate_filter(MeshGrob* mesh, MeshElementsFlags from);
185 
186 
187  enum FilterOp { FILTER_SET, FILTER_ADD, FILTER_REMOVE };
188 
199  FilterOp op,
200  const std::string& where, const std::string& filter="*",
201  bool propagate=true
202  );
203 
215  FilterOp op,
216  const std::string& attribute, const std::string& filter,
217  bool propagate=true
218  );
219 
220  };
221 }
222 
223 #endif
Base class for Commands related with a MeshGrob object.
Commands that manipulate mesh attributes.
void apply_filter_op(FilterOp op, const std::string &where, const std::string &filter="*", bool propagate=true)
applies an operation to a filter
MeshGrobFiltersCommands()
MeshGrobAttributesCommands constructor.
~MeshGrobFiltersCommands() override
MeshGrobAttributesCommands destructor.
void apply_filter_op_attribute(FilterOp op, const std::string &attribute, const std::string &filter, bool propagate=true)
applies an operation to a filter based on attribute values
A Grob wrapper around Geogram's Mesh class.
Definition: mesh_grob.h:56
Base class for Commands related with a MeshGrob object.
Global Graphite namespace.
Definition: common.h:76
Definitions common to all include files in the mesh library.