0023962: Moving OCCT documentation to sources
OCCT documentation (Overview and User Guides) has been converted from MS Word files to text-based MarkDown format and added to OCCT sources, in the new subfolder 'dox'. The HTML and PDF articles can be generated from the sources using Doxygen and MiKTeX. See the file OCCT_Docs_HowTo.md for details on the new documentation system. This branch includes: - new folder structure for Open CASCADE documentation - sources of almost all OCCT User Guides and Overview - tcl and bat scripts, which allow to generate HTML and PDF articles
1
.gitattributes
vendored
@ -34,6 +34,7 @@
|
||||
*.brep eol=lf
|
||||
*.rle eol=lf
|
||||
*.vrml eol=lf
|
||||
*.md eol=lf
|
||||
FILES eol=lf
|
||||
PACKAGES eol=lf
|
||||
EXTERNLIB eol=lf
|
||||
|
3
.gitignore
vendored
@ -7,6 +7,7 @@
|
||||
/ao1
|
||||
/sil
|
||||
/wnt
|
||||
/doc
|
||||
/drv
|
||||
/inc
|
||||
/work
|
||||
@ -45,8 +46,6 @@ Release
|
||||
/*.am
|
||||
/*.m4
|
||||
/*.ac
|
||||
/*.sh
|
||||
/*.bat
|
||||
/autom4te.cache
|
||||
/build_configure
|
||||
/configure
|
||||
|
6
LICENSE
@ -120,14 +120,16 @@ END OF THE TERMS AND
|
||||
CONDITIONS OF THIS LICENSE
|
||||
|
||||
|
||||
Open CASCADE S.A.S. is a French société par actions simplifiée having its main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France. Its web site is located at the following address www.opencascade.com
|
||||
Open CASCADE S.A.S. is a French société par actions simplifiée having its main offices at 1, place in Frères Montgolfier, 78280 Guyancourt, France. Its web site is located at the following address www.opencascade.com
|
||||
|
||||
|
||||
Open CASCADE Technology Public License
|
||||
|
||||
Schedule "A"
|
||||
|
||||
The content of this file is subject to the Open CASCADE Technology Public License Version 6.5 (the "License"). You may not use the content of this file except in compliance with the License. Please obtain a copy of the License at http://www.opencascade.org and read it completely before using this file.
|
||||
The content of this file is subject to the Open CASCADE Technology Public License Version 6.5 (the "License").
|
||||
You may not use the content of this file except in compliance with the License.
|
||||
Please obtain a copy of the License at http://www.opencascade.org and read it completely before using this file.
|
||||
|
||||
The Initial Developer of the Original Code is Open CASCADE S.A.S., with main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France. The Original Code is copyright © Open CASCADE S.A.S., 2001. All rights reserved.
|
||||
|
||||
|
188
dox/DoxygenLayout.xml
Normal file
@ -0,0 +1,188 @@
|
||||
<doxygenlayout version="1.0">
|
||||
<!-- Generated by doxygen 1.8.3.1 -->
|
||||
<!-- Navigation index tabs for HTML output -->
|
||||
<navindex>
|
||||
<tab type="mainpage" visible="yes" title="Introduction"/>
|
||||
<tab type="pages" visible="yes" title="Documents" intro="This section contains links to all OCCT documents that are available at the moment"/>
|
||||
<tab type="modules" visible="yes" title="" intro=""/>
|
||||
<tab type="namespaces" visible="yes" title="">
|
||||
<tab type="namespacelist" visible="no" title="" intro=""/>
|
||||
<tab type="namespacemembers" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="classes" visible="yes" title="Reference Manual">
|
||||
<tab type="classlist" visible="no" title="" intro=""/>
|
||||
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||
<tab type="hierarchy" visible="no" title="" intro=""/>
|
||||
<tab type="classmembers" visible="no" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="files" visible="no" title="Files">
|
||||
<tab type="filelist" visible="yes" title="" intro=""/>
|
||||
<tab type="globals" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="examples" visible="no" title="" intro=""/>
|
||||
</navindex>
|
||||
|
||||
<!-- Layout definition for a class page -->
|
||||
<class>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||
<inheritancegraph visible="$CLASS_GRAPH"/>
|
||||
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
|
||||
<memberdecl>
|
||||
<nestedclasses visible="yes" title=""/>
|
||||
<publictypes title=""/>
|
||||
<publicslots title=""/>
|
||||
<signals title=""/>
|
||||
<publicmethods title=""/>
|
||||
<publicstaticmethods title=""/>
|
||||
<publicattributes title=""/>
|
||||
<publicstaticattributes title=""/>
|
||||
<protectedtypes title=""/>
|
||||
<protectedslots title=""/>
|
||||
<protectedmethods title=""/>
|
||||
<protectedstaticmethods title=""/>
|
||||
<protectedattributes title=""/>
|
||||
<protectedstaticattributes title=""/>
|
||||
<packagetypes title=""/>
|
||||
<packagemethods title=""/>
|
||||
<packagestaticmethods title=""/>
|
||||
<packageattributes title=""/>
|
||||
<packagestaticattributes title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
<privatetypes title=""/>
|
||||
<privateslots title=""/>
|
||||
<privatemethods title=""/>
|
||||
<privatestaticmethods title=""/>
|
||||
<privateattributes title=""/>
|
||||
<privatestaticattributes title=""/>
|
||||
<friends title=""/>
|
||||
<related title="" subtitle=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<constructors title=""/>
|
||||
<functions title=""/>
|
||||
<related title=""/>
|
||||
<variables title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
</memberdef>
|
||||
<allmemberslink visible="yes"/>
|
||||
<usedfiles visible="$SHOW_USED_FILES"/>
|
||||
<authorsection visible="yes"/>
|
||||
</class>
|
||||
|
||||
<!-- Layout definition for a namespace page -->
|
||||
<namespace>
|
||||
<briefdescription visible="yes"/>
|
||||
<memberdecl>
|
||||
<nestednamespaces visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</namespace>
|
||||
|
||||
<!-- Layout definition for a file page -->
|
||||
<file>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||
<includegraph visible="$INCLUDE_GRAPH"/>
|
||||
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
|
||||
<sourcelink visible="yes"/>
|
||||
<memberdecl>
|
||||
<classes visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection/>
|
||||
</file>
|
||||
|
||||
<!-- Layout definition for a group page -->
|
||||
<group>
|
||||
<briefdescription visible="yes"/>
|
||||
<groupgraph visible="$GROUP_GRAPHS"/>
|
||||
<memberdecl>
|
||||
<nestedgroups visible="yes" title=""/>
|
||||
<dirs visible="yes" title=""/>
|
||||
<files visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<signals title=""/>
|
||||
<publicslots title=""/>
|
||||
<protectedslots title=""/>
|
||||
<privateslots title=""/>
|
||||
<events title=""/>
|
||||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<pagedocs/>
|
||||
<inlineclasses title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<signals title=""/>
|
||||
<publicslots title=""/>
|
||||
<protectedslots title=""/>
|
||||
<privateslots title=""/>
|
||||
<events title=""/>
|
||||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</group>
|
||||
|
||||
<!-- Layout definition for a directory page -->
|
||||
<directory>
|
||||
<briefdescription visible="yes"/>
|
||||
<directorygraph visible="yes"/>
|
||||
<memberdecl>
|
||||
<dirs visible="yes"/>
|
||||
<files visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
</directory>
|
||||
</doxygenlayout>
|
31
dox/FILES.txt
Normal file
@ -0,0 +1,31 @@
|
||||
overview/overview.md
|
||||
overview/tutorial/tutorial.md
|
||||
technical_overview/technical_overview.md
|
||||
|
||||
user_guides/user_guides.md
|
||||
user_guides/foundation_classes/foundation_classes.md
|
||||
user_guides/modeling_data/modeling_data.md
|
||||
user_guides/modeling_algos/modeling_algos.md
|
||||
user_guides/visualization/visualization.md
|
||||
user_guides/iges/iges.md
|
||||
user_guides/step/step.md
|
||||
user_guides/xde/xde.md
|
||||
user_guides/ocaf/ocaf.md
|
||||
user_guides/tobj/tobj.md
|
||||
user_guides/shape_healing/shape_healing.md
|
||||
user_guides/draw_test_harness/draw_test_harness.md
|
||||
user_guides/wok/wok.md
|
||||
|
||||
dev_guides/dev_guides.md
|
||||
dev_guides/wok/wok.md
|
||||
dev_guides/cdl/cdl.md
|
||||
dev_guides/tests/tests.md
|
||||
dev_guides/documentation/documentation.md
|
||||
|
||||
dev_guides/building/automake.md
|
||||
dev_guides/building/cmake.md
|
||||
dev_guides/building/code_blocks.md
|
||||
dev_guides/building/msvc.md
|
||||
dev_guides/building/xcode.md
|
||||
|
||||
overview/license.md
|
157
dox/Overview/LICENSE.md
Normal file
@ -0,0 +1,157 @@
|
||||
License {#occt_pubic_license}
|
||||
=======
|
||||
|
||||
## Open CASCADE Technology Public License
|
||||
|
||||
*License version: 6.6* @htmlonly<br />@endhtmlonly
|
||||
*March, 2013*
|
||||
|
||||
Open CASCADE S.A.S. releases and makes publicly available the source code of the software Open CASCADE Technology to the free software development community under the terms and conditions of this license.
|
||||
|
||||
It is not the purpose of this license to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this license has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
|
||||
Please read this license carefully and completely before downloading this software. By downloading, using, modifying, distributing and sublicensing this software, you indicate your acceptance to be bound by the terms and conditions of this license. If you do not want to accept or cannot accept for any reasons the terms and conditions of this license, please do not download or use in any manner this software.
|
||||
|
||||
### 1. Definitions
|
||||
|
||||
Unless there is something in the subject matter or in the context inconsistent therewith, the capitalized terms used in this License shall have the following meaning.
|
||||
|
||||
"Applicable Intellectual Property Rights" means (a) with respect to the Initial Developer, any rights under patents or patents applications or other intellectual property rights that are now or hereafter acquired, owned by or assigned to the Initial Developer and that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce, modify, distribute or sublicense the Original Code without infringement; and (b) with respect to You or any Contributor, any rights under patents or patents applications or other intellectual property rights that are now or hereafter acquired, owned by or assigned to You or to such Contributor and that cover subject matter contained in Your Modifications or in such Contributor's Modifications, taken alone or in combination with Original Code.
|
||||
|
||||
"Contributor" means each individual or legal entity that creates or contributes to the creation of any Modification, including the Initial Developer.
|
||||
|
||||
"Derivative Program": means a new program combining the Software or portions thereof with other source code not governed by the terms of this License.
|
||||
|
||||
"Initial Developer": means Open CASCADE S.A.S., with main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France.
|
||||
|
||||
"Modifications": mean any addition to, deletion from or change to the substance or the structure of the Software. When source code of the Software is released as a series of files, a Modification is: (a) any addition to, deletion from or change to the contents of a file containing the Software or (b) any new file or other representation of computer program statements that contains any part of the Software. By way of example, Modifications include any debug of, or improvement to, the Original Code or any of its components or portions as well as its next versions or releases thereof.
|
||||
|
||||
"Original Code": means (a) the source code of the software Open CASCADE Technology originally made available by the Initial Developer under this License, including the source code of any updates or upgrades of the Original Code and (b) the object code compiled from such source code and originally made available by Initial Developer under this License.
|
||||
|
||||
"Software": means the Original Code, the Modifications, the combination of Original Code and any Modifications or any respective portions thereof.
|
||||
|
||||
"You" or "Your": means an individual or a legal entity exercising rights under this License.
|
||||
|
||||
|
||||
### 2. Acceptance of license
|
||||
|
||||
By using, reproducing, modifying, distributing or sublicensing the Software or any portion thereof, You expressly indicate Your acceptance of the terms and conditions of this License and undertake to act in accordance with all the provisions of this License applicable to You.
|
||||
|
||||
|
||||
### 3. Scope and purpose
|
||||
|
||||
This License applies to the Software and You may not use, reproduce, modify, distribute, sublicense or circulate the Software, or any portion thereof, except as expressly provided under this License. Any attempt to otherwise use, reproduce, modify, distribute or sublicense the Software is void and will automatically terminate Your rights under this License.
|
||||
|
||||
|
||||
### 4. Contributor license
|
||||
|
||||
Subject to the terms and conditions of this License, the Initial Developer and each of the Contributors hereby grant You a world-wide, royalty-free, irrevocable and non-exclusive license under the Applicable Intellectual Property Rights they own or control, to use, reproduce, modify, distribute and sublicense the Software provided that:
|
||||
|
||||
You reproduce in all copies of the Software the copyright and other proprietary notices and disclaimers of the Initial Developer as they appear in the Original Code and attached hereto as Schedule "A" and any other notices or disclaimers attached to the Software and keep intact all notices in the Original Code that refer to this License and to the absence of any warranty;
|
||||
You include a copy of this License with every copy of the Software You distribute;
|
||||
If you distribute or sublicense the Software (as modified by You or on Your behalf as the case may be), You cause such Software to be licensed as a whole, at no charge, to all third parties, under the terms and conditions of the License, making in particular available to all third parties the source code of the Software;
|
||||
You document all Your Modifications, indicate the date of each such Modifications, designate the version of the Software You used, prominently include a file carrying such information with respect to the Modifications and duplicate the copyright and other proprietary notices and disclaimers attached hereto as Schedule "B" or any other notices or disclaimers attached to the Software with your Modifications.
|
||||
|
||||
For greater certainty, it is expressly understood that You may freely create Derivative Programs (without any obligation to publish such Derivative Program) and distribute same as a single product. In such case, You must ensure that all the requirements of this License are fulfilled for the Software or any portion thereof.
|
||||
|
||||
|
||||
### 5. Your license
|
||||
|
||||
You hereby grant all Contributors and anyone who becomes a party under this License a world-wide, non-exclusive, royalty-free and irrevocable license under the Applicable Intellectual Property Rights owned or controlled by You, to use, reproduce, modify, distribute and sublicense all Your Modifications under the terms and conditions of this License.
|
||||
|
||||
|
||||
### 6. Software subject to license
|
||||
|
||||
Your Modifications shall be governed by the terms and conditions of this License. You are not authorized to impose any other terms or conditions than those prevailing under this License when You distribute and/or sublicense the Software, save and except as permitted under Section 7 hereof.
|
||||
|
||||
|
||||
### 7. Additional terms
|
||||
|
||||
You may choose to offer, on a non-exclusive basis, and to charge a fee for any warranty, support, maintenance, liability obligations or other rights consistent with the scope of this License with respect to the Software (the "Additional Terms") to the recipients of the Software. However, You may do so only on Your own behalf and on Your sole and exclusive responsibility. You must obtain the recipient's agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold the Initial Developer and any Contributor harmless for any liability incurred by or claims asserted against the Initial Developer or any Contributors with respect to any such Additional Terms.
|
||||
|
||||
|
||||
### 8. Disclaimer of warranty
|
||||
|
||||
The Software is provided under this License on an "as is" basis, without warranty of any kind, including without limitation, warranties that the Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Software is with You.
|
||||
|
||||
|
||||
### 9. Liability
|
||||
|
||||
Under no circumstances shall You, the Initial Developer or any Contributor be liable to any person for any direct or indirect damages of any kind including, without limitation, damages for loss of goodwill, loss of data, work stoppage, computer failure or malfunction or any and all other commercial damages or losses resulting from or relating to this License or indirectly to the use of the Software.
|
||||
|
||||
|
||||
### 10. Trademark
|
||||
|
||||
This License does not grant any rights to use the trademarks, trade names and domain names "MATRA", "EADS Matra Datavision", "CAS.CADE", "Open CASCADE", "opencascade.com" and "opencascade.org" or any other trademarks, trade names or domain names used or owned by the Initial Developer.
|
||||
|
||||
|
||||
### 11. Copyright
|
||||
|
||||
The Initial Developer retains all rights, title and interest in and to the Original Code. You may not remove the copyright © notice which appears when You download the Software.
|
||||
|
||||
|
||||
### 12. Term
|
||||
|
||||
This License is granted to You for a term equal to the remaining period of protection covered by the intellectual property rights applicable to the Original Code.
|
||||
|
||||
|
||||
### 13. Termination
|
||||
|
||||
In case of termination, as provided in Section 3 above, You agree to immediately stop any further use, reproduction, modification, distribution and sublicensing of the Software and to destroy all copies of the Software that are in Your possession or control. All sublicenses of the Software which have been properly granted prior to termination shall survive any termination of this License. In addition, Sections 5, 8 to 11, 13.2 and 15.2 of this License, in reason of their nature, shall survive the termination of this License for a period of fifteen (15) years.
|
||||
|
||||
|
||||
### 14. Versions of the license
|
||||
|
||||
The Initial Developer may publish new versions of this License from time to time. Once Original Code has been published under a particular version of this License, You may choose to continue to use it under the terms and conditions of that version or use the Original Code under the terms of any subsequent version of this License published by the Initial Developer.
|
||||
|
||||
|
||||
### 15. Miscellaneous
|
||||
|
||||
#### 15.1 Relationship of Parties
|
||||
|
||||
This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between You and the Initial Developer, and You will not represent to the contrary, whether expressly, by implication or otherwise.
|
||||
|
||||
#### 15.2 Independent Development
|
||||
|
||||
Nothing in this License will impair the Initial Developer's right to acquire, license, develop, have others develop for it, market or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Derivative Programs, technology or products that You may develop, produce, market or distribute.
|
||||
|
||||
#### 15.3 Severability
|
||||
|
||||
If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and extent.
|
||||
|
||||
|
||||
@htmlonly<center>@endhtmlonly
|
||||
#### END OF THE TERMS AND CONDITIONS OF THIS LICENSE
|
||||
|
||||
Open CASCADE S.A.S. is a French société par actions simplifiée having its main offices at 1, place in Frères Montgolfier, 78280 Guyancourt, France. Its web site is located at the following address http://www.opencascade.com
|
||||
|
||||
|
||||
#### Open CASCADE Technology Public License
|
||||
|
||||
#### Schedule "A"
|
||||
|
||||
The content of this file is subject to the Open CASCADE Technology Public License Version 6.5 (the "License").
|
||||
You may not use the content of this file except in compliance with the License.
|
||||
Please obtain a copy of the License at http://www.opencascade.org and read it completely before using this file. The Initial Developer of the Original Code is Open CASCADE S.A.S., with main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France. The Original Code is copyright © Open CASCADE S.A.S., 2001. All rights reserved.
|
||||
|
||||
"The Original Code and all software distributed under the License are distributed on an "AS IS" basis, without warranty of any kind, and the Initial Developer hereby disclaims all such warranties, including without limitation, any warranties of merchantability, fitness for a particular purpose or non-infringement.
|
||||
|
||||
Please see the License for the specific terms and conditions governing rights and limitations under the License".
|
||||
|
||||
#### End of Schedule "A"
|
||||
|
||||
|
||||
#### Open CASCADE Technology Public License
|
||||
|
||||
#### Schedule "B"
|
||||
|
||||
"The content of this file is subject to the Open CASCADE Technology Public License Version 6.5 (the "License"). You may not use the content of this file except in compliance with the License. Please obtain a copy of the License at http://www.opencascade.org and read it completely before using this file. The Initial Developer of the Original Code is Open CASCADE S.A.S., with main offices at 1, place des Frères Montgolfier, 78280 Guyancourt, France. The Original Code is copyright © Open CASCADE S.A.S., 2001. All rights reserved.
|
||||
|
||||
Modifications to the Original Code have been made by ________________________. Modifications are copyright © [Year to be included]. All rights reserved.
|
||||
|
||||
The software Open CASCADE Technology and all software distributed under the License are distributed on an "AS IS" basis, without warranty of any kind, and the Initial Developer hereby disclaims all such warranties, including without limitation, any warranties of merchantability, fitness for a particular purpose or non-infringement. Please see the License for the specific terms and conditions governing rights and limitations under the License".
|
||||
|
||||
#### End of Schedule "B"
|
||||
|
||||
@htmlonly</center>@endhtmlonly
|
604
dox/Overview/Overview.md
Normal file
@ -0,0 +1,604 @@
|
||||
Overview {#mainpage}
|
||||
========
|
||||
|
||||
@section OCCT_OVW_SECTION_1 Welcome
|
||||
|
||||
Welcome to Open CASCADE Technology version 6.6.0, a minor release,
|
||||
which introduces a number of new features and improved traditional
|
||||
functionality along with some changes over the previous maintenance release 6.5.5.
|
||||
|
||||
This release makes Open CASCADE Technology even a more powerful and stable
|
||||
development platform for 3D modeling and numerical simulation applications.
|
||||
|
||||
Open CASCADE Technology 6.6.0 is a full-featured package that allows developing
|
||||
applications on Windows and Linux platforms.
|
||||
|
||||
@htmlonly<center>@endhtmlonly http://www.opencascade.org
|
||||
|
||||

|
||||
|
||||
Copyright © 2001-2013 OPEN CASCADE S.A.S.
|
||||
|
||||

|
||||
|
||||
@htmlonly</center>@endhtmlonly
|
||||
|
||||
@section OCCT_OVW_SECTION_2 Copyrights
|
||||
|
||||
Copyright© 2001-2013 by OPEN CASCADE S.A.S. All rights reserved.
|
||||
|
||||
Trademark information
|
||||
----------------------
|
||||
|
||||
You are hereby informed that all software is a property of its respective authors and is protected by
|
||||
international and domestic laws on intellectual property and trademarks.
|
||||
Should you need further information, please directly contact the authors.
|
||||
|
||||
CAS.CADE and Open CASCADE are registered trademarks of OPEN CASCADE S.A.S.
|
||||
|
||||
Acknowledgement
|
||||
------------------
|
||||
|
||||
The following parties are acknowledged for producing tools which are used within
|
||||
Open CASCADE Technology libraries or for release preparation.
|
||||
|
||||
You are hereby informed that all rights to the software listed below belong to its respective
|
||||
authors and such software may not be freely available and/or be free of charge for any kind
|
||||
of use or purpose. We strongly recommend that you carefully read the license of these products
|
||||
and, in case you need any further information, directly contact their authors.
|
||||
|
||||
**Qt** is a cross-platform application framework that is widely used for developing application software
|
||||
with graphical user interface (GUI). Qt is free and open source software distributed under
|
||||
the terms of the GNU Lesser General Public License. In OCCT Qt is used for programming samples.
|
||||
If you need further information on Qt, please, refer to Qt Homepage (qt.digia.com).
|
||||
|
||||
**Tcl** is a high-level programming language. Tk is a graphical user interface (GUI) toolkit,
|
||||
with buttons, menus, listboxes, scrollbars, and so on. Taken together Tcl and Tk provide a solution
|
||||
to develop cross-platform graphical user interfaces with a native look and feel. Tcl/Tk is under copyright by
|
||||
Scriptics Corp., Sun Microsystems, and other companies. However, Tcl/Tk is an open source, and
|
||||
the copyright allows you to use, modify, and redistribute Tcl/Tk for any purpose, without an
|
||||
explicit license agreement and without paying any license fees or royalties.
|
||||
To use Tcl/Tk, please refer to the Licensing Terms (http://www.tcl.tk/software/tcltk/license.html).
|
||||
|
||||
**Robert Boehne** has developed **GNU Autoconf**, **Automake** and **Libtool** scripts and makefiles
|
||||
for the Open CASCADE project http://sourceforge.net/projects/autoopencas/,
|
||||
which became an initial groundwork for the build scripts based on respective GNU tools
|
||||
(autoconf, automake and libtool) in Open CASCADE Technology version 4.0.
|
||||
These scripts are now maintained by the OPEN CASCADE company.
|
||||
|
||||
**GL2PS** is developed by Christophe Geuzaine and others. It is OpenGL to PostScript printing library.
|
||||
The library is licensed under GL2PS LICENSE http://www.geuz.org/gl2ps/COPYING.GL2PS Version 2, November 2003.
|
||||
|
||||
**FreeType 2** is developed by Antoine Leca, David Turner, Werner Lemberg and others.
|
||||
It is a software font engine that is designed to be small, efficient, highly customizable and
|
||||
portable while capable of producing high-quality output (glyph images). This product
|
||||
can be used in graphic libraries, display servers, font conversion tools,
|
||||
text image generation tools, and many other products.
|
||||
|
||||
FreeType 2 is released under two open-source licenses: BSD-like FreeType License and the GPL.
|
||||
|
||||
**Intel® Threading Building Blocks (TBB)** offers a rich and complete approach to expressing parallelism in a C++ program.
|
||||
It is a library that helps you to take advantage of multi-core processor performance without having to be a threading expert.
|
||||
Threading Building Blocks is not just a threads-replacement library. It represents a higher-level, task-based parallelism that
|
||||
abstracts platform details and threading mechanisms for scalability and performance.
|
||||
TBB is available under GPLv2 license with the runtime exception.
|
||||
|
||||
Open CASCADE Technology WOK module on Windows also makes use of LGPL-licensed C routines * regexp and getopt, taken from GNU C library.
|
||||
|
||||
**Doxygen** (Copyright © 1997-2010 by Dimitri van Heesch) is open source documentation system for
|
||||
C++, C, Java, Objective-C, Python, IDL, PHP and C#. This product is used in Open CASCADE Technology
|
||||
for automatic creation of Technical Documentation from C++ header files.
|
||||
If you need further information on Doxygen, please refer to http://www.stack.nl/~dimitri/doxygen/index.html.
|
||||
|
||||
**Graphviz** is open source graph visualization software developed by John Ellson, Emden Gansner, Yifan Hu and Arif Bilgin.
|
||||
Graph visualization is representiation of structured information as diagrams of abstract graphs and networks.
|
||||
This product is used together with Doxygen in Open CASCADE Technology for automatic creation of Technical Documentation
|
||||
(generation of dependency graphs). Current versions of Graphviz are licensed on an open source
|
||||
basis only under The Eclipse Public License (EPL) (http://www.graphviz.org/License.php).
|
||||
|
||||
**Inno Setup** is a free script-driven installation system created in CodeGear Delphi by Jordan Russell.
|
||||
In OCCT Inno Setup is used to create Installation Wizard on Windows.
|
||||
It is licensed under Inno Setup License (http://www.jrsoftware.org/files/is/license.txt).
|
||||
|
||||
**FreeImage** is an Open Source library supporting popular graphics image formats, such as PNG, BMP, JPEG, TIFF
|
||||
and others used by multimedia applications. This library is developed by Hervé Drolon and Floris van den Berg.
|
||||
FreeImage is easy to use, fast, multithreading safe, compatible with all 32-bit or 64-bit versions of Windows,
|
||||
and cross-platform (works both with Linux and Mac OS X). FreeImage is licensed under the
|
||||
GNU General Public License, version 2.0 (GPLv2) and
|
||||
the FreeImage Public License (FIPL) (http://freeimage.sourceforge.net/freeimage-license.txt).
|
||||
|
||||
Adobe Systems, Inc. provides **Adobe Acrobat Professional**, which is a software to view, create, manipulate,
|
||||
print and manage files in Portable Document Format (PDF).
|
||||
This product is used in OCCT for the development and update of User's Guides.
|
||||
|
||||
The same developer provides **Robohelp HTML** that allows developing online Help for applications that are run on the Web and on Intranets.
|
||||
**Robohelp HTML X5.0.2** is used in OCCT for the development and update of OCCT Overview.
|
||||
|
||||
**Linux** is a registered trademark of Linus Torvalds.
|
||||
|
||||
**Windows** is a registered trademark of Microsoft Corporation in the United States and other countries.
|
||||
|
||||
**Mac** and the Mac logo are trademarks of Apple Inc., registered in the U.S. and other countries.
|
||||
|
||||
|
||||
@section OCCT_OVW_SECTION_3 Introduction
|
||||
|
||||
|
||||
This document is just an introduction to Open CASCADE Technology (OCCT) dealing with
|
||||
compatibility and installation issues and providing a general description of OCCT modules
|
||||
and other features. All modules and development tools are described in User's Guides, available in
|
||||
Adobe Portable Document Format (PDF). To read this format, you need Adobe Acrobat Reader,
|
||||
which is a freeware and can be downloaded from the Adobe site.
|
||||
All user guides can be accessed directly from this help.
|
||||
|
||||
Alongside with PDF User Guides, OCCT suggests its users full reference documentation on all
|
||||
implementation classes automatically generated by Doxygen software.
|
||||
This Doxygen generated documentation is supplied in the form of a separate package,
|
||||
in a usual html file format.
|
||||
|
||||
Reference documentation is presented in **Modules --> Toolkits --> Packages --> Classes**
|
||||
logic structure with cross-references to all OCCT classes and complete in-browser search by all classes.
|
||||
|
||||
**Recommendation for generation of reference documentation**
|
||||
|
||||
Reference documentation can be generated by OCCT binary WOK package that
|
||||
is available for downloading from www.opencascade.org and dev.opencascade.org sites.
|
||||
|
||||
Prerequisites:
|
||||
|
||||
* Doxygen version 1.7.4 or higher
|
||||
* Graphviz version 2.28.0 or higher
|
||||
|
||||
Run WOK (cd \<WOK_INSTALL_DIR\>/site folder):
|
||||
|
||||
* Using WOK TCL shell:
|
||||
> wok_tclsh.sh
|
||||
|
||||
* Using Emacs editor:
|
||||
> wok_emacs.sh
|
||||
|
||||
In the WOK prompt, step into your workbench:
|
||||
|
||||
>wokcd <your workbench>
|
||||
|
||||
In your workbench, use **wgendoc** command with –h argument to get information about arguments of **wgendoc** command:
|
||||
|
||||
>wgendoc -h
|
||||
|
||||
then run **wgendoc** command with required arguments
|
||||
|
||||
e.g., wgendoc –output=d:/occt/doc {–m=Draw Visualization} -chm
|
||||
|
||||
|
||||
@section OCCT_OVW_SECTION_4 Installation
|
||||
|
||||
Open CASCADE Technology can be installed with binaries precompiled by
|
||||
Visual C++ 2008 using Installation Procedure under Windows platform only
|
||||
|
||||
The source package and the building tools are available for self-dependent
|
||||
preparation binary files on Unix and Windows platforms.
|
||||
|
||||
@subsection OCCT_OVW_SECTION_4_1 Windows
|
||||
|
||||
**Recommendation:**
|
||||
|
||||
If you have a previous version of OCCT installed on your station,
|
||||
and you do not plan to use it along with the new version, you might want to uninstall
|
||||
the previous version (using Control Panel, Add/Remove Programs) before
|
||||
the installation of this new version, to avoid possible problems
|
||||
(conflict of system variables, paths, etc).
|
||||
|
||||
**Attention:** For full installation OCCT requires approximately 650 Mb of disk space,
|
||||
but during the installation process you will need 1,2 Gb of free disk space.
|
||||
|
||||
OCCT installation with reference documentation requires 1,4 Gb on disk.
|
||||
|
||||
* Download the OCCT installer from OPEN CASCADE web site using the link. you have been provided
|
||||
* Launch the installer and follow the instructions.
|
||||
|
||||
### Third-party tools
|
||||
|
||||
|
||||
The includes and binaries of third-party libraries necessary for building and launching
|
||||
OCCT are included into binary distribution (built with Visual C++ 2008).
|
||||
To recompile OCCT libraries with other Visual C++ versions,
|
||||
it is necessary to install headers and libraries of these third-party products.
|
||||
|
||||
The recommended way to do this is to download each of the third-party tools from its web site
|
||||
and build it using the relevant tools. For additional convenience of the users,
|
||||
OPEN CASCADE also provides the documents with recommendations on building
|
||||
third-party products from source files.
|
||||
|
||||
When the installation is complete, you will find the following directories
|
||||
(some might be absent in case of custom installation):
|
||||
|
||||

|
||||
|
||||
### Description of directory tree
|
||||
|
||||
|
||||
* **3rdparty** * This folder contains third-party products necessary to compile and use OCCT as well as start sample applications with Visual C++ 2008;
|
||||
* **ros/adm** * This folder contains administration files, which allow rebuilding OCCT;
|
||||
* **ros/adm/cmake** * This folder contains files of CMake building procedure;
|
||||
* **ros/adm/msvc** * This folder contains Visual Studio projects for Visual C++ 2005, 2008 and 2010, which allow rebuilding OCCT under Windows platform in 32 and 64-bit mode;
|
||||
* **ros/data** * This folder contains CAD files in different formats, which can be used to test the OCCT functionalities;
|
||||
* **ros/doc** * This folder contains OCCT Overview documentation;
|
||||
* **ros/drv** * This folder contains source files generated by WOK (private header files and instantiations of generic classes);
|
||||
* **ros/inc** * This folder contains all OCCT header files;
|
||||
* **ros/samples** * This folder contains sample applications.
|
||||
* **ros/src** * This folder contains OCCT source files. They are organized in folders, one per development unit;
|
||||
* **ros/tests** * This folder contains scripts for OCCT testing.
|
||||
* **ros/win32/vc9** * This folder contains executable and library files built in optimize mode for Windows platform by Visual C++ 2008;
|
||||
|
||||
|
||||
@subsection OCCT_OVW_SECTION_4_2 System Environment Variables
|
||||
|
||||
To run any Open CASCADE Technology application you need to set the environment variables.
|
||||
|
||||
### On Windows
|
||||
|
||||
|
||||
You can define the environment variables with env.bat script located in the
|
||||
OpenCACADE<version_number>/ros folder. This script accepts two arguments to be used:
|
||||
the version of Visual Studio (vc8, vc9, or vc10) and the architecture (win32 or win64).
|
||||
|
||||
The additional environment settings necessary for compiling OCCT libraries and samples
|
||||
by Microsoft Visual Studio can be set using script custom.bat located in the same folder.
|
||||
You might need to edit this script to correct the paths to third-party libraries
|
||||
if they are installed on your system in a non-default location.
|
||||
|
||||
Script msvc.bat can be used with the same arguments for immediate launch of Visual Studio for (re)compiling OCCT.
|
||||
|
||||
### On Unix
|
||||
|
||||
|
||||
If OCCT was built by Code::Blocks, you can define the environment variables with env_cbp.sh or custom_cbp.sh script.
|
||||
|
||||
If OCCT was built by Automake, you can define the environment variables with env_amk.sh or custom_amk.sh script.
|
||||
|
||||
The scripts are located in the OpenCACADE<version_number>/ros folder of the source package.
|
||||
|
||||
|
||||
### Description of system variables:
|
||||
|
||||
|
||||
* **CASROOT** is used to define the root directory of Open CASCADE Technology;
|
||||
* **PATH** is required to define the path to OCCT binaries and 3rdparty folder;
|
||||
* **LD_LIBRARY_PATH** is required to define the path to OCCT libraries (on UNIX platforms only);
|
||||
* **MMGT_OPT** if set to 1, the memory manager performs optimizations as described below; if set to 2,
|
||||
Intel ® TBB optimized memory manager is used; if 0 (default), every memory block is allocated
|
||||
in C memory heap directly (via malloc() and free() functions).
|
||||
In the latter case, all other options except MMGT_CLEAR and MMGT_REENTRANT are ignored;
|
||||
* **MMGT_CLEAR** if set to 1 (default), every allocated memory block is cleared by zeros;
|
||||
if set to 0, memory block is returned as it is;
|
||||
* **MMGT_CELLSIZE** defines the maximal size of blocks allocated in large pools of memory. Default is 200;
|
||||
* **MMGT_NBPAGES** defines the size of memory chunks allocated for small blocks in pages
|
||||
(operating-system dependent). Default is 10000;
|
||||
* **MMGT_THRESHOLD** defines the maximal size of blocks that are recycled internally
|
||||
instead of being returned to the heap. Default is 40000;
|
||||
* **MMGT_MMAP** when set to 1 (default), large memory blocks are allocated using
|
||||
memory mapping functions of the operating system; if set to 0,
|
||||
they will be allocated in the C heap by malloc();
|
||||
* **MMGT_REENTRANT** when set to 1 (default), all calls to the
|
||||
optimized memory manager will be secured against possible simultaneous access from different execution threads.
|
||||
|
||||
This variable should be set in any multithreaded application that uses
|
||||
an optimized memory manager (MMGT_OPT=1) and has more than one thread
|
||||
potentially calling OCCT functions. If set to 0, OCCT memory management and
|
||||
exception handling routines will skip the code protecting from possible concurrency
|
||||
in multi-threaded environment. This can yield some performance gain in some applications,
|
||||
but can lead to unpredictable results if used in a multithreaded application;
|
||||
|
||||
**Special note:** for applications that use OCCT memory manager from more than one thread,
|
||||
on multiprocessor hardware, it is recommended to use options MMGT_OPT=2 and MMGT_REENTRANT=1.
|
||||
|
||||
* **CSF_LANGUAGE** is required to define the default language of messages;
|
||||
* **CSF_EXCEPTION_PROMPT** – if defined and set to 1 then a diagnostic message is displayed in case of an exception;
|
||||
* **CSF_MDTVFontDirectory** accesses the fonts that can be used in OCCT;
|
||||
* **CSF_MDTVTexturesDirectory** defines the directory for available textures when using texture mapping;
|
||||
* **CSF_UnitsDefinition** and **CSF_UnitsLexicon** are required by programs considering units;
|
||||
* **CSF_SHMessage** is required in order to define the path to the messages file for *ShapeHealing*;
|
||||
* **CSF_XSMessage** is required in order to define the path to the messages file for **STEP** and **IGES** translators;
|
||||
* **CSF_StandardDefaults** and **CSF_PluginDefaults** are required in order to maintain CASCADE Persistence mechanism to make possible any open/save operations with OCAF documents;
|
||||
* **CSF_StandardLiteDefaults** is required in order to maintain *OCCT Persistence mechanism* to make possible any open/save operations with Lite OCAF documents;
|
||||
* **CSF_XCAFDefaults** any open/save operations for **XDE** documents;
|
||||
* **CSF_GraphicShr** is required to define the path to the *TKOpenGl* library;
|
||||
* **CSF_IGESDefaults** and **CSF_STEPDefaults** are required for **IGES** and **STEP** translators correspondingly in order to define the path to the resource files;
|
||||
* **CSF_XmlOcafResource** is required in order to set the path to **XSD** resources, which defines XML grammar.
|
||||
|
||||
As part of XML persistence support, these definitions can be used by end users
|
||||
in XML validators or editors, together with persistent XmlOcaf documents;
|
||||
|
||||
* **CSF_MIGRATION_TYPES** is required in order to read documents that contain old data types, such as *TDataStd_Shape*;
|
||||
* **TCLLIBPATH**, **TCL_LIBRARY**, **TK_LIBRARY** and **TIX_LIBRARY** are required to allow work with **DRAW** and **WOK**.
|
||||
|
||||
|
||||
@section OCCT_OVW_SECTION_5 Requirements
|
||||
|
||||
@subsection OCCT_OVW_SECTION_5_1 Linux Intel
|
||||
|
||||
| Operating System | 32/64-bit: Debian: 4.0, Mandriva: 2010* |
|
||||
| :--------------------------------------------- | :------------------------------------------------------------------------------------------------- |
|
||||
| Minimum memory | 512 Mb, 1 Gb recommended |
|
||||
| Free disk space (complete installation) | For full installation Open CASCADE Technology requires 600 Mb of disk space. |
|
||||
| Minimum swap space | 500 Mb |
|
||||
| Video card | GeForce, |
|
||||
| | The following versions of GeForce drivers are recommended: |
|
||||
| | 64-bit Version: 100.14.19 or later http://www.nvidia.com/object/linux_display_amd64_100.14.19.html |
|
||||
| | 32-bit Version: 100.14.19 or later http://www.nvidia.com/object/linux_display_ia32_100.14.19.html |
|
||||
| Graphic library | OpenGL 1.1+ (OpenGL 1.5+ is recommended) |
|
||||
| C++ | GNU gcc 4.0. * 4.3.2. |
|
||||
| TCL (for testing tools) | Tcltk 8.5 or 8.6 |
|
||||
| | http://www.tcl.tk/software/tcltk/8.6.html |
|
||||
| Qt (for demonstration tools) | Qt 4.6.2 http://qt.digia.com/downloads |
|
||||
| Freetype (OCCT Text rendering) | freetype-2.4.10 |
|
||||
| | http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (Support of common graphic formats ) | FreeImage 3.14.1 |
|
||||
| | http://sourceforge.net/projects/freeimage/files/Source%20Distribution/ |
|
||||
| gl2ps (Export contents of OCCT | gl2ps-1.3.5 |
|
||||
| viewer to vector graphic file) | http://geuz.org/gl2ps/ |
|
||||
| TBB (optional tool for parallelized | TBB 3.x or 4.x |
|
||||
| version of BRepMesh component) | http://www.threadingbuildingblocks.org/ |
|
||||
|
||||
@subsection OCCT_OVW_SECTION_5_2 Windows Intel
|
||||
|
||||
| Operating System | 32/64-bit: 8/ 7 SP1 / VISTA SP2 /XP SP3 |
|
||||
| :--------------------------------------------- | :----------------------------------------------------------------------------------------------- |
|
||||
| Minimum memory | 512 Mb, 1 Gb recommended |
|
||||
| Free disk space | For full installation Open CASCADE Technology requires 650 Mb of disk space. |
|
||||
| (complete installation) | but during the process of installation you will need 1,2 Gb of free disk space. |
|
||||
| Minimum swap space | 500 Mb |
|
||||
| Video card | GeForce, |
|
||||
| | Version 266.58 WHQL or later is recommended:http://www.nvidia.com/Download/index.aspx |
|
||||
| Graphic library | OpenGL 1.1+ (OpenGL 1.5+ is recommended) |
|
||||
| C++ | Microsoft Visual Studio .NET 2005 SP1 with all security updates |
|
||||
| | Microsoft Visual Studio .NET 2008 SP1* |
|
||||
| | Microsoft Visual Studio .NET 2010 |
|
||||
| | Microsoft Visual Studio .NET 2012 |
|
||||
| TCL (for testing tools) | ActiveTcl 8.5 or 8.6 |
|
||||
| | http://www.activestate.com/activetcl/downloads |
|
||||
| Qt (for demonstration tools) | Qt 4.6.2 http://qt.digia.com/downloads |
|
||||
| Freetype (OCCT Text rendering) | freetype-2.4.10 |
|
||||
| | http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (Support of common graphic formats ) | FreeImage 3.14.1 |
|
||||
| | http://sourceforge.net/projects/freeimage/files/Source%20Distribution/ |
|
||||
| gl2ps (Export contents of OCCT | gl2ps-1.3.5 |
|
||||
| viewer to vector graphic file) | http://geuz.org/gl2ps/ |
|
||||
| TBB (optional tool for parallelized | TBB 3.x or 4.x |
|
||||
| version of BRepMesh component) | http://www.threadingbuildingblocks.org/ |
|
||||
|
||||
@subsection OCCT_OVW_SECTION_5_3 MAC OS X
|
||||
|
||||
| Operating System | Requires Mac OS X 10.6.8 Snow Leopard / 10.7 Lion |
|
||||
| :--------------------------------------------- | :----------------------------------------------------------------------------------------------- |
|
||||
| Minimum memory | 512 Mb, 1 Gb recommended |
|
||||
| Free disk space (complete installation) | For full installation Open CASCADE Technology requires 600 Mb of disk space. |
|
||||
| Minimum swap space | 500 Mb |
|
||||
| Graphic library | OpenGL 1.1+ (OpenGL 1.5+ is recommended) |
|
||||
| C++ | XCode 3.2 or newer (4.x is recommended) |
|
||||
| TCL (for testing tools) | Tcltk 8.5 or 8.6 |
|
||||
| | http://www.tcl.tk/software/tcltk/8.6.html |
|
||||
| Qt (for demonstration tools) | Qt 4.6.2 http://qt.digia.com/downloads |
|
||||
| Freetype (OCCT Text rendering) | freetype-2.4.10 |
|
||||
| | http://sourceforge.net/projects/freetype/files/ |
|
||||
| FreeImage (Support of common graphic formats ) | FreeImage 3.14.1 |
|
||||
| | http://sourceforge.net/projects/freeimage/files/Source%20Distribution/ |
|
||||
| gl2ps (Export contents of OCCT | gl2ps-1.3.5 |
|
||||
| viewer to vector graphic file) | http://geuz.org/gl2ps/ |
|
||||
| TBB (optional tool for parallelized | TBB 3.x or 4.x |
|
||||
| version of BRepMesh component) | http://www.threadingbuildingblocks.org/ |
|
||||
|
||||
|
||||
@section OCCT_OVW_SECTION_6 Release Notes
|
||||
|
||||
|
||||
Open CASCADE Technology latest version
|
||||
@htmlonly
|
||||
<a href="http://occtrel.nnov.opencascade.com/OpenCASCADE6.6.0/doc/release_notes.pdf">Release Notes</a>
|
||||
@endhtmlonly (PDF)
|
||||
|
||||
|
||||
@section OCCT_OVW_SECTION_7 Getting Started
|
||||
|
||||
|
||||
@subsection OCCT_OVW_SECTION_7_1 Draw Test Harness
|
||||
|
||||
Draw is a command interpreter based on TCL and a graphical system used for testing and demonstrating OCCT modeling libraries.
|
||||
|
||||
Draw can be used interactively to create, display and modify objects such as curves, surfaces and topological shapes.
|
||||
|
||||

|
||||
|
||||
Scripts can be written to customize Draw and perform tests.
|
||||
New types of objects and new commands can be added using C++ programming language.
|
||||
|
||||
Draw contains:
|
||||
|
||||
* A command interpreter based on TCL command language.
|
||||
* A 2D an 3D graphic viewer with support of operations such as zoom, pan, rotation and full-screen views.
|
||||
* An optional set of geometric commands to create and modify curves and surfaces and to use OCCT geometry algorithms.
|
||||
* A set of topological commands to create and modify BRep shapes and to use OCCT topology algorithms.
|
||||
* A set of graphic commands for view and display operations including Mesh Visualization Service.
|
||||
* A set of Application framework commands for handling of files and attributes.
|
||||
* A set of Data Exchange commands for translation of files from various formats (IGES,STEP) into OCCT shapes.
|
||||
* A set of Shape Healing commands: check of overlapping edges, approximation of a shape to BSpline, etc.
|
||||
|
||||
You can add new custom test harness commands to Draw in order to test
|
||||
or demonstrate a new functionality, which you are developing.
|
||||
|
||||
Currently DRAW Test Harness is a single executable called DRAWEXE.
|
||||
|
||||
Commands grouped in toolkits can be loaded at run-time thereby implementing dynamically loaded plug-ins.
|
||||
Thus you can work only with the commands that suit your needs adding
|
||||
the commands dynamically without leaving the Test Harness session.
|
||||
|
||||
Declaration of available plug-ins is done through special resource file(s).
|
||||
The pload command loads the plug-in in accordance with
|
||||
the specified resource file and activates the commands implemented in the plug-in.
|
||||
|
||||
The whole process of using the plug-in mechanism as well as the instructions for extending Test Harness is described in the
|
||||
@htmlonly
|
||||
<a href="http://occtrel.nnov.opencascade.com/OpenCASCADE6.6.0/doc/OCCT_Tests.pdf">User's Guide/</a>
|
||||
@endhtmlonly
|
||||
|
||||
Draw Test Harness provides an environment for OCCT automated testing system. Please, consult its
|
||||
@htmlonly
|
||||
<a href="http://occtrel.nnov.opencascade.com/OpenCASCADE6.6.0/doc/OCCT_Tests.pdf">User's Guide /</a>
|
||||
@endhtmlonly
|
||||
for details.
|
||||
|
||||
Remarks:
|
||||
|
||||
* The DRAWEXE executable is delivered with the installation procedure on Windows platform only.
|
||||
* To start it, launch DRAWEXE executable from Open CASCADE Technology//Draw Test Harness item of the Start\\Programs menu.
|
||||
|
||||
@subsection OCCT_OVW_SECTION_7_2 Experimenting with Draw Test Harness
|
||||
|
||||
Running Draw
|
||||
------------
|
||||
|
||||
**On Linux:**
|
||||
|
||||
1. If OCCT was built by Code::Blocks * use $CASROOT/draw_cbp.sh file to launch DRAWEXE executable;
|
||||
2. If OCCT was built by Automake * use $CASROOT/draw_amk.sh file to launch DRAWEXE executable;
|
||||
|
||||
Draw[1]> prompt appears in the command window
|
||||
|
||||
Type pload ALL
|
||||
|
||||
**On Windows:**
|
||||
|
||||
Launch Draw executable from Open CASCADE Technology\\Test Harness\\Draw Test Harness
|
||||
item of the Start\\Programs menu or Use $CASROOT\\draw.bat file to launch DRAWEXE executable.
|
||||
|
||||
Draw[1]> prompt appears in the command window
|
||||
|
||||
Type pload ALL
|
||||
|
||||
**Creating your first geometric objects**
|
||||
|
||||
1. In the command window, type axo to create an axonometric view
|
||||
2. Type box b -10 -10 -10 20 20 20 to create a cube b of size 20,
|
||||
parallel to the X Y Z axis and centered on the origin.
|
||||
The cube will be displayed in the axonometric view in wireframe mode
|
||||
3. Type fit to fill the viewer with the cube
|
||||
4. Type pcylinder c 2 30 to create a cylinder c of radius 2 and height 30.
|
||||
The cylinder will be displayed in addition to the cube
|
||||
|
||||
**Manipulating the view**
|
||||
|
||||
1. Type clear to erase the view
|
||||
2. Type donly c to display the cylinder only
|
||||
3. Type donly b to display the cube only
|
||||
4. Type hlr hlr b to display the cube in the hidden line removal mode
|
||||
|
||||
**Running demonstration files**
|
||||
|
||||
1. Type cd ..//.. to return to the root directory
|
||||
2. Type cd src//DrawResources to reach the DrawResources directory
|
||||
3. Type source "Available Demo File" to run the demonstration provided with Open CASCADE
|
||||
4. The following demonstration files are available:
|
||||
* DataExchangeDemo.tcl
|
||||
* ModelingDemo.tcl
|
||||
* OCAFDemo.tcl
|
||||
* VisualizationDemo.tcl
|
||||
|
||||
**Getting Help**
|
||||
|
||||
1. Type help to see all available commands
|
||||
2. Type help command-name to find out the arguments for a given command
|
||||
|
||||
@subsection OCCT_OVW_SECTION_7_3 Programming Samples
|
||||
|
||||
@subsubsection OCCT_OVW_SECTION_7_3_1 MFC
|
||||
|
||||
Visual C++ programming samples containing 10 Visual C++ projects
|
||||
illustrating how to use a particular module or functionality.
|
||||
|
||||
The list of MFC samples:
|
||||
|
||||
* Geometry
|
||||
* Modeling
|
||||
* Viewer2d
|
||||
* Viewer3d
|
||||
* ImportExport
|
||||
* Ocaf
|
||||
* Triangulation
|
||||
* HLR
|
||||
* Animation
|
||||
* Convert
|
||||
|
||||

|
||||
|
||||
**Remarks:**
|
||||
|
||||
* MFC samples are available only on Windows platform;
|
||||
* To start a sample use Open CASCADE Technology\\Samples\\Mfc\\ item of the Start\\Programs menu;
|
||||
* Read carefully readme.txt to learn about launching and compilation options.
|
||||
|
||||
@subsubsection OCCT_OVW_SECTION_7_3_2 Qt
|
||||
|
||||
OCCT contains three samples based on Qt application framework
|
||||
|
||||
Import Export
|
||||
-------------
|
||||
|
||||
Import Export programming sample contains 3D Viewer and Import // Export functionality.
|
||||
|
||||

|
||||
|
||||
Tutorial
|
||||
---------
|
||||
|
||||
The Qt programming tutorial teaches how to use Open CASCADE Technology services to model a 3D object.
|
||||
The purpose of the tutorial is not to explain all OCCT classes but
|
||||
to help start thinking in terms of the Open CASCADE Technology.
|
||||
|
||||
This tutorial assumes that the user has experience in using and setting up C++.
|
||||
From the viewpoint of programming, Open CASCADE Technology is designed
|
||||
to enhance user's C++ tools with high performance modeling classes, methods and functions.
|
||||
The combination of these resources allows creating substantial applications.
|
||||
|
||||
**See also:** @subpage overview__tutorial "3D Object Tutorial"
|
||||
|
||||
Voxel
|
||||
------
|
||||
|
||||
This is a demonstration application showing OCCT voxel models.
|
||||
It also includes a set of non-regression tests and other commands
|
||||
for testing this functionality (accessible only through TEST pre-processor definition).
|
||||
|
||||
**See also:**
|
||||
@htmlonly
|
||||
<a href="http://occtrel.nnov.opencascade.com/OpenCASCADE6.6.0/doc/voxels_wp.pdf">Voxels User's guide (PDF)</a>
|
||||
@endhtmlonly
|
||||
|
||||
**Remarks:**
|
||||
|
||||
* Qt samples are available on all supported platforms;
|
||||
* To start a sample on Windows use Open CASCADE Technology\\Samples\\Qt\\ item of the Start\\Programs menu.
|
||||
|
||||
@subsubsection OCCT_OVW_SECTION_7_3_3 C#
|
||||
|
||||
C# sample containing 3D Viewer and Import // Export functionality.
|
||||
|
||||

|
||||
|
||||
Import:
|
||||
|
||||
* BRep
|
||||
* Iges
|
||||
* Step
|
||||
|
||||
Export:
|
||||
|
||||
* Brep
|
||||
* Iges
|
||||
* Step
|
||||
* Stl
|
||||
* Vrml
|
||||
|
||||
**Remarks:**
|
||||
|
||||
* C# sample is available only on Windows platform;
|
||||
* It is delivered in source code only and must be built with Microsoft Visual C++ 2005.
|
69
dox/dev_guides/building/automake.md
Normal file
@ -0,0 +1,69 @@
|
||||
Building with Automake {#dev_guides__building__automake}
|
||||
======================
|
||||
|
||||
This file describes steps to build OCCT libraries from complete source
|
||||
archive on Linux with GNU build system (Autotools).
|
||||
|
||||
If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See file \ref wok "WOK" for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see
|
||||
OCCT_Build3rdParty_Linux.pdf for instructions.
|
||||
|
||||
Note that during compilation by makefiles on some Linux OS on a station with
|
||||
NVIDIA video card you may experience problems because the installation
|
||||
procedure of NVIDIA video driver removes library libGL.so included in package
|
||||
libMesaGL from directory /usr/X11R6/lib and places this library libGL.so in
|
||||
directory /usr/lib. However, libtool expects to find the library in directory
|
||||
/usr/X11R6/lib, which causes compilation crash (See /usr/X11R6/lib/libGLU.la).
|
||||
|
||||
To prevent this, suggest making links:
|
||||
|
||||
ln -s /usr/lib/libGL.so /usr/X11R6/lib/libGL.so
|
||||
ln -s /usr/lib/libGL.la /usr/X11R6/lib/libGL.la
|
||||
|
||||
1.In OCCT root folder, launch build_configure script
|
||||
|
||||
This will generate files configure and Makefile.in for your system.
|
||||
|
||||
2.Go to the directory where OCCT will be built, and run configure to generate
|
||||
makefiles.
|
||||
|
||||
$CASROOT/configure \<FLAGS\>
|
||||
|
||||
Where \<FLAGS\> is a set of options.
|
||||
The following flags are mandatory:
|
||||
|
||||
* --with-tcl= defines location of tclConfig.sh
|
||||
* --with-tk= defines location of tkConfig.sh
|
||||
* --with-freetype= defines location of installed FreeType product
|
||||
* --prefix= defines location for the installation of OCCT binaries
|
||||
|
||||
Additional flags:
|
||||
|
||||
* --with-gl2ps= defines location of installed gl2ps product
|
||||
* --with-freeimage= defines location of installed FreeImage product
|
||||
* --with-tbb-include= defines location of tbb.h
|
||||
* --with-tbb-library= defines location of libtbb.so
|
||||
* --enable-debug= yes: includes debug information, no: does not include debug information
|
||||
* --enable-production= yes: switches code optimization, no: switches off code optimization
|
||||
* --disable-draw - allows OCCT building without Draw.
|
||||
|
||||
If location of FreeImage, TBB, and Gl2Ps is not specified, OCCT will be
|
||||
built without these optional libraries.
|
||||
|
||||
|
||||
Attention: 64-bit platforms are detected automatically.
|
||||
|
||||
Example:
|
||||
|
||||
> ./configure -prefix=/PRODUCTS/occt-6.5.5 --with-tcl=/PRODUCTS/tcltk-8.5.8/lib --with-tk=/PRODUCTS/tcltk-8.5.8/lib --with-freetype=/PRODUCTS/freetype-2.4.10 --with-gl2ps=/PRODUCTS/gl2ps-1.3.5 --with-freeimage=/PRODUCTS/freeimage-3.14.1 --with-tbb-include=/PRODUCTS/tbb30_018oss/include --with-tbb-library=/PRODUCTS/tbb30_018oss/lib/ia32/cc4.1.0_libc2.4_kernel2.6.16.21
|
||||
|
||||
3.If configure exits successfully, you can build OCCT with make command.
|
||||
|
||||
> make -j8 install
|
||||
|
||||
To start DRAW, launch
|
||||
|
||||
> draw.sh
|
77
dox/dev_guides/building/cmake.md
Normal file
@ -0,0 +1,77 @@
|
||||
Building with CMake {#dev_guides__building__cmake}
|
||||
===================
|
||||
|
||||
This file describes steps to build OCCT libraries from complete source package
|
||||
with CMake. CMake is free software that can create GNU Makefiles, KDevelop,
|
||||
XCode, and Visual Studio project files. Version 2.6 or above of CMake is
|
||||
required.
|
||||
|
||||
If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See file \ref wok "WOK" for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see
|
||||
instructions for your platform on Resources page at http://dev.opencascade.org
|
||||
|
||||
1. Decide on location of build and install directories.
|
||||
|
||||
The build directory is the one where intermediate files will be created
|
||||
(projects / makefiles, objects, binaries).
|
||||
The install directory is the one where binaries will be installed after
|
||||
build, along with header files and resources required for OCCT use in
|
||||
applications.
|
||||
|
||||
OCCT CMake scripts assume use of separate build and one install directories
|
||||
for each configuration (Debug or Release).
|
||||
|
||||
It is recommended to separate build and install directories from OCCT
|
||||
source directory, for example:
|
||||
|
||||
/user/home/occt/ros - sources
|
||||
/user/home/tmp/occt-build-release - intermediate files (release)
|
||||
/user/home/occt-install-release - installed binaries (release)
|
||||
|
||||
2. Run CMake indicating path to OCCT sources (ros subdirectory) and selected build directory.
|
||||
It is recommended to use GUI tools provided by CMake: cmake-gui on Windows
|
||||
and Mac, ccmake on Linux.
|
||||
|
||||
Example:
|
||||
|
||||
Linux> cd /user/home/occt-install-release
|
||||
Linux> ccmake /user/home/occt/ros
|
||||
|
||||
3. Run Configure
|
||||
|
||||
You will likely get CMake errors due to missing paths to 3rd-party
|
||||
libraries. This is normal; proceed with configuration as follows.
|
||||
|
||||
4. Check parameters shown by CMake, set them in accordance with your
|
||||
environment, and repeat Configure until it runs without error:
|
||||
|
||||
- 3RDPARTY_DIR: path to directory whethe 3rd-party libraries are installed
|
||||
(for the cases when they are not in default locations, or on Windows)
|
||||
- 3RDPARTY_USE_\<library\>: select to use optional libraries
|
||||
- Other options in 3RDPARTY group can be used to fine-tune paths to
|
||||
3rd-party libraries
|
||||
|
||||
- BUILD_TYPE: configuration to build (Debug or Release)
|
||||
- BUILD_BITNESS: bitness (32 or 64)
|
||||
- BUILD_TOOLKITS: optional string containing list of toolkits to be built
|
||||
in addition to those included in completely built modueles
|
||||
- BUILD_\<module\>: select to build corresponding OCCT module
|
||||
|
||||
- INSTALL_DIR: directory to install OCCT
|
||||
- INSTALL_\<library\>: select to copy corresponding 3rd-party library to OCCT
|
||||
install dir
|
||||
|
||||
5. Run Generate
|
||||
|
||||
This will create makefiles or project files for your build system.
|
||||
|
||||
6. Build OCCT:
|
||||
|
||||
- on Windows with MSVC: open solution OCCT.sln and build it, when build project INSTALL_ALL explicitly to have binaries and headers installed
|
||||
- on Linux with make files: run 'make install'
|
||||
|
||||
|
||||
|
64
dox/dev_guides/building/code_blocks.md
Normal file
@ -0,0 +1,64 @@
|
||||
Building with Code::Blocks on Mac OS X {#dev_guides__building__code_blocks}
|
||||
======================================
|
||||
|
||||
This file describes steps to build OCCT libraries from complete source package
|
||||
on Mac OS X with Code::Blocks.
|
||||
|
||||
If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See file \ref wok "WOK" for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see
|
||||
OCCT_Build3rdParty_OSX.pdf for details.
|
||||
|
||||
1. Add paths to the mandatory 3rd-party products (Tcl/Tk and FreeType) in file
|
||||
custom.sh located in \<OCCT_ROOT_DIR\>. For this:
|
||||
|
||||
1.1. Add paths to the includes in variable "CSF_OPT_INC";
|
||||
|
||||
1.2. Add paths to the binary libraries in variable "CSF_OPT_LIB64";
|
||||
|
||||
All paths should be separated by ":" symbol.
|
||||
|
||||
2. Add paths to the optional 3rd-party libraries (TBB, gl2ps and FreeImage)
|
||||
in the aforementioned environment variables "CSF_OPT_INC" and
|
||||
"CSF_OPT_LIB64" from file custom.sh.
|
||||
|
||||
If you want to build OCCT without the optional libraries perform the
|
||||
following steps:
|
||||
|
||||
2.1 Disable unnecessary library in custom.sh by setting the corresponding
|
||||
variable HAVE_\<LIBRARY_NAME\> to "false".
|
||||
|
||||
export HAVE_GL2PS=false
|
||||
|
||||
2.2 Remove this library from Linker settings in Code::Blocks for each project
|
||||
that uses it: right click on the required project, choose "Build options",
|
||||
go to "Linker settings" tab in the opened window , select unnecessary
|
||||
libraries and click "Delete" button.
|
||||
|
||||
3. Open Terminal application
|
||||
|
||||
4. Enter \<OCCT_ROOT_DIR\>:
|
||||
|
||||
cd \<OCCT_ROOT_DIR\>
|
||||
|
||||
5. To start Code::Blocks, run the command /codeblocks.sh
|
||||
|
||||
6. To build all toolkits, click "Build->Build workspace" in the menu bar.
|
||||
|
||||
|
||||
To start DRAWEXE, which has been built with Code::Blocks on Mac OS X, perform
|
||||
the following steps:
|
||||
|
||||
1. Open Terminal application
|
||||
|
||||
2. Enter \<OCCT_ROOT_DIR\>:
|
||||
|
||||
cd \<OCCT_ROOT_DIR\>
|
||||
|
||||
3. Run script
|
||||
|
||||
./draw_cbp.sh cbp [d]
|
||||
|
||||
Option "d" is used if OCCT has been built in Debug mode.
|
31
dox/dev_guides/building/msvc.md
Normal file
@ -0,0 +1,31 @@
|
||||
Building with MS Visual C++ {#dev_guides__building__msvc}
|
||||
===========================
|
||||
|
||||
This file describes steps to build OCCT libraries from complete source
|
||||
archive on Windows with MS Visual C++.
|
||||
|
||||
If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See file \ref wok "WOK" for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see
|
||||
OCCT_Build3rdParty_Windows.pdf for instructions.
|
||||
|
||||
1. Edit file custom.bat to define environment:
|
||||
|
||||
- VCVER - version of Visual Studio (vc8, vc9, vc10 or vc11),
|
||||
and relevant VCVARS path
|
||||
- ARCH - architecture (32 or 64), affects only PATH variable for execution
|
||||
- HAVE_* - flags to enable or disable use of optional third-party products
|
||||
- CSF_OPT_* - paths to search for includes and binaries of all used
|
||||
third-party products
|
||||
|
||||
2. Launch msvc.bat to start Visual Studio with all necessary environment
|
||||
variables defined.
|
||||
|
||||
Note: the MSVC project files are located in folders adm\\msvc\\vc[9-11].
|
||||
Binaries are produced in win32 or win64 folders.
|
||||
|
||||
3. Build with Visual Studio
|
||||
|
||||
To start DRAW, launch draw.bat.
|
71
dox/dev_guides/building/xcode.md
Normal file
@ -0,0 +1,71 @@
|
||||
Building with Xcode {#dev_guides__building__xcode}
|
||||
===================
|
||||
|
||||
This file describes steps to build OCCT libraries from complete source package
|
||||
on Mac OS X with Xcode.
|
||||
|
||||
If you are building OCCT from bare sources (as in Git repository), or do some
|
||||
changes affecting CDL files, you need to use WOK to re-generate header files
|
||||
and build scripts / projects. See file \ref wok "WOK" for instructions.
|
||||
|
||||
Before building OCCT, you need to install required third-party libraries; see
|
||||
OCCT_Build3rdParty_OSX.pdf for details.
|
||||
|
||||
1. Add paths to the mandatory 3rd-party products (Tcl/Tk and FreeType)
|
||||
in file custom.sh located in \<OCCT_ROOT_DIR\>. For this:
|
||||
|
||||
1.1. Add paths to the includes in variable "CSF_OPT_INC";
|
||||
|
||||
1.2. Add paths to the binary libraries in variable "CSF_OPT_LIB64";
|
||||
|
||||
All paths should be separated by ":" symbol.
|
||||
|
||||
2. Add paths to the optional 3rd-party libraries (TBB, gl2ps and FreeImage)
|
||||
in the aforementioned environment variables "CSF_OPT_INC" and
|
||||
"CSF_OPT_LIB64" from file custom.sh.
|
||||
|
||||
If you want to build OCCT without the optional libraries perform the
|
||||
following steps:
|
||||
|
||||
2.1 Disable unnecessary library in custom.sh by setting the corresponding
|
||||
variable HAVE_<LIBRARY_NAME> to "false".
|
||||
|
||||
export HAVE_GL2PS=false
|
||||
|
||||
2.2 Remove this library from Project navigator in Xcode for each project that
|
||||
uses it: choose the required project, right click on the unnecessary
|
||||
library and select "Delete" button.
|
||||
|
||||
3. Open Terminal application.
|
||||
|
||||
4. Enter \<OCCT_ROOT_DIR\>:
|
||||
|
||||
cd \<OCCT_ROOT_DIR\>
|
||||
|
||||
5. To start Xcode, run the command /xcode.sh
|
||||
|
||||
6. To build a certain toolkit, select it in "Scheme" drop-down list in Xcode
|
||||
toolbar, press "Product" in the menu and click "Build" button.
|
||||
|
||||
To build the entire OCCT, create a new empty project (select "File ->
|
||||
New -> Project -> "Empty project" in the menu. Input the project name,
|
||||
e.g. "OCCT", click "Next" and "Create" buttons). Drag and drop the "OCCT"
|
||||
folder in the created "OCCT" project in the Project navigator. Select
|
||||
"File -> New -> Target -> Aggregate" in the menu. Enter the project name
|
||||
(e.g. "OCCT") and click "Finish". The "Build Phases" tab will open.
|
||||
Click "+" button to add the necessary toolkits to the target project.
|
||||
It is possible to select all toolkits by pressing "Command+A" combination.
|
||||
|
||||
To start DRAWEXE, which has been built with Xcode on Mac OS X, perform the following steps:
|
||||
|
||||
1. Open Terminal application
|
||||
|
||||
2. Enter \<OCCT_ROOT_DIR\>:
|
||||
|
||||
cd \<OCCT_ROOT_DIR\>
|
||||
|
||||
3. Run script
|
||||
|
||||
./draw_cbp.sh xcd [d]
|
||||
|
||||
Option "d" is used if OCCT has been built in Debug mode.
|
1876
dox/dev_guides/cdl/cdl.md
Normal file
BIN
dox/dev_guides/cdl/images/cdl_image001.jpg
Normal file
After ![]() (image error) Size: 6.7 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image002.jpg
Normal file
After ![]() (image error) Size: 3.5 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image003.jpg
Normal file
After ![]() (image error) Size: 45 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image004.jpg
Normal file
After ![]() (image error) Size: 17 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image005.jpg
Normal file
After ![]() (image error) Size: 16 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image006.jpg
Normal file
After ![]() (image error) Size: 22 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image007.jpg
Normal file
After ![]() (image error) Size: 20 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image008.jpg
Normal file
After ![]() (image error) Size: 17 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image009.jpg
Normal file
After ![]() (image error) Size: 27 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image010.jpg
Normal file
After ![]() (image error) Size: 50 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image011.jpg
Normal file
After ![]() (image error) Size: 60 KiB |
BIN
dox/dev_guides/cdl/images/cdl_image012.jpg
Normal file
After ![]() (image error) Size: 42 KiB |
102
dox/dev_guides/dev_guides.md
Normal file
@ -0,0 +1,102 @@
|
||||
Developer Guides {#dev_guides}
|
||||
================
|
||||
|
||||
@section OCCT_OVW_SECTION1 Source Repository
|
||||
|
||||
This directory contains sources of Open CASCADE Technology (OCCT), a collection
|
||||
of C++ libraries providing services for 3D surface and solid modeling, CAD data
|
||||
exchange, and visualization. OCCT can be best applied in development of
|
||||
software dealing with 3D modeling (CAD), manufacturing / measuring (CAM) or
|
||||
numerical simulation (CAE).
|
||||
|
||||
The OCCT code is subject to the Open CASCADE Technology Public License Version
|
||||
6.6 (the "License"). You may not use the content of the relevant files except in
|
||||
compliance with the License. Please see the LICENSE file or obtain a copy of the
|
||||
License at http://www.opencascade.org and read it completely before using this
|
||||
software.
|
||||
|
||||
@section OCCT_OVW_SECTION11 Building OCCT Libraries
|
||||
|
||||
The source package of the Open CASCADE Technology including the source files of samples
|
||||
and tools and the set of building procedures is available for self-dependent preparation
|
||||
binary files on UNIX and Windows platforms.
|
||||
|
||||
In order to build OCCT libraries from these sources for use in your program,
|
||||
you need to:
|
||||
|
||||
1. Install the required third-party libraries.
|
||||
|
||||
Follow the instructions provided in the documents titled "Building 3rd party
|
||||
products for OCCT" on http://dev.opencascade.org/?q=home/resources for
|
||||
choice of the needed libraries, their installation and building.
|
||||
|
||||
2. If you use OCCT sources from Git repository or do come changes affecting
|
||||
CDL files or dependencies of OCCT toolkit, update header files generated
|
||||
from CDL, and regenerate build scripts for your environment using WOK.
|
||||
See \subpage dev_guides__wok "WOK" for details.
|
||||
|
||||
Skip to step 3 if you use complete source package (e.g. official OCCT
|
||||
release) without changes in CDL.
|
||||
|
||||
3. Build using your preferred build tool.
|
||||
- \subpage dev_guides__building__automake "Building on Linux with Autotools"
|
||||
- \subpage dev_guides__building__cmake "Building with CMake (cross-platform)"
|
||||
- \subpage dev_guides__building__code_blocks "Building on Mac OS X with Code::Blocks"
|
||||
- \subpage dev_guides__building__msvc "Building on Windows with MS Visual Studio 2005-2012"
|
||||
- \subpage dev_guides__building__xcode "Building on Mac OS X with Xcode"
|
||||
|
||||
The current version of OCCT can be consulted in the file src/Standard/Standard_Version.hxx
|
||||
|
||||
@section OCCT_OVW_SECTION111 Automatic tests
|
||||
|
||||
OCCT automatic testing system is integrated with @ref draw "DRAW Test Harness",
|
||||
a console application based on Tcl (a scripting language).
|
||||
All tests are run from DRAW command prompt (run **draw.bat** or
|
||||
**draw.sh** to start it).
|
||||
|
||||
Standard OCCT tests are located in subdirectory **tests** of the OCCT root
|
||||
folder. This location is set as default at DRAW start (see environment variable
|
||||
_CSF_TestScriptsPath_ defined in **src/DrawResources/DrawDefaults**).
|
||||
|
||||
The tests are organized in three levels:
|
||||
- Group: a group of related test grids, usually testing a particular subset of OCCT functionality (e.g. *blend*).
|
||||
- Grid: a set of test cases within a group, usually aimed at testing a particular aspect or mode of execution of the relevant functionality (e.g. *buildevol*).
|
||||
- Test case: a script implementing an individual test (e.g. *K4*).
|
||||
|
||||
To run all tests, type command *testgrid*:
|
||||
|
||||
Draw[]\> testgrid
|
||||
|
||||
For running only a group or a grid of tests, give additional arguments indicating the group and (if needed) the grid name:
|
||||
|
||||
Draw[]\> testgrid blend simple
|
||||
|
||||
As the tests progress, the result of each test case is reported.
|
||||
At the end of the log a summary of test cases is output, including the list of
|
||||
detected regressions and improvements, if any.
|
||||
The tests are considered as non-regressive if only OK, BAD (i.e. known problem),
|
||||
and SKIPPED (i.e. not executed, typically because of lack of a data file)
|
||||
statuses are reported.
|
||||
|
||||
To run a single test, type command 'test' followed by the names of
|
||||
group, grid, and test case.
|
||||
|
||||
Draw[1]\> test blend simple A1
|
||||
CASE blend simple A1: OK
|
||||
|
||||
To see intermediate commands and their output during the test execution,
|
||||
add one more argument '-echo' at the end of the command line, or type 'dlog get'
|
||||
after test completion.
|
||||
|
||||
For more information consult \subpage dev_guides__tests "Automatic Testing System"
|
||||
|
||||
@section OCCT_OVW_SECTION1112 CDL Overview
|
||||
|
||||
CDL is the component definition language of the Open CASCADE Technology (OCCT) programming platform.
|
||||
Some components, which CDL allows you to create, are specific to OCCT application architecture.
|
||||
|
||||
For more information consult \subpage dev_guides__cdl "Component Definition Language Developer's Guide"
|
||||
|
||||
@section OCCT_OVW_SECTION1113 Documentation Overview
|
||||
|
||||
\subpage dev_guides__documentation "Documentation Developer's Guide"
|
531
dox/dev_guides/documentation/documentation.md
Normal file
@ -0,0 +1,531 @@
|
||||
Documentation {#dev_guides__documentation}
|
||||
=================
|
||||
|
||||
@section OCCT_DM_SECTION_1 Introduction
|
||||
|
||||
This document provides practical guidenes for generation and editing of OCCT user documentation.
|
||||
|
||||
@section OCCT_DM_SECTION_2 Prerequisites
|
||||
|
||||
<b>Tcl/Tk</b>
|
||||
The lates version: http://www.tcl.tk/software/tcltk/download.html
|
||||
|
||||
<b>Doxygen</b> ( >= 1.8.4 )
|
||||
The latest version: http://www.stack.nl/~dimitri/doxygen/download.html
|
||||
|
||||
<b>MathJax</b> (used for rendering math formulas in browser). Download it for local installation or use the MathJax Content Delivery Network. \(read
|
||||
@htmlonly <a href="#OCCT_DM_SECTION_A_9">Formulas</a> @endhtmlonly paragraph for more detailed description\).
|
||||
The latest version: http://www.mathjax.org/download/
|
||||
|
||||
<b>MiKTeX</b> or equivalent tool (used for PDF document creation)
|
||||
Latest version: http://miktex.org/download
|
||||
|
||||
@section OCCT_DM_SECTION_2_1 Documentation Generation
|
||||
|
||||
Run gendoc.bat from OCCT directory to generate all articles are defined in FILES.txt:
|
||||
|
||||
gendoc.bat options:
|
||||
|
||||
* -html : To generate HTML files (cannot be used with -pdf);
|
||||
* -pdf : To generate PDF files (cannot be used with -html);
|
||||
* -m=<modules_list> : Specifies list of articles to generate. If it is not specified, all files, mentioned in FILES.txt are processed;
|
||||
* -l=<document_name> : Specifies the article caption for a single document;
|
||||
* -h : Prints help message;
|
||||
* -v : Specifies the Verbose mode (info on all script actions is shown).
|
||||
|
||||
If you run the command without arguments (like example above) it will generate HTML documentation
|
||||
for all articles are defined into FILES.txt.
|
||||
|
||||
**Note**: the generation process generates PDF files for each article,
|
||||
but in html case it generates common Html page with references to the ones.
|
||||
|
||||
For generation of specific article you need:
|
||||
* have it's name with relative path (from \%OCCDIR\%/dox/ to the file) contained in FILES.txt
|
||||
(is located into \%OCCDIR\%/dox/ directory).
|
||||
|
||||
@verbatim
|
||||
devs_guid/documentation/documentation.md
|
||||
@endverbatim
|
||||
|
||||
where documentation .md is name of article and devs_guid/documentation/ is relative path of it
|
||||
|
||||
* use this name with -m option in the generation process:
|
||||
|
||||
@verbatim
|
||||
% gen.bat -html -m=devs_guid/documentation/documentation.md
|
||||
@endverbatim
|
||||
|
||||
Multiple files are separated with comma:
|
||||
|
||||
@verbatim
|
||||
% gen.bat -html -m=MD_FILE_1,MD_FILE_2
|
||||
@endverbatim
|
||||
|
||||
To sepcify a article name with -l option, use tcl list to prevent whitespaces incorrect interpretation:
|
||||
|
||||
@verbatim
|
||||
% gen.bat -pdf -m=MD_FILE_1 -l=[list MD File 1 Label]
|
||||
@endverbatim
|
||||
|
||||
@section OCCT_DM_SECTION_3 Documentation Conventions
|
||||
|
||||
This section contains information about conventions in the field of OCCT documentation file format,
|
||||
structure of documentation directories, etc.
|
||||
|
||||
@subsection OCCT_DM_SECTION_3_1 File Format
|
||||
|
||||
It is proposed to use MarkDown file format for easy maintainance of generic text documents.
|
||||
The MarkDown files have a "*.md" extension and are based on rules desribed in
|
||||
@htmlonly <a href="#OCCT_DM_SECTION_A">Document Syntax</a> @endhtmlonly section.
|
||||
|
||||
@subsection OCCT_DM_SECTION_3_2 Directory Structure
|
||||
|
||||

|
||||
|
||||
Every separate article has own folder if images are used in it. These images
|
||||
are stored into "images" subfolder.
|
||||
|
||||
If you want to use the same image for several articles, you can place the one into "dox/resources" folder.
|
||||
|
||||
**Note**: Every article can use any image that is used by others articles. To avoid incorrect image
|
||||
displaying, use relative path to the image (starting from dox folder). For instance
|
||||
@verbatim
|
||||

|
||||
@endverbatim
|
||||
|
||||
Result of generation of the documentation is:
|
||||
|
||||
%OCCT_DIR% / doc - a folder for generated articles;
|
||||
* html/ - a directory for generated HTML pages;
|
||||
* pdf/ - a directory for generated PDF files.
|
||||
|
||||
@section OCCT_DM_SECTION_4 Adding a New Article
|
||||
|
||||
- Place a new article into folder that is chosen taking into account the place of the article
|
||||
at the hierarchy of the documentation. For instance the article about "using SVN working with OCCT
|
||||
source code" (svn.md - the file of the article) might be placed into /dox/devs_guide/ . If the article has images then you may create
|
||||
the own folder of the article and subfolder in it for images. For instance
|
||||
*/dox/devs_guide/svn/ - for svn.md file
|
||||
*/dox/devs_guide/svn/images/ - for images
|
||||
|
||||
- Update dox/FILES.txt to add relative path to svn.md. For instance
|
||||
@verbatim
|
||||
devs_guide/snv/svn.md
|
||||
@endverbatim
|
||||
|
||||
**Note**: the place of the relative path to an article is connected with the place
|
||||
into treeview of html version.
|
||||
|
||||
|
||||
Note, that you should specify a file tag, not the document name.
|
||||
See <a href="#OCCT_DM_SECTION_A_1">Header section</a> for details.
|
||||
|
||||
@section OCCT_DOC_SECTION_5 Additional Resources
|
||||
|
||||
More information about OCCT can be found at http://www.opencascade.org
|
||||
|
||||
The information on formula syntax can be found at:
|
||||
http://en.wikipedia.org/wiki/Help:Displaying_a_formula
|
||||
|
||||
More information on MarkDown and Doxygen syntax can be found at:
|
||||
http://www.stack.nl/~dimitri/doxygen/manual
|
||||
|
||||
|
||||
@section OCCT_DM_SECTION_A Appendix 1: Document Syntax
|
||||
|
||||
Each OCCT document file in *.md format has a simple structure.
|
||||
It can contain:
|
||||
|
||||
| Content type | Obligation |
|
||||
| :---------------- | :-------------------: |
|
||||
| Header | M |
|
||||
| Footer | M |
|
||||
| Plain text | O |
|
||||
| List | O |
|
||||
| Table | O |
|
||||
| Code | O |
|
||||
| Formula | O |
|
||||
| Image | O |
|
||||
| Page numbers | M (auto generation) |
|
||||
| Table of contents | M (auto generation) |
|
||||
|
||||
The legend:
|
||||
|
||||
* M is for Mandatory
|
||||
* O is for Optional
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_1 Text Caption (a header)
|
||||
|
||||
headings of different levels can be specified with the following code:
|
||||
|
||||
@verbatim
|
||||
Header 1 {#header1}
|
||||
=======
|
||||
@endverbatim
|
||||
|
||||
to get
|
||||
|
||||
Header 1
|
||||
=========
|
||||
|
||||
and with the following code:
|
||||
|
||||
@verbatim
|
||||
Header 2 {#header2}
|
||||
--------
|
||||
@endverbatim
|
||||
|
||||
to get
|
||||
|
||||
Header 2
|
||||
---------
|
||||
|
||||
Where a word in curly braces is a MarkDown-style reference, which can be used in table of contents.
|
||||
If you would like to have the table of contents, it is recommended to use \@section,
|
||||
\@subsection and \@subsubsection pages instead of MarkDown headers as follows:
|
||||
|
||||
@verbatim
|
||||
@section Section_Name Section Header
|
||||
@subsection SubSection_Name SubSection Header
|
||||
@subsubsection SubSubSection_Name SubSubSection Header
|
||||
@endverbatim
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_2 Plain Text
|
||||
|
||||
Plain text is a text in a notepad-like format. To insert special symbols,
|
||||
like \< , \> or \\, prepend them with \\ character: \\\<, \\\>, \\\\
|
||||
To emphasize some words, write one pair of asterisks ( * ) or underscores ( _ ) across the word
|
||||
to make it *italic* and two pairs of these symbols to make a word **Bold**.
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_3 Lists
|
||||
|
||||
To create a bulleted list, start each line with a hyphen or an asterisk,
|
||||
followed by a space. List items can be nested. This code:
|
||||
|
||||
@verbatim
|
||||
* Bullet 1
|
||||
* Bullet 2
|
||||
* Bullet 2a
|
||||
* Bullet 2b
|
||||
* Bullet 3
|
||||
@endverbatim
|
||||
|
||||
produces this list:
|
||||
|
||||
* Bullet 1
|
||||
* Bullet 2
|
||||
* Bullet 2a
|
||||
* Bullet 2b
|
||||
* Bullet 3
|
||||
|
||||
To create a numbered list, start each line with number and a period, then a space. Thus this code
|
||||
|
||||
@verbatim
|
||||
1. ListItem_1
|
||||
2. ListItem_2
|
||||
3. ListItem_3
|
||||
@endverbatim
|
||||
|
||||
produces this list:
|
||||
|
||||
1. ListItem_1
|
||||
2. ListItem_2
|
||||
3. ListItem_3
|
||||
|
||||
It is recommended to indent lists with 2 spaces.
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_4 Tables
|
||||
|
||||
A table consists of a header line, a separator line, and at least one row line.
|
||||
Table columns are separated by the pipe (|) character. The following example:
|
||||
|
||||
@verbatim
|
||||
First Header | Second Header
|
||||
------------- | -------------
|
||||
Content Cell | Content Cell
|
||||
Content Cell | Content Cell
|
||||
@endverbatim
|
||||
|
||||
will produce the following table:
|
||||
|
||||
First Header | Second Header
|
||||
------------ | -------------
|
||||
Content Cell | Content Cell
|
||||
Content Cell | Content Cell
|
||||
|
||||
Column alignment can be controlled via one or two colons at the header separator line:
|
||||
|
||||
@verbatim
|
||||
| Right | Center | Left |
|
||||
| ----: | :----: | :---- |
|
||||
| 10 | 10 | 10 |
|
||||
| 1000 | 1000 | 1000 |
|
||||
@endverbatim
|
||||
|
||||
which will looks as follows:
|
||||
|
||||
| Right | Center | Left |
|
||||
| ----: | :----: | :---- |
|
||||
| 10 | 10 | 10 |
|
||||
| 1000 | 1000 | 1000 |
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_5 Code Blocks
|
||||
|
||||
It is recommended to indent a code lines with 4 spaces.
|
||||
A fenced code block does not require indentation, and is defined by a pair of "fence lines".
|
||||
Such line consists of 3 or more tilde (~) characters on a line.
|
||||
The end of the block should have the same number of tildes. Here is an example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
a one-line code block
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
By default the output is the same as for a normal code block.
|
||||
To highlight the code, the developer has to indicate the typical file extension,
|
||||
which corresponds to the programming language, after the opening fence.
|
||||
For highlighting according to the C++ language, for instance, write the following code (the curly braces and dot are optional):
|
||||
|
||||
@verbatim
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
int func(int a,int b) { return a*b; }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@endverbatim
|
||||
|
||||
which will produce:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
int func(int a,int b) { return a*b; }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Verbatim content can be written by using framing \@verbatim \@endverbatim . For instance
|
||||
|
||||
@verbatim
|
||||
verbatim text
|
||||
@endverbatim
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_6 References
|
||||
|
||||
To insert a reference to a website, it is proposed to write a URL. For example: http://en.wikipedia.org
|
||||
To insert a reference to another part of the same document, the developer can write:
|
||||
|
||||
@verbatim
|
||||
@htmlonly
|
||||
<a href="#OCCT_DOC_SECTION_5">Doxygen Configuration file</a>
|
||||
@endhtmlonly
|
||||
@endverbatim
|
||||
|
||||
to get a link to paragraph : @htmlonly <a href="#OCCT_DOC_SECTION_5">Doxygen configuration</a> @endhtmlonly
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_7 Images
|
||||
|
||||
To insert image into document the developer can write the following code(in Doxygen-style):
|
||||
@verbatim
|
||||

|
||||
@endverbatim
|
||||
|
||||
This code tells Doxygen to insert a picture right in the place this code was written. Like this:
|
||||
@verbatim
|
||||

|
||||
@endverbatim
|
||||
|
||||

|
||||
|
||||
@subsection OCCT_DM_SECTION_A_8 Table Of Contents
|
||||
|
||||
To get the table of contents at the beginning of the document, write \@tableofcontents tag.
|
||||
But it is not needed now because TreeView option for HTML is used.
|
||||
The TOC in the PDF document will be generated automatically.
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_9 Formulas
|
||||
|
||||
Formulas within documents will be generated using MathJax tool.
|
||||
|
||||
A developer has to specify these parameters in Doxyfile to enable support of MathJax in Doxygen:
|
||||
|
||||
USE_MATHJAX = YES
|
||||
MATHJAX_FORMAT = HTML-CSS
|
||||
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
|
||||
MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
|
||||
|
||||
To use MathJax tool with the HTML page, it's \<head\> block has to contain
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.html}
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
|
||||
displayAlign: "left"
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript"
|
||||
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
First script configures MathJax to understand separator types and to left allign formulas.
|
||||
The second script inserts reference to MathJax tool.
|
||||
This tool will always be used when the HTML output will be shown.
|
||||
|
||||
Equations can be written by several ways:
|
||||
|
||||
1.Unnumbered displayed formulas that are centered on a separate line.
|
||||
These formulas should be put between \@f\[ and \@f\] tags. An example:
|
||||
|
||||
@verbatim
|
||||
@f$[
|
||||
|I_2|=\left| \int_{0}^T \psi(t)
|
||||
\left\{
|
||||
u(a,t)-
|
||||
\int_{\gamma(t)}^a
|
||||
\frac{d\theta}{k(\theta,t)}
|
||||
\int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi
|
||||
\right\} dt
|
||||
\right|
|
||||
@f$]
|
||||
@endverbatim
|
||||
|
||||
gives the following result:
|
||||
|
||||
@f$
|
||||
|I_2|=\left| \int_{0}^T \psi(t)
|
||||
\left\{
|
||||
u(a,t)-
|
||||
\int_{\gamma(t)}^a
|
||||
\frac{d\theta}{k(\theta,t)}
|
||||
\int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi
|
||||
\right\} dt
|
||||
\right|
|
||||
@f$
|
||||
|
||||
2.Formulas can also be put between @verbatim \begin{align} @endverbatim and @verbatim \end{align} @endverbatim tags. An example:
|
||||
|
||||
@verbatim
|
||||
\begin{align}
|
||||
\dot{x} & = \sigma(y-x) \\
|
||||
\dot{y} & = \rho x - y - xz \\
|
||||
\dot{z} & = -\beta z + xy
|
||||
\end{align}
|
||||
@endverbatim
|
||||
|
||||
gives the following result:
|
||||
@latexonly
|
||||
\begin{align}
|
||||
\dot{x} & = \sigma(y-x) \\
|
||||
\dot{y} & = \rho x - y - xz \\
|
||||
\dot{z} & = -\beta z + xy
|
||||
\end{align}
|
||||
@endlatexonly
|
||||
|
||||
@htmlonly
|
||||
\begin{align}
|
||||
\dot{x} & = \sigma(y-x) \\
|
||||
\dot{y} & = \rho x - y - xz \\
|
||||
\dot{z} & = -\beta z + xy
|
||||
\end{align}
|
||||
@endhtmlonly
|
||||
|
||||
3.Inline formulas can be specified using this syntax:
|
||||
|
||||
@verbatim
|
||||
@f$ \sqrt{3x-1}+(1+x)^2 @f$
|
||||
@endverbatim
|
||||
|
||||
that leads to the following result: @f$ \sqrt{3x-1}+(1+x)^2 @f$
|
||||
|
||||
@section OCCT_DM_SECTION_B Appendix 2: Doxygen Configuration
|
||||
|
||||
@subsection OCCT_DM_SECTION_B_1 Doxygen Configuration File
|
||||
|
||||
To generate documentation from "source" *.md files a developer can use file OCCT.doxyfile,
|
||||
which is located in /docs directory of OCCT (more information can be found at @htmlonly
|
||||
<a href="#OCCT_DM_SECTION_X_X_X">Directory Structure</a> @endhtmlonly paragraph)
|
||||
or create his own configuration file, called "Doxyfile". The configuration file may look as follows:
|
||||
|
||||
@verbatim
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = "OCCT User's Guides"
|
||||
PROJECT_NUMBER = 1.0.1
|
||||
PROJECT_LOGO = "D:/OS/OCCT/docs/OCCT_logo.png"
|
||||
OUTPUT_LANGUAGE = English
|
||||
TAB_SIZE = 4
|
||||
MARKDOWN_SUPPORT = YES
|
||||
AUTOLINK_SUPPORT = NO
|
||||
SHOW_FILES = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
INPUT = "D:/OS/OCCT/docs/"
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.md
|
||||
RECURSIVE = YES
|
||||
IMAGE_PATH = tmp
|
||||
GENERATE_HTML = YES
|
||||
SEARCHENGINE = NO
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER = "static/header.html"
|
||||
HTML_FOOTER = "static/footer.html"
|
||||
HTML_STYLESHEET = "static/general.css"
|
||||
HTML_EXTRA_STYLESHEET = "static/styles.css"
|
||||
HTML_COLORSTYLE_HUE = 220
|
||||
HTML_COLORSTYLE_SAT = 100
|
||||
HTML_COLORSTYLE_GAMMA = 80
|
||||
HTML_TIMESTAMP = YES
|
||||
HTML_DYNAMIC_SECTIONS = NO
|
||||
HTML_INDEX_NUM_ENTRIES = 100
|
||||
GENERATE_LATEX = YES
|
||||
GENERATE_RTF = YES
|
||||
@endverbatim
|
||||
|
||||
@subsection OCCT_DM_SECTION_B_2 Doxygen Output Customization
|
||||
|
||||
The customization of the output files, produced by Doxygen, can be made by using different Doxyfile parameters,
|
||||
like HTML_COLORSTYLE_SAT, which specifies one of HSV color component of HTML page header, and also by using DoxygenLayout xml file.
|
||||
A developer can use default file from /docs directory or generate his own with doxygen -l command. It may looks as follows:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.xml}
|
||||
<doxygenlayout version="1.0">
|
||||
<!-- Generated by doxygen 1.8.3.1 -->
|
||||
<!-- Navigation index tabs for HTML output -->
|
||||
<navindex>
|
||||
<tab type="mainpage" visible="yes" title="Introduction"/>
|
||||
<tab type="pages" visible="yes" title="Documents" intro=
|
||||
"This section contains links to all OCCT documents that are available at the moment"/>
|
||||
<tab type="modules" visible="no" title="" intro=""/>
|
||||
<tab type="namespaces" visible="no" title="">
|
||||
<tab type="namespacelist" visible="no" title="" intro=""/>
|
||||
<tab type="namespacemembers" visible="no" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="classes" visible="no" title="">
|
||||
<tab type="classlist" visible="no" title="" intro=""/>
|
||||
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||
<tab type="hierarchy" visible="no" title="" intro=""/>
|
||||
<tab type="classmembers" visible="no" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="files" visible="yes" title="Files">
|
||||
<tab type="filelist" visible="yes" title="" intro=""/>
|
||||
<tab type="globals" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="examples" visible="no" title="" intro=""/>
|
||||
</navindex>
|
||||
...
|
||||
</doxygenlayout>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The tag \<tab\> specifies tabs which appear at the head of each html page. For the OCCT user documentation
|
||||
"mainpage" and "pages" tabs are usually needed and their visible parameter should always be "yes".
|
||||
The visibility of other tabs should be set to "no".
|
||||
|
||||
Developers can find more information about Doxygen configuration in the help file
|
||||
or at http://www.stack.nl/~dimitri/doxygen/manual/
|
||||
|
||||
@subsection OCCT_DM_SECTION_B_3 Doxywizard Usage
|
||||
|
||||
The easiest way of applying and modification of Doxyfile is to use a Doxywizard application,
|
||||
which is usually a part of the Doxygen tool. To apply a configuration file, the developer should
|
||||
select "Open..." item of the File menu or press Ctrl + O. Modification of Doxyfile can be made
|
||||
using "Wizard" or "Expert" tabs of Doxywizard application.
|
||||
|
||||
Developers can find more information about Doxywizard usage in the help file or at
|
||||
http://www.stack.nl/~dimitri/doxygen/manual/doxywizard_usage.html.
|
BIN
dox/dev_guides/documentation/images/documentation_image001.png
Normal file
After ![]() (image error) Size: 8.4 KiB |
BIN
dox/dev_guides/tests/images/tests_image001.png
Normal file
After ![]() (image error) Size: 14 KiB |
593
dox/dev_guides/tests/tests.md
Normal file
@ -0,0 +1,593 @@
|
||||
Automated Testing System {#dev_guides__tests}
|
||||
======================================
|
||||
|
||||
@section testmanual_1 Introduction
|
||||
|
||||
This document provides overview and practical guidelines for work with OCCT automatic testing system.
|
||||
Reading this section *Introduction* should be sufficient for OCCT developers to use the test system
|
||||
to control non-regression of the modifications they implement in OCCT. Other sections provide
|
||||
more in-depth description of the test system, required for modifying the tests and adding new test cases.
|
||||
|
||||
@subsection testmanual_1_1 Basic Information
|
||||
|
||||
OCCT automatic testing system is organized around DRAW Test Harness [1],
|
||||
a console application based on Tcl (a scripting language) interpreter extended by OCCT-related commands.
|
||||
Standard OCCT tests are included with OCCT sources and are located in subdirectory *tests*
|
||||
of the OCCT root folder. Other test folders can be included in the scope of the test system,
|
||||
e.g. for testing applications based on OCCT.
|
||||
Logically the tests are organized in three levels:
|
||||
|
||||
* Group: group of related test grids, usually relating to some part of OCCT functionality (e.g. blend)
|
||||
* Grid: set of test cases within a group, usually aimed at testing some particular aspect or mode of execution of the relevant functionality (e.g. buildevol)
|
||||
* Test case: script implementing individual test (e.g. K4)
|
||||
|
||||
Some tests involve data files (typically CAD models) which are located separately
|
||||
and are not included with OCCT code. The archive with publicly available
|
||||
test data files should be downloaded and installed independently on OCCT code from dev.opencascade.org.
|
||||
|
||||
@subsection testmanual_1_2 Intended Use of Automatic Tests
|
||||
|
||||
Each modification made in OCCT code must be checked for non-regression
|
||||
by running the whole set of tests. The developer who does the modification
|
||||
is responsible for running and ensuring non-regression on the tests that are available to him.
|
||||
Note that many tests are based on data files that are confidential and thus available only at OPEN CASCADE.
|
||||
Thus official certification testing of the changes before integration to master branch
|
||||
of official OCCT Git repository (and finally to the official release) is performed by OPEN CASCADE in any case.
|
||||
|
||||
Each new non-trivial modification (improvement, bug fix, new feature) in OCCT
|
||||
should be accompanied by a relevant test case suitable for verifying that modification.
|
||||
This test case is to be added by developer who provides the modification.
|
||||
If a modification affects result of some test case(s),
|
||||
either the modification should be corrected (if it causes regression)
|
||||
or affected test cases should be updated to account for the modification.
|
||||
|
||||
The modifications made in the OCCT code and related test scripts
|
||||
should be included in the same integration to master branch.
|
||||
|
||||
@subsection testmanual_1_3 Quick Start
|
||||
|
||||
@subsubsection testmanual_1_3_1 Setup
|
||||
|
||||
Before running tests, make sure to define environment variable CSF_TestDataPath
|
||||
pointing to the directory containing test data files.
|
||||
(The publicly available data files can be downloaded
|
||||
from http://dev.opencascade.org separately from OCCT code.)
|
||||
The recommended way for that is adding a file *DrawInitAppli*
|
||||
in the directory which is current at the moment of starting DRAWEXE (normally it is $CASROOT).
|
||||
This file is evaluated automatically at the DRAW start. Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
set env(CSF_TestDataPath) d:/occt/tests_data
|
||||
return ;# this is to avoid an echo of the last command above in cout
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
All tests are run from DRAW command prompt, thus first run draw.tcl or draw.sh to start DRAW.
|
||||
|
||||
@subsubsection testmanual_1_3_2 Running Tests
|
||||
|
||||
To run all tests, type command *testgrid* followed by path
|
||||
to the new directory where results will be saved.
|
||||
It is recommended that this directory should be new or empty;
|
||||
use option –overwrite to allow writing logs in existing non-empty directory.
|
||||
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
Draw[]> testgrid d:/occt/results-2012-02-27
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If empty string is given as log directory name, the name will be generated automatically
|
||||
using current date and time, prefixed by *results_*. Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
Draw[]> testgrid {}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For running only some group or a grid of tests,
|
||||
give additional arguments indicating group and (if needed) grid. Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
Draw[]> testgrid d:/occt/results-2012-02-28 blend simple
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
As the tests progress, the result of each test case is reported.
|
||||
At the end of the log summary of test cases is output,
|
||||
including list of detected regressions and improvements, if any. Example:
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
Tests summary
|
||||
|
||||
CASE 3rdparty export A1: OK
|
||||
...
|
||||
CASE pipe standard B1: BAD (known problem)
|
||||
CASE pipe standard C1: OK
|
||||
No regressions
|
||||
Total cases: 208 BAD, 31 SKIPPED, 3 IMPROVEMENT, 1791 OK
|
||||
Elapsed time: 1 Hours 14 Minutes 33.7384512019 Seconds
|
||||
Detailed logs are saved in D:/occt/results_2012-06-04T0919
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The tests are considered as non-regressive if only OK, BAD (i.e. known problem),
|
||||
and SKIPPED (i.e. not executed, e.g. because of lack of data file) statuses are reported.
|
||||
See <a href="#testmanual_3_4">Grid’s *cases.list* file</a> chapter for details.
|
||||
|
||||
The detailed logs of running tests are saved in the specified directory and its sub-directories.
|
||||
Cumulative HTML report summary.html provides links to reports on each test case.
|
||||
An additional report TESTS-summary.xml is output in JUnit-style XML format
|
||||
that can be used for integration with Jenkins or other continuous integration system.
|
||||
Type *help testgrid* in DRAW prompt to get help on additional options supported by testgrid command.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
Draw[3]> help testgrid
|
||||
testgrid: Run all tests, or specified group, or one grid
|
||||
Use: testgrid logdir [group [grid]] [options...]
|
||||
Allowed options are:
|
||||
-verbose {0-2}: verbose level, 0 by default, can be set to 1 or 2
|
||||
-parallel N: run in parallel with up to N processes (default 0)
|
||||
-refresh N: save summary logs every N seconds (default 60)
|
||||
-overwrite: force writing logs in existing non-empty directory
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsubsection testmanual_1_3_3 Running Single Test
|
||||
|
||||
To run single test, type command *test*’ followed by names of group, grid, and test case.
|
||||
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
Draw[1]> test blend simple A1
|
||||
CASE blend simple A1: OK
|
||||
Draw[2]>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Note that normally intermediate output of the script is not shown.
|
||||
To see intermediate commands and their output, type command *decho on*
|
||||
before running the test case. (Type ‘decho off’ to disable echoing when not needed.)
|
||||
The detailed log of the test can also be obtained after the test execution by command *dlog get*.
|
||||
|
||||
@section testmanual_2 Organization of Test Scripts
|
||||
|
||||
@subsection testmanual_2_1 General Layout
|
||||
|
||||
Standard OCCT tests are located in subdirectory tests of the OCCT root folder ($CASROOT).
|
||||
Additional test folders can be added to the test system
|
||||
by defining environment variable CSF_TestScriptsPath.
|
||||
This should be list of paths separated by semicolons (*;*) on Windows
|
||||
or colons (*:*) on Linux or Mac. Upon DRAW launch,
|
||||
path to tests sub-folder of OCCT is added at the end of this variable automatically.
|
||||
Each test folder is expected to contain:
|
||||
|
||||
* Optional file parse.rules defining patterns for interpretation of test results, common for all groups in this folder
|
||||
* One or several test group directories.
|
||||
|
||||
Each group directory contains:
|
||||
|
||||
* File grids.list that identifies this test group and defines list of test grids in it.
|
||||
* Test grids (sub-directories), each containing set of scripts for test cases, and optional files cases.list, parse.rules, begin, and end.
|
||||
* Optional sub-directory data
|
||||
* Optional file parse.rules
|
||||
* Optional files begin and end
|
||||
|
||||
By convention, names of test groups, grids, and cases should contain no spaces and be lowercase.
|
||||
Names begin, end, data, parse.rules, grids.list, cases.list are reserved.
|
||||
General layout of test scripts is shown on Figure 1.
|
||||
|
||||

|
||||
|
||||
Figure 1. Layout of tests folder
|
||||
|
||||
@subsection testmanual_2_2 Test Groups
|
||||
|
||||
@subsubsection testmanual_2_2_1 Group Names
|
||||
|
||||
Test folder usually contains several directories representing test groups (Group 1, Group N).
|
||||
Each directory contains test grids for certain OCCT functionality.
|
||||
The name of directory corresponds to this functionality.
|
||||
Example:
|
||||
|
||||
@verbatim
|
||||
caf
|
||||
mesh
|
||||
offset
|
||||
@endverbatim
|
||||
|
||||
@subsubsection testmanual_2_2_2 Group's *grids.list* File
|
||||
|
||||
The test group must contain file *grids.list* file
|
||||
which defines ordered list of grids in this group in the following format:
|
||||
|
||||
~~~~~~~~~~~~~~~~~
|
||||
001 gridname1
|
||||
002 gridname2
|
||||
...
|
||||
NNN gridnameN
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~
|
||||
001 basic
|
||||
002 advanced
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsubsection testmanual_2_2_3 Group's *begin* File
|
||||
|
||||
The file *begin* is a Tcl script. It is executed before every test in current group.
|
||||
Usually it loads necessary Draw commands, sets common parameters and defines
|
||||
additional Tcl functions used in test scripts.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
pload TOPTEST ;# load topological command
|
||||
set cpulimit 300 ;# set maximum time allowed for script execution
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsubsection testmanual_2_2_4 Group's *end* File
|
||||
|
||||
The file end is a TCL script. It is executed after every test in current group.
|
||||
Usually it checks the results of script work, makes a snap-shot
|
||||
of the viewer and writes *TEST COMPLETED* to the output.
|
||||
Note: *TEST COMPLETED* string should be presented in output
|
||||
in order to signal that test is finished without crash.
|
||||
See <a href="#testmanual_3">Creation And Modification Of Tests</a> chapter for more information.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
if { [isdraw result] } {
|
||||
checkshape result
|
||||
} else {
|
||||
puts *Error: The result shape can not be built*
|
||||
}
|
||||
puts *TEST COMPLETED*
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsubsection testmanual_2_2_5 Group’s *parse.rules* File
|
||||
|
||||
The test group may contain *parse.rules* file.
|
||||
This file defines patterns used for analysis of the test execution log
|
||||
and deciding the status of the test run.
|
||||
Each line in the file should specify a status (single word),
|
||||
followed by a regular expression delimited by slashes (*/*)
|
||||
that will be matched against lines in the test output log to check if it corresponds to this status.
|
||||
The regular expressions support subset of the Perl re syntax.
|
||||
The rest of the line can contain a comment message
|
||||
which will be added to the test report when this status is detected.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
FAILED /\b[Ee]xception\b/ exception
|
||||
FAILED /\bError\b/ error
|
||||
SKIPPED /Cannot open file for reading/ data file is missing
|
||||
SKIPPED /Could not read file .*, abandon/ data file is missing
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Lines starting with a *#* character and blank lines are ignored to allow comments and spacing.
|
||||
See <a href="#testmanual_2_3_4">Interpretation of test results</a> chapter for details.
|
||||
|
||||
If a line matches several rules, the first one applies.
|
||||
Rules defined in the grid are checked first, then rules in group,
|
||||
then rules in the test root directory. This allows defining some rules on the grid level
|
||||
with status IGNORE to ignore messages that would otherwise be treated as errors due to the group level rules.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
FAILED /\bFaulty\b/ bad shape
|
||||
IGNORE /^Error [23]d = [\d.-]+/ debug output of blend command
|
||||
IGNORE /^Tcl Exception: tolerance ang : [\d.-]+/ blend failure
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsection testmanual_2_3 Test Grids
|
||||
|
||||
@subsubsection testmanual_2_3_1 Grid Names
|
||||
|
||||
Group folder can have several sub-directories (Grid 1… Grid N) defining test grids.
|
||||
Each test grid directory contains a set of related test cases.
|
||||
The name of directory should correspond to its contents.
|
||||
|
||||
Example:
|
||||
|
||||
caf
|
||||
basic
|
||||
bugs
|
||||
presentation
|
||||
|
||||
Where **caf** is the name of test group and *basic*, *bugs*, *presentation*, etc are the names of grids.
|
||||
|
||||
@subsubsection testmanual_2_3_2 Grid’s *begin* File
|
||||
|
||||
The file *begin* is a TCL script. It is executed before every test in current grid.
|
||||
Usually it sets variables specific for the current grid.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
set command bopfuse ;# command tested in this grid
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsubsection testmanual_2_3_3 Grid’s *end* File
|
||||
|
||||
The file *end* is a TCL script. It is executed after every test in current grid.
|
||||
Usually it executes specific sequence of commands common for all tests in the grid.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
vdump $logdir/${casename}.gif ;# makes a snap-shot of AIS viewer
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsubsection testmanual_2_3_4 Grid’s *cases.list* File
|
||||
|
||||
The grid directory can contain an optional file cases.list
|
||||
defining alternative location of the test cases.
|
||||
This file should contain singe line defining the relative path to collection of test cases.
|
||||
|
||||
Example:
|
||||
|
||||
../data/simple
|
||||
|
||||
This option is used for creation of several grids of tests with the same data files
|
||||
and operations but performed with differing parameters.
|
||||
The common scripts are usually located place in common
|
||||
subdirectory of the test group (data/simple as in example).
|
||||
If cases.list file exists then grid directory should not contain any test cases.
|
||||
The specific parameters and pre- and post-processing commands
|
||||
for the tests execution in this grid should be defined in the begin and end files.
|
||||
|
||||
@subsection testmanual_2_4 Test Cases
|
||||
|
||||
The test case is TCL script which performs some operations using DRAW commands
|
||||
and produces meaningful messages that can be used to check the result for being valid.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
pcylinder c1 10 20 ;# create first cylinder
|
||||
pcylinder c2 5 20 ;# create second cylinder
|
||||
ttranslate c2 5 0 10 ;# translate second cylinder to x,y,z
|
||||
bsection result c1 c2 ;# create a section of two cylinders
|
||||
checksection result ;# will output error message if result is bad
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The test case can have any name (except reserved names begin, end, data, cases.list, parse.rules).
|
||||
For systematic grids it is usually a capital English letter followed by a number.
|
||||
|
||||
Example:
|
||||
|
||||
@verbatim
|
||||
A1
|
||||
A2
|
||||
B1
|
||||
B2
|
||||
@endverbatim
|
||||
|
||||
Such naming facilitates compact representation of results
|
||||
of tests execution in tabular format within HTML reports.
|
||||
|
||||
@subsection testmanual_2_5 Directory *data*
|
||||
|
||||
The test group may contain subdirectory data.
|
||||
Usually it contains data files used in tests (BREP, IGES, STEP, etc.)
|
||||
and / or test scripts shared by different test grids
|
||||
(in subdirectories, see <a href="#testmanual_2_3_4">Grid’s *cases.list* file</a> chapter).
|
||||
|
||||
@section testmanual_3 Creation And Modification Of Tests
|
||||
|
||||
This section describes how to add new tests and update existing ones.
|
||||
|
||||
@subsection testmanual_3_1 Choosing Group, Grid, and Test Case Name
|
||||
|
||||
The new tests are usually added in context of processing some bugs.
|
||||
Such tests in general should be added to group bugs, in the grid
|
||||
corresponding to the affected OCCT functionality.
|
||||
New grids can be added as necessary to contain tests on functionality not yet covered by existing test grids.
|
||||
The test case name in the bugs group should be prefixed by ID
|
||||
of the corresponding issue in Mantis (without leading zeroes).
|
||||
It is recommended to add a suffix providing a hint on the situation being tested.
|
||||
If more than one test is added for a bug, they should be distinguished by suffixes;
|
||||
either meaningful or just ordinal numbers.
|
||||
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
12345_coaxial
|
||||
12345_orthogonal_1
|
||||
12345_orthogonal_2
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In the case if new test corresponds to functionality for which
|
||||
specific group of tests exists (e.g. group mesh for BRepMesh issues),
|
||||
this test can be added (or moved later by OCC team) to this group.
|
||||
|
||||
@subsection testmanual_3_2 Adding Data Files Required for a Test
|
||||
|
||||
It is advisable that tests scripts should be made self-contained whenever possible,
|
||||
so as to be usable in environments where data files are not available.
|
||||
For that simple geometric objects and shapes can be created using DRAW commands in the test script itself.
|
||||
If test requires some data file, it should be put to subdirectory data of the test grid.
|
||||
Note that when test is integrated to master branch,
|
||||
OCC team can move data file to data files repository,
|
||||
so as to keep OCCT sources repository clean from big data files.
|
||||
When preparing a test script, try to minimize size of involved data model.
|
||||
For instance, if problem detected on a big shape can be reproduced on a single face
|
||||
extracted from that shape, use only this face in the test.
|
||||
|
||||
@subsection testmanual_3_3 Implementation of the Script
|
||||
|
||||
Test should run commands necessary to perform the operations being tested,
|
||||
in a clean DRAW session. This includes loading necessary functionality by *pload* command,
|
||||
if this is not done by *begin* script. The messages produced by commands in standard output
|
||||
should include identifiable messages on the discovered problems if any.
|
||||
Usually the script represents a set of commands that a person would run interactively
|
||||
to perform the operation and see its results, with additional comments to explain what happens.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
# Simple test of fusing box and sphere
|
||||
box b 10 10 10
|
||||
sphere s 5
|
||||
bfuse result b s
|
||||
checkshape result
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Make sure that file parse.rules in the grid or group directory contains
|
||||
regular expression to catch possible messages indicating failure of the test.
|
||||
For instance, for catching errors reported by *checkshape* command
|
||||
relevant grids define a rule to recognize its report by the word *Faulty*: FAILED /\bFaulty\b/ bad shape
|
||||
For the messages generated in the script the most natural way is to use the word *Error* in the message.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
set expected_length 11
|
||||
if { [expr $actual_length - $expected_length] > 0.001 } {
|
||||
puts *Error: The length of the edge should be $expected_length*
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
At the end, the test script should output *TEST COMPLETED* string
|
||||
to mark successful completion of the script.
|
||||
This is often done by the end script in the grid.
|
||||
When test script requires data file, use Tcl procedure *locate_data_file*
|
||||
to get path to the data file, rather than explicit path.
|
||||
This will allow easy move of the data file from OCCT repository
|
||||
to the data files repository without a need to update test script.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
stepread [locate_data_file CAROSKI_COUPELLE.step] a *
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
When test needs to produce some snapshots or other artifacts,
|
||||
use Tcl variable logdir as location where such files should be put.
|
||||
Command *testgrid* sets this variable to the subdirectory of the results folder
|
||||
corresponding to the grid. Command *test* sets it to $CASROOT/tmp unless it is already defined.
|
||||
Use Tcl variable casename to prefix all the files produced by the test.
|
||||
This variable is set to the name of the test case.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
xwd $logdir/${casename}.gif
|
||||
vdisplay result; vfit
|
||||
vdump $logdir/${casename}-axo.gif
|
||||
vfront; vfit
|
||||
vdump $logdir/${casename}-front.gif
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
could produce:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
A1.gif
|
||||
A1-axo.gif
|
||||
A1-front.gif
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsection testmanual_3_4 Interpretation of Test Results
|
||||
|
||||
The result of the test is evaluated by checking its output against patterns
|
||||
defined in the files parse.rules of the grid and group.
|
||||
The OCCT test system recognizes five statuses of the test execution:
|
||||
|
||||
* SKIPPED: reported if line matching SKIPPED pattern is found (prior to any FAILED pattern). This indicates that the test cannot be run in the current environment; most typical case is absence of the required data file.
|
||||
* FAILED: reported if some line matching pattern with status FAILED is found (unless it is masked by preceding IGNORE pattern or a TODO statement, see below), or if message TEST COMPLETED is not found at the end. This indicates that test produces bad or unexpected result, and usually highlights a regression.
|
||||
* BAD: reported if test script output contains one or several TODO statements and corresponding number of matching lines in the log. This indicates a known problem (see 3.5). The lines matching TODO statements are not checked against other patterns and thus will not cause a FAILED status.
|
||||
* IMPROVEMENT: reported if test script output contains TODO statement for which no corresponding line is found. This is possible indication of improvement (known problem disappeared).
|
||||
* OK: If none of the above statuses have been assigned. This means test passed without problems.
|
||||
|
||||
Other statuses can be specified in the parse.rules files, these will be classified as FAILED.
|
||||
Before integration of the change to OCCT repository, all tests should return either OK or BAD status.
|
||||
The new test created for unsolved problem should return BAD.
|
||||
The new test created for a fixed problem should return FAILED without the fix, and OK with the fix.
|
||||
|
||||
@subsection testmanual_3_5 Marking BAD Cases
|
||||
|
||||
If the test produces invalid result at a certain moment then the corresponding bug
|
||||
should be created in the OCCT issue tracker [3], and the problem should be marked as TODO in the test script.
|
||||
The following statement should be added to such test script:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
puts *TODO BugNumber ListOfPlatforms: RegularExpression*
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
where:
|
||||
|
||||
* BugNumber is an ID of the bug in the tracker. For example: #12345
|
||||
* ListOfPlatform is a list of platforms at which the bug is reproduced (e.g. Mandriva2008, Windows or All).
|
||||
|
||||
*Note: the platform name is custom for the OCCT test system;*
|
||||
*it can be consulted as value of environment variable os_type defined in DRAW.*
|
||||
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
Draw[2]> puts $env(os_type)
|
||||
windows
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
|
||||
* RegularExpression is a regular expression which should be matched against the line indicating the problem in the script output.
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
puts *TODO #22622 Mandriva2008: Abort .* an exception was raised*
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Parser checks the output of the test and if an output line matches
|
||||
the RegularExpression then it will be assigned a BAD status instead of FAILED.
|
||||
For each output line matching to an error expression a separate TODO line
|
||||
must be added to mark the test as BAD.
|
||||
If not all the TODO statements are found in the test log,
|
||||
the test will be considered as possible improvement.
|
||||
To mark the test as BAD for an incomplete case
|
||||
(when final TEST COMPLETE message is missing)
|
||||
the expression *TEST INCOMPLETE* should be used instead of regular expression.
|
||||
|
||||
Example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
puts *TODO OCC22817 All: exception.+There are no suitable edges*
|
||||
puts *TODO OCC22817 All: \\*\\* Exception \\*\\**
|
||||
puts *TODO OCC22817 All: TEST INCOMPLETE*
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@section testmanual_4 Extended Use
|
||||
|
||||
@subsection testmanual_4_1 Running Tests on Older Versions of OCCT
|
||||
|
||||
Sometimes it might be necessary to run tests on previous versions of OCCT (up to to 6.5.3)
|
||||
that do not include this test system. This can be done by adding DRAW configuration file DrawAppliInit
|
||||
in the directory which is current by the moment of DRAW startup,
|
||||
to load test commands and define necessary environment. Example
|
||||
(assume that d:/occt contains up-to-date version of OCCT sources
|
||||
with tests, and test data archive is unpacked to d:/test-data):
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
set env(CASROOT) d:/occt
|
||||
set env(CSF_TestScriptsPath) $env(CASROOT)/tests
|
||||
source $env(CASROOT)/src/DrawResources/TestCommands.tcl
|
||||
set env(CSF_TestDataPath) d:/test-data
|
||||
return
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Note that on older versions of OCCT the tests are run in compatibility mode
|
||||
and not all output of the test command can be captured;
|
||||
this can lead to absence of some error messages (can be reported as improvement).
|
||||
|
||||
@subsection testmanual_4_2 Adding Custom Tests
|
||||
|
||||
You can extend the test system by adding your own tests.
|
||||
For that it is necessary to add paths to the directory where these tests are located,
|
||||
and additional data directory(ies), to the environment variables CSF_TestScriptsPath and CSF_TestDataPath.
|
||||
The recommended way for doing this is using DRAW configuration file DrawAppliInit
|
||||
located in the directory which is current by the moment of DRAW startup.
|
||||
|
||||
Use Tcl command *_path_separator* to insert platform-dependent separator to the path list.
|
||||
Example:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
set env(CSF_TestScriptsPath) \
|
||||
$env(TestScriptsPath)[_path_separator]d:/MyOCCTProject/tests
|
||||
set env(CSF_TestDataPath) \
|
||||
d:/occt/test-data[_path_separator]d:/MyOCCTProject/tests
|
||||
return ;# this is to avoid an echo of the last command above in cout
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@section testmanual_5 References
|
||||
|
||||
-# DRAW Test Harness User’s Guide
|
||||
-# Perl regular expressions, http://perldoc.perl.org/perlre.html
|
||||
-# OCCT MantisBT issue tracker, http://tracker.dev.opencascade.org
|
BIN
dox/dev_guides/wok/images/wok_image001.jpg
Normal file
After ![]() (image error) Size: 43 KiB |
BIN
dox/dev_guides/wok/images/wok_image002.jpg
Normal file
After ![]() (image error) Size: 72 KiB |
BIN
dox/dev_guides/wok/images/wok_image003.jpg
Normal file
After ![]() (image error) Size: 43 KiB |
BIN
dox/dev_guides/wok/images/wok_image004.jpg
Normal file
After ![]() (image error) Size: 50 KiB |
153
dox/dev_guides/wok/wok.md
Normal file
@ -0,0 +1,153 @@
|
||||
WOK {#dev_guides__wok}
|
||||
=========
|
||||
|
||||
WOK is a legacy build environment for Open CASCADE Technology. It is required
|
||||
for generation of header files for classes defined with @ref ug_cdl "CDL"
|
||||
("Cascade Definition Language"). Also tools for generation of project files
|
||||
for other build systems, and OCCT documentation, are integrated to WOK.
|
||||
|
||||
WOK thus is needed in the following situations:
|
||||
- Building from OCCT sources from Git repository (do not contain generated files)
|
||||
- Building after some changes made in CDL files
|
||||
|
||||
Before installing and using WOK, make sure that you have installed a compiler (it is assumed that it is Visual Studio on Windows or gcc on Linux and MacOS) and third-party components required for building OCCT.
|
||||
|
||||
@section wok1 Installing WOK
|
||||
|
||||
Download the latest version of binary distribution WOK from http://dev.opencascade.org/index.php?q=home/resources
|
||||
|
||||
@subsection wok11 Windows
|
||||
|
||||
Run the installer. You will be prompted to read and accept the OCCT Public License to proceed:
|
||||
|
||||

|
||||
|
||||
Click Next and proceed with the installation.
|
||||
At the end of the installation you will be prompted to specify the version and the location of Visual Studio to be used, and the location of third-party libraries:
|
||||
|
||||

|
||||
|
||||
You can change these settings at any time later. For this click on the item "Customize environment (GUI tool)" in the WOK group in the Windows Start menu.
|
||||
|
||||
The shortcuts from this group provide two ways to run WOK:
|
||||
* In command prompt window ("WOK TCL shell").
|
||||
* In Emacs editor ("WOK Emacs"). Using Emacs is convenient if you need to work within WOK environment.
|
||||
|
||||
By default WOK installer creates a WOK factory with name "LOC" within workshop "dev" (WOK path :LOC:dev).
|
||||
|
||||
@subsection wok12 Linux
|
||||
|
||||
* Unpack the .tgz archive containing WOK distributive into an installation directory <WOK_INSTALL_DIR>.
|
||||
|
||||
* Perform the following commands assuming that you have unpacked WOK distributive archive into <WOK_INSTALL_DIR>:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
cd <WOK_INSTALL_DIR>/site
|
||||
wok_confgui.sh
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Define all necessary paths to third-party products in the dialog window:
|
||||
|
||||

|
||||
|
||||
* Run the following commands to create WOK LOC factory:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
cd <WOK_INSTALL_DIR>/site
|
||||
wok_init.sh
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Your installation procedure is over. To run WOK use one the following commands:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
cd <WOK_INSTALL_DIR>/site
|
||||
wok_emacs.sh
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
or
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
cd <WOK_INSTALL_DIR>/site
|
||||
wok_tclsh.sh
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsection wok13 Mac OS X
|
||||
|
||||
* In the Finder double click on wokSetup.dmg file. This will open a new window. Drag and drop "wokSetup" folder from this window at the location in the Finder where you want to install WOK, i.e. <WOK_INSTALL_DIR>.
|
||||
|
||||
* Browse in the Finder to the folder <WOK_INSTALL_DIR>/site and double click on WokConfig. This will open a window with additional search path settings. Define all necessary paths to third-party products in the dialog window:
|
||||
|
||||

|
||||
|
||||
* Run the following commands to create WOK LOC factory:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
cd <WOK_INSTALL_DIR>/site
|
||||
wok_init.sh
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Your installation procedure is over. To run WOK in Emacs navigate in the Finder to the folder <WOK_INSTALL_DIR>/site and double click on WokEmacs.
|
||||
|
||||
|
||||
@section wok2 Initialization of Workbench
|
||||
|
||||
To start working with OCCT, clone the OCCT Git repository from the server (see http://dev.opencascade.org/index.php?q=home/resources for details) or unpack the source archive.
|
||||
|
||||
Then create a WOK workbench (command wcreate) setting its Home to the directory, where the repository is created ($CASROOT variable). The workbench should have the same name as that directory.
|
||||
|
||||
For example, assuming that OCCT repository has been cloned into D:/occt folder:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
LOC:dev> wcreate occt -DHome=D:/occt
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Note: $CASROOT is equal to D:/occt now
|
||||
|
||||
Then you can work with this workbench using normal WOK functionality (wprocess, umake, etc.; see WOK User’s Guide for details) or use it only for generation of derived sources and project files, and build OCCT with Visual Studio on Windows or make command on Linux, as described below.
|
||||
|
||||
@section wok3 Generation of building projects
|
||||
|
||||
Use command wgenproj in WOK to generate derived headers, source and building projects files:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
LOC:dev> wokcd occt
|
||||
LOC:dev:occt> wgenproj [ -target=<TARGET> ] [ -no_wprocess ]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
TARGET:
|
||||
* vc8 - Visual Studio 2005
|
||||
* vc9 - Visual Studio 2008
|
||||
* vc10 - Visual Studio 2010
|
||||
* vc11 - Visual Studio 2012
|
||||
* cbp - CodeBlocks
|
||||
* cmake - CMake
|
||||
* amk - AutoMake
|
||||
* xcd - Xcode
|
||||
-no_wprocess - skip generation of derived headers and source files
|
||||
|
||||
Note that this command takes several minutes to complete at the first call.
|
||||
|
||||
Re-execute this step to generate derived headers, source and building projects files if some CDL files in OCCT have been modified (either by you directly, or due to updates in the repository). Note that in some cases WOK may fail to update correctly; in such case remove sub-directories drv and .adm and repeat the command.
|
||||
|
||||
To regenerate derived headers and source files without regeneration of projects use command:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
LOC:dev> wokcd occt
|
||||
LOC:dev:occt> wprocess -DGroups=Src,Xcpp
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The generated building project has been placed into $CASROOT/adm folder:
|
||||
* for vc8 - $CASROOT/adm/msvc/vc8
|
||||
* for vc9 - $CASROOT/adm/msvc/vc9
|
||||
* for vc10 - $CASROOT/adm/msvc/vc10
|
||||
* for vc11 - $CASROOT/adm/msvc/vc11
|
||||
* for cbp - $CASROOT/adm/<OS> /cbp
|
||||
* for cmake - $CASROOT/adm/cmake
|
||||
* for amk - $CASROOT/adm/lin/amk
|
||||
* xcd - $CASROOT/adm/<OS>/xcd
|
||||
|
||||
@section wok4 Generation of documentation
|
||||
|
||||
Use command wgendoc in WOK to generate reference documentation:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.tcl}
|
||||
:LOC:dev> wokcd occt
|
||||
:LOC:dev:occt> wgendoc
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The following options can be used:
|
||||
* -wb=< workbench name > the name of OCCT workbench (the current one by default);
|
||||
* -m=< list of modules > the list of modules that will be contained in the documentation;
|
||||
* -outdir=< path > the output directory for the documentation;
|
||||
* -chm the option to generate CHM file;
|
||||
* -hhc=< path > the path to HTML Help Compiler (hhc.exe) or equivalent;
|
||||
* -qthelp=< path > the option to generate Qt Help file, it is necessary to specify the path to qthelpgenerator executable;
|
||||
* -doxygen=< path > the path to Doxygen executable
|
||||
* -dot=< path > the path to GraphViz dot executable
|
690
dox/occdoc.tcl
Normal file
@ -0,0 +1,690 @@
|
||||
# -----------------------------------------------------------------------
|
||||
# Script name: CompileDocs.tcl
|
||||
# This script compiles OCCT documents from *.md files to HTML pages
|
||||
# Author: omy
|
||||
# -----------------------------------------------------------------------
|
||||
|
||||
# Generates Doxygen configuration file for Overview documentation
|
||||
proc OverviewDoc_MakeDoxyfile {casDir outDir tagFileDir {doxyFileName} {generatorMode ""} DocFilesList verboseMode} {
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "INFO: Doxygen is now generating Doxyfile..."
|
||||
}
|
||||
|
||||
set doxyFile [open $doxyFileName "w"]
|
||||
set casroot $casDir
|
||||
set inputDir $casDir/dox
|
||||
|
||||
# Common configs
|
||||
puts $doxyFile "DOXYFILE_ENCODING = UTF-8"
|
||||
puts $doxyFile "PROJECT_NAME = \"Open CASCADE Technology\""
|
||||
puts $doxyFile "PROJECT_NUMBER = 6.6.0"
|
||||
puts $doxyFile "PROJECT_BRIEF = "
|
||||
puts $doxyFile "PROJECT_LOGO = $inputDir/resources/occt_logo.png"
|
||||
|
||||
puts $doxyFile "OUTPUT_DIRECTORY = $outDir"
|
||||
puts $doxyFile "CREATE_SUBDIRS = NO"
|
||||
puts $doxyFile "OUTPUT_LANGUAGE = English"
|
||||
puts $doxyFile "ABBREVIATE_BRIEF = \"The \$name class\" \
|
||||
\"The \$name widget\" \
|
||||
\"The \$name file\" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the"
|
||||
|
||||
puts $doxyFile "FULL_PATH_NAMES = YES"
|
||||
puts $doxyFile "INHERIT_DOCS = YES"
|
||||
puts $doxyFile "TAB_SIZE = 4"
|
||||
puts $doxyFile "MARKDOWN_SUPPORT = YES"
|
||||
puts $doxyFile "EXTRACT_ALL = YES"
|
||||
puts $doxyFile "CASE_SENSE_NAMES = NO"
|
||||
puts $doxyFile "INLINE_INFO = YES"
|
||||
puts $doxyFile "SORT_MEMBER_DOCS = YES"
|
||||
puts $doxyFile "WARNINGS = YES"
|
||||
puts $doxyFile "WARN_IF_UNDOCUMENTED = YES"
|
||||
puts $doxyFile "WARN_IF_DOC_ERROR = YES"
|
||||
puts $doxyFile "WARN_NO_PARAMDOC = NO"
|
||||
puts $doxyFile "WARN_FORMAT = \"\$file:\$line: \$text\""
|
||||
puts $doxyFile "INPUT_ENCODING = UTF-8"
|
||||
puts $doxyFile "FILE_PATTERNS = *.md *.dox "
|
||||
puts $doxyFile "RECURSIVE = YES"
|
||||
puts $doxyFile "SOURCE_BROWSER = NO"
|
||||
puts $doxyFile "INLINE_SOURCES = YES"
|
||||
puts $doxyFile "COLS_IN_ALPHA_INDEX = 5"
|
||||
|
||||
# Generation options
|
||||
puts $doxyFile "GENERATE_DOCSET = NO"
|
||||
puts $doxyFile "GENERATE_HTMLHELP = NO"
|
||||
puts $doxyFile "GENERATE_CHI = NO"
|
||||
puts $doxyFile "GENERATE_QHP = NO"
|
||||
puts $doxyFile "GENERATE_ECLIPSEHELP = NO"
|
||||
puts $doxyFile "GENERATE_RTF = NO"
|
||||
puts $doxyFile "GENERATE_MAN = NO"
|
||||
puts $doxyFile "GENERATE_XML = NO"
|
||||
puts $doxyFile "GENERATE_DOCBOOK = NO"
|
||||
puts $doxyFile "GENERATE_AUTOGEN_DEF = NO"
|
||||
puts $doxyFile "GENERATE_PERLMOD = NO"
|
||||
|
||||
set PARAM_INPUT "INPUT = "
|
||||
set PARAM_IMAGEPATH "IMAGE_PATH = $inputDir/resources/ "
|
||||
|
||||
foreach docFile $DocFilesList {
|
||||
set NEW_IMG_PATH [file normalize [file dirname "$inputDir/$docFile"]]
|
||||
if { [string compare $NEW_IMG_PATH $casroot] != 0 } {
|
||||
if {[file isdirectory "$NEW_IMG_PATH/images"]} {
|
||||
append PARAM_IMAGEPATH " " "$NEW_IMG_PATH/images"
|
||||
}
|
||||
}
|
||||
append PARAM_INPUT " " $inputDir/$docFile
|
||||
}
|
||||
puts $doxyFile $PARAM_INPUT
|
||||
puts $doxyFile $PARAM_IMAGEPATH
|
||||
|
||||
if { $generatorMode == "PDF_ONLY"} {
|
||||
set PARAM_LATEX_EF "LATEX_EXTRA_FILES ="
|
||||
foreach docFile $DocFilesList {
|
||||
set NEW_LEF_PATH [file normalize [file dirname "$inputDir/$docFile"]]
|
||||
if { [string compare $NEW_LEF_PATH $casroot] != 0 } {
|
||||
append PARAM_LATEX_EF " " "$NEW_LEF_PATH/images"
|
||||
}
|
||||
}
|
||||
puts $doxyFile $PARAM_LATEX_EF
|
||||
}
|
||||
|
||||
if { $generatorMode == "HTML_ONLY"} {
|
||||
# Set a reference to a TAGFILE
|
||||
if { $tagFileDir != "" } {
|
||||
if {[file exists $tagFileDir/OCCT.tag] == 1} {
|
||||
set tagPath [OverviewDoc_GetRelPath $tagFileDir $outDir/html]
|
||||
puts $doxyFile "TAGFILES = $tagFileDir/OCCT.tag=$tagPath/html"
|
||||
}
|
||||
}
|
||||
|
||||
# HTML Output
|
||||
puts $doxyFile "GENERATE_LATEX = NO"
|
||||
puts $doxyFile "GENERATE_HTML = YES"
|
||||
puts $doxyFile "HTML_COLORSTYLE_HUE = 220"
|
||||
puts $doxyFile "HTML_COLORSTYLE_SAT = 100"
|
||||
puts $doxyFile "HTML_COLORSTYLE_GAMMA = 80"
|
||||
puts $doxyFile "HTML_TIMESTAMP = YES"
|
||||
puts $doxyFile "HTML_DYNAMIC_SECTIONS = YES"
|
||||
puts $doxyFile "HTML_INDEX_NUM_ENTRIES = 100"
|
||||
puts $doxyFile "DISABLE_INDEX = YES"
|
||||
puts $doxyFile "GENERATE_TREEVIEW = YES"
|
||||
puts $doxyFile "ENUM_VALUES_PER_LINE = 8"
|
||||
puts $doxyFile "TREEVIEW_WIDTH = 250"
|
||||
puts $doxyFile "EXTERNAL_PAGES = NO"
|
||||
puts $doxyFile "SEARCHENGINE = YES"
|
||||
puts $doxyFile "SERVER_BASED_SEARCH = NO"
|
||||
puts $doxyFile "EXTERNAL_SEARCH = NO"
|
||||
puts $doxyFile "SEARCHDATA_FILE = searchdata.xml"
|
||||
puts $doxyFile "SKIP_FUNCTION_MACROS = YES"
|
||||
# Formula options
|
||||
puts $doxyFile "FORMULA_FONTSIZE = 12"
|
||||
puts $doxyFile "FORMULA_TRANSPARENT = YES"
|
||||
puts $doxyFile "USE_MATHJAX = YES"
|
||||
puts $doxyFile "MATHJAX_FORMAT = HTML-CSS"
|
||||
puts $doxyFile "MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest"
|
||||
|
||||
} elseif { $generatorMode == "PDF_ONLY"} {
|
||||
|
||||
puts $doxyFile "GENERATE_HTML = NO"
|
||||
puts $doxyFile "DISABLE_INDEX = YES"
|
||||
puts $doxyFile "GENERATE_TREEVIEW = NO"
|
||||
puts $doxyFile "PREDEFINED = PDF_ONLY"
|
||||
puts $doxyFile "GENERATE_LATEX = YES"
|
||||
puts $doxyFile "COMPACT_LATEX = YES"
|
||||
puts $doxyFile "PDF_HYPERLINKS = YES"
|
||||
puts $doxyFile "USE_PDFLATEX = YES"
|
||||
puts $doxyFile "LATEX_BATCHMODE = YES"
|
||||
puts $doxyFile "LATEX_OUTPUT = latex"
|
||||
puts $doxyFile "LATEX_CMD_NAME = latex"
|
||||
puts $doxyFile "MAKEINDEX_CMD_NAME = makeindex"
|
||||
}
|
||||
|
||||
close $doxyFile
|
||||
}
|
||||
|
||||
# Returns the relative path between two directories
|
||||
proc OverviewDoc_GetRelPath {targetFile currentpath} {
|
||||
set cc [file split [file normalize $currentpath]]
|
||||
set tt [file split [file normalize $targetFile]]
|
||||
|
||||
if {![string equal [lindex $cc 0] [lindex $tt 0]]} {
|
||||
# not on *n*x then
|
||||
return -code error "$targetFile not on same volume as $currentpath"
|
||||
}
|
||||
while {[string equal [lindex $cc 0] [lindex $tt 0]] && [llength $cc] > 0} {
|
||||
# discard matching components from the front
|
||||
set cc [lreplace $cc 0 0]
|
||||
set tt [lreplace $tt 0 0]
|
||||
}
|
||||
set prefix ""
|
||||
if {[llength $cc] == 0} {
|
||||
# just the file name, so targetFile is lower down (or in same place)
|
||||
set prefix "."
|
||||
}
|
||||
# step up the tree
|
||||
for {set i 0} {$i < [llength $cc]} {incr i} {
|
||||
append prefix " .."
|
||||
}
|
||||
# stick it all together (the eval is to flatten the targetFile list)
|
||||
return [eval file join $prefix $tt]
|
||||
}
|
||||
|
||||
# Prints Help message
|
||||
proc OverviewDoc_PrintHelpMessage {} {
|
||||
puts "\nUsage : occdoc \[-h\] \[-html\] \[-pdf\] \[-m=<list of files>\] \[-l=<document name>\] \[-v\]"
|
||||
puts ""
|
||||
puts " Options are : "
|
||||
puts " -html : To generate HTML files"
|
||||
puts " (cannot be used with -pdf)"
|
||||
puts " -pdf : To generate PDF files"
|
||||
puts " (cannot be used with -html)"
|
||||
puts " -m=<modules_list> : Specifies list of documents to generate."
|
||||
puts " If it is not specified, all files, "
|
||||
puts " mentioned in FILES.txt are processed."
|
||||
puts " -l=<document_name> : Specifies the document caption "
|
||||
puts " for a single document"
|
||||
puts " -h : Prints help message"
|
||||
puts " -v : Specifies the Verbose mode"
|
||||
puts " (info on all script actions is shown)"
|
||||
}
|
||||
|
||||
# Parses command line arguments
|
||||
proc OverviewDoc_ParseArguments {arguments} {
|
||||
global args_names
|
||||
global args_values
|
||||
set args_names {}
|
||||
array set args_values {}
|
||||
|
||||
foreach arg $arguments {
|
||||
if {[regexp {^(-)[a-z]+$} $arg] == 1} {
|
||||
set name [string range $arg 1 [string length $arg]-1]
|
||||
lappend args_names $name
|
||||
set args_values($name) "NULL"
|
||||
continue
|
||||
} elseif {[regexp {^(-)[a-z]+=.+$} $arg] == 1} {
|
||||
set equal_symbol_position [string first "=" $arg]
|
||||
set name [string range $arg 1 $equal_symbol_position-1]
|
||||
lappend args_names $name
|
||||
set value [string range $arg $equal_symbol_position+1 [string length $arguments]-1]
|
||||
|
||||
# To parse a list of values for -m parameter
|
||||
if { [string first "," $value] != -1 } {
|
||||
set value [split $value ","];
|
||||
}
|
||||
set args_values($name) $value
|
||||
} else {
|
||||
puts "Error in argument $arg"
|
||||
return 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
# Loads a list of docfiles from file FILES.txt
|
||||
proc OverviewDoc_LoadFilesList {} {
|
||||
|
||||
set INPUTDIR [file normalize [file dirname [info script]]]
|
||||
|
||||
global available_docfiles
|
||||
set available_docfiles {}
|
||||
|
||||
# Read data from file
|
||||
if { [file exists "$INPUTDIR/FILES.txt"] == 1 } {
|
||||
set FILE [open "$INPUTDIR/FILES.txt" r]
|
||||
while {1} {
|
||||
set line [gets $FILE]
|
||||
if {$line != ""} {
|
||||
lappend available_docfiles $line
|
||||
}
|
||||
|
||||
if {[eof $FILE]} {
|
||||
close $FILE
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return -1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
# Writes new tex file for conversion from tex to pdf for a specific doc
|
||||
proc OverviewDoc_MakeRefmanTex {fileName latexDir docLabel verboseMode} {
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "INFO: Making refman.tex file for $fileName"
|
||||
}
|
||||
set DOCNAME "$latexDir/refman.tex"
|
||||
if {[file exists $DOCNAME] == 1} {
|
||||
file delete -force $DOCNAME
|
||||
}
|
||||
set texfile [open $DOCNAME w]
|
||||
|
||||
puts $texfile "\\batchmode"
|
||||
puts $texfile "\\nonstopmode"
|
||||
puts $texfile "\\documentclass\[oneside\]{article}"
|
||||
puts $texfile "\n% Packages required by doxygen"
|
||||
puts $texfile "\\usepackage{calc}"
|
||||
puts $texfile "\\usepackage{doxygen}"
|
||||
puts $texfile "\\usepackage{graphicx}"
|
||||
puts $texfile "\\usepackage\[utf8\]{inputenc}"
|
||||
puts $texfile "\\usepackage{makeidx}"
|
||||
puts $texfile "\\usepackage{multicol}"
|
||||
puts $texfile "\\usepackage{multirow}"
|
||||
puts $texfile "\\usepackage{textcomp}"
|
||||
puts $texfile "\\usepackage{amsmath}"
|
||||
puts $texfile "\\usepackage\[table\]{xcolor}"
|
||||
puts $texfile "\\usepackage{indentfirst}"
|
||||
puts $texfile ""
|
||||
puts $texfile "% Font selection"
|
||||
puts $texfile "\\usepackage\[T1\]{fontenc}"
|
||||
puts $texfile "\\usepackage{mathptmx}"
|
||||
puts $texfile "\\usepackage\[scaled=.90\]{helvet}"
|
||||
puts $texfile "\\usepackage{courier}"
|
||||
puts $texfile "\\usepackage{amssymb}"
|
||||
puts $texfile "\\usepackage{sectsty}"
|
||||
puts $texfile "\\renewcommand{\\familydefault}{\\sfdefault}"
|
||||
puts $texfile "\\allsectionsfont{%"
|
||||
puts $texfile " \\fontseries{bc}\\selectfont%"
|
||||
puts $texfile " \\color{darkgray}%"
|
||||
puts $texfile "}"
|
||||
puts $texfile "\\renewcommand{\\DoxyLabelFont}{%"
|
||||
puts $texfile " \\fontseries{bc}\\selectfont%"
|
||||
puts $texfile " \\color{darkgray}%"
|
||||
puts $texfile "}"
|
||||
puts $texfile ""
|
||||
puts $texfile "% Page & text layout"
|
||||
puts $texfile "\\usepackage{geometry}"
|
||||
puts $texfile "\\geometry{%"
|
||||
puts $texfile " a4paper,%"
|
||||
puts $texfile " top=2.5cm,%"
|
||||
puts $texfile " bottom=2.5cm,%"
|
||||
puts $texfile " left=2.5cm,%"
|
||||
puts $texfile " right=2.5cm%"
|
||||
puts $texfile "}"
|
||||
puts $texfile "\\tolerance=750"
|
||||
puts $texfile "\\hfuzz=15pt"
|
||||
puts $texfile "\\hbadness=750"
|
||||
puts $texfile "\\setlength{\\emergencystretch}{15pt}"
|
||||
puts $texfile "\\setlength{\\parindent}{0.75cm}"
|
||||
puts $texfile "\\setlength{\\parskip}{0.2cm}"
|
||||
puts $texfile "\\makeatletter"
|
||||
puts $texfile "\\renewcommand{\\paragraph}{%"
|
||||
puts $texfile " \@startsection{paragraph}{4}{0ex}{-1.0ex}{1.0ex}{%"
|
||||
puts $texfile "\\normalfont\\normalsize\\bfseries\\SS@parafont%"
|
||||
puts $texfile " }%"
|
||||
puts $texfile "}"
|
||||
puts $texfile "\\renewcommand{\\subparagraph}{%"
|
||||
puts $texfile " \\@startsection{subparagraph}{5}{0ex}{-1.0ex}{1.0ex}{%"
|
||||
puts $texfile "\\normalfont\\normalsize\\bfseries\\SS@subparafont%"
|
||||
puts $texfile " }%"
|
||||
puts $texfile "}"
|
||||
puts $texfile "\\makeatother"
|
||||
puts $texfile ""
|
||||
puts $texfile "% Headers & footers"
|
||||
puts $texfile "\\usepackage{fancyhdr}"
|
||||
puts $texfile "\\pagestyle{fancyplain}"
|
||||
puts $texfile "\\fancyhead\[LE\]{\\fancyplain{}{\\bfseries\\thepage}}"
|
||||
puts $texfile "\\fancyhead\[CE\]{\\fancyplain{}{}}"
|
||||
puts $texfile "\\fancyhead\[RE\]{\\fancyplain{}{\\bfseries\\leftmark}}"
|
||||
puts $texfile "\\fancyhead\[LO\]{\\fancyplain{}{\\bfseries\\rightmark}}"
|
||||
puts $texfile "\\fancyhead\[CO\]{\\fancyplain{}{}}"
|
||||
puts $texfile "\\fancyhead\[RO\]{\\fancyplain{}{\\bfseries\\thepage}}"
|
||||
puts $texfile "\\fancyfoot\[LE\]{\\fancyplain{}{}}"
|
||||
puts $texfile "\\fancyfoot\[CE\]{\\fancyplain{}{}}"
|
||||
puts $texfile "\\fancyfoot\[RE\]{\\fancyplain{}{\\bfseries\\scriptsize © Open CASCADE Technology 2001\-2013}}"
|
||||
puts $texfile "\\fancyfoot\[LO\]{\\fancyplain{}{\\bfseries\\scriptsize © Open CASCADE Technology 2001\-2013}}"
|
||||
puts $texfile "\\fancyfoot\[CO\]{\\fancyplain{}{}}"
|
||||
puts $texfile "\\fancyfoot\[RO\]{\\fancyplain{}{}}"
|
||||
puts $texfile "\\renewcommand{\\footrulewidth}{0.4pt}"
|
||||
puts $texfile "\\renewcommand{\\sectionmark}\[1\]{%"
|
||||
puts $texfile " \\markright{\\thesection\\ #1}%"
|
||||
puts $texfile "}"
|
||||
puts $texfile ""
|
||||
puts $texfile "% Indices & bibliography"
|
||||
puts $texfile "\\usepackage{natbib}"
|
||||
puts $texfile "\\usepackage\[titles\]{tocloft}"
|
||||
puts $texfile "\\renewcommand{\\cftsecleader}{\\cftdotfill{\\cftdotsep}}"
|
||||
puts $texfile "\\setcounter{tocdepth}{3}"
|
||||
puts $texfile "\\setcounter{secnumdepth}{5}"
|
||||
puts $texfile "\\makeindex"
|
||||
puts $texfile ""
|
||||
puts $texfile "% Hyperlinks (required, but should be loaded last)"
|
||||
puts $texfile "\\usepackage{ifpdf}"
|
||||
puts $texfile "\\ifpdf"
|
||||
puts $texfile " \\usepackage\[pdftex,pagebackref=true\]{hyperref}"
|
||||
puts $texfile "\\else"
|
||||
puts $texfile " \\usepackage\[ps2pdf,pagebackref=true\]{hyperref}"
|
||||
puts $texfile "\\fi"
|
||||
puts $texfile "\\hypersetup{%"
|
||||
puts $texfile " colorlinks=true,%"
|
||||
puts $texfile " linkcolor=black,%"
|
||||
puts $texfile " citecolor=black,%"
|
||||
puts $texfile " urlcolor=blue,%"
|
||||
puts $texfile " unicode%"
|
||||
puts $texfile "}"
|
||||
puts $texfile ""
|
||||
puts $texfile "% Custom commands"
|
||||
puts $texfile "\\newcommand{\\clearemptydoublepage}{%"
|
||||
puts $texfile " \\newpage{\\pagestyle{empty}\\cleardoublepage}%"
|
||||
puts $texfile "}"
|
||||
puts $texfile "\n"
|
||||
puts $texfile "%===== C O N T E N T S =====\n"
|
||||
puts $texfile "\\begin{document}"
|
||||
puts $texfile ""
|
||||
puts $texfile "% Titlepage & ToC"
|
||||
puts $texfile "\\hypersetup{pageanchor=false}"
|
||||
puts $texfile "\\pagenumbering{roman}"
|
||||
puts $texfile "\\begin{titlepage}"
|
||||
puts $texfile "\\vspace*{7cm}"
|
||||
puts $texfile "\\begin{center}%"
|
||||
puts $texfile "\\includegraphics\[width=0.75\\textwidth, height=0.2\\textheight\]{occttransparent.png}\\\\\\\\"
|
||||
puts $texfile "{\\Large Open C\\-A\\-S\\-C\\-A\\-D\\-E Technology \\\\\[1ex\]\\Large 6.\\-6.\\-0 }\\\\"
|
||||
puts $texfile "\\vspace*{1cm}"
|
||||
puts $texfile "{\\Large $docLabel}\\\\"
|
||||
puts $texfile "\\vspace*{1cm}"
|
||||
puts $texfile "{\\large Generated by Doxygen 1.8.4}\\\\"
|
||||
puts $texfile "\\vspace*{0.5cm}"
|
||||
puts $texfile "{\\small \\today}\\"
|
||||
puts $texfile "\\end{center}"
|
||||
puts $texfile "\\end{titlepage}"
|
||||
puts $texfile "\\clearpage"
|
||||
puts $texfile "\\pagenumbering{roman}"
|
||||
puts $texfile "\\tableofcontents"
|
||||
puts $texfile "\\newpage"
|
||||
puts $texfile "\\pagenumbering{arabic}"
|
||||
puts $texfile "\\hypersetup{pageanchor=true}"
|
||||
puts $texfile ""
|
||||
puts $texfile "\\hypertarget{$fileName}{}"
|
||||
puts $texfile "\\input{$fileName}"
|
||||
puts $texfile ""
|
||||
puts $texfile "% Index"
|
||||
puts $texfile "\\newpage"
|
||||
puts $texfile "\\phantomsection"
|
||||
puts $texfile "\\addcontentsline{toc}{part}{Index}"
|
||||
puts $texfile "\\printindex\n"
|
||||
puts $texfile "\\end{document}"
|
||||
|
||||
close $texfile
|
||||
}
|
||||
|
||||
# Postprocesses generated TeX files
|
||||
proc OverviewDoc_ProcessTex {{texFiles {}} {latexDir} verboseMode} {
|
||||
|
||||
foreach TEX $texFiles {
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "INFO: Preprocessing file $TEX"
|
||||
}
|
||||
set IN_F [open "$TEX" r]
|
||||
set TMPFILENAME "$latexDir/temp.tex"
|
||||
set OUT_F [open $TMPFILENAME w]
|
||||
|
||||
while {1} {
|
||||
set line [gets $IN_F]
|
||||
if { [string first "\\includegraphics" $line] != -1 } {
|
||||
# Center images in TeX files
|
||||
set line "\\begin{center}\n $line\n\\end{center}"
|
||||
} elseif { [string first "\\subsection" $line] != -1 } {
|
||||
# Replace \subsection with \section tag
|
||||
regsub -all "\\\\subsection" $line "\\\\section" line
|
||||
} elseif { [string first "\\subsubsection" $line] != -1 } {
|
||||
# Replace \subsubsection with \subsection tag
|
||||
regsub -all "\\\\subsubsection" $line "\\\\subsection" line
|
||||
} elseif { [string first "\\paragraph" $line] != -1 } {
|
||||
# Replace \paragraph with \subsubsection tag
|
||||
regsub -all "\\\\paragraph" $line "\\\\subsubsection" line
|
||||
}
|
||||
puts $OUT_F $line
|
||||
|
||||
if {[eof $IN_F]} {
|
||||
close $IN_F
|
||||
close $OUT_F
|
||||
break
|
||||
}
|
||||
}
|
||||
file delete -force $TEX
|
||||
file rename $TMPFILENAME $TEX
|
||||
}
|
||||
}
|
||||
|
||||
# Main procedure for documents compilation
|
||||
proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode} {
|
||||
|
||||
set INDIR [file normalize [file dirname [info script]]]
|
||||
set CASROOT [file normalize [file dirname "$INDIR/../../"]]
|
||||
set OUTDIR $CASROOT/doc
|
||||
set PDFDIR $OUTDIR/overview/pdf
|
||||
set HTMLDIR $OUTDIR/overview/html
|
||||
set LATEXDIR $OUTDIR/overview/latex
|
||||
set TAGFILEDIR $OUTDIR/refman
|
||||
set DOXYFILE $OUTDIR/OCCT.cfg
|
||||
|
||||
# Create or clean the output folders
|
||||
if {[file exists $OUTDIR] == 0} {
|
||||
file mkdir $OUTDIR
|
||||
}
|
||||
if {[file exists $HTMLDIR] == 0} {
|
||||
file mkdir $HTMLDIR
|
||||
}
|
||||
if {[file exists $LATEXDIR] == 0} {
|
||||
file mkdir $LATEXDIR
|
||||
}
|
||||
if {[file exists $PDFDIR] == 0} {
|
||||
file mkdir $PDFDIR
|
||||
}
|
||||
|
||||
# Run tools to compile documents
|
||||
puts ""
|
||||
puts " [clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Generation process started..."
|
||||
puts ""
|
||||
puts " Please, wait while Doxygen finishes it\'s work"
|
||||
OverviewDoc_MakeDoxyfile $CASROOT "$OUTDIR/overview" $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $verboseMode
|
||||
|
||||
# Run doxygen tool
|
||||
if { $generatorMode == "HTML_ONLY"} {
|
||||
puts " [clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Doxygen is now generating HTML files...\n"
|
||||
}
|
||||
set RESULT [catch {exec doxygen $DOXYFILE > $OUTDIR/doxygen_out.log} DOX_ERROR]
|
||||
if {$RESULT != 0} {
|
||||
if {[llength [split $DOX_ERROR "\n"]] > 1} {
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "INFO: See Doxygen messages in $OUTDIR/doxygen_warnings_and_errors.log"
|
||||
}
|
||||
set DOX_ERROR_FILE [open "$OUTDIR/doxygen_warnings_and_errors.log" "w"]
|
||||
puts $DOX_ERROR_FILE $DOX_ERROR
|
||||
close $DOX_ERROR_FILE
|
||||
} else {
|
||||
puts $DOX_ERROR
|
||||
}
|
||||
}
|
||||
# Close the Doxygen application
|
||||
after 300
|
||||
|
||||
# Start PDF generation routine
|
||||
if { $generatorMode == "PDF_ONLY" } {
|
||||
puts ""
|
||||
puts " [clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Doxygen is now generating PDF files...\n"
|
||||
|
||||
set OS $::tcl_platform(platform)
|
||||
if { $OS == "unix" } {
|
||||
set PREFIX ".sh"
|
||||
} elseif { $OS == "windows" } {
|
||||
set PREFIX ".bat"
|
||||
}
|
||||
|
||||
# Prepare a list of TeX files, generated by Doxygen
|
||||
cd $LATEXDIR
|
||||
|
||||
set TEXFILES [glob $LATEXDIR -type f -directory $LATEXDIR -tails "*.tex" ]
|
||||
set REFMAN_IDX [lsearch $TEXFILES "refman.tex"]
|
||||
set TEXFILES [lreplace $TEXFILES $REFMAN_IDX $REFMAN_IDX]
|
||||
set REFMAN_IDX [lsearch $TEXFILES "index.tex"]
|
||||
set TEXFILES [lreplace $TEXFILES $REFMAN_IDX $REFMAN_IDX]
|
||||
|
||||
set IDX [lsearch $TEXFILES "$LATEXDIR"]
|
||||
while { $IDX != -1} {
|
||||
set TEXFILES [lreplace $TEXFILES $IDX $IDX]
|
||||
set IDX [lsearch $TEXFILES "$LATEXDIR"]
|
||||
}
|
||||
|
||||
# Preprocess generated TeX files
|
||||
OverviewDoc_ProcessTex $TEXFILES $LATEXDIR $verboseMode
|
||||
|
||||
# Generate PDF files from
|
||||
foreach TEX $TEXFILES {
|
||||
# Rewrite existing REFMAN.tex file...
|
||||
set TEX [string range $TEX 0 [ expr "[string length $TEX] - 5"]]
|
||||
OverviewDoc_MakeRefmanTex $TEX $LATEXDIR $docLabel $verboseMode
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "INFO: Generating PDF file from $TEX"
|
||||
}
|
||||
# ...and use it to generate PDF from TeX...
|
||||
set RESULT [catch {eval exec [auto_execok $LATEXDIR/make$PREFIX] > "$OUTDIR/pdflatex_out.log"} LaTeX_ERROR]
|
||||
if {$RESULT != 0} {
|
||||
if {[llength [split $LaTeX_ERROR "\n"]] > 1} {
|
||||
set LaTeX_ERROR_FILE [open "$OUTDIR/pdflatex_warnings_and_errors.log" "w"]
|
||||
puts $LaTeX_ERROR_FILE $LaTeX_ERROR
|
||||
close $LaTeX_ERROR_FILE
|
||||
} else {
|
||||
puts $DOX_ERROR
|
||||
}
|
||||
}
|
||||
|
||||
# ...and place it to the specific folder
|
||||
if { [file exists $PDFDIR/$TEX.pdf] == 1 } {
|
||||
file delete -force $PDFDIR/$TEX.pdf
|
||||
}
|
||||
file rename $LATEXDIR/refman.pdf "$PDFDIR/$TEX.pdf"
|
||||
}
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "INFO: See LaTeX messages in $OUTDIR/pdflatex_warnings_and_errors.log"
|
||||
}
|
||||
}
|
||||
|
||||
cd $INDIR
|
||||
puts " [clock format [clock seconds] -format {%Y.%m.%d %H:%M}] Generation process finished..."
|
||||
puts ""
|
||||
puts "--------------------------------------------------------------------"
|
||||
if { $generatorMode == "HTML_ONLY" } {
|
||||
puts " You can look at generated HTML pages by opening: "
|
||||
set RESFILE $OUTDIR/overview/html/index.html
|
||||
puts " $RESFILE"
|
||||
}
|
||||
if { $generatorMode == "PDF_ONLY" } {
|
||||
puts " You can look at generated PDF files in: "
|
||||
puts " $OUTDIR/overview/pdf folder"
|
||||
}
|
||||
puts ""
|
||||
puts " Copyright \u00a9 Open CASCADE Technology 2001-2013"
|
||||
puts "--------------------------------------------------------------------\n"
|
||||
}
|
||||
|
||||
# A command for User Documentation compilation
|
||||
proc occdoc {args} {
|
||||
# Programm options
|
||||
set GEN_HTML "NO"
|
||||
set GEN_PDF "NO"
|
||||
set DOCFILES {}
|
||||
set DOCLABEL "Default OCCT Document"
|
||||
set VERB_MODE "NO"
|
||||
set GEN_MODE "DEFAULT"
|
||||
global available_docfiles
|
||||
global args_names
|
||||
global args_values
|
||||
|
||||
# Load list of docfiles
|
||||
if { [OverviewDoc_LoadFilesList] != 0 } {
|
||||
puts "ERROR: File FILES.txt was not found"
|
||||
return
|
||||
}
|
||||
|
||||
# Parse CL arguments
|
||||
if {[OverviewDoc_ParseArguments $args] == 1} {
|
||||
return
|
||||
}
|
||||
if {$args_names == {}} {
|
||||
set GEN_HTML "YES"
|
||||
set VERB_MODE "YES"
|
||||
} else {
|
||||
foreach arg_n $args_names {
|
||||
if {$arg_n == "h"} {
|
||||
OverviewDoc_PrintHelpMessage
|
||||
return
|
||||
} elseif {$arg_n == "html"} {
|
||||
set GEN_HTML "YES"
|
||||
} elseif {$arg_n == "pdf"} {
|
||||
set GEN_PDF "YES"
|
||||
} elseif {$arg_n == "v"} {
|
||||
set VERB_MODE "YES"
|
||||
} elseif {$arg_n == "m"} {
|
||||
if {$args_values(m) != "NULL"} {
|
||||
set DOCFILES $args_values(m)
|
||||
} else {
|
||||
puts "Error in argument m"
|
||||
return
|
||||
}
|
||||
# Check if all chosen docfiles are correct
|
||||
foreach docfile $DOCFILES {
|
||||
if { [lsearch $available_docfiles $docfile] == -1 } {
|
||||
puts "File \"$docfile\" is not presented in the list of available docfiles"
|
||||
puts "Please, specify the correct docfile name"
|
||||
return
|
||||
} else {
|
||||
puts "File $docfile is presented in FILES.TXT"
|
||||
}
|
||||
}
|
||||
} elseif {$arg_n == "l"} {
|
||||
if { [llength $DOCFILES] <= 1 } {
|
||||
if {$args_values(l) != "NULL"} {
|
||||
set DOCLABEL $args_values(l)
|
||||
} else {
|
||||
puts "Error in argument l"
|
||||
return
|
||||
}
|
||||
}
|
||||
} else {
|
||||
puts "\nWrong argument: $arg_n"
|
||||
OverviewDoc_PrintHelpMessage
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Specify generation mode
|
||||
if {$GEN_HTML == "YES" && $GEN_PDF == "NO"} {
|
||||
set GEN_MODE "HTML_ONLY"
|
||||
} elseif {$GEN_PDF == "YES"} {
|
||||
set GEN_MODE "PDF_ONLY"
|
||||
}
|
||||
# Check if -v is the only option
|
||||
if {$GEN_MODE == "DEFAULT"} {
|
||||
if { $VERB_MODE == "YES" } {
|
||||
puts "\nArgument -v can't be used without -pdf or -html argument"
|
||||
OverviewDoc_PrintHelpMessage
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
# Specify verbose mode
|
||||
if { $GEN_PDF != "YES" && [llength $DOCFILES] > 1 } {
|
||||
set DOCLABEL ""
|
||||
}
|
||||
|
||||
# If we don't specify list for docfiles with -m argument,
|
||||
# we assume that we have to generate all docfiles
|
||||
if { [llength $DOCFILES] == 0 } {
|
||||
set DOCFILES $available_docfiles
|
||||
}
|
||||
|
||||
# Start main activities
|
||||
OverviewDoc_Main $DOCFILES $GEN_MODE $DOCLABEL $VERB_MODE
|
||||
}
|
BIN
dox/overview/images/overview_c__ie.png
Normal file
After ![]() (image error) Size: 37 KiB |
BIN
dox/overview/images/overview_draw.png
Normal file
After ![]() (image error) Size: 17 KiB |
BIN
dox/overview/images/overview_installation.png
Normal file
After ![]() (image error) Size: 7.5 KiB |
BIN
dox/overview/images/overview_mvc.png
Normal file
After ![]() (image error) Size: 31 KiB |
BIN
dox/overview/images/overview_occttransparent.png
Normal file
After ![]() (image error) Size: 35 KiB |
BIN
dox/overview/images/overview_qt.png
Normal file
After ![]() (image error) Size: 63 KiB |
BIN
dox/overview/tutorial/images/tutorial_image001.png
Normal file
After ![]() (image error) Size: 3.9 KiB |
BIN
dox/overview/tutorial/images/tutorial_image002.png
Normal file
After ![]() (image error) Size: 4.6 KiB |
BIN
dox/overview/tutorial/images/tutorial_image003.png
Normal file
After ![]() (image error) Size: 7.1 KiB |
BIN
dox/overview/tutorial/images/tutorial_image004.png
Normal file
After ![]() (image error) Size: 1.9 KiB |
BIN
dox/overview/tutorial/images/tutorial_image005.png
Normal file
After ![]() (image error) Size: 1.8 KiB |
BIN
dox/overview/tutorial/images/tutorial_image006.png
Normal file
After ![]() (image error) Size: 2.7 KiB |
BIN
dox/overview/tutorial/images/tutorial_image007.png
Normal file
After ![]() (image error) Size: 3.2 KiB |
BIN
dox/overview/tutorial/images/tutorial_image008.png
Normal file
After ![]() (image error) Size: 3.6 KiB |
BIN
dox/overview/tutorial/images/tutorial_image009.png
Normal file
After ![]() (image error) Size: 4.2 KiB |
BIN
dox/overview/tutorial/images/tutorial_image010.png
Normal file
After ![]() (image error) Size: 4.3 KiB |
BIN
dox/overview/tutorial/images/tutorial_image011.png
Normal file
After ![]() (image error) Size: 2.7 KiB |
BIN
dox/overview/tutorial/images/tutorial_image012.png
Normal file
After ![]() (image error) Size: 3.1 KiB |
BIN
dox/overview/tutorial/images/tutorial_image013.png
Normal file
After ![]() (image error) Size: 2.6 KiB |
BIN
dox/overview/tutorial/images/tutorial_image014.png
Normal file
After ![]() (image error) Size: 3.3 KiB |
BIN
dox/overview/tutorial/images/tutorial_image015.png
Normal file
After ![]() (image error) Size: 4.3 KiB |
BIN
dox/overview/tutorial/images/tutorial_image016.png
Normal file
After ![]() (image error) Size: 4.1 KiB |
BIN
dox/overview/tutorial/images/tutorial_image017.png
Normal file
After ![]() (image error) Size: 5.7 KiB |
BIN
dox/overview/tutorial/images/tutorial_image018.png
Normal file
After ![]() (image error) Size: 2.8 KiB |
BIN
dox/overview/tutorial/images/tutorial_image019.png
Normal file
After ![]() (image error) Size: 42 KiB |
843
dox/overview/tutorial/tutorial.md
Normal file
@ -0,0 +1,843 @@
|
||||
Tutorial {#overview__tutorial}
|
||||
=======
|
||||
|
||||
@section sec1 Overview
|
||||
|
||||
|
||||
This tutorial will teach you how to use Open CASCADE Technology services to model a 3D object. The purpose of this tutorial is not to describe all Open CASCADE Technology classes but to help you start thinking in terms of Open CASCADE Technology as a tool.
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB1_1 Prerequisites
|
||||
|
||||
This tutorial assumes that you have experience in using and setting up C++.
|
||||
From a programming standpoint, Open CASCADE Technology is designed to enhance your C++ tools with 3D modeling classes, methods and functions. The combination of all these resources will allow you to create substantial applications.
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB1_2 The Model
|
||||
|
||||
To illustrate the use of classes provided in the 3D geometric modeling toolkits, you will create a bottle as shown:
|
||||
|
||||

|
||||
|
||||
In the tutorial we will create, step-by-step, a function that will model a bottle as shown above. You will find the complete source code of this tutorial, including the very function *MakeBottle* in the distribution of Open CASCADE Technology. The function body is provided in the file samples/qt/Tutorial/src/MakeBottle.cxx.
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB1_3 Model Specifications
|
||||
|
||||
We first define the bottle specifications as follows:
|
||||
|
||||
| Object Parameter | Parameter Name | Parameter Value |
|
||||
| :--------------: | :------------: | :-------------: |
|
||||
| Bottle height | MyHeight | 70mm |
|
||||
| Bottle width | MyWidth | 50mm |
|
||||
| Bottle thickness | MyThickness | 30mm |
|
||||
|
||||
In addition, we decide that the bottle's profile (base) will be centered on the origin of the global Cartesian coordinate system.
|
||||
|
||||

|
||||
|
||||
This modeling requires four steps:
|
||||
|
||||
* build the bottle's Profile
|
||||
* build the bottle's Body
|
||||
* build the Threading on the bottle's neck
|
||||
* build the result compound
|
||||
|
||||
|
||||
@section sec2 Building the Profile
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB2_1 Defining Support Points
|
||||
|
||||
To create the bottle's profile, you first create characteristic points with their coordinates as shown below in the (XOY) plane. These points will be the supports that define the geometry of the profile.
|
||||
|
||||

|
||||
|
||||
There are two classes to describe a 3D Cartesian point from its X, Y and Z coordinates in Open CASCADE Technology:
|
||||
|
||||
* the primitive geometric *gp_Pnt* class
|
||||
* the transient *Geom_CartesianPoint* class manipulated by handle
|
||||
|
||||
A handle is a type of smart pointer that provides automatic memory management.
|
||||
To choose the best class for this application, consider the following:
|
||||
|
||||
* *gp_Pnt* is manipulated by value. Like all objects of its kind, it will have a limited lifetime.
|
||||
* *Geom_CartesianPoint* is manipulated by handle and may have multiple references and a long lifetime.
|
||||
|
||||
Since all the points you will define are only used to create the profile's curves, an object with a limited lifetime will do. Choose the *gp_Pnt* class.
|
||||
To instantiate a *gp_Pnt* object, just specify the X, Y, and Z coordinates of the points in the global cartesian coordinate system:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
gp_Pnt aPnt1(-myWidth / 2., 0, 0);
|
||||
gp_Pnt aPnt2(-myWidth / 2., -myThickness / 4., 0);
|
||||
gp_Pnt aPnt3(0, -myThickness / 2., 0);
|
||||
gp_Pnt aPnt4(myWidth / 2., -myThickness / 4., 0);
|
||||
gp_Pnt aPnt5(myWidth / 2., 0, 0);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Once your objects are instantiated, you can use methods provided by the class to access and modify its data. For example, to get the X coordinate of a point:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
Standard_Real xValue1 = aPnt1.X();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB2_2 Profile: Defining the Geometry
|
||||
With the help of the previously defined points, you can compute a part of the bottle's profile geometry. As shown in the figure below, it will consist of two segments and one arc.
|
||||
|
||||

|
||||
|
||||
To create such entities, you need a specific data structure, which implements 3D geometric objects. This can be found in the Geom package of Open CASCADE Technology.
|
||||
In Open CASCADE Technology a package is a group of classes providing related functionality. The classes have names that start with the name of a package they belong to. For example, *Geom_Line* and *Geom_Circle* classes belong to the *Geom* package. The *Geom* package implements 3D geometric objects: elementary curves and surfaces are provided as well as more complex ones (such as *Bezier* and *BSpline*).
|
||||
However, the *Geom* package provides only the data structure of geometric entities. You can directly instantiate classes belonging to *Geom*, but it is easier to compute elementary curves and surfaces by using the *GC* package.
|
||||
This is because the *GC* provides two algorithm classes which are exactly what is required for our profile:
|
||||
|
||||
* Class *GC_MakeSegment* to create a segment. One of its constructors allows you to define a segment by two end points P1 and P2
|
||||
* Class *GC_MakeArcOfCircle* to create an arc of a circle. A useful constructor creates an arc from two end points P1 and P3 and going through P2.
|
||||
|
||||
Both of these classes return a *Geom_TrimmedCurve* manipulated by handle. This entity represents a base curve (line or circle, in our case), limited between two of its parameter values. For example, circle C is parameterized between 0 and 2PI. If you need to create a quarter of a circle, you create a *Geom_TrimmedCurve* on C limited between 0 and M_PI/2.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
Handle(Geom_TrimmedCurve) aArcOfCircle = GC_MakeArcOfCircle(aPnt2,aPnt3,aPnt4);
|
||||
Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1, aPnt2);
|
||||
Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4, aPnt5);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
All *GC* classes provide a casting method to obtain a result automatically with a function-like call. Note that this method will raise an exception if construction has failed. To handle possible errors more explicitly, you may use the *IsDone* and *Value* methods. For example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
GC_MakeSegment mkSeg (aPnt1, aPnt2);
|
||||
Handle(Geom_TrimmedCurve) aSegment1;
|
||||
if(mkSegment.IsDone()){
|
||||
aSegment1 = mkSeg.Value();
|
||||
}
|
||||
else {
|
||||
// handle error
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB2_3 Profile: Defining the Topology
|
||||
|
||||
|
||||
You have created the support geometry of one part of the profile but these curves are independent with no relations between each other.
|
||||
To simplify the modeling, it would be right to manipulate these three curves as a single entity.
|
||||
This can be done by using the topological data structure of Open CASCADE Technology defined in the *TopoDS* package: it defines relationships between geometric entities which can be linked together to represent complex shapes.
|
||||
Each object of the *TopoDS* package, inheriting from the *TopoDS_Shape* class, describes a topological shape as described below:
|
||||
|
||||
| Shape | Open CASCADE Technology Class | Description |
|
||||
| :-------- | :---------------------------- | :------------------------------------------------------------ |
|
||||
| Vertex | TopoDS_Vertex | Zero dimensional shape corresponding to a point in geometry. |
|
||||
| Edge | TopoDS_Edge | One-dimensional shape corresponding to a curve and bounded by a vertex at each extremity.|
|
||||
| Wire | TopoDS_Wire | Sequence of edges connected by vertices. |
|
||||
| Face | TopoDS_Face | Part of a surface bounded by a closed wire(s). |
|
||||
| Shell | TopoDS_Shell | Set of faces connected by edges. |
|
||||
| Solid | TopoDS_Solid | Part of 3D space bounded by Shells. |
|
||||
| CompSolid | TopoDS_CompSolid | Set of solids connected by their faces. |
|
||||
| Compound | TopoDS_Compound | Set of any other shapes described above. |
|
||||
|
||||
Referring to the previous table, to build the profile, you will create:
|
||||
|
||||
* Three edges out of the previously computed curves.
|
||||
* One wire with these edges.
|
||||
|
||||

|
||||
|
||||
However, the *TopoDS* package provides only the data structure of the topological entities. Algorithm classes available to compute standard topological objects can be found in the *BRepBuilderAPI* package.
|
||||
To create an edge, you use the BRepBuilderAPI_MakeEdge class with the previously computed curves:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
|
||||
TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aArcOfCircle);
|
||||
TopoDS_Edge aEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In Open CASCADE Technology, you can create edges in several ways. One possibility is to create an edge directly from two points, in which case the underlying geometry of this edge is a line, bounded by two vertices being automatically computed from the two input points. For example, aEdge1 and aEdge3 could have been computed in a simpler way:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Edge aEdge1 = BRepBuilderAPI_MakeEdge(aPnt1, aPnt3);
|
||||
TopoDS_Edge aEdge2 = BRepBuilderAPI_MakeEdge(aPnt4, aPnt5);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To connect the edges, you need to create a wire with the *BRepBuilderAPI_MakeWire* class. There are two ways of building a wire with this class:
|
||||
|
||||
* directly from one to four edges
|
||||
* by adding other wire(s) or edge(s) to an existing wire (this is explained later in this tutorial)
|
||||
|
||||
When building a wire from less than four edges, as in the present case, you can use the constructor directly as follows:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(aEdge1, aEdge2, aEdge3);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB2_4 Profile: Completing the Profile
|
||||
|
||||
|
||||
Once the first part of your wire is created you need to compute the complete profile. A simple way to do this is to:
|
||||
|
||||
* compute a new wire by reflecting the existing one.
|
||||
* add the reflected wire to the initial one.
|
||||
|
||||

|
||||
|
||||
To apply a transformation on shapes (including wires), you first need to define the properties of a 3D geometric transformation by using the gp_Trsf class. This transformation can be a translation, a rotation, a scale, a reflection, or a combination of these.
|
||||
In our case, we need to define a reflection with respect to the X axis of the global coordinate system. An axis, defined with the gp_Ax1 class, is built out of a point and has a direction (3D unitary vector). There are two ways to define this axis.
|
||||
The first way is to define it from scratch, using its geometric definition:
|
||||
|
||||
* X axis is located at (0, 0, 0) - use the *gp_Pnt* class.
|
||||
* X axis direction is (1, 0, 0) - use the *gp_Dir* class. A *gp_Dir* instance is created out of its X, Y and Z coordinates.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
gp_Pnt aOrigin(0, 0, 0);
|
||||
gp_Dir xDir(1, 0, 0);
|
||||
gp_Ax1 xAxis(aOrigin, xDir);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The second and simplest way is to use the geometric constants defined in the gp package (origin, main directions and axis of the global coordinate system). To get the X axis, just call the *gp::OX* method:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
gp_Ax1 xAxis = gp::OX();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
As previously explained, the 3D geometric transformation is defined with the *gp_Trsf* class. There are two different ways to use this class:
|
||||
|
||||
* by defining a transformation matrix by all its values
|
||||
* by using the appropriate methods corresponding to the required transformation (SetTranslation for a translation, SetMirror for a reflection, etc.): the matrix is automatically computed.
|
||||
|
||||
Since the simplest approach is always the best one, you should use the SetMirror method with the axis as the center of symmetry.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
gp_Trsf aTrsf;
|
||||
aTrsf.SetMirror(xAxis);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You now have all necessary data to apply the transformation with the BRepBuilderAPI_Transform class by specifying:
|
||||
|
||||
* the shape on which the transformation must be applied.
|
||||
* the geometric transformation
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
BRepBuilderAPI_Transform aBRepTrsf(aWire, aTrsf);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
*BRepBuilderAPI_Transform* does not modify the nature of the shape: the result of the reflected wire remains a wire. But the function-like call or the *BRepBuilderAPI_Transform::Shape* method returns a *TopoDS_Shape* object:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Shape aMirroredShape = aBRepTrsf.Shape();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
What you need is a method to consider the resulting reflected shape as a wire. The *TopoDS* global functions provide this kind of service by casting a shape into its real type. To cast the transformed wire, use the *TopoDS::Wire* method.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Wire aMirroredWire = TopoDS::Wire(aMirroredShape);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The bottle's profile is almost finished. You have created two wires: *aWire* and *aMirroredWire*. You need to concatenate them to compute a single shape. To do this, you use the *BRepBuilderAPI_MakeWire* class as follows:
|
||||
|
||||
* create an instance of *BRepBuilderAPI_MakeWire*.
|
||||
* add all edges of the two wires by using the *Add* method on this object.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
BRepBuilderAPI_MakeWire mkWire;
|
||||
mkWire.Add(aWire);
|
||||
mkWire.Add(aMirroredWire);
|
||||
TopoDS_Wire myWireProfile = mkWire.Wire();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@section sec3 Building the Body
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB3_1 Prism the Profile
|
||||
|
||||
|
||||
To compute the main body of the bottle, you need to create a solid shape. The simplest way is to use the previously created profile and to sweep it along a direction. The *Prism* functionality of Open CASCADE Technology is the most appropriate for that task. It accepts a shape and a direction as input and generates a new shape according to the following rules:
|
||||
|
||||
| Shape | Generates |
|
||||
| :----- | :----------------- |
|
||||
| Vertex | Edge |
|
||||
| Edge | Face |
|
||||
| Wire | Shell |
|
||||
| Face | Solid |
|
||||
| Shell | Compound of Solids |
|
||||
|
||||

|
||||
|
||||
Your current profile is a wire. Referring to the Shape/Generates table, you need to compute a face out of its wire to generate a solid.
|
||||
To create a face, use the *BRepBuilderAPI_MakeFace* class. As previously explained, a face is a part of a surface bounded by a closed wire. Generally, *BRepBuilderAPI_MakeFace* computes a face out of a surface and one or more wires.
|
||||
When the wire lies on a plane, the surface is automatically computed.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The *BRepPrimAPI* package provides all the classes to create topological primitive constructions: boxes, cones, cylinders, spheres, etc. Among them is the *BRepPrimAPI_MakePrism* class. As specified above, the prism is defined by:
|
||||
|
||||
* the basis shape to sweep;
|
||||
* a vector for a finite prism or a direction for finite and infinite prisms.
|
||||
|
||||
You want the solid to be finite, swept along the Z axis and to be myHeight height. The vector, defined with the *gp_Vec* class on its X, Y and Z coordinates, is:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
gp_Vec aPrismVec(0, 0, myHeight);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
All the necessary data to create the main body of your bottle is now available. Just apply the *BRepPrimAPI_MakePrism* class to compute the solid:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile, aPrismVec);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB3_2 Applying Fillets
|
||||
|
||||
|
||||
The edges of the bottle's body are very sharp. To replace them by rounded faces, you use the *Fillet* functionality of Open CASCADE Technology.
|
||||
For our purposes, we will specify that fillets must be:
|
||||
|
||||
* applied on all edges of the shape
|
||||
* have a radius of *myThickness* / 12
|
||||
|
||||

|
||||
|
||||
To apply fillets on the edges of a shape, you use the *BRepFilletAPI_MakeFillet* class. This class is normally used as follows:
|
||||
|
||||
* Specify the shape to be filleted in the *BRepFilletAPI_MakeFillet* constructor.
|
||||
* Add the fillet descriptions (an edge and a radius) using the *Add* method (you can add as many edges as you need).
|
||||
* Ask for the resulting filleted shape with the *Shape* method.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
BRepFilletAPI_MakeFillet mkFillet(myBody);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To add the fillet description, you need to know the edges belonging to your shape. The best solution is to explore your solid to retrieve its edges. This kind of functionality is provided with the *TopExp_Explorer* class, which explores the data structure described in a *TopoDS_Shape* and extracts the sub-shapes you specifically need.
|
||||
Generally, this explorer is created by providing the following information:
|
||||
|
||||
* the shape to explore
|
||||
* the type of sub-shapes to be found. This information is given with the *TopAbs_ShapeEnum* enumeration.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopExp_Explorer anEdgeExplorer(myBody, TopAbs_EDGE);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
An explorer is usually applied in a loop by using its three main methods:
|
||||
|
||||
* *More()* to know if there are more sub-shapes to explore.
|
||||
* *Current()* to know which is the currently explored sub-shape (used only if the *More()* method returns true).
|
||||
* *Next()* to move onto the next sub-shape to explore.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
while(anEdgeExplorer.More()){
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExplorer.Current());
|
||||
//Add edge to fillet algorithm
|
||||
...
|
||||
anEdgeExplorer.Next();
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In the explorer loop, you have found all the edges of the bottle shape. Each one must then be added in the *BRepFilletAPI_MakeFillet* instance with the *Add()* method. Do not forget to specify the radius of the fillet along with it.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
mkFillet.Add(myThickness / 12., anEdge);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Once this is done, you perform the last step of the procedure by asking for the filleted shape.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
myBody = mkFillet.Shape();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB3_3 Adding the Neck
|
||||
|
||||
|
||||
To add a neck to the bottle, you will create a cylinder and fuse it to the body. The cylinder is to be positioned on the top face of the body with a radius of *myThickness* / 4. and a height of *myHeight* / 10.
|
||||
|
||||

|
||||
|
||||
To position the cylinder, you need to define a coordinate system with the *gp_Ax2* class defining a right-handed coordinate system from a point and two directions - the main (Z) axis direction and the X direction (the Y direction is computed from these two).
|
||||
To align the neck with the center of the top face, being in the global coordinate system (0, 0, *myHeight*), with its normal on the global Z axis, your local coordinate system can be defined as follows:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
gp_Pnt neckLocation(0, 0, myHeight);
|
||||
gp_Dir neckAxis = gp::DZ();
|
||||
gp_Ax2 neckAx2(neckLocation, neckAxis);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To create a cylinder, use another class from the primitives construction package: the *BRepPrimAPI_MakeCylinder* class. The information you must provide is:
|
||||
|
||||
* the coordinate system where the cylinder will be located;
|
||||
* the radius and height.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
Standard_Real myNeckRadius = myThickness / 4.;
|
||||
Standard_Real myNeckHeight = myHeight / 10;
|
||||
BRepPrimAPI_MakeCylinder MKCylinder(neckAx2, myNeckRadius, myNeckHeight);
|
||||
TopoDS_Shape myNeck = MKCylinder.Shape();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You now have two separate parts: a main body and a neck that you need to fuse together.
|
||||
The *BRepAlgoAPI* package provides services to perform Boolean operations between shapes, and especially: *common* (Boolean intersection), *cut* (Boolean subtraction) and *fuse* (Boolean union).
|
||||
Use *BRepAlgoAPI_Fuse* to fuse the two shapes:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
myBody = BRepAlgoAPI_Fuse(myBody, myNeck);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB3_4 Creating a Hollowed Solid
|
||||
|
||||
|
||||
Since a real bottle is used to contain liquid material, you should now create a hollowed solid from the bottle's top face.
|
||||
In Open CASCADE Technology, a hollowed solid is called a *Thick* *Solid* and is internally computed as follows:
|
||||
|
||||
* Remove one or more faces from the initial solid to obtain the first wall W1 of the hollowed solid.
|
||||
* Create a parallel wall W2 from W1 at a distance D. If D is positive, W2 will be outside the initial solid, otherwise it will be inside.
|
||||
* Compute a solid from the two walls W1 and W2.
|
||||
|
||||

|
||||
|
||||
To compute a thick solid, you create an instance of the *BRepOffsetAPI_MakeThickSolid* class by giving the following information:
|
||||
|
||||
* The shape, which must be hollowed.
|
||||
* The tolerance used for the computation (tolerance criterion for coincidence in generated shapes).
|
||||
* The thickness between the two walls W1 and W2 (distance D).
|
||||
* The face(s) to be removed from the original solid to compute the first wall W1.
|
||||
|
||||
The challenging part in this procedure is to find the face to remove from your shape - the top face of the neck, which:
|
||||
|
||||
* has a plane (planar surface) as underlying geometry;
|
||||
* is the highest face (in Z coordinates) of the bottle.
|
||||
|
||||
To find the face with such characteristics, you will once again use an explorer to iterate on all the bottle's faces to find the appropriate one.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
for(TopExp_Explorer aFaceExplorer(myBody, TopAbs_FACE) ; aFaceExplorer.More() ; aFaceExplorer.Next()){
|
||||
TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current());
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
For each detected face, you need to access the geometric properties of the shape: use the *BRep_Tool* class for that. The most commonly used methods of this class are:
|
||||
|
||||
* *Surface* to access the surface of a face;
|
||||
* *Curve* to access the 3D curve of an edge;
|
||||
* *Point* to access the 3D point of a vertex.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
As you can see, the *BRep_Tool::Surface* method returns an instance of the *Geom_Surface* class manipulated by handle. However, the *Geom_Surface* class does not provide information about the real type of the object *aSurface*, which could be an instance of *Geom_Plane*, *Geom_CylindricalSurface*, etc.
|
||||
All objects manipulated by handle, like *Geom_Surface*, inherit from the *Standard_Transient* class which provides two very useful methods concerning types:
|
||||
|
||||
* *DynamicType* to know the real type of the object
|
||||
* *IsKind* to know if the object inherits from one particular type
|
||||
|
||||
DynamicType returns the real type of the object, but you need to compare it with the existing known types to determine whether *aSurface* is a plane, a cylindrical surface or some other type.
|
||||
To compare a given type with the type you seek, use the *STANDARD_TYPE* macro, which returns the type of a class:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
|
||||
//
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If this comparison is true, you know that the *aSurface* real type is *Geom_Plane*. You can then convert it from *Geom_Surface* to *Geom_Plane* by using the *DownCast()* method provided by each class inheriting *Standard_Transient*. As its name implies, this static method is used to downcast objects to a given type with the following syntax:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurface);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Remember that the goal of all these conversions is to find the highest face of the bottle lying on a plane. Suppose that you have these two global variables:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Face faceToRemove;
|
||||
Standard_Real zMax = -1;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You can easily find the plane whose origin is the biggest in Z knowing that the location of the plane is given with the *Geom_Plane::Location* method. For example:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
gp_Pnt aPnt = aPlane->Location();
|
||||
Standard_Real aZ = aPnt.Z();
|
||||
if(aZ > zMax){
|
||||
zMax = aZ;
|
||||
faceToRemove = aFace;
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You have now found the top face of the neck. Your final step before creating the hollowed solid is to put this face in a list. Since more than one face can be removed from the initial solid, the *BRepOffsetAPI_MakeThickSolid* constructor takes a list of faces as arguments.
|
||||
Open CASCADE Technology provides many collections for different kinds of objects: see *TColGeom* package for collections of objects from *Geom* package, *TColgp* package for collections of objects from gp package, etc.
|
||||
The collection for shapes can be found in the *TopTools* package. As *BRepOffsetAPI_MakeThickSolid* requires a list, use the *TopTools_ListOfShape* class.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopTools_ListOfShape facesToRemove;
|
||||
facesToRemove.Append(faceToRemove);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
All the necessary data are now available so you can create your hollowed solid by calling the *BRepOffsetAPI_MakeThickSolid* constructor:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
MyBody = BRepOffsetAPI_MakeThickSolid(myBody, facesToRemove, -myThickness / 50, 1.e-3);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@section sec4 Building the Threading
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB4_1 Creating Surfaces
|
||||
|
||||
|
||||
Up to now, you have learned how to create edges out of 3D curves.
|
||||
You will now learn how to create an edge out of a 2D curve and a surface.
|
||||
To learn this aspect of Open CASCADE Technology, you will build helicoidal profiles out of 2D curves on cylindrical surfaces. The theory is more complex than in previous steps, but applying it is very simple.
|
||||
As a first step, you compute these cylindrical surfaces. You are already familiar with curves of the *Geom* package. Now you can create a cylindrical surface (*Geom_CylindricalSurface*) using:
|
||||
|
||||
* a coordinate system;
|
||||
* a radius.
|
||||
|
||||
Using the same coordinate system *neckAx2* used to position the neck, you create two cylindrical surfaces *Geom_CylindricalSurface* with the following radii:
|
||||
|
||||

|
||||
|
||||
Notice that one of the cylindrical surfaces is smaller than the neck. There is a good reason for this: after the thread creation, you will fuse it with the neck. So, we must make sure that the two shapes remain in contact.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99);
|
||||
|
||||
Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB4_2 Defining 2D Curves
|
||||
|
||||
|
||||
To create the neck of the bottle, you made a solid cylinder based on a cylindrical surface. You will create the profile of threading by creating 2D curves on such a surface.
|
||||
All geometries defined in the *Geom* package are parameterized. This means that each curve or surface from Geom is computed with a parametric equation.
|
||||
A *Geom_CylindricalSurface* surface is defined with the following parametric equation:
|
||||
|
||||
P(U, V) = O + R * (cos(U) * xDir + sin(U) * yDir) + V * zDir, where :
|
||||
|
||||
* P is the point defined by parameters (U, V).
|
||||
* O, *Dir, yDir and zDir are respectively the origin, the X direction, Y direction and Z direction of the cylindrical surface local coordinate system.
|
||||
* R is the radius of the cylindrical surface.
|
||||
* U range is [0, 2PI] and V is infinite.
|
||||
|
||||

|
||||
|
||||
The advantage of having such parameterized geometries is that you can compute, for any (U, V) parameters of the surface:
|
||||
|
||||
* the 3D point;
|
||||
* the derivative vectors of order 1, 2 to N at this point.
|
||||
|
||||
There is another advantage of these parametric equations: you can consider a surface as a 2D parametric space defined with a (U, V) coordinate system. For example, consider the parametric ranges of the neck's surface:
|
||||
|
||||

|
||||
|
||||
Suppose that you create a 2D line on this parametric (U, V) space and compute its 3D parametric curve. Depending on the line definition, results are as follows:
|
||||
|
||||
| Case | Parametric Equation | Parametric Curve |
|
||||
| :------------ | :----------------------------------------------------------- | :---------------------------------------------------------------------------- |
|
||||
| U = 0 | P(V) = O + V * zDir | Line parallel to the Z direction |
|
||||
| V = 0 | P(U) = O + R * (cos(U) * xDir + sin(U) * yDir) | Circle parallel to the (O, X, Y) plane |
|
||||
| U != 0 V != 0 | P(U, V) = O + R * (cos(U) * xDir + sin(U) * yDir) + V * zDir | Helicoidal curve describing the evolution of height and angle on the cylinder |
|
||||
|
||||
The helicoidal curve type is exactly what you need. On the neck's surface, the evolution laws of this curve will be:
|
||||
|
||||
* In V parameter: between 0 and myHeighNeck for the height description
|
||||
* In U parameter: between 0 and 2PI for the angle description. But, since a cylindrical surface is U periodic, you can decide to extend this angle evolution to 4PI as shown in the following drawing:
|
||||
|
||||

|
||||
|
||||
In this (U, V) parametric space, you will create a local (X, Y) coordinate system to position the curves to be created. This coordinate system will be defined with:
|
||||
|
||||
* A center located in the middle of the neck's cylinder parametric space at (2*PI, myNeckHeight / 2) in U, V coordinates.
|
||||
* A X direction defined with the (2*PI, myNeckHeight/4) vector in U, V coordinates, so that the curves occupy half of the neck's surfaces.
|
||||
|
||||

|
||||
|
||||
To use 2D primitive geometry types of Open CASCADE Technology for defining a point and a coordinate system, you will once again instantiate classes from gp:
|
||||
|
||||
* To define a 2D point from its X and Y coordinates, use the *gp_Pnt2d* class.
|
||||
* To define a 2D direction (unit vector) from its X and Y coordinates, use the gp_Dir2d class. The coordinates will automatically be normalized.
|
||||
* To define a 2D right-handed coordinate system, use the *gp_Ax2d* class, which is computed from a point (origin of the coordinate system) and a direction - the X direction of the coordinate system. The Y direction will be automatically computed.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
gp_Pnt2d aPnt(2. * M_PI, myNeckHeight / 2.);
|
||||
gp_Dir2d aDir(2. * M_PI, myNeckHeight / 4.);
|
||||
gp_Ax2d anAx2d(aPnt, aDir);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
You will now define the curves. As previously mentioned, these thread profiles are computed on two cylindrical surfaces. In the following figure, curves on the left define the base (on *aCyl1* surface) and the curves on the right define the top of the thread's shape (on *aCyl2* surface).
|
||||
|
||||

|
||||
|
||||
You have already used the *Geom* package to define 3D geometric entities. For 2D, you will use the *Geom2d* package. As for *Geom*, all geometries are parameterized. For example, a *Geom2d_Ellipse* ellipse is defined from:
|
||||
|
||||
* a coordinate system whose origin is the ellipse center;
|
||||
* a major radius on the major axis defined by the X direction of the coordinate system;
|
||||
* a minor radius on the minor axis defined by the Y direction of the coordinate system.
|
||||
|
||||
Supposing that:
|
||||
|
||||
* Both ellipses have the same major radius of 2*PI,
|
||||
* Minor radius of the first ellipse is myNeckHeight / 10,
|
||||
* And the minor radius value of the second ellipse is a fourth of the first one,
|
||||
|
||||
Your ellipses are defined as follows:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
Standard_Real aMajor = 2. * M_PI;
|
||||
Standard_Real aMinor = myNeckHeight / 10;
|
||||
Handle(Geom2d_Ellipse) anEllipse1 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor);
|
||||
Handle(Geom2d_Ellipse) anEllipse2 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor / 4);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To describe portions of curves for the arcs drawn above, you define *Geom2d_TrimmedCurve* trimmed curves out of the created ellipses and two parameters to limit them.
|
||||
As the parametric equation of an ellipse is P(U) = O + (MajorRadius * cos(U) * XDirection) + (MinorRadius * sin(U) * YDirection), the ellipses need to be limited between 0 and M_PI.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
Handle(Geom2d_TrimmedCurve) anArc1 = new Geom2d_TrimmedCurve(anEllipse1, 0, M_PI);
|
||||
Handle(Geom2d_TrimmedCurve) anArc2 = new Geom2d_TrimmedCurve(anEllipse2, 0, M_PI);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The last step consists in defining the segment, which is the same for the two profiles: a line limited by the first and the last point of one of the arcs.
|
||||
To access the point corresponding to the parameter of a curve or a surface, you use the Value or D0 method (meaning 0th derivative), D1 method is for first derivative, D2 for the second one.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0);
|
||||
gp_Pnt2d anEllipsePnt2;
|
||||
anEllipse1->D0(M_PI, anEllipsePnt2);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
When creating the bottle's profile, you used classes from the *GC* package, providing algorithms to create elementary geometries.
|
||||
In 2D geometry, this kind of algorithms is found in the *GCE2d* package. Class names and behaviors are similar to those in *GC*. For example, to create a 2D segment out of two points:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(anEllipsePnt1, anEllipsePnt2);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB4_3 Building Edges and Wires
|
||||
|
||||
|
||||
As you did when creating the base profile of the bottle, you can now:
|
||||
|
||||
* compute the edges of the neck's threading.
|
||||
* compute two wires out of these edges.
|
||||
|
||||

|
||||
|
||||
Previously, you have built:
|
||||
|
||||
* two cylindrical surfaces of the threading
|
||||
* three 2D curves defining the base geometry of the threading
|
||||
|
||||
To compute the edges out of these curves, once again use the *BRepBuilderAPI_MakeEdge* class. One of its constructors allows you to build an edge out of a curve described in the 2D parametric space of a surface.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Edge anEdge1OnSurf1 = BRepBuilderAPI_MakeEdge(anArc1, aCyl1);
|
||||
TopoDS_Edge anEdge2OnSurf1 = BRepBuilderAPI_MakeEdge(aSegment, aCyl1);
|
||||
TopoDS_Edge anEdge1OnSurf2 = BRepBuilderAPI_MakeEdge(anArc2, aCyl2);
|
||||
TopoDS_Edge anEdge2OnSurf2 = BRepBuilderAPI_MakeEdge(aSegment, aCyl2);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Now, you can create the two profiles of the threading, lying on each surface.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Wire threadingWire1 = BRepBuilderAPI_MakeWire(anEdge1OnSurf1, anEdge2OnSurf1);
|
||||
TopoDS_Wire threadingWire2 = BRepBuilderAPI_MakeWire(anEdge1OnSurf2, anEdge2OnSurf2);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Remember that these wires were built out of a surface and 2D curves.
|
||||
One important data item is missing as far as these wires are concerned: there is no information on the 3D curves. Fortunately, you do not need to compute this yourself, which can be a difficult task since the mathematics can be quite complex.
|
||||
When a shape contains all the necessary information except 3D curves, Open CASCADE Technology provides a tool to build them automatically. In the BRepLib tool package, you can use the *BuildCurves3d* method to compute 3D curves for all the edges of a shape.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
BRepLib::BuildCurves3d(threadingWire1);
|
||||
BRepLib::BuildCurves3d(threadingWire2);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@subsection OCCT_TUTORIAL_SUB4_4 Creating Threading
|
||||
|
||||
|
||||
You have computed the wires of the threading. The threading will be a solid shape, so you must now compute the faces of the wires, the faces allowing you to join the wires, the shell out of these faces and then the solid itself. This can be a lengthy operation.
|
||||
There are always faster ways to build a solid when the base topology is defined. You would like to create a solid out of two wires. Open CASCADE Technology provides a quick way to do this by building a loft: a shell or a solid passing through a set of wires in a given sequence.
|
||||
The loft function is implemented in the *BRepOffsetAPI_ThruSections* class, which you use as follows:
|
||||
|
||||

|
||||
|
||||
* Initialize the algorithm by creating an instance of the class. The first parameter of this constructor must be specified if you want to create a solid. By default, *BRepOffsetAPI_ThruSections* builds a shell.
|
||||
* Add the successive wires using the AddWire method.
|
||||
* Use the *CheckCompatibility* method to activate (or deactivate) the option that checks whether the wires have the same number of edges. In this case, wires have two edges each, so you can deactivate this option.
|
||||
* Ask for the resulting loft shape with the Shape method.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
BRepOffsetAPI_ThruSections aTool(Standard_True);
|
||||
aTool.AddWire(threadingWire1); aTool.AddWire(threadingWire2);
|
||||
aTool.CheckCompatibility(Standard_False);
|
||||
TopoDS_Shape myThreading = aTool.Shape();
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@section sec5 Building the Resulting Compound
|
||||
|
||||
|
||||
You are almost done building the bottle. Use the *TopoDS_Compound* and *BRep_Builder* classes to build single shape from *myBody* and *myThreading*:
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Compound aRes;
|
||||
BRep_Builder aBuilder;
|
||||
aBuilder.MakeCompound (aRes);
|
||||
aBuilder.Add (aRes, myBody);
|
||||
aBuilder.Add (aRes, myThreading);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Congratulations! Your bottle is complete. Here is the result snapshot of the Tutorial application:
|
||||
|
||||

|
||||
|
||||
We hope that this tutorial has provided you with a feel for the industrial strength power of Open CASCADE Technology.
|
||||
If you want to know more and develop major projects using Open CASCADE Technology, we invite you to study our training, support, and consulting services on our site at http://www.opencascade.org/support. Our professional services can maximize the power of your Open CASCADE Technology applications.
|
||||
|
||||
|
||||
@section sec6 Appendix
|
||||
|
||||
|
||||
Complete definition of MakeBottle function (defined in the file src/MakeBottle.cxx of the Tutorial):
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
TopoDS_Shape MakeBottle(const Standard_Real myWidth, const Standard_Real myHeight,
|
||||
const Standard_Real myThickness)
|
||||
{
|
||||
// Profile : Define Support Points
|
||||
gp_Pnt aPnt1(-myWidth / 2., 0, 0);
|
||||
gp_Pnt aPnt2(-myWidth / 2., -myThickness / 4., 0);
|
||||
gp_Pnt aPnt3(0, -myThickness / 2., 0);
|
||||
gp_Pnt aPnt4(myWidth / 2., -myThickness / 4., 0);
|
||||
gp_Pnt aPnt5(myWidth / 2., 0, 0);
|
||||
|
||||
// Profile : Define the Geometry
|
||||
Handle(Geom_TrimmedCurve) anArcOfCircle = GC_MakeArcOfCircle(aPnt2,aPnt3,aPnt4);
|
||||
Handle(Geom_TrimmedCurve) aSegment1 = GC_MakeSegment(aPnt1, aPnt2);
|
||||
Handle(Geom_TrimmedCurve) aSegment2 = GC_MakeSegment(aPnt4, aPnt5);
|
||||
|
||||
// Profile : Define the Topology
|
||||
TopoDS_Edge anEdge1 = BRepBuilderAPI_MakeEdge(aSegment1);
|
||||
TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(anArcOfCircle);
|
||||
TopoDS_Edge anEdge3 = BRepBuilderAPI_MakeEdge(aSegment2);
|
||||
TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge1, anEdge2, anEdge3);
|
||||
|
||||
// Complete Profile
|
||||
gp_Ax1 xAxis = gp::OX();
|
||||
gp_Trsf aTrsf;
|
||||
|
||||
aTrsf.SetMirror(xAxis);
|
||||
BRepBuilderAPI_Transform aBRepTrsf(aWire, aTrsf);
|
||||
TopoDS_Shape aMirroredShape = aBRepTrsf.Shape();
|
||||
TopoDS_Wire aMirroredWire = TopoDS::Wire(aMirroredShape);
|
||||
|
||||
BRepBuilderAPI_MakeWire mkWire;
|
||||
mkWire.Add(aWire);
|
||||
mkWire.Add(aMirroredWire);
|
||||
TopoDS_Wire myWireProfile = mkWire.Wire();
|
||||
|
||||
// Body : Prism the Profile
|
||||
TopoDS_Face myFaceProfile = BRepBuilderAPI_MakeFace(myWireProfile);
|
||||
gp_Vec aPrismVec(0, 0, myHeight);
|
||||
TopoDS_Shape myBody = BRepPrimAPI_MakePrism(myFaceProfile, aPrismVec);
|
||||
|
||||
// Body : Apply Fillets
|
||||
BRepFilletAPI_MakeFillet mkFillet(myBody);
|
||||
TopExp_Explorer anEdgeExplorer(myBody, TopAbs_EDGE);
|
||||
while(anEdgeExplorer.More()){
|
||||
TopoDS_Edge anEdge = TopoDS::Edge(anEdgeExplorer.Current());
|
||||
//Add edge to fillet algorithm
|
||||
mkFillet.Add(myThickness / 12., anEdge);
|
||||
anEdgeExplorer.Next();
|
||||
}
|
||||
|
||||
myBody = mkFillet.Shape();
|
||||
|
||||
// Body : Add the Neck
|
||||
gp_Pnt neckLocation(0, 0, myHeight);
|
||||
gp_Dir neckAxis = gp::DZ();
|
||||
gp_Ax2 neckAx2(neckLocation, neckAxis);
|
||||
|
||||
Standard_Real myNeckRadius = myThickness / 4.;
|
||||
Standard_Real myNeckHeight = myHeight / 10.;
|
||||
|
||||
BRepPrimAPI_MakeCylinder MKCylinder(neckAx2, myNeckRadius, myNeckHeight);
|
||||
TopoDS_Shape myNeck = MKCylinder.Shape();
|
||||
|
||||
myBody = BRepAlgoAPI_Fuse(myBody, myNeck);
|
||||
|
||||
// Body : Create a Hollowed Solid
|
||||
TopoDS_Face faceToRemove;
|
||||
Standard_Real zMax = -1;
|
||||
|
||||
for(TopExp_Explorer aFaceExplorer(myBody, TopAbs_FACE); aFaceExplorer.More(); aFaceExplorer.Next()){
|
||||
TopoDS_Face aFace = TopoDS::Face(aFaceExplorer.Current());
|
||||
// Check if <aFace> is the top face of the bottle's neck
|
||||
Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);
|
||||
if(aSurface->DynamicType() == STANDARD_TYPE(Geom_Plane)){
|
||||
Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aSurface);
|
||||
gp_Pnt aPnt = aPlane->Location();
|
||||
Standard_Real aZ = aPnt.Z();
|
||||
if(aZ > zMax){
|
||||
zMax = aZ;
|
||||
faceToRemove = aFace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TopTools_ListOfShape facesToRemove;
|
||||
facesToRemove.Append(faceToRemove);
|
||||
myBody = BRepOffsetAPI_MakeThickSolid(myBody, facesToRemove, -myThickness / 50, 1.e-3);
|
||||
// Threading : Create Surfaces
|
||||
Handle(Geom_CylindricalSurface) aCyl1 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 0.99);
|
||||
Handle(Geom_CylindricalSurface) aCyl2 = new Geom_CylindricalSurface(neckAx2, myNeckRadius * 1.05);
|
||||
|
||||
// Threading : Define 2D Curves
|
||||
gp_Pnt2d aPnt(2. * M_PI, myNeckHeight / 2.);
|
||||
gp_Dir2d aDir(2. * M_PI, myNeckHeight / 4.);
|
||||
gp_Ax2d anAx2d(aPnt, aDir);
|
||||
|
||||
Standard_Real aMajor = 2. * M_PI;
|
||||
Standard_Real aMinor = myNeckHeight / 10;
|
||||
|
||||
Handle(Geom2d_Ellipse) anEllipse1 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor);
|
||||
Handle(Geom2d_Ellipse) anEllipse2 = new Geom2d_Ellipse(anAx2d, aMajor, aMinor / 4);
|
||||
Handle(Geom2d_TrimmedCurve) anArc1 = new Geom2d_TrimmedCurve(anEllipse1, 0, M_PI);
|
||||
Handle(Geom2d_TrimmedCurve) anArc2 = new Geom2d_TrimmedCurve(anEllipse2, 0, M_PI);
|
||||
gp_Pnt2d anEllipsePnt1 = anEllipse1->Value(0);
|
||||
gp_Pnt2d anEllipsePnt2 = anEllipse1->Value(M_PI);
|
||||
|
||||
Handle(Geom2d_TrimmedCurve) aSegment = GCE2d_MakeSegment(anEllipsePnt1, anEllipsePnt2);
|
||||
// Threading : Build Edges and Wires
|
||||
TopoDS_Edge anEdge1OnSurf1 = BRepBuilderAPI_MakeEdge(anArc1, aCyl1);
|
||||
TopoDS_Edge anEdge2OnSurf1 = BRepBuilderAPI_MakeEdge(aSegment, aCyl1);
|
||||
TopoDS_Edge anEdge1OnSurf2 = BRepBuilderAPI_MakeEdge(anArc2, aCyl2);
|
||||
TopoDS_Edge anEdge2OnSurf2 = BRepBuilderAPI_MakeEdge(aSegment, aCyl2);
|
||||
TopoDS_Wire threadingWire1 = BRepBuilderAPI_MakeWire(anEdge1OnSurf1, anEdge2OnSurf1);
|
||||
TopoDS_Wire threadingWire2 = BRepBuilderAPI_MakeWire(anEdge1OnSurf2, anEdge2OnSurf2);
|
||||
BRepLib::BuildCurves3d(threadingWire1);
|
||||
BRepLib::BuildCurves3d(threadingWire2);
|
||||
|
||||
// Create Threading
|
||||
BRepOffsetAPI_ThruSections aTool(Standard_True);
|
||||
aTool.AddWire(threadingWire1);
|
||||
aTool.AddWire(threadingWire2);
|
||||
aTool.CheckCompatibility(Standard_False);
|
||||
|
||||
TopoDS_Shape myThreading = aTool.Shape();
|
||||
|
||||
// Building the Resulting Compound
|
||||
TopoDS_Compound aRes;
|
||||
BRep_Builder aBuilder;
|
||||
aBuilder.MakeCompound (aRes);
|
||||
aBuilder.Add (aRes, myBody);
|
||||
aBuilder.Add (aRes, myThreading);
|
||||
|
||||
return aRes;
|
||||
}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
BIN
dox/resources/occt_logo.png
Normal file
After ![]() (image error) Size: 17 KiB |
5
dox/start.tcl
Normal file
@ -0,0 +1,5 @@
|
||||
# Command-line starter for occdoc command, use it as follows:
|
||||
# tclsh> source dox/start.tcl [arguments]
|
||||
|
||||
source [file join [file dirname [info script]] occdoc.tcl]
|
||||
occdoc {*}$argv
|
BIN
dox/technical_overview/images/technical_overview_over.png
Normal file
After ![]() (image error) Size: 9.5 KiB |
3017
dox/technical_overview/technical_overview.md
Normal file
7457
dox/user_guides/draw_test_harness/draw_test_harness.md
Normal file
After ![]() (image error) Size: 6.7 KiB |
After ![]() (image error) Size: 3.5 KiB |
1877
dox/user_guides/foundation_classes/foundation_classes.md
Normal file
After ![]() (image error) Size: 6.7 KiB |
After ![]() (image error) Size: 3.5 KiB |
After ![]() (image error) Size: 50 KiB |
After ![]() (image error) Size: 16 KiB |
After ![]() (image error) Size: 19 KiB |
After ![]() (image error) Size: 21 KiB |
After ![]() (image error) Size: 40 KiB |
After ![]() (image error) Size: 47 KiB |
1560
dox/user_guides/iges/iges.md
Normal file
BIN
dox/user_guides/iges/images/iges_image001.jpg
Normal file
After ![]() (image error) Size: 6.7 KiB |
BIN
dox/user_guides/iges/images/iges_image002.jpg
Normal file
After ![]() (image error) Size: 3.5 KiB |
BIN
dox/user_guides/iges/images/iges_image003.jpg
Normal file
After ![]() (image error) Size: 21 KiB |
BIN
dox/user_guides/iges/images/iges_image004.jpg
Normal file
After ![]() (image error) Size: 26 KiB |
After ![]() (image error) Size: 6.7 KiB |
After ![]() (image error) Size: 3.5 KiB |
After ![]() (image error) Size: 15 KiB |
After ![]() (image error) Size: 13 KiB |
After ![]() (image error) Size: 12 KiB |
After ![]() (image error) Size: 5.6 KiB |
After ![]() (image error) Size: 7.9 KiB |
After ![]() (image error) Size: 6.2 KiB |
After ![]() (image error) Size: 6.2 KiB |
After ![]() (image error) Size: 6.0 KiB |
After ![]() (image error) Size: 7.5 KiB |
After ![]() (image error) Size: 7.1 KiB |
After ![]() (image error) Size: 11 KiB |
After ![]() (image error) Size: 8.3 KiB |
After ![]() (image error) Size: 8.2 KiB |
After ![]() (image error) Size: 10 KiB |
After ![]() (image error) Size: 9.1 KiB |