Graphite  Version 3
An experimental 3D geometry processing program
mesh_grob.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
35  * with the following (non-GPL) libraries:
36  * Qt, SuperLU, WildMagic and CGAL
37  */
38 
39 
40 #ifndef H_OGF_GEOGRAMPLUG_GROB_MESH_GROB_H
41 #define H_OGF_GEOGRAMPLUG_GROB_MESH_GROB_H
42 
43 #include <OGF/mesh/common/common.h>
45 #include <geogram/mesh/mesh.h>
46 
51 namespace OGF {
52 
56  gom_class MESH_API MeshGrob : public Grob, public GEO::Mesh {
57  public:
64 
65 
69  ~MeshGrob() override;
70 
74  bool load(const FileName& value) override;
75 
79  bool append(const FileName& value) override;
80 
84  bool save(const NewFileName& value) override;
85 
89  void clear() override;
90 
94  Grob* duplicate(SceneGraph* sg) override;
95 
99  bool is_serializable() const override;
100 
104  bool serialize_read(InputGraphiteFile& geofile) override;
105 
109  bool serialize_write(OutputGraphiteFile& geofile) override;
110 
111 
112  gom_properties:
113 
119  std::string get_attributes() const;
120 
127  std::string get_scalar_attributes() const;
128 
134  std::string get_selections() const;
135 
141  std::string get_filters() const;
142 
143  gom_slots:
151  std::string list_attributes(
152  const std::string& localisations="",
153  const std::string& types="",
154  const std::string& dims=""
155  );
156 
157 
158  public:
162  void update() override;
163 
167  Box3d bbox() const override;
168 
178  SceneGraph* sg, const std::string& name
179  );
180 
188  static MeshGrob* find(SceneGraph* sg, const std::string& name);
189 
196 
197  private:
198  };
199 
208 
219 }
220 #endif
221 
Represents a mesh.
Definition: mesh.h:2693
A 3d axis aligned box.
Definition: geometry.h:235
A Composite Graphite Object.
Base class for all 3D Graphite objects.
Definition: grob.h:68
An extension of InputGeoFile for storing a complete Graphite scenegraph in a structured binary file.
Definition: geofile.h:67
A Grob wrapper around Geogram's Mesh class.
Definition: mesh_grob.h:56
Box3d bbox() const override
Gets the bounding box.
~MeshGrob() override
MeshGrob destructor;.
bool is_serializable() const override
Tests whether this Grob can be serialized in GeoFile.
bool load(const FileName &value) override
Replaces this Grob with the contents of a file.
bool serialize_read(InputGraphiteFile &geofile) override
Reads this Grob from a GeoFile.
std::string get_scalar_attributes() const
Gets the list of all scalar attributes.
bool save(const NewFileName &value) override
Saves this Grob to a file.
bool serialize_write(OutputGraphiteFile &geofile) override
Writes this Grob into a stream.
void clear() override
Clears this Grob.
static MeshGrob * find(SceneGraph *sg, const std::string &name)
Finds a MeshGrob by name.
static MeshGrob * find_or_create(SceneGraph *sg, const std::string &name)
Finds or creates a MeshGrob with the specified name.
static void register_geogram_file_extensions()
Registers all Geogram file extensions in Graphite.
Grob * duplicate(SceneGraph *sg) override
Duplicates this Grob.
std::string get_filters() const
Gets the list of all filters.
MeshGrob(CompositeGrob *parent)
MeshGrob constructor.
std::string get_selections() const
Gets the list of all selections.
void update() override
bool append(const FileName &value) override
Appends the content of the specified file to this Grob.
A template class for strings that need to have a specific type in the GOM system.
Definition: properties.h:218
An extension of InputGeoFile for storing a complete Graphite scenegraph in a structured binary file.
Definition: geofile.h:129
Represents the list of objects loaded in Graphite.
Definition: scene_graph.h:62
The base class for all 3D objects in the system.
The class that represents a mesh.
Global Graphite namespace.
Definition: common.h:76
Name< MeshGrob * > MeshGrobName
The name of an existing MeshGrob in the SceneGraph.
Definition: mesh_grob.h:207
Name< MeshGrob *, true > NewMeshGrobName
The name of an (existing or not) MeshGrob in the SceneGraph.
Definition: mesh_grob.h:218
Definitions common to all include files in the mesh library.