Line data Source code
1 :
2 : /* Copyright (c) 2006-2016, Stefan Eilemann <eile@equalizergraphics.com>
3 : * Daniel Nachbaur <danielnachbaur@gmail.com>
4 : *
5 : * This library is free software; you can redistribute it and/or modify it under
6 : * the terms of the GNU Lesser General Public License version 2.1 as published
7 : * by the Free Software Foundation.
8 : *
9 : * This library is distributed in the hope that it will be useful, but WITHOUT
10 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 : * details.
13 : *
14 : * You should have received a copy of the GNU Lesser General Public License
15 : * along with this library; if not, write to the Free Software Foundation, Inc.,
16 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 : */
18 :
19 : #ifndef EQSERVER_FRAMEDATA_H
20 : #define EQSERVER_FRAMEDATA_H
21 :
22 : #include <eq/fabric/frame.h> // for Frame::Type
23 : #include <eq/fabric/frameData.h> // member
24 : #include <eq/server/types.h>
25 :
26 : namespace eq
27 : {
28 : namespace server
29 : {
30 : /** A holder for a Frame Data and parameters. */
31 : class FrameData : public fabric::FrameData, public co::Object
32 : {
33 : public:
34 : /** Construct a new FrameData. */
35 : FrameData();
36 8 : virtual ~FrameData() {}
37 : /** @name Data Access */
38 : //@{
39 : /** Set the number of the frame when this data was last used. */
40 4 : void setFrameNumber(const uint32_t number) { _frameNumber = number; }
41 2 : uint32_t getFrameNumber() const { return _frameNumber; }
42 : /** Set the position of the data relative to the window. */
43 4 : void setOffset(const Vector2i& offset) { _offset = offset; }
44 : /** @return the position of the data relative to the window. */
45 4 : const Vector2i& getOffset() const { return _offset; }
46 : /** Set the output frame zoom factor. */
47 4 : void setZoom(const Zoom& zoom_) { _zoom = zoom_; }
48 4 : const Zoom& getZoom() const { return _zoom; }
49 : //@}
50 :
51 : protected:
52 6 : virtual ChangeType getChangeType() const { return INSTANCE; }
53 : virtual void getInstanceData(co::DataOStream& os);
54 : virtual void applyInstanceData(co::DataIStream& is);
55 :
56 : private:
57 : /** The zoom factor of the output frame after readback. */
58 : Zoom _zoom;
59 :
60 : /** Position wrt destination view. */
61 : Vector2i _offset;
62 :
63 : /** The number of the config frame when this data was last used. */
64 : uint32_t _frameNumber;
65 : };
66 : }
67 : }
68 : #endif // EQSERVER_FRAMEDATA_H
|