Graphite  Version 3
An experimental 3D geometry processing program
mesh_grob_border_tools.h
Go to the documentation of this file.
1 
2 /*
3  * OGF/Graphite: Geometry and Graphics Programming Library + Utilities
4  * Copyright (C) 2000-2009 INRIA - Project ALICE
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  * If you modify this software, you should include a notice giving the
21  * name of the person performing the modification, the date of modification,
22  * and the reason for such modification.
23  *
24  * Contact: Bruno Levy - levy@loria.fr
25  *
26  * Project ALICE
27  * LORIA, INRIA Lorraine,
28  * Campus Scientifique, BP 239
29  * 54506 VANDOEUVRE LES NANCY CEDEX
30  * FRANCE
31  *
32  * Note that the GNU General Public License does not permit incorporating
33  * the Software into proprietary programs.
34  *
35  * As an exception to the GPL, Graphite can be linked
36  * with the following (non-GPL) libraries: Qt, SuperLU, WildMagic and CGAL
37  */
38 
39 #ifndef H_OGF_MESH_GFX_TOOLS_MESH_GROB_BORDER_TOOLS_H
40 #define H_OGF_MESH_GFX_TOOLS_MESH_GROB_BORDER_TOOLS_H
41 
42 #include <OGF/mesh_gfx/common/common.h>
44 
50 namespace OGF {
51 
55  class MESH_GFX_API MeshGrobGlueEdges : public MeshGrobTool {
56  public:
62  }
63 
67  void grab(const RayPick& p_ndc) override;
68  };
69 
73  class MESH_GFX_API MeshGrobUnglueEdges : public MeshGrobTool {
74  public:
80  }
81 
85  void grab(const RayPick& p_ndc) override;
86  };
87 
92  gom_attribute(category, "borders")
93  gom_attribute(icon, "cut_edges")
94  gom_attribute(help, "glue edges / unglue edges")
95  gom_attribute(message,
96  "btn1: glue edge; btn3: unglue edge"
97  )
98  gom_class MESH_GFX_API MeshGrobGlueUnglueEdges : public MultiTool {
99  public:
105  set_tool(MOUSE_BUTTON_LEFT, new MeshGrobGlueEdges(parent));
106  set_tool(MOUSE_BUTTON_RIGHT, new MeshGrobUnglueEdges(parent));
107  }
111  void reset() override;
112  };
113 
118  class MESH_GFX_API MeshGrobZipEdges : public MeshGrobTool {
119  public:
125  }
126 
130  void grab(const RayPick& p_ndc) override;
131  };
132 
133 
138  gom_attribute(category, "borders")
139  gom_attribute(icon, "zip_edge")
140  gom_attribute(help, "zip edges / unzip edges")
141  gom_attribute(message,
142  "btn1: zip edges; btn3: unzip edge"
143  )
144  gom_class MESH_GFX_API MeshGrobZipUnzipEdges : public MultiTool {
145  public:
151  set_tool(MOUSE_BUTTON_LEFT, new MeshGrobZipEdges(parent));
152  set_tool(MOUSE_BUTTON_RIGHT, new MeshGrobUnglueEdges(parent));
153  }
154 
158  void reset() override;
159  };
160 
161 
166  class MESH_GFX_API MeshGrobConnectEdges : public MeshGrobTool {
167  public:
173  f_ = NO_FACET;
174  c_ = NO_CORNER;
175  }
176 
180  void grab(const RayPick& p_ndc) override;
181 
185  void reset() override;
186 
187  private:
188  index_t f_;
189  index_t c_;
190  };
191 
192 
197  gom_attribute(category, "borders")
198  gom_attribute(icon, "connect_edges")
199  gom_attribute(help, "connect edges / disconnect edges")
200  gom_attribute(message,
201  "btn1: connect edges; btn3: disconnect edges"
202  )
203  gom_class MESH_GFX_API MeshGrobConnectDisconnectEdges : public MultiTool {
204  public:
210  ToolsManager* parent
211  ) : MultiTool(parent) {
212  set_tool(MOUSE_BUTTON_LEFT, new MeshGrobConnectEdges(parent));
213  set_tool(MOUSE_BUTTON_RIGHT, new MeshGrobUnglueEdges(parent));
214  }
215 
219  void reset() override;
220  };
221 }
222 
223 #endif
A Tool that zips/unzips edges depending on the pushed mouse button.
void reset() override
Resets this Tool.
MeshGrobConnectDisconnectEdges(ToolsManager *parent)
MeshGrobConnectDisconnectEdges constructor.
A Tool that connects two picked mesh facet edges on the border.
MeshGrobConnectEdges(ToolsManager *manager)
MeshGrobConnectEdges constructor.
void reset() override
Resets this Tool.
void grab(const RayPick &p_ndc) override
A Tool that glues edges on the border.
MeshGrobGlueEdges(ToolsManager *manager)
MeshGrobGlueEdges constructor.
void grab(const RayPick &p_ndc) override
A Tool that glues/unglues edges depending on the pushed mouse button.
void reset() override
Resets this Tool.
MeshGrobGlueUnglueEdges(ToolsManager *parent)
MeshGrobGlueUnglueEdges constructor.
Base class for tools that operate on MeshGrob.
A Tool that unglues two edges, thus forming a new border.
MeshGrobUnglueEdges(ToolsManager *manager)
MeshGrobUnGlueEdges constructor.
void grab(const RayPick &p_ndc) override
A Tool that zips two edges on the border, starting from their common vertex.
MeshGrobZipEdges(ToolsManager *manager)
MeshGrobZipEdges constructor.
void grab(const RayPick &p_ndc) override
A Tool that zips/unzips edges depending on the pushed mouse button.
MeshGrobZipUnzipEdges(ToolsManager *parent)
MeshGrobZipUnzipEdges constructor.
void reset() override
Resets this Tool.
A Tool that can associate a different tool to each button of the mouse.
Definition: tool.h:199
Manages the Tool objects associated with a given Grob class.
Definition: tools_manager.h:62
Base classes for tools that operate on MeshGrob.
geo_index_t index_t
The type for storing and manipulating indices.
Definition: numeric.h:329
Global Graphite namespace.
Definition: common.h:76
Represents the information related with a picking event.
Definition: ray_picker.h:64