1 #pragma once 2 3 #ifndef TPARAM_UI_CONCEPT_H 4 #define TPARAM_UI_CONCEPT_H 5 6 #include "tparam.h" 7 8 #include <vector> 9 #include <string> 10 11 //*********************************************************************************************** 12 // TParamUIConcept definition 13 //*********************************************************************************************** 14 15 //! Defines the User Interface Types available for a group of TParam objects. 16 /*! 17 A User Interface Concept is used to associate parameters to the way they 18 should be 19 interactively represented. For example, a TDoubleParamP may be used to 20 represent 21 multiple objects, such as lengths or angles; a couple of TPointParamP may 22 represent 23 vectors, and so on. Observe that each entry in the list is associated to a 24 specific 25 struct of parameter objects. 26 \n\n 27 The list in the Type enum provides all the interface types currently supported 28 by Toonz. 29 */ 30 class TParamUIConcept { 31 public: 32 // Associated with each specific types are the structure the m_params member 33 // will need to hold. 34 // The mandatory parameters are in square brackets. 35 36 enum Type { 37 NONE = 0, 38 39 RADIUS, // Distance from a point (radius). Represented by { 40 // [TDoubleParamP], TPointParamP } 41 WIDTH, // Width, as distance from a line with given angle. { 42 // [TDoubleParamP], TDoubleParamP } 43 ANGLE, // An angle. { 44 // [TDoubleParamP] } 45 ANGLE_2, // An angle range defined with start and end angles. 46 // { [2 TDoubleParamP], TDoubleParamP } 47 48 POINT, // A Point. { 49 // [TPointParamP] } 50 POINT_2, // A Point given its X and Y coordinates. { [2 51 // TDoubleParamP] } 52 VECTOR, // A Vector. { 53 // [TPointParamP], TPointParamP } 54 POLAR, // A Vector in polar coordinates, from the origin. { [2 55 // TDoubleParamP] } 56 57 SIZE, // Size, shown with a rect with P00 on the origin. { 58 // [TDoubleParamP], TDoubleParamP } 59 QUAD, // A Quadrilateral. { [4 60 // TPointParamP] } 61 RECT, // A Rect, with width, height and center. { [2 62 // TDoubleParamP], TPointParamP } 63 64 DIAMOND, // A diagonally laid square. { 65 // [TDoubleParamP] } 66 LINEAR_RANGE, // A band-like range between two points. 67 // { [2 TPointParamP] } 68 69 TYPESCOUNT 70 }; 71 72 public: 73 Type m_type; //!< Concept identifier 74 std::string m_label; //!< Name to show on editing 75 std::vector<TParamP> m_params; //!< Associated parameters 76 }; 77 78 #endif // TPARAM_UI_CONCEPT_H 79