Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | Friends
omni::WarpPoint Class Reference

A Warp defines a bezier point with one position and two handles / * Also stores flag if it is selected. More...

#include <WarpPoint.h>

Public Member Functions

 WarpPoint ()
 Default constructor. More...
 
 WarpPoint (QPointF const &_pos, QPointF const &_c1=QPointF(0.0, 0.0), QPointF const &_c2=QPointF(0.0, 0.0))
 Constructor from point. More...
 
void setPos (QPointF const &_pos)
 Set new position. More...
 
QPointF & pos ()
 Returns reference to position. More...
 
QPointF const & pos () const
 Returns const reference to position. More...
 
float x () const
 Return x coordinate of position. More...
 
float y () const
 Return y coordinate of position. More...
 
void setC1 (QPointF const &_c1)
 Set first bezier handle. More...
 
QPointF & c1 ()
 Returns reference to first bezier handle. More...
 
QPointF const & c1 () const
 Returns const reference to first bezier handle. More...
 
void setC2 (QPointF const &_c2)
 Set second bezier handle. More...
 
QPointF & c2 ()
 Returns reference to second bezier handle. More...
 
QPointF const & c2 () const
 Returns const reference to second bezier handle. More...
 
void setSelected (bool)
 Set selection flag. More...
 
bool selected () const
 Return selection flag. More...
 
void toStream (QDataStream &) const
 Write tuning to stream. More...
 
void fromStream (QDataStream &)
 Read tuning from stream. More...
 

Private Attributes

QPointF pos_
 
QPointF c1_
 
QPointF c2_
 
bool selected_ = false
 

Friends

bool operator== (WarpPoint const &, WarpPoint const &)
 Test for equality. More...
 

Detailed Description

A Warp defines a bezier point with one position and two handles / * Also stores flag if it is selected.

Constructor & Destructor Documentation

omni::WarpPoint::WarpPoint ( )

Default constructor.

27  {}
omni::WarpPoint::WarpPoint ( QPointF const &  _pos,
QPointF const &  _c1 = QPointF(0.0, 0.0),
QPointF const &  _c2 = QPointF(0.0, 0.0) 
)

Constructor from point.

32  :
33  pos_(_pos),
34  c1_(_c1),
35  c2_(_c2),
36  selected_(false)
37  {}
QPointF c2_
Definition: WarpPoint.h:91
bool selected_
Definition: WarpPoint.h:92
QPointF pos_
Definition: WarpPoint.h:91
QPointF c1_
Definition: WarpPoint.h:91

Member Function Documentation

QPointF & omni::WarpPoint::c1 ( )

Returns reference to first bezier handle.

70  {
71  return c1_;
72  }
QPointF c1_
Definition: WarpPoint.h:91
QPointF const & omni::WarpPoint::c1 ( ) const

Returns const reference to first bezier handle.

75  {
76  return c1_;
77  }
QPointF c1_
Definition: WarpPoint.h:91
QPointF & omni::WarpPoint::c2 ( )

Returns reference to second bezier handle.

85  {
86  return c2_;
87  }
QPointF c2_
Definition: WarpPoint.h:91
QPointF const & omni::WarpPoint::c2 ( ) const

Returns const reference to second bezier handle.

90  {
91  return c2_;
92  }
QPointF c2_
Definition: WarpPoint.h:91
void omni::WarpPoint::fromStream ( QDataStream &  _is)

Read tuning from stream.

116  {
117  PropertyMap _map;
118 
119  _is >> _map;
120  _map.get("pos", pos_)
121  .get("c1", c1_)
122  .get("c2", c2_)
123  .get("selected", selected_);
124  }
QPointF c2_
Definition: WarpPoint.h:91
bool selected_
Definition: WarpPoint.h:92
QPointF pos_
Definition: WarpPoint.h:91
QPointF c1_
Definition: WarpPoint.h:91
QPointF & omni::WarpPoint::pos ( )

Returns reference to position.

45  {
46  return pos_;
47  }
QPointF pos_
Definition: WarpPoint.h:91
QPointF const & omni::WarpPoint::pos ( ) const

Returns const reference to position.

50  {
51  return pos_;
52  }
QPointF pos_
Definition: WarpPoint.h:91
bool omni::WarpPoint::selected ( ) const

Return selection flag.

100  {
101  return selected_;
102  }
bool selected_
Definition: WarpPoint.h:92
void omni::WarpPoint::setC1 ( QPointF const &  _c1)

Set first bezier handle.

65  {
66  c1_ = _c1;
67  }
QPointF c1_
Definition: WarpPoint.h:91
void omni::WarpPoint::setC2 ( QPointF const &  _c2)

Set second bezier handle.

80  {
81  c2_ = _c2;
82  }
QPointF c2_
Definition: WarpPoint.h:91
void omni::WarpPoint::setPos ( QPointF const &  _pos)

Set new position.

40  {
41  pos_ = _pos;
42  }
QPointF pos_
Definition: WarpPoint.h:91
void omni::WarpPoint::setSelected ( bool  _selected)

Set selection flag.

95  {
96  selected_ = _selected;
97  }
bool selected_
Definition: WarpPoint.h:92
void omni::WarpPoint::toStream ( QDataStream &  _os) const

Write tuning to stream.

105  {
106  PropertyMap _map;
107 
108  _map.put("pos", pos_)
109  ("c1", c1_)
110  ("c2", c2_)
111  ("selected", selected_);
112  _os << _map;
113  }
QPointF c2_
Definition: WarpPoint.h:91
bool selected_
Definition: WarpPoint.h:92
QPointF pos_
Definition: WarpPoint.h:91
QPointF c1_
Definition: WarpPoint.h:91
float omni::WarpPoint::x ( ) const

Return x coordinate of position.

55  {
56  return pos_.x();
57  }
QPointF pos_
Definition: WarpPoint.h:91
float omni::WarpPoint::y ( ) const

Return y coordinate of position.

60  {
61  return pos_.y();
62  }
QPointF pos_
Definition: WarpPoint.h:91

Friends And Related Function Documentation

bool operator== ( WarpPoint const &  _lhs,
WarpPoint const &  _rhs 
)
friend

Test for equality.

127  {
128  return
133  }
QPointF c2_
Definition: WarpPoint.h:91
bool selected_
Definition: WarpPoint.h:92
#define OMNI_TEST_MEMBER_EQUAL(member)
Definition: util.h:125
QPointF pos_
Definition: WarpPoint.h:91
QPointF c1_
Definition: WarpPoint.h:91

Field Documentation

QPointF omni::WarpPoint::c1_
private
QPointF omni::WarpPoint::c2_
private
QPointF omni::WarpPoint::pos_
private
bool omni::WarpPoint::selected_ = false
private

The documentation for this class was generated from the following files: