#include <MeshObjectT.hh>


Public Member Functions | |
| MeshObject (const MeshObject &_object) | |
| copy constructor | |
| MeshObject (SeparatorNode *_rootNode) | |
| 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 () |
| 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 | updateTopology () |
| Update Topology 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::TriStripNodeT < 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::TriStripNodeT < MeshT > * | meshNode () |
| Get the Scenegraph Mesh Node. | |
| void | boundingBox (ACG::Vec3f &_bbMin, typename ACG::Vec3f &_bbMax) |
| Get the BoundingBox of this object. | |
This class provides the functionality for all kind of meshes for the framework
Definition at line 104 of file MeshObjectT.hh.
| MeshObject< MeshT, objectDataType >::MeshObject | ( | const MeshObject< MeshT, objectDataType > & | _object | ) | [inline] |
copy constructor
Create a copy of this object
Definition at line 68 of file MeshObjectT.cc.
References BaseObjectData::init(), BaseObject::name(), and MeshObject< MeshT, objectDataType >::setName().
| MeshObject< MeshT, objectDataType >::MeshObject | ( | SeparatorNode * | _rootNode | ) | [inline] |
constructor
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 95 of file MeshObjectT.cc.
References BaseObjectData::init(), and BaseObject::setDataType().
| MeshObject< MeshT, objectDataType >::~MeshObject | ( | ) | [inline, 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 115 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::areaNode_, BaseObject::deleteData(), MeshObject< MeshT, objectDataType >::featureNode_, MeshObject< MeshT, objectDataType >::handleNode_, MeshObject< MeshT, objectDataType >::meshNode_, MeshObject< MeshT, objectDataType >::shaderNode_, MeshObject< MeshT, objectDataType >::textureNode_, and MeshObject< MeshT, objectDataType >::triangle_bsp_.
| void MeshObject< MeshT, objectDataType >::boundingBox | ( | ACG::Vec3f & | _bbMin, | |
| typename ACG::Vec3f & | _bbMax | |||
| ) | [inline] |
Get the BoundingBox of this object.
Get the Bounding box size of this object
Definition at line 487 of file MeshObjectT.cc.
References ACG::SceneGraph::MeshNodeT< Mesh >::boundingBox(), and MeshObject< MeshT, objectDataType >::meshNode_.
| void MeshObject< MeshT, objectDataType >::cleanup | ( | ) | [inline, 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 149 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::areaNode_, MeshObject< MeshT, objectDataType >::featureNode_, MeshObject< MeshT, objectDataType >::handleNode_, BaseObjectData::init(), MeshObject< MeshT, objectDataType >::meshNode_, BaseObject::setDataType(), MeshObject< MeshT, objectDataType >::shaderNode_, MeshObject< MeshT, objectDataType >::statusNode_, MeshObject< MeshT, objectDataType >::textureNode_, and MeshObject< MeshT, objectDataType >::triangle_bsp_.
| BaseObject * MeshObject< MeshT, objectDataType >::copy | ( | ) | [inline, 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 402 of file MeshObjectT.cc.
| QString MeshObject< MeshT, objectDataType >::getObjectinfo | ( | ) | [inline, 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 546 of file MeshObjectT.cc.
References DATA_POLY_MESH, DATA_TRIANGLE_MESH, BaseObject::dataType(), and MeshObject< MeshT, objectDataType >::mesh().
| void MeshObject< MeshT, objectDataType >::hideAreas | ( | bool | _hide | ) | [inline] |
Hide or show the area Nodes of the object.
Shows or hides the areas on the object
Definition at line 456 of file MeshObjectT.cc.
References ACG::SceneGraph::BaseNode::Active, MeshObject< MeshT, objectDataType >::areaNode_, MeshObject< MeshT, objectDataType >::handleNode_, ACG::SceneGraph::BaseNode::HideNode, and ACG::SceneGraph::BaseNode::set_status().
| void MeshObject< MeshT, objectDataType >::hideSelection | ( | bool | _hide | ) | [inline] |
Hide or show the selection Node of the object.
Shows or hides the selections on the object
Definition at line 429 of file MeshObjectT.cc.
References ACG::SceneGraph::BaseNode::Active, ACG::SceneGraph::BaseNode::HideNode, ACG::SceneGraph::BaseNode::set_status(), and MeshObject< MeshT, objectDataType >::statusNode_.
| void MeshObject< MeshT, objectDataType >::init | ( | MeshT * | _mesh = 0 |
) | [inline, 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 182 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::areaNode_, GLSL::Program::disable(), ACG::SceneGraph::MaterialNode::enable_alpha_test(), MeshObject< MeshT, objectDataType >::featureNode_, MeshObject< MeshT, objectDataType >::handleNode_, BaseObjectData::manipulatorNode(), BaseObjectData::materialNode(), MeshObject< MeshT, objectDataType >::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, objectDataType >::shaderNode_, ACG::SceneGraph::DrawModes::SOLID_PHONG_SHADED, ACG::SceneGraph::DrawModes::SOLID_SHADER, MeshObject< MeshT, objectDataType >::statusNode_, MeshObject< MeshT, objectDataType >::textureNode(), MeshObject< MeshT, objectDataType >::textureNode_, MeshObject< MeshT, objectDataType >::update(), and GLSL::Program::use().
| void MeshObject< MeshT, objectDataType >::invalidateTriangleBsp | ( | ) | [inline] |
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 649 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::triangle_bsp_.
Referenced by MeshObject< MeshT, objectDataType >::updateGeometry(), and MeshObject< MeshT, objectDataType >::updateTopology().
| bool MeshObject< MeshT, objectDataType >::loadMesh | ( | QString | _filename | ) | [inline] |
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 507 of file MeshObjectT.cc.
References DATA_POLY_MESH, DATA_TRIANGLE_MESH, BaseObject::dataType(), MeshObject< MeshT, objectDataType >::mesh(), BaseObject::name(), BaseObjectData::setFromFileName(), MeshObject< MeshT, objectDataType >::setName(), BaseObjectData::show(), and MeshObject< MeshT, objectDataType >::update().
| MeshT * MeshObject< MeshT, objectDataType >::mesh | ( | ) | [inline] |
return a pointer to the mesh
Get a pointer to the objects mesh.
Definition at line 335 of file MeshObjectT.cc.
Referenced by MeshObject< MeshT, objectDataType >::getObjectinfo(), MeshObject< MeshT, objectDataType >::loadMesh(), MeshObject< MeshT, objectDataType >::requestTriangleBsp(), and Core::slotLoad().
| ACG::SceneGraph::TriStripNodeT< MeshT > * MeshObject< MeshT, objectDataType >::meshNode | ( | ) | [inline] |
Get the Scenegraph Mesh Node.
Returns a pointer to the mesh node
Definition at line 480 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::meshNode_.
| bool MeshObject< MeshT, objectDataType >::picked | ( | uint | _node_idx | ) | [inline, 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 577 of file MeshObjectT.cc.
References ACG::SceneGraph::BaseNode::id(), and MeshObject< MeshT, objectDataType >::meshNode_.
| MeshObject< MeshT, objectDataType >::OMTriangleBSP * MeshObject< MeshT, objectDataType >::requestTriangleBsp | ( | ) | [inline] |
Get a bsp for this object. Only supported for Triangle Meshes at the moment.
Definition at line 606 of file MeshObjectT.cc.
References TriangleBSPCoreT< BSPTraits >::build(), DATA_TRIANGLE_MESH, BaseObject::dataType(), MeshObject< MeshT, objectDataType >::mesh(), TriangleBSPCoreT< BSPTraits >::push_back(), TriangleBSPCoreT< BSPTraits >::reserve(), and MeshObject< MeshT, objectDataType >::triangle_bsp_.
Referenced by MeshObject< MeshT, objectDataType >::resetTriangleBsp().
| MeshObject< MeshT, objectDataType >::OMTriangleBSP * MeshObject< MeshT, objectDataType >::resetTriangleBsp | ( | ) | [inline] |
Update the bsp for this object. Only supported for Triangle Meshes at the moment.
Definition at line 637 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::requestTriangleBsp(), and MeshObject< MeshT, objectDataType >::triangle_bsp_.
| void MeshObject< MeshT, objectDataType >::setName | ( | QString | _name | ) | [inline, 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 298 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::areaNode_, MeshObject< MeshT, objectDataType >::featureNode_, MeshObject< MeshT, objectDataType >::handleNode_, MeshObject< MeshT, objectDataType >::meshNode_, ACG::SceneGraph::BaseNode::name(), MeshObject< MeshT, objectDataType >::shaderNode_, MeshObject< MeshT, objectDataType >::statusNode_, and MeshObject< MeshT, objectDataType >::textureNode_.
Referenced by MeshObject< MeshT, objectDataType >::loadMesh(), and MeshObject< MeshT, objectDataType >::MeshObject().
| ACG::SceneGraph::ShaderNode * MeshObject< MeshT, objectDataType >::shaderNode | ( | ) | [inline, virtual] |
Return pointer to the shader node.
Returns a pointer to the shader node
Reimplemented from BaseObjectData.
Definition at line 422 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::shaderNode_.
| ACG::SceneGraph::EnvMapNode * MeshObject< MeshT, objectDataType >::textureNode | ( | ) | [inline] |
Get the TextureNode of the current mesh.
Returns a pointer to the texture node
Definition at line 414 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::textureNode_.
Referenced by MeshObject< MeshT, objectDataType >::init().
| void MeshObject< MeshT, objectDataType >::update | ( | ) | [inline, 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 344 of file MeshObjectT.cc.
References PluginFunctions::setMainGLContext(), MeshObject< MeshT, objectDataType >::updateFeatures(), MeshObject< MeshT, objectDataType >::updateGeometry(), MeshObject< MeshT, objectDataType >::updateModelingRegions(), MeshObject< MeshT, objectDataType >::updateSelection(), and MeshObject< MeshT, objectDataType >::updateTopology().
Referenced by MeshObject< MeshT, objectDataType >::init(), and MeshObject< MeshT, objectDataType >::loadMesh().
| void MeshObject< MeshT, objectDataType >::updateFeatures | ( | ) | [inline] |
Update Feature Visualization Node.
Updates the modeling regions scenegraph nodes
Definition at line 395 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::featureNode_, and ACG::SceneGraph::StatusNodeT< Mesh, Mod >::update_cache().
Referenced by MeshObject< MeshT, objectDataType >::update().
| void MeshObject< MeshT, objectDataType >::updateGeometry | ( | ) | [inline] |
Update Geometry of all data structures.
Updates the geometry information in the mesh scenegraph node
Definition at line 368 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::invalidateTriangleBsp(), MeshObject< MeshT, objectDataType >::meshNode_, and ACG::SceneGraph::MeshNodeT< Mesh >::update_geometry().
Referenced by MeshObject< MeshT, objectDataType >::update().
| void MeshObject< MeshT, objectDataType >::updateModelingRegions | ( | ) | [inline] |
Call this function to update the modeling regions.
Updates the modeling regions scenegraph nodes
Definition at line 386 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::areaNode_, MeshObject< MeshT, objectDataType >::handleNode_, and ACG::SceneGraph::StatusNodeT< Mesh, Mod >::update_cache().
Referenced by MeshObject< MeshT, objectDataType >::update().
| void MeshObject< MeshT, objectDataType >::updateSelection | ( | ) | [inline] |
Call this function to update the modeling regions.
Updates the selection scenegraph nodes
Definition at line 361 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::statusNode_, and ACG::SceneGraph::StatusNodeT< Mesh, Mod >::update_cache().
Referenced by MeshObject< MeshT, objectDataType >::update().
| void MeshObject< MeshT, objectDataType >::updateTopology | ( | ) | [inline] |
Update Topology of all data structures.
Updates the topology information in the mesh scenegraph node
Definition at line 376 of file MeshObjectT.cc.
References MeshObject< MeshT, objectDataType >::invalidateTriangleBsp(), MeshObject< MeshT, objectDataType >::meshNode_, ACG::SceneGraph::TriStripNodeT< Mesh >::update_strips(), and ACG::SceneGraph::TriStripNodeT< Mesh >::update_topology().
Referenced by MeshObject< MeshT, objectDataType >::update().