void AnimationTreeEditor::edit_path(const Vector<String> &p_path) {

	button_path.clear();

	Ref<AnimationNode> node = tree->get_tree_root();

	if (node.is_valid()) {
		current_root = node->get_instance_id();

		for (int i = 0; i < p_path.size(); i++) {

			Ref<AnimationNode> child = node->get_child_by_name(p_path[i]);
			ERR_BREAK(child.is_null());
			node = child;
			button_path.push_back(p_path[i]);
		}

		for (int i = 0; i < editors.size(); i++) {
			if (editors[i]->can_edit(node)) {
				editors[i]->edit(node);
				editors[i]->show();
			} else {
				editors[i]->edit(Ref<AnimationNode>());
				editors[i]->hide();
			}
		}
	} else {
		current_root = 0;
	}

	edited_path = button_path;

	_update_path();
}
예제 #2
0
void mbe_clip(mbe_t *canvas) {
    if(!canvas->subpath->isEmpty())
	_update_path(canvas);

    canvas->canvas->clipPath(*canvas->path, SkRegion::kIntersect_Op);
    canvas->path->rewind();
    canvas->subpath->rewind();
}
예제 #3
0
void mbe_restore(mbe_t *canvas) {
    struct _mbe_states_t *states;

    _update_path(canvas);

    states = canvas->states;
    ASSERT(states->next);
    canvas->states = states->next;
    free(states);
}
void
dmz::MBRAPluginFaultTreeAutoLayout::_update_tree (
      const Handle SuperHandle,
      const Handle SubHandle,
      const Int32 Column,
      Int32 &count) {

   ObjectModule *objMod (get_object_module ());

   if (objMod && SuperHandle && SubHandle) {

      Vector rootPos (0.0, 0.0, 0.0);

      Vector superPos;
      objMod->lookup_position (SuperHandle, _defaultAttrHandle, superPos);

      Vector offset ((Column * _hOffset), 0.0, (count * _vOffset));
      Vector topPos (rootPos + offset);

      HandleContainer children;
      objMod->lookup_sub_links (SubHandle, _linkAttrHandle, children);

      if (children.get_count ()) {

         Int32 startCount (count);

         Handle current (children.get_first ());

         while (current) {

            _update_tree (SubHandle, current, Column + 1, count);

            current = children.get_next ();
         }

         Int32 endCount (count);

         offset.set_xyz (0.0, 0.0, ((endCount - startCount - 1) * 0.5f * _vOffset));
         objMod->store_position (SubHandle, _defaultAttrHandle, topPos + offset);

         _update_logic (SubHandle);

         _update_path (SubHandle);
      }
      else {

         offset.set_xyz ((Column * _hOffset), 0.0, (count * _vOffset));
         objMod->store_position (SubHandle, _defaultAttrHandle, rootPos + offset);

         count++;
      }
   }
}
예제 #5
0
int mbe_in_fill(mbe_t *canvas, co_aix x, co_aix y) {
    SkRegion region, dev_region;
    bool in_fill;

    if(!canvas->subpath->isEmpty())
	_update_path(canvas);

    _canvas_device_region(canvas->canvas, &dev_region);
    region.setPath(*canvas->path, dev_region);

    in_fill = region.contains(x, y);

    return in_fill;
}
void
dmz::MBRAPluginFaultTreeAutoLayout::_update_tree () {

   ObjectModule *objMod (get_object_module ());

   if (objMod && _root) {

      HandleContainer children;

      objMod->lookup_sub_links (_root, _linkAttrHandle, children);

      _path = QPainterPath ();

      Int32 count (0);

      Handle current (children.get_first ());

      while (current) {

         _update_tree (_root, current, 1, count);

         current = children.get_next ();
      }

      Vector offset (0.0, 0.0, 0.0);

      if (count) {

         offset.set_z ((count - 1) * 0.5f * _vOffset);
      }

      objMod->store_position (_root, _defaultAttrHandle, offset);

      _update_logic (_root);

      if (children.get_count ()) {

         _update_path (_root);
      }

      if (_pathItem) { _pathItem->setPath (_path); }
   }
}
예제 #7
0
void mbe_stroke(mbe_t *canvas) {
    SkPath *path = canvas->path;
    SkPaint *paint = canvas->paint;

    ASSERT(ptn);
    ASSERT(path);
    ASSERT(paint);

    if(!canvas->subpath->isEmpty())
	_update_path(canvas);

    _prepare_paint(canvas, SkPaint::kStroke_Style);

    canvas->canvas->drawPath(*path, *paint);

    _finish_paint(canvas);

    path->rewind();
    canvas->subpath->rewind();
}
예제 #8
0
void mbe_fill_preserve(mbe_t *canvas) {
    mbe_pattern_t *ptn = canvas->states->ptn;
    SkPaint *paint = canvas->paint;
    SkPath *path = canvas->path;
    SkRegion *saved_clip = NULL;
    co_aix x, y;

    ASSERT(paint);
    ASSERT(ptn);
    ASSERT(path);

    if(!canvas->subpath->isEmpty())
	_update_path(canvas);

    _prepare_paint(canvas, SkPaint::kFill_Style);

    canvas->canvas->drawPath(*path, *paint);

    _finish_paint(canvas);
}
예제 #9
0
void mbe_transform(mbe_t *mbe, co_aix matrix[6]) {
    _update_path(mbe);

    matrix_mul(matrix, mbe->states->matrix, mbe->states->matrix);
}