|
Revision 13041, 1.5 kB
(checked in by robert, 15 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | #include <osg/LineStipple> |
|---|
| 2 | |
|---|
| 3 | #include <osgDB/Registry> |
|---|
| 4 | #include <osgDB/Input> |
|---|
| 5 | #include <osgDB/Output> |
|---|
| 6 | |
|---|
| 7 | using namespace osg; |
|---|
| 8 | using namespace osgDB; |
|---|
| 9 | using namespace std; |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | bool LineStipple_readLocalData(Object& obj, Input& fr); |
|---|
| 13 | bool LineStipple_writeLocalData(const Object& obj, Output& fw); |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | REGISTER_DOTOSGWRAPPER(LineStipple) |
|---|
| 18 | ( |
|---|
| 19 | new osg::LineStipple, |
|---|
| 20 | "LineStipple", |
|---|
| 21 | "Object StateAttribute LineStipple", |
|---|
| 22 | &LineStipple_readLocalData, |
|---|
| 23 | &LineStipple_writeLocalData |
|---|
| 24 | ); |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | bool LineStipple_readLocalData(Object& obj, Input& fr) |
|---|
| 28 | { |
|---|
| 29 | bool iteratorAdvanced = false; |
|---|
| 30 | |
|---|
| 31 | LineStipple& linestipple = static_cast<LineStipple&>(obj); |
|---|
| 32 | |
|---|
| 33 | int ref = linestipple.getFactor(); |
|---|
| 34 | if (fr[0].matchWord("factor") && fr[1].getInt(ref)) |
|---|
| 35 | { |
|---|
| 36 | linestipple.setFactor(ref); |
|---|
| 37 | fr+=2; |
|---|
| 38 | iteratorAdvanced = true; |
|---|
| 39 | } |
|---|
| 40 | |
|---|
| 41 | unsigned int mask = linestipple.getPattern(); |
|---|
| 42 | if (fr[0].matchWord("pattern") && fr[1].getUInt(mask)) |
|---|
| 43 | { |
|---|
| 44 | linestipple.setPattern(mask); |
|---|
| 45 | fr+=2; |
|---|
| 46 | iteratorAdvanced = true; |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | return iteratorAdvanced; |
|---|
| 50 | } |
|---|
| 51 | |
|---|
| 52 | bool LineStipple_writeLocalData(const Object& obj,Output& fw) |
|---|
| 53 | { |
|---|
| 54 | const LineStipple& linestipple = static_cast<const LineStipple&>(obj); |
|---|
| 55 | |
|---|
| 56 | fw.indent() << "factor " << linestipple.getFactor() << std::endl; |
|---|
| 57 | fw.indent() << "pattern 0x" << hex << linestipple.getPattern() << dec << std::endl; |
|---|
| 58 | |
|---|
| 59 | return true; |
|---|
| 60 | } |
|---|