Summary of the invention
The objective of the invention is to share the defective that the aspect exists, the dot-form map symbol model based on the path is provided, as the shared basis of the point symbol between GIS, CAD, professional graphics software at existing dot-form map symbol.Another goal of the invention of the present invention provides a kind of shared method of dot-form map symbol, at same symbolic library, uses for different CAD and GIS platform respectively, realizes sharing and play up fast dot-form map symbol.
The present invention for a technical scheme that solves its technical matters employing is:
Based on the dot-form map symbol model (hereinafter to be referred as VGE point symbol model) in path, this model is made up of dot-form map symbol data model and dot-form map symbol renderer.
Described dot-form map symbol data model comprises point symbol, and point symbol comprises vector point symbol, grid point symbol and chart point symbol; The vector point symbol is made of path, stroke and filling, and wherein, stroke has write down path indexing and stroke correlation parameter, as color, texture, width, vertical misalignment and drawing order etc.; Filling has been write down path indexing and has been filled correlation parameter, as the point symbol of color, pattern, texture, filling, the line symbol of filling etc.
Described dot-form map symbol renderer is made up of stroke process device, filling processor and three interfaces of path conversion.
The technical scheme that realizes another goal of the invention of the present invention is: the dot-form map symbol based on VGE point symbol model is shared method, comprises point symbol data sharing method and function sharing method.
Described data sharing method comprises dot-form map symbol assimilation and dot-form map symbol XML exchange.Described dot-form map symbol assimilation is based on VGE point symbol model, assimilates dot-form map symbol in present main flow CAD, the GIS software platform.Described dot-form map symbol XML exchange is that the point symbol data based on the VGE symbolic model are carried out the symbol exchange, shared by the XML form, comprises point symbol data that import the commutative form of XML and the point symbol data that derive the commutative form of XML.
Described function sharing method comprises dot-form map symbol monitoring and dot-form map symbol replacement, can be divided into dual mode: a kind of in operating system during the corresponding GIS running software of monitoring point symbol play up the drawing for order that calls, and it is replaced with the instruction of playing up of VGE dot-form map symbol; Another kind is that mode with com is with the VGE dot-form map symbol and play up and extend on the corresponding GIS platform.
Advantage of the present invention is: the dot-form map symbol data are separated with playing up, and aspect symbol data, can assimilate the point symbol of making in main flow CAD, GIS, the professional graphics software, support the design of complicated point symbol, cartoon characters, support texture to fill; Aspect symbol plays up, can and play up the VGE point symbol and extend on the corresponding GIS software platform, thereby realize that the point symbol between GIS, CAD, professional graphics software shares, realize " use more in a storehouse " of Spot Map Symbol Base.
Embodiment
Below in conjunction with drawings and Examples the present invention is described in further details.
Embodiment 1
VGE point symbol model provided by the invention, model are played up the two large divisions by dot-form map symbol data model and map symbol and are formed.Wherein:
As shown in Figure 1, dot-form map symbol data model: point symbol comprises vector point symbol, grid point symbol and chart point symbol.The vector point symbol is made of path, stroke, filling, and wherein, stroke is made of section, and section is divided into four kinds in straight line, arc, bezier, SPL.Stroke has write down path indexing and stroke correlation parameter, as color, texture, width, vertical misalignment and drawing order etc.; Filling has been write down path indexing and has been filled correlation parameter, as the point symbol of color, pattern, texture, filling, the line symbol of filling etc.
We have defined a PointSymbol class, and following functions are provided:
①GetArraySize(int?*?size)
Be used for obtaining complete all members' of dot-form map symbol memory size, parameter s ize is the memory address of dot-form map symbol size.
②GetArray(BYTE?*?buffer)
Be used for obtaining complete all members' of dot-form map symbol internal memory record, parameter b uffer is the memory address of dot-form map symbol content.
③GetFillCount(int?*?c)
Be used for obtaining the number of complete all fillings of dot-form map symbol, parameter c is the memory address of filling a number variable in the dot-form map symbol.
④GetFill(int?ID)
Be used for obtaining the full detail (color, texture, fill pattern, interval etc.) of complete certain filling of dot-form map symbol, parameter I D is the unique identifying number of filling in the dot-form map symbol.
⑤GetFillOutline(Stroke?*?s)
Be used for obtaining the profile information (color, texture, fill pattern, interval etc.) of complete certain filling of dot-form map symbol, parameter s is the memory address of filling profile in the dot-form map symbol.
⑥GetStrokeCount(int?*?c)
Be used for obtaining the number of all strokes of complete dot-form map symbol, parameter c is the memory address of a stroke number variable in the linear map symbol.
⑦GetStroke(int?ID)
Be used for obtaining the full detail (color, texture, width, side-play amount, actual situation pattern etc.) of complete certain stroke of dot-form map symbol, parameter I D is the unique identifying number of stroke in the dot-form map symbol.
Dot-form map symbol is played up: the VGE symbol is played up by stroke process device, filling processor and three interfaces of path conversion and is formed.Dot-form map symbol is played up the ProcessOnePoint function of corresponding VGE symbol in playing up, and calls ProcessStroke, ProcessFill function, and function is as follows:
①ProcessStroke(Stroke?*?s)
Be used on virtual canvas object, drawing a stroke with certain stroke parameter (color, texture, width, actual situation pattern etc.).Parameter s is quoting of a stroke object.
②ProcessFill(Fill?*?f)
Be used on virtual canvas object an enclosed areas being filled with certain pad parameter (color, texture, at interval, angle, pattern etc.).Parameter f is quoting of a filled object.
Embodiment 2
As shown in Figure 2, the present invention also provides a kind of dot-form map symbol based on VGE point symbol model to share method, comprises point symbol data sharing and function sharing method.Data sharing method can be divided into dot-form map symbol assimilation and dot-form map symbol XML exchange, and the function sharing method comprises that point symbol is monitored and the point symbol monitoring is replaced.
Share method based on the dot-form map symbol of VGE point symbol model and specifically adopt following steps:
Step 1, based on the VGE dot-form map symbol model, the point symbol that designs among the CAD, GIS software platform of assimilation main flow, point symbol file importing that will already present other form (as * .dxf, * .style).
Step 2, the XML Switching Module by the VGE point symbol import the point symbol data of the commutative form of XML, and as the point symbol among the SLD (filling symbol), the function that provides is:
LoadFromFile(string?file)
Be used for being written into symbol data to internal memory from outside Spot Map Symbol Base file, parameter f ile is the pathname of outside Spot Map Symbol Base.File type can be the symbol Interchange Format of XML form, also can be self-defining storage inside form.
Step 3, utilize the com mode that VGE point symbol model and high-quality map symbol render engine are extended in the GIS software platform of application.
Step 4, point symbol is played up the drawing for order that calls during monitoring GIS running software in operating system, and it is replaced with the instruction of playing up of VGE point symbol.
Step 5, the XML Switching Module by the VGE point symbol are output as the commutative form of XML with the VGE point symbol that designs, and share for dot-form map symbol, and the function that provides is:
SaveToFile(string?file)
Be used for the symbolic library behind the edit-modify is saved in outside Spot Map Symbol Base file, parameter f ile is the pathname of outside Spot Map Symbol Base.File type can be the symbol Interchange Format of XML form, also can be self-defining storage inside form.