Пример #1
0
                return out;
            }

            istream& Arc::operator>>(istream &in) {
                // Deserializer super class.
                StraightLine::operator>>(in);

                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<Deserializer> d = sf.getDeserializer(in);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('r', 'a', 'd', 'i', 'u', 's') >::RESULT,
                       m_radius);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('b', 'e', 'g', 'i', 'n') >::RESULT,
                       m_beginInterval);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL3('e', 'n', 'd') >::RESULT,
                       m_endInterval);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL4('r', 'o', 't', 'z') >::RESULT,
                       m_rotationZ);

                return in;
            }

        }
    }
} // hesperia::data::scenario
Пример #2
0
            istream& IntrinsicParameters::operator>>(istream &in) {
                SerializationFactory sf;

                Deserializer &d = sf.getDeserializer(in);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('p', 'r', 'i', 'n', 'c', 'i', 'p', 'l') >::RESULT,
                       m_principlePoint);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('f', 'o', 'c', 'a', 'l', 'l', 'e', 'n') >::RESULT,
                       m_focalLength);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL7('f', 'o', 'c', 'd', 'i', 's', 't') >::RESULT,
                       m_focalDistance);

                d.read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('a', 'l', 'p', 'h', 'a') >::RESULT,
                       m_alpha);

                return in;
            }

            const string IntrinsicParameters::toString() const {
                stringstream sstr;
                sstr << "principle point = " << m_principlePoint.toString() << ", focal length = " << m_focalLength.toString() << ", focal distance = " << m_focalDistance << ", alpha = " << m_alpha;
                return sstr.str();
            }

        }
    }
} // core::data::camera
Пример #3
0
            istream& Polygon::operator>>(istream &in) {
                // Deserializer super class.
                Shape::operator>>(in);

                SerializationFactory& sf=SerializationFactory::getInstance();

                core::SharedPointer<Deserializer> d = sf.getDeserializer(in);

                // Clean up.
                m_listOfVertices.clear();

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL6('h', 'e', 'i', 'g', 'h', 't') >::RESULT,
                       m_height);

                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL5('c', 'o', 'l', 'o', 'r') >::RESULT,
                       m_color);

                // Read number of vertices.
                uint32_t numberOfVertices = 0;
                d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('n', 'u', 'm', 'v', 'e', 'r', 't', 's') >::RESULT,
                       numberOfVertices);

                if (numberOfVertices > 0) {
                    // Read string of vertices.
                    string vertices;
                    d->read(CRC32 < OPENDAVINCI_CORE_STRINGLITERAL8('v', 'e', 'r', 't', 'i', 'c', 'e', 's') >::RESULT,
                           vertices);

                    stringstream sstr(vertices);