Basic Image AlgorithmS Library
2.8.0
|
Utility class for using OpenSceneGraph. More...
#include <GLviewer/OpenSceneGraphHelper.hh>
Public Member Functions | |
OpenSceneGraphHelper () | |
~OpenSceneGraphHelper () | |
Static Public Member Functions | |
static bool | AddOrSetInfo (osg::ref_ptr< osg::Node > node, const std::string &key, const std::string &value) |
Adds or sets information to the node. More... | |
static bool | AdjustImageSizeToGPULimit (BIAS::Image< unsigned char > &tex) |
checks max texture size and adjusts More... | |
static bool | BIAS2OSGMatrix (const BIAS::Matrix4x4< double > &BiasMat, osg::Matrixd &OsgMat) |
static bool | BIASimageToOSGimage (const BIAS::Image< unsigned char > &in, osg::Image *out, bool copydata) |
conversion function More... | |
static osg::Node * | CreateBranchIndexedFaceSets (const BIAS::TriangleMesh &mesh, const std::string &name) |
this is the new method which takes a triangle mesh and creates | |
static void | DumpInfo (const osg::ref_ptr< osg::Node > node) |
Prints the content of the info associated with node to cout. More... | |
static std::vector < osg::ref_ptr< osg::Node > > | FindNodesWithInfo (const osg::ref_ptr< osg::Node > node, const std::string &key) |
Returns a vector of all nodes containing an info characterised by key. More... | |
static osg::ref_ptr< osg::Node > | FindNodeWithInfo (const osg::ref_ptr< osg::Node > node, const std::string &key, const std::string &value) |
Finds a node downwards of node who has a matching key value pair. More... | |
static void | GetInfo (const osg::ref_ptr< osg::Node > node, std::map< std::string, std::string > &key_val) |
returns the associated info as key_value pairs More... | |
static bool | HasInfo (const osg::ref_ptr< osg::Node > node, const std::string &key, std::string &value) |
Checks if the node contains additional information in form of a key value pair. More... | |
static bool | OSG2BIASMatrix (const osg::Matrixd &OsgMat, BIAS::Matrix4x4< double > &BiasMat) |
static bool | OSGimageToBIASimage (const osg::Image *in, BIAS::Image< unsigned char > &out) |
static bool | RemoveInfo (osg::ref_ptr< osg::Node > node, const std::string &key) |
Removes key value pair from node. More... | |
Static Protected Member Functions | |
static void | FindNodesWithInfoHelper_ (const osg::ref_ptr< osg::Node > CurrentNode, const std::string &key, std::vector< osg::ref_ptr< osg::Node > > &result) |
helper function for FindNodesWithInfo More... | |
Utility class for using OpenSceneGraph.
Definition at line 41 of file OpenSceneGraphHelper.hh.
|
inline |
Definition at line 43 of file OpenSceneGraphHelper.hh.
|
inline |
Definition at line 44 of file OpenSceneGraphHelper.hh.
|
static |
Adds or sets information to the node.
Returns false if info is overwritten. Throws an exception when node is NULL.
Definition at line 410 of file OpenSceneGraphHelper.cpp.
Referenced by BIAS::SceneOpenSceneGraph::AppendSubTreeFromFile(), BIAS::SceneOpenSceneGraph::AppendSubTreeFromImageFile(), BIAS::SceneOpenSceneGraph::AppendSubTreeSwitch(), BIAS::SceneOpenSceneGraph::SetNodeMarkerID(), BIAS::SceneOpenSceneGraph::SetNodeOccluder(), and BIAS::SceneOpenSceneGraph::SetNodeVisible().
|
static |
checks max texture size and adjusts
swap current and next indeces
Definition at line 299 of file OpenSceneGraphHelper.cpp.
References BIAS::Rescale< InputStorageType, OutputStorageType >::DownsampleBy2(), BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), and BIAS::ImageBase::GetWidth().
|
static |
Definition at line 282 of file OpenSceneGraphHelper.cpp.
References BIAS::Matrix< T >::GetData().
|
static |
conversion function
Definition at line 32 of file OpenSceneGraphHelper.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageData(), and BIAS::ImageBase::GetWidth().
Referenced by BIAS::ThreeDOutOpenSceneGraph::AddOSGImage_(), and BIAS::ThreeDOutOpenSceneGraph::AddOSGIndexedFaceSets_().
|
static |
this is the new method which takes a triangle mesh and creates
an osg branch avoiding the copying into ThreeDOut.
Definition at line 157 of file OpenSceneGraphHelper.cpp.
References BIAS::TriangleMesh::GetTexCoordsRef(), BIAS::TriangleMesh::GetTextureRef(), BIAS::TriangleMesh::GetTriangleIndicesRef(), and BIAS::TriangleMesh::GetVerticesRef().
|
static |
Prints the content of the info associated with node to cout.
Definition at line 508 of file OpenSceneGraphHelper.cpp.
|
static |
Returns a vector of all nodes containing an info characterised by key.
The search is conducted starting by node and proceeding downwards of node.
Definition at line 476 of file OpenSceneGraphHelper.cpp.
|
staticprotected |
helper function for FindNodesWithInfo
Definition at line 486 of file OpenSceneGraphHelper.cpp.
|
static |
Finds a node downwards of node who has a matching key value pair.
Returns NULL if no node with a matching key value pair is found. Throws an exception when node is NULL.
Definition at line 451 of file OpenSceneGraphHelper.cpp.
|
static |
returns the associated info as key_value pairs
Definition at line 431 of file OpenSceneGraphHelper.cpp.
|
static |
Checks if the node contains additional information in form of a key value pair.
Throws an exception when node is NULL.
Definition at line 374 of file OpenSceneGraphHelper.cpp.
Referenced by BIAS::GetNodeType(), and BIAS::SceneOpenSceneGraph::IsEditableNode().
|
static |
Definition at line 266 of file OpenSceneGraphHelper.cpp.
References BIAS::Matrix< T >::GetData().
|
static |
Definition at line 109 of file OpenSceneGraphHelper.cpp.
References BIAS::ImageBase::Flip(), BIAS::Image< StorageType >::GetImageData(), and BIAS::Image< StorageType >::Init().
|
static |
Removes key value pair from node.
Returns false if info was not contained in the node. Throws an exception when node is NULL.
Definition at line 392 of file OpenSceneGraphHelper.cpp.