#include <ObjectTypes/MeshObject/MeshObjectT.hh>


Public Member Functions | |
| MeshObject (const MeshObject &_object) | |
| copy constructor | |
| MeshObject (DataType _typeId) | |
| Constructor. | |
| virtual | ~MeshObject () |
| destructor | |
| virtual void | cleanup () |
| Reset current object, including all related nodes. | |
Name and Path handling | |
| void | setName (QString _name) |
| Set the name of the Object. | |
Load/Save | |
| bool | loadMesh (QString _filename) |
| Load a mesh from the given file. | |
Object Information | |
| QString | getObjectinfo () |
| Get all Info for the Object as a string. | |
Picking | |
| bool | picked (uint _node_idx) |
| detect if the node has been picked | |
| void | enablePicking (bool _enable) |
| Enable or disable picking for this Node. | |
| bool | pickingEnabled () |
| Check if picking is enabled for this Node. | |
Protected Member Functions | |
| virtual void | init (MeshT *_mesh=0) |
| Initialise current object, including all related nodes. | |
BSP Extension ( Implements a BSP for the mesh used for fast searches ) | |
|
| |
|
typedef OpenMeshTriangleBSPT < MeshT > | OMTriangleBSP |
| OMTriangleBSP * | triangle_bsp_ |
| If requested a bsp is created for this object. | |
| OMTriangleBSP * | requestTriangleBsp () |
| void | invalidateTriangleBsp () |
| OMTriangleBSP * | resetTriangleBsp () |
Content | |
|
| |
| MeshT * | mesh_ |
| MeshT * | mesh () |
| return a pointer to the mesh | |
| virtual void | update (UpdateType _type=UPDATE_ALL) |
| Update the whole Object (Selection,Topology,...). | |
| void | updateSelection () |
| Call this function to update the modeling regions. | |
| void | updateModelingRegions () |
| Call this function to update the modeling regions. | |
| void | updateFeatures () |
| Update Feature Visualization Node. | |
| void | updateGeometry () |
| Update Geometry of all data structures. | |
| void | updateColor () |
| Update Colors of all data structures. | |
| void | updateTopology () |
| Update Topology of all data structures. | |
| void | updateTexture () |
| Update Texture of all data structures. | |
| BaseObject * | copy () |
Visualization | |
|
| |
|
ACG::SceneGraph::SelectionNodeT < MeshT > * | statusNode_ |
| Status Node for a mesh, visualizing the selection state of a mesh. | |
|
ACG::SceneGraph::StatusNodeT < MeshT, AreaNodeMod< MeshT > > * | areaNode_ |
| Area selection Vis. | |
|
ACG::SceneGraph::StatusNodeT < MeshT, HandleNodeMod< MeshT > > * | handleNode_ |
| Handle selection Vis. | |
|
ACG::SceneGraph::StatusNodeT < MeshT, FeatureNodeMod< MeshT > > * | featureNode_ |
| Feature selection Vis. | |
|
ACG::SceneGraph::MeshNodeT < MeshT > * | meshNode_ |
| Scenegraph Mesh Node. | |
| ACG::SceneGraph::EnvMapNode * | textureNode_ |
| Scenegraph TextureNode. | |
| ACG::SceneGraph::ShaderNode * | shaderNode_ |
| Scenegraph ShaderNode. | |
| ACG::SceneGraph::EnvMapNode * | textureNode () |
| Get the TextureNode of the current mesh. | |
| ACG::SceneGraph::ShaderNode * | shaderNode () |
| Return pointer to the shader node. | |
| void | hideSelection (bool _hide) |
| Hide or show the selection Node of the object. | |
| bool | selectionVisible () |
| return if the selections are currently visible | |
| void | hideFeatures (bool _hide) |
| Hide or show the feature Node of the object. | |
| bool | featuresVisible () |
| return if the feature Node of the object is currently visible | |
| void | hideAreas (bool _hide) |
| Hide or show the area Nodes of the object. | |
| bool | areasVisible () |
| return if the areas are currently visible | |
| ACG::SceneGraph::MeshNodeT < MeshT > * | meshNode () |
| Get the Scenegraph Mesh Node. | |
| void | boundingBox (ACG::Vec3d &_bbMin, typename ACG::Vec3d &_bbMax) |
| Get the BoundingBox of this object. | |
| BaseNode * | primaryNode () |
This class provides the functionality for all kind of meshes for the framework
Definition at line 95 of file MeshObjectT.hh.
| MeshObject< MeshT >::MeshObject | ( | const MeshObject< MeshT > & | _object | ) |
copy constructor
Create a copy of this object
Definition at line 68 of file MeshObjectT.cc.
References BaseObjectData::init(), BaseObject::name(), and MeshObject< MeshT >::setName().
| MeshObject< MeshT >::MeshObject | ( | DataType | _typeId | ) |
Constructor.
This is the standard constructor for MeshObjects. As triangle and Poly Meshes are handled by this class, the typeId is passed to the MeshObject to specify it.
| _typeId | This is the type Id the Object will use. Should be typeId("TriangleMesh") or typeId("PolyMesh") |
Constructor for Mesh Objects. This object class gets a Separator Node giving the root node to which it should be connected. The mesh is generated internally and all nodes for visualization will be added below the scenegraph node.
You dont need to create an object of this type manually. Use PluginFunctions::addTriMesh or PluginFunctions::addPolyMesh instead. The objectDataType has to match the one of MeshT ( see Types.hh::DataType )
Definition at line 96 of file MeshObjectT.cc.
References BaseObjectData::init(), and BaseObject::setDataType().
| MeshObject< MeshT >::~MeshObject | ( | ) | [virtual] |
destructor
Destructor for Mesh Objects. The destructor deletes the mesh and all Scenegraph nodes associated with the mesh or the object.
Definition at line 116 of file MeshObjectT.cc.
References MeshObject< MeshT >::areaNode_, BaseObject::deleteData(), MeshObject< MeshT >::featureNode_, MeshObject< MeshT >::handleNode_, MeshObject< MeshT >::meshNode_, MeshObject< MeshT >::shaderNode_, MeshObject< MeshT >::textureNode_, and MeshObject< MeshT >::triangle_bsp_.
| void MeshObject< MeshT >::boundingBox | ( | ACG::Vec3d & | _bbMin, | |
| typename ACG::Vec3d & | _bbMax | |||
| ) |
Get the BoundingBox of this object.
Get the Bounding box size of this object
Definition at line 534 of file MeshObjectT.cc.
References ACG::SceneGraph::MeshNodeT< Mesh >::boundingBox(), and MeshObject< MeshT >::meshNode_.
| void MeshObject< MeshT >::cleanup | ( | void | ) | [virtual] |
Reset current object, including all related nodes.
Cleanup Function for Mesh Objects. Deletes the contents of the whole object and calls MeshObject::init afterwards.
Reimplemented from BaseObjectData.
Definition at line 150 of file MeshObjectT.cc.
References MeshObject< MeshT >::areaNode_, MeshObject< MeshT >::featureNode_, MeshObject< MeshT >::handleNode_, BaseObjectData::init(), MeshObject< MeshT >::meshNode_, MeshObject< MeshT >::shaderNode_, MeshObject< MeshT >::statusNode_, MeshObject< MeshT >::textureNode_, and MeshObject< MeshT >::triangle_bsp_.
| BaseObject * MeshObject< MeshT >::copy | ( | ) | [virtual] |
return a full copy of this object ( All scenegraph nodes will be created ) but the object will not be a part of the object tree.
Reimplemented from BaseObject.
Definition at line 449 of file MeshObjectT.cc.
| QString MeshObject< MeshT >::getObjectinfo | ( | ) | [virtual] |
Get all Info for the Object as a string.
Returns a string containing all information about the current object. This also includes the information provided by BaseObjectData::getObjectinfo
Reimplemented from BaseObject.
Definition at line 593 of file MeshObjectT.cc.
References BaseObject::dataType(), MeshObject< MeshT >::mesh(), and typeId().
| void MeshObject< MeshT >::hideAreas | ( | bool | _hide | ) |
Hide or show the area Nodes of the object.
Shows or hides the areas on the object
Definition at line 503 of file MeshObjectT.cc.
References ACG::SceneGraph::BaseNode::Active, MeshObject< MeshT >::areaNode_, MeshObject< MeshT >::handleNode_, ACG::SceneGraph::BaseNode::HideNode, and ACG::SceneGraph::ACG::SceneGraph::BaseNode::set_status().
Referenced by ViewControlPlugin::showModelingAreas().
| void MeshObject< MeshT >::hideSelection | ( | bool | _hide | ) |
Hide or show the selection Node of the object.
Shows or hides the selections on the object
Definition at line 476 of file MeshObjectT.cc.
References ACG::SceneGraph::BaseNode::Active, ACG::SceneGraph::BaseNode::HideNode, ACG::SceneGraph::ACG::SceneGraph::BaseNode::set_status(), and MeshObject< MeshT >::statusNode_.
Referenced by ViewControlPlugin::showSelection().
| void MeshObject< MeshT >::init | ( | MeshT * | _mesh = 0 |
) | [protected, virtual] |
Initialise current object, including all related nodes.
This function initalizes the mesh object. It creates the scenegraph nodes, the mesh and requests all required properties for the mesh.
Definition at line 181 of file MeshObjectT.cc.
References MeshObject< MeshT >::areaNode_, GLSL::Program::disable(), ACG::SceneGraph::MaterialNode::enable_alpha_test(), MeshObject< MeshT >::featureNode_, MeshObject< MeshT >::handleNode_, BaseObjectData::manipulatorNode(), BaseObjectData::materialNode(), MeshObject< MeshT >::meshNode_, ACG::SceneGraph::MaterialNode::set_color(), ACG::SceneGraph::MaterialNode::set_line_width(), ACG::SceneGraph::MaterialNode::set_point_size(), ACG::SceneGraph::MaterialNode::set_round_points(), GLSL::Program::setUniform(), MeshObject< MeshT >::shaderNode_, ACG::SceneGraph::DrawModes::SOLID_PHONG_SHADED, ACG::SceneGraph::DrawModes::SOLID_SHADER, MeshObject< MeshT >::statusNode_, MeshObject< MeshT >::textureNode(), MeshObject< MeshT >::textureNode_, MeshObject< MeshT >::update(), and GLSL::Program::use().
| void MeshObject< MeshT >::invalidateTriangleBsp | ( | ) |
If something in the mesh changes, call this function to clear the octree. You have to do a new request as the old one will be deleted.
: Update the tree when the update function of this object is called.
: dont recreate but update the old one.
Definition at line 696 of file MeshObjectT.cc.
References MeshObject< MeshT >::triangle_bsp_.
Referenced by MeshObject< MeshT >::updateGeometry(), and MeshObject< MeshT >::updateTopology().
| bool MeshObject< MeshT >::loadMesh | ( | QString | _filename | ) |
Load a mesh from the given file.
Load the mesh data from a file. The loader uses the OpenMesh object loaders and therefore supports all mesh types supported by OpenMesh.
| _filename | Full path of the file to load. |
Definition at line 554 of file MeshObjectT.cc.
References BaseObject::dataType(), MeshObject< MeshT >::mesh(), BaseObject::name(), OpenMesh::IO::read_mesh(), BaseObjectData::setFromFileName(), MeshObject< MeshT >::setName(), BaseObjectData::show(), and MeshObject< MeshT >::update().
| MeshT * MeshObject< MeshT >::mesh | ( | ) |
return a pointer to the mesh
Get a pointer to the objects mesh.
Definition at line 334 of file MeshObjectT.cc.
Referenced by OFFImporter::addObject(), MeshRepairPlugin::detectFoldover(), MeshObject< MeshT >::getObjectinfo(), MeshObject< MeshT >::loadMesh(), FileSTLPlugin::loadObject(), FileOMPlugin::loadObject(), FileOFFPlugin::loadObject(), FileOBJPlugin::loadObject(), FileOMPlugin::loadPolyMeshObject(), FileOMPlugin::loadTriMeshObject(), and MeshObject< MeshT >::requestTriangleBsp().
| ACG::SceneGraph::MeshNodeT< MeshT > * MeshObject< MeshT >::meshNode | ( | ) |
Get the Scenegraph Mesh Node.
Returns a pointer to the mesh node
Definition at line 527 of file MeshObjectT.cc.
References MeshObject< MeshT >::meshNode_.
| bool MeshObject< MeshT >::picked | ( | uint | _node_idx | ) | [virtual] |
detect if the node has been picked
Given an node index from PluginFunctions::scenegraphPick this function can be used to check if the meshNode of the object has been picked.
| _node_idx | Index of the picked mesh node |
Reimplemented from BaseObjectData.
Definition at line 624 of file MeshObjectT.cc.
References ACG::SceneGraph::ACG::SceneGraph::BaseNode::id(), and MeshObject< MeshT >::meshNode_.
| BaseNode * MeshObject< MeshT >::primaryNode | ( | ) | [virtual] |
get the primary node of this object (Use this node to change drawModes)
Reimplemented from BaseObjectData.
Definition at line 709 of file MeshObjectT.cc.
References BaseObjectData::boundingBoxNode().
| MeshObject< MeshT >::OMTriangleBSP * MeshObject< MeshT >::requestTriangleBsp | ( | ) |
Get a bsp for this object. Only supported for Triangle Meshes at the moment.
Definition at line 653 of file MeshObjectT.cc.
References TriangleBSPCoreT< BSPTraits >::build(), BaseObject::dataType(), MeshObject< MeshT >::mesh(), TriangleBSPCoreT< BSPTraits >::push_back(), TriangleBSPCoreT< BSPTraits >::reserve(), MeshObject< MeshT >::triangle_bsp_, and typeId().
Referenced by MeshObject< MeshT >::resetTriangleBsp().
| MeshObject< MeshT >::OMTriangleBSP * MeshObject< MeshT >::resetTriangleBsp | ( | ) |
Update the bsp for this object. Only supported for Triangle Meshes at the moment.
Definition at line 684 of file MeshObjectT.cc.
References MeshObject< MeshT >::requestTriangleBsp(), and MeshObject< MeshT >::triangle_bsp_.
| void MeshObject< MeshT >::setName | ( | QString | _name | ) | [virtual] |
Set the name of the Object.
Set the name of an object. All Scenegraph nodes are renamed too. It also calls BaseObjectData::setName.
Reimplemented from BaseObjectData.
Definition at line 297 of file MeshObjectT.cc.
References MeshObject< MeshT >::areaNode_, MeshObject< MeshT >::featureNode_, MeshObject< MeshT >::handleNode_, MeshObject< MeshT >::meshNode_, ACG::SceneGraph::ACG::SceneGraph::BaseNode::name(), MeshObject< MeshT >::shaderNode_, MeshObject< MeshT >::statusNode_, and MeshObject< MeshT >::textureNode_.
Referenced by MeshObject< MeshT >::loadMesh(), and MeshObject< MeshT >::MeshObject().
| ACG::SceneGraph::ShaderNode * MeshObject< MeshT >::shaderNode | ( | ) | [virtual] |
Return pointer to the shader node.
Returns a pointer to the shader node
Reimplemented from BaseObjectData.
Definition at line 469 of file MeshObjectT.cc.
References MeshObject< MeshT >::shaderNode_.
| ACG::SceneGraph::EnvMapNode * MeshObject< MeshT >::textureNode | ( | ) |
Get the TextureNode of the current mesh.
Returns a pointer to the texture node
Definition at line 461 of file MeshObjectT.cc.
References MeshObject< MeshT >::textureNode_.
Referenced by MeshObject< MeshT >::init().
| void MeshObject< MeshT >::update | ( | UpdateType | _type = UPDATE_ALL |
) | [virtual] |
Update the whole Object (Selection,Topology,...).
Updates the visualization of the object. Calls MeshObject::updateGeometry, MeshObject::updateTopology, MeshObject::updateSelection and MeshObject::updateModelingRegions.
Reimplemented from BaseObjectData.
Definition at line 343 of file MeshObjectT.cc.
References UpdateType::contains(), PluginFunctions::setMainGLContext(), UPDATE_ALL, UPDATE_COLOR, UPDATE_GEOMETRY, UPDATE_SELECTION, UPDATE_TEXTURE, UPDATE_TOPOLOGY, MeshObject< MeshT >::updateColor(), MeshObject< MeshT >::updateFeatures(), MeshObject< MeshT >::updateGeometry(), MeshObject< MeshT >::updateModelingRegions(), MeshObject< MeshT >::updateSelection(), MeshObject< MeshT >::updateTexture(), and MeshObject< MeshT >::updateTopology().
Referenced by MeshObject< MeshT >::init(), MeshObject< MeshT >::loadMesh(), FileOFFPlugin::loadObject(), FileOBJPlugin::loadObject(), and SubdividerPlugin::subdivide().
| void MeshObject< MeshT >::updateColor | ( | ) |
Update Colors of all data structures.
Updates the color information in the mesh scenegraph node
Definition at line 407 of file MeshObjectT.cc.
References MeshObject< MeshT >::meshNode_, and ACG::SceneGraph::MeshNodeT< Mesh >::update_color().
Referenced by MeshObject< MeshT >::update().
| void MeshObject< MeshT >::updateFeatures | ( | ) |
Update Feature Visualization Node.
Updates the modeling regions scenegraph nodes
Definition at line 436 of file MeshObjectT.cc.
References MeshObject< MeshT >::featureNode_, and ACG::SceneGraph::StatusNodeT< Mesh, Mod >::updateSelection().
Referenced by MeshObject< MeshT >::update().
| void MeshObject< MeshT >::updateGeometry | ( | ) |
Update Geometry of all data structures.
Updates the geometry information in the mesh scenegraph node
Definition at line 388 of file MeshObjectT.cc.
References MeshObject< MeshT >::areaNode_, MeshObject< MeshT >::featureNode_, MeshObject< MeshT >::handleNode_, MeshObject< MeshT >::invalidateTriangleBsp(), MeshObject< MeshT >::meshNode_, MeshObject< MeshT >::statusNode_, ACG::SceneGraph::MeshNodeT< Mesh >::update_geometry(), and ACG::SceneGraph::StatusNodeT< Mesh, Mod >::updateGeometry().
Referenced by MeshObject< MeshT >::update().
| void MeshObject< MeshT >::updateModelingRegions | ( | ) |
Call this function to update the modeling regions.
Updates the modeling regions scenegraph nodes
Definition at line 427 of file MeshObjectT.cc.
References MeshObject< MeshT >::areaNode_, MeshObject< MeshT >::handleNode_, and ACG::SceneGraph::StatusNodeT< Mesh, Mod >::updateSelection().
Referenced by MeshObject< MeshT >::update().
| void MeshObject< MeshT >::updateSelection | ( | ) |
Call this function to update the modeling regions.
Updates the selection scenegraph nodes
Definition at line 381 of file MeshObjectT.cc.
References MeshObject< MeshT >::statusNode_, and ACG::SceneGraph::StatusNodeT< Mesh, Mod >::updateSelection().
Referenced by MeshObject< MeshT >::update().
| void MeshObject< MeshT >::updateTexture | ( | ) |
Update Texture of all data structures.
Updates the modeling regions scenegraph nodes
Definition at line 443 of file MeshObjectT.cc.
References MeshObject< MeshT >::meshNode_, and ACG::SceneGraph::MeshNodeT< Mesh >::update_textures().
Referenced by MeshObject< MeshT >::update().
| void MeshObject< MeshT >::updateTopology | ( | ) |
Update Topology of all data structures.
Updates the topology information in the mesh scenegraph node
Definition at line 414 of file MeshObjectT.cc.
References MeshObject< MeshT >::areaNode_, MeshObject< MeshT >::featureNode_, MeshObject< MeshT >::handleNode_, MeshObject< MeshT >::invalidateTriangleBsp(), MeshObject< MeshT >::meshNode_, MeshObject< MeshT >::statusNode_, ACG::SceneGraph::MeshNodeT< Mesh >::update_topology(), and ACG::SceneGraph::StatusNodeT< Mesh, Mod >::updateTopology().
Referenced by MeshObject< MeshT >::update().
1.7.1