Class implements an osg::Drawable that paints fiber representations either using lines or tubes.
More...
#include <WFiberDrawable.h>
Class implements an osg::Drawable that paints fiber representations either using lines or tubes.
Definition at line 41 of file WFiberDrawable.h.
◆ WFiberDrawable() [1/2]
WFiberDrawable::WFiberDrawable |
( |
| ) |
|
The constructor here does nothing.
One thing that may be necessary is disabling display lists. This can be done by calling setSupportsDisplayList (false); Display lists should be disabled for 'Drawable's that can change over time (that is, the vertices drawn change from time to time).
Definition at line 36 of file WFiberDrawable.cpp.
Referenced by clone(), and cloneType().
◆ WFiberDrawable() [2/2]
WFiberDrawable::WFiberDrawable |
( |
const WFiberDrawable & |
pg, |
|
|
const osg::CopyOp & |
copyop = osg::CopyOp::SHALLOW_COPY |
|
) |
| |
I can't say much about the methods below, but OSG seems to expect that we implement them.
- Parameters
-
Definition at line 46 of file WFiberDrawable.cpp.
◆ clone()
osg::Object * WFiberDrawable::clone |
( |
const osg::CopyOp & |
copyop | ) |
const |
|
virtual |
◆ cloneType()
osg::Object * WFiberDrawable::cloneType |
( |
| ) |
const |
|
virtual |
◆ drawFibers()
void WFiberDrawable::drawFibers |
( |
osg::RenderInfo & |
renderInfo | ) |
const |
|
private |
◆ drawImplementation()
void WFiberDrawable::drawImplementation |
( |
osg::RenderInfo & |
renderInfo | ) |
const |
|
virtual |
Real work is done here.
THERE IS A VERY IMPORTANT THING TO NOTE HERE: the drawImplementation method receives an state as parameter. This can be used to change the OpenGL state, but changing the OpenGL state here is something to be avoided as much as possible. Do this only if it is absolutely necessary to make your rendering algorithm work. The "right" (most efficient and flexible) way to change the OpenGL state in OSG is by attaching 'StateSet's to 'Node's and 'Drawable's. That said, the example below shows how to change the OpenGL state in these rare cases in which it is necessary. But always keep in mind: Change the OpenGL state only if strictly necessary.
- Parameters
-
renderInfo | the render info object. See osg doc for details |
Definition at line 72 of file WFiberDrawable.cpp.
◆ drawTubes()
void WFiberDrawable::drawTubes |
( |
| ) |
const |
|
private |
◆ setBitfield()
void WFiberDrawable::setBitfield |
( |
std::shared_ptr< std::vector< bool > > |
bitField | ) |
|
|
inline |
◆ setColor()
void WFiberDrawable::setColor |
( |
std::shared_ptr< std::vector< float > > |
color | ) |
|
|
inline |
◆ setPointsPerLine()
void WFiberDrawable::setPointsPerLine |
( |
std::shared_ptr< std::vector< size_t > > |
ppl | ) |
|
|
inline |
◆ setStartIndexes()
void WFiberDrawable::setStartIndexes |
( |
std::shared_ptr< std::vector< size_t > > |
idx | ) |
|
|
inline |
◆ setTangents()
void WFiberDrawable::setTangents |
( |
std::shared_ptr< std::vector< float > > |
tangents | ) |
|
|
inline |
◆ setUseTubes()
void WFiberDrawable::setUseTubes |
( |
bool |
flag | ) |
|
|
inline |
◆ setVerts()
void WFiberDrawable::setVerts |
( |
std::shared_ptr< std::vector< float > > |
verts | ) |
|
|
inline |
◆ m_active
std::shared_ptr< std::vector< bool > > WFiberDrawable::m_active |
|
private |
◆ m_colors
std::shared_ptr< std::vector< float > > WFiberDrawable::m_colors |
|
private |
◆ m_pointsPerLine
std::shared_ptr< std::vector< size_t > > WFiberDrawable::m_pointsPerLine |
|
private |
◆ m_recalcLock
std::shared_mutex WFiberDrawable::m_recalcLock |
|
private |
◆ m_startIndexes
std::shared_ptr< std::vector< size_t > > WFiberDrawable::m_startIndexes |
|
private |
◆ m_tangents
std::shared_ptr< std::vector< float > > WFiberDrawable::m_tangents |
|
private |
◆ m_useTubes
bool WFiberDrawable::m_useTubes |
|
private |
◆ m_verts
std::shared_ptr< std::vector< float > > WFiberDrawable::m_verts |
|
private |
The documentation for this class was generated from the following files: