tahoma2d/toonz/sources/include/tparamuiconcept.h

83 lines
2.9 KiB
C
Raw Normal View History

2016-05-17 03:04:11 +12:00
#pragma once
2016-03-19 06:57:51 +13:00
#ifndef TPARAM_UI_CONCEPT_H
#define TPARAM_UI_CONCEPT_H
#include "tparam.h"
#include <vector>
#include <string>
//***********************************************************************************************
// TParamUIConcept definition
//***********************************************************************************************
//! Defines the User Interface Types available for a group of TParam objects.
/*!
2016-06-15 18:43:10 +12:00
A User Interface Concept is used to associate parameters to the way they
should be
interactively represented. For example, a TDoubleParamP may be used to
represent
multiple objects, such as lengths or angles; a couple of TPointParamP may
represent
vectors, and so on. Observe that each entry in the list is associated to a
specific
2016-03-19 06:57:51 +13:00
struct of parameter objects.
\n\n
2016-06-15 18:43:10 +12:00
The list in the Type enum provides all the interface types currently supported
by Toonz.
2016-03-19 06:57:51 +13:00
*/
2016-06-15 18:43:10 +12:00
class TParamUIConcept {
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
// Associated with each specific types are the structure the m_params member
// will need to hold.
// The mandatory parameters are in square brackets.
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
enum Type {
NONE = 0,
2016-03-19 06:57:51 +13:00
2019-11-11 23:35:16 +13:00
RADIUS, // Distance from a point (radius). Represented by {
// [TDoubleParamP], TPointParamP }
WIDTH, // Width, as distance from a line with given angle. {
// [TDoubleParamP], TDoubleParamP }
ANGLE, // An angle. {
// [TDoubleParamP] }
ANGLE_2, // An angle range defined with start and end angles.
// { [2 TDoubleParamP], TDoubleParamP }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
POINT, // A Point. {
// [TPointParamP] }
POINT_2, // A Point given its X and Y coordinates. { [2
// TDoubleParamP] }
VECTOR, // A Vector. {
// [TPointParamP], TPointParamP }
POLAR, // A Vector in polar coordinates, from the origin. { [2
// TDoubleParamP] }
2016-03-19 06:57:51 +13:00
2016-06-15 18:43:10 +12:00
SIZE, // Size, shown with a rect with P00 on the origin. {
// [TDoubleParamP], TDoubleParamP }
QUAD, // A Quadrilateral. { [4
// TPointParamP] }
RECT, // A Rect, with width, height and center. { [2
// TDoubleParamP], TPointParamP }
2016-03-19 06:57:51 +13:00
2019-11-14 15:32:32 +13:00
DIAMOND, // A diagonally laid square. {
// [TDoubleParamP] }
LINEAR_RANGE, // A band-like range between two points.
// { [2 TPointParamP] }
COMPASS, // a line widget pointing toward some point. [TPointParamP]
COMPASS_SPIN, // ... with guides in rotational direction.
2021-01-20 19:33:21 +13:00
RAINBOW_WIDTH,
2016-06-15 18:43:10 +12:00
TYPESCOUNT
};
2016-03-19 06:57:51 +13:00
public:
2016-06-15 18:43:10 +12:00
Type m_type; //!< Concept identifier
std::string m_label; //!< Name to show on editing
std::vector<TParamP> m_params; //!< Associated parameters
2016-03-19 06:57:51 +13:00
};
2016-06-15 18:43:10 +12:00
#endif // TPARAM_UI_CONCEPT_H