1 #include "DeprecatedGeometry.h"
2 
setNormalBinding(AttributeBinding ab)3 void deprecated_osg::Geometry::setNormalBinding(AttributeBinding ab) { SET_BINDING(_normalArray.get(), ab) }
getNormalBinding() const4 deprecated_osg::Geometry::AttributeBinding deprecated_osg::Geometry::getNormalBinding() const { return static_cast<AttributeBinding>(osg::getBinding(getNormalArray())); }
5 
setColorBinding(deprecated_osg::Geometry::AttributeBinding ab)6 void deprecated_osg::Geometry::setColorBinding(deprecated_osg::Geometry::AttributeBinding ab) { SET_BINDING(_colorArray.get(), ab) }
getColorBinding() const7 deprecated_osg::Geometry::AttributeBinding deprecated_osg::Geometry::getColorBinding() const { return static_cast<AttributeBinding>(osg::getBinding(getColorArray())); }
8 
setSecondaryColorBinding(deprecated_osg::Geometry::AttributeBinding ab)9 void deprecated_osg::Geometry::setSecondaryColorBinding(deprecated_osg::Geometry::AttributeBinding ab) { SET_BINDING(_secondaryColorArray.get(), ab) }
getSecondaryColorBinding() const10 deprecated_osg::Geometry::AttributeBinding deprecated_osg::Geometry::getSecondaryColorBinding() const { return static_cast<AttributeBinding>(osg::getBinding(getSecondaryColorArray())); }
11 
setFogCoordBinding(deprecated_osg::Geometry::AttributeBinding ab)12 void deprecated_osg::Geometry::setFogCoordBinding(deprecated_osg::Geometry::AttributeBinding ab) { SET_BINDING(_fogCoordArray.get(), ab) }
getFogCoordBinding() const13 deprecated_osg::Geometry::AttributeBinding deprecated_osg::Geometry::getFogCoordBinding() const { return static_cast<AttributeBinding>(osg::getBinding(getFogCoordArray())); }
14 
15 
setVertexAttribBinding(unsigned int index,AttributeBinding ab)16 void deprecated_osg::Geometry::setVertexAttribBinding(unsigned int index,AttributeBinding ab)
17 {
18     if (index<_vertexAttribList.size() && _vertexAttribList[index].valid())
19     {
20         if (_vertexAttribList[index]->getBinding()==static_cast<osg::Array::Binding>(ab)) return;
21 
22         _vertexAttribList[index]->setBinding(static_cast<osg::Array::Binding>(ab));
23 
24         dirtyGLObjects();
25     }
26     else
27     {
28         OSG_NOTICE<<"Warning, can't assign attribute binding as no has been array assigned to set binding for."<<std::endl;
29     }
30 }
31 
getVertexAttribBinding(unsigned int index) const32 deprecated_osg::Geometry::AttributeBinding deprecated_osg::Geometry::getVertexAttribBinding(unsigned int index) const { return static_cast<AttributeBinding>(osg::getBinding(getVertexAttribArray(index))); }
33 
setVertexAttribNormalize(unsigned int index,GLboolean norm)34 void deprecated_osg::Geometry::setVertexAttribNormalize(unsigned int index,GLboolean norm)
35 {
36     if (index<_vertexAttribList.size() && _vertexAttribList[index].valid())
37     {
38         _vertexAttribList[index]->setNormalize(norm!=GL_FALSE);
39 
40         dirtyGLObjects();
41     }
42 }
43 
getVertexAttribNormalize(unsigned int index) const44 GLboolean deprecated_osg::Geometry::getVertexAttribNormalize(unsigned int index) const { return osg::getNormalize(getVertexAttribArray(index)); }
45 
setVertexIndices(osg::IndexArray * array)46 void deprecated_osg::Geometry::setVertexIndices(osg::IndexArray* array)
47 {
48     if (_vertexArray.valid()) { _vertexArray->setUserData(array); if (array)  _containsDeprecatedData = true; }
49     else { OSG_WARN<<"Geometry::setVertexIndicies(..) function failed as there is no vertex array to associate inidices with."<<std::endl; }
50 }
51 
getVertexIndices() const52 const osg::IndexArray* deprecated_osg::Geometry::getVertexIndices() const
53 {
54     if (_vertexArray.valid()) return dynamic_cast<osg::IndexArray*>(_vertexArray->getUserData());
55     else return 0;
56 }
57 
setNormalIndices(osg::IndexArray * array)58 void deprecated_osg::Geometry::setNormalIndices(osg::IndexArray* array)
59 {
60     if (_normalArray.valid()) { _normalArray->setUserData(array); if (array)  _containsDeprecatedData = true; }
61     else { OSG_WARN<<"Geometry::setNormalIndicies(..) function failed as there is no normal array to associate inidices with."<<std::endl; }
62 }
63 
getNormalIndices() const64 const osg::IndexArray* deprecated_osg::Geometry::getNormalIndices() const
65 {
66     if (_normalArray.valid()) return dynamic_cast<osg::IndexArray*>(_normalArray->getUserData());
67     else return 0;
68 }
69 
setColorIndices(osg::IndexArray * array)70 void deprecated_osg::Geometry::setColorIndices(osg::IndexArray* array)
71 {
72     if (_colorArray.valid()) { _colorArray->setUserData(array); if (array)  _containsDeprecatedData = true; }
73     else { OSG_WARN<<"Geometry::setColorIndicies(..) function failed as there is no color array to associate inidices with."<<std::endl; }
74 }
75 
getColorIndices() const76 const osg::IndexArray* deprecated_osg::Geometry::getColorIndices() const
77 {
78     if (_colorArray.valid()) return dynamic_cast<osg::IndexArray*>(_colorArray->getUserData());
79     else return 0;
80 }
81 
setSecondaryColorIndices(osg::IndexArray * array)82 void deprecated_osg::Geometry::setSecondaryColorIndices(osg::IndexArray* array)
83 {
84     if (_secondaryColorArray.valid()) { _secondaryColorArray->setUserData(array); if (array)  _containsDeprecatedData = true; }
85     else { OSG_WARN<<"Geometry::setSecondaryColorArray(..) function failed as there is no secondary color array to associate inidices with."<<std::endl; }
86 }
87 
getSecondaryColorIndices() const88 const osg::IndexArray* deprecated_osg::Geometry::getSecondaryColorIndices() const
89 {
90     if (_secondaryColorArray.valid()) return dynamic_cast<osg::IndexArray*>(_secondaryColorArray->getUserData());
91     else return 0;
92 }
93 
setFogCoordIndices(osg::IndexArray * array)94 void deprecated_osg::Geometry::setFogCoordIndices(osg::IndexArray* array)
95 {
96     if (_fogCoordArray.valid()) { _fogCoordArray->setUserData(array); if (array)  _containsDeprecatedData = true; }
97     else { OSG_WARN<<"Geometry::setFogCoordIndicies(..) function failed as there is no fog coord array to associate inidices with."<<std::endl; }
98 }
99 
getFogCoordIndices() const100 const osg::IndexArray* deprecated_osg::Geometry::getFogCoordIndices() const
101 {
102     if (_fogCoordArray.valid()) return dynamic_cast<osg::IndexArray*>(_fogCoordArray->getUserData());
103     else return 0;
104 }
105 
setTexCoordIndices(unsigned int unit,osg::IndexArray * array)106 void deprecated_osg::Geometry::setTexCoordIndices(unsigned int unit,osg::IndexArray* array)
107 {
108     if (unit<_texCoordList.size() && _texCoordList[unit].valid()) { _texCoordList[unit]->setUserData(array); if (array)  _containsDeprecatedData = true; }
109     else { OSG_WARN<<"Geometry::setTexCoordIndices(..) function failed as there is no texcoord array to associate inidices with."<<std::endl; }
110 }
111 
getTexCoordIndices(unsigned int unit) const112 const osg::IndexArray* deprecated_osg::Geometry::getTexCoordIndices(unsigned int unit) const
113 {
114     if (unit<_texCoordList.size() && _texCoordList[unit].valid()) return dynamic_cast<osg::IndexArray*>(_texCoordList[unit]->getUserData());
115     else return 0;
116 }
117 
setVertexAttribIndices(unsigned int index,osg::IndexArray * array)118 void deprecated_osg::Geometry::setVertexAttribIndices(unsigned int index,osg::IndexArray* array)
119 {
120     if (index<_vertexAttribList.size() && _vertexAttribList[index].valid()) { _vertexAttribList[index]->setUserData(array); if (array)  _containsDeprecatedData = true; }
121     else { OSG_WARN<<"Geometry::setVertexAttribIndices(..) function failed as there is no vertex attrib array to associate inidices with."<<std::endl; }
122 }
getVertexAttribIndices(unsigned int index) const123 const osg::IndexArray* deprecated_osg::Geometry::getVertexAttribIndices(unsigned int index) const
124 {
125     if (index<_vertexAttribList.size() && _vertexAttribList[index].valid()) return dynamic_cast<osg::IndexArray*>(_vertexAttribList[index]->getUserData());
126     else return 0;
127 }
128 
129 
130