Summary of the invention
Technical problems to be solved in this application are to provide a kind of Dynamic Graph processing method and processing device, in order to solve existing skillWhen art using stream file format Dynamic Graph is processed, it is unfavorable for owing to file structure is single applying the multiple of Dynamic Graph to answerCarry out resolving the technical problem read to Dynamic Graph with software.
This application provides a kind of Dynamic Graph processing method, described Dynamic Graph includes canvas element, graphic element and animationElement, described method includes:
Resolve canvas element, graphic element and the animated element comprised in described Dynamic Graph;
According to the analysis result of described canvas element, graphic element and animated element, set up the node of XML data formatTree, represents each element in described Dynamic Graph with the form of described node tree node;
Wherein:
Described canvas element includes the painting canvas property value of canvas object and correspondence thereof;
Described graphic element includes Drawing Object and graph of a correspondence property value thereof;
Described animated element includes the animation attributes value of animation object and correspondence thereof.
Said method, it is preferred that the described node tree setting up XML data format, including:
Painting canvas property value to described canvas object and correspondence thereof carries out the conversion of XML data format, by described painting canvas pairThe transformation result of elephant is as the root node of described node tree, using the transformation result of described painting canvas property value as described root nodeSlave node;
Described Drawing Object and graph of a correspondence property value thereof are carried out the conversion of XML data format, by described figure pairThe transformation result of elephant is as the slave node of described root node, using the transformation result of described graphic attribute value as the figure of its correspondenceThe slave node of shape Object node;
Animation attributes value to described animation object and correspondence thereof carries out the conversion of XML data format, by described animation pairThe transformation result of elephant is as the slave node of Drawing Object node belonging to it, using the transformation result of described animation attributes value as itThe slave node of affiliated animation Object node.
Said method, it is preferred that described Dynamic Graph also includes composite figure element, composite figure daughter element and combined animationDaughter element, described composite figure element includes the composite attribute value of composite figure object and correspondence thereof, described composite figure unitElement includes that the composite figure property value of composite figure subobject and correspondence thereof, described combined animation daughter element include combined animationThe combined animation property value of object and correspondence thereof, wherein, described method also includes:
Set up composite figure element described in described node tree, composite figure daughter element and combined animation daughter element the most rightThe node answered, particularly as follows:
The composite attribute value of described composite figure object and correspondence thereof is carried out XML data format conversion, by described combinationThe transformation result of Drawing Object is as the slave node of described root node, using right as it for the transformation result of described composite attribute valueAnswer the slave node of composite figure Object node;
Composite figure property value to described composite figure subobject and correspondence thereof carries out the conversion of XML data format, willThe transformation result of described composite figure subobject is as the slave node of its corresponding composite figure Object node, by described constitutional diagramThe transformation result of shape property value is as the slave node of the composite figure subobject node of its correspondence;
Combined animation property value to described combined animation subobject and correspondence thereof carries out the conversion of XML data format, willThe transformation result of described combined animation subobject is as the slave node of composite figure subobject node belonging to it, by described combinationThe transformation result of animation attributes value is as the slave node of the combined animation subobject node of its correspondence.
Present invention also provides another kind of Dynamic Graph processing method, described Dynamic Graph presented in described node tree,Described node tree includes that the node of XML data format, described method include:
Travel through the node in described node tree;
According to each node in described node tree, reduce described Dynamic Graph;
Wherein:
Described Dynamic Graph includes canvas element, graphic element, animated element;
Described canvas element includes the painting canvas property value of canvas object and correspondence thereof;
Described graphic element includes Drawing Object and graph of a correspondence property value thereof;
Described animated element includes the animation attributes value of animation object and correspondence thereof.
Said method, it is preferred that the described Dynamic Graph of described reduction, including:
Root node in described node tree is carried out the conversion of object data format, the transformation result of described root node is madeCanvas object for described Dynamic Graph;
Slave node to described canvas object node carries out the conversion of object data format, by described canvas object nodeSlave node in the transformation result of image object node as the Drawing Object in described canvas object, by described canvas objectIn the slave node of node, the transformation result of painting canvas property value node is as painting canvas property value corresponding to described canvas object;
Slave node to described image object node carries out the conversion of object data format, by described Drawing Object nodeSlave node in the transformation result of animation Object node as the animation object in Drawing Object belonging to it, by described figure pairAs in the slave node of node the transformation result of graphic attribute value node as Drawing Object graph of a correspondence property value belonging to it;
Slave node to described animation Object node carries out the conversion of object data format, by described animation Object nodeThe transformation result of slave node as animation attributes value corresponding to animation object belonging to it.
Said method, it is preferred that described Dynamic Graph also includes composite figure element, composite figure daughter element and combined animationDaughter element, described composite figure element includes the composite attribute value of composite figure object and correspondence thereof, described composite figure unitElement includes that the composite figure property value of composite figure subobject and correspondence thereof, described combined animation daughter element include combined animationThe combined animation property value of object and correspondence thereof, wherein, described method also includes:
Reduce the composite figure element in described Dynamic Graph, composite figure daughter element, combined animation daughter element, particularly as follows:
Slave node to described canvas object node carries out the conversion of object data format, by described canvas object nodeSlave node in the transformation result of composite figure Object node as the composite figure object in described canvas object;
Slave node to described composite figure Object node carries out the conversion of object data format, by described composite figureIn the slave node of Object node, the transformation result of combination image subobject node is as the combination in described composite figure objectFigure subobject, using the transformation result of composite attribute value node in the slave node of described composite figure Object node as describedThe composite attribute value that composite figure object is corresponding;
Slave node to described combination image subobject node carries out the conversion of object data format, by described constitutional diagramIn the slave node of shape subobject node, the transformation result of combined animation subobject node is as composite figure subobject belonging to itIn combined animation subobject, by the slave node of described composite figure subobject node composite figure property value node turnChange result as composite figure property value corresponding to composite figure subobject belonging to it;
Slave node to described combined animation subobject node carries out the conversion of object data format, described combination is movedDraw the transformation result of slave node of subobject node as combined animation property value corresponding to combined animation subobject belonging to it.
Present invention also provides a kind of Dynamic Graph processing means, described Dynamic Graph includes canvas element, graphic element and movesDrawing element, described device includes:
Element resolution unit, for resolving canvas element, graphic element and the animated element comprised in described Dynamic Graph;
Node tree sets up unit, for according to described canvas element, graphic element and animated element, sets up XML data latticeThe nodes of formula, represents each element in described Dynamic Graph with the form of described node tree node;
Wherein:
Described canvas element includes the painting canvas property value of canvas object and correspondence thereof;
Described graphic element includes Drawing Object and graph of a correspondence property value thereof;
Described animated element includes the animation attributes value of animation object and correspondence thereof.
Said apparatus, it is preferred that described node tree is set up unit and included:
Primary nodal point conversion subelement, for carrying out XML data to the painting canvas property value of described canvas object and correspondence thereofThe conversion of form, using the transformation result of described canvas object as the root node of described node tree, by described painting canvas property valueTransformation result is as the slave node of described root node;
Secondary nodal point conversion subelement, for carrying out XML data to described Drawing Object and graph of a correspondence property value thereofThe conversion of form, using the transformation result of described Drawing Object as the slave node of described root node, by described graphic attribute valueTransformation result as the slave node of its graph of a correspondence Object node;
3rd node conversion subelement, for carrying out XML data to the animation attributes value of described animation object and correspondence thereofThe conversion of form, using the transformation result of described animation object as the slave node of Drawing Object node belonging to it, by described dynamicDraw the transformation result of property value as the slave node of animation Object node it described.
Said apparatus, it is preferred that described Dynamic Graph also includes composite figure element, composite figure daughter element and combined animationDaughter element, described composite figure element includes the composite attribute value of composite figure object and correspondence thereof, described composite figure unitElement includes that the composite figure property value of composite figure subobject and correspondence thereof, described combined animation daughter element include combined animationThe combined animation property value of object and correspondence thereof, wherein:
Described node tree is set up unit and is also included:
Fourth node conversion subelement, for carrying out XML to the composite attribute value of described composite figure object and correspondence thereofData Format Transform, using the transformation result of described composite figure object as the slave node of described root node, by described combinationThe transformation result of property value is as the slave node of its corresponding composite figure Object node;
5th node conversion subelement, for entering the composite figure property value of described composite figure subobject and correspondence thereofThe conversion of row XML data format, using the transformation result of described composite figure subobject as its corresponding composite figure Object nodeSlave node, using the transformation result of described composite figure property value as the subordinate of the composite figure subobject node of its correspondenceNode;
6th node conversion subelement, for entering the combined animation property value of described combined animation subobject and correspondence thereofThe conversion of row XML data format, saves the transformation result of described combined animation subobject as composite figure subobject belonging to itPoint slave node, using the transformation result of described combined animation property value as its correspondence combined animation subobject node fromBelong to node.
Present invention also provides another kind of Dynamic Graph processing means, described Dynamic Graph presented in described node tree,Described node tree includes that the node of XML data format, described device include:
Node traverses unit, for traveling through the node in described node tree;
Dynamic Graph reduction unit, for according to each node in described node tree, reduces described Dynamic Graph;
Wherein:
Described Dynamic Graph includes canvas element, graphic element, animated element;
Described canvas element includes the painting canvas property value of canvas object and correspondence thereof;
Described graphic element includes Drawing Object and graph of a correspondence property value thereof;
Described animated element includes the animation attributes value of animation object and correspondence thereof.
Said apparatus, it is preferred that described Dynamic Graph reduction unit includes:
First goes back atomic unit, for the root node in described node tree carries out the conversion of object data format, by instituteState the transformation result canvas object as described Dynamic Graph of root node;
Second goes back atomic unit, for the slave node of described canvas object node carries out turning of object data formatChange, using the transformation result of image object node in the slave node of described canvas object node as the figure in described canvas objectShape object, using the transformation result of painting canvas property value node in the slave node of described canvas object node as described canvas objectCorresponding painting canvas property value;
3rd goes back atomic unit, for the slave node of described image object node carries out turning of object data formatChange, using the transformation result of animation Object node in the slave node of described Drawing Object node as in Drawing Object belonging to itAnimation object, using the transformation result of graphic attribute value node in the slave node of described Drawing Object node as figure belonging to itObject graph of a correspondence property value;
4th goes back atomic unit, for the slave node of described animation Object node carries out turning of object data formatChange, using the transformation result of the slave node of described animation Object node as animation attributes value corresponding to animation object belonging to it.
Said apparatus, it is preferred that described Dynamic Graph also includes composite figure element, composite figure daughter element and combined animationDaughter element, described composite figure element includes the composite attribute value of composite figure object and correspondence thereof, described composite figure unitElement includes that the composite figure property value of composite figure subobject and correspondence thereof, described combined animation daughter element include combined animationThe combined animation property value of object and correspondence thereof, wherein:
Described Dynamic Graph reduction unit also includes:
5th goes back atomic unit, for the slave node of described canvas object node carries out turning of object data formatChange, using the transformation result of composite figure Object node in the slave node of described canvas object node as in described canvas objectComposite figure object;
6th goes back atomic unit, for the slave node of described composite figure Object node is carried out object data formatConversion, using the transformation result of combination image subobject node in the slave node of described composite figure Object node as described groupClose the composite figure subobject in Drawing Object, by composite attribute value node in the slave node of described composite figure Object nodeTransformation result as composite attribute value corresponding to described composite figure object;
7th goes back atomic unit, for the slave node of described combination image subobject node is carried out object data formatConversion, using the transformation result of combined animation subobject node in the slave node of described composite figure subobject node as itCombined animation subobject in affiliated composite figure subobject, will combine in the slave node of described composite figure subobject nodeThe transformation result of graphic attribute value node is as composite figure property value corresponding to composite figure subobject belonging to it;
8th goes back atomic unit, for the slave node of described combined animation subobject node is carried out object data formatConversion, using the transformation result of the slave node of described combined animation subobject node as combined animation subobject pair belonging to itThe combined animation property value answered.
From such scheme, a kind of Dynamic Graph processing method and processing device that the application provides, by by Dynamic GraphEach element represents with the node tree form of XML data format, and the data of XML data format can be by universal application softwareRead, described Dynamic Graph is follow-up store after, conveniently can not only be read by multiple Dynamic Graph application software, andAnd without resolving any configuration file etc., add the range of application of Dynamic Graph, and improve the reading efficiency that Dynamic Graph reads.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is carried out clear, completeDescribe, it is clear that described embodiment is only some embodiments of the present application rather than whole embodiments wholely.Based onEmbodiment in the application, it is every other that those of ordinary skill in the art are obtained under not making creative work premiseEmbodiment, broadly falls into the scope of the application protection.
With reference to Fig. 1, for the flow chart of a kind of Dynamic Graph processing method embodiment one that the application provides, described method is suitable forIn the application that the motion graphics being in Dynamic Announce is processed, in the embodiment of the present application, with to described Dynamic GraphAs a example by preservation, described method may comprise steps of:
Step 101: resolve canvas element, graphic element and the animated element comprised in described Dynamic Graph.
Wherein, as described in the text, described Dynamic Graph is in the presence of Dynamic Announce state, based on painting canvas, and described pictureIt is provided with figure on cloth, figure is provided with animation.The dynamic effect of the figure of described Dynamic Graph is realized by the value of variable, asThe dynamical state (position or color value etc.) that the title of variable, minima, maximum and minima are corresponding with maximum, exampleAs, Drawing Object Rect1 comprises the dynamic of horizontal displacement, the left side of this Drawing Object when the minima of variable OPCTAG2 is 0Position is 20, and when OPCTAG2 reaches maximum 100, the left position of Drawing Object is 420, as follows specific to physical recordIn shown code, matrix object moves horizontally shown in animation.
Being, described Dynamic Graph includes that canvas element, described canvas element include that the painting canvas of canvas object and correspondence thereof belongs toProperty value, described Dynamic Graph also includes graphic element, and described graphic element is based on described canvas object, by described painting canvas attributeValue defines the equivalent and contained graphic element of length and width shape attribute of described canvas object performance shape in described canvas objectFormula, such as the position relationship etc. between each graphic element.Described graphic element includes Drawing Object and graph of a correspondence object thereofAnd graph of a correspondence property value, described Dynamic Graph also includes in animated element, each described animated element and described Dynamic GraphThe Drawing Object of a graphic element there is membership, described animated element based on the Drawing Object that it is affiliated, byDescribed graphic attribute value define the horizontal displacement dynamic value of its graph of a correspondence object, the left side away from, top margin, width and height etc.And the form of expression that contained animated element is in described Drawing Object, as in described Drawing Object between each animated elementPosition relationship etc..Described animated element includes the animation attributes value of animation object and correspondence thereof, described animation attributes value defineThe property values such as the position of described animation object, size.
Wherein, the analysis result in described step 101 is, the canvas object in the described Dynamic Graph got and picture thereofDrawing Object in cloth property value, described canvas object and graphic attribute value thereof, animation object in described image object andAnimation attributes value.
Step 102: according to the analysis result of described canvas element, graphic element and animated element, set up XML data formatNode tree, each element in described Dynamic Graph is represented with the form of described node tree.
Wherein, described step 102 is the process that described dynamic diagram sequences turns to the text of XML data format.DescribedAfter step 102 has performed, described Dynamic Graph with the text representation figure of XML data format and dynamically, by Dynamic Graph painting canvasThe variable associated in the rendering parameter of Drawing Object such as length, width and coordinate etc., dynamic effect in object and the value of variableCorresponding dynamic parameter preserves to XML file, reaches to represent the purpose of exclusive data with general format.
From in such scheme, in a kind of Dynamic Graph processing method embodiment one that the application provides, by by dynamicallyEach element in figure represents with the node tree form of XML data format, and the data of XML data format can be answered by universalRead with software, described Dynamic Graph is follow-up store after, can not only be carried out conveniently by multiple Dynamic Graph application softwareRead, and without resolving any configuration file etc., add the range of application of Dynamic Graph, and improve the reading that Dynamic Graph readsTake efficiency.
With reference to Fig. 2, for the flow process of step 102 described in a kind of Dynamic Graph processing method embodiment two that the application providesFigure, described step 102, when setting up the node tree of XML data format, may comprise steps of realization:
Step 201: the painting canvas property value of described canvas object and correspondence thereof is carried out the conversion of XML data format, by instituteState the transformation result root node as described node tree of canvas object, using the transformation result of described painting canvas property value as describedThe slave node of root node.
Wherein, the execution result of described step 201 is: set up the root node in described node tree and painting canvas property value pairThe slave node answered, as shown in Figure 3.
Step 202: described Drawing Object and graph of a correspondence property value thereof are carried out the conversion of XML data format, by instituteState the transformation result slave node as described root node of Drawing Object, the transformation result of graphic attribute value is corresponding as itThe slave node of Drawing Object node.
Wherein, the execution result of described step 102 is: set up the Drawing Object pair in canvas object in described node treeThe node answered, as the slave node of root node, and sets up the node of described graphic attribute value, corresponding as this graphic attribute valueThe slave node of Drawing Object node, as shown in Figure 3.
Step 203: the animation attributes value of described animation object and correspondence thereof is carried out the conversion of XML data format, by instituteState the transformation result of animation object as the slave node of Drawing Object node belonging to it, by the Change-over knot of described animation attributes valueFruit is as the slave node of animation Object node belonging to it.
Wherein, the execution result of described step 203 is: set up the animation pair in each Drawing Object in described node treeAs corresponding node, as the slave node of Drawing Object node belonging to it, and set up the node of described animation attributes value, asThe slave node of this animation attributes value correspondence animation Object node, as shown in Figure 3.
It should be noted that during the execution of described step 201 to described step 203 it can be understood as:
Initially set up the root node that described canvas object is corresponding, and set up the joint that each described painting canvas property value is corresponding successivelyPoint, as the slave node of described root node, is melted into XML data format by the root node having built up and slave node sequence thereofText preserve;
Secondly, travel through each described Drawing Object in described canvas object successively, set up each described Drawing Object pairThe node answered, as the slave node of described root node, travels through the graphic attribute value of each described Drawing Object, sets up each instituteState the node that graphic attribute value is corresponding, as the slave node of this graphic attribute value correspondence figure Object node, the figure that will set upThe text of the node of shape object and slave node sequence chemical conversion XML data format thereof preserves;
Again, travel through each described animation object in described Drawing Object successively, set up each described animation object pairThe node answered, as the slave node of Drawing Object node belonging to it, travels through the animation attributes value of each described animation object, buildsThe node that vertical each described animation attributes value is corresponding, as the slave node of this animation attributes value object animation Object node, willThe text of the node of the animation object set up and slave node sequence chemical conversion XML data format thereof preserves.
That is, in described step 102 when setting up the node tree of XML data format, foundation can be layered successively by root nodeEach slave node layer, it is also possible to by root node, the root node with the slave node of described root node as subtree is built successivelyVertical subtree, such as, after setting up root node, set up the subtree with each Drawing Object node as root node successively, final withHereinbefore reach identical purpose, complete the foundation to node tree.
It should be noted that described step 102 is when setting up described node tree, can be layered successively by canvas elementContribute, it is also possible to by canvas element, successively each graphic element and animated element thereof are contribute.In Fig. 3, by savingThe root node of some tree starts to set up to lower leaf, or starts to build to making from left to right or from the right side by the root node of node treeVertical.It is below the partial code example in the embodiment of the present application after the conversion of a certain Drawing Object:
<object ObjectType=" INDEX_RECT ">// canvas object INDEX_RECT "
<objectName xml:space=“preserve”>rECT1</ObjectName>// Drawing Object RECT1
<left>-3</Left>// left position-3
<top>-1</Top>// peak-1+1
<width>1280</Width>// width 1280
<height>133</Height>// highly 133
<visible>true</Visible>// visible
<layer>0</Layer>// 0+1 layer
<rotateCenterX>637.000000</RotateCenterX>//X-coordinate 637
<rotateCenterY>65.500000</RotateCenterY>//Y coordinate 65.5
<gradientColor>16777215,12632064</GradientColor>gradient color gamut
<gradientStyle>gsVCENTER_121</GradientStyle>//Gradient model codegsVCENTER_121
<gradientStep>8</GradientStep>gradient grade 8
<backgroundColor>12632064</BackgroundColor>// background color code 12632064
<backgroundStyle>bgSOLIDFILL</BackgroundStyle>// backstyle codebgSOLIDFILL
<issemiTransparent>false</IssemiTransparent>// non-the superlative degree
<edgeColor>0</EdgeColor>// rib color value 0
<edgeStyle>esNOLINE</EdgeStyle>// rib pattern
<edgeWidth>1</EdgeWidth>// rib is wide by 1
<nodeList>(-3 ,-1), (-3,132), (1277,132), (1277 ,-1)</NodeList>// node coordinate
<nodeListFormat xml:space=“preserve”>13, true</NodeListFormat>// nodeList framework
</object>
It is below the partial code example in the embodiment of the present application after the conversion of a certain Dynamic Graph:
It addition, can also include composite figure element in described Dynamic Graph, described composite figure element includes constitutional diagramThe composite attribute value of shape object and correspondence thereof, described Dynamic Graph also includes composite figure daughter element, described composite figure daughter elementShow based on described composite figure object, described composite attribute value define the shape attribute etc. of described composite figure objectValue and the contained composite figure daughter element form of expression in described composite figure object, as each composite figure daughter element itBetween position relationship etc..Described composite figure daughter element includes the composite figure property value of composite figure subobject and correspondence thereof(described composite figure subobject Drawing Object as described previously can be the object of similar structures, in the embodiment of the present applicationIn be distinguish between with different titles), described Dynamic Graph also includes combined animation daughter element, and described combined animation daughter element is with instituteShow, by the shape attribute of composite figure subobject described in described composite figure attribute definition based on stating composite figure subobjectEquivalence, as horizontal displacement dynamic value, the left side away from, top margin, width etc., and contained combined animation daughter element is at described constitutional diagramForm of expression property value in shape subobject, such as the position relationship etc. between each combined animation daughter element.Described combined animationDaughter element includes the combined animation property value of combined animation subobject and correspondence thereof, described in described combined animation attribute value definitionThe property values such as the position of combined animation subobject, size.
Thus, described method can also include:
Set up composite figure element described in described node tree, composite figure daughter element and combined animation daughter element the most rightThe node answered, particularly as follows:
The composite attribute value of described composite figure object and correspondence thereof is carried out XML data format conversion, by described combinationThe transformation result of Drawing Object is as the slave node of described root node, using right as it for the transformation result of described composite attribute valueAnswer the slave node of composite figure Object node;
Composite figure property value to described composite figure subobject and correspondence thereof carries out the conversion of XML data format, willThe transformation result of described composite figure subobject is as the slave node of its corresponding composite figure Object node, by described constitutional diagramThe transformation result of shape property value is as the slave node of the composite figure subobject node of its correspondence;
Combined animation property value to described combined animation subobject and correspondence thereof carries out the conversion of XML data format, willThe transformation result of described combined animation subobject is as the slave node of composite figure subobject node belonging to it, by described combinationThe transformation result of animation attributes value is as the slave node of the combined animation subobject node of its correspondence.
It should be noted that the above-mentioned process of composite figure object corresponding node described in described node tree of setting up is with aboveThe middle process setting up node tree is similar to, and is not described in detail at this.
In actual applications, outside the Dynamic Announce contents processing above two content combination of described Dynamic Graph, it is also possible toHaving herein below to combine, e.g., described Dynamic Graph includes described canvas element, described composite figure element, described composite figureOutside daughter element and combined animation daughter element, described graphic element and described animated element can not be included, and with foregoingThe described Dynamic Graph that compound mode exists, when setting up described node tree, can initially set up described painting canvas as being hereinbefore similar toRoot node that in element, canvas object is corresponding and slave node corresponding to the painting canvas property value of correspondence thereof, the most again according to the applicationIt is corresponding with combined animation daughter element that content in embodiment two sets up described composite figure element, described composite figure daughter elementNode.Detailed process, with similar, does not repeats them here.
With reference to Fig. 4, for the flow chart of a kind of Dynamic Graph processing method embodiment three that the application provides, described method is suitable forIn the application that the motion graphics being in Dynamic Announce is processed, in the embodiment of the present application, with to described Dynamic GraphAs a example by reading, described Dynamic Graph is presented in described node tree, and described node tree includes the node of XML data format, instituteThe method of stating may comprise steps of:
Step 401: travel through the node in described node tree.
Wherein, described node tree exists with the text of XML data format, and the node in described node tree includes describedThe node that in Dynamic Graph, canvas element corresponding node, graphic element Object node and animated element are corresponding.
Step 402: according to each node in described node tree, reduces described Dynamic Graph;
Wherein, described step 402 is the inverse process of step 102 described above, to the node tree of described Dynamic GraphUnserializing process, it is also possible to be understood as, carries out the text of XML data format object data and is converted to the dynamic of Dynamic AnnounceThe process of state figure.
From such scheme, a kind of Dynamic Graph processing method embodiment three that the application provides, will be with XML data formatThe node tree that exists of text be reduced into the Dynamic Graph of Dynamic Announce, it is not necessary to configuration file is parsed by prior artJourney, improves the reading efficiency that Dynamic Graph reads.
It should be noted that in described step 402, can carry out being reduced into correspondence successively to each node traversedDynamic Graph in element, such as canvas element, graphic element, animated element etc., and then obtain the Dynamic Graph of reduction.
With reference to Fig. 5, for the flow process of step 402 described in a kind of Dynamic Graph processing method embodiment four that the application providesFigure, described step 402 is reduced described Dynamic Graph time can be realized by following steps:
Step 501: the root node in described node tree is carried out the conversion of object data format, turning described root nodeChange the result canvas object as described Dynamic Graph.
Step 502: the slave node of described canvas object node is carried out the conversion of object data format, by described painting canvasIn the slave node of Object node, the transformation result of image object node is as the Drawing Object in described canvas object, by describedIn the slave node of canvas object node, the transformation result of painting canvas property value node belongs to as the painting canvas that described canvas object is correspondingProperty value;
Step 503: the slave node of described image object node is carried out the conversion of object data format, by described figureIn the slave node of Object node, the transformation result of animation Object node is as the animation object in Drawing Object belonging to it, by instituteState the transformation result of graphic attribute value node in the slave node of Drawing Object node as figure corresponding to Drawing Object belonging to itShape property value;
Step 504: the slave node of described animation Object node is carried out the conversion of object data format, by described animationThe transformation result of the slave node of Object node is as animation attributes value corresponding to animation object belonging to it.
As shown in Figure 6, for the exemplary plot in described step 401 to described step 402.
It should be noted that described step 402 is when reducing described Dynamic Graph, can be layered successively by canvas elementReduction, it is also possible to by canvas element, successively each graphic element and animated element thereof are reduced.In Fig. 3, by savingThe root node of some tree starts to reduce to lower leaf, or from left to right or starts to go back from the right side to work by the root node of node treeFormer.
It addition, described node tree can also include composite figure element, composite figure daughter element, combined animation daughter elementEach self-corresponding node, therefore, described method can also include:
Reduce the composite figure element in described Dynamic Graph, composite figure daughter element, combined animation daughter element, particularly as follows:
Slave node to described canvas object node carries out the conversion of object data format, by described canvas object nodeSlave node in the transformation result of composite figure Object node as the composite figure object in described canvas object;
Slave node to described composite figure Object node carries out the conversion of object data format, by described composite figureIn the slave node of Object node, the transformation result of combination image subobject node is as the combination in described composite figure objectFigure subobject, using the transformation result of composite attribute value node in the slave node of described composite figure Object node as describedThe composite attribute value that composite figure object is corresponding;
Slave node to described combination image subobject node carries out the conversion of object data format, by described constitutional diagramIn the slave node of shape subobject node, the transformation result of combined animation subobject node is as composite figure subobject belonging to itIn combined animation subobject, by the slave node of described composite figure subobject node composite figure property value node turnChange result as composite figure property value corresponding to composite figure subobject belonging to it;
Slave node to described combined animation subobject node carries out the conversion of object data format, described combination is movedDraw the transformation result of slave node of subobject node as combined animation property value corresponding to combined animation subobject belonging to it.
After reduction completes, described Dynamic Graph can also include composite figure element, in described composite figure elementIncluding the composite attribute value of composite figure object and correspondence thereof, described Dynamic Graph also includes composite figure daughter element, described combinationFigure daughter element shows based on described composite figure object, described composite attribute value define described composite figure objectThe shape attribute equivalent and contained composite figure daughter element form of expression in described composite figure object, such as each constitutional diagramPosition relationship etc. between shape daughter element.Described composite figure daughter element includes the constitutional diagram of composite figure subobject and correspondence thereof(described composite figure subobject Drawing Object as described previously can be the object of similar structures to shape property value, in this ShenEmbodiment please be distinguish between with different titles), described Dynamic Graph also includes combined animation daughter element, described combined animationElement shows based on described composite figure subobject, by composite figure subobject described in described composite figure attribute definitionShape attribute is equivalent, as horizontal displacement dynamic value, the left side away from, top margin, width etc., and contained combined animation daughter element is in instituteState the form of expression property value in composite figure subobject, such as the position relationship etc. between each combined animation daughter element.DescribedCombined animation daughter element includes the combined animation property value of combined animation subobject and correspondence thereof, by described combined animation property valueDefine the property values such as the position of described combined animation subobject, size.
It should be noted that composite figure element, composite figure daughter element, combination described in the described Dynamic Graph of above-mentioned reductionThe process of animation daughter element, with hereinbefore to reduce the process of Dynamic Graph similar, is not described in detail at this.
In actual applications, outside the Dynamic Announce contents processing above two content combination of described Dynamic Graph, it is also possible toHaving herein below to combine, e.g., described Dynamic Graph includes described canvas element, described composite figure element, described composite figureOutside daughter element and combined animation daughter element, described graphic element and described animated element can not be included, and with foregoingThe described Dynamic Graph that compound mode exists,
When reducing described Dynamic Graph, can first reduce the picture of described canvas element and correspondence thereof as being hereinbefore similar toCloth property value, afterwards, then according to the content described composite figure element of reduction in the embodiment of the present application four, described composite figureElement and combined animation daughter element, detailed process, with similar, does not repeats them here.
With reference to Fig. 7, for the structural representation of a kind of Dynamic Graph processing means embodiment five that the application provides, described deviceBe applicable to the application that the motion graphics being in Dynamic Announce is processed, in the embodiment of the present application, with to described dynamicallyAs a example by the preservation of figure, described Dynamic Graph includes that canvas element, graphic element and animated element, described device may include that
Element resolution unit 701, for resolving canvas element, graphic element and the animation unit comprised in described Dynamic GraphElement.
Wherein, as described in the text, described Dynamic Graph is in the presence of Dynamic Announce state, based on painting canvas, and described pictureIt is provided with figure on cloth, figure is provided with animation.The dynamic effect of the figure of described Dynamic Graph is realized by the value of variable, asThe dynamical state (position or color value etc.) that the title of variable, minima, maximum and minima are corresponding with maximum, exampleAs, Drawing Object Rect1 comprises the dynamic of horizontal displacement, the left side of this Drawing Object when the minima of variable OPCTAG2 is 0Position is 20, and when OPCTAG2 reaches maximum 100, the left position of Drawing Object is 420, the most front specific to physical recordIn literary composition, matrix object moves horizontally shown in animation code.Being, described Dynamic Graph includes canvas element, described canvas element bagIncluding the painting canvas property value of canvas object and correspondence thereof, described Dynamic Graph also includes graphic element, and described graphic element is with described pictureBased on cloth object, by the equivalent and contained figure of length and width shape attribute of canvas object described in described painting canvas attribute value definitionThe element form of expression in described canvas object, such as the position relationship etc. between each graphic element.Described graphic element bagIncluding Drawing Object and graph of a correspondence object thereof and graph of a correspondence property value thereof, described Dynamic Graph also includes animated element, oftenIndividual described animated element has membership, described animated element with the Drawing Object of a graphic element in described Dynamic GraphBased on the Drawing Object that it is affiliated, described graphic attribute value the horizontal displacement defining its graph of a correspondence object is dynamicValue, the left side away from, top margin, width and height etc. and the contained animated element form of expression in described Drawing Object, such as instituteState the position relationship etc. between each animated element in Drawing Object.Described animated element includes the dynamic of animation object and correspondence thereofDraw property value, described animation attributes value define the property values such as the position of described animation object, size.
Wherein, the analysis result in described element resolution unit 701 is, the painting canvas pair in the described Dynamic Graph gotAs and painting canvas property value, described canvas object in Drawing Object and graphic attribute value, the animation in described image objectObject and animation attributes value thereof.
Node tree sets up unit 702, for according to described canvas element, graphic element and animated element, sets up XML dataThe nodes of form, represents each element in described Dynamic Graph with the form of described node tree node;
Wherein:
Described canvas element includes the painting canvas property value of canvas object and correspondence thereof;
Described graphic element includes Drawing Object and graph of a correspondence property value thereof;
Described animated element includes the animation attributes value of animation object and correspondence thereof.
Wherein, described node tree sets up the running of unit 702, is described dynamic diagram sequences and turns to XML data latticeThe process of the text of formula.Setting up after unit 702 run at described node tree, described Dynamic Graph is with XML data formatText representation figure, with dynamically, by the rendering parameter of Drawing Object in Dynamic Graph canvas object such as length, width and coordinate etc., movesIn state effect, the variable of association and dynamic parameter corresponding to the value of variable preserve to XML file, reach with general format tableShow the purpose of exclusive data.
From in such scheme, in a kind of Dynamic Graph processing means embodiment five that the application provides, by by dynamicallyEach element in figure represents with the node tree form of XML data format, and the data of XML data format can be answered by universalRead with software, described Dynamic Graph is follow-up store after, can not only be carried out conveniently by multiple Dynamic Graph application softwareRead, and without resolving any configuration file etc., add the range of application of Dynamic Graph, and improve the reading that Dynamic Graph readsTake efficiency.
With reference to Fig. 8, set up unit for node tree described in a kind of Dynamic Graph processing means embodiment six that the application providesThe structural representation of 702, wherein, described node tree is set up unit and be may include that
Primary nodal point conversion subelement 721, for carrying out XML number to the painting canvas property value of described canvas object and correspondence thereofAccording to the conversion of form, using the transformation result of described canvas object as the root node of described node tree, by described painting canvas property valueTransformation result as the slave node of described root node.
Wherein, the operation result of described primary nodal point conversion subelement 721 is: set up the root node in described node treeAnd the slave node that painting canvas property value is corresponding, as shown in Figure 3.
Secondary nodal point conversion subelement 722, for carrying out XML number to described Drawing Object and graph of a correspondence property value thereofAccording to the conversion of form, using the transformation result of described Drawing Object as the slave node of described root node, by described graphic attributeThe transformation result of value is as the slave node of its graph of a correspondence Object node.
Wherein, the operation result of described secondary nodal point conversion subelement 722 is: set up canvas object in described node treeIn node corresponding to Drawing Object, as the slave node of root node, and set up the node of described graphic attribute value, as thisThe slave node of graphic attribute value correspondence figure Object node, as shown in Figure 3.
3rd node conversion subelement 723, for carrying out XML number to the animation attributes value of described animation object and correspondence thereofAccording to the conversion of form, using the transformation result of described animation object as the slave node of Drawing Object node belonging to it, by describedThe transformation result of animation attributes value is as the slave node of animation Object node it described.
Wherein, the operation result of described 3rd node conversion subelement 723 is: set up each figure in described node treeThe node that animation object in object is corresponding, as the slave node of Drawing Object node belonging to it, and sets up described animation and belongs toThe node of property value, as the slave node of this animation attributes value correspondence animation Object node, as shown in Figure 3.
It should be noted that at described primary nodal point conversion subelement 721 to described 3rd node conversion subelement 723In running it can be understood as:
Initially set up the root node that described canvas object is corresponding, and set up the joint that each described painting canvas property value is corresponding successivelyPoint, as the slave node of described root node, is melted into XML data format by the root node having built up and slave node sequence thereofText preserve;
Secondly, travel through each described Drawing Object in described canvas object successively, set up each described Drawing Object pairThe node answered, as the slave node of described root node, travels through the graphic attribute value of each described Drawing Object, sets up each instituteState the node that graphic attribute value is corresponding, as the slave node of this graphic attribute value correspondence figure Object node, the figure that will set upThe text of the node of shape object and slave node sequence chemical conversion XML data format thereof preserves;
Again, travel through each described animation object in described Drawing Object successively, set up each described animation object pairThe node answered, as the slave node of Drawing Object node belonging to it, travels through the animation attributes value of each described animation object, buildsThe node that vertical each described animation attributes value is corresponding, as the slave node of this animation attributes value object animation Object node, willThe text of the node of the animation object set up and slave node sequence chemical conversion XML data format thereof preserves.
That is, described node tree sets up unit 702 when setting up the node tree of XML data format, can by root node successivelyEach slave node layer is set up in layering, it is also possible to by root node, successively with the slave node of described root node as subtreeRoot node sets up subtree, such as, after setting up root node, set up the son with each Drawing Object node as root node successivelyTree, finally and hereinbefore reaches identical purpose, completes the foundation to node tree.
It should be noted that described node tree sets up unit 702 when setting up described node tree, can be opened by canvas elementBegin to be layered achievement successively, it is also possible to by canvas element, successively each graphic element and animated element thereof are contribute.AsIn Fig. 3, set up to lower leaf by the root node of node tree, or by the root node of node tree from left to right or from the right side toBegin setting up.
It addition, can also include composite figure element in described Dynamic Graph, described composite figure element includes constitutional diagramThe composite attribute value of shape object and correspondence thereof, described Dynamic Graph also includes composite figure daughter element, described composite figure daughter elementShow based on described composite figure object, described composite attribute value define the shape attribute etc. of described composite figure objectValue and the contained composite figure daughter element form of expression in described composite figure object, as each composite figure daughter element itBetween position relationship etc..Described composite figure daughter element includes the composite figure property value of composite figure subobject and correspondence thereof(described composite figure subobject Drawing Object as described previously can be the object of similar structures, in the embodiment of the present applicationIn be distinguish between with different titles), described Dynamic Graph also includes combined animation daughter element, and described combined animation daughter element is with instituteShow, by the shape attribute of composite figure subobject described in described composite figure attribute definition based on stating composite figure subobjectEquivalence, as horizontal displacement dynamic value, the left side away from, top margin, width etc., and contained combined animation daughter element is at described constitutional diagramForm of expression property value in shape subobject, such as the position relationship etc. between each combined animation daughter element.Described combined animationDaughter element includes the combined animation property value of combined animation subobject and correspondence thereof, described in described combined animation attribute value definitionThe property values such as the position of combined animation subobject, size.
Thus, as it is shown in figure 9, be another part structural representation of the embodiment of the present application six, described node tree is set up singleUnit 702 can also include:
Fourth node conversion subelement 724, for carrying out the composite attribute value of described composite figure object and correspondence thereofXML data format is changed, using the transformation result of described composite figure object as the slave node of described root node, by described groupClose the transformation result slave node as its corresponding composite figure Object node of property value;
5th node conversion subelement 725, for described composite figure subobject and the composite figure attribute of correspondence thereofValue carries out the conversion of XML data format, using the transformation result of described composite figure subobject as its corresponding composite figure objectThe slave node of node, using the transformation result of described composite figure property value as the composite figure subobject node of its correspondenceSlave node;
6th node conversion subelement 726, for described combined animation subobject and the combined animation attribute of correspondence thereofValue carries out the conversion of XML data format, and the transformation result of described combined animation subobject is right as composite figure belonging to itAs the slave node of node, using the transformation result of described combined animation property value as the combined animation subobject node of its correspondenceSlave node.
It should be noted that the above-mentioned process of composite figure object corresponding node described in described node tree of setting up is with aboveThe middle process setting up node tree is similar to, and is not described in detail at this.
In actual applications, outside the Dynamic Announce contents processing above two content combination of described Dynamic Graph, it is also possible toHaving herein below to combine, e.g., described Dynamic Graph includes described canvas element, described composite figure element, described composite figureOutside daughter element and combined animation daughter element, described graphic element and described animated element can not be included, and with foregoingCompound mode exist described Dynamic Graph, described node tree set up unit 702 set up described node tree time, can be as hereinbeforeSimilar, initially set up the subordinate that the painting canvas property value of root node that in described canvas element, canvas object is corresponding and correspondence thereof is correspondingNode, sets up described composite figure element, described composite figure daughter element according to the content in the embodiment of the present application six the most againThe node corresponding with combined animation daughter element.Detailed process, with similar, does not repeats them here.
With reference to Figure 10, for the structural representation of a kind of Dynamic Graph processing means embodiment seven that the application provides, described sideMethod is be applicable to the application processing the motion graphics being in Dynamic Announce, in the embodiment of the present application, with to described dynamicAs a example by the reading of state figure, described Dynamic Graph is presented in described node tree, and described node tree includes the joint of XML data formatPoint, described device includes:
Node traverses unit 1001, for traveling through the node in described node tree.
Wherein, described node tree exists with the text of XML data format, and the node in described node tree includes describedThe node that in Dynamic Graph, canvas element corresponding node, graphic element Object node and animated element are corresponding.
Dynamic Graph reduction unit 1002, for according to each node in described node tree, reduces described Dynamic Graph;
Wherein:
Described Dynamic Graph includes canvas element, graphic element, animated element;
Described canvas element includes the painting canvas property value of canvas object and correspondence thereof;
Described graphic element includes Drawing Object and graph of a correspondence property value thereof;
Described animated element includes the animation attributes value of animation object and correspondence thereof.
Wherein, described Dynamic Graph reduction unit 1002 is node tree described above and sets up the inverse process of unit 702, rightThe unserializing process of the node tree of described Dynamic Graph, it is also possible to be understood as, carries out object data by the text of XML data formatIt is converted to the process of the Dynamic Graph of Dynamic Announce.
From such scheme, a kind of Dynamic Graph processing means embodiment seven that the application provides, will be with XML data formatThe node tree that exists of text be reduced into the Dynamic Graph of Dynamic Announce, it is not necessary to configuration file is parsed by prior artJourney, improves the reading efficiency that Dynamic Graph reads.
With reference to Figure 11, for Dynamic Graph reduction unit described in a kind of Dynamic Graph processing means embodiment eight that the application providesThe structural representation of 1002, described Dynamic Graph reduction unit 1002 includes:
First goes back atomic unit 1021, for the root node in described node tree being carried out the conversion of object data format,Using the transformation result of described root node as the canvas object of described Dynamic Graph.
Second goes back atomic unit 1022, for the slave node of described canvas object node is carried out object data formatConversion, using the transformation result of image object node in the slave node of described canvas object node as in described canvas objectDrawing Object, using the transformation result of painting canvas property value node in the slave node of described canvas object node as described painting canvas pairAs corresponding painting canvas property value.
3rd goes back atomic unit 1023, for the slave node of described image object node is carried out object data formatConversion, using the transformation result of animation Object node in the slave node of described Drawing Object node as in Drawing Object belonging to itAnimation object, using the transformation result of graphic attribute value node in the slave node of described Drawing Object node as belonging to it schemeShape object graph of a correspondence property value.
4th goes back atomic unit 1024, for the slave node of described animation Object node is carried out object data formatConversion, using the transformation result of the slave node of described animation Object node as animation attributes corresponding to animation object belonging to itValue.
As shown in Figure 6, go back atomic unit 1021 for described first and go back the example in atomic unit 1024 to the described 4thFigure.
It should be noted that described Dynamic Graph reduction unit 1002 is when reducing described Dynamic Graph, can be by canvas elementStart to be layered reduction successively, it is also possible to by canvas element, successively each graphic element and animated element thereof are reduced.In Fig. 3, reduce to lower leaf by the root node of node tree, or from left to right or from the right side by the root node of node treeReduction is started to work.
It addition, described Dynamic Graph also includes composite figure element, composite figure daughter element and combined animation daughter element, because ofThis, with reference to Figure 12, for the structural representation of Dynamic Graph reduction unit 1002 described in the embodiment of the present application eight, described Dynamic Graph is alsoFormer unit 1002 can also include:
5th goes back atomic unit 1025, for the slave node of described canvas object node is carried out object data formatConversion, using the transformation result of composite figure Object node in the slave node of described canvas object node as described canvas objectIn composite figure object;
6th goes back atomic unit 1026, for the slave node of described composite figure Object node is carried out object data latticeThe conversion of formula, using the transformation result of combination image subobject node in the slave node of described composite figure Object node as instituteState the composite figure subobject in composite figure object, by composite attribute value in the slave node of described composite figure Object nodeThe transformation result of node is as composite attribute value corresponding to described composite figure object;
7th goes back atomic unit 1027, for the slave node of described combination image subobject node is carried out object dataThe conversion of form, makees the transformation result of combined animation subobject node in the slave node of described composite figure subobject nodeCombined animation subobject in composite figure subobject belonging to it, by the slave node of described composite figure subobject nodeThe transformation result of composite figure property value node is as composite figure property value corresponding to composite figure subobject belonging to it;
8th goes back atomic unit 1028, for the slave node of described combined animation subobject node is carried out object dataThe conversion of form, using right as combined animation belonging to it for the transformation result of the slave node of described combined animation subobject nodeAs corresponding combined animation property value.
After reduction completes, described Dynamic Graph can also include composite figure element, in described composite figure elementIncluding the composite attribute value of composite figure object and correspondence thereof, described Dynamic Graph also includes composite figure daughter element, described combinationFigure daughter element shows based on described composite figure object, described composite attribute value define described composite figure objectThe shape attribute equivalent and contained composite figure daughter element form of expression in described composite figure object, such as each constitutional diagramPosition relationship etc. between shape daughter element.Described composite figure daughter element includes the constitutional diagram of composite figure subobject and correspondence thereof(described composite figure subobject Drawing Object as described previously can be the object of similar structures to shape property value, in this ShenEmbodiment please be distinguish between with different titles), described Dynamic Graph also includes combined animation daughter element, described combined animationElement shows based on described composite figure subobject, by composite figure subobject described in described composite figure attribute definitionShape attribute is equivalent, as horizontal displacement dynamic value, the left side away from, top margin, width etc., and contained combined animation daughter element is in instituteState the form of expression property value in composite figure subobject, such as the position relationship etc. between each combined animation daughter element.DescribedCombined animation daughter element includes the combined animation property value of combined animation subobject and correspondence thereof, by described combined animation property valueDefine the property values such as the position of described combined animation subobject, size.
It should be noted that composite figure element, composite figure daughter element, combination described in the described Dynamic Graph of above-mentioned reductionThe process of animation daughter element, with hereinbefore to reduce the process of Dynamic Graph similar, is not described in detail at this.
In actual applications, outside the Dynamic Announce contents processing above two content combination of described Dynamic Graph, it is also possible toHaving herein below to combine, e.g., described Dynamic Graph includes described canvas element, described composite figure element, described composite figureOutside daughter element and combined animation daughter element, described graphic element and described animated element can not be included, and with foregoingThe described Dynamic Graph that compound mode exists,
When reducing described Dynamic Graph, can first reduce the picture of described canvas element and correspondence thereof as being hereinbefore similar toCloth property value, afterwards, then according to the content described composite figure element of reduction in the embodiment of the present application eight, described composite figureElement and combined animation daughter element, detailed process, with similar, does not repeats them here.
It should be noted that each embodiment in this specification all uses the mode gone forward one by one to describe, each embodiment weightPoint explanation is all the difference with other embodiments, and between each embodiment, identical similar part sees mutually.
Finally, in addition it is also necessary to explanation, in this article, the relational terms of such as first and second or the like be used merely to byOne entity or operation separate with another entity or operating space, and not necessarily require or imply these entities or operationBetween exist any this reality relation or order.And, term " includes ", " comprising " or its any other variant meaningContaining comprising of nonexcludability, so that include that the process of a series of key element, method, article or equipment not only include thatA little key elements, but also include other key elements being not expressly set out, or also include for this process, method, article orThe key element that equipment is intrinsic.In the case of there is no more restriction, statement " including ... " key element limited, do not arrangeExcept there is also other identical element in including the process of described key element, method, article or equipment.
Above a kind of Dynamic Graph processing method and processing device provided by the present invention is described in detail, used hereinPrinciple and the embodiment of the present invention are set forth by specific case, and the explanation of above example is only intended to help to understandThe method of the present invention and core concept thereof;Simultaneously for one of ordinary skill in the art, according to the thought of the present invention, at toolAll will change on body embodiment and range of application, in sum, this specification content should not be construed as the applicationRestriction.