1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0032340: OCCT Documentation - highlight C++ code snippets

Added {.cpp} highlighting markers to the C++ code blocks in documentation;
Excessive tildes "~~~~~~~" in code block borders are reduced to required minimum of "~~~~" (4);
Removed obsolete space bars after code block borders;
TCL code blocks are now highlighted with {.php} markers;
Removed excessive {.cpp} highlighting markers appended to non-code blocks such as lists, reports and file content or structure examples;
Minor fixes for tests.md and draw_test_harness.md (whitespace removal and structural fix for "Where:" in code examples);
Minimum HDD space for OCCT updated in introduction.md.
This commit is contained in:
btokarev
2021-05-18 13:09:50 +03:00
committed by bugmaster
parent 4d67a36952
commit 77d94fd174
25 changed files with 4576 additions and 4571 deletions

View File

@@ -811,7 +811,7 @@ The following example illustrates how to use the GF algorithm:
#### Usage of the GF algorithm on C++ level
~~~~
~~~~{.cpp}
BOPAlgo_Builder aBuilder;
// Setting arguments
TopTools_ListOfShape aLSObjects = …; // Objects
@@ -865,7 +865,7 @@ const TopoDS_Shape& aResult = aBuilder.Shape();
#### Usage of the GF algorithm on Tcl level
~~~~
~~~~{.cpp}
# prepare the arguments
box b1 10 10 10
box b2 3 4 5 10 10 10
@@ -1199,7 +1199,7 @@ It is based on the General Fuse algorithm, thus all options of the General Fuse
@subsubsection specification__boolean_8_3_1 API
On the low level the Splitter algorithm is implemented in class *BOPAlgo_Splitter*. The usage of this algorithm looks as follows:
~~~~~
~~~~{.cpp}
BOPAlgo_Splitter aSplitter;
// Setting arguments and tools
TopTools_ListOfShape aLSObjects = …; // Objects
@@ -1218,12 +1218,12 @@ if (aSplitter.HasErrors()) { //check error status
}
//
const TopoDS_Shape& aResult = aSplitter.Shape(); // result of the operation
~~~~~
~~~~
@subsubsection specification__boolean_8_3_2 DRAW
The command *bsplit* implements the Splitter algorithm in DRAW. Similarly to the *bbuild* command for the General Fuse algorithm, the *bsplit* command should be used after the Pave Filler is filled.
~~~~~
~~~~{.cpp}
# s1 s2 s3 - objects
# t1 t2 t3 - tools
bclearobjects
@@ -1232,7 +1232,7 @@ baddobjects s1 s2 s3
baddtools t1 t2 t3
bfillds
bsplit result
~~~~~
~~~~
@subsection specification__boolean_8_4 Examples
@@ -1240,7 +1240,7 @@ bsplit result
Splitting a face by the set of edges:
~~~~
~~~~{.cpp}
# draw script for reproducing
bclearobjects
bcleartools
@@ -1286,7 +1286,7 @@ bsplit result
Splitting a plate by the set of cylinders:
~~~~
~~~~{.cpp}
# draw script for reproducing:
bclearobjects
bcleartools
@@ -2182,7 +2182,7 @@ This option is useful e.g. for building a solid from the faces of one shell or f
#### C++ Level
The usage of the algorithm on the API level:
~~~~
~~~~{.cpp}
BOPAlgo_MakerVolume aMV;
// Set the arguments
TopTools_ListOfShape aLS = …; // arguments
@@ -2206,7 +2206,7 @@ const TopoDS_Shape& aResult = aMV.Shape(); // result of the operation
#### Tcl Level
To use the algorithm in Draw the command mkvolume has been implemented. The usage of this command is following:
~~~~
~~~~{.php}
Usage: mkvolume r b1 b2 ... [-c] [-ni] [-ai]
Options:
-c - use this option to have input compounds considered as set of separate arguments (allows passing multiple arguments as one compound);
@@ -2309,7 +2309,7 @@ aResult = aCBuilder.Shape(); // the result
#### DRAW usage
The following set of new commands has been implemented to run the algorithm in DRAW Test Harness:
~~~~
~~~~{.php}
bcbuild : Initialization of the Cells Builder. Use: *bcbuild r*
bcadd : Add parts to result. Use: *bcadd r s1 (0,1) s2 (0,1) ... [-m material [-u]]*
bcaddall : Add all parts to result. Use: *bcaddall r [-m material [-u]]*
@@ -2320,7 +2320,7 @@ bcmakecontainers : Make containers from the parts added to result. Use: *bcmakec
~~~~
Here is the example of the algorithm use on the DRAW level:
~~~~
~~~~{.php}
psphere s1 15
psphere s2 15
psphere s3 15
@@ -2343,7 +2343,7 @@ bcremoveint res
@subsection specification__boolean_10c_Cells_2 Examples
The following simple example illustrates the possibilities of the algorithm working on a cylinder and a sphere intersected by a plane:
~~~~
~~~~{.php}
pcylinder c 10 30
psphere s 15
ttranslate s 0 0 30
@@ -2353,7 +2353,7 @@ mkface f p -25 30 -17 17
@figure{/specification/boolean_operations/images/cells_algorithm_001.png,"Arguments",160}
~~~~
~~~~{.php}
bclearobjects
bcleartools
baddobjects c s f
@@ -2363,7 +2363,7 @@ bcbuild r
#### 1. Common for all arguments
~~~~
~~~~{.php}
bcremoveall
bcadd res c 1 s 1 f 1
~~~~
@@ -2372,7 +2372,7 @@ bcadd res c 1 s 1 f 1
#### 2. Common between cylinder and face
~~~~
~~~~{.php}
bcremoveall
bcadd res f 1 c 1
~~~~
@@ -2381,7 +2381,7 @@ bcadd res f 1 c 1
#### 3. Common between cylinder and sphere
~~~~
~~~~{.php}
bcremoveall
bcadd res c 1 s 1
~~~~
@@ -2390,7 +2390,7 @@ bcadd res c 1 s 1
#### 4. Fuse of cylinder and sphere
~~~~
~~~~{.php}
bcremoveall
bcadd res c 1 -m 1
bcadd res s 1 -m 1
@@ -2401,7 +2401,7 @@ bcremoveint res
#### 5. Parts of the face inside solids - FUSE(COMMON(f, c), COMMON(f, s))
~~~~
~~~~{.php}
bcremoveall
bcadd res f 1 s 1 -m 1
bcadd res f 1 c 1 -m 1
@@ -2409,7 +2409,7 @@ bcadd res f 1 c 1 -m 1
@figure{/specification/boolean_operations/images/cells_algorithm_006_1.png,"Parts of the face inside solids",160}
~~~~
~~~~{.php}
bcremoveint res
~~~~
@@ -2417,7 +2417,7 @@ bcremoveint res
#### 6. Part of the face outside solids
~~~~
~~~~{.php}
bcremoveall
bcadd res f 1 c 0 s 0
~~~~
@@ -2426,7 +2426,7 @@ bcadd res f 1 c 0 s 0
#### 7. Fuse operation (impossible using standard Boolean Fuse operation)
~~~~
~~~~{.php}
bcremoveall
bcadd res c 1 -m 1
bcadd res s 1 -m 1
@@ -2788,7 +2788,7 @@ For setting the Gluing options in DRAW it is necessary to call the <i>bglue</i>
* 1 - for partial coincidence;
* 2 - for full coincidence
~~~~
~~~~{.php}
bglue 1
~~~~
@@ -2836,7 +2836,7 @@ To enable the safe processing mode for the operation in DRAW, it is necessary to
* 0 - default value, the safe mode is switched off;
* 1 - the safe mode will be switched on.
~~~~
~~~~{.php}
bnondestructive 1
~~~~
@@ -2867,7 +2867,7 @@ To enable/disable the classification of the solids in DRAW, it is necessary to c
* 0 - disabling the classification;
* 1 - default value, enabling the classification.
~~~~
~~~~{.php}
bcheckinverted 0
~~~~
@@ -2893,7 +2893,7 @@ aGF.SetUseOBB(Standard_True);
To enable/disable the usage of OBB in the operation in DRAW it is necessary to call the *buseobb* command with the appropriate value:
* 0 - disabling the usage of OBB;
* 1 - enabling the usage of OBB.
~~~~
~~~~{.php}
buseobb 1
~~~~
@@ -2919,7 +2919,7 @@ Note that messages corresponding to errors and warnings are defined in resource
These messages can be localized; for that put translated version to separate file and load it in the application by call to *Message_MsgFile::Load()* .
Here is the example of how to use this system:
~~~~~
~~~~{.php}
BOPAlgo_PaveFiller aPF;
aPF.SetArguments(...);
aPF.Perform();
@@ -2934,12 +2934,12 @@ if (aPF.HasErrors()) {
}
...
}
~~~~~
~~~~
DRAW commands executing Boolean operations output errors and warnings generated by these operations in textual form.
Additional option allows saving shapes for which warnings have been generated, as DRAW variables.
To activate this option, run command *bdrawwarnshapes* with argument 1 (or with 0 to deactivate):
~~~~
~~~~{.php}
bdrawwarnshapes 1
~~~~
@@ -2978,7 +2978,7 @@ But if the faces are fully coinciding, the result must be empty, and both faces
Example of the overlapping faces:
~~~~
~~~~{.php}
plane p 0 0 0 0 0 1
mkface f1 p -10 10 -10 10
mkface f2 p 0 20 -10 10
@@ -3005,7 +3005,7 @@ Thus, each of the input edges will be Modified into its two splits.
But in the CUT operation on the same edges, the tool edge will be Deleted from the result and, thus, will not have any Modified shapes.
Example of the intersecting edges:
~~~~
~~~~{.php}
line l1 0 0 0 1 0 0
mkedge e1 l1 -10 10
@@ -3051,7 +3051,7 @@ Two intersecting edges will both have the intersection vertices Generated from t
As for the operation with intersecting faces, consider the following example:
~~~~
~~~~{.php}
plane p1 0 0 0 0 0 1
mkface f1 p1 -10 10 -10 10
@@ -3115,7 +3115,7 @@ For controlling this possibility in DRAW the command **bsimplify** has been impl
Here is the simple example of simplification of the result of Fuse operation of two boxes:
~~~~
~~~~{.php}
bsimplify -f 1
box b1 10 10 15
@@ -3173,7 +3173,7 @@ The following example illustrates how to use General Fuse operator:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepAlgoAPI_BuilderAlgo.hxx>
@@ -3205,7 +3205,7 @@ The following example illustrates how to use General Fuse operator:
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
box b1 10 10 10
box b2 3 4 5 10 10 10
@@ -3231,7 +3231,7 @@ The following example illustrates how to use the Splitter operator:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <BRepAlgoAPI_Splitter.hxx>
@@ -3265,7 +3265,7 @@ const TopoDS_Shape& aResult = aSplitter.Shape();
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
# objects
box b1 10 10 10
@@ -3297,7 +3297,7 @@ The following example illustrates how to use Common operation:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include < BRepAlgoAPI_Common.hxx>
@@ -3336,7 +3336,7 @@ The following example illustrates how to use Common operation:
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
box b1 10 10 10
box b2 7 0 4 10 10 10
@@ -3364,7 +3364,7 @@ The following example illustrates how to use Fuse operation:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include < BRepAlgoAPI_Fuse.hxx>
@@ -3403,7 +3403,7 @@ The following example illustrates how to use Fuse operation:
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
box b1 10 10 10
box b2 7 0 4 10 10 10
@@ -3431,7 +3431,7 @@ The following example illustrates how to use Cut operation:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include < BRepAlgoAPI_Cut.hxx>
@@ -3470,7 +3470,7 @@ The following example illustrates how to use Cut operation:
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
box b1 10 10 10
box b2 7 0 4 10 10 10
@@ -3499,7 +3499,7 @@ The following example illustrates how to use Section operation:
#### C++ Level
~~~~
~~~~{.cpp}
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
#include < BRepAlgoAPI_Section.hxx>
@@ -3538,7 +3538,7 @@ The following example illustrates how to use Section operation:
#### Tcl Level
~~~~
~~~~{.php}
# prepare the arguments
box b1 10 10 10
box b2 3 4 5 10 10 10