Graphite
Version 3
An experimental 3D geometry processing program
|
A wrapper to script low-level editing operations on a MeshGrob. More...
#include <OGF/mesh/interfaces/mesh_grob_editor_interface.h>
Public Member Functions | |
MeshGrobEditor () | |
MeshGrobEditor constructor. | |
~MeshGrobEditor () override | |
MeshGrobEditor destrutor. | |
MeshGrob * | mesh_grob () const |
Gets the wrapped MeshGrob. More... | |
index_t | get_dimension () const |
Gets the dimension. More... | |
index_t | get_nb_vertices () const |
Gets the number of vertices. More... | |
index_t | get_nb_edges () const |
Gets the number of edges. More... | |
index_t | get_nb_facets () const |
Gets the number of facets. More... | |
index_t | get_nb_cells () const |
Gets the number of cells. More... | |
NL::Vector * | create_attribute (const std::string &attribute_name, index_t dimension=1, MetaType *type=nullptr) |
Creates an attribute. More... | |
NL::Vector * | find_or_create_attribute (const std::string &attribute_name, index_t dimension=1, MetaType *type=nullptr) |
Creates an attribute. More... | |
bool | has_attribute (const std::string &attribute_name) const |
Tests whether the mesh has an attribute. More... | |
NL::Vector * | get_points () |
Gets the points. More... | |
NL::Vector * | get_triangles () const |
If the surface mesh is triangulated, gets the array of triangles. More... | |
NL::Vector * | get_triangle_adjacents () const |
If the surface mesh is triangulated, gets the array of triangles. More... | |
NL::Vector * | get_tetrahedra () const |
If the volume mesh is tetrahedralized, gets the array of tetrahedra. More... | |
NL::Vector * | get_tetrahedra_adjacents () const |
If the volume mesh is tetrahedralized, gets the array of tetrahedra adjacencies. More... | |
void | clear () |
clears this mesh. | |
index_t | create_vertex (double x=0.0, double y=0.0, double z=0.0) |
Creates a new vertex. More... | |
void | set_vertex (index_t v, double x=0.0, double y=0.0, double z=0.0) |
Sets the coordinates of an existing vertex. More... | |
index_t | create_vertices (index_t nb) |
Creates multiple vertices. More... | |
index_t | create_facet (index_t nb_vertices) |
Creates a facet. More... | |
index_t | create_triangle (index_t v1, index_t v2, index_t v3) |
Creates a triangle. More... | |
index_t | create_quad (index_t v1, index_t v2, index_t v3, index_t v4) |
Creates a quad. More... | |
index_t | create_edge (index_t v1, index_t v2) |
Creates an edge. More... | |
void | connect_facets () |
Computes facet adjacencies. | |
index_t | facet_nb_vertices (index_t f) const |
Gets the number of vertices in a facet. More... | |
index_t | facet_vertex (index_t f, index_t lv) const |
Gets a vertex in a facet. More... | |
void | set_facet_vertex (index_t f, index_t lv, index_t v) |
Sets a vertex of the facet. More... | |
void | delete_vertices (NL::Vector *to_delete) |
Deletes a set of vertices. More... | |
void | delete_edges (NL::Vector *to_delete, bool delete_isolated_vertices=true) |
Deletes a set of edges. More... | |
void | delete_facets (NL::Vector *to_delete, bool delete_isolated_vertices=true) |
Deletes a set of facets. More... | |
void | delete_cells (NL::Vector *to_delete, bool delete_isolated_vertices=true) |
Deletes a set of cells. More... | |
Public Member Functions inherited from OGF::Interface | |
Interface () | |
Interface constructor. | |
~Interface () override | |
Interface destructor. | |
Grob * | grob () const |
Gets the Grob. More... | |
SceneGraph * | scene_graph () const |
Gets the SceneGraph. More... | |
Grob * | get_grob () const |
Gets the current Grob. More... | |
Public Member Functions inherited from OGF::Object | |
Object (bool transient=false) | |
Object constructor. More... | |
virtual | ~Object () |
Object destructor. | |
virtual MetaClass * | meta_class () const |
Gets the meta class. More... | |
virtual void | set_meta_class (MetaClass *mclass) |
Sets the meta class. More... | |
unsigned int | id () const |
Gets the identifier of this object. More... | |
std::string | string_id () const |
Gets the unique string identifier. More... | |
bool | has_method (const std::string &method_name) const |
Tests whether a method is defined. More... | |
virtual bool | invoke_method (const std::string &method_name, const ArgList &args, Any &ret_val) |
Invokes a method by method name and argument list, and gets the return value. More... | |
bool | invoke_method (const std::string &method_name, const ArgList &args) |
Invokes a method by method name and argument list. More... | |
bool | invoke_method (const std::string &method_name) |
Invokes a method by method name. More... | |
bool | has_property (const std::string &prop_name) const |
Tests whether a property is defined. More... | |
virtual bool | get_property (const std::string &prop_name, std::string &prop_value) const |
Gets a property. More... | |
virtual Connection * | connect_signal_to_slot (const std::string &signal_name, Object *to, const std::string &slot_name) |
Connects a signal with a slot of another object. More... | |
virtual void | add_connection (Connection *connection) |
Adds a connection to this object. More... | |
virtual void | remove_connection (Connection *connection) |
Removes a connection to this object. More... | |
virtual void | get_element (index_t i, Any &value) const |
Gets an element by index. More... | |
virtual void | set_element (index_t i, const Any &value) |
Sets an element by index. More... | |
virtual void | search (const std::string &needle, const std::string &path="") |
Displays the names of all objects that contain a substring. More... | |
bool | get_signals_enabled () const |
Tests wheter signals are enabled. More... | |
void | set_signals_enabled (bool value) |
Enables or disables signals. More... | |
bool | get_slots_enabled () const |
Tests wheter slots are enabled. More... | |
void | set_slots_enabled (bool value) |
Enables or disables slots. More... | |
MetaClass * | get_meta_class () const |
Gets the meta class. More... | |
std::string | get_string_id () const |
Gets the unique string identifier. More... | |
virtual std::string | get_doc () const |
Gets the documentation. More... | |
virtual Sign | compare (const Object *other) const |
Compares this object with another one. More... | |
virtual bool | is_a (const MetaType *type) const |
Tests whether this object inherits a given type. More... | |
void | disconnect () |
Removes all connections from signals of this objects. More... | |
void | enable_signals () |
Enables signals. | |
void | disable_signals () |
Disables signals. | |
void | enable_slots () |
Enables slots. | |
void | disable_slots () |
Disables slots. | |
void | set_properties (const ArgList &args) |
Sets several properties in a single call. More... | |
virtual bool | set_property (const std::string &name, const std::string &value) |
Sets an individual property. More... | |
void | help () const |
Displays some help about this object. More... | |
virtual bool | set_property (const std::string &name, const Any &value) |
Sets an individual property. More... | |
virtual bool | get_property (const std::string &prop_name, Any &prop_value) const |
Gets a property. More... | |
Public Member Functions inherited from GEO::Counted | |
void | ref () const |
Increments the reference count. More... | |
void | unref () const |
Decrements the reference count. More... | |
bool | is_shared () const |
Check if the object is shared. More... | |
int | nb_refs () const |
Gets the number of references that point to this object. More... | |
Public Attributes | |
__pad0__: void set_dimension(index_t dim) | |
__pad1__: NL::Vector* find_attribute( const std::string& attribute_name | |
bool | quiet |
Public Attributes inherited from OGF::Interface | |
__pad0__: virtual void set_grob(Grob* value) | |
Public Attributes inherited from OGF::Object | |
__pad0__: virtual index_t get_nb_elements() const | |
__pad1__: bool equals(const Object* other) const | |
Protected Member Functions | |
bool | check_mesh_grob () const |
Checks whether MeshGrob is valid. More... | |
bool | check_vertex_index (index_t v) const |
Checks whether a vertex index is valid. More... | |
bool | check_facet_index (index_t f) const |
Checks whether a facet index is valid. More... | |
void | update () |
Redisplays the wrapped MeshGrob. | |
Protected Member Functions inherited from OGF::Object | |
virtual bool | emit_signal (const std::string &signal_name, const ArgList &args, bool called_from_slot=false) |
Emits a signal and calls the slots it is connected to. More... | |
Protected Member Functions inherited from GEO::Counted | |
Counted () | |
Creates a reference counted object. More... | |
virtual | ~Counted () |
Destroys a reference counted object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from OGF::Object | |
static Object * | id_to_object (unsigned int id) |
Gets an object from a unique object id. More... | |
Static Public Member Functions inherited from GEO::Counted | |
static void | ref (const Counted *counted) |
Increments the reference count. More... | |
static void | unref (const Counted *counted) |
Decrements the reference count. More... | |
A wrapper to script low-level editing operations on a MeshGrob.
Definition at line 56 of file mesh_grob_editor_interface.h.
|
protected |
Checks whether a facet index is valid.
Displays an error message if not.
true | if facet index is valid. |
false | otherwise. |
|
protected |
|
protected |
Checks whether a vertex index is valid.
Displays an error message if not.
true | if vertex index is valid. |
false | otherwise. |
NL::Vector* OGF::MeshGrobEditor::create_attribute | ( | const std::string & | attribute_name, |
index_t | dimension = 1 , |
||
MetaType * | type = nullptr |
||
) |
Creates an attribute.
[in] | attribute_name | the name of the attribute, preceded by the elements (e.g., "vertices.attr_name", "edges.attr_name" etc...). |
[in] | dimension | number of elements per item. Default is 1. |
[in] | type | optional meta type for the attribute elements. Default is double precision number. |
Creates an edge.
[in] | v1,v2 | the two extremities of the edge, in 0..nb_vertices()-1 |
Creates a facet.
The vertices of the facet are left uninitialized.
[in] | nb_vertices | number of vertices in facet. |
Creates a quad.
[in] | v1,v2,v3,v4 | the indices of the vertices, in 0..nb_vertices()-1 |
Creates a triangle.
[in] | v1,v2,v3 | the indices of the vertices, in 0..nb_vertices()-1 |
index_t OGF::MeshGrobEditor::create_vertex | ( | double | x = 0.0 , |
double | y = 0.0 , |
||
double | z = 0.0 |
||
) |
Creates a new vertex.
If this is a 2D mesh, z
is ignored.
[in] | x,y,z | the coordinates of the vertex. |
Creates multiple vertices.
[in] | nb | the number of vertices to create. |
void OGF::MeshGrobEditor::delete_cells | ( | NL::Vector * | to_delete, |
bool | delete_isolated_vertices = true |
||
) |
Deletes a set of cells.
[in] | to_delete | a vector of type unsigned int or index_t. |
[in] | delete_isolated_vertices | if set, all vertices that have no mesh element incident to them are deleted. |
to_delete needs to have the same size as the number of cells in the mesh. A non-zero entry in to_delete means that the associated cell should be deleted.
void OGF::MeshGrobEditor::delete_edges | ( | NL::Vector * | to_delete, |
bool | delete_isolated_vertices = true |
||
) |
Deletes a set of edges.
[in] | to_delete | a vector of type unsigned int or index_t. |
[in] | delete_isolated_vertices | if set, all vertices that have no mesh element incident to them are deleted. |
to_delete needs to have the same size as the number of edges in the mesh. A non-zero entry in to_delete means that the associated edge should be deleted.
void OGF::MeshGrobEditor::delete_facets | ( | NL::Vector * | to_delete, |
bool | delete_isolated_vertices = true |
||
) |
Deletes a set of facets.
[in] | delete_isolated_vertices | if set, all vertices that have no mesh element incident to them are deleted. |
[in] | to_delete | a vector of type unsigned int or index_t. |
to_delete needs to have the same size as the number of facets in the mesh. A non-zero entry in to_delete means that the associated facet should be deleted.
void OGF::MeshGrobEditor::delete_vertices | ( | NL::Vector * | to_delete | ) |
Deletes a set of vertices.
[in] | to_delete | a vector of type unsigned int or index_t. |
to_delete needs to have the same size as the number of vertices in the mesh. A non-zero entry in to_delete means that the associated vertex should be deleted.
Gets the number of vertices in a facet.
[in] | f | the index of the facet. |
f
. Gets a vertex in a facet.
[in] | f | the facet index. |
[in] | lv | the local index of the vertex in the facet. |
NL::Vector* OGF::MeshGrobEditor::find_or_create_attribute | ( | const std::string & | attribute_name, |
index_t | dimension = 1 , |
||
MetaType * | type = nullptr |
||
) |
Creates an attribute.
[in] | attribute_name | the name of the attribute, preceded by the elements (e.g., "vertices.attr_name", "edges.attr_name" etc...). |
[in] | dimension | number of elements per item. Default is 1. |
[in] | type | optional meta type for the attribute elements. Default is double precision number. |
index_t OGF::MeshGrobEditor::get_dimension | ( | ) | const |
Gets the dimension.
index_t OGF::MeshGrobEditor::get_nb_cells | ( | ) | const |
Gets the number of cells.
index_t OGF::MeshGrobEditor::get_nb_edges | ( | ) | const |
Gets the number of edges.
index_t OGF::MeshGrobEditor::get_nb_facets | ( | ) | const |
Gets the number of facets.
index_t OGF::MeshGrobEditor::get_nb_vertices | ( | ) | const |
Gets the number of vertices.
|
inline |
Gets the points.
Definition at line 172 of file mesh_grob_editor_interface.h.
NL::Vector* OGF::MeshGrobEditor::get_tetrahedra | ( | ) | const |
If the volume mesh is tetrahedralized, gets the array of tetrahedra.
NL::Vector* OGF::MeshGrobEditor::get_tetrahedra_adjacents | ( | ) | const |
If the volume mesh is tetrahedralized, gets the array of tetrahedra adjacencies.
NL::Vector* OGF::MeshGrobEditor::get_triangle_adjacents | ( | ) | const |
If the surface mesh is triangulated, gets the array of triangles.
NL::Vector* OGF::MeshGrobEditor::get_triangles | ( | ) | const |
If the surface mesh is triangulated, gets the array of triangles.
bool OGF::MeshGrobEditor::has_attribute | ( | const std::string & | attribute_name | ) | const |
Tests whether the mesh has an attribute.
[in] | attribute_name | the name of the attribute, preceded by the elements (e.g., "vertices.attr_name", "edges.attr_name" etc...). |
true | if the mesh has an attribute of the specified name. |
false | otherwise. |
|
inline |
Gets the wrapped MeshGrob.
Definition at line 72 of file mesh_grob_editor_interface.h.
Sets a vertex of the facet.
[in] | f | the facet index. |
[in] | lv | the local index of the vertex in the facet. |
[in] | v | the global index of the vertex. |
void OGF::MeshGrobEditor::set_vertex | ( | index_t | v, |
double | x = 0.0 , |
||
double | y = 0.0 , |
||
double | z = 0.0 |
||
) |
Sets the coordinates of an existing vertex.
If this is a 2D mesh, z
is ignored.
[in] | v | the index of the vertex, in 0..nb_vertices()-1 |
[in] | x,y,z | the coordinates of the vertex. |
bool OGF::MeshGrobEditor::quiet |
Definition at line 126 of file mesh_grob_editor_interface.h.