CN109887058A - Cross-platform drafting system - Google Patents

Cross-platform drafting system Download PDF

Info

Publication number
CN109887058A
CN109887058A CN201811319516.7A CN201811319516A CN109887058A CN 109887058 A CN109887058 A CN 109887058A CN 201811319516 A CN201811319516 A CN 201811319516A CN 109887058 A CN109887058 A CN 109887058A
Authority
CN
China
Prior art keywords
platform
interface
module
kernel
command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811319516.7A
Other languages
Chinese (zh)
Inventor
吴航
包铭聪
汪琳青
周朝恩
林立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Aiqi Information Science & Technology Co Ltd
Original Assignee
Shanghai Aiqi Information Science & Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Aiqi Information Science & Technology Co Ltd filed Critical Shanghai Aiqi Information Science & Technology Co Ltd
Priority to CN201811319516.7A priority Critical patent/CN109887058A/en
Publication of CN109887058A publication Critical patent/CN109887058A/en
Pending legal-status Critical Current

Links

Abstract

A kind of cross-platform drafting system, the drafting system include: kernel views module, the module management figure, and display and gesture request are transmitted to interactive command and graphic entity;Gesture request is converted to drawing step, realizes interaction logic by interaction command module, echoes interaction effect to display request with motion graphics;Graphic entity module manages and shows graph data in system kernel.

Description

Cross-platform drafting system
Technical field
The invention belongs to drawing technique field, in particular to a kind of cross-platform drafting system.
Background technique
In recent years, popularizing with mobile device, high-resolution, higher configured, portability and cost performance make it suitable for In more complex drawing application.The demand drawn for mobile phone and tablet computer (based on iOS and Android) grows at top speed, The vector plotting technology that mobile device is bribed in face has biggish development space and application value.It can advertisement be general draws applied to mobile phone Figure, CAI software platform, each field of image procossing.However at present mainstream mobile platform mapping software have the shortcomings that it is following:
The format of bitmap is mostly used, it is big that there are data storage capacities, the shortcomings that distortion is had after stretching, and the format of polar plot It can be very good to avoid these disadvantages;
Lack teaching link, is typically drawn by user oneself, for lacking the user of foundation of painting, none Guidance and instructional function well.
Summary of the invention
The embodiment of the present invention provides a kind of cross-platform drafting system, which is used for vector plotting, comprising:
Display and gesture request are transmitted to interactive command and graphic entity by kernel views module, the module management figure;
Gesture request is converted to drawing step, realizes interaction logic, to display request with Dynamic Graph by interaction command module Shape echoes interaction effect;
Graphic entity module manages and shows graph data in system kernel.And
View adapter, the view adapter realize occupy-place view using display interface frame, and response is drawn and touch disappears Breath, the gesture commission kernel view processing that display is requested and identified;
The display primitive of painting canvas interface is mapped to the drafting function in special pattern library by painting canvas adapter.
The present invention proposes a kind of design side of cross-platform guiding vector plotting platform according to the characteristic of mobile device Case.Vector plotting function is realized using C++ in cross-platform kernel;View adapter and painting canvas are realized in equipment correlation module Adapter, touch gestures identification, and gesture information is entrusted into kernel processes;Tutor's instructional function, user are added in drawing course The learning process of drawing can be simplified by the way of similar copy.
The invention has the following advantages:
(1) cross-platform, drawing function is realized using C++ in kernel, it can be at different platform (Android, IOS, Win) Between share;Kernel is easy to extend, equipment correlation module is easily achieved.
(2) format of polar plot is used, can be arbitrarily enlarged and be reduced, and data storage capacity is small.
Detailed description of the invention
The following detailed description is read with reference to the accompanying drawings, above-mentioned and other mesh of exemplary embodiment of the invention , feature and advantage will become prone to understand.In the accompanying drawings, if showing by way of example rather than limitation of the invention Dry embodiment, in which:
Cross-platform drawing model schematic diagram in Fig. 1 embodiment of the present invention.
The architecture of drawing platform in Fig. 2 embodiment of the present invention.
Drawing MVC framework in Fig. 3 embodiment of the present invention.
Guiding drawing flow chart in Fig. 4 embodiment of the present invention.
Specific embodiment
According to one or more embodiment, drafting system model of the invention is as shown in Figure 1.Include six big elements, tool Body is described as follows.
(1) application program.Integrated drawing platform, Custom Interface layout and effect, using draw data.
(2) view adapter.Occupy-place view is realized using interface framework, and response is drawn and touched message, display is requested With the gesture commission kernel view processing identified.Allow kernel with call-back manner refreshing content.
(3) painting canvas adapter.The display primitive of painting canvas interface is mapped to the drafting function in special pattern library.
(4) kernel view.Display and gesture request are transmitted to interactive command and graphic entity by managing graphic.
(5) interactive command.Gesture request is converted into drawing step, realizes interaction logic.Display is requested, with Dynamic Graph Shape echoes interaction effect.More drawing functions can be realized by expanding interactive command.
(6) graphic entity.Graph data is managed and shown in kernel, is expanded type and is realized more drawing functions.
According to one or more embodiment, the structure of drafting system of the invention is as shown in Figure 2.In order to reduce module coupling Conjunction property improves reusability, the hierarchical architecture design of vector plotting platform as shown in Figure 2 on different equipment platforms.It is overall On be divided into two big layers: cross-platform drawing inner nuclear layer and the relevant interface layer of equipment platform.In cross-platform drawing inner nuclear layer Realize the unrelated function of equipment platform.The distinctive general utility functions of equipment platform is provided in interface layer, for the various of top layer Application program uses.
For operating system iOS, interface layer is realized using ObjC and C++.For Android, interface layer is adopted It is realized with Java.JNI encapsulated layer is provided between drawing inner nuclear layer and interface layer, allow the Java code of Android with The C++ code of kernel mutually calls.Realize that the key technology mutually called is that the conversion sum aggregate of language is programmed using SWIG At.In windows desktop application, C# and WPF development interface encapsulated layer can be used and (MFC and GDI also can be used in program + realize.) SWIG be also employed between C++ and C# being connected conversion on.
There is corresponding drawing platform in each operating system, these platforms have identical kernel.Such as iOS and Android Drawing platform.These drawing platforms are all locally applied forms, are able to achieve a greater degree of fusion and performance optimization.In drawing Main drawing function is realized in core, and kinds of platform is adapted to by way of compiling identical code in different platform, avoids weight Multiple exploitation improves reusability.
It is used in the form of static library for various drawing application programs for the drawing platform that iOS is provided.Application program is not necessarily to Using the interface of drawing kernel, easy interface provided by interface layer need to be only used, to reduce the work of application and development It measures.Interface layer and application program are all based on the SDK exploitation of iOS platform, and unified look & feel may be implemented, and reduce real Existing difficulty.
It include a JAR packet (kernel JNI and interface layer for the drawing platform that Android application program provides Java class) and a drawing kernel local dynamic base.Application program is by using easy interface provided by interface layer Reduce integrated difficulty.Interface layer and application program are all based on the SDK exploitation of Android platform, can be farthest Using the characteristic of platform SDK, close fusion is realized.
According to one or more embodiment, drawing platform of the invention is designed using MVC architecture mode as shown in Figure 3 Dynamic behaviour.
(1) repaint message is responded in cartographical views, painting canvas adapter is initialized using current drawing context, by this Painting canvas adapter is passed to kernel view with abstract painting canvas interface object, and request is drawn.
(2) request of static graphical art and DYNAMIC DRAWING is transmitted to graphic entity by kernel view respectively and present figure is ordered It enables.Graphic entity and drawing command call painting canvas interface object to draw.When drawing, painting canvas adapter will be called back.
(3) response touches message in cartographical views, identifies commission kernel view processing after gesture, is turned by kernel view It issues present figure order and interacts formula drawing.
(4) drawing command changes interim figure according to touch location, and that calls abstract view interface redraws function triggering weight Message is drawn, the interim figure is shown when redrawing next time, to realize DYNAMIC DRAWING.It is real to change figure after primary touch Body, calls the function that regenerates of view interface, can thus show new graphic entity content.
According to one or more embodiment, drawing platform of the invention has following six nucleus modules, in addition to It is all cross-platform module outside GraphView module.
(1) GraphView: the relevant adaptor module of equipment platform includes view adapter and painting canvas adapter.
(2) CoreView: kernel views module provides access interface for upper layer adapter, and managing graphic data will be shown Graphic entity or interactive command are transmitted to gesture request.
(3) Command: interaction command module realizes select command and multiple drawing commands.These order for draw and Various figures are modified, provide action message interface for upper interface to receive touch gestures or mouse information data.Interaction life It enables module that action message is distributed to corresponding command object in inside, realizes interactive drawing.
(4) Shape: graphic entity module, major function are the storage, rendering and interactive computing of Common graphical.
(5) Graphics: graphic interface module realizes the transformation of displaing coordinate system, scaling translation calculation, a variety of curve shapes Display output.It does not apply any shape library in graphic interface library, merely provides the painting canvas interface of suitable kinds of platform.By The painting canvas adapter class of interface layer realizes the painting canvas interface using a certain shape library.
(6) Geometry: mathematics geometry module realizes point, vector, transformation matrix, rectangle frame, the song based on Bezier Line path, is cut out, the mathematical algorithms such as geometry computing function and solving equations such as the shortest distance.
Drawing platform devises cross-platform painting canvas interface with reference to HTML5Canvas standard, defines listed in table 1 It shows primitive, is suitble to majority shape library.
(1) vector graphics based on path is shown.
Painting canvas interface support subpath, comprising beginPath, moveTo, lineTo, bezierTo, quadTo, 7 kinds of display primitive such as closePath and drawPath.Designing points: it a, avoids not having using composite data types such as array, points There are broken line and polygon etc. to need the drawing function of variable number coordinate, mainly uses the simple types such as floating number and integer, with Exempt to generate complicated parameter type in JNI.B, coordinate using single precision floating datum rather than integer, with iPhone, iPAD etc. The display screen of high pixel density (PPI) is adapted.
Because rectangle, line segment, circle, ellipse are figures relatively simple and being commonly used, most of shape libraries both provide this The drafting function of a little figures, so providing drawRect, drawLine, drawEllipse drawing letter in painting canvas interface Number.Other vector graphics can show that primitive indicates with these paths.Such as any angle is indicated using Cubic kolmogorov's differential system Circular arc, four sections of Beziers indicate it is oval, by B spline curve and three rank parameter curve curve separating be it is continuous three times Bezier.
1 painting canvas callback interface GiCanvas of table
(2) paintbrush and paintbrush are set.
Comprising setPen and setBrush, function is set.Designing points: a, color value use integer (int argb), Android is upper can directly to apply the color value, extract each color component by byte order on the platforms such as iOS and be converted to flat The distinctive color type of platform.B, the diagram parameters such as line width are saved in the GiGraphics class of cross-platform kernel, judge automatically and SetPen the and setBrush function for calling painting canvas interface avoids repeating to realize in the painting canvas adapter of each equipment platform The function.
(3) graphic clipping.
Function is cut out using shape library, includes saveClip, restoreClip, clipRect, clipPath function.
(4) image is shown.
In order to simplify the otherness of realization, isolation platform, image manages in equipment platform, only uses in painting canvas interface Title identifies image object.DrawHandle (x, y, type) shows the dotted images such as the control point icon of original size, DrawBitmap (name, xc, yc, w, h, angle) shows image in a rectangle frame.For drawBitmap, reality is used The wide high expression image zooming information in border, angle expresses image rotation information, displacement information, this three are expressed in the center of image The matrixing information of image is co-expressed, image is shown with any angle and size vector quantization.
About the design of drawing command, drawing platform is dynamic according to multiple point touching on the basis of above-mentioned static graphics are shown The location information of work, dynamic changes and display figure.As shown in table 2, steps are as follows for execution: (1) knowing in cartographical views class Not Chu multi-touch gesture movement, commission kernel distribute gesture motion.It is sharp in cartographical views class (such as MyDeviceView) Certain touch gestures is identified from multiple point touching information with the gesture recognition built in system, then transition gesture action parameter And entrust kernel processes.
(2) gesture motion is distributed to current drawing command by kernel view (GiCoreView), by drawing command according to Touch location changes the shape of interim figure.
(3) after drawing command changes interim figure, the redraw of view interface is called.
Function, view adapter is arranged automatically redraws region and triggering repaint message.
(4) view class entrusts kernel to show motion graphics in redrawing receptance function, and the drawing command of kernel, which will call, to be taken out As painting canvas interface (GiCanvas) draws motion graphics (such as towing effect).
According to the gesture identification feature of iOS and Android, (such as Android needs voluntarily to realize scaling and rotation gesture Recognizer), devise the gesture primitive of drawing command as shown in Table 2.Wherein, click, doubleClick, LongPress is single finger gesture, touchBegan, touchMoved, touchEnded be singly refer to drag gesture (using at most, Therefore it is decomposed into three), twoFingersMove corresponds to two fingers kneading, rotation and drag gesture, and (three kinds of gestures merge into one Gesture primitive is in order to avoid identifying specific gesture-type in equipment platform).
2 drawing gesture primitive of table
MgMotion includes the data such as current contact, home-position contact, touch action state and view GiView object, is passed through The view adapter object of equipment platform is transmitted to kernel by the view member variable of MgMotion.It is used in cross-platform kernel Command mode and template method mode design interactive command architecture.Each interactive drawing order both corresponds to an order Class, gesture primitive interface shown in support matrix 2.Each order class is corresponding with the command name of a unique identification, all orders Object all caches in MgCmdManager command manager class.Common basic drawing command, extraneous module are provided in kernel More interactive command classes may be implemented, command name and class factory function are registered in command manager, be somebody's turn to do in actual use Command object is just created when order.
According to one or more embodiment, in the present invention, guiding drawing is recorded by manufacturer or advanced level user first The step of drawing, uses as study course for ordinary user.After ordinary user opens study course, study course can be played gradually, in this mistake Cheng Zhong, user can carry out the operation of similar imitation, grasp the method for drawing in such a process.Its content mainly includes three A module:
Module is recorded in study course: being recorded each step mapping operation, is saved into course files.
Study course playing module: course files are read and start to play the interior of corresponding step when user clicks operation in next step Hold.
User's drafting module: after each step content of study course is completed, user can be allowed copy the behaviour of drafting Make.Corresponding process is as shown in Figure 4.
What guiding of the invention was drawn is achieved in that: each step of course files record drawing, without foundation of painting User can also according to the step in course files step by step draw out the good works of effect.
It is worth noting that although foregoing teachings are by reference to several essences that detailed description of the preferred embodimentsthe present invention has been described creates Mind and principle, it should be appreciated that, the invention is not limited to the specific embodiments disclosed, the division also unawareness to various aspects Taste these aspect in feature cannot combine, it is this divide merely to statement convenience.The present invention is directed to cover appended power Included various modifications and equivalent arrangements in the spirit and scope that benefit requires.

Claims (6)

1. a kind of cross-platform drafting system, the drafting system include:
Display and gesture request are transmitted to interactive command and graphic entity by kernel views module, the module management figure;
Gesture request is converted to drawing step, realizes interaction logic by interaction command module, is returned to display request with motion graphics Aobvious interaction effect;
Graphic entity module manages and shows graph data in system kernel.
2. cross-platform drafting system according to claim 1, which is characterized in that further include
View adapter, the view adapter realize occupy-place view using display interface frame, and message is drawn and touched in response, will Display request and the gesture commission kernel view processing identified;
The display primitive of painting canvas interface is mapped to the drafting function in special pattern library by painting canvas adapter.
3. cross-platform drafting system according to claim 2, which is characterized in that drafting system further include:
Cross-platform drawing inner nuclear layer and the relevant interface layer of equipment platform,
The unrelated function of equipment platform is realized in cross-platform drawing inner nuclear layer,
The distinctive general utility functions of equipment platform is provided in interface layer, is used for the various application programs of top layer.
4. cross-platform drafting system according to claim 3, which is characterized in that drafting system uses MVC architecture mode, should Mode includes:
(1) repaint message is responded in cartographical views, painting canvas adapter is initialized using current drawing context, by this painting canvas Adapter is passed to after kernel view with abstract painting canvas interface object and requests to draw;
(2) request of static graphical art and DYNAMIC DRAWING is transmitted to graphic entity and present figure order by kernel view respectively.Figure Shape entity and drawing command call painting canvas interface object to draw, and when drawing, painting canvas adapter will be called back;
(3) response touches message in cartographical views, identifies commission kernel view processing after gesture, is transmitted to by kernel view Present figure order interacts formula drawing;
(4) drawing command changes interim figure according to touch location, and the function triggering that redraws of abstract view interface is called to redraw and disappear Breath, the interim figure is shown when redrawing next time, to realize DYNAMIC DRAWING, changes graphic entity after primary touch, That calls view interface regenerates function, shows new graphic entity content.
5. cross-platform drafting system according to claim 4, which is characterized in that the kernel of drafting system includes six cores Module, wherein being all cross-platform module other than GraphView module, 6 modules are respectively:
(1) GraphView: the relevant adaptor module of equipment platform includes view adapter and painting canvas adapter;
(2) CoreView: kernel views module provides access interface, managing graphic data, by display and hand for upper layer adapter Gesture request is transmitted to graphic entity or interactive command;
(3) Command: interaction command module realizes select command and multiple drawing commands.These orders are for drawing and modifying Various figures provide action message interface for upper interface to receive touch gestures or mouse information data, interactive command mould Action message is distributed to corresponding command object in inside by block, realizes interactive drawing;
(4) Shape: graphic entity module, major function are the storage, rendering and interactive computing of Common graphical;
(5) Graphics: graphic interface module, realize the transformation of displaing coordinate system, scaling translation calculation, a variety of curve shapes show Show output, the painting canvas interface of kinds of platform is provided, by the painting canvas adapter class of interface layer using a certain shape library Lai real The now painting canvas interface;
(6) Geometry: mathematics geometry module realizes point, vector, transformation matrix, rectangle frame, the curve based on Bezier, road Diameter is cut out, the mathematical algorithms such as geometry computing function and solving equations such as the shortest distance.
6. cross-platform drafting system according to claim 1, which is characterized in that the drafting system is for vector plotting System.
CN201811319516.7A 2018-11-07 2018-11-07 Cross-platform drafting system Pending CN109887058A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811319516.7A CN109887058A (en) 2018-11-07 2018-11-07 Cross-platform drafting system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811319516.7A CN109887058A (en) 2018-11-07 2018-11-07 Cross-platform drafting system

Publications (1)

Publication Number Publication Date
CN109887058A true CN109887058A (en) 2019-06-14

Family

ID=66924837

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811319516.7A Pending CN109887058A (en) 2018-11-07 2018-11-07 Cross-platform drafting system

Country Status (1)

Country Link
CN (1) CN109887058A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111524210A (en) * 2020-04-10 2020-08-11 北京百度网讯科技有限公司 Method and apparatus for generating drawings
CN116126320A (en) * 2022-12-21 2023-05-16 瑞庭网络技术(上海)有限公司 Data processing method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250129A (en) * 2016-07-26 2016-12-21 南京航空航天大学 The vector quantization dynamic drawing method of symbol based on meta graph recognition model
US20170285883A1 (en) * 2015-11-23 2017-10-05 Shenzhen Skyworth-Rgb Electronic Co., Ltd. User interface displaying and processing method and user interface displaying and processing device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170285883A1 (en) * 2015-11-23 2017-10-05 Shenzhen Skyworth-Rgb Electronic Co., Ltd. User interface displaying and processing method and user interface displaying and processing device
CN106250129A (en) * 2016-07-26 2016-12-21 南京航空航天大学 The vector quantization dynamic drawing method of symbol based on meta graph recognition model

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张云贵: "论文第3章:移动绘图平台的架构设计", 《HTTPS://WWW.CNBLOGS.COM/RHCAD/P/3228032.HTML》 *
张云贵: "论文第四章:ios绘图平台的实现", 《HTTPS://WWW.CNBLOGS.COM/RHCAD/P/3228053.HTML》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111524210A (en) * 2020-04-10 2020-08-11 北京百度网讯科技有限公司 Method and apparatus for generating drawings
CN116126320A (en) * 2022-12-21 2023-05-16 瑞庭网络技术(上海)有限公司 Data processing method and device, electronic equipment and storage medium
CN116126320B (en) * 2022-12-21 2024-02-23 瑞庭网络技术(上海)有限公司 Data processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US7096454B2 (en) Method for gesture based modeling
US7661071B2 (en) Creation of three-dimensional user interface
US9182882B2 (en) Dynamic creation and modeling of solid models
US8860675B2 (en) Drawing aid system for multi-touch devices
CN107132912B (en) Interactive demonstration method and system for building planning of GIS and BIM augmented reality
US8914259B2 (en) Passive associativity in three-dimensional (3D) modeling
CN110069257A (en) A kind of interface processing method, device and terminal
KR20160046150A (en) Apparatus and method for drawing and solving a figure content
US8825459B2 (en) Multi-modal manipulation of a geometric model
JP2020504848A (en) System and method for managing hand-drawn graphical connectors
WO2016099317A1 (en) Method and system for the visual management of data
CN112100296B (en) GIS system convenient to carry out GIS vector data editing
US8902222B2 (en) Three dimensional contriver tool for modeling with multi-touch devices
Bueno et al. Supporting tools for early stages of architectural design
CN109887058A (en) Cross-platform drafting system
WO2017006223A1 (en) Graphic engine for creating and executing applications with multisensory interfaces
WO2013109245A1 (en) Dynamic creation and modeling of solid models
US10514841B2 (en) Multi-layered ink object
US10725636B2 (en) Modification, manipulation and rendering of object attributes
CN114797109A (en) Object editing method and device, electronic equipment and storage medium
US11809701B2 (en) Handwriting forming method and apparatus, and electronic device
CN114327395A (en) Webpage design method, device, computer equipment, storage medium and product
Mao et al. A Light-weight Mobile Education App for 3D Modelling Course Teaching
US10761719B2 (en) User interface code generation based on free-hand input
Dickinson et al. Pen–tablet as a CAD interface alternative

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190614