Cleanup: style

This commit is contained in:
Campbell Barton
2015-05-13 06:10:49 +10:00
parent 3160740421
commit e4cd4c383f
18 changed files with 65 additions and 57 deletions

View File

@@ -148,10 +148,12 @@ struct bPose;
struct bSplineIKConstraint;
struct EvaluationContext;
struct bPoseChannel *BKE_armature_ik_solver_find_root(struct bPoseChannel *pchan,
struct bKinematicConstraint *data);
struct bPoseChannel* BKE_armature_splineik_solver_find_root(struct bPoseChannel *pchan,
struct bSplineIKConstraint *data);
struct bPoseChannel *BKE_armature_ik_solver_find_root(
struct bPoseChannel *pchan,
struct bKinematicConstraint *data);
struct bPoseChannel *BKE_armature_splineik_solver_find_root(
struct bPoseChannel *pchan,
struct bSplineIKConstraint *data);
void BKE_pose_splineik_init_tree(struct Scene *scene, struct Object *ob, float ctime);
void BKE_splineik_execute_tree(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan_root, float ctime);

View File

@@ -2221,8 +2221,9 @@ BoundBox *BKE_armature_boundbox_get(Object *ob)
/************** Graph evaluation ********************/
bPoseChannel *BKE_armature_ik_solver_find_root(bPoseChannel *pchan,
bKinematicConstraint *data)
bPoseChannel *BKE_armature_ik_solver_find_root(
bPoseChannel *pchan,
bKinematicConstraint *data)
{
bPoseChannel *rootchan = pchan;
if (!(data->flag & CONSTRAINT_IK_TIP)) {
@@ -2243,8 +2244,9 @@ bPoseChannel *BKE_armature_ik_solver_find_root(bPoseChannel *pchan,
return rootchan;
}
bPoseChannel* BKE_armature_splineik_solver_find_root(bPoseChannel *pchan,
bSplineIKConstraint *data)
bPoseChannel *BKE_armature_splineik_solver_find_root(
bPoseChannel *pchan,
bSplineIKConstraint *data)
{
bPoseChannel *rootchan = pchan;
int segcount = 0;

View File

@@ -629,7 +629,7 @@ void BKE_pose_constraints_evaluate(EvaluationContext *UNUSED(eval_ctx),
Object *ob,
bPoseChannel *pchan)
{
Scene *scene = (Scene*)G.main->scene.first;
Scene *scene = G.main->scene.first;
DEBUG_PRINT("%s on %s pchan %s\n", __func__, ob->id.name, pchan->name);
if (pchan->flag & POSE_IKTREE || pchan->flag & POSE_IKSPLINE) {
/* IK are being solved separately/ */

View File

@@ -1394,7 +1394,7 @@ void BKE_curve_forward_diff_tangent_bezier(float q0, float q1, float q2, float q
rt0 = 3.0f * (q1 - q0);
rt1 = f * (3.0f * (q3 - q0) + 9.0f * (q1 - q2));
rt2 = 6.0f * (q0 + q2)- 12.0f * q1;
rt2 = 6.0f * (q0 + q2) - 12.0f * q1;
q0 = rt0;
q1 = f * (rt1 + rt2);

View File

@@ -3235,7 +3235,7 @@ short DAG_get_eval_flags_for_object(Scene *scene, void *object)
DagNode *node;
if (!DEG_depsgraph_use_legacy()) {
return DEG_get_eval_flags_for_id(scene->depsgraph, (ID*)object);
return DEG_get_eval_flags_for_id(scene->depsgraph, (ID *)object);
}
if (scene->theDag == NULL) {
@@ -3541,7 +3541,7 @@ void DAG_ids_clear_recalc(Main *bmain)
short DAG_get_eval_flags_for_object(Scene *scene, void *object)
{
return DEG_get_eval_flags_for_id(scene->depsgraph, (ID*)object);
return DEG_get_eval_flags_for_id(scene->depsgraph, (ID *)object);
}
void DAG_ids_flush_tagged(Main *bmain)

View File

@@ -322,7 +322,7 @@ void BKE_object_eval_uber_transform(EvaluationContext *UNUSED(eval_ctx),
copy_m4_m4(ob->obmat, ob->proxy_from->obmat);
}
ob->recalc &= ~(OB_RECALC_OB|OB_RECALC_TIME);
ob->recalc &= ~(OB_RECALC_OB | OB_RECALC_TIME);
if (ob->data == NULL) {
ob->recalc &= ~OB_RECALC_DATA;
}
@@ -336,5 +336,5 @@ void BKE_object_eval_uber_data(EvaluationContext *eval_ctx,
BLI_assert(ob->type != OB_ARMATURE);
BKE_object_handle_data_update(eval_ctx, scene, ob);
ob->recalc &= ~(OB_RECALC_DATA|OB_RECALC_TIME);
ob->recalc &= ~(OB_RECALC_DATA | OB_RECALC_TIME);
}

View File

@@ -55,7 +55,7 @@ void DisplaceOperation::executePixelSampled(float output[4], float x, float y, P
float uv[2], deriv[2][2];
pixelTransform(xy, uv, deriv);
if(is_zero_v2(deriv[0]) && is_zero_v2(deriv[1])) {
if (is_zero_v2(deriv[0]) && is_zero_v2(deriv[1])) {
this->m_inputColorProgram->readSampled(output, uv[0], uv[1], COM_PS_BILINEAR);
}
else {

View File

@@ -72,7 +72,7 @@ struct DepsRelation {
DepsNode *to; /* B */
/* relationship attributes */
const char* name; /* label for debugging */
const char *name; /* label for debugging */
eDepsRelation_Type type; /* type */
int flag; /* (eDepsRelation_Flag) */

View File

@@ -178,7 +178,7 @@ string deg_fcurve_id_name(const FCurve *fcu)
static void deg_graph_build_finalize(Depsgraph *graph)
{
std::stack<OperationDepsNode*> stack;
std::stack<OperationDepsNode *> stack;
for (Depsgraph::OperationNodes::const_iterator it_op = graph->operations.begin();
it_op != graph->operations.end();
@@ -192,8 +192,9 @@ static void deg_graph_build_finalize(Depsgraph *graph)
++it_rel)
{
DepsRelation *rel = *it_rel;
if (rel->from->type == DEPSNODE_TYPE_OPERATION &&
(rel->flag & DEPSREL_FLAG_CYCLIC) == 0) {
if ((rel->from->type == DEPSNODE_TYPE_OPERATION) &&
(rel->flag & DEPSREL_FLAG_CYCLIC) == 0)
{
++node->num_links_pending;
}
}

View File

@@ -124,7 +124,7 @@ RootDepsNode *DepsgraphNodeBuilder::add_root_node()
IDDepsNode *DepsgraphNodeBuilder::add_id_node(ID *id)
{
const char *idtype_name = BKE_idcode_to_name(GS(id->name));
return m_graph->add_id_node(id, string(id->name+2) + "[" + idtype_name + "]");
return m_graph->add_id_node(id, string(id->name + 2) + "[" + idtype_name + "]");
}
TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source(ID *id)
@@ -404,8 +404,8 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob)
id_node->eval_flags |= DAG_EVAL_NEED_CURVE_PATH;
}
}
break;
}
break;
case OB_ARMATURE: /* Pose */
if (ob->id.lib != NULL && ob->proxy_from != NULL) {
@@ -972,8 +972,8 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
add_operation_node(obdata, DEPSNODE_TYPE_GEOMETRY,
DEPSOP_TYPE_INIT, function_bind(BKE_mesh_eval_geometry, _1, (Mesh *)obdata),
DEG_OPCODE_PLACEHOLDER, "Geometry Eval");
break;
}
break;
case OB_MBALL:
{
@@ -987,8 +987,8 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
DEPSOP_TYPE_INIT, function_bind(BKE_mball_eval_geometry, _1, (MetaBall *)obdata),
DEG_OPCODE_PLACEHOLDER, "Geometry Eval");
}
break;
}
break;
case OB_CURVE:
case OB_FONT:
@@ -1003,8 +1003,8 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
add_operation_node(obdata, DEPSNODE_TYPE_GEOMETRY,
DEPSOP_TYPE_EXEC, function_bind(BKE_curve_eval_path, _1, (Curve *)obdata),
DEG_OPCODE_GEOMETRY_PATH, "Path");
break;
}
break;
case OB_SURF: /* Nurbs Surface */
{
@@ -1012,8 +1012,8 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
add_operation_node(obdata, DEPSNODE_TYPE_GEOMETRY,
DEPSOP_TYPE_INIT, function_bind(BKE_curve_eval_geometry, _1, (Curve *)obdata),
DEG_OPCODE_PLACEHOLDER, "Geometry Eval");
break;
}
break;
case OB_LATTICE: /* Lattice */
{
@@ -1021,8 +1021,8 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
add_operation_node(obdata, DEPSNODE_TYPE_GEOMETRY,
DEPSOP_TYPE_INIT, function_bind(BKE_lattice_eval_geometry, _1, (Lattice *)obdata),
DEG_OPCODE_PLACEHOLDER, "Geometry Eval");
break;
}
break;
}
add_operation_node(obdata, DEPSNODE_TYPE_GEOMETRY,

View File

@@ -399,8 +399,8 @@ void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *o
case OB_LATTICE:
{
build_obdata_geom(bmain, scene, ob);
break;
}
break;
case OB_ARMATURE: /* Pose */
@@ -446,8 +446,8 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob)
{
ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM);
add_relation(parent_key, ob_key, DEPSREL_TYPE_STANDARD, "Armature Deform Parent");
break;
}
break;
case PARVERT1: /* Vertex Parent */
case PARVERT3:
@@ -459,15 +459,15 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob)
ComponentKey transform_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM);
add_relation(transform_key, ob_key, DEPSREL_TYPE_TRANSFORM, "Vertex Parent TFM");
break;
}
break;
case PARBONE: /* Bone Parent */
{
ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_BONE, ob->parsubstr);
add_relation(parent_key, ob_key, DEPSREL_TYPE_TRANSFORM, "Bone Parent");
break;
}
break;
default:
{
@@ -502,8 +502,8 @@ void DepsgraphRelationBuilder::build_object_parent(Object *ob)
ComponentKey parent_key(&ob->parent->id, DEPSNODE_TYPE_TRANSFORM);
add_relation(parent_key, ob_key, DEPSREL_TYPE_TRANSFORM, "Parent");
}
break;
}
break;
}
/* exception case: parent is duplivert */
@@ -696,7 +696,7 @@ void DepsgraphRelationBuilder::build_animdata(ID *id)
/* prevent driver from occurring before own animation... */
if (adt->action || adt->nla_tracks.first) {
add_relation(adt_key, driver_key, DEPSREL_TYPE_OPERATION,
"[AnimData Before Drivers]");
"[AnimData Before Drivers]");
}
}
}
@@ -1249,7 +1249,7 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *ob,
// TODO: the bigggest point here is that we need the curve PATH and not just the general geometry...
ComponentKey target_key(&data->tar->id, DEPSNODE_TYPE_GEOMETRY);
ComponentKey pose_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE);
add_relation(target_key, pose_key, DEPSREL_TYPE_TRANSFORM,"[Curve.Path -> Spline IK] DepsRel");
add_relation(target_key, pose_key, DEPSREL_TYPE_TRANSFORM, "[Curve.Path -> Spline IK] DepsRel");
}
pchan->flag |= POSE_DONE;
@@ -1595,8 +1595,8 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje
ComponentKey mom_key(&mom->id, DEPSNODE_TYPE_GEOMETRY);
add_relation(geom_key, mom_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Metaball Motherball");
}
break;
}
break;
case OB_CURVE:
case OB_FONT:
@@ -1619,18 +1619,18 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje
add_relation(textoncurve_key, geom_key, DEPSREL_TYPE_GEOMETRY_EVAL, "Text on Curve");
}
}
break;
}
break;
case OB_SURF: /* Nurbs Surface */
{
break;
}
break;
case OB_LATTICE: /* Lattice */
{
break;
}
break;
}
/* ShapeKeys */

View File

@@ -917,14 +917,16 @@ DepsgraphStatsID *DepsgraphDebug::get_id_stats(ID *id, bool create)
return id_stats;
}
DepsgraphStatsComponent *DepsgraphDebug::get_component_stats(DepsgraphStatsID *id_stats,
const string &name,
bool create)
DepsgraphStatsComponent *DepsgraphDebug::get_component_stats(
DepsgraphStatsID *id_stats,
const string &name,
bool create)
{
DepsgraphStatsComponent *comp_stats;
for (comp_stats = (DepsgraphStatsComponent *)id_stats->components.first;
comp_stats != NULL;
comp_stats = comp_stats->next) {
comp_stats = comp_stats->next)
{
if (STREQ(comp_stats->name, name.c_str()))
break;
}

View File

@@ -152,7 +152,7 @@ void DEG_id_tag_update(ID *id, short flag)
void DEG_id_tag_update_ex(Main *bmain, ID *id, short flag)
{
if(id == NULL) {
if (id == NULL) {
/* Ideally should not happen, but old depsgraph allowed this. */
return;
}
@@ -173,14 +173,14 @@ void DEG_id_tag_update_ex(Main *bmain, ID *id, short flag)
continue;
}
if (flag & OB_RECALC_DATA && GS(id->name) == ID_OB) {
Object *object = (Object*)id;
Object *object = (Object *)id;
if (object->data != NULL) {
DEG_graph_id_tag_update(bmain,
graph,
(ID*)object->data);
(ID *)object->data);
}
}
if (flag & (OB_RECALC_OB|OB_RECALC_DATA)) {
if (flag & (OB_RECALC_OB | OB_RECALC_DATA)) {
DEG_graph_id_tag_update(bmain, graph, id);
}
}
@@ -210,7 +210,7 @@ void DEG_id_type_tag(Main *bmain, short idtype)
/* FIFO queue for tagged nodes that need flushing */
/* XXX This may get a dedicated implementation later if needed - lukas */
typedef std::queue<OperationDepsNode*> FlushQueue;
typedef std::queue<OperationDepsNode *> FlushQueue;
/* Flush updates from tagged nodes outwards until all affected nodes are tagged. */
void DEG_graph_flush_updates(Main *bmain, Depsgraph *graph)
@@ -317,9 +317,9 @@ void DEG_graph_flush_updates(Main *bmain, Depsgraph *graph)
*/
void DEG_ids_flush_tagged(Main *bmain)
{
for (Scene *scene = (Scene*)bmain->scene.first;
for (Scene *scene = (Scene *)bmain->scene.first;
scene != NULL;
scene = (Scene*)scene->id.next)
scene = (Scene *)scene->id.next)
{
/* TODO(sergey): Only visible scenes? */
if (scene->depsgraph != NULL) {
@@ -417,9 +417,9 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene)
void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time))
{
for (Scene *scene = (Scene*)bmain->scene.first;
for (Scene *scene = (Scene *)bmain->scene.first;
scene != NULL;
scene = (Scene*)scene->id.next)
scene = (Scene *)scene->id.next)
{
if (scene->depsgraph != NULL) {
DEG_graph_on_visible_update(bmain, scene);
@@ -440,7 +440,7 @@ void DEG_ids_check_recalc(Main *bmain, Scene *scene, bool time)
a = set_listbasepointers(bmain, lbarray);
while (a--) {
ListBase *lb = lbarray[a];
ID *id = (ID*)lb->first;
ID *id = (ID *)lb->first;
/* We tag based on first ID type character to avoid
* looping over all ID's in case there are no tags.

View File

@@ -53,7 +53,7 @@ struct FCurve;
/* Evaluation Operation for atomic operation */
// XXX: move this to another header that can be exposed?
typedef function<void(struct EvaluationContext*)> DepsEvalOperationCb;
typedef function<void(struct EvaluationContext *)> DepsEvalOperationCb;
/* Metatype of Nodes - The general "level" in the graph structure the node serves */
typedef enum eDepsNode_Class {

View File

@@ -168,7 +168,7 @@ struct IDDepsNode : public DepsNode {
};
typedef unordered_map<ComponentIDKey,
ComponentDepsNode*,
ComponentDepsNode *,
component_key_hash> ComponentMap;
void init(const ID *id, const string &subdata);

View File

@@ -59,7 +59,7 @@ public:
function() {};
function(void *) {}
operator bool() const { return false; }
bool operator== (void*) { return false; }
bool operator== (void *) { return false; }
template<typename T1>
void operator() (T1) {

View File

@@ -24,8 +24,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef ___DEPSGRAPH_UTIL_PCHANMAP_H__
#define ___DEPSGRAPH_UTIL_PCHANMAP_H__
#ifndef __DEPSGRAPH_UTIL_PCHANMAP_H__
#define __DEPSGRAPH_UTIL_PCHANMAP_H__
struct RootPChanMap {
/* ctor and dtor - Create and free the internal map respectively. */

View File

@@ -3237,7 +3237,8 @@ static uiBut *ui_def_but(
return but;
}
void ui_def_but_icon(uiBut *but, const int icon, const int flag) {
void ui_def_but_icon(uiBut *but, const int icon, const int flag)
{
if (icon) {
ui_icon_ensure_deferred(but->block->evil_C, icon, (flag & UI_BUT_ICON_PREVIEW) != 0);
}