Changeset 530 for trunk


Ignore:
Timestamp:
10/21/10 16:34:45 (19 months ago)
Author:
ddangelo
Message:

Wrapping of the LineWidth? StateAttribute? added. This can be used to specify the width a of a line strip.

Location:
trunk/avango-osg
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/avango-osg/include/avango/osg/SConscript

    r453 r530  
    5858    LayerGroup.h 
    5959    LineSegmentIntersector.h 
     60    LineWidth.h 
    6061    LoadFile.h 
    6162    LoadImage.h 
  • trunk/avango-osg/include/avango/osg/StateSet.h

    r298 r530  
    4343#include <avango/osg/BlendFunc.h> 
    4444#include <avango/osg/Texture.h> 
     45#include <avango/osg/LineWidth.h> 
    4546 
    4647namespace av 
     
    8283      SFInt NormalizeMode; 
    8384      SFInt DepthTestMode; 
     85      SFLineWidth LineWidth; 
    8486 
    8587      SFTexture Texture0; 
     
    141143      virtual void setUniformsCB(const av::osg::MFUniform::SetValueEvent& event); 
    142144 
     145      virtual void getLineWidthCB(const av::osg::SFLineWidth::GetValueEvent& event); 
     146      virtual void setLineWidthCB(const av::osg::SFLineWidth::SetValueEvent& event); 
     147 
    143148    private: 
    144149 
  • trunk/avango-osg/python/SConscript

    r453 r530  
    7575    avango/osg/OSGLayerGeode.cpp 
    7676    avango/osg/OSGLayerGroup.cpp 
     77    avango/osg/OSGLineWidth.cpp 
    7778    avango/osg/OSGSwitch.cpp 
    7879    avango/osg/OSGTransform.cpp 
  • trunk/avango-osg/python/avango/osg/_osg.cpp

    r514 r530  
    6363#include "OSGLightSource.h" 
    6464#include "OSGLineSegmentIntersector.h" 
     65#include "OSGLineWidth.h" 
    6566#include "OSGLoadFile.h" 
    6667#include "OSGLoadImage.h" 
     
    176177  init_OSGLight(); 
    177178  init_OSGLightSource(); 
     179  init_OSGLineWidth(); 
    178180  init_OSGPolygonOffset(); 
    179181  init_OSGQuad(); 
  • trunk/avango-osg/src/avango/osg/Init.cpp

    r453 r530  
    4848#include <avango/osg/Light.h> 
    4949#include <avango/osg/LightSource.h> 
     50#include <avango/osg/LineWidth.h> 
    5051#include <avango/osg/Geode.h> 
    5152#include <avango/osg/Geometry.h> 
     
    115116    av::osg::Light::initClass(); 
    116117    av::osg::LightSource::initClass(); 
     118    av::osg::LineWidth::initClass(); 
    117119    av::osg::Geode::initClass(); 
    118120    av::osg::Geometry::initClass(); 
  • trunk/avango-osg/src/avango/osg/SConscript

    r453 r530  
    5151    Light.cpp 
    5252    LightSource.cpp 
     53    LineWidth.cpp 
    5354    Geode.cpp 
    5455    Geometry.cpp 
  • trunk/avango-osg/src/avango/osg/StateSet.cpp

    r298 r530  
    115115                            boost::bind(&StateSet::getUniformsCB, this, _1), 
    116116                            boost::bind(&StateSet::setUniformsCB, this, _1)); 
     117 
     118  AV_FC_ADD_ADAPTOR_FIELD(LineWidth, 
     119                            boost::bind(&StateSet::getLineWidthCB, this, _1), 
     120                            boost::bind(&StateSet::setLineWidthCB, this, _1)); 
     121 
    117122} 
    118123 
     
    439444} 
    440445 
     446/* virtual */ void 
     447av::osg::StateSet::getLineWidthCB(const av::osg::SFLineWidth::GetValueEvent& event) 
     448{ 
     449  *(event.getValuePtr()) = av::osg::get_from_osg_object<av::osg::LineWidth>(mOsgStateSet->getAttribute(::osg::LineWidth::LINEWIDTH)); 
     450} 
     451 
     452/* virtual */ void 
     453av::osg::StateSet::setLineWidthCB(const av::osg::SFLineWidth::SetValueEvent& event) 
     454{ 
     455  ::osg::LineWidth *osg_linewidth = 
     456    (event.getValue().isValid() ? event.getValue()->getOsgLineWidth() : 0); 
     457  if (osg_linewidth != 0) 
     458    mOsgStateSet->setAttribute(osg_linewidth,::osg::StateAttribute::ON); 
     459  else 
     460    mOsgStateSet->removeAttribute(::osg::StateAttribute::LINEWIDTH); 
     461} 
     462 
Note: See TracChangeset for help on using the changeset viewer.