├── .gitignore ├── LICENSE ├── OCC-Lib.zip ├── Projects ├── QtCreator_MSVC │ ├── OCCT-QT-Demo_MSVC.pro │ ├── OCCT-QT-Demo_MSVC.pro.user │ ├── OCCT_MSVC.pri │ └── msvc_pro.bat ├── QtCreator_MinGW │ ├── OCCT-QT-Demo_MinGW.pro │ ├── OCCT-QT-Demo_MinGW.pro.user │ ├── OCCT_MinGW.pri │ └── mingw_pro.bat └── VS2015 │ ├── OCC.sln │ ├── OCC.vcxproj │ ├── OCC.vcxproj.filters │ ├── OCC.vcxproj.user │ ├── OCCT_PropertySheet.props │ ├── _env_old.bat │ ├── _msvc_old.bat │ ├── msvc_new.bat │ ├── 新方法请启动msvc_new.txt │ └── 老方法请启动_msvc_old.txt ├── README OLD.md ├── README.md └── src ├── ComplainUtf8.h ├── GUI_Message.cpp ├── GUI_Message.h ├── Icon.h ├── MainWindow.cpp ├── MainWindow.h ├── MainWindow2.cpp ├── Msg.cpp ├── Msg.h ├── MsgUI.cpp ├── MsgUI.h ├── MyDocument.cpp ├── MyDocument.h ├── MyViewer.cpp ├── MyViewer.h ├── OCCT_GraphDriver.cpp ├── OCCT_GraphDriver.h ├── OCCT_ShapeExport.cpp ├── OCCT_ShapeExport.h ├── OCCT_ShapeImport.cpp ├── OCCT_ShapeImport.h ├── OCCT_ShapeList.h ├── OCCT_Utf8String.h ├── OCCT_Utf8StringList.h ├── OcctView.cxx ├── OcctView.h ├── OcctWindow.cxx ├── OcctWindow.h ├── QShapeExportUI.cpp ├── QShapeExportUI.h ├── QShapeImportUI.cpp ├── QShapeImportUI.h ├── Resources ├── Ais │ ├── tool_Attach.png │ ├── tool_Detach.png │ ├── tool_delete.png │ ├── tool_displayall.png │ ├── tool_erase.png │ ├── tool_eraseall.png │ ├── tool_material.png │ ├── tool_objcolor.png │ ├── tool_selcolor.png │ ├── tool_shading.png │ ├── tool_transparency.png │ ├── tool_wireframe.png │ └── trans.png ├── ICON_CANCLE.png ├── ICON_SURE.png ├── OccView │ ├── cursor_rotate.png │ ├── cursor_zoom.png │ ├── raytrace_antialiasing.png │ ├── raytrace_raytracing.png │ ├── raytrace_reflections.png │ ├── raytrace_shadows.png │ ├── view_axo.png │ ├── view_back.png │ ├── view_bottom.png │ ├── view_comp_off.png │ ├── view_comp_on.png │ ├── view_fitall.png │ ├── view_fitarea.png │ ├── view_front.png │ ├── view_globalpan.png │ ├── view_glpan.png │ ├── view_left.png │ ├── view_pan.png │ ├── view_reset.png │ ├── view_right.png │ ├── view_rotate.png │ ├── view_top.png │ └── view_zoom.png ├── Sel │ ├── SEL_Edge.png │ ├── SEL_Face.png │ ├── SEL_Shape.png │ ├── SEL_Solid.png │ └── SEL_Vertex.png ├── Toolbar │ ├── SEL_Edge.png │ ├── SEL_Face.png │ ├── SEL_Shape.png │ ├── SEL_Solid.png │ └── SEL_Vertex.png ├── icon-circleupdate.png └── icon-update.png ├── images ├── app.ico ├── app.png ├── back.png ├── copy.png ├── cut.png ├── new.png ├── open.png ├── paste.png ├── save.png └── saveas.png ├── main.cpp ├── mdi.qrc ├── mdichild.cpp ├── mdichild.h ├── mdichild_action1.cpp ├── mdichild_action2.cpp ├── mdichild_init.cpp └── mdichild_slots.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。 3 | ################################################################################ 4 | 5 | /.vs 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /OCC-Lib.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/OCC-Lib.zip -------------------------------------------------------------------------------- /Projects/QtCreator_MSVC/OCCT-QT-Demo_MSVC.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++11 6 | 7 | # The following define makes your compiler emit warnings if you use 8 | # any Qt feature that has been marked deprecated (the exact warnings 9 | # depend on your compiler). Please consult the documentation of the 10 | # deprecated API in order to know how to port your code away from it. 11 | DEFINES += QT_DEPRECATED_WARNINGS 12 | 13 | # You can also make your code fail to compile if it uses deprecated APIs. 14 | # In order to do so, uncomment the following line. 15 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 16 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 17 | 18 | RESOURCES += ../../src/mdi.qrc 19 | 20 | # OCCT 21 | include(OCCT_MSVC.pri) 22 | 23 | HEADERS += $$files(../../src/*.h) 24 | 25 | SOURCES += $$files(../../src/*.cpp) 26 | SOURCES += $$files(../../src/*.cxx) 27 | 28 | # Default rules for deployment. 29 | qnx: target.path = /tmp/$${TARGET}/bin 30 | else: unix:!android: target.path = /opt/$${TARGET}/bin 31 | !isEmpty(target.path): INSTALLS += target 32 | -------------------------------------------------------------------------------- /Projects/QtCreator_MSVC/OCCT-QT-Demo_MSVC.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {16d77cbd-a208-4da2-8867-1c4a45884861} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | GB2312 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | -fno-delayed-template-parsing 60 | 61 | true 62 | 63 | 64 | 65 | ProjectExplorer.Project.Target.0 66 | 67 | Desktop Qt 5.12.7 MSVC2015 64bit 68 | Desktop Qt 5.12.7 MSVC2015 64bit 69 | qt.qt5.5127.win64_msvc2015_64_kit 70 | 0 71 | 0 72 | 0 73 | 74 | E:/GIT/OCC-QT-Demo/Projects/build-OCCT-QT-Demo_MSVC-Desktop_Qt_5_12_7_MSVC2015_64bit-Debug 75 | 76 | 77 | true 78 | QtProjectManager.QMakeBuildStep 79 | true 80 | 81 | false 82 | false 83 | false 84 | 85 | 86 | true 87 | Qt4ProjectManager.MakeStep 88 | 89 | false 90 | 91 | 92 | false 93 | 94 | 2 95 | Build 96 | Build 97 | ProjectExplorer.BuildSteps.Build 98 | 99 | 100 | 101 | true 102 | Qt4ProjectManager.MakeStep 103 | 104 | true 105 | clean 106 | 107 | false 108 | 109 | 1 110 | Clean 111 | Clean 112 | ProjectExplorer.BuildSteps.Clean 113 | 114 | 2 115 | false 116 | 117 | Debug 118 | Qt4ProjectManager.Qt4BuildConfiguration 119 | 2 120 | 121 | 122 | E:/GIT/OCC-QT-Demo/Projects/build-OCCT-QT-Demo_MSVC-Desktop_Qt_5_12_7_MSVC2015_64bit-Release 123 | 124 | 125 | true 126 | QtProjectManager.QMakeBuildStep 127 | false 128 | 129 | false 130 | false 131 | true 132 | 133 | 134 | true 135 | Qt4ProjectManager.MakeStep 136 | 137 | false 138 | 139 | 140 | false 141 | 142 | 2 143 | Build 144 | Build 145 | ProjectExplorer.BuildSteps.Build 146 | 147 | 148 | 149 | true 150 | Qt4ProjectManager.MakeStep 151 | 152 | true 153 | clean 154 | 155 | false 156 | 157 | 1 158 | Clean 159 | Clean 160 | ProjectExplorer.BuildSteps.Clean 161 | 162 | 2 163 | false 164 | 165 | Release 166 | Qt4ProjectManager.Qt4BuildConfiguration 167 | 0 168 | 169 | 170 | E:/GIT/OCC-QT-Demo/Projects/build-OCCT-QT-Demo_MSVC-Desktop_Qt_5_12_7_MSVC2015_64bit-Profile 171 | 172 | 173 | true 174 | QtProjectManager.QMakeBuildStep 175 | true 176 | 177 | false 178 | true 179 | true 180 | 181 | 182 | true 183 | Qt4ProjectManager.MakeStep 184 | 185 | false 186 | 187 | 188 | false 189 | 190 | 2 191 | Build 192 | Build 193 | ProjectExplorer.BuildSteps.Build 194 | 195 | 196 | 197 | true 198 | Qt4ProjectManager.MakeStep 199 | 200 | true 201 | clean 202 | 203 | false 204 | 205 | 1 206 | Clean 207 | Clean 208 | ProjectExplorer.BuildSteps.Clean 209 | 210 | 2 211 | false 212 | 213 | Profile 214 | Qt4ProjectManager.Qt4BuildConfiguration 215 | 0 216 | 217 | 3 218 | 219 | 220 | 0 221 | Deploy 222 | Deploy 223 | ProjectExplorer.BuildSteps.Deploy 224 | 225 | 1 226 | ProjectExplorer.DefaultDeployConfiguration 227 | 228 | 1 229 | 230 | 231 | dwarf 232 | 233 | cpu-cycles 234 | 235 | 236 | 250 237 | 238 | -e 239 | cpu-cycles 240 | --call-graph 241 | dwarf,4096 242 | -F 243 | 250 244 | 245 | -F 246 | true 247 | 4096 248 | false 249 | false 250 | 1000 251 | 252 | true 253 | 254 | false 255 | false 256 | false 257 | false 258 | true 259 | 0.01 260 | 10 261 | true 262 | kcachegrind 263 | 1 264 | 25 265 | 266 | 1 267 | true 268 | false 269 | true 270 | valgrind 271 | 272 | 0 273 | 1 274 | 2 275 | 3 276 | 4 277 | 5 278 | 6 279 | 7 280 | 8 281 | 9 282 | 10 283 | 11 284 | 12 285 | 13 286 | 14 287 | 288 | 2 289 | 290 | Qt4ProjectManager.Qt4RunConfiguration:E:/GIT/OCC-QT-Demo/Projects/QtCreator_MSVC/OCCT-QT-Demo_MSVC.pro 291 | E:/GIT/OCC-QT-Demo/Projects/QtCreator_MSVC/OCCT-QT-Demo_MSVC.pro 292 | 293 | false 294 | 295 | false 296 | true 297 | true 298 | false 299 | false 300 | true 301 | 302 | E:/GIT/OCC-QT-Demo/Projects/build-OCCT-QT-Demo_MSVC-Desktop_Qt_5_12_7_MSVC2015_64bit-Debug 303 | 304 | 1 305 | 306 | 307 | 308 | ProjectExplorer.Project.TargetCount 309 | 1 310 | 311 | 312 | ProjectExplorer.Project.Updater.FileVersion 313 | 22 314 | 315 | 316 | Version 317 | 22 318 | 319 | 320 | -------------------------------------------------------------------------------- /Projects/QtCreator_MSVC/OCCT_MSVC.pri: -------------------------------------------------------------------------------- 1 | #设置 2 | 3 | OCCIncludePath = $${PWD}/../../OCC-Lib/inc 4 | OCCLibPath = $${PWD}/../../OCC-Lib/MSVC_win64_vc14/lib 5 | 6 | INCLUDEPATH += $$OCCIncludePath 7 | 8 | win32: LIBS += -L$$OCCLibPath/ -lTKBin 9 | win32: LIBS += -L$$OCCLibPath/ -lTKBinL 10 | win32: LIBS += -L$$OCCLibPath/ -lTKG3d 11 | win32: LIBS += -L$$OCCLibPath/ -lTKService 12 | win32: LIBS += -L$$OCCLibPath/ -lTKVRML 13 | win32: LIBS += -L$$OCCLibPath/ -lTKGeomAlgo 14 | win32: LIBS += -L$$OCCLibPath/ -lTKShHealing 15 | win32: LIBS += -L$$OCCLibPath/ -lTKXCAF 16 | win32: LIBS += -L$$OCCLibPath/ -lTKBinTObj 17 | win32: LIBS += -L$$OCCLibPath/ -lTKGeomBase 18 | win32: LIBS += -L$$OCCLibPath/ -lTKStdL 19 | win32: LIBS += -L$$OCCLibPath/ -lTKXDEIGES 20 | win32: LIBS += -L$$OCCLibPath/ -lTKBinXCAF 21 | win32: LIBS += -L$$OCCLibPath/ -lTKHLR 22 | win32: LIBS += -L$$OCCLibPath/ -lTKStd 23 | win32: LIBS += -L$$OCCLibPath/ -lTKXDESTEP 24 | win32: LIBS += -L$$OCCLibPath/ -lTKBool 25 | win32: LIBS += -L$$OCCLibPath/ -lTKIGES 26 | win32: LIBS += -L$$OCCLibPath/ -lTKSTEP209 27 | win32: LIBS += -L$$OCCLibPath/ -lTKXMesh 28 | win32: LIBS += -L$$OCCLibPath/ -lTKBO 29 | win32: LIBS += -L$$OCCLibPath/ -lTKLCAF 30 | win32: LIBS += -L$$OCCLibPath/ -lTKSTEPAttr 31 | win32: LIBS += -L$$OCCLibPath/ -lTKXmlL 32 | win32: LIBS += -L$$OCCLibPath/ -lTKBRep 33 | win32: LIBS += -L$$OCCLibPath/ -lTKMath 34 | win32: LIBS += -L$$OCCLibPath/ -lTKSTEPBase 35 | win32: LIBS += -L$$OCCLibPath/ -lTKXml 36 | win32: LIBS += -L$$OCCLibPath/ -lTKCAF 37 | win32: LIBS += -L$$OCCLibPath/ -lTKMesh 38 | win32: LIBS += -L$$OCCLibPath/ -lTKSTEP 39 | win32: LIBS += -L$$OCCLibPath/ -lTKXmlTObj 40 | win32: LIBS += -L$$OCCLibPath/ -lTKCDF 41 | win32: LIBS += -L$$OCCLibPath/ -lTKMeshVS 42 | win32: LIBS += -L$$OCCLibPath/ -lTKSTL 43 | win32: LIBS += -L$$OCCLibPath/ -lTKXmlXCAF 44 | win32: LIBS += -L$$OCCLibPath/ -lTKernel 45 | win32: LIBS += -L$$OCCLibPath/ -lTKOffset 46 | win32: LIBS += -L$$OCCLibPath/ -lTKTObj 47 | win32: LIBS += -L$$OCCLibPath/ -lTKXSBase 48 | win32: LIBS += -L$$OCCLibPath/ -lTKFeat 49 | win32: LIBS += -L$$OCCLibPath/ -lTKOpenGl 50 | win32: LIBS += -L$$OCCLibPath/ -lTKTopAlgo 51 | win32: LIBS += -L$$OCCLibPath/ -lTKFillet 52 | win32: LIBS += -L$$OCCLibPath/ -lTKPrim 53 | win32: LIBS += -L$$OCCLibPath/ -lTKV3d 54 | win32: LIBS += -L$$OCCLibPath/ -lTKG2d 55 | win32: LIBS += -L$$OCCLibPath/ -lTKRWMesh 56 | win32: LIBS += -L$$OCCLibPath/ -lTKVCAF 57 | 58 | INCLUDEPATH += $$OCCLibPath 59 | DEPENDPATH += $$OCCLibPath 60 | 61 | #gl_lib_path = lib/ 62 | #LIBS += -lEGL 63 | -------------------------------------------------------------------------------- /Projects/QtCreator_MSVC/msvc_pro.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | Setlocal EnableDelayedExpansion 4 | 5 | rem Setup environment 6 | SET PATH=%PATH%;../../OCC-Lib/MSVC_win64_vc14/bin; 7 | 8 | rem Define path to project file 9 | start "" "OCCT-QT-Demo_MSVC.pro" -------------------------------------------------------------------------------- /Projects/QtCreator_MinGW/OCCT-QT-Demo_MinGW.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++11 6 | 7 | # The following define makes your compiler emit warnings if you use 8 | # any Qt feature that has been marked deprecated (the exact warnings 9 | # depend on your compiler). Please consult the documentation of the 10 | # deprecated API in order to know how to port your code away from it. 11 | DEFINES += QT_DEPRECATED_WARNINGS 12 | 13 | # You can also make your code fail to compile if it uses deprecated APIs. 14 | # In order to do so, uncomment the following line. 15 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 16 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 17 | 18 | RESOURCES += ../../src/mdi.qrc 19 | 20 | # OCCT 21 | include(OCCT_MinGW.pri) 22 | 23 | HEADERS += $$files(../../src/*.h) 24 | 25 | SOURCES += $$files(../../src/*.cpp) 26 | SOURCES += $$files(../../src/*.cxx) 27 | 28 | # Default rules for deployment. 29 | qnx: target.path = /tmp/$${TARGET}/bin 30 | else: unix:!android: target.path = /opt/$${TARGET}/bin 31 | !isEmpty(target.path): INSTALLS += target 32 | -------------------------------------------------------------------------------- /Projects/QtCreator_MinGW/OCCT-QT-Demo_MinGW.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {16d77cbd-a208-4da2-8867-1c4a45884861} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | GB2312 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | -fno-delayed-template-parsing 60 | 61 | true 62 | 63 | 64 | 65 | ProjectExplorer.Project.Target.0 66 | 67 | Desktop Qt 5.12.7 MinGW 64-bit 68 | Desktop Qt 5.12.7 MinGW 64-bit 69 | qt.qt5.5127.win64_mingw73_kit 70 | 1 71 | 0 72 | 0 73 | 74 | E:/GIT/OCC-QT-Demo/Projects/build-OCCT-QT-Demo_MinGW-Desktop_Qt_5_12_7_MinGW_64_bit-Debug 75 | 76 | 77 | true 78 | QtProjectManager.QMakeBuildStep 79 | true 80 | 81 | false 82 | false 83 | false 84 | 85 | 86 | true 87 | Qt4ProjectManager.MakeStep 88 | 89 | false 90 | 91 | 92 | false 93 | 94 | 2 95 | Build 96 | Build 97 | ProjectExplorer.BuildSteps.Build 98 | 99 | 100 | 101 | true 102 | Qt4ProjectManager.MakeStep 103 | 104 | true 105 | clean 106 | 107 | false 108 | 109 | 1 110 | Clean 111 | Clean 112 | ProjectExplorer.BuildSteps.Clean 113 | 114 | 2 115 | false 116 | 117 | Debug 118 | Qt4ProjectManager.Qt4BuildConfiguration 119 | 2 120 | 121 | 122 | E:/GIT/OCC-QT-Demo/Projects/build-OCCT-QT-Demo_MinGW-Desktop_Qt_5_12_7_MinGW_64_bit-Release 123 | 124 | 125 | true 126 | QtProjectManager.QMakeBuildStep 127 | false 128 | 129 | false 130 | false 131 | true 132 | 133 | 134 | true 135 | Qt4ProjectManager.MakeStep 136 | 137 | false 138 | 139 | 140 | false 141 | 142 | 2 143 | Build 144 | Build 145 | ProjectExplorer.BuildSteps.Build 146 | 147 | 148 | 149 | true 150 | Qt4ProjectManager.MakeStep 151 | 152 | true 153 | clean 154 | 155 | false 156 | 157 | 1 158 | Clean 159 | Clean 160 | ProjectExplorer.BuildSteps.Clean 161 | 162 | 2 163 | false 164 | 165 | Release 166 | Qt4ProjectManager.Qt4BuildConfiguration 167 | 0 168 | 169 | 170 | E:/GIT/OCC-QT-Demo/Projects/build-OCCT-QT-Demo_MinGW-Desktop_Qt_5_12_7_MinGW_64_bit-Profile 171 | 172 | 173 | true 174 | QtProjectManager.QMakeBuildStep 175 | true 176 | 177 | false 178 | true 179 | true 180 | 181 | 182 | true 183 | Qt4ProjectManager.MakeStep 184 | 185 | false 186 | 187 | 188 | false 189 | 190 | 2 191 | Build 192 | Build 193 | ProjectExplorer.BuildSteps.Build 194 | 195 | 196 | 197 | true 198 | Qt4ProjectManager.MakeStep 199 | 200 | true 201 | clean 202 | 203 | false 204 | 205 | 1 206 | Clean 207 | Clean 208 | ProjectExplorer.BuildSteps.Clean 209 | 210 | 2 211 | false 212 | 213 | Profile 214 | Qt4ProjectManager.Qt4BuildConfiguration 215 | 0 216 | 217 | 3 218 | 219 | 220 | 0 221 | Deploy 222 | Deploy 223 | ProjectExplorer.BuildSteps.Deploy 224 | 225 | 1 226 | ProjectExplorer.DefaultDeployConfiguration 227 | 228 | 1 229 | 230 | 231 | dwarf 232 | 233 | cpu-cycles 234 | 235 | 236 | 250 237 | 238 | -e 239 | cpu-cycles 240 | --call-graph 241 | dwarf,4096 242 | -F 243 | 250 244 | 245 | -F 246 | true 247 | 4096 248 | false 249 | false 250 | 1000 251 | 252 | true 253 | 254 | false 255 | false 256 | false 257 | false 258 | true 259 | 0.01 260 | 10 261 | true 262 | kcachegrind 263 | 1 264 | 25 265 | 266 | 1 267 | true 268 | false 269 | true 270 | valgrind 271 | 272 | 0 273 | 1 274 | 2 275 | 3 276 | 4 277 | 5 278 | 6 279 | 7 280 | 8 281 | 9 282 | 10 283 | 11 284 | 12 285 | 13 286 | 14 287 | 288 | 2 289 | 290 | Qt4ProjectManager.Qt4RunConfiguration:E:/GIT/OCC-QT-Demo/Projects/QtCreator_MinGW/OCCT-QT-Demo_MinGW.pro 291 | E:/GIT/OCC-QT-Demo/Projects/QtCreator_MinGW/OCCT-QT-Demo_MinGW.pro 292 | 293 | false 294 | 295 | false 296 | true 297 | true 298 | false 299 | false 300 | true 301 | 302 | E:/GIT/OCC-QT-Demo/Projects/build-OCCT-QT-Demo_MinGW-Desktop_Qt_5_12_7_MinGW_64_bit-Release 303 | 304 | 1 305 | 306 | 307 | 308 | ProjectExplorer.Project.TargetCount 309 | 1 310 | 311 | 312 | ProjectExplorer.Project.Updater.FileVersion 313 | 22 314 | 315 | 316 | Version 317 | 22 318 | 319 | 320 | -------------------------------------------------------------------------------- /Projects/QtCreator_MinGW/OCCT_MinGW.pri: -------------------------------------------------------------------------------- 1 | #设置 2 | 3 | OCCIncludePath = $${PWD}/../../OCC-Lib/inc 4 | OCCLibPath = $${PWD}/../../OCC-Lib/MinGW_win64_gcc/lib 5 | 6 | INCLUDEPATH += $$OCCIncludePath 7 | 8 | win32: LIBS += -L$$OCCLibPath/ -llibTKBin.dll 9 | win32: LIBS += -L$$OCCLibPath/ -llibTKBinL.dll 10 | win32: LIBS += -L$$OCCLibPath/ -llibTKBinTObj.dll 11 | win32: LIBS += -L$$OCCLibPath/ -llibTKBinXCAF.dll 12 | win32: LIBS += -L$$OCCLibPath/ -llibTKBO.dll 13 | win32: LIBS += -L$$OCCLibPath/ -llibTKBool.dll 14 | win32: LIBS += -L$$OCCLibPath/ -llibTKBRep.dll 15 | win32: LIBS += -L$$OCCLibPath/ -llibTKCAF.dll 16 | win32: LIBS += -L$$OCCLibPath/ -llibTKCDF.dll 17 | win32: LIBS += -L$$OCCLibPath/ -llibTKernel.dll 18 | win32: LIBS += -L$$OCCLibPath/ -llibTKFeat.dll 19 | win32: LIBS += -L$$OCCLibPath/ -llibTKFillet.dll 20 | win32: LIBS += -L$$OCCLibPath/ -llibTKG2d.dll 21 | win32: LIBS += -L$$OCCLibPath/ -llibTKG3d.dll 22 | win32: LIBS += -L$$OCCLibPath/ -llibTKGeomAlgo.dll 23 | win32: LIBS += -L$$OCCLibPath/ -llibTKGeomBase.dll 24 | win32: LIBS += -L$$OCCLibPath/ -llibTKHLR.dll 25 | win32: LIBS += -L$$OCCLibPath/ -llibTKIGES.dll 26 | win32: LIBS += -L$$OCCLibPath/ -llibTKLCAF.dll 27 | win32: LIBS += -L$$OCCLibPath/ -llibTKMath.dll 28 | win32: LIBS += -L$$OCCLibPath/ -llibTKMesh.dll 29 | win32: LIBS += -L$$OCCLibPath/ -llibTKMeshVS.dll 30 | win32: LIBS += -L$$OCCLibPath/ -llibTKOffset.dll 31 | win32: LIBS += -L$$OCCLibPath/ -llibTKOpenGl.dll 32 | win32: LIBS += -L$$OCCLibPath/ -llibTKPrim.dll 33 | win32: LIBS += -L$$OCCLibPath/ -llibTKRWMesh.dll 34 | win32: LIBS += -L$$OCCLibPath/ -llibTKService.dll 35 | win32: LIBS += -L$$OCCLibPath/ -llibTKShHealing.dll 36 | win32: LIBS += -L$$OCCLibPath/ -llibTKStd.dll 37 | win32: LIBS += -L$$OCCLibPath/ -llibTKStdL.dll 38 | win32: LIBS += -L$$OCCLibPath/ -llibTKSTEP.dll 39 | win32: LIBS += -L$$OCCLibPath/ -llibTKSTEP209.dll 40 | win32: LIBS += -L$$OCCLibPath/ -llibTKSTEPAttr.dll 41 | win32: LIBS += -L$$OCCLibPath/ -llibTKSTEPBase.dll 42 | win32: LIBS += -L$$OCCLibPath/ -llibTKSTL.dll 43 | win32: LIBS += -L$$OCCLibPath/ -llibTKTObj.dll 44 | win32: LIBS += -L$$OCCLibPath/ -llibTKTopAlgo.dll 45 | win32: LIBS += -L$$OCCLibPath/ -llibTKV3d.dll 46 | win32: LIBS += -L$$OCCLibPath/ -llibTKVCAF.dll 47 | win32: LIBS += -L$$OCCLibPath/ -llibTKVRML.dll 48 | win32: LIBS += -L$$OCCLibPath/ -llibTKXCAF.dll 49 | win32: LIBS += -L$$OCCLibPath/ -llibTKXDEIGES.dll 50 | win32: LIBS += -L$$OCCLibPath/ -llibTKXDESTEP.dll 51 | win32: LIBS += -L$$OCCLibPath/ -llibTKXMesh.dll 52 | win32: LIBS += -L$$OCCLibPath/ -llibTKXml.dll 53 | win32: LIBS += -L$$OCCLibPath/ -llibTKXmlL.dll 54 | win32: LIBS += -L$$OCCLibPath/ -llibTKXmlTObj.dll 55 | win32: LIBS += -L$$OCCLibPath/ -llibTKXmlXCAF.dll 56 | win32: LIBS += -L$$OCCLibPath/ -llibTKXSBase.dll 57 | 58 | INCLUDEPATH += $$OCCLibPath 59 | DEPENDPATH += $$OCCLibPath 60 | -------------------------------------------------------------------------------- /Projects/QtCreator_MinGW/mingw_pro.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | Setlocal EnableDelayedExpansion 4 | 5 | rem Setup environment 6 | SET PATH=%PATH%;../../OCC-Lib/MinGW_win64_gcc/bin; 7 | 8 | rem Define path to project file 9 | start "" "OCCT-QT-Demo_MinGW.pro" -------------------------------------------------------------------------------- /Projects/VS2015/OCC.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OCC", "OCC.vcxproj", "{4DCC0893-61D1-448D-9DA4-0D26478A5272}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {4DCC0893-61D1-448D-9DA4-0D26478A5272}.Debug|x64.ActiveCfg = Debug|x64 15 | {4DCC0893-61D1-448D-9DA4-0D26478A5272}.Debug|x64.Build.0 = Debug|x64 16 | {4DCC0893-61D1-448D-9DA4-0D26478A5272}.Release|x64.ActiveCfg = Release|x64 17 | {4DCC0893-61D1-448D-9DA4-0D26478A5272}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /Projects/VS2015/OCC.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | x64 7 | 8 | 9 | Release 10 | x64 11 | 12 | 13 | 14 | {4DCC0893-61D1-448D-9DA4-0D26478A5272} 15 | QtVS_v304 16 | 8.1 17 | 8.1 18 | $(MSBuildProjectDirectory)\QtMsBuild 19 | 20 | 21 | 22 | Application 23 | v140 24 | 25 | 26 | Application 27 | v140 28 | 29 | 30 | 31 | 32 | 33 | 34 | msvc2015_64 35 | core;gui;widgets 36 | debug 37 | 38 | 39 | msvc2015_64 40 | core;gui;widgets 41 | release 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | $(SolutionDir)..\_Bin\$(ProjectName)\$(Platform)_$(Configuration)\ 61 | $(SolutionDir)..\_Temp\$(ProjectName)\$(Platform)_$(Configuration)\ 62 | 63 | 64 | $(SolutionDir)..\_Bin\$(ProjectName)\$(Platform)_$(Configuration)\ 65 | $(SolutionDir)..\_Temp\$(ProjectName)\$(Platform)_$(Configuration)\ 66 | 67 | 68 | 69 | true 70 | true 71 | ProgramDatabase 72 | Disabled 73 | MultiThreadedDebugDLL 74 | 75 | 76 | Console 77 | true 78 | 79 | 80 | 81 | 82 | true 83 | true 84 | None 85 | MaxSpeed 86 | MultiThreadedDLL 87 | 88 | 89 | Windows 90 | false 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | Designer 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /Projects/VS2015/OCC.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {1375a0b9-9c03-428b-a166-1e49f5860683} 6 | 7 | 8 | {a13adee4-7caa-4f3f-9331-6c5a8aedea31} 9 | 10 | 11 | {f7041ee9-87ed-417c-9a54-3a1cae6307df} 12 | 13 | 14 | {32a79917-fc25-4cd8-95a0-abb9452e789d} 15 | 16 | 17 | {b2cdbf4a-e755-4c03-8d3d-bed1527a3c8b} 18 | 19 | 20 | {c9b493b3-df3b-4697-860d-b279642382e5} 21 | 22 | 23 | {bdfe0279-0465-4017-ba85-c1c89692c8d0} 24 | 25 | 26 | 27 | 28 | _Frame\docview 29 | 30 | 31 | _Frame\docview 32 | 33 | 34 | _Frame\mdichild 35 | 36 | 37 | _Frame\mdichild 38 | 39 | 40 | _Frame\mdichild 41 | 42 | 43 | _Frame\mdichild 44 | 45 | 46 | _Frame\mdichild 47 | 48 | 49 | _Frame\QTGUI 50 | 51 | 52 | _Frame\QTGUI 53 | 54 | 55 | _Frame\QTGUI 56 | 57 | 58 | _Frame\QTGUI 59 | 60 | 61 | _Frame 62 | 63 | 64 | _Frame 65 | 66 | 67 | _Frame 68 | 69 | 70 | OCCT(自定义) 71 | 72 | 73 | OCCT(自定义) 74 | 75 | 76 | OCCT(自定义) 77 | 78 | 79 | OCCT(自定义)\View 80 | 81 | 82 | OCCT(自定义)\View 83 | 84 | 85 | _Frame\QTGUI 86 | 87 | 88 | 89 | 90 | _Frame\mdichild 91 | 92 | 93 | _Frame\QTGUI 94 | 95 | 96 | _Frame 97 | 98 | 99 | OCCT(自定义)\View 100 | 101 | 102 | 103 | 104 | _Frame\docview 105 | 106 | 107 | _Frame\docview 108 | 109 | 110 | _Frame\QTGUI 111 | 112 | 113 | _Frame\QTGUI 114 | 115 | 116 | _Frame\QTGUI 117 | 118 | 119 | _Frame\QTGUI 120 | 121 | 122 | OCCT(自定义) 123 | 124 | 125 | OCCT(自定义) 126 | 127 | 128 | OCCT(自定义) 129 | 130 | 131 | OCCT(自定义) 132 | 133 | 134 | OCCT(自定义) 135 | 136 | 137 | OCCT(自定义) 138 | 139 | 140 | OCCT(自定义)\View 141 | 142 | 143 | _Frame 144 | 145 | 146 | Resource 147 | 148 | 149 | 150 | 151 | Resource 152 | 153 | 154 | -------------------------------------------------------------------------------- /Projects/VS2015/OCC.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Projects/VS2015/OCCT_PropertySheet.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | TKBin.lib;TKBinL.lib;TKBinTObj.lib;TKBinXCAF.lib;TKBO.lib;TKBool.lib;TKBRep.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKIGES.lib;TKLCAF.lib;TKMath.lib;TKMesh.lib;TKMeshVS.lib;TKOffset.lib;TKOpenGl.lib;TKPrim.lib;TKRWMesh.lib;TKService.lib;TKShHealing.lib;TKStd.lib;TKStdL.lib;TKSTEP.lib;TKSTEP209.lib;TKSTEPAttr.lib;TKSTEPBase.lib;TKSTL.lib;TKTObj.lib;TKTopAlgo.lib;TKV3d.lib;TKVCAF.lib;TKVRML.lib;TKXCAF.lib;TKXDEIGES.lib;TKXDESTEP.lib;TKXMesh.lib;TKXml.lib;TKXmlL.lib;TKXmlTObj.lib;TKXmlXCAF.lib;TKXSBase.lib;%(AdditionalDependencies) 9 | $(CSF_OCCTLibPath);%(AdditionalLibraryDirectories) 10 | 11 | 12 | $(CSF_OCCTIncludePath);%(AdditionalIncludeDirectories) 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Projects/VS2015/_env_old.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/Projects/VS2015/_env_old.bat -------------------------------------------------------------------------------- /Projects/VS2015/_msvc_old.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | Setlocal EnableDelayedExpansion 4 | 5 | rem Setup environment 6 | call "%~dp0_env_old.bat" vc14 win64 %3 7 | 8 | rem Define path to project file 9 | set "PRJFILE=%~dp0OCC.sln" 10 | 11 | rem Launch Visual Studio - either professional (devenv) or Express, as available 12 | if exist "%DevEnvDir%\devenv.exe" ( 13 | start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%" 14 | ) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" ( 15 | start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%" 16 | ) else ( 17 | echo Error: Could not find MS Visual Studio ^(%VCFMT%^) 18 | echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^) 19 | ) 20 | -------------------------------------------------------------------------------- /Projects/VS2015/msvc_new.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | Setlocal EnableDelayedExpansion 4 | 5 | rem Setup environment 6 | SET PATH=%PATH%;../../OCC-Lib/MSVC_win64_vc14/bin; 7 | SET "CSF_OCCTIncludePath=../../OCC-Lib/inc" 8 | SET "CSF_OCCTLibPath=../../OCC-Lib/MSVC_win64_vc14/lib" 9 | 10 | rem Define path to project file 11 | start "" "OCC.sln" 12 | -------------------------------------------------------------------------------- /Projects/VS2015/新方法请启动msvc_new.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/Projects/VS2015/新方法请启动msvc_new.txt -------------------------------------------------------------------------------- /Projects/VS2015/老方法请启动_msvc_old.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/Projects/VS2015/老方法请启动_msvc_old.txt -------------------------------------------------------------------------------- /README OLD.md: -------------------------------------------------------------------------------- 1 | # OCC-QT-Demo 2 | OpenCacade7.5.0 QT5 示例 3 | ## 1.环境安装 4 | 1.0 VS2015/VS2017/VS2019 5 | 6 | 1.1 下载OpenCascade7.5.0并安装 7 | 官网 (外网可能有点慢)https://old.opencascade.com/content/latest-release 8 | 微云 链接:https://share.weiyun.com/1bM7dI5G 密码:9v2nuf 9 | 10 | 1.2 QT安装 11 | QT5.12.7 https://download.qt.io/archive/qt/5.12/5.12.7/qt-opensource-windows-x86-5.12.7.exe 12 | QT for VS 插件 https://download.qt.io/official_releases/vsaddin/2.5.2/qt-vsaddin-msvc2015-2.5.2-rev.01.vsix 13 | 14 | 1.3 安装视频 15 | 环境配置可参照视频 https://www.bilibili.com/video/BV12T4y1P7Z3?share_source=copy_web 16 | ## 2.VS项目启动 17 | 修改环境变量 *env.bat* 中 18 | ```set "OCCT_7_5_0=E:\OpenCASCADE-7.5.0-vc14-64"``` 19 | 然后点击 *msvc.bat* 启动(务必) 20 | *PS:OpenCascade使用的其他三方库的需要配置,使用批命令(.bat)的方式启动省去了设置这些三方库* 21 | *OpenCascade安装路径下面的QT只有Release的库,因此只能编写Release版本的QT程序,建议另外安装QT。参照1.2下载地址和1.3安装视频* 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OCC-QT-Demo 2 | 3 | ## 1.环境安装 4 | 1.0 VS2015/VS2017/VS2019 5 | 6 | 1.1 QT安装 7 | QT5.12.7 https://download.qt.io/archive/qt/5.12/5.12.7/qt-opensource-windows-x86-5.12.7.exe 8 | QT for VS 插件 https://download.qt.io/official_releases/vsaddin/2.5.2/qt-vsaddin-msvc2015-2.5.2-rev.01.vsix 9 | 10 | 1.2 OCCT 11 | OpenCascade7.5.0已经安装并且编译好,无其他三方库依赖(精简版本) 12 | 13 | ## 2.VS项目启动 14 | 2.1 vs2015 15 | 启动 projects/VS2015/msvc_new.bat 16 | 17 | 2.2 QT Creator+VC14(VS2015编译器) 18 | 启动 projects/QtCreator_MSVC/msvc_pro.bat 19 | 20 | 2.3 QT Creator+MinGW(安装QT时可安装) 21 | 启动 projects/QtCreator_MINGW/mingw_pro.bat 22 | 23 | 2.4 旧的方式 24 | 旧的启动方式请参照README_OLD.md 25 | *安装设置OCCT然后修改env.bat* 26 | 启动 projects/VS2015/_msvc_old.bat -------------------------------------------------------------------------------- /src/ComplainUtf8.h: -------------------------------------------------------------------------------- 1 | #if defined(_MSC_VER) && (_MSC_VER >= 1600) 2 | # pragma execution_character_set("utf-8") 3 | #endif 4 | -------------------------------------------------------------------------------- /src/GUI_Message.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/GUI_Message.cpp -------------------------------------------------------------------------------- /src/GUI_Message.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Msg.h" 3 | 4 | #include 5 | #include 6 | 7 | class GUI_Message : public QListView 8 | ,public Messager 9 | { 10 | Q_OBJECT 11 | public: 12 | GUI_Message(QWidget *parent); 13 | void ShowMessage(int Type, const OCCT_Utf8String & Message) override; 14 | void DebugMessage(int Type, const OCCT_Utf8String & Message) override; 15 | ~GUI_Message(); 16 | 17 | void SetCurrentMessager(); 18 | protected: 19 | void contextMenuEvent(QContextMenuEvent *event) override; 20 | private: 21 | QStandardItemModel * p_Model; 22 | }; 23 | -------------------------------------------------------------------------------- /src/Icon.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Icon.h -------------------------------------------------------------------------------- /src/MainWindow.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/MainWindow.cpp -------------------------------------------------------------------------------- /src/MainWindow.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MAINWINDOW_H 3 | #define MAINWINDOW_H 4 | 5 | #include 6 | 7 | class MdiChild; 8 | QT_BEGIN_NAMESPACE 9 | class QAction; 10 | class QMenu; 11 | class QMdiArea; 12 | class QMdiSubWindow; 13 | QT_END_NAMESPACE 14 | 15 | class MainWindow : public QMainWindow 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | MainWindow(); 21 | virtual ~MainWindow(); 22 | bool openFile(const QString &fileName); 23 | protected: 24 | void closeEvent(QCloseEvent *event) override; 25 | 26 | private slots: 27 | void newFile(); 28 | void open(); 29 | void save(); 30 | void saveAs(); 31 | void updateRecentFileActions(); 32 | void openRecentFile(); 33 | void about(); 34 | void updateMenus(); 35 | void updateMDIMenus(); 36 | void updateWindowMenu(); 37 | MdiChild *createMdiChild(); 38 | void switchLayoutDirection(); 39 | private: 40 | enum { MaxRecentFiles = 5 }; 41 | 42 | void createActions(); 43 | void createMDIActions(); 44 | void createStatusBar(); 45 | void readSettings(); 46 | void writeSettings(); 47 | bool loadFile(const QString &fileName); 48 | static bool hasRecentFiles(); 49 | void prependToRecentFiles(const QString &fileName,bool Add = true); 50 | void setRecentFilesVisible(bool visible); 51 | MdiChild *activeMdiChild() const; 52 | QMdiSubWindow *findMdiChild(const QString &fileName) const; 53 | 54 | QMdiArea * mdiArea; 55 | QMenu * windowMenu; 56 | QAction * newAct; 57 | QAction * openAct; 58 | QAction * saveAct; 59 | QAction * saveAsAct; 60 | QAction * recentFileActs[MaxRecentFiles]; 61 | QAction * recentFileSeparator; 62 | QAction * recentFileSubMenuAct; 63 | QAction * closeAct; 64 | QAction * closeAllAct; 65 | QAction * tileAct; 66 | QAction * cascadeAct; 67 | QAction * nextAct; 68 | QAction * previousAct; 69 | QAction * windowMenuSeparatorAct; 70 | private: 71 | QMenu * Mdi_ViewMenu; 72 | QList ChildMenus; 73 | QList ChildToolBars; 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/MainWindow2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/MainWindow2.cpp -------------------------------------------------------------------------------- /src/Msg.cpp: -------------------------------------------------------------------------------- 1 | #include "Msg.h" 2 | #include 3 | #include 4 | 5 | #ifdef __APPLE__ 6 | // There are a lot of *_l functions availalbe on Mac OS X - we use them 7 | #define SAVE_TL() 8 | #elif defined(_MSC_VER) 9 | // MSVCRT has equivalents with slightly different syntax 10 | #define SAVE_TL() 11 | #define strtod_l(thePtr, theNextPtr, theLocale) _strtod_l(thePtr, theNextPtr, theLocale) 12 | #define vprintf_l(theLocale, theFormat, theArgPtr) _vprintf_l(theFormat, theLocale, theArgPtr) 13 | #define vsprintf_l(theBuffer, theLocale, theFormat, theArgPtr) _vsprintf_l(theBuffer, theFormat, theLocale, theArgPtr) 14 | #define vfprintf_l(theFile, theLocale, theFormat, theArgPtr) _vfprintf_l(theFile, theFormat, theLocale, theArgPtr) 15 | #else 16 | // glibc provides only limited xlocale implementation: 17 | // strtod_l/strtol_l/strtoll_l functions with explicitly specified locale 18 | // and newlocale/uselocale/freelocale to switch locale within current thread only. 19 | // So we switch to C locale temporarily 20 | #define SAVE_TL() Standard_CLocaleSentry aLocaleSentry; 21 | #ifndef OCCT_CLOCALE_POSIX2008 22 | // glibc version for android platform use locale-independent implementation of 23 | // strtod, strtol, strtoll functions. For other system with locale-depended 24 | // implementations problems may appear if "C" locale is not set explicitly. 25 | #if !defined(__ANDROID__) && !defined(__QNX__) && !defined(__MINGW32__) 26 | #error System does not support xlocale. Import/export could be broken if C locale did not specified by application. 27 | #endif 28 | #define strtod_l(thePtr, theNextPtr, theLocale) strtod(thePtr, theNextPtr) 29 | #endif 30 | #define vprintf_l(theLocale, theFormat, theArgPtr) vprintf(theFormat, theArgPtr) 31 | #define vsprintf_l(theBuffer, theLocale, theFormat, theArgPtr) vsprintf(theBuffer, theFormat, theArgPtr) 32 | #define vfprintf_l(theFile, theLocale, theFormat, theArgPtr) vfprintf(theFile, theFormat, theArgPtr) 33 | #endif 34 | 35 | NCollection_Map Msg::m_Msgrs = NCollection_Map(); 36 | Messager * Msg::m_CurrentMsgr = nullptr; 37 | 38 | void Msg::AddMessager(Messager * pMsgr) 39 | { 40 | if (pMsgr != nullptr && m_Msgrs.Contains(pMsgr) == false) 41 | m_Msgrs.Add(pMsgr); 42 | } 43 | 44 | void Msg::RemoveMessager(Messager * pMsgr) 45 | { 46 | if (pMsgr != nullptr) 47 | m_Msgrs.Remove(pMsgr); 48 | } 49 | 50 | void Msg::SetCurrentMessager(Messager * pMsgr) 51 | { 52 | m_CurrentMsgr = pMsgr; 53 | } 54 | 55 | void Msg::RemoveCurrentMessager() 56 | { 57 | m_CurrentMsgr = nullptr; 58 | } 59 | 60 | void Msg::ShowInfo(const OCCT_Utf8String & Message, bool Global) 61 | { 62 | if (Global) 63 | { 64 | NCollection_Map::Iterator Itor(m_Msgrs); 65 | for (; Itor.More(); Itor.Next()) 66 | Itor.Value()->ShowMessage(Msg_Info, Message); 67 | } 68 | else 69 | { 70 | if(m_CurrentMsgr) 71 | m_CurrentMsgr->ShowMessage(Msg_Info, Message); 72 | } 73 | } 74 | 75 | void Msg::ShowWaring(const OCCT_Utf8String & Message, bool Global) 76 | { 77 | if (Global) 78 | { 79 | NCollection_Map::Iterator Itor(m_Msgrs); 80 | for (; Itor.More(); Itor.Next()) 81 | Itor.Value()->ShowMessage(Msg_Waring, Message); 82 | } 83 | else 84 | { 85 | if (m_CurrentMsgr) 86 | m_CurrentMsgr->ShowMessage(Msg_Waring, Message); 87 | } 88 | } 89 | 90 | void Msg::ShowError(const OCCT_Utf8String & Message, bool Global) 91 | { 92 | if (Global) 93 | { 94 | NCollection_Map::Iterator Itor(m_Msgrs); 95 | for (; Itor.More(); Itor.Next()) 96 | Itor.Value()->ShowMessage(Msg_Error, Message); 97 | } 98 | else 99 | { 100 | if (m_CurrentMsgr) 101 | m_CurrentMsgr->ShowMessage(Msg_Error, Message); 102 | } 103 | } 104 | 105 | void Msg::ShowInfo(bool Global, const char * theFormat, ...) 106 | { 107 | char theBuffer[1024]; 108 | SAVE_TL(); 109 | va_list argp; 110 | va_start(argp, theFormat); 111 | int result = vsprintf_l(theBuffer, Standard_CLocaleSentry::GetCLocale(), theFormat, argp); 112 | va_end(argp); 113 | Msg::ShowInfo(theBuffer, Global); 114 | } 115 | 116 | void Msg::ShowWaring(bool Global, const char * theFormat, ...) 117 | { 118 | char theBuffer[1024]; 119 | SAVE_TL(); 120 | va_list argp; 121 | va_start(argp, theFormat); 122 | int result = vsprintf_l(theBuffer, Standard_CLocaleSentry::GetCLocale(), theFormat, argp); 123 | va_end(argp); 124 | Msg::ShowWaring(theBuffer, Global); 125 | } 126 | 127 | void Msg::ShowError(bool Global, const char * theFormat, ...) 128 | { 129 | char theBuffer[1024]; 130 | SAVE_TL(); 131 | va_list argp; 132 | va_start(argp, theFormat); 133 | int result = vsprintf_l(theBuffer, Standard_CLocaleSentry::GetCLocale(), theFormat, argp); 134 | va_end(argp); 135 | Msg::ShowError(theBuffer, Global); 136 | } 137 | 138 | 139 | void Msg::DebugInfo(const OCCT_Utf8String & Message, bool Global) 140 | { 141 | if (Global) 142 | { 143 | NCollection_Map::Iterator Itor(m_Msgrs); 144 | for (; Itor.More(); Itor.Next()) 145 | Itor.Value()->DebugMessage(Msg_Info, Message); 146 | } 147 | else 148 | { 149 | if (m_CurrentMsgr) 150 | m_CurrentMsgr->DebugMessage(Msg_Info, Message); 151 | } 152 | } 153 | 154 | void Msg::DebugWaring(const OCCT_Utf8String & Message, bool Global) 155 | { 156 | if (Global) 157 | { 158 | NCollection_Map::Iterator Itor(m_Msgrs); 159 | for (; Itor.More(); Itor.Next()) 160 | Itor.Value()->DebugMessage(Msg_Waring, Message); 161 | } 162 | else 163 | { 164 | if (m_CurrentMsgr) 165 | m_CurrentMsgr->DebugMessage(Msg_Waring, Message); 166 | } 167 | } 168 | 169 | void Msg::DebugError(const OCCT_Utf8String & Message, bool Global) 170 | { 171 | if (Global) 172 | { 173 | NCollection_Map::Iterator Itor(m_Msgrs); 174 | for (; Itor.More(); Itor.Next()) 175 | Itor.Value()->DebugMessage(Msg_Error, Message); 176 | } 177 | else 178 | { 179 | if (m_CurrentMsgr) 180 | m_CurrentMsgr->DebugMessage(Msg_Error, Message); 181 | } 182 | } 183 | 184 | void Msg::DebugInfo(bool Global, const char * theFormat, ...) 185 | { 186 | char theBuffer[1024]; 187 | SAVE_TL(); 188 | va_list argp; 189 | va_start(argp, theFormat); 190 | int result = vsprintf_l(theBuffer, Standard_CLocaleSentry::GetCLocale(), theFormat, argp); 191 | va_end(argp); 192 | Msg::DebugInfo(theBuffer, Global); 193 | } 194 | 195 | void Msg::DebugWaring(bool Global, const char * theFormat, ...) 196 | { 197 | char theBuffer[1024]; 198 | SAVE_TL(); 199 | va_list argp; 200 | va_start(argp, theFormat); 201 | int result = vsprintf_l(theBuffer, Standard_CLocaleSentry::GetCLocale(), theFormat, argp); 202 | va_end(argp); 203 | Msg::DebugWaring(theBuffer, Global); 204 | } 205 | 206 | void Msg::DebugError(bool Global, const char * theFormat, ...) 207 | { 208 | char theBuffer[1024]; 209 | SAVE_TL(); 210 | va_list argp; 211 | va_start(argp, theFormat); 212 | int result = vsprintf_l(theBuffer, Standard_CLocaleSentry::GetCLocale(), theFormat, argp); 213 | va_end(argp); 214 | Msg::DebugError(theBuffer, Global); 215 | } 216 | 217 | -------------------------------------------------------------------------------- /src/Msg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "OCCT_Utf8String.h" 3 | #include 4 | 5 | #define Msg_Info (0x0) 6 | #define Msg_Waring (0x1) 7 | #define Msg_Error (0x2) 8 | 9 | class Messager 10 | { 11 | public: 12 | Messager() {}; 13 | virtual ~Messager() {}; 14 | virtual void ShowMessage(int Type, const OCCT_Utf8String & Message) = 0; 15 | virtual void DebugMessage(int Type, const OCCT_Utf8String & Message) = 0; 16 | }; 17 | 18 | class Msg 19 | { 20 | public: 21 | static void AddMessager(Messager * pMsgr); 22 | static void RemoveMessager(Messager * pMsgr); 23 | 24 | static void SetCurrentMessager(Messager * pMsgr); 25 | static void RemoveCurrentMessager(); 26 | static Messager * GetCurrentMessager() {return m_CurrentMsgr;} 27 | 28 | static void ShowInfo(const OCCT_Utf8String & Message, bool Global = false); 29 | static void ShowWaring(const OCCT_Utf8String & Message, bool Global = false); 30 | static void ShowError(const OCCT_Utf8String & Message, bool Global = false); 31 | 32 | static void ShowInfo(bool Global,const char* theFormat, ...); 33 | static void ShowWaring(bool Global,const char* theFormat, ...); 34 | static void ShowError(bool Global,const char* theFormat, ...); 35 | 36 | static void DebugInfo(const OCCT_Utf8String & Message, bool Global = false); 37 | static void DebugWaring(const OCCT_Utf8String & Message, bool Global = false); 38 | static void DebugError(const OCCT_Utf8String & Message, bool Global = false); 39 | 40 | static void DebugInfo(bool Global, const char* theFormat, ...); 41 | static void DebugWaring(bool Global, const char* theFormat, ...); 42 | static void DebugError(bool Global, const char* theFormat, ...); 43 | private: 44 | Msg() {} 45 | virtual ~Msg() {} 46 | protected: 47 | static NCollection_Map m_Msgrs; 48 | static Messager * m_CurrentMsgr; 49 | }; 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/MsgUI.cpp: -------------------------------------------------------------------------------- 1 | #include "MsgUI.h" 2 | 3 | MsgUIer * MsgUI::p_UIer = nullptr; 4 | MsgUI::MsgUI() 5 | { 6 | } 7 | 8 | MsgUI::~MsgUI() 9 | { 10 | } 11 | 12 | void MsgUI::SetUIer(MsgUIer * pUIer) 13 | { 14 | p_UIer = pUIer; 15 | } 16 | 17 | //#include "GUI_Dialogs.h" 18 | int MsgUI::GetChoose(const OCCT_Utf8String & Title, const OCCT_Utf8StringList & ChooseList) 19 | { 20 | if (p_UIer) 21 | return p_UIer->GetChoose(Title, ChooseList); 22 | else 23 | return -1; 24 | } 25 | 26 | OCCT_Utf8String MsgUI::GetInPut(const OCCT_Utf8String & Title) 27 | { 28 | if (p_UIer) 29 | return p_UIer->GetInPut(Title); 30 | else 31 | return ""; 32 | //return GUI_Dialogs::GetInPut(Title.ToCString()).toUtf8().data(); 33 | } 34 | 35 | Standard_Boolean MsgUI::YesOrNo(const OCCT_Utf8String & Title, const OCCT_Utf8String & Message) 36 | { 37 | if (p_UIer) 38 | return p_UIer->YesOrNo(Title, Message); 39 | else 40 | return Standard_False; 41 | //return GUI_Dialogs::YesOrNo(Title.ToCString(),Message.ToCString()); 42 | } 43 | 44 | NCollection_List MsgUI::GetChoose(const OCCT_Utf8String & Title, 45 | const NCollection_DataMap & Map) 46 | { 47 | if (p_UIer) 48 | return p_UIer->GetChoose(Title, Map); 49 | else 50 | return NCollection_List(); 51 | } 52 | -------------------------------------------------------------------------------- /src/MsgUI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "OCCT_Utf8String.h" 3 | #include "OCCT_Utf8StringList.h" 4 | #include 5 | 6 | class MsgUIer 7 | { 8 | public: 9 | MsgUIer() {}; 10 | virtual ~MsgUIer(){}; 11 | virtual int GetChoose(const OCCT_Utf8String & Title, const OCCT_Utf8StringList & ChooseList) = 0; 12 | virtual OCCT_Utf8String GetInPut(const OCCT_Utf8String & Title) = 0; 13 | virtual Standard_Boolean YesOrNo(const OCCT_Utf8String & Title, const OCCT_Utf8String & Message) = 0; 14 | virtual NCollection_List GetChoose(const OCCT_Utf8String & Title, 15 | const NCollection_DataMap & Map) = 0; 16 | }; 17 | 18 | class MsgUI 19 | { 20 | public: 21 | MsgUI(); 22 | virtual ~MsgUI(); 23 | static void SetUIer(MsgUIer * pUIer); 24 | 25 | static int GetChoose(const OCCT_Utf8String & Title, const OCCT_Utf8StringList & ChooseList); 26 | static OCCT_Utf8String GetInPut(const OCCT_Utf8String & Title); 27 | static Standard_Boolean YesOrNo(const OCCT_Utf8String & Title,const OCCT_Utf8String & Message); 28 | static NCollection_List GetChoose(const OCCT_Utf8String & Title, 29 | const NCollection_DataMap & Map); 30 | private: 31 | static MsgUIer * p_UIer; 32 | }; 33 | 34 | -------------------------------------------------------------------------------- /src/MyDocument.cpp: -------------------------------------------------------------------------------- 1 | #include "MyDocument.h" 2 | 3 | IMPLEMENT_STANDARD_RTTIEXT(MyDocument, Standard_Transient) 4 | MyDocument::MyDocument() 5 | { 6 | } 7 | 8 | MyDocument::~MyDocument() 9 | { 10 | } 11 | 12 | //void Document::SaveData(ByteOStream & out) const 13 | //{ 14 | //} 15 | // 16 | //void Document::LoadData(ByteIStream & in) 17 | //{ 18 | //} 19 | -------------------------------------------------------------------------------- /src/MyDocument.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | class MyDocument 7 | :public Standard_Transient 8 | { 9 | DEFINE_STANDARD_RTTIEXT(MyDocument, Standard_Transient) 10 | public: 11 | MyDocument(); 12 | virtual ~MyDocument(); 13 | 14 | void setModified(bool) {} 15 | bool isModified() { return false; } 16 | 17 | //virtual void SaveData(ByteOStream & out) const; 18 | //virtual void LoadData(ByteIStream & in); 19 | private: 20 | }; 21 | DEFINE_STANDARD_HANDLE(MyDocument, Standard_Transient) 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/MyViewer.cpp: -------------------------------------------------------------------------------- 1 | #include "MyViewer.h" 2 | #include "OCCT_GraphDriver.h" 3 | #include "AIS_Shape.hxx" 4 | 5 | IMPLEMENT_STANDARD_RTTIEXT(MyViewer, Standard_Transient) 6 | MyViewer::MyViewer(const Handle(MyDocument) & hDoc) 7 | :h_Doc(hDoc) 8 | { 9 | h_Viewer = OCCT_GraphDriver::CreateViewer(); 10 | h_AisContext = OCCT_GraphDriver::CreateAISContext(h_Viewer); 11 | h_TempAisContext = OCCT_GraphDriver::CreateAISContext(h_Viewer); 12 | h_Viewer->Update(); 13 | } 14 | 15 | MyViewer::~MyViewer() 16 | { 17 | } 18 | 19 | const Handle(MyDocument) & MyViewer::getDocument() 20 | { 21 | return h_Doc; 22 | } 23 | 24 | void MyViewer::selectionChanged() 25 | { 26 | } 27 | 28 | void MyViewer::Display(const TopoDS_Shape & Shape) 29 | { 30 | Handle(AIS_Shape) hAisShape = new AIS_Shape(Shape); 31 | h_AisContext->Display(hAisShape,Standard_True); 32 | } 33 | 34 | NCollection_List MyViewer::GetAisObj() 35 | { 36 | NCollection_List Objs; 37 | h_AisContext->DisplayedObjects(Objs); 38 | return Objs; 39 | } 40 | 41 | NCollection_List MyViewer::GetSelAisObj() 42 | { 43 | NCollection_List Objs; 44 | h_AisContext->InitSelected(); 45 | for (; h_AisContext->MoreSelected(); h_AisContext->NextSelected()) 46 | { 47 | 48 | const Handle(AIS_InteractiveObject) & AisObj = h_AisContext->SelectedInteractive(); 49 | if (AisObj) 50 | Objs.Append(AisObj); 51 | } 52 | return Objs; 53 | } 54 | 55 | 56 | bool MyViewer::getAisObjColor(Quantity_Color & Color) 57 | { 58 | Color = Quantity_NOC_YELLOW; 59 | h_AisContext->InitSelected(); 60 | if (h_AisContext->MoreSelected()) 61 | { 62 | Handle(AIS_InteractiveObject) H_AisObj = h_AisContext->SelectedInteractive(); 63 | H_AisObj->Color(Color); 64 | return true; 65 | } 66 | else 67 | return false; 68 | } 69 | 70 | void MyViewer::AisObjColor(Quantity_Color Color) 71 | { 72 | for (h_AisContext->InitSelected(); h_AisContext->MoreSelected(); h_AisContext->NextSelected()) 73 | { 74 | Handle(AIS_InteractiveObject) H_AisObj = h_AisContext->SelectedInteractive(); 75 | H_AisObj->SetColor(Color); 76 | H_AisObj->Redisplay(); 77 | } 78 | h_AisContext->UpdateCurrentViewer(); 79 | } 80 | 81 | void MyViewer::AisObjUnColor() 82 | { 83 | for (h_AisContext->InitSelected(); h_AisContext->MoreSelected(); h_AisContext->NextSelected()) 84 | { 85 | Handle(AIS_InteractiveObject) H_AisObj = h_AisContext->SelectedInteractive(); 86 | H_AisObj->UnsetColor(); 87 | H_AisObj->Redisplay(); 88 | } 89 | h_AisContext->UpdateCurrentViewer(); 90 | } 91 | 92 | void MyViewer::AisObjTransparency(Standard_Real Transparency) 93 | { 94 | for (h_AisContext->InitSelected(); h_AisContext->MoreSelected(); h_AisContext->NextSelected()) 95 | { 96 | Handle(AIS_InteractiveObject) H_AisObj = h_AisContext->SelectedInteractive(); 97 | H_AisObj->SetTransparency(Transparency); 98 | } 99 | } 100 | 101 | void MyViewer::AisObjUnTransparency() 102 | { 103 | for (h_AisContext->InitSelected(); h_AisContext->MoreSelected(); h_AisContext->NextSelected()) 104 | { 105 | Handle(AIS_InteractiveObject) H_AisObj = h_AisContext->SelectedInteractive(); 106 | H_AisObj->UnsetTransparency(); 107 | } 108 | } 109 | 110 | void MyViewer::AisObjDisplayAll() 111 | { 112 | h_AisContext->DisplayAll(Standard_True); 113 | } 114 | 115 | void MyViewer::AisObjEraseAll() 116 | { 117 | h_AisContext->EraseAll(Standard_True); 118 | } 119 | 120 | void MyViewer::AisObjHide() 121 | { 122 | for (h_AisContext->InitSelected(); h_AisContext->MoreSelected(); /*h_AisContext->NextSelected()*/) 123 | { 124 | Handle(AIS_InteractiveObject) H_AisObj = h_AisContext->SelectedInteractive(); 125 | if (!H_AisObj.IsNull()) 126 | { 127 | h_AisContext->Erase(H_AisObj, Standard_False); 128 | } 129 | } 130 | h_AisContext->UpdateCurrentViewer(); 131 | } 132 | 133 | void MyViewer::AisObjWireFrame() 134 | { 135 | h_AisContext->SetDisplayMode(0, Standard_True); 136 | for (h_AisContext->InitSelected(); h_AisContext->MoreSelected(); h_AisContext->NextSelected()) 137 | { 138 | h_AisContext->SetDisplayMode(h_AisContext->SelectedInteractive(), 0, Standard_True); 139 | h_AisContext->Redisplay(h_AisContext->SelectedInteractive(), Standard_True); 140 | } 141 | h_AisContext->UpdateCurrentViewer(); 142 | } 143 | 144 | void MyViewer::AisObjShaded() 145 | { 146 | for (h_AisContext->InitSelected(); h_AisContext->MoreSelected(); h_AisContext->NextSelected()) 147 | h_AisContext->SetDisplayMode(h_AisContext->SelectedInteractive(), 1, Standard_False); 148 | h_AisContext->UpdateCurrentViewer(); 149 | } 150 | 151 | Quantity_Color MyViewer::getAisSelColor() 152 | { 153 | Handle(Prs3d_Drawer) theStyle = h_AisContext->SelectionStyle(); 154 | return theStyle->Color(); 155 | } 156 | 157 | #include 158 | #include 159 | #include 160 | 161 | void MyViewer::AisSelColor(Quantity_Color Color) 162 | { 163 | Handle(Prs3d_Drawer) theStyle = h_AisContext->SelectionStyle(); 164 | theStyle->SetColor(Color); 165 | theStyle->SectionAspect()->SetColor(Color); 166 | theStyle->PlaneAspect()->EdgesAspect()->SetColor(Color); 167 | theStyle->PointAspect()->SetColor(Color); 168 | h_AisContext->UpdateCurrentViewer(); 169 | } 170 | -------------------------------------------------------------------------------- /src/MyViewer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/MyViewer.h -------------------------------------------------------------------------------- /src/OCCT_GraphDriver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/OCCT_GraphDriver.cpp -------------------------------------------------------------------------------- /src/OCCT_GraphDriver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/OCCT_GraphDriver.h -------------------------------------------------------------------------------- /src/OCCT_ShapeExport.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/OCCT_ShapeExport.cpp -------------------------------------------------------------------------------- /src/OCCT_ShapeExport.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "OCCT_ShapeList.h" 3 | #include "OCCT_Utf8String.h" 4 | 5 | enum OCCT_ShapeExportModelFileType 6 | { 7 | MFT_BREP, 8 | MFT_STEP, 9 | MFT_IGES, 10 | MFT_STL, 11 | MFT_NULL 12 | }; 13 | 14 | class OCCT_ShapeExportUI 15 | { 16 | public: 17 | typedef OCCT_ShapeExportModelFileType ModelFileType; 18 | public: 19 | OCCT_ShapeExportUI() {}; 20 | virtual ~OCCT_ShapeExportUI() {}; 21 | 22 | virtual OCCT_Utf8String getSavePathFolder(ModelFileType & FileType) = 0; 23 | virtual OCCT_Utf8String getSavePath(ModelFileType & FileType) = 0; 24 | 25 | virtual void showPathSuccess(const OCCT_Utf8String & Path) = 0; 26 | virtual void showPathError(const OCCT_Utf8String & Path) = 0; 27 | virtual void showError(const OCCT_Utf8String & ErrorMsg) = 0; 28 | virtual void showSuccess(const OCCT_Utf8String & ErrorMsg) = 0; 29 | 30 | virtual void BeginWaitCursor() = 0; 31 | virtual void EndWaitCursor() = 0; 32 | }; 33 | 34 | class OCCT_ShapeExport 35 | { 36 | typedef OCCT_ShapeExportModelFileType ModelFileType; 37 | public: 38 | OCCT_ShapeExport(OCCT_ShapeExportUI * pUI); 39 | virtual ~OCCT_ShapeExport(); 40 | 41 | void ExportModel(OCCT_ShapeList theExportList); 42 | void ExportMutiModel(OCCT_ShapeList theExportList); 43 | private: 44 | OCCT_ShapeExportUI * p_UI; 45 | }; 46 | 47 | -------------------------------------------------------------------------------- /src/OCCT_ShapeImport.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/OCCT_ShapeImport.cpp -------------------------------------------------------------------------------- /src/OCCT_ShapeImport.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "OCCT_ShapeList.h" 3 | #include "OCCT_Utf8StringList.h" 4 | 5 | class OCCT_ShapeImportUI 6 | { 7 | public: 8 | OCCT_ShapeImportUI() {}; 9 | virtual ~OCCT_ShapeImportUI() {}; 10 | 11 | virtual OCCT_Utf8String getExtUpper(const OCCT_Utf8String & Utf8String) = 0; 12 | virtual OCCT_Utf8StringList getLoadPathList() = 0; 13 | virtual OCCT_Utf8String getLoadPath() = 0; 14 | 15 | virtual void showPathSuccess(const OCCT_Utf8String & Path) = 0; 16 | virtual void showPathError(const OCCT_Utf8String & Path) = 0; 17 | virtual void showError(const OCCT_Utf8String & ErrorMsg) = 0; 18 | virtual void showSuccess(const OCCT_Utf8String & ErrorMsg) = 0; 19 | virtual void BeginWaitCursor() = 0; 20 | virtual void EndWaitCursor() = 0; 21 | }; 22 | 23 | class OCCT_ShapeImport 24 | { 25 | public: 26 | OCCT_ShapeImport(OCCT_ShapeImportUI * pUI); 27 | virtual ~OCCT_ShapeImport(); 28 | 29 | OCCT_ShapeList ImportModel(); 30 | OCCT_ShapeList ImportModel(const OCCT_Utf8String & Path); 31 | private: 32 | OCCT_ShapeImportUI * p_UI; 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /src/OCCT_ShapeList.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | typedef class NCollection_List OCCT_ShapeList; 11 | typedef class NCollection_List OCCT_SolidList; 12 | typedef class NCollection_List OCCT_FaceList; 13 | typedef class NCollection_List OCCT_EdgeList; 14 | typedef class NCollection_List OCCT_VertexList; 15 | 16 | inline OCCT_ShapeList & operator+=(OCCT_ShapeList & ShapeList, const TopoDS_Shape & Shape) 17 | { 18 | ShapeList.Append(Shape); 19 | return ShapeList; 20 | } 21 | inline OCCT_ShapeList & operator-=(OCCT_ShapeList & ShapeList, const TopoDS_Shape & Shape) 22 | { 23 | ShapeList.Remove(Shape); 24 | return ShapeList; 25 | } 26 | inline OCCT_ShapeList & operator+=(OCCT_ShapeList & ShapeList, const OCCT_ShapeList & Other) 27 | { 28 | for (OCCT_ShapeList::Iterator Itor(Other); Itor.More(); Itor.Next()) 29 | ShapeList.Append(Itor.Value()); 30 | return ShapeList; 31 | } 32 | inline OCCT_ShapeList & operator-=(OCCT_ShapeList & ShapeList, const OCCT_ShapeList & Other) 33 | { 34 | for (OCCT_ShapeList::Iterator Itor(Other); Itor.More(); Itor.Next()) 35 | ShapeList.Remove(Itor.Value()); 36 | return ShapeList; 37 | } 38 | 39 | inline OCCT_SolidList & operator+=(OCCT_SolidList & SolidList, const TopoDS_Solid & Solid) 40 | { 41 | SolidList.Append(Solid); 42 | return SolidList; 43 | } 44 | inline OCCT_SolidList & operator-=(OCCT_SolidList & SolidList, const TopoDS_Solid & Solid) 45 | { 46 | SolidList.Remove(Solid); 47 | return SolidList; 48 | } 49 | inline OCCT_SolidList & operator+=(OCCT_SolidList & SolidList, const OCCT_SolidList & Other) 50 | { 51 | for (OCCT_SolidList::Iterator Itor(Other); Itor.More(); Itor.Next()) 52 | SolidList.Append(Itor.Value()); 53 | return SolidList; 54 | } 55 | inline OCCT_SolidList & operator-=(OCCT_SolidList & SolidList, const OCCT_SolidList & Other) 56 | { 57 | for (OCCT_SolidList::Iterator Itor(Other); Itor.More(); Itor.Next()) 58 | SolidList.Remove(Itor.Value()); 59 | return SolidList; 60 | } 61 | 62 | inline OCCT_FaceList & operator+=(OCCT_FaceList & FaceList, const TopoDS_Face & Face) 63 | { 64 | FaceList.Append(Face); 65 | return FaceList; 66 | } 67 | inline OCCT_FaceList & operator-=(OCCT_FaceList & FaceList, const TopoDS_Face & Face) 68 | { 69 | FaceList.Remove(Face); 70 | return FaceList; 71 | } 72 | inline OCCT_FaceList & operator+=(OCCT_FaceList & FaceList, const OCCT_FaceList & Other) 73 | { 74 | for (OCCT_FaceList::Iterator Itor(Other); Itor.More(); Itor.Next()) 75 | FaceList.Append(Itor.Value()); 76 | return FaceList; 77 | } 78 | inline OCCT_FaceList & operator-=(OCCT_FaceList & FaceList, const OCCT_FaceList & Other) 79 | { 80 | for (OCCT_FaceList::Iterator Itor(Other); Itor.More(); Itor.Next()) 81 | FaceList.Remove(Itor.Value()); 82 | return FaceList; 83 | } 84 | 85 | inline OCCT_EdgeList & operator+=(OCCT_EdgeList & EdgeList, const TopoDS_Edge & Edge) 86 | { 87 | EdgeList.Append(Edge); 88 | return EdgeList; 89 | } 90 | inline OCCT_EdgeList & operator-=(OCCT_EdgeList & EdgeList, const TopoDS_Edge & Edge) 91 | { 92 | EdgeList.Remove(Edge); 93 | return EdgeList; 94 | } 95 | inline OCCT_EdgeList & operator+=(OCCT_EdgeList & EdgeList, const OCCT_EdgeList & Other) 96 | { 97 | for (OCCT_EdgeList::Iterator Itor(Other); Itor.More(); Itor.Next()) 98 | EdgeList.Append(Itor.Value()); 99 | return EdgeList; 100 | } 101 | inline OCCT_EdgeList & operator-=(OCCT_EdgeList & EdgeList, const OCCT_EdgeList & Other) 102 | { 103 | for (OCCT_EdgeList::Iterator Itor(Other); Itor.More(); Itor.Next()) 104 | EdgeList.Remove(Itor.Value()); 105 | return EdgeList; 106 | } 107 | 108 | inline OCCT_VertexList & operator+=(OCCT_VertexList & VertexList, const TopoDS_Vertex & Vertex) 109 | { 110 | VertexList.Append(Vertex); 111 | return VertexList; 112 | } 113 | inline OCCT_VertexList & operator-=(OCCT_VertexList & VertexList, const TopoDS_Vertex & Vertex) 114 | { 115 | VertexList.Remove(Vertex); 116 | return VertexList; 117 | } 118 | inline OCCT_VertexList & operator+=(OCCT_VertexList & VertexList, const OCCT_VertexList & Other) 119 | { 120 | for (OCCT_VertexList::Iterator Itor(Other); Itor.More(); Itor.Next()) 121 | VertexList.Append(Itor.Value()); 122 | return VertexList; 123 | } 124 | inline OCCT_VertexList & operator-=(OCCT_VertexList & VertexList, const OCCT_VertexList & Other) 125 | { 126 | for (OCCT_VertexList::Iterator Itor(Other); Itor.More(); Itor.Next()) 127 | VertexList.Remove(Itor.Value()); 128 | return VertexList; 129 | } 130 | 131 | inline OCCT_ShapeList & operator<<(OCCT_ShapeList & List, const TopoDS_Shape & Shape) 132 | { 133 | List.Append(Shape); 134 | return List; 135 | } 136 | inline OCCT_SolidList & operator<<(OCCT_SolidList & List, const TopoDS_Solid & Shape) 137 | { 138 | List.Append(Shape); 139 | return List; 140 | } 141 | inline OCCT_FaceList & operator<<(OCCT_FaceList & List, const TopoDS_Face & Shape) 142 | { 143 | List.Append(Shape); 144 | return List; 145 | } 146 | inline OCCT_EdgeList & operator<<(OCCT_EdgeList & List, const TopoDS_Edge & Shape) 147 | { 148 | List.Append(Shape); 149 | return List; 150 | } 151 | inline OCCT_VertexList & operator<<(OCCT_VertexList & List, const TopoDS_Vertex & Shape) 152 | { 153 | List.Append(Shape); 154 | return List; 155 | } 156 | -------------------------------------------------------------------------------- /src/OCCT_Utf8String.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/OCCT_Utf8String.h -------------------------------------------------------------------------------- /src/OCCT_Utf8StringList.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "OCCT_Utf8String.h" 3 | #include 4 | 5 | typedef NCollection_List OCCT_Utf8StringList; 6 | 7 | inline OCCT_Utf8StringList & operator<<(OCCT_Utf8StringList & List, const OCCT_Utf8String & String) 8 | { 9 | List.Append(String); 10 | return List; 11 | } 12 | 13 | inline OCCT_Utf8StringList & operator+=(OCCT_Utf8StringList & List, const OCCT_Utf8String & String) 14 | { 15 | List.Append(String); 16 | return List; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/OcctView.cxx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/OcctView.cxx -------------------------------------------------------------------------------- /src/OcctView.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/OcctView.h -------------------------------------------------------------------------------- /src/OcctWindow.cxx: -------------------------------------------------------------------------------- 1 | #include "OcctWindow.h" 2 | 3 | IMPLEMENT_STANDARD_RTTIEXT(OcctWindow,Aspect_Window) 4 | 5 | // ======================================================================= 6 | // function : OcctWindow 7 | // purpose : 8 | // ======================================================================= 9 | OcctWindow::OcctWindow ( QWidget* theWidget, const Quantity_NameOfColor theBackColor ) 10 | : Aspect_Window(), 11 | myWidget( theWidget ) 12 | { 13 | SetBackground (theBackColor); 14 | myXLeft = myWidget->rect().left(); 15 | myYTop = myWidget->rect().top(); 16 | myXRight = myWidget->rect().right(); 17 | myYBottom = myWidget->rect().bottom(); 18 | } 19 | 20 | // ======================================================================= 21 | // function : Destroy 22 | // purpose : 23 | // ======================================================================= 24 | void OcctWindow::Destroy() 25 | { 26 | myWidget = NULL; 27 | } 28 | 29 | // ======================================================================= 30 | // function : NativeParentHandle 31 | // purpose : 32 | // ======================================================================= 33 | Aspect_Drawable OcctWindow::NativeParentHandle() const 34 | { 35 | QWidget* aParentWidget = myWidget->parentWidget(); 36 | if ( aParentWidget != NULL ) 37 | return (Aspect_Drawable)aParentWidget->winId(); 38 | else 39 | return 0; 40 | } 41 | 42 | // ======================================================================= 43 | // function : NativeHandle 44 | // purpose : 45 | // ======================================================================= 46 | Aspect_Drawable OcctWindow::NativeHandle() const 47 | { 48 | return (Aspect_Drawable)myWidget->winId(); 49 | } 50 | 51 | // ======================================================================= 52 | // function : IsMapped 53 | // purpose : 54 | // ======================================================================= 55 | Standard_Boolean OcctWindow::IsMapped() const 56 | { 57 | return !( myWidget->isMinimized() || myWidget->isHidden() ); 58 | } 59 | 60 | // ======================================================================= 61 | // function : Map 62 | // purpose : 63 | // ======================================================================= 64 | void OcctWindow::Map() const 65 | { 66 | myWidget->show(); 67 | myWidget->update(); 68 | } 69 | 70 | // ======================================================================= 71 | // function : Unmap 72 | // purpose : 73 | // ======================================================================= 74 | void OcctWindow::Unmap() const 75 | { 76 | myWidget->hide(); 77 | myWidget->update(); 78 | } 79 | 80 | // ======================================================================= 81 | // function : DoResize 82 | // purpose : 83 | // ======================================================================= 84 | Aspect_TypeOfResize OcctWindow::DoResize() 85 | { 86 | int aMask = 0; 87 | Aspect_TypeOfResize aMode = Aspect_TOR_UNKNOWN; 88 | 89 | if ( !myWidget->isMinimized() ) 90 | { 91 | if ( Abs ( myWidget->rect().left() - myXLeft ) > 2 ) aMask |= 1; 92 | if ( Abs ( myWidget->rect().right() - myXRight ) > 2 ) aMask |= 2; 93 | if ( Abs ( myWidget->rect().top() - myYTop ) > 2 ) aMask |= 4; 94 | if ( Abs ( myWidget->rect().bottom() - myYBottom ) > 2 ) aMask |= 8; 95 | 96 | switch ( aMask ) 97 | { 98 | case 0: 99 | aMode = Aspect_TOR_NO_BORDER; 100 | break; 101 | case 1: 102 | aMode = Aspect_TOR_LEFT_BORDER; 103 | break; 104 | case 2: 105 | aMode = Aspect_TOR_RIGHT_BORDER; 106 | break; 107 | case 4: 108 | aMode = Aspect_TOR_TOP_BORDER; 109 | break; 110 | case 5: 111 | aMode = Aspect_TOR_LEFT_AND_TOP_BORDER; 112 | break; 113 | case 6: 114 | aMode = Aspect_TOR_TOP_AND_RIGHT_BORDER; 115 | break; 116 | case 8: 117 | aMode = Aspect_TOR_BOTTOM_BORDER; 118 | break; 119 | case 9: 120 | aMode = Aspect_TOR_BOTTOM_AND_LEFT_BORDER; 121 | break; 122 | case 10: 123 | aMode = Aspect_TOR_RIGHT_AND_BOTTOM_BORDER; 124 | break; 125 | default: 126 | break; 127 | } // end switch 128 | 129 | myXLeft = myWidget->rect().left(); 130 | myXRight = myWidget->rect().right(); 131 | myYTop = myWidget->rect().top(); 132 | myYBottom = myWidget->rect().bottom(); 133 | } 134 | 135 | return aMode; 136 | } 137 | 138 | // ======================================================================= 139 | // function : Ratio 140 | // purpose : 141 | // ======================================================================= 142 | Standard_Real OcctWindow::Ratio() const 143 | { 144 | QRect aRect = myWidget->rect(); 145 | return Standard_Real( aRect.right() - aRect.left() ) / Standard_Real( aRect.bottom() - aRect.top() ); 146 | } 147 | 148 | // ======================================================================= 149 | // function : Size 150 | // purpose : 151 | // ======================================================================= 152 | void OcctWindow::Size ( Standard_Integer& theWidth, Standard_Integer& theHeight ) const 153 | { 154 | QRect aRect = myWidget->rect(); 155 | theWidth = aRect.width(); 156 | theHeight = aRect.height(); 157 | } 158 | 159 | // ======================================================================= 160 | // function : Position 161 | // purpose : 162 | // ======================================================================= 163 | void OcctWindow::Position ( Standard_Integer& theX1, Standard_Integer& theY1, 164 | Standard_Integer& theX2, Standard_Integer& theY2 ) const 165 | { 166 | theX1 = myWidget->rect().left(); 167 | theX2 = myWidget->rect().right(); 168 | theY1 = myWidget->rect().top(); 169 | theY2 = myWidget->rect().bottom(); 170 | } -------------------------------------------------------------------------------- /src/OcctWindow.h: -------------------------------------------------------------------------------- 1 | #ifndef OcctWindow_H 2 | #define OcctWindow_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | class OcctWindow; 11 | 12 | /* 13 | OcctWindow class implements Aspect_Window interface using Qt API 14 | as a platform-independent source of window geometry information. 15 | A similar class should be used instead of platform-specific OCCT 16 | classes (WNT_Window, Xw_Window) in any Qt 5 application using OCCT 17 | 3D visualization. 18 | 19 | With Qt 5, the requirement for a Qt-based application to rely fully 20 | on Qt public API and stop using platform-specific APIs looks mandatory. 21 | An example of this is changed QWidget event sequence: when a widget is 22 | first shown on the screen, a resize event is generated before the 23 | underlying native window is resized correctly, however the QWidget instance 24 | already holds correct size information at that moment. The OCCT classes 25 | acting as a source of window geometry for V3d_View class (WNT_Window, Xw_Window) 26 | are no longer compatible with changed Qt behavior because they rely on 27 | platform-specific API that cannot return correct window geometry information 28 | in some cases. A reasonable solution is to provide a Qt-based implementation 29 | of Aspect_Window interface at application level. 30 | */ 31 | 32 | class OcctWindow : public Aspect_Window 33 | { 34 | public: 35 | 36 | //! Constructor 37 | OcctWindow( QWidget* theWidget, const Quantity_NameOfColor theBackColor = Quantity_NOC_MATRAGRAY ); 38 | 39 | virtual void Destroy(); 40 | 41 | //! Destructor 42 | ~OcctWindow() 43 | { 44 | Destroy(); 45 | } 46 | 47 | //! Returns native Window handle 48 | virtual Aspect_Drawable NativeHandle() const; 49 | 50 | //! Returns parent of native Window handle. 51 | virtual Aspect_Drawable NativeParentHandle() const; 52 | 53 | //! Applies the resizing to the window 54 | virtual Aspect_TypeOfResize DoResize(); 55 | 56 | //! Returns True if the window is opened 57 | //! and False if the window is closed. 58 | virtual Standard_Boolean IsMapped() const; 59 | 60 | //! Apply the mapping change to the window 61 | //! and returns TRUE if the window is mapped at screen. 62 | virtual Standard_Boolean DoMapping() const { return Standard_True; } 63 | 64 | //! Opens the window . 65 | virtual void Map() const; 66 | 67 | //! Closes the window . 68 | virtual void Unmap() const; 69 | 70 | virtual void Position( Standard_Integer& theX1, Standard_Integer& theY1, 71 | Standard_Integer& theX2, Standard_Integer& theY2 ) const; 72 | 73 | //! Returns The Window RATIO equal to the physical 74 | //! WIDTH/HEIGHT dimensions. 75 | virtual Standard_Real Ratio() const; 76 | 77 | virtual void Size( Standard_Integer& theWidth, Standard_Integer& theHeight ) const; 78 | 79 | virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return NULL; } 80 | 81 | DEFINE_STANDARD_RTTIEXT(OcctWindow,Aspect_Window) 82 | 83 | protected: 84 | Standard_Integer myXLeft; 85 | Standard_Integer myYTop; 86 | Standard_Integer myXRight; 87 | Standard_Integer myYBottom; 88 | QWidget* myWidget; 89 | }; 90 | 91 | 92 | #endif // OcctWindow_H -------------------------------------------------------------------------------- /src/QShapeExportUI.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/QShapeExportUI.cpp -------------------------------------------------------------------------------- /src/QShapeExportUI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "OCCT_ShapeExport.h" 3 | 4 | class QShapeExportUI: 5 | public OCCT_ShapeExportUI 6 | { 7 | public: 8 | QShapeExportUI(); 9 | virtual ~QShapeExportUI(); 10 | private: 11 | virtual OCCT_Utf8String getSavePathFolder(ModelFileType & FileType) override; 12 | virtual OCCT_Utf8String getSavePath(ModelFileType & FileType) override; 13 | 14 | virtual void showPathSuccess(const OCCT_Utf8String & Path) override; 15 | virtual void showPathError(const OCCT_Utf8String & Path) override; 16 | virtual void showError(const OCCT_Utf8String & ErrorMsg) override; 17 | virtual void showSuccess(const OCCT_Utf8String & SuccessMsg) override; 18 | 19 | virtual void BeginWaitCursor() override; 20 | virtual void EndWaitCursor() override; 21 | }; 22 | 23 | -------------------------------------------------------------------------------- /src/QShapeImportUI.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/QShapeImportUI.cpp -------------------------------------------------------------------------------- /src/QShapeImportUI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "OCCT_ShapeImport.h" 3 | 4 | class QShapeImportUI: 5 | public OCCT_ShapeImportUI 6 | { 7 | public: 8 | QShapeImportUI(); 9 | virtual ~QShapeImportUI(); 10 | private: 11 | virtual OCCT_Utf8String getExtUpper(const OCCT_Utf8String & Utf8String) override; 12 | virtual OCCT_Utf8StringList getLoadPathList() override; 13 | virtual OCCT_Utf8String getLoadPath() override; 14 | 15 | virtual void showPathSuccess(const OCCT_Utf8String & Path) override; 16 | virtual void showPathError(const OCCT_Utf8String & Path) override; 17 | virtual void showError(const OCCT_Utf8String & ErrorMsg) override; 18 | virtual void showSuccess(const OCCT_Utf8String & SuccessMsg) override; 19 | 20 | virtual void BeginWaitCursor() override; 21 | virtual void EndWaitCursor() override; 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /src/Resources/Ais/tool_Attach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_Attach.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_Detach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_Detach.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_delete.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_displayall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_displayall.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_erase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_erase.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_eraseall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_eraseall.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_material.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_material.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_objcolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_objcolor.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_selcolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_selcolor.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_shading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_shading.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_transparency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_transparency.png -------------------------------------------------------------------------------- /src/Resources/Ais/tool_wireframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/tool_wireframe.png -------------------------------------------------------------------------------- /src/Resources/Ais/trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Ais/trans.png -------------------------------------------------------------------------------- /src/Resources/ICON_CANCLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/ICON_CANCLE.png -------------------------------------------------------------------------------- /src/Resources/ICON_SURE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/ICON_SURE.png -------------------------------------------------------------------------------- /src/Resources/OccView/cursor_rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/cursor_rotate.png -------------------------------------------------------------------------------- /src/Resources/OccView/cursor_zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/cursor_zoom.png -------------------------------------------------------------------------------- /src/Resources/OccView/raytrace_antialiasing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/raytrace_antialiasing.png -------------------------------------------------------------------------------- /src/Resources/OccView/raytrace_raytracing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/raytrace_raytracing.png -------------------------------------------------------------------------------- /src/Resources/OccView/raytrace_reflections.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/raytrace_reflections.png -------------------------------------------------------------------------------- /src/Resources/OccView/raytrace_shadows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/raytrace_shadows.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_axo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_axo.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_back.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_bottom.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_comp_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_comp_off.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_comp_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_comp_on.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_fitall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_fitall.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_fitarea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_fitarea.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_front.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_globalpan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_globalpan.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_glpan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_glpan.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_left.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_pan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_pan.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_reset.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_right.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_rotate.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_top.png -------------------------------------------------------------------------------- /src/Resources/OccView/view_zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/OccView/view_zoom.png -------------------------------------------------------------------------------- /src/Resources/Sel/SEL_Edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Sel/SEL_Edge.png -------------------------------------------------------------------------------- /src/Resources/Sel/SEL_Face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Sel/SEL_Face.png -------------------------------------------------------------------------------- /src/Resources/Sel/SEL_Shape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Sel/SEL_Shape.png -------------------------------------------------------------------------------- /src/Resources/Sel/SEL_Solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Sel/SEL_Solid.png -------------------------------------------------------------------------------- /src/Resources/Sel/SEL_Vertex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Sel/SEL_Vertex.png -------------------------------------------------------------------------------- /src/Resources/Toolbar/SEL_Edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Toolbar/SEL_Edge.png -------------------------------------------------------------------------------- /src/Resources/Toolbar/SEL_Face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Toolbar/SEL_Face.png -------------------------------------------------------------------------------- /src/Resources/Toolbar/SEL_Shape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Toolbar/SEL_Shape.png -------------------------------------------------------------------------------- /src/Resources/Toolbar/SEL_Solid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Toolbar/SEL_Solid.png -------------------------------------------------------------------------------- /src/Resources/Toolbar/SEL_Vertex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/Toolbar/SEL_Vertex.png -------------------------------------------------------------------------------- /src/Resources/icon-circleupdate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/icon-circleupdate.png -------------------------------------------------------------------------------- /src/Resources/icon-update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/Resources/icon-update.png -------------------------------------------------------------------------------- /src/images/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/images/app.ico -------------------------------------------------------------------------------- /src/images/app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/images/app.png -------------------------------------------------------------------------------- /src/images/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/images/back.png -------------------------------------------------------------------------------- /src/images/copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/images/copy.png -------------------------------------------------------------------------------- /src/images/cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/images/cut.png -------------------------------------------------------------------------------- /src/images/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/images/new.png -------------------------------------------------------------------------------- /src/images/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/images/open.png -------------------------------------------------------------------------------- /src/images/paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/images/paste.png -------------------------------------------------------------------------------- /src/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/images/save.png -------------------------------------------------------------------------------- /src/images/saveas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/images/saveas.png -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/main.cpp -------------------------------------------------------------------------------- /src/mdi.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/copy.png 4 | images/cut.png 5 | images/new.png 6 | images/open.png 7 | images/paste.png 8 | images/save.png 9 | Resources/ICON_CANCLE.png 10 | Resources/ICON_SURE.png 11 | images/saveas.png 12 | images/app.png 13 | images/back.png 14 | Resources/icon-circleupdate.png 15 | Resources/icon-update.png 16 | 17 | 18 | Resources/OccView/view_axo.png 19 | Resources/OccView/view_back.png 20 | Resources/OccView/view_bottom.png 21 | Resources/OccView/view_comp_off.png 22 | Resources/OccView/view_comp_on.png 23 | Resources/OccView/view_fitall.png 24 | Resources/OccView/view_fitarea.png 25 | Resources/OccView/view_front.png 26 | Resources/OccView/view_glpan.png 27 | Resources/OccView/view_left.png 28 | Resources/OccView/view_pan.png 29 | Resources/OccView/view_reset.png 30 | Resources/OccView/view_right.png 31 | Resources/OccView/view_rotate.png 32 | Resources/OccView/view_top.png 33 | Resources/OccView/view_zoom.png 34 | Resources/OccView/cursor_rotate.png 35 | Resources/OccView/cursor_zoom.png 36 | Resources/OccView/raytrace_antialiasing.png 37 | Resources/OccView/raytrace_raytracing.png 38 | Resources/OccView/raytrace_reflections.png 39 | Resources/OccView/raytrace_shadows.png 40 | Resources/OccView/view_globalpan.png 41 | 42 | 43 | Resources/Sel/SEL_Edge.png 44 | Resources/Sel/SEL_Face.png 45 | Resources/Sel/SEL_Shape.png 46 | Resources/Sel/SEL_Solid.png 47 | Resources/Sel/SEL_Vertex.png 48 | 49 | 50 | Resources/Ais/tool_Attach.png 51 | Resources/Ais/tool_delete.png 52 | Resources/Ais/tool_Detach.png 53 | Resources/Ais/tool_displayall.png 54 | Resources/Ais/tool_erase.png 55 | Resources/Ais/tool_eraseall.png 56 | Resources/Ais/tool_material.png 57 | Resources/Ais/tool_objcolor.png 58 | Resources/Ais/tool_selcolor.png 59 | Resources/Ais/tool_shading.png 60 | Resources/Ais/tool_transparency.png 61 | Resources/Ais/tool_wireframe.png 62 | Resources/Ais/trans.png 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/mdichild.cpp: -------------------------------------------------------------------------------- 1 | #include "mdichild.h" 2 | #include "ComplainUtf8.h" 3 | #include "GUI_Message.h" 4 | 5 | #include 6 | #include 7 | 8 | MdiChild::MdiChild(QWidget * parent) 9 | :QMainWindow(parent) 10 | { 11 | //InitMBD 12 | h_MyDoc = new MyDocument(); 13 | h_MyViewer = new MyViewer(h_MyDoc); 14 | //Config 15 | this->setMenuBar(nullptr); 16 | setAttribute(Qt::WA_DeleteOnClose); 17 | isUntitled = true; 18 | //Init 19 | this->Init(); 20 | } 21 | 22 | MdiChild::~MdiChild() 23 | { 24 | } 25 | 26 | void MdiChild::SetCurrent() 27 | { 28 | p_MessageWidget->SetCurrentMessager(); 29 | } 30 | 31 | void MdiChild::createMDIActions() 32 | { 33 | } 34 | 35 | QString MdiChild::userFriendlyCurrentFile() 36 | { 37 | return strippedName(curFile); 38 | } 39 | 40 | QList MdiChild::GetDockActions() 41 | { 42 | return QList() 43 | << p_MessageDock->toggleViewAction(); 44 | //<< p_TopoDock->toggleViewAction() 45 | //<< p_PropertyDock->toggleViewAction() 46 | //<< p_AddGD_T_Dock->toggleViewAction() 47 | //<< p_AddSR_Dock->toggleViewAction(); 48 | } 49 | 50 | void MdiChild::closeEvent(QCloseEvent *event) 51 | { 52 | if (maybeSave()) { 53 | event->accept(); 54 | } else { 55 | event->ignore(); 56 | } 57 | } 58 | 59 | void MdiChild::documentWasModified() 60 | { 61 | setWindowModified(document()->isModified()); 62 | } 63 | 64 | bool MdiChild::maybeSave() 65 | { 66 | if (!document()->isModified()) 67 | return true; 68 | const QMessageBox::StandardButton ret 69 | = QMessageBox::warning(this, tr("MDI"), 70 | tr("'%1' has been modified.\n" 71 | "Do you want to save your changes?") 72 | .arg(userFriendlyCurrentFile()), 73 | QMessageBox::Save | QMessageBox::Discard 74 | | QMessageBox::Cancel); 75 | switch (ret) { 76 | case QMessageBox::Save: 77 | return save(); 78 | case QMessageBox::Cancel: 79 | return false; 80 | default: 81 | break; 82 | } 83 | return true; 84 | } 85 | 86 | void MdiChild::setCurrentFile(const QString &fileName) 87 | { 88 | curFile = QFileInfo(fileName).canonicalFilePath(); 89 | isUntitled = false; 90 | document()->setModified(false); 91 | setWindowModified(false); 92 | setWindowTitle(userFriendlyCurrentFile() + "[*]"); 93 | } 94 | 95 | QString MdiChild::strippedName(const QString &fullFileName) 96 | { 97 | return QFileInfo(fullFileName).fileName(); 98 | } 99 | -------------------------------------------------------------------------------- /src/mdichild.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MDICHILD_H 3 | #define MDICHILD_H 4 | 5 | #include 6 | #include "MyDocument.h" 7 | #include "MyViewer.h" 8 | 9 | class MdiChild : public QMainWindow 10 | { 11 | Q_OBJECT 12 | public: 13 | MdiChild(QWidget * parent); 14 | virtual ~MdiChild(); 15 | 16 | QString userFriendlyCurrentFile(); 17 | QString currentFile() { return curFile; } 18 | 19 | QList GetDockActions(); 20 | Handle(MyDocument) document() { return h_MyDoc; } 21 | 22 | void SetCurrent(); 23 | void createMDIActions(); 24 | public: //mdichild_action1 25 | void newFile(); 26 | bool loadFile(const QString &fileName); 27 | bool save(); 28 | bool saveAs(); 29 | bool saveFile(const QString &fileName); 30 | public: //mdichild_action2 31 | void ImportModel(); 32 | void ExportModel(); 33 | void SelNatural(); 34 | void SelSolid(); 35 | void SelFace(); 36 | void SelEdge(); 37 | void SelVertex(); 38 | 39 | void AisObjDisplayAll(); 40 | void AisObjEraseAll(); 41 | void AisObjHide(); 42 | void SelTrans(); 43 | void SelUnTrans(); 44 | void SelWireFrame(); 45 | void SelShaded(); 46 | void SelColor(); 47 | void SelUnColor(); 48 | 49 | void Test1(); 50 | protected slots: //mdichild_slots 51 | void selectionChanged(); 52 | protected: 53 | void closeEvent(QCloseEvent *event) override; 54 | protected: //mdichild_init 55 | void Init(); 56 | private slots: 57 | void documentWasModified(); 58 | private: 59 | bool maybeSave(); 60 | void setCurrentFile(const QString &fileName); 61 | QString strippedName(const QString &fullFileName); 62 | 63 | QString curFile; 64 | bool isUntitled; 65 | 66 | //Occt 67 | class OcctView * q3dView; 68 | 69 | //Message 70 | QDockWidget * p_MessageDock; 71 | class GUI_Message * p_MessageWidget; 72 | 73 | Handle(MyDocument) h_MyDoc; 74 | Handle(MyViewer) h_MyViewer; 75 | }; 76 | #endif 77 | -------------------------------------------------------------------------------- /src/mdichild_action1.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/mdichild_action1.cpp -------------------------------------------------------------------------------- /src/mdichild_action2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/mdichild_action2.cpp -------------------------------------------------------------------------------- /src/mdichild_init.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ajune-wang/OCC-QT-Demo/96f5d317daa5c9791c67621a0bc7c5502f087e55/src/mdichild_init.cpp -------------------------------------------------------------------------------- /src/mdichild_slots.cpp: -------------------------------------------------------------------------------- 1 | #include "mdichild.h" 2 | 3 | void MdiChild::selectionChanged() 4 | { 5 | h_MyViewer->selectionChanged(); 6 | } --------------------------------------------------------------------------------