synfig-core
1.0.3
|
Base class for the Values of Synfig. More...
#include <value.h>
Public Types | |
typedef std::vector< ValueBase > | List |
Public Member Functions | |
ValueBase () | |
Default constructor. | |
template<typename T > | |
ValueBase (const T &x, bool loop_=false, bool static_=false) | |
Template constructor for any type. | |
template<typename T > | |
ValueBase (const std::vector< T > &x, bool loop_=false, bool static_=false) | |
ValueBase (Type &x) | |
Copy constructor. The data is not copied, just the type. | |
~ValueBase () | |
Default destructor. | |
template<class T > | |
ValueBase & | operator= (const T &x) |
ValueBase & | operator= (const ValueBase &x) |
Operator asignation for ValueBase classes. Does a exact copy of . | |
bool | operator== (const ValueBase &rhs) const |
Eqaul than operator. Segment, Gradient and Bline Points cannot be compared. | |
bool | operator!= (const ValueBase &rhs) const |
Not equal than operator. | |
const ValueBase & | operator[] (int index) const |
Constant index operator for when value is of type TYPE_LIST. | |
void | clear () |
Deletes the data only if the ref count is zero. | |
bool | get_loop () const |
Gets the loop option. | |
void | set_loop (bool x) |
Sets the loop option. | |
bool | get_static () const |
Gets the static option. | |
void | set_static (bool x) |
Sets the static option. | |
Interpolation | get_interpolation () const |
Gets the interpolation. | |
void | set_interpolation (Interpolation x) |
Sets the interpolation. | |
void | copy (const ValueBase &x) |
Create independent copy from existing ValueBase object. | |
void | copy_properties_of (const ValueBase &x) |
Copies properties (static, interpolation, etc) from other ValueBase object. | |
bool | empty () const |
True if the Value is not valid or is type LIST and is empty. | |
Type & | get_contained_type () const |
Gets the contained type in the Value Base. | |
bool | is_valid () const |
Returns true if the contained value is defined and valid. | |
String | type_name () const |
Returns a string containing the name of the type. Used for sif files. | |
Type & | get_type () const |
Returns the type of the contained value. | |
template<typename T > | |
bool | can_get (const T &x) const |
template<typename T > | |
bool | can_set (const T &x) const |
template<typename T > | |
bool | can_put (const T &x) const |
bool | can_copy_from (const TypeId type) const |
bool | can_copy_from (const Type &type) const |
bool | can_copy_to (const TypeId type) const |
bool | can_copy_to (const Type &type) const |
template<typename T > | |
bool | same_type_as (const T &x) const |
template<typename T > | |
const T & | get (const T &x) const |
Template to get the ValueBase class data by casting the type. | |
const List & | get_list () const |
Gets the data as List Type. | |
template<typename T > | |
std::vector< T > | get_list_of (const T &x) const |
template<typename T > | |
void | set_list_of (const std::vector< T > &list) |
template<typename T > | |
void | put (T *x) const |
Put template for any class. | |
template<typename T > | |
void | set (const T &x) |
Set template for any class. |
Static Public Member Functions | |
template<typename T > | |
static bool | can_get (const TypeId type, const T &x) |
template<typename T > | |
static bool | can_get (const Type &type, const T &x) |
template<typename T > | |
static bool | can_set (const TypeId type, const T &x) |
template<typename T > | |
static bool | can_set (const Type &type, const T &x) |
template<typename T > | |
static bool | can_put (const TypeId type, const T &x) |
template<typename T > | |
static bool | can_put (const Type &type, const T &x) |
static bool | can_copy (const TypeId dest, const TypeId src) |
static bool | can_copy (const Type &dest, const Type &src) |
static Type & | ident_type (const String &str) |
template<typename T > | |
static Type & | get_type (const T &) |
static Type & | get_type (const List &) |
static Type & | get_type (Canvas *const &) |
static Type & | get_type (ValueNode_Bone *const &) |
template<typename T > | |
static Type & | get_type (const T *&) |
template<typename T > | |
static Type & | get_type (const std::vector< T > &) |
template<typename T > | |
static Type & | get_type (const std::list< T > &) |
Protected Attributes | |
Type * | type |
The type of value. | |
void * | data |
Pointer to hold the data of the value. | |
etl::reference_counter | ref_count |
bool | loop_ |
For Values with loop option like TYPE_LIST. | |
bool | static_ |
For Values of Constant Value Nodes. | |
Interpolation | interpolation_ |
Parameter interpolation. |
Base class for the Values of Synfig.
typedef std::vector<ValueBase> synfig::ValueBase::List |
ValueBase::ValueBase | ( | ) |
Default constructor.
References synfig::Type::initialize(), and type.
|
inline |
Template constructor for any type.
References synfig::Type::initialize(), and type.
|
inline |
References synfig::Type::initialize(), set_list_of(), and type.
ValueBase::ValueBase | ( | Type & | x | ) |
Copy constructor. The data is not copied, just the type.
References synfig::Type::initialize(), and type.
ValueBase::~ValueBase | ( | ) |
Default destructor.
References clear().
|
inline |
Template for the operator assignation operator for non ValueBase classes
Reimplemented in synfig::Value< T >.
Operator asignation for ValueBase classes. Does a exact copy of .
Reimplemented in synfig::Value< T >.
References clear(), data, synfig::Operation::Description::get_copy(), synfig::Type::identifier, interpolation_, loop_, ref_count, static_, and type.
bool ValueBase::operator== | ( | const ValueBase & | rhs | ) | const |
Eqaul than operator. Segment, Gradient and Bline Points cannot be compared.
References data, synfig::Operation::Description::get_compare(), synfig::Type::identifier, and type.
Referenced by operator!=().
|
inline |
Not equal than operator.
References operator==().
|
inline |
Constant index operator for when value is of type TYPE_LIST.
References get_list(), type, and synfig::type_list.
void ValueBase::clear | ( | ) |
Deletes the data only if the ref count is zero.
References data, synfig::Operation::Description::get_destroy(), synfig::Type::identifier, ref_count, and synfig::type_nil.
Referenced by operator=(), and ~ValueBase().
|
inline |
Gets the loop option.
References loop_.
Referenced by synfig::convert_bline_to_segment_list(), synfig::convert_bline_to_width_list(), synfig::convert_bline_to_wplist(), synfig::ValueNode_DIList::create(), synfig::ValueNode_BLine::create(), synfig::ValueNode_WPList::create(), reverse_value(), CurveGradient::set_param(), Plant::set_param(), Region::sync(), Outline::sync(), and Advanced_Outline::sync().
|
inline |
|
inline |
Gets the static option.
References static_.
Referenced by encode_layer(), encode_value(), and synfig::ValueNode_Const::get_static().
|
inline |
|
inline |
Gets the interpolation.
References interpolation_.
Referenced by encode_value(), and synfig::ValueNode_Const::get_interpolation().
|
inline |
Sets the interpolation.
References interpolation_.
Referenced by synfig::ValueNode_Const::set_interpolation().
void ValueBase::copy | ( | const ValueBase & | x | ) |
Create independent copy from existing ValueBase object.
References copy_properties_of(), data, synfig::Operation::Description::get_copy(), synfig::Type::identifier, ref_count, and type.
void ValueBase::copy_properties_of | ( | const ValueBase & | x | ) |
Copies properties (static, interpolation, etc) from other ValueBase object.
References interpolation_, loop_, and static_.
Referenced by copy().
bool ValueBase::empty | ( | ) | const |
True if the Value is not valid or is type LIST and is empty.
References get_list(), is_valid(), and synfig::type_list.
Referenced by synfig::convert_bline_to_width_list(), synfig::convert_bline_to_wplist(), synfig::ValueNode_DIList::create(), synfig::ValueNode_BLine::create(), synfig::ValueNode_WPList::create(), get_contained_type(), and synfig::ValueNode_Reverse::ValueNode_Reverse().
Type & ValueBase::get_contained_type | ( | ) | const |
Gets the contained type in the Value Base.
References empty(), get_list(), synfig::type_list, and synfig::type_nil.
Referenced by synfig::convert_bline_to_wplist(), synfig::ValueNode_DIList::create(), synfig::ValueNode_BLine::create(), synfig::ValueNode_WPList::create(), synfig::ValueNode_StaticList::create_from(), reverse_value(), Region::sync(), Outline::sync(), and synfig::ValueNode_Reverse::ValueNode_Reverse().
bool ValueBase::is_valid | ( | ) | const |
Returns true if the contained value is defined and valid.
References ref_count, type, and synfig::type_nil.
Referenced by can_get(), can_put(), empty(), and encode_layer().
|
inline |
Returns a string containing the name of the type. Used for sif files.
References synfig::Type::description, synfig::Type::Description::name, and type.
|
inline |
Returns the type of the contained value.
References type.
Referenced by synfig::ValueAverage::add(), synfig::ValueAverage::average(), synfig::ValueAverage::average_generic(), synfig::ValueAverage::average_weighted(), synfig::ValueVector::check_type(), synfig::ValueTransformation::check_type(), synfig::ValueAverage::check_type(), synfig::ValueNode_SegCalcVertex::create(), synfig::ValueNode_BLineCalcVertex::create(), synfig::ValueNode_SegCalcTangent::create(), synfig::ValueNode_BLineCalcWidth::create(), synfig::ValueNode_Const::create(), synfig::ValueNode_BLineCalcTangent::create(), synfig::ValueNode_GradientRotate::create(), synfig::ValueNode_Stripes::create(), synfig::ValueNode_BoneInfluence::create(), synfig::ValueNode_Repeat_Gradient::create(), synfig::ValueNode_DIList::create(), synfig::ValueNode_BLine::create(), synfig::ValueNode_WPList::create(), synfig::LinkableValueNode::create(), encode_animated(), encode_layer(), encode_value(), synfig::ValueVector::get_vector(), synfig::ValueAverage::multiply(), reverse_value(), synfig::ValueAverage::set_average_value(), synfig::ValueAverage::set_average_value_weighted(), synfig::ValueNode_Composite::set_link_vfunc(), CheckerBoard::set_param(), synfig::Layer_Skeleton::set_param(), Region::set_param(), synfig::Layer_Bitmap::set_param(), synfig::Layer_SphereDistort::set_param(), CurveGradient::set_param(), Outline::set_param(), Halftone3::set_param(), synfig::Layer_Polygon::set_param(), synfig::Layer_Shape::set_param(), synfig::ValueNode_Const::set_value(), synfig::ValueTransformation::transform(), synfig::ValueNode_Add::ValueNode_Add(), synfig::ValueNode_Bone::ValueNode_Bone(), synfig::ValueNode_Integer::ValueNode_Integer(), synfig::ValueNode_Real::ValueNode_Real(), synfig::ValueNode_Reverse::ValueNode_Reverse(), and synfig::ValueNode_Subtract::ValueNode_Subtract().
|
inlinestatic |
References synfig::types_namespace::get_type_alias().
Referenced by synfig::Layer_SkeletonDeformation::prepare_mesh(), same_type_as(), and synfig::Layer_PasteCanvas::set_param().
|
inlinestatic |
References can_get(), and synfig::Type::identifier.
Referenced by can_get().
|
inlinestatic |
References synfig::types_namespace::get_type_alias().
Referenced by same_type_as().
|
inlinestatic |
References can_set(), and synfig::Type::identifier.
Referenced by can_set().
|
inlinestatic |
References synfig::types_namespace::get_type_alias().
Referenced by same_type_as().
|
inlinestatic |
References can_put(), and synfig::Type::identifier.
Referenced by can_put().
References synfig::Operation::Description::get_copy().
Referenced by can_copy_from(), and can_copy_to().
References can_copy(), and synfig::Type::identifier.
Referenced by can_copy().
|
inline |
References can_get(), is_valid(), and type.
Referenced by can_get().
|
inline |
|
inline |
References can_put(), is_valid(), and type.
Referenced by can_put().
|
inline |
References can_copy().
|
inline |
References can_copy().
|
inline |
References can_copy().
|
inline |
References can_copy().
|
inline |
References can_get(), can_put(), and can_set().
Referenced by svg_layer::set_param(), synfig::BooleanCurve::set_param(), Layer_TimeLoop::set_param(), and synfig::Layer_PasteCanvas::set_param().
|
inline |
Template to get the ValueBase class data by casting the type.
References synfig::types_namespace::get_type_alias().
Referenced by Blur_Layer::accelerated_cairorender(), synfig::Layer_SolidColor::accelerated_cairorender(), SuperSample::accelerated_cairorender(), Zoom::accelerated_cairorender(), Translate::accelerated_cairorender(), synfig::Layer_Stretch::accelerated_cairorender(), Layer_Shade::accelerated_cairorender(), synfig::Layer_MotionBlur::accelerated_cairorender(), RadialBlur::accelerated_cairorender(), Rotate::accelerated_cairorender(), SimpleCircle::accelerated_cairorender(), CheckerBoard::accelerated_cairorender(), Rectangle::accelerated_cairorender(), synfig::Layer_SphereDistort::accelerated_cairorender(), Layer_Bevel::accelerated_cairorender(), ConicalGradient::accelerated_cairorender(), FilledRect::accelerated_cairorender(), RadialGradient::accelerated_cairorender(), CurveWarp::accelerated_cairorender(), synfig::Layer_Bitmap::accelerated_cairorender(), Halftone2::accelerated_cairorender(), LinearGradient::accelerated_cairorender(), Halftone3::accelerated_cairorender(), Warp::accelerated_cairorender(), synfig::Layer_Composite::accelerated_cairorender(), synfig::Layer_Shape::accelerated_cairorender(), Circle::accelerated_cairorender(), synfig::Layer_PasteCanvas::accelerated_cairorender(), Blur_Layer::accelerated_render(), SuperSample::accelerated_render(), synfig::Layer_SolidColor::accelerated_render(), Zoom::accelerated_render(), Translate::accelerated_render(), synfig::Layer_Stretch::accelerated_render(), Layer_Shade::accelerated_render(), synfig::Layer_MotionBlur::accelerated_render(), RadialBlur::accelerated_render(), Rotate::accelerated_render(), CheckerBoard::accelerated_render(), Rectangle::accelerated_render(), synfig::Layer_SphereDistort::accelerated_render(), Layer_Bevel::accelerated_render(), Metaballs::accelerated_render(), FilledRect::accelerated_render(), CurveWarp::accelerated_render(), synfig::Layer_Bitmap::accelerated_render(), Halftone2::accelerated_render(), Halftone3::accelerated_render(), Warp::accelerated_render(), synfig::Layer_Composite::accelerated_render(), synfig::Layer_Shape::accelerated_render(), Circle::accelerated_render(), synfig::Layer_PasteCanvas::accelerated_render(), synfig::ValueAverage::add(), Plant::calc_bounding_rect(), Circle::compile_gradient(), synfig::ValueNode_GradientRotate::create(), synfig::ValueNode_Repeat_Gradient::create(), synfig::ValueNode_StaticList::create_list_entry(), synfig::ValueNode_DynamicList::create_list_entry(), encode_animated(), encode_layer(), encode_value(), synfig::Layer_Shape::feather_cairo_surface(), synfig::Layer_Sound::fill_sound_processor(), synfig::Layer_Composite::get_amount(), synfig::Layer_Composite::get_blend_method(), Rectangle::get_bounding_rect(), synfig::Layer_Bitmap::get_bounding_rect(), synfig::Layer_SphereDistort::get_bounding_rect(), NoiseDistort::get_bounding_rect(), synfig::Layer_Shape::get_bounding_rect(), Circle::get_bounding_rect(), InsideOut::get_cairocolor(), Metaballs::get_cairocolor(), Blur_Layer::get_color(), synfig::Layer_SolidColor::get_color(), Zoom::get_color(), InsideOut::get_color(), Translate::get_color(), synfig::Layer_Stretch::get_color(), Layer_Shade::get_color(), XORPattern::get_color(), CheckerBoard::get_color(), Rotate::get_color(), SimpleCircle::get_color(), Rectangle::get_color(), synfig::Layer_SphereDistort::get_color(), Metaballs::get_color(), Layer_Bevel::get_color(), Warp::get_color(), Mandelbrot::get_color(), Julia::get_color(), Circle::get_color(), synfig::Layer_Shape::get_color(), Blur_Layer::get_full_bounding_rect(), Zoom::get_full_bounding_rect(), Translate::get_full_bounding_rect(), Layer_Shade::get_full_bounding_rect(), synfig::Layer_Stretch::get_full_bounding_rect(), Rectangle::get_full_bounding_rect(), Layer_Bevel::get_full_bounding_rect(), Warp::get_full_bounding_rect(), Circle::get_full_bounding_rect(), synfig::ValueNode_Real::get_inverse(), synfig::Layer::get_local_name(), synfig::Layer::get_name(), synfig::Layer_PasteCanvas::get_origin(), Import::get_param(), Mandelbrot::get_param(), Julia::get_param(), synfig::Layer_PasteCanvas::get_time_dilation(), synfig::Layer_PasteCanvas::get_time_offset(), synfig::Layer_PasteCanvas::get_times_vfunc(), synfig::Layer_PasteCanvas::get_transformation(), synfig::ValueVector::get_vector(), synfig::Layer_Mime::get_version(), synfig::Layer::get_version(), synfig::Layer::get_z_depth(), Halftone3::Halftone3(), Zoom::hit_check(), InsideOut::hit_check(), synfig::Layer_SolidColor::hit_check(), synfig::Layer_Stretch::hit_check(), Translate::hit_check(), Rotate::hit_check(), SimpleCircle::hit_check(), Rectangle::hit_check(), synfig::Layer_SphereDistort::hit_check(), synfig::Layer_Bitmap::hit_check(), Warp::hit_check(), synfig::Layer_Shape::hit_check(), Circle::hit_check(), synfig::Layer_PasteCanvas::hit_check(), Star::import_parameters(), synfig::Layer_Composite::is_disabled(), Rectangle::is_solid_color(), synfig::Layer_Composite::is_solid_color(), Julia::Julia(), Mandelbrot::Mandelbrot(), synfig::ValueAverage::multiply(), synfig::optimize_layers(), synfig::Layer_SkeletonDeformation::prepare_mesh(), reverse_value(), Blur_Layer::set_param(), synfig::Layer_SolidColor::set_param(), svg_layer::set_param(), SuperSample::set_param(), Layer_Shade::set_param(), CheckerBoard::set_param(), Rectangle::set_param(), Rotate::set_param(), Import::set_param(), synfig::Layer_ColorCorrect::set_param(), synfig::Layer_Bitmap::set_param(), Layer_Bevel::set_param(), FilledRect::set_param(), synfig::Layer_Composite::set_param(), Advanced_Outline::set_param(), Mandelbrot::set_param(), Julia::set_param(), synfig::Layer_Shape::set_param(), Plant::set_param(), synfig::Layer_PasteCanvas::set_param(), Import::set_time(), synfig::Layer_PasteCanvas::set_time(), synfig::ValueNode_Const::set_value(), Star::sync(), Warp::sync(), Advanced_Outline::sync(), CurveWarp::transform(), synfig::ValueTransformation::transform(), synfig::ValueNode_Add::ValueNode_Add(), synfig::ValueNode_And::ValueNode_And(), synfig::ValueNode_Bone::ValueNode_Bone(), synfig::ValueNode_Compare::ValueNode_Compare(), synfig::ValueNode_Duplicate::ValueNode_Duplicate(), synfig::ValueNode_Integer::ValueNode_Integer(), synfig::ValueNode_Logarithm::ValueNode_Logarithm(), synfig::ValueNode_Not::ValueNode_Not(), synfig::ValueNode_Or::ValueNode_Or(), synfig::ValueNode_Pow::ValueNode_Pow(), synfig::ValueNode_Real::ValueNode_Real(), synfig::ValueNode_Reciprocal::ValueNode_Reciprocal(), and synfig::ValueNode_Subtract::ValueNode_Subtract().
|
inline |
Gets the data as List Type.
Referenced by synfig::ValueAverage::average(), synfig::ValueAverage::average_weighted(), synfig::ValueNode_StaticList::create_from(), synfig::ValueNode_DynamicList::create_from(), empty(), encode_value(), get_contained_type(), get_list_of(), operator[](), synfig::Layer_SkeletonDeformation::prepare_mesh(), reverse_value(), synfig::ValueAverage::set_average_value(), synfig::ValueAverage::set_average_value_weighted(), synfig::BooleanCurve::set_param(), synfig::Layer_Skeleton::sync(), Outline::sync(), and Advanced_Outline::sync().
|
inline |
References get_list().
Referenced by synfig::bline_length(), Plant::calc_bounding_rect(), synfig::convert_bline_to_segment_list(), synfig::convert_bline_to_width_list(), synfig::convert_bline_to_wplist(), synfig::ValueNode_DIList::create(), synfig::ValueNode_BLine::create(), synfig::ValueNode_WPList::create(), synfig::find_closest_point(), synfig::hom_to_std(), synfig::Layer_Polygon::set_param(), synfig::std_to_hom(), Region::sync(), Outline::sync(), Advanced_Outline::sync(), and CurveWarp::transform().
|
inline |
Referenced by Advanced_Outline::Advanced_Outline(), CurveGradient::CurveGradient(), CurveWarp::CurveWarp(), synfig::Layer_Polygon::Layer_Polygon(), synfig::Layer_Skeleton::Layer_Skeleton(), synfig::Layer_SkeletonDeformation::Layer_SkeletonDeformation(), Metaballs::Metaballs(), Plant::Plant(), and ValueBase().
|
inline |
Put template for any class.
Reimplemented in synfig::Value< T >.
References synfig::types_namespace::get_type_alias().
Referenced by svg_layer::set_param(), Layer_TimeLoop::set_param(), and synfig::Layer_PasteCanvas::set_param().
|
inline |
Set template for any class.
Reimplemented in synfig::Value< T >.
Referenced by synfig::Layer_Polygon::clear(), encode_layer(), synfig::Layer_ColorCorrect::get_param(), synfig::Layer_Bitmap::get_param(), Mandelbrot::get_param(), Julia::get_param(), Halftone3::Halftone3(), Star::import_parameters(), Plant::Plant(), reverse_value(), synfig::Layer_Composite::set_amount(), synfig::Layer_Composite::set_blend_method(), Blur_Layer::set_param(), synfig::Layer_SolidColor::set_param(), SuperSample::set_param(), Layer_Shade::set_param(), CheckerBoard::set_param(), Rectangle::set_param(), Rotate::set_param(), Import::set_param(), Layer_Bevel::set_param(), FilledRect::set_param(), synfig::Layer_Composite::set_param(), Advanced_Outline::set_param(), Mandelbrot::set_param(), Julia::set_param(), synfig::Layer_Shape::set_param(), Plant::set_param(), synfig::Layer_PasteCanvas::set_time(), Plant::set_version(), and synfig::Layer_Polygon::upload_polygon().
Returns a the corresponding Type of the described type. Notice that this is used in the loadcanvas. It should keep all all type names used in previous sif files
References synfig::Type::try_get_type_by_name(), type, and synfig::type_nil.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
References synfig::type_nil.
|
inlinestatic |
References synfig::type_nil.
|
inlinestatic |
References synfig::type_nil.
|
protected |
The type of value.
Referenced by can_get(), can_put(), can_set(), copy(), get_type(), ident_type(), is_valid(), operator=(), operator==(), operator[](), type_name(), and ValueBase().
|
protected |
Pointer to hold the data of the value.
Referenced by clear(), copy(), operator=(), and operator==().
|
protected |
Counter of Value Nodes that refers to this Value Base Value base can only be destructed if the ref_count is not greater than 0
Referenced by clear(), copy(), is_valid(), and operator=().
|
protected |
For Values with loop option like TYPE_LIST.
Referenced by copy_properties_of(), get_loop(), operator=(), and set_loop().
|
protected |
For Values of Constant Value Nodes.
Referenced by copy_properties_of(), get_static(), operator=(), and set_static().
|
protected |
Parameter interpolation.
Referenced by copy_properties_of(), get_interpolation(), operator=(), and set_interpolation().