You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

rdhoore108

Trainee

  • "rdhoore108" started this thread

Posts: 89

Location: Belgium

Occupation: Systems and Network Administrator

  • Send private message

1

Saturday, September 11th 2010, 10:32am

Parent and children: how to improve their relationship

Dear Klaus,

The introduction of parent and children is very beautiful. Thank you very much for this!

Its possibilities would become very much increased if we also had a way to distinguish, when we change the value of a property, if it should also affect the children of the object, or not. And also a way to change the value of the children, but not the parent itself.

Probably this is not so hard for you to implement - however, it is not so easy to figure out a syntax which could indicate in the code if our changing a property should be limited to the parent itself, or should include the children, or should only affect the children. This syntax should be backward compatible, and should seem logical.

I can see that you have been thinking about the same problem when you introduced "scalechildren". This property would not be needed if we had a way to indicate if any changing of a value should be limited to the parent or not.

To illustrate my point, let's say that we agree that:
  • if we put a # prefix in front of a value, then it means the operation is limited to the parent;
  • if we put a ~ prefix in front of a value, then it means the operation is limited to the children, and not the parent;
  • if we put no prefix, then the standard behavior happens: the operation affects parent and its children.

Then scale="#0.5" would mean the parent gets scaled, but the scaling of the children would remain unaffected. And there would be no need for scalechildren="false".

And visible="~false" would mean the children become hidden, but the parent remains unaffected.

Of course, this should not be limited to booleans, but should also work for numbers and strings.

Now I'm not saying that this # and ~ is such a great idea (they are neither backward compatible, nor logical), I just meant to illustrate the effect, not the means. I hope I'm making sense.

So if anyone knows a nice syntax that could be used for indicating if changing a value should affect the parent only, or the children only, please step forward *smile*. It should obey the rules of xml, and should be backward compatible.

Thank you.


PS. I came up with this idea after I noticed that making invisible parents just so that one can control all children at once, comes with a speed penalty. Just try the following (a suitable invisible parent for all controls on the screen), and you will see that autorotation becomes incredibly slow and jumpy:

Source code

1
2
3
4
5
6
	<plugin name="ParentForMyControls"
		url="spacer.gif" 
		width="100%"
		height="100%"
		handcursor="false"
	/>

So here it would help to make it invisible, but of course I want to make its children visible or invisible without making the parent visible.
- Ronny D'Hoore