/usr/include/synfig-0.0/synfig/valuenode_bone.h is in libsynfig-dev 0.64.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | /* === S Y N F I G ========================================================= */
/*! \file valuenode_bone.h
** \brief Header file for implementation of the "Bone" valuenode conversion.
**
** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
** Copyright (c) 2007 Chris Moore
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
** published by the Free Software Foundation; either version 2 of
** the License, or (at your option) any later version.
**
** This package is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** General Public License for more details.
** \endlegal
*/
/* ========================================================================= */
/* === S T A R T =========================================================== */
#ifndef __SYNFIG_VALUENODE_BONE_H
#define __SYNFIG_VALUENODE_BONE_H
/* === H E A D E R S ======================================================= */
#include "valuenode.h"
/* === M A C R O S ========================================================= */
/* === C L A S S E S & S T R U C T S ======================================= */
namespace synfig {
class ValueNode_Bone : public LinkableValueNode
{
ValueNode::RHandle name_;
ValueNode::RHandle origin_;
ValueNode::RHandle origin0_;
ValueNode::RHandle angle_;
ValueNode::RHandle angle0_;
ValueNode::RHandle scalelx_;
ValueNode::RHandle scalely_;
ValueNode::RHandle scalex_;
ValueNode::RHandle scaley_;
ValueNode::RHandle length_;
ValueNode::RHandle strength_;
ValueNode::RHandle parent_;
bool setup_;
protected:
ValueNode_Bone();
ValueNode_Bone(const ValueBase &value, etl::loose_handle<Canvas> canvas = 0);
public:
typedef etl::handle<ValueNode_Bone> Handle;
typedef etl::handle<const ValueNode_Bone> ConstHandle;
typedef etl::loose_handle<ValueNode_Bone> LooseHandle;
typedef std::map<synfig::GUID, LooseHandle> BoneMap;
typedef std::map<etl::loose_handle<const Canvas>, BoneMap> CanvasMap;
typedef std::set<LooseHandle> BoneSet;
typedef std::list<LooseHandle> BoneList;
virtual ValueBase operator()(Time t)const;
virtual ValueNode* clone(etl::loose_handle<Canvas> canvas, const GUID& deriv_guid=GUID())const;
virtual ~ValueNode_Bone();
virtual void set_guid(const GUID& new_guid);
virtual void set_root_canvas(etl::loose_handle<Canvas> canvas);
virtual String get_name()const;
virtual String get_local_name()const;
virtual String get_bone_name(Time t)const;
virtual ValueNode::LooseHandle get_link_vfunc(int i)const;
protected:
LinkableValueNode* create_new()const;
virtual bool set_link_vfunc(int i,ValueNode::Handle x);
virtual void on_changed();
public:
using synfig::LinkableValueNode::get_link_vfunc;
using synfig::LinkableValueNode::set_link_vfunc;
static bool check_type(ValueBase::Type type);
static ValueNode_Bone* create(const ValueBase &x, etl::loose_handle<Canvas> canvas = 0);
virtual Vocab get_children_vocab_vfunc()const;
ValueNode_Bone::LooseHandle find(String name)const;
String unique_name(String name)const;
static void show_bone_map(etl::loose_handle<Canvas> canvas, const char *file, int line, String text, Time t=0);
static BoneMap get_bone_map(etl::handle<const Canvas> canvas);
static BoneList get_ordered_bones(etl::handle<const Canvas> canvas);
ValueNode_Bone::ConstHandle is_ancestor_of(ValueNode_Bone::ConstHandle bone, Time t)const;
virtual bool is_root()const { return false; }
// return a set of the bones that affect the given valuenode
// recurses through the valuenodes in the waypoints if it's animated,
// through the subnodes if it's linkable,
// and through the bone itself it's a bone constant
static BoneSet get_bones_referenced_by(ValueNode::Handle value_node, bool recursive = true);
// return a set of the bones that would be affected if the given ValueNode were edited
// value_node is either a ValueNode_Const or a ValueNode_Animated, of type VALUENODE_BONE
static BoneSet get_bones_affected_by(ValueNode::Handle value_node);
// return a set of the bones that can be parents of the given ValueNode without causing loops
static BoneSet get_possible_parent_bones(ValueNode::Handle value_node);
static ValueNode_Bone::Handle get_root_bone();
bool get_setup() { return setup_; }
void set_setup(bool value) { setup_ = value; changed(); }
#ifdef _DEBUG
virtual void ref()const;
virtual bool unref()const;
virtual void rref()const;
virtual void runref()const;
#endif
private:
virtual Matrix get_setup_matrix(Time t)const;
Matrix get_setup_matrix(Time t, Point origin0, Angle angle0, ValueNode_Bone::ConstHandle parent)const;
virtual Matrix get_animated_matrix(Time t, Point child_origin)const;
Matrix get_animated_matrix(Time t, Real scalex, Real scaley, Angle angle, Point origin, ValueNode_Bone::ConstHandle parent)const;
ValueNode_Bone::ConstHandle get_parent(Time t)const;
}; // END of class ValueNode_Bone
class ValueNode_Bone_Root : public ValueNode_Bone
{
public:
ValueNode_Bone_Root();
virtual ~ValueNode_Bone_Root();
virtual ValueBase operator()(Time t)const;
virtual String get_name()const;
virtual String get_local_name()const;
virtual String get_bone_name(Time t)const;
virtual void set_guid(const GUID& new_guid);
virtual void set_root_canvas(etl::loose_handle<Canvas> canvas);
virtual int link_count()const;
virtual bool is_root()const { return true; }
private:
Matrix get_setup_matrix(Time t)const;
Matrix get_animated_matrix(Time t, Point child_origin)const;
protected:
LinkableValueNode* create_new()const;
public:
static bool check_type(ValueBase::Type type);
static ValueNode_Bone* create(const ValueBase &x);
#ifdef _DEBUG
virtual void ref()const;
virtual bool unref()const;
virtual void rref()const;
virtual void runref()const;
#endif
}; // END of class ValueNode_Bone_Root
}; // END of namespace synfig
/* === E N D =============================================================== */
#endif
|