Parent objects and insert rules

Andreas Zehender zehender at kde.org
Tue Sep 23 09:05:11 CEST 2003


Hi Leon!

On Tuesday, 23. September 2003 04:23, Leon Pennington wrote:
> I'm currently doing the mesh object, which is working okay. My problem is
> the Triangle.
>
> I need triangle to be able to accept object modifers as it does now when
> its a standalone object, but if its parent is a mesh, I need it not to
> accept them as children, is their anyway to do this? or should I simply
> remove them in serialization?

Yes, I think that can be modeled with the insert rules system.
Problems see below.

> Also the way I've written the mesh insert rules I'd assume you could not
> add a modifier (say texture) before a triangle. But it seems to allow this,
> but weirdly it won't allow a triangle after a texture. I've listed the
> rules below. Am I missing something?
>
> I was thinking it might have to do with graphical objects ( as thats what
> its base class is ) and the rules combining? if so can I force it not too.
>
> I've done a meshobjects group as povray docs say they may add polygon or
> others to the mesh object.
>
> <targetclass name="Mesh">
>    <definegroup name="MeshObjects">
>       <class name="Triangle"/>
>    </definegroup>
>    <rule>
>       <class name="Comment"/>
>       <class name="Raw"/>
>    </rule>
>    <rule>
>       <group name="ObjectModifier"/>
>       <not><before><group name="MeshObjects"/></before></not>
>    </rule>
>    <rule>
>       <group name="MeshObjects"/>
>       <not><after><group name="ObjectModifier"/></after></not>
>    </rule>
> </targetclass>

The insert rules system works as follows: An object can be inserted when at 
least one rule permits it.

And since triangle and mesh are graphical objects, object modifiers can be 
inserted allways and everywhere.

Arrrgs, the csg object has the same problem...

Just commit the rules, I will think about a solution.

Greetings, Andreas

-- 
--------------------------------------------------
 Andreas Zehender
 Master of Computer Science, Dipl. Ing. (BA)
 http://www.azweb.de
 az at azweb.de | zehender at kde.org      
--------------------------------------------------



More information about the kpovmodeler-devel mailing list