|
Revision 13041, 1.9 kB
(checked in by robert, 15 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | #include "Exception.h" |
|---|
| 16 | #include "VolumeLocator.h" |
|---|
| 17 | #include "Object.h" |
|---|
| 18 | |
|---|
| 19 | using namespace ive; |
|---|
| 20 | |
|---|
| 21 | void VolumeLocator::write(DataOutputStream* out) |
|---|
| 22 | { |
|---|
| 23 | |
|---|
| 24 | out->writeInt(IVEVOLUMELOCATOR); |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | osg::Object* object = dynamic_cast<osg::Object*>(this); |
|---|
| 28 | if (object) |
|---|
| 29 | ((ive::Object*)(object))->write(out); |
|---|
| 30 | else |
|---|
| 31 | out_THROW_EXCEPTION("VolumeLocaotr::write(): Could not cast this osgVolume::Locator to an osg::Object."); |
|---|
| 32 | |
|---|
| 33 | out->writeMatrixd(getTransform()); |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | void VolumeLocator::read(DataInputStream* in) |
|---|
| 37 | { |
|---|
| 38 | |
|---|
| 39 | int id = in->peekInt(); |
|---|
| 40 | if(id != IVEVOLUMELOCATOR) |
|---|
| 41 | { |
|---|
| 42 | in_THROW_EXCEPTION("VolumeLocator::read(): Expected Locator identification."); |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | id = in->readInt(); |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | osg::Object* object = dynamic_cast<osg::Object*>(this); |
|---|
| 50 | if(object) |
|---|
| 51 | ((ive::Object*)(object))->read(in); |
|---|
| 52 | else |
|---|
| 53 | in_THROW_EXCEPTION("VolumeLocator::read(): Could not cast this osgVolume::Locator to an osg::Object."); |
|---|
| 54 | |
|---|
| 55 | setTransform(in->readMatrixd()); |
|---|
| 56 | |
|---|
| 57 | } |
|---|