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

Parameter widget for getting and setting mapping parameters. More...

#include <MappingParameters.h>

Inheritance diagram for omni::ui::MappingParameters:
Inheritance graph
[legend]
Collaboration diagram for omni::ui::MappingParameters:
Collaboration graph
[legend]

Signals

void dataModelChanged ()
 
- Signals inherited from omni::ui::ParameterWidget
void parametersUpdated ()
 

Public Member Functions

 MappingParameters (QWidget *_parent=nullptr)
 
 ~MappingParameters ()
 
- Public Member Functions inherited from omni::ui::ParameterWidget
 ParameterWidget (QWidget *_parent=nullptr)
 Default constructor. More...
 
virtual ~ParameterWidget ()
 Default Constructor. More...
 
RangedFloataddWidget (QString const &, float, float, float)
 Adds a widget with a name, a value and min-max range. More...
 
RangedIntaddIntegerWidget (QString const &, int, int, int)
 Adds a integer widget with a name, a value and min-max range. More...
 
RangedFloataddAngleWidget (QString const &, float, float, float)
 Adds an angle widget with a name, a value and min-max range. More...
 
RangedFloataddOffsetWidget (QString const &, float, float, float)
 Adds an offset widget with a name, a value and min-max range. More...
 
RotationaddRotationWidget (QString const &)
 Adds an Rotation widget with three dials for X,Y and Z axis. More...
 
omni::ui::AffineTransformaddAffineTransformWidget (QString const &, omni::AffineTransform *)
 Add a new affine transform widget with an id. More...
 
QCheckBox * addCheckBox (QString const &, bool _checked=false)
 Adds a checkbox. More...
 
int focusId () const
 Return id of focused parameter, -1 if no parameter is focused. More...
 
- Public Member Functions inherited from omni::ui::mixin::Scale< omni::ui::RangedFloat >
 Scale ()
 
virtual void setScale (float _scale)
 Set scale and apply to sliders. More...
 
bool rescaleValues () const
 
void setRescaleValues (bool _rescaleValues)
 
float scale () const
 Return scale value. More...
 
QString suffix () const
 Common unit of sliders. More...
 
void setSuffix (QString const &_suffix)
 Set suffix (unit) of slider. More...
 
void registerScaledSlider (slider_type *_slider)
 Register slider to be scaled. More...
 
void unregisterScaledSlider (slider_type *_slider)
 Remove slider from list, keep scale. More...
 
- Public Member Functions inherited from omni::ui::mixin::DataModel< DATAMODEL, SHARED >
 DataModel ()
 
void setDataModel (pointer_type _dataModel)
 Set new data model. More...
 
pointer_type dataModel ()
 Return pointer to data model. More...
 
const pointer_type dataModel () const
 Return pointer to data model (const version) More...
 
virtual void updateFrontend ()
 Push data to frontend widgets and all child widgets. More...
 
virtual void updateDataModel ()
 Update the data model interface. More...
 

Protected Member Functions

virtual void dataToFrontend ()
 Pure virtual method which determines how data model is represented in frontend. More...
 
virtual bool frontendToData ()
 Return true if data has changed by front end. More...
 
void addDefaultParameters ()
 Add flip and bound to canvas parameters. More...
 
- Protected Member Functions inherited from omni::ui::ParameterWidget
virtual int firstFocusId () const
 Id of first focussed widget. More...
 
void keyPressEvent (QKeyEvent *_event)
 
- Protected Member Functions inherited from omni::ui::mixin::Locked
template<typename F >
void locked (F f)
 Lock widget and execute given functor. More...
 
bool isLocked () const
 Return true if widget is locked. More...
 

Protected Attributes

omni::ui::AffineTransformtransform_ = nullptr
 
- Protected Attributes inherited from omni::ui::ParameterWidget
std::vector< QUniquePtr
< QWidget > > 
parameters_
 Slider parameter widgets. More...
 
std::map< QString, QWidget * > parameterMap_
 Slider widgets, sorted by their label. More...
 

Additional Inherited Members

- Public Types inherited from omni::ui::mixin::Scale< omni::ui::RangedFloat >
typedef omni::ui::RangedFloat slider_type
 
typedef float scalar_type
 
- Public Types inherited from omni::ui::mixin::DataModel< DATAMODEL, SHARED >
typedef DATAMODEL data_model_type
 Data type. More...
 
typedef DataModel
< data_model_type, SHARED > 
type
 This type. More...
 
typedef detail::PointerType
< data_model_type, SHARED > 
pointer_type_handler
 Pointer type handler. More...
 
typedef pointer_type_handler::type pointer_type
 Derived pointer type. More...
 
- Public Slots inherited from omni::ui::ParameterWidget
void clear ()
 Removes all parameter widgets. More...
 
virtual void updateParameters ()
 
double getParamAsFloat (QString const &) const
 Utility method for retrieving the value from a slider with id. More...
 
void setParamAsFloat (QString const &_str, double _value)
 Set slider value from given value. More...
 
int getParamAsInt (QString const &) const
 Utility method for retrieving the value from a slider with id. More...
 
void setParamAsInt (QString const &_str, int _value)
 Set slider value from given value. More...
 
bool getParamAsBool (QString const &) const
 Utility method for retrieving the value from checkbox with id. More...
 
QWidget * getWidget (QString const &)
 Get parameter widget from parameter map with Id. More...
 
void setParametersVisible (bool)
 Show / hide parameter widgets. More...
 
bool focusNext (bool _circular=false)
 Put focus on next element. More...
 
bool focusPrev (bool _circular=false)
 Put focus on prev element. More...
 
void focus (int _index)
 Focus item in layout with index. More...
 
void focusFirst ()
 Set focus on first widget in parameter list. More...
 
void focusLast ()
 Set focus on last widget in parameter list. More...
 
virtual void setScale (float)
 Set slider ranges. More...
 
virtual void setUnit (QString const &)
 Set slider ranges. More...
 
- Static Public Member Functions inherited from omni::ui::mixin::Scale< omni::ui::RangedFloat >
static int getPrecision (float _scale)
 Return precesion by scale. More...
 

Detailed Description

Parameter widget for getting and setting mapping parameters.

Constructor & Destructor Documentation

omni::ui::MappingParameters::MappingParameters ( QWidget *  _parent = nullptr)
26  :
27  ParameterWidget(_parent)
28  {
29  QLayout *_layout = new QVBoxLayout;
30  _layout->setSpacing(2);
31  _layout->setContentsMargins(0, 0, 0, 0);
32  _layout->setSizeConstraint(QLayout::SetMaximumSize);
33  setLayout(_layout);
35  }
ParameterWidget(QWidget *_parent=nullptr)
Default constructor.
Definition: ParameterWidget.cpp:28
virtual void updateDataModel()
Update the data model interface.
Definition: DataModel.h:134
omni::ui::MappingParameters::~MappingParameters ( )
38  {
39  }

Member Function Documentation

void omni::ui::MappingParameters::addDefaultParameters ( )
protected

Add flip and bound to canvas parameters.

void omni::ui::MappingParameters::dataModelChanged ( )
signal
void omni::ui::MappingParameters::dataToFrontend ( )
protectedvirtual

Pure virtual method which determines how data model is represented in frontend.

Implements omni::ui::mixin::DataModel< DATAMODEL, SHARED >.

41  {
42  addCheckBox("Flip horizontal",dataModel()->flipHorizontal());
43  addCheckBox("Flip vertical",dataModel()->flipVertical());
44 
45  if (dataModel()->isUVW()) {
46  addCheckBox("Bound to canvas",dataModel()->isBoundToCanvas());
47  transform_ = addAffineTransformWidget("Transform", &dataModel()->transform());
48  // transform_->setTranslationVisible(false);
49  }
50  }
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
QCheckBox * addCheckBox(QString const &, bool _checked=false)
Adds a checkbox.
Definition: ParameterWidget.cpp:131
omni::ui::AffineTransform * transform_
Definition: MappingParameters.h:55
omni::ui::AffineTransform * addAffineTransformWidget(QString const &, omni::AffineTransform *)
Add a new affine transform widget with an id.
Definition: ParameterWidget.cpp:300
bool omni::ui::MappingParameters::frontendToData ( )
protectedvirtual

Return true if data has changed by front end.

Implements omni::ui::mixin::DataModel< DATAMODEL, SHARED >.

53  {
54  dataModel()->setFlipHorizontal(getParamAsBool("Flip horizontal"));
55  dataModel()->setFlipVertical(getParamAsBool("Flip vertical"));
56 
57  if (dataModel()->isUVW()) {
58  dataModel()->setBoundToCanvas(getParamAsBool("Bound to canvas"));
59 
60  if (transform_)
62  }
63  return true;
64  }
pointer_type dataModel()
Return pointer to data model.
Definition: DataModel.h:118
omni::ui::AffineTransform * transform_
Definition: MappingParameters.h:55
bool getParamAsBool(QString const &) const
Utility method for retrieving the value from checkbox with id.
Definition: ParameterWidget.cpp:184
virtual void updateDataModel()
Update the data model interface.
Definition: DataModel.h:134

Field Documentation

omni::ui::AffineTransform* omni::ui::MappingParameters::transform_ = nullptr
protected

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