Compare commits
127 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d64e0bb6ac | ||
|
61e348dab6 | ||
|
e6804ff7c0 | ||
|
1704c57631 | ||
|
47cbf13472 | ||
|
ebc93ae74f | ||
|
df80c6ddda | ||
|
65b88edb4b | ||
|
b56dd33fbd | ||
|
9873027959 | ||
|
679ecdeeac | ||
|
01ca42b2c1 | ||
|
228de226a1 | ||
|
d399d3c36b | ||
|
91b16a64ca | ||
|
5432891550 | ||
|
b4747b2976 | ||
|
785a954097 | ||
|
0d19eb340e | ||
|
fa84b8ffc4 | ||
|
9764ccbb78 | ||
|
7c8090aa6c | ||
|
be8d29f50a | ||
|
63bcc44896 | ||
|
3dfe95cdb9 | ||
|
34db9c0093 | ||
|
2cd138b878 | ||
|
cb389a77e4 | ||
|
519d35d81e | ||
|
db71702d4b | ||
|
971c281b11 | ||
|
3d68eaf52b | ||
|
67335dfc1e | ||
|
f8eb9b179e | ||
|
197ac94e72 | ||
|
e618b52683 | ||
|
d16b64f1ec | ||
|
a942f2da6a | ||
|
decdfc9499 | ||
|
b92f35729a | ||
|
f10da91dab | ||
|
5064550f11 | ||
|
93cb31a607 | ||
|
8e3ebc7a63 | ||
|
f376ac72de | ||
|
d53ae65f65 | ||
|
62684c43f6 | ||
|
d5c3f40613 | ||
|
f8c8ba7a6d | ||
|
938bb74003 | ||
|
bf12f0763e | ||
|
ca2edbb237 | ||
|
89f18cb939 | ||
|
67e1d45b60 | ||
|
bf5b529346 | ||
|
49663e13f0 | ||
|
ca0f3082a0 | ||
|
e8181411e6 | ||
|
d4faf9e945 | ||
|
c5face6f3a | ||
|
cc88c2f65b | ||
|
1d18c75e70 | ||
|
6f31882ada | ||
|
e16f61a62f | ||
|
362dec17cf | ||
|
1896126e35 | ||
|
03e04ead37 | ||
|
6a240ff87d | ||
|
7eb732b683 | ||
|
ecba6de3cc | ||
|
d5f74e42d6 | ||
|
9bd37e127c | ||
|
7075ef95b6 | ||
|
69fd2d1b53 | ||
|
12fc400cf8 | ||
|
45f8c99462 | ||
|
01ee00d90b | ||
|
1b7602c84a | ||
|
02fe718cde | ||
|
c2c2f2b62c | ||
|
8bb96a9760 | ||
|
5495fa7e65 | ||
|
816d03eef3 | ||
|
6b371aa564 | ||
|
f52d1b53c4 | ||
|
af203d549a | ||
|
3b010a7435 | ||
|
8cb69787f2 | ||
|
feb2743f11 | ||
|
97f7a9d875 | ||
|
38e756a1f1 | ||
|
eb77c7dbd2 | ||
|
5291af9fd3 | ||
|
50ba108c2a | ||
|
4abae870a8 | ||
|
dda67c1ca2 | ||
|
eddb9c7c00 | ||
|
00302ba4e7 | ||
|
ec0cdc0e65 | ||
|
5322131bd1 | ||
|
f1a5afa25c | ||
|
124021462e | ||
|
8b1ad7e012 | ||
|
ee7b5544a9 | ||
|
3c946c3825 | ||
|
8a6db25a62 | ||
|
e226a50679 | ||
|
6788f42398 | ||
|
a5deedd07b | ||
|
d77256d181 | ||
|
682c9d0682 | ||
|
51f8f60c7a | ||
|
be7c077ac5 | ||
|
f38896916f | ||
|
a86d3ec04b | ||
|
091232bae7 | ||
|
265d4508bd | ||
|
05d7de534a | ||
|
82e10785dd | ||
|
b5ac8292b0 | ||
|
1190746b3c | ||
|
4d9421a970 | ||
|
545ef510a7 | ||
|
3804f298a1 | ||
|
cb78155f10 | ||
|
73ccc151fd | ||
|
861a7b03e1 |
@@ -69,10 +69,6 @@ else()
|
||||
SET(COMPILER ${CMAKE_GENERATOR})
|
||||
endif()
|
||||
|
||||
if (${COMPILER_BITNESS} STREQUAL 64)
|
||||
add_definitions(-D_OCC64)
|
||||
endif()
|
||||
|
||||
add_definitions(-DCSFDB)
|
||||
if(WIN32)
|
||||
add_definitions(/DWNT -wd4996)
|
||||
@@ -213,6 +209,19 @@ SET(USE_OPENCL OFF CACHE BOOL "whether use OpenCL or not")
|
||||
|
||||
SET(INSTALL_TESTS OFF CACHE BOOL "Is tests copy to install directory")
|
||||
|
||||
MACRO (CHECK_AND_UNSET VARNAME)
|
||||
IF(DEFINED ${VARNAME})
|
||||
UNSET(${VARNAME} CACHE)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
MACRO (CHECK_AND_UNSET_GROUP VARNAME)
|
||||
CHECK_AND_UNSET ("${VARNAME}_DIR")
|
||||
CHECK_AND_UNSET ("${VARNAME}_INCLUDE_DIR")
|
||||
CHECK_AND_UNSET ("${VARNAME}_DLL")
|
||||
CHECK_AND_UNSET ("${VARNAME}_LIBRARY")
|
||||
ENDMACRO()
|
||||
|
||||
MACRO(THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME)
|
||||
IF(NOT DEFINED 3RDPARTY_${PRODUCT_NAME}_DIR)
|
||||
SET(3RDPARTY_${PRODUCT_NAME}_DIR "" CACHE PATH "Directory contains ${PRODUCT_NAME} product")
|
||||
@@ -386,12 +395,20 @@ IF(USE_FREEIMAGE)
|
||||
THIRDPARTY_PRODUCT("FREEIMAGEPLUS" "FreeImagePlus.h" "freeimageplus${BUILD_SUFFIX}")
|
||||
|
||||
ENDIF()
|
||||
ELSE()
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE")
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGEPLUS")
|
||||
CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
|
||||
CHECK_AND_UNSET ("INSTALL_FREEIMAGEPLUS")
|
||||
ENDIF()
|
||||
|
||||
# GL2PS
|
||||
IF(USE_GL2PS)
|
||||
ADD_DEFINITIONS(-DHAVE_GL2PS)
|
||||
THIRDPARTY_PRODUCT("GL2PS" "gl2ps.h" "gl2ps${BUILD_SUFFIX}")
|
||||
ELSE()
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_GL2PS")
|
||||
CHECK_AND_UNSET ("INSTALL_GL2PS")
|
||||
ENDIF()
|
||||
|
||||
# OPENCL
|
||||
@@ -422,6 +439,11 @@ IF(USE_OPENCL)
|
||||
# if CL/cl.h isn't found (and 3RDPARTY_OPENCL_INCLUDE_DIR isn't defined)
|
||||
# then try to find OpenCL/cl.h (all other variable won't be changed)
|
||||
THIRDPARTY_PRODUCT("OPENCL" "OpenCL/cl.h" "OpenCL${BUILD_SUFFIX}")
|
||||
ELSE()
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENCL")
|
||||
CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB")
|
||||
CHECK_AND_UNSET ("3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_LIB")
|
||||
CHECK_AND_UNSET ("INSTALL_OPENCL")
|
||||
ENDIF()
|
||||
|
||||
# TBB
|
||||
@@ -439,6 +461,11 @@ IF (USE_TBB)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TBB_DLL_DIR "${3RDPARTY_TBB_DLL}" PATH)
|
||||
GET_FILENAME_COMPONENT(3RDPARTY_TBB_MALLOC_DLL_DIR "${3RDPARTY_TBB_MALLOC_DLL}" PATH)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB")
|
||||
CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB_MALLOC")
|
||||
CHECK_AND_UNSET ("3RDPARTY_TBB_DIR_NAME")
|
||||
CHECK_AND_UNSET ("INSTALL_TBB")
|
||||
ENDIF()
|
||||
|
||||
string( REGEX REPLACE ";" " " 3RDPARTY_NOT_INCLUDED "${3RDPARTY_NOT_INCLUDED}")
|
||||
|
@@ -156,7 +156,6 @@ p IntCurvesFace
|
||||
p IntImp
|
||||
p IntImpParGen
|
||||
p IntPatch
|
||||
p IntPoly
|
||||
p IntPolyh
|
||||
p IntRes2d
|
||||
p IntStart
|
||||
|
@@ -38,6 +38,7 @@ dev_guides/contribution/coding_rules.md
|
||||
dev_guides/contribution_workflow/contribution_workflow.md
|
||||
dev_guides/git_guide/git_guide.md
|
||||
dev_guides/tests/tests.md
|
||||
dev_guides/debug/debug.md
|
||||
dev_guides/cdl/cdl.md
|
||||
dev_guides/wok/wok.md
|
||||
|
||||
|
@@ -3,46 +3,47 @@ Coding Rules {#dev_guides__coding_rules}
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section OCCT_RULES_SECTION_1 Introduction
|
||||
@section occt_coding_rules_1 Introduction
|
||||
|
||||
The purpose of this document is to define and formalize one style of programming for developers working on Open CASCADE Technology.
|
||||
The establishment of a common style facilitates understanding and maintaining code developed by more than one programmer as well as making it easier for several people to co-operate in the development of the same framework.
|
||||
In addition, following a common programming style enables the construction of tools that incorporate knowledge of these standards to help in the programming task.
|
||||
Using a consistent coding style throughout a particular module, package, or project is important because it allows people other than the author, and the author himself, to easily understand and (hopefully) maintain the code.
|
||||
Most programming styles are somewhat arbitrary, and this one is no exception. Some guidelines have been excerpted from the public domain of widely accepted practices.
|
||||
This suggests that the guide will continue to evolve over time as new ideas and enhancements are added.
|
||||
The purpose of this document is to define a common programming style for Open CASCADE Technology.
|
||||
|
||||
@subsection OCCT_RULES_SECTION_1_1 Scope of the rules in this document
|
||||
The common style facilitates understanding and maintaining a code developed cooperatively by several programmers. In addition, it enables construction of tools that incorporate knowledge of these standards to help in the programming.
|
||||
|
||||
Rules in this document was written for C++ code.
|
||||
However, with minor exceptions due to language restrictions, them should be applied to any sources in Open CASCADE Technology framework, including:
|
||||
OCCT programming style follows common and appropriate best practices, so some guidelines have been excerpted from the public domain.
|
||||
|
||||
The guide can be improved in the future as new ideas and enhancements are added.
|
||||
|
||||
@subsection occt_coding_rules_1_1 Scope of the document
|
||||
|
||||
Rules in this document refer to C++ code. However, with minor exceptions due to language restrictions, they are applicable to any sources in Open CASCADE Technology framework, including:
|
||||
- C/C++
|
||||
- GLSL programs
|
||||
- OpenCL kernels
|
||||
- TCL scripts and test cases
|
||||
|
||||
@section OCCT_RULES_SECTION_2 Naming Conventions
|
||||
@section occt_coding_rules_2 Naming Conventions
|
||||
|
||||
@subsection OCCT_RULES_SECTION_2_1 General naming rules
|
||||
@subsection occt_coding_rules_2_1 General naming rules
|
||||
|
||||
The names considered in this section are mainly those which compound the interface to Open CASCADE Technology libraries as well as source code itself.
|
||||
The names considered in this section mainly refer to the interface of Open CASCADE Technology libraries or source code itself.
|
||||
|
||||
### International language [MANDATORY]
|
||||
All names are composed of English words and their abbreviations.
|
||||
Open CASCADE Technology is an open source available for international community.
|
||||
|
||||
### Suggestive names
|
||||
Names should be suggestive or, at least, contain a suggestive part.
|
||||
Currently, there is no exact rule that would define how to generate suggestive names. However, usually names given to toolkits, packages, classes and methods are suggestive. Here are several examples:
|
||||
- Packages containing words Geom or Geom2d in their names are related to geometrical data and operations.
|
||||
- Packages containing words TopoDS or BRep in their names are related to topological data and operations.
|
||||
- In OCAF, packages that define transient, persistent data classes and drivers to map between them, have similar names prefixed by 'T', 'P', and 'M' correspondingly (e.g. TDocStd, PDocStd, MDocStd).
|
||||
- Packages ending with ...Test define Draw Harness plugins.
|
||||
- Methods starting with Get... and Set... are usually responsible for (accordingly) retrieving/storing some data.
|
||||
Open CASCADE Technology is an open source platform available for an international community, thus all names need to be composed of English words or their abbreviations.
|
||||
|
||||
### Meaningful names
|
||||
|
||||
Names should be meaningful or, at least, contain a meaningful part. To better understand this requirement, let us examine the existing names of toolkits, packages, classes and methods:
|
||||
- Packages containing words *Geom* or *Geom2d* in their names are related to geometrical data and operations.
|
||||
- Packages containing words *TopoDS* or *BRep* in their names are related to topological data and operations.
|
||||
- In OCAF, packages that define transient, persistent data classes and drivers to map between them, have similar names prefixed by *T*, *P*, and *M* correspondingly (e.g. *TDocStd*, *PDocStd*, *MDocStd*).
|
||||
- Packages ending with <i>...Test</i> define Draw Harness plugins.
|
||||
- Methods starting with *Get...* and *Set...* are usually responsible for correspondingly retrieving and storing data.
|
||||
|
||||
### Related names
|
||||
Names that define logically connected functionality should have the same prefix (start with the same letters) or, at least, have any other common part in them.
|
||||
As an example the method GetCoord can be given. It returns a triple of real values and is defined for directions, vectors and points. The logical connection is obvious.
|
||||
|
||||
Names related to a logically connected functionality should have the same prefix (start with the same letters) or, at least, have any other common part.
|
||||
For example, method *GetCoord* returns a triple of real values and is defined for directions, vectors and points. The logical connection is obvious.
|
||||
|
||||
### Camel Case style
|
||||
Camel Case style is preferred for names.
|
||||
@@ -54,46 +55,50 @@ Standard_Integer width_of_box; // this is bad
|
||||
Standard_Integer aWidthOfBox; // this is OK
|
||||
~~~~~
|
||||
|
||||
@subsection OCCT_RULES_SECTION_2_2 Names of development units
|
||||
Usually unit (e.g. package) is a set of classes, methods, enumerations or any other sources implementing certain common functionality which, to the certain extent, is self contained and independent from other parts of library.
|
||||
@subsection occt_coding_rules_2_2 Names of development units
|
||||
|
||||
### Underscores in units names [MANDATORY]
|
||||
Names of units should not contain underscores, except cases where usage of underscores is allowed explicitly.
|
||||
Usually names of files consisting Open CASCADE Technology are constructed according to the rules defined in the appropriate sections of this document.
|
||||
Usually a unit (e.g. a package) is a set of classes, methods, enumerations or any other sources implementing a common functionality, which is self-contained and independent from other parts of the library.
|
||||
|
||||
### No underscores in unit names [MANDATORY]
|
||||
|
||||
Names of units should not contain underscores, unless the use of underscores is allowed explicitly.
|
||||
|
||||
### File name extensions [MANDATORY]
|
||||
|
||||
### File names extensions [MANDATORY]
|
||||
The following extensions should be used for source files, depending on their type:
|
||||
|
||||
.cdl - CDL declaration files
|
||||
.cxx - C++ source files
|
||||
.hxx - C++ header files
|
||||
.lxx - headers with definitions of inline methods (CDL packages)
|
||||
* <i>.cdl</i> - CDL declaration files
|
||||
* <i>.cxx</i> - C++ source files
|
||||
* <i>.hxx</i> - C++ header files
|
||||
* <i>.lxx</i> - headers with definitions of inline methods (CDL packages)
|
||||
|
||||
@subsection OCCT_RULES_SECTION_2_3 Names of toolkits
|
||||
### Prefix for toolkit names [MANDATORY]
|
||||
|
||||
The following rules are usually used in naming of toolkits:
|
||||
|
||||
### Prefix for toolkits names [MANDATORY]
|
||||
Toolkits names are prefixed by TK, followed by suggestive part of name explaining the domain of functionality covered by the toolkit (e.g. TKOpenGl).
|
||||
Toolkit names are prefixed by *TK*, followed by a meaningful part of the name explaining the domain of functionality covered by the toolkit (e.g. *TKOpenGl*).
|
||||
|
||||
### Names of classes
|
||||
Usually source files located in the unit have names that start from the name of the unit, separated from remaining part of file name (if any) by underscore "_".
|
||||
For instance, names of files containing sources of C++ classes are constructed according to the following template.
|
||||
|
||||
### Naming of C++ class files
|
||||
The following template should be used for names of files containing sources of C++ classes:
|
||||
Usually the names of source files located in a unit start from the unit name separated from the other part of the file name by underscore "_".
|
||||
|
||||
<unit-name>_<class-name>.cxx (.hxx, .cdl etc.)
|
||||
Thus, the names of files containing sources of C++ classes that belong to a package are constructed according to the following template:
|
||||
|
||||
Files that contain sources related to whole unit are called by the name of unit with appropriate extension.
|
||||
~~~~~
|
||||
<package-name>_<class-name>.cxx (or .hxx, or .cdl)
|
||||
~~~~~
|
||||
|
||||
For example, file *Adaptor2d_Curve2d.cxx* belongs to the package *Adaptor2d*
|
||||
|
||||
Files that contain sources related to the whole unit are called by the unit name with appropriate extension.
|
||||
|
||||
### Names of functions
|
||||
The term 'function' here is defined as:
|
||||
|
||||
The term **function** here is defined as:
|
||||
- Any class method
|
||||
- Any package method
|
||||
- Any non-member procedure or function
|
||||
|
||||
It is preferred to name public methods from upper case, while protected and private methods from low case.
|
||||
It is preferred to start names of public methods from an upper case character and to start names of protected and private methods from a lower case character.
|
||||
|
||||
|
||||
~~~~~{.cpp}
|
||||
class MyPackage_MyClass
|
||||
@@ -111,12 +116,15 @@ private:
|
||||
};
|
||||
~~~~~
|
||||
|
||||
@subsection OCCT_RULES_SECTION_2_4 Names of variables
|
||||
There are several rules that describe currently accepted practice used for naming variables.
|
||||
@subsection occt_coding_rules_2_3 Names of variables
|
||||
|
||||
There are several rules that describe currently accepted practices for naming variables.
|
||||
|
||||
### Naming of variables
|
||||
Name of variable should not conflict with the global names (packages, macros, functions, global variables etc.), either existing or possible.
|
||||
The name of variable should not start with underscore(s).
|
||||
|
||||
Name of a variable should not conflict with the existing or possible global names (for packages, macros, functions, global variables, etc.).
|
||||
|
||||
The name of a variable should not start with an underscore.
|
||||
|
||||
See the following examples:
|
||||
|
||||
@@ -129,7 +137,8 @@ Standard_Integer THE_KERNEL = 0; // this is OK
|
||||
~~~~~
|
||||
|
||||
### Names of function parameters
|
||||
The name of a function (procedure, class method) parameter should start with 'the' followed by the rest of the name starting with capital letter.
|
||||
|
||||
The name of a function (procedure, class method) parameter should start with prefix *the* followed by the meaningful part of the name starting with a capital letter.
|
||||
|
||||
See the following examples:
|
||||
|
||||
@@ -140,7 +149,8 @@ void Package_MyClass::MyFunction (const gp_Pnt& thePoint); // this is preferred
|
||||
~~~~~
|
||||
|
||||
### Names of class member variables
|
||||
The name of a class member variable should start with 'my' followed by the rest of the name (rule for suggestive names applies) starting with capital letter.
|
||||
|
||||
The name of a class member variable should start with prefix *my* followed by the meaningful of the name starting with a capital letter.
|
||||
|
||||
See the following examples:
|
||||
|
||||
@@ -151,9 +161,9 @@ Standard_Integer myCounter; // This is preferred
|
||||
~~~~~
|
||||
|
||||
### Names of global variables
|
||||
|
||||
It is strongly recommended to avoid defining any global variables.
|
||||
However, as soon as global variable is necessary, the following rule applies.
|
||||
Global variable name should be prefixed by the name of a class or a package where it is defined followed with '_my'.
|
||||
However, as soon as a global variable is necessary, its name should be prefixed by the name of a class or a package where it is defined followed with *_my*.
|
||||
|
||||
See the following examples:
|
||||
|
||||
@@ -162,7 +172,7 @@ Standard_Integer MyPackage_myGlobalVariable = 0;
|
||||
Standard_Integer MyPackage_MyClass_myGlobalVariable = 0;
|
||||
~~~~~
|
||||
|
||||
Static constants within the file should be spelled upper-case and started with 'THE_' prefix:
|
||||
Static constants within the file should be written in upper-case and begin with prefix *THE_*:
|
||||
~~~~~{.cpp}
|
||||
namespace
|
||||
{
|
||||
@@ -171,10 +181,12 @@ namespace
|
||||
~~~~~
|
||||
|
||||
### Names of local variables
|
||||
Local variable name should be constructed in such way that it can be distinguished from the name of a function parameter, a class member variable and a global variable.
|
||||
It is preferred to prefix local variable names with 'a' and 'an' (also 'is', 'to' and 'has' for Boolean variables).
|
||||
|
||||
See the following examples:
|
||||
The name of a local variable should be distinguishable from the name of a function parameter, a class member variable and a global variable.
|
||||
|
||||
It is preferred to prefix local variable names with *a* and *an* (or *is*, *to* and *has* for Boolean variables).
|
||||
|
||||
See the following example:
|
||||
|
||||
~~~~~{.cpp}
|
||||
Standard_Integer theI; // this is bad
|
||||
@@ -184,8 +196,9 @@ Standard_Integer anIndex; // this is OK
|
||||
~~~~~
|
||||
|
||||
### Avoid dummy names
|
||||
Avoid dummy names like I, j, k. Such names are meaningless and easy to mix up.
|
||||
Code becomes more and more complicated when such dummy names used multiple times in code with different meaning, in cycles with different iteration ranges and so on.
|
||||
Avoid dummy names, such as <i>i, j, k</i>. Such names are meaningless and easy to mix up.
|
||||
|
||||
The code becomes more and more complicated when such dummy names are used there multiple times with different meanings, or in cycles with different iteration ranges, etc.
|
||||
|
||||
See the following examples for preferred style:
|
||||
|
||||
@@ -207,31 +220,37 @@ void Average (const Standard_Real** theArray,
|
||||
}
|
||||
~~~~~
|
||||
|
||||
@section OCCT_RULES_SECTION_3 Formatting rules
|
||||
@section occt_coding_rules_3 Formatting rules
|
||||
|
||||
In order to improve the open source readability and, consequently, maintainability, the following set of rules is applied.
|
||||
To improve the open source readability and, consequently, maintainability, the following set of rules is applied.
|
||||
|
||||
### International language [MANDATORY]
|
||||
|
||||
All comments in all sources must be in English.
|
||||
|
||||
### Line length
|
||||
In all sources try not to exceed 120 characters limit of line length.
|
||||
|
||||
Try to stay within the limit of 120 characters per line in all sources.
|
||||
|
||||
### C++ style comments
|
||||
|
||||
Prefer C++ style comments in C++ sources.
|
||||
|
||||
### Commenting out unused code
|
||||
|
||||
Delete unused code instead of commenting it or using #define.
|
||||
|
||||
### Indentation in sources [MANDATORY]
|
||||
|
||||
Indentation in all sources should be set to two space characters.
|
||||
Use of tabulation characters for indentation is disallowed.
|
||||
|
||||
### Separating spaces
|
||||
Punctuation rules follow the rules of English.
|
||||
C/C++ reserved words, commas, colons and semicolons should be followed by a space character if they are not at the end of line.
|
||||
There should be no space characters after '(' and before ')'. Closing and opening brackets should be separated by a space character.
|
||||
For better readability it is also recommended to surround conventional operators by a space character. See the following examples:
|
||||
|
||||
Punctuation rules follow the rules of the English language.
|
||||
* C/C++ reserved words, commas, colons and semicolons should be followed by a space character if they are not at the end of a line.
|
||||
* There should be no space characters after '(' and before ')'. Closing and opening brackets should be separated by a space character.
|
||||
* For better readability it is also recommended to surround conventional operators by a space character. See the following examples:
|
||||
|
||||
~~~~~{.cpp}
|
||||
while (true) // NOT: while( true ) ...
|
||||
@@ -245,7 +264,9 @@ for (anIter = 0; anIter < 10; ++anIter) // NOT: for (anIter=0;anIter<10;++anIter
|
||||
~~~~~
|
||||
|
||||
### Separate logical blocks
|
||||
|
||||
Separate logical blocks of code with one blank line and comments.
|
||||
|
||||
See the following example:
|
||||
|
||||
~~~~~{.cpp}
|
||||
@@ -268,8 +289,10 @@ if (anArgsNb < 3 || isSmthInvalid)
|
||||
Notice that multiple blank lines should be avoided.
|
||||
|
||||
### Separate function bodies [MANDATORY]
|
||||
|
||||
Use function descriptive blocks to separate function bodies from each other.
|
||||
Each descriptive block should contain at least a function name and description of purpose.
|
||||
Each descriptive block should contain at least a function name and purpose description.
|
||||
|
||||
See the following example:
|
||||
|
||||
~~~~~{.cpp}
|
||||
@@ -293,8 +316,9 @@ void TellMeSmthBad()
|
||||
~~~~~
|
||||
|
||||
### Block layout [MANDATORY]
|
||||
Figure brackets '{', '}' and each operator (for, if, else, try, catch) should be on dedicated line.
|
||||
General block should have layout similarly to the following:
|
||||
Figure brackets <i>{ }</i> and each operator <i>(for, if, else, try, catch)</i> should be written on a dedicated line.
|
||||
|
||||
In general, the layout should be as follows:
|
||||
|
||||
~~~~~{.cpp}
|
||||
while (expression)
|
||||
@@ -303,10 +327,11 @@ while (expression)
|
||||
}
|
||||
~~~~~
|
||||
|
||||
Entering block increases and leaving block decreases indentation to one tabulation.
|
||||
Entering a block increases and leaving a block decreases the indentation by one tabulation.
|
||||
|
||||
### Single-line operators
|
||||
Single-line conditional operator (if, while, for etc.) can be written without brackets on the following line.
|
||||
|
||||
Single-line conditional operators <i>(if, while, for,</i> etc.) can be written without brackets on the following line.
|
||||
|
||||
~~~~~{.cpp}
|
||||
if (!myIsInit) return Standard_False; // bad
|
||||
@@ -320,10 +345,11 @@ if (!theAlgo.IsNull()) // preferred
|
||||
}
|
||||
~~~~~
|
||||
|
||||
Code on the same line is less convenient for debugging.
|
||||
Having all code in the same line is less convenient for debugging.
|
||||
|
||||
### Use alignment
|
||||
Use alignment wherever it enhances readability. See the following example:
|
||||
### Alignment
|
||||
|
||||
Use alignment wherever it enhances the readability. See the following example:
|
||||
|
||||
~~~~~{.cpp}
|
||||
MyPackage_MyClass anObject;
|
||||
@@ -339,8 +365,11 @@ switch (aVal)
|
||||
~~~~~
|
||||
|
||||
### Indentation of comments
|
||||
Comments should be indented similar to the code which they refer to or can be on the same line if they are short.
|
||||
Text should be delimited with single space character from slash.
|
||||
|
||||
Comments should be indented in the same way as the code to which they refer or they can be in the same line if they are short.
|
||||
|
||||
The text of the comment should be separated from the slash character by a single space character.
|
||||
|
||||
See the following example:
|
||||
|
||||
~~~~~{.cpp}
|
||||
@@ -354,8 +383,10 @@ while (expression) //bad comment
|
||||
~~~~~
|
||||
|
||||
### Early return statement
|
||||
Prefer early return condition rather than collecting indentations.
|
||||
Better write like this:
|
||||
|
||||
Use an early return condition rather than collect indentations.
|
||||
|
||||
Write like this:
|
||||
|
||||
~~~~~{.cpp}
|
||||
Standard_Integer ComputeSumm (const Standard_Integer* theArray,
|
||||
@@ -372,7 +403,7 @@ Standard_Integer ComputeSumm (const Standard_Integer* theArray,
|
||||
}
|
||||
~~~~~
|
||||
|
||||
rather than:
|
||||
Rather than:
|
||||
|
||||
~~~~~{.cpp}
|
||||
Standard_Integer ComputeSumm (const Standard_Integer* theArray,
|
||||
@@ -387,15 +418,18 @@ Standard_Integer ComputeSumm (const Standard_Integer* theArray,
|
||||
}
|
||||
~~~~~
|
||||
|
||||
to improve readability and reduce unnecessary indentation depth.
|
||||
This helps to improve readability and reduce the unnecessary indentation depth.
|
||||
|
||||
### Trailing spaces
|
||||
Trailing spaces should be removed when possible.
|
||||
Spaces at end of line are useless and do not affect functionality.
|
||||
|
||||
Trailing spaces should be removed whenever possible.
|
||||
Spaces at the end of a line are useless and do not affect functionality.
|
||||
|
||||
### Headers order
|
||||
Split into groups: system headers, per framework headers, project headers; sort includes list alphabetically.
|
||||
This rule can improve readability, allows detection of useless header's multiple inclusions and makes 3rd-party dependencies clearly visible.
|
||||
|
||||
Split headers into groups: system headers, headers per each framework, project headers; sort the list of includes alphabetically.
|
||||
|
||||
This rule improves readability, allows detecting useless multiple header inclusions and makes 3rd-party dependencies clearly visible.
|
||||
|
||||
~~~~~{.cpp}
|
||||
// system headers
|
||||
@@ -412,25 +446,28 @@ This rule can improve readability, allows detection of useless header's multiple
|
||||
#include <NCollection_List.hxx>
|
||||
~~~~~
|
||||
|
||||
@section OCCT_RULES_SECTION_4 Documentation rules
|
||||
@section occt_coding_rules_4 Documentation rules
|
||||
|
||||
The source code is one of the most important references for documentation.
|
||||
The comments in the source code should be complete enough to allow understanding of that code, and to serve as basis for other documents.
|
||||
The main reasons why comments are regarded as documentation and should be maintained are:
|
||||
The comments in the source code should be complete enough to allow understanding the corresponding code and to serve as basis for other documents.
|
||||
|
||||
- The comments are easy to reach - they are always together with source code
|
||||
- It's easy to update description in the comment when source is modified
|
||||
- The source itself represents a good context to describe various details that would require much more explanations in separate document
|
||||
- As a summary, this is the most cost-effective documentation
|
||||
The main reasons why the comments are regarded as documentation and should be maintained are:
|
||||
- The comments are easy to reach - they are always together with the source code;
|
||||
- It is easy to update a description in the comment when the source is modified;
|
||||
- The source by itself is a good context to describe various details that would require much more explanations in a separate document;
|
||||
- As a summary, this is the most cost-effective documentation.
|
||||
|
||||
The comments should be compatible with Doxygen tool for automatic documentation generation (thus should use compatible tags).
|
||||
|
||||
### Documenting classes [MANDATORY]
|
||||
|
||||
Each class should be documented in its header file (.hxx or .cdl).
|
||||
The comment should give enough details for the reader to understand the purpose of the class and main way of work with it.
|
||||
The comment should give enough details for the reader to understand the purpose of the class and the main way of work with it.
|
||||
|
||||
### Documenting class methods [MANDATORY]
|
||||
|
||||
Each class or package method should be documented in the header file (.hxx or .cdl).
|
||||
|
||||
The comment should explain the purpose of the method, its parameters, and returned value(s).
|
||||
Accepted style is:
|
||||
|
||||
@@ -442,77 +479,97 @@ Standard_Export Standard_Real Square (Standard_Real theValue);
|
||||
@endverbatim
|
||||
|
||||
### Documenting C/C++ sources
|
||||
|
||||
It is very desirable to put comments in the C/C++ sources of the package/class.
|
||||
They should be detailed enough to allow any person to understand what does each part of code, and get familiar with it.
|
||||
It is recommended to comment all static functions (like methods in headers), and at least each 10-100 lines of the function bodies.
|
||||
There are also some rules that define how comments should be formatted, see section "Formatting Rules".
|
||||
Following these rules is important for good comprehension of the comments;
|
||||
moreover it makes possible to automatically generate user-oriented documentation directly from commented sources.
|
||||
|
||||
@section OCCT_RULES_SECTION_5 Application design
|
||||
They should be detailed enough to allow any person to understand what each part of code does.
|
||||
|
||||
The following set of rules defines the common style which should be applied by any developer contributing to the open source.
|
||||
It is recommended to comment all static functions (like methods in headers), and to insert at least one comment per each 10-100 lines in the function body.
|
||||
|
||||
There are also some rules that define how comments should be formatted, see <a href="#occt_coding_rules_3">Formatting Rules</a>.
|
||||
|
||||
Following these rules is important for good comprehension of the comments. Moreover, this approach allows automatically generating user-oriented documentation directly from the commented sources.
|
||||
|
||||
@section occt_coding_rules_5 Application design
|
||||
|
||||
The following rules define the common style, which should be applied by any developer contributing to the open source.
|
||||
|
||||
### Allow possible inheritance
|
||||
|
||||
### Allow for possible inheritance
|
||||
Try to design general classes (objects) keeping possible inheritance in mind.
|
||||
This rule means that making possible extensions of your class the user should not encounter with problems of private implementations.
|
||||
This rule means that the user who makes possible extensions of your class should not encounter problems of private implementation.
|
||||
Try to use protected members and virtual methods wherever you expect extensions in the future.
|
||||
|
||||
### Avoid friend declarations
|
||||
Avoid using 'friend' classes or functions except some specific cases (ex., iteration) 'Friend' declarations increase coupling.
|
||||
|
||||
Avoid using 'friend' classes or functions except for some specific cases (for example, iteration) 'Friend' declarations increase coupling.
|
||||
|
||||
### Set/get methods
|
||||
|
||||
Avoid providing set/get methods for all fields of the class.
|
||||
Intensive set/get functions break down encapsulation.
|
||||
|
||||
### Hiding virtual functions [MANDATORY]
|
||||
|
||||
Avoid hiding a base class virtual function by a redefined function with a different signature.
|
||||
Most of the compilers issue warning on this.
|
||||
|
||||
### Avoid mixing error reporting strategies
|
||||
Try not to mix different error indication/handling strategies (exceptions or returned values) on the same level of an application.
|
||||
|
||||
Try not to mix different error indication/handling strategies (exceptions or returned values) on the same application level.
|
||||
|
||||
### Minimize compiler warnings [MANDATORY]
|
||||
|
||||
When compiling the source pay attention to and try to minimize compiler warnings.
|
||||
|
||||
### Avoid unnecessary inclusion
|
||||
Try to minimize compilation dependencies by removing unnecessary inclusion.
|
||||
### Avoid unnecessary inclusions
|
||||
|
||||
@section OCCT_RULES_SECTION_6 General C/C++ rules
|
||||
Try to minimize compilation dependencies by removing unnecessary inclusions.
|
||||
|
||||
This section defines rules for writing portable and maintainable C/C++ source code.
|
||||
@section occt_coding_rules_6 General C/C++ rules
|
||||
|
||||
This section defines the rules for writing a portable and maintainable C/C++ source code.
|
||||
|
||||
### Wrapping of global variables [MANDATORY]
|
||||
Use package or class methods returning reference to wrap global variables to reduces possible name space conflicts.
|
||||
|
||||
Use package or class methods returning reference to wrap global variables to reduce possible name space conflicts.
|
||||
|
||||
### Avoid private members
|
||||
Use 'protected' members instead of 'private' wherever reasonable to enable future extensions.
|
||||
Use 'private' fields if future extensions should be disabled.
|
||||
|
||||
Use *protected* members instead of *private* wherever reasonable to enable future extensions.
|
||||
Use *private* fields if future extensions should be disabled.
|
||||
|
||||
### Constants and inlines over defines [MANDATORY]
|
||||
|
||||
Use constant variables (const) and inline functions instead of defines (#define).
|
||||
|
||||
### Avoid explicit numerical values [MANDATORY]
|
||||
|
||||
Avoid usage of explicit numeric values. Use named constants and enumerations instead.
|
||||
Magic numbers are badly to read and maintain.
|
||||
Numbers produce difficulties for reading and maintenance.
|
||||
|
||||
### Three mandatory methods
|
||||
A class with any of (destructor, assignment operator, copy constructor) usually needs all of them.
|
||||
|
||||
If a class has a destructor, an assignment operator or a copy constructor, it usually needs the other two methods.
|
||||
|
||||
### Virtual destructor
|
||||
|
||||
A class with virtual function(s) ought to have a virtual destructor.
|
||||
|
||||
### Default parameter value
|
||||
|
||||
Do not redefine a default parameter value in an inherited function.
|
||||
|
||||
### Use const modifier
|
||||
Use const modifier wherever possible (functions parameters, return values etc.)
|
||||
|
||||
Use *const* modifier wherever possible (functions parameters, return values, etc.)
|
||||
|
||||
### Usage of goto [MANDATORY]
|
||||
Avoid goto statement except the cases where it is really needed.
|
||||
Avoid *goto* statement unless it is really needed.
|
||||
|
||||
### Declaring variable in for() header
|
||||
Declaring cycle variable in the header of the for() statement if not used out of cycle.
|
||||
|
||||
Declare a cycle variable in the header of the *for()* statement if not used out of cycle.
|
||||
|
||||
~~~~~{.cpp}
|
||||
Standard_Real aMinDist = Precision::Infinite();
|
||||
@@ -524,6 +581,7 @@ for (NCollection_Sequence<gp_Pnt>::Iterator aPntIter (theSequence);
|
||||
~~~~~
|
||||
|
||||
### Condition statements within zero
|
||||
|
||||
Avoid usage of C-style comparison for non-boolean variables:
|
||||
|
||||
~~~~~{.cpp}
|
||||
@@ -547,57 +605,70 @@ void Function (Standard_Integer theValue,
|
||||
}
|
||||
~~~~~
|
||||
|
||||
@section OCCT_RULES_SECTION_7 Portability issues
|
||||
@section occt_coding_rules_7 Portability issues
|
||||
|
||||
This chapter contains rules that are critical for cross-platform portability.
|
||||
|
||||
### Ensure code portability [MANDATORY]
|
||||
It is required that source code must be portable to all platforms listed in the official 'Technical Requirements'.
|
||||
### Provide code portability [MANDATORY]
|
||||
|
||||
The source code must be portable to all platforms listed in the official 'Technical Requirements'.
|
||||
The term 'portable' here means 'able to be built from source'.
|
||||
|
||||
The C++ source code should meet C++03 standard.
|
||||
Any usage of compiler-specific features or further language versions (C++11, until all major compliers on all supported platforms do not implement all it features)
|
||||
should be optional (escaped with appropriate preprocessor checks) and non-exclusive (alternative implementation should be provided, compatible with other compilers).
|
||||
Any usage of compiler-specific features or further language versions (for example, C++11, until all major compilers on all supported platforms implement all its features) should be optional (used only with appropriate preprocessor checks) and non-exclusive (an alternative implementation compatible with other compilers should be provided).
|
||||
|
||||
### Avoid usage of global variables [MANDATORY]
|
||||
Avoid usage of global variables. Usage of global variables may cause problems of accessing them from another shared library.
|
||||
Instead of global variables, use global (package or class) functions that return reference to static variable local to this function.
|
||||
|
||||
Avoid usage of global variables. Usage of global variables may cause problems when accessed from another shared library.
|
||||
|
||||
Use global (package or class) functions that return reference to static variable local to this function instead of global variables.
|
||||
|
||||
Another possible problem is the order of initialization of global variables defined in various libraries that may differ depending on platform, compiler and environment.
|
||||
|
||||
### Avoid explicit basic types
|
||||
Avoid explicit usage of basic types (int, float, double etc.), use Open CASCADE Technology types (from package Standard - see Standard_Integer, Standard_Real, Standard_ShortReal, Standard_Boolean, Standard_CString and others) or specific typedef instead.
|
||||
|
||||
### Use sizeof() to calculate sizes [MANDATORY]
|
||||
Do not assume sizes of types. Use sizeof() instead to calculate sizes.
|
||||
Avoid explicit usage of basic types (*int*, *float*, *double*, etc.), use Open CASCADE Technology types from package *Standard: Standard_Integer, Standard_Real, Standard_ShortReal, Standard_Boolean, Standard_CString* and others or a specific *typedef* instead.
|
||||
|
||||
### Empty line at end of file [MANDATORY]
|
||||
In accordance with C++03 standard source files should be trailed by empty line.
|
||||
### Use *sizeof()* to calculate sizes [MANDATORY]
|
||||
|
||||
Do not assume sizes of types. Use *sizeof()* instead to calculate sizes.
|
||||
|
||||
### Empty line at the end of file [MANDATORY]
|
||||
|
||||
In accordance with C++03 standard source files should be trailed by an empty line.
|
||||
It is recommended to follow this rule for any plain text files for consistency and for correct work of git difference tools.
|
||||
|
||||
@section OCCT_RULES_SECTION_8 Stability issues
|
||||
@section occt_coding_rules_8 Stability issues
|
||||
|
||||
The rules listed in this chapter are important for stability of the programs that use Open CASCADE Technology libraries.
|
||||
|
||||
### OSD::SetSignal() to catch exceptions
|
||||
When using Open CASCADE Technology in an application, make sure to call OSD::SetSignal() function when the application is initialized.
|
||||
This will install C handlers for run-time interrupt signals and exceptions,
|
||||
so that low-level exceptions (such as access violation, division by zero etc.) will be redirected to C++ exceptions
|
||||
(that use try {...} catch (Standard_Failure) {...} blocks).
|
||||
### Use *OSD::SetSignal()* to catch exceptions
|
||||
|
||||
When using Open CASCADE Technology in an application, call *OSD::SetSignal()* function when the application is initialized.
|
||||
|
||||
This will install C handlers for run-time interrupt signals and exceptions, so that low-level exceptions (such as access violation, division by zero, etc.) will be redirected to C++ exceptions
|
||||
that use *try {...} catch (Standard_Failure) {...}* blocks.
|
||||
|
||||
The above rule is especially important for robustness of modeling algorithms.
|
||||
|
||||
### Cross-referenced handles
|
||||
Take care about cycling of handled references to avoid chains which will never be freed.
|
||||
For that purpose, use a pointer at one (subordinate) side. See the following example:
|
||||
|
||||
In MyPackage.cdl:
|
||||
Take care about cycling of handled references to avoid chains, which will never be freed. For this purpose, use a pointer at one (subordinate) side.
|
||||
|
||||
See the following example:
|
||||
|
||||
In *MyPackage.cdl* :
|
||||
|
||||
~~~~
|
||||
class MyFirstHandle;
|
||||
class MySecondHandle;
|
||||
pointer MySecondPointer to MySecondHandle;
|
||||
...
|
||||
~~~~
|
||||
|
||||
In MyPackage_MyFirstHandle.cdl:
|
||||
In *MyPackage_MyFirstHandle.cdl* :
|
||||
|
||||
~~~~
|
||||
class MyFirstHandle from MyPackage
|
||||
...
|
||||
is
|
||||
@@ -611,9 +682,11 @@ In MyPackage_MyFirstHandle.cdl:
|
||||
mySecondPointer : MySecondPointer from MyPackage;
|
||||
...
|
||||
end MyFirstHandle from MyPackage;
|
||||
~~~~
|
||||
|
||||
In MyPackage_MySecondHandle.cdl:
|
||||
In *MyPackage_MySecondHandle.cdl* :
|
||||
|
||||
~~~~
|
||||
class MySecondHandle from MyPackage
|
||||
...
|
||||
is
|
||||
@@ -625,6 +698,7 @@ In MyPackage_MySecondHandle.cdl:
|
||||
myFirstHandle : MyFirstHandle from MyPackage;
|
||||
...
|
||||
end MySecondHandle from MyPackage;
|
||||
~~~~
|
||||
|
||||
In C++ code:
|
||||
|
||||
@@ -650,10 +724,11 @@ void MyFunction()
|
||||
~~~~~
|
||||
|
||||
### C++ memory allocation
|
||||
In C++ use new and delete operators instead of malloc() and free().
|
||||
Try not to mix different memory allocation techniques.
|
||||
|
||||
### Match new and delete [MANDATORY]
|
||||
In C++ use *new* and *delete* operators instead of *malloc()* and *free()*. Try not to mix different memory allocation techniques.
|
||||
|
||||
### Match *new* and *delete* [MANDATORY]
|
||||
|
||||
Use the same form of new and delete.
|
||||
|
||||
~~~~~{.cpp}
|
||||
@@ -663,9 +738,11 @@ aPtr3 = Standard::Allocate (4096); ... ; Standard::Free (aPtr3);
|
||||
~~~~~
|
||||
|
||||
### Methods managing dynamical allocation [MANDATORY]
|
||||
|
||||
Define a destructor, a copy constructor and an assignment operator for classes with dynamically allocated memory.
|
||||
|
||||
### Uninitialized variables [MANDATORY]
|
||||
|
||||
Every variable should be initialized.
|
||||
|
||||
~~~~~{.cpp}
|
||||
@@ -673,15 +750,18 @@ Standard_Integer aTmpVar1; // bad
|
||||
Standard_Integer aTmpVar2 = 0; // OK
|
||||
~~~~~
|
||||
|
||||
Uninitialized variables might be kept only within performance-sensitive code blocks and only when their initialization is *guarantied* by following code.
|
||||
Uninitialized variables might be kept only within performance-sensitive code blocks and only when their initialization is guaranteed by subsequent code.
|
||||
|
||||
### Do not hide global new
|
||||
Avoid hiding the global new operator.
|
||||
### Do not hide global *new*
|
||||
|
||||
Avoid hiding the global *new* operator.
|
||||
|
||||
### Assignment operator
|
||||
In operator=() assign to all data members and check for assignment to self.
|
||||
|
||||
In *operator=()* assign to all data members and check for assignment to self.
|
||||
|
||||
### Float comparison
|
||||
|
||||
Don't check floats for equality or non-equality; check for GT, GE, LT or LE.
|
||||
|
||||
~~~~~{.cpp}
|
||||
@@ -691,42 +771,45 @@ if (Abs (theFloat1 - theFloat2) < theTolerance)
|
||||
}
|
||||
~~~~~
|
||||
|
||||
Package 'Precision' provides standard values for SI units and widely adopted by existing modeling algorithms:
|
||||
- Precision::Confusion() for lengths in meters
|
||||
- Precision::Angular() for angles in radians
|
||||
Package *Precision* provides standard values for SI units and widely adopted by existing modeling algorithms:
|
||||
|
||||
as well as definition of infinity values within sanity range of double precision:
|
||||
- Precision::Infinite()
|
||||
- Precision::IsInfinite()
|
||||
- Precision::IsPositiveInfinite()
|
||||
- Precision::IsNegativeInfinite()
|
||||
- *Precision::Confusion()* for lengths in meters;
|
||||
- *Precision::Angular()* for angles in radians.
|
||||
|
||||
as well as definition of infinite values within normal range of double precision:
|
||||
- *Precision::Infinite()*
|
||||
- *Precision::IsInfinite()*
|
||||
- *Precision::IsPositiveInfinite()*
|
||||
- *Precision::IsNegativeInfinite()*
|
||||
|
||||
### Non-indexed iteration
|
||||
Avoid usage of iteration over non-indexed collections of objects.
|
||||
If such iteration is used, make sure that the result of the algorithm does not depend on order.
|
||||
|
||||
Since the order of iteration is unpredictable in this case, it frequently leads to different behavior of the application from one run to another,
|
||||
thus embarrassing the debugging process.
|
||||
It mostly concerns mapped objects for which pointers are involved in calculating the hash function.
|
||||
For example, the hash function of TopoDS_Shape involves the address of TopoDS_TShape object.
|
||||
Thus the order of the same shape in the TopTools_MapOfShape will vary in different sessions of the application.
|
||||
Avoid usage of iteration over non-indexed collections of objects.
|
||||
If such iteration is used, make sure that the result of the algorithm does not depend on the order of iterated items.
|
||||
|
||||
Since the order of iteration is unpredictable in case of a non-indexed collection of objects, it frequently leads to different behavior of the application from one run to another, thus embarrassing the debugging process.
|
||||
|
||||
It mostly concerns mapped objects for which pointers are involved in calculating the hash function. For example, the hash function of *TopoDS_Shape* involves the address of *TopoDS_TShape* object. Thus the order of the same shape in the *TopTools_MapOfShape* will vary in different sessions of the application.
|
||||
|
||||
### Do not throw in destructors
|
||||
Do not throw from within destructor.
|
||||
|
||||
Do not throw from within a destructor.
|
||||
|
||||
### Assigning to reference [MANDATORY]
|
||||
Avoid possible assignments of the temporary object to a reference.
|
||||
Different behavior for different compiler of different platforms.
|
||||
|
||||
@section OCCT_RULES_SECTION_9 Performance issues
|
||||
Avoid the assignment of a temporary object to a reference. This results in a different behavior for different compilers on different platforms.
|
||||
|
||||
@section occt_coding_rules_9 Performance issues
|
||||
|
||||
These rules define the ways of avoiding possible loss of performance caused by ineffective programming.
|
||||
|
||||
### Class fields alignment
|
||||
In a class, declare its fields in the decreasing order of their size for better alignment.
|
||||
|
||||
Declare fields of a class in the decreasing order of their size for better alignment.
|
||||
Generally, try to reduce misaligned accesses since they impact the performance (for example, on Intel machines).
|
||||
|
||||
### Fields initialization order [MANDATORY]
|
||||
|
||||
List class data members in the constructor's initialization list in the order they are declared.
|
||||
|
||||
~~~~~{.cpp}
|
||||
@@ -752,7 +835,8 @@ private:
|
||||
~~~~~
|
||||
|
||||
### Initialization over assignment
|
||||
In class constructors prefer initialization over assignment.
|
||||
|
||||
Prefer initialization over assignment in class constructors.
|
||||
|
||||
~~~~~{.cpp}
|
||||
MyPackage_MyClass()
|
||||
@@ -763,8 +847,9 @@ MyPackage_MyClass()
|
||||
~~~~~
|
||||
|
||||
### Optimize caching
|
||||
When programming procedures with extensive memory access, try to optimize them in terms of cache behavior.
|
||||
Here is an example of how cache behavior can be impact:
|
||||
|
||||
When programming procedures with extensive memory access, try to optimize them in terms of cache behavior. Here is an example of how the cache behavior can be impacted:
|
||||
|
||||
On x86 this code
|
||||
|
||||
~~~~~{.cpp}
|
||||
@@ -775,7 +860,7 @@ for (Standard_Integer anIter = 0; anIter < 4096; ++anIter)
|
||||
}
|
||||
~~~~~
|
||||
|
||||
is more efficient than
|
||||
is more efficient then
|
||||
|
||||
~~~~~{.cpp}
|
||||
Standard_Real anArray[2][4096];
|
||||
@@ -785,14 +870,103 @@ for (Standard_Integer anIter = 0; anIter < 4096; ++anIter)
|
||||
}
|
||||
~~~~~
|
||||
|
||||
since linear access (above) does not invalidate cache too often.
|
||||
since linear access does not invalidate cache too often.
|
||||
|
||||
@section OCCT_RULES_SECTION_10 Examples
|
||||
@section occt_coding_rules_10 Draw Harness command
|
||||
|
||||
Here is C++ source file sample:
|
||||
Draw Harness provides TCL interface for OCCT algorithms.
|
||||
|
||||
There is no TCL wrapper over OCCT C++ classes, instead interface is provided through the set of TCL commands implemented in C++.
|
||||
|
||||
There is a list of common rules which should be followed to implement well-formed Draw Harness command.
|
||||
|
||||
### Return value
|
||||
|
||||
Command should return 0 in most cases even if the executed algorithm has failed. Returning 1 would lead to a TCL exception, thus should be used in case of a command line syntax error and similar issues.
|
||||
|
||||
### Validate input parameters
|
||||
|
||||
Command arguments should be validated before usage. The user should see a human-readable error description instead of a runtime exception from the executed algorithm.
|
||||
|
||||
### Validate the number of input parameters
|
||||
|
||||
Command should warn the user about unknown arguments, including cases when extra parameters have been pushed for the command with a fixed number of arguments.
|
||||
|
||||
~~~~~{.cpp}
|
||||
if (theArgsNb != 3)
|
||||
{
|
||||
std::cout << "Syntax error - wrong number of arguments!\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Standard_Integer anArgIter = 1;
|
||||
Standard_CString aResName = theArgVec[anArgIter++];
|
||||
Standard_CString aFaceName = theArgVec[anArgIter++];
|
||||
TopoDS_Shape aFaceShape = DBRep::Get (aFaceName);
|
||||
if (aFaceShape.IsNull()
|
||||
|| aFaceShape.ShapeType() != TopAbs_FACE)
|
||||
{
|
||||
std::cout << "Shape " << aFaceName << " is empty or not a Face!\n";
|
||||
return 1;
|
||||
}
|
||||
DBRep::Set (aResName, aFaceShape);
|
||||
return 0;
|
||||
~~~~~
|
||||
|
||||
### Message printing
|
||||
|
||||
Informative messages should be printed into standard output *std::cout*, whilst command results (if any) - into Draw Interpreter.
|
||||
|
||||
Information printed into Draw Interpreter should be well-structured to allow usage in TCL script.
|
||||
|
||||
### Long list of arguments
|
||||
|
||||
Any command with a long list of obligatory parameters should be considered as ill-formed by design.
|
||||
Optional parameters should start with flag name (with '-' prefix) and followed by its values:
|
||||
|
||||
~~~~~{.tcl}
|
||||
myCommand -flag1 value1 value2 -flag2 value3
|
||||
~~~~~
|
||||
|
||||
### Arguments parser
|
||||
|
||||
- Integer values should be read using *Draw::Atoi()* function.
|
||||
- Real values should be read using *Draw::Atof()* function.
|
||||
- Flags names should be checked in case insensitive manner.
|
||||
|
||||
Functions *Draw::Atof()* and *Draw::Atoi()* support expressions and read values in C-locale.
|
||||
|
||||
~~~~~{.cpp}
|
||||
Standard_Real aPosition[3] = {0.0, 0.0, 0.0};
|
||||
for (Standard_Integer anArgIter = 1; anArgIter < theArgsNb; ++anArgIter)
|
||||
{
|
||||
Standard_CString anArg = theArgVec[anArgIter];
|
||||
TCollection_AsciiString aFlag (anArg);
|
||||
aFlag.LowerCase(); //!< for case insensitive comparison
|
||||
if (aFlag == "position")
|
||||
{
|
||||
if ((anArgIt + 3) >= theArgsNb)
|
||||
{
|
||||
std::cerr << "Wrong syntax at argument '" << anArg << "'!\n";
|
||||
return 1;
|
||||
}
|
||||
aPosition[0] = Draw::Atof (theArgVec[++anArgIt]);
|
||||
aPosition[1] = Draw::Atof (theArgVec[++anArgIt]);
|
||||
aPosition[2] = Draw::Atof (theArgVec[++anArgIt]);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Syntax error! Unknown flag '" << anArg << "'\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
~~~~~
|
||||
|
||||
@section occt_coding_rules_11 Examples
|
||||
|
||||
### Sample documented class
|
||||
|
||||
@verbatim
|
||||
//! Sample documented class
|
||||
class Package_Class
|
||||
{
|
||||
|
||||
@@ -803,21 +977,22 @@ public: //! @name public methods
|
||||
//! @return squared value
|
||||
Standard_Export Standard_Real Square (const Standard_Real theValue);
|
||||
|
||||
private: //! @name private methods
|
||||
private: //! \@name private methods
|
||||
|
||||
//! Auxiliary method
|
||||
void increment();
|
||||
|
||||
private: //! @name private fields
|
||||
private: //! \@name private fields
|
||||
|
||||
Standard_Integer myCounter; //!< usage counter
|
||||
|
||||
};
|
||||
|
||||
|
||||
@endverbatim
|
||||
|
||||
~~~~~{.cpp}
|
||||
~~~~~
|
||||
#include <Package_Class.hxx>
|
||||
|
||||
// ==========================================================
|
||||
// function : Square
|
||||
// purpose : Method computes the square value
|
||||
@@ -838,7 +1013,8 @@ void Package_Class::increment()
|
||||
}
|
||||
~~~~~
|
||||
|
||||
TCL script for Draw Harness:
|
||||
### TCL script for Draw Harness
|
||||
|
||||
~~~~~{.tcl}
|
||||
# show fragments (solids) in shading with different colors
|
||||
proc DisplayColored {theShape} {
|
||||
@@ -872,7 +1048,7 @@ vfit
|
||||
vdump $imagedir/${casename}.png 512 512
|
||||
~~~~~
|
||||
|
||||
GLSL program:
|
||||
### GLSL program:
|
||||
~~~~~{.fs}
|
||||
vec3 Ambient; //!< Ambient contribution of light sources
|
||||
vec3 Diffuse; //!< Diffuse contribution of light sources
|
||||
|
244
dox/dev_guides/debug/debug.md
Normal file
@@ -0,0 +1,244 @@
|
||||
Debugging tools and hints {#dev_guides__debug}
|
||||
=========================
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section occt_debug_intro Introduction
|
||||
|
||||
This manual describes facilities included in OCCT to support debugging, and provides some hints for more efficient debug.
|
||||
|
||||
@section occt_debug_bop Self-diagnostics in Boolean operations algorithm
|
||||
|
||||
In real-world applications modeling operations are often performed in a long sequence, while the user sees only the final result of the whole sequence. If the final result is wrong, the first debug step is to identify the offending operation to be debugged further. Boolean operation algorithm in OCCT provides a self-diagnostic feature which can help to do that step.
|
||||
|
||||
This feature can be activated by defining environment variable *CSF_DEBUG_BOP*, which should specify an existing writeable directory.
|
||||
|
||||
The diagnostic code checks validity of the input arguments and the result of each Boolean operation. When an invalid situation is detected, the report consisting of argument shapes and a DRAW script to reproduce the problematic operation is saved to the directory pointed by *CSF_DEBUG_BOP*.
|
||||
|
||||
@section occt_debug_exceptions Calling JIT debugger on exception
|
||||
|
||||
On Windows platform when using Visual Studio compiler there is a possibility to start the debugger automatically if an exception is caught in a program running OCCT. For this, set environment variable *CSF_DEBUG* to any value. Note that this feature works only if you enable OCCT exception handler in your application by calling *OSD::SetSignal()*.
|
||||
|
||||
@section occt_debug_call Functions for calling from debugger
|
||||
|
||||
Modern interactive debuggers provide the possibility to execute application code at a program break point. This feature can be used to analyse the temporary objects available only in the context of the debugged code. OCCT provides several global functions that can be used in this way.
|
||||
|
||||
Note that all these functions accept pointer to variable as <i>void*</i> to allow calling the function even when debugger does not recognize type equivalence or can not perform necessary type cast automatically. It is responsibility of the developer to provide the correct pointer. In general these functions are not guaranteed to work, thus use them with caution and at your own risk.
|
||||
|
||||
@subsection occt_debug_call_draw Interacting with DRAW
|
||||
|
||||
Open CASCADE Test Harness or @ref user_guides__test_harness "DRAW" provides an extensive set of tools for inspection and analysis of OCCT shapes and geometric objects and is mostly used as environment for prototyping and debugging OCCT-based algorithms.
|
||||
|
||||
In some cases the objects to be inspected are available in DRAW as results of DRAW commands. In other cases, however, it is necessary to inspect intermediate objects created by the debugged algorithm. To support this, DRAW provides a set of commands allowing the developer to store intermediate objects directly from the debugger stopped at some point during the program execution (usually at a breakpoint).
|
||||
|
||||
~~~~~
|
||||
const char* Draw_Eval (const char *theCommandStr)
|
||||
~~~~~
|
||||
|
||||
Evaluates a DRAW command or script.
|
||||
A command is passed as a string parameter.
|
||||
|
||||
~~~~~
|
||||
const char* DBRep_Set (const char* theNameStr, void* theShapePtr)
|
||||
~~~~~
|
||||
|
||||
Sets the specified shape as a value of DRAW interpreter variable with the given name.
|
||||
- *theNameStr* - the DRAW interpreter variable name to set.
|
||||
- *theShapePtr* - a pointer to *TopoDS_Shape* variable.
|
||||
|
||||
~~~~~
|
||||
const char* DrawTrSurf_Set (const char* theNameStr, void* theHandlePtr)
|
||||
const char* DrawTrSurf_SetPnt (const char* theNameStr, void* thePntPtr)
|
||||
const char* DrawTrSurf_SetPnt2d (const char* theNameStr, void* thePnt2dPtr)
|
||||
~~~~~
|
||||
|
||||
Sets the specified geometric object as a value of DRAW interpreter variable with the given name.
|
||||
- *theNameStr* - the DRAW interpreter variable name to set.
|
||||
- *theHandlePtr* - a pointer to the geometric variable (Handle to *Geom_Geometry* or *Geom2d_Curve* or descendant) to be set.
|
||||
- *thePntPtr* - a pointer to the variable of type *gp_Pnt* to be set.
|
||||
- *thePnt2dPtr* - a pointer to the variable of type *gp_Pnt2d* to be set.
|
||||
|
||||
All these functions are defined in *TKDraw* toolkit and return a string indicating the result of execution.
|
||||
|
||||
@subsection occt_debug_call_brep Saving and dumping shapes and geometric objects
|
||||
|
||||
The following functions are provided by *TKBRep* toolkit and can be used from debugger prompt:
|
||||
|
||||
~~~~~
|
||||
const char* BRepTools_Write (const char* theFileNameStr, void* theShapePtr)
|
||||
~~~~~
|
||||
|
||||
Saves the specified shape to a file with the given name.
|
||||
- *theFileNameStr* - the DRAW interpreter variable name to set.
|
||||
- *theShapePtr* - a pointer to *TopoDS_Shape* variable.
|
||||
|
||||
~~~~~
|
||||
const char* BRepTools_Dump (void* theShapePtr)
|
||||
const char* BRepTools_DumpLoc (void* theShapePtr)
|
||||
~~~~~
|
||||
|
||||
Dumps shape or its location to cout.
|
||||
- *theShapePtr* - a pointer to *TopoDS_Shape* variable.
|
||||
|
||||
The following additional function is provided by *TKGeomBase* toolkit:
|
||||
|
||||
~~~~~
|
||||
const char* GeomTools_Dump (void* theHandlePtr)
|
||||
~~~~~
|
||||
|
||||
Dump geometric object to cout.
|
||||
- *theHandlePtr* - a pointer to the geometric variable (<i>Handle</i> to *Geom_Geometry* or *Geom2d_Curve* or descendant) to be set.
|
||||
|
||||
@section occt_debug_vstudio Using Visual Studio debugger
|
||||
|
||||
@subsection occt_debug_vstudio_command Command window
|
||||
|
||||
Visual Studio debugger provides the Command Window (can be activated from menu <b>View / Other Windows / Command Window</b>), which can be used to evaluate variables and expressions interactively in a debug session (see http://msdn.microsoft.com/en-us/library/c785s0kz.aspx). Note that the Immediate Window can also be used but it has some limitations, e.g. does not support aliases.
|
||||
|
||||
When the execution is interrupted by a breakpoint, you can use this window to call the above described functions in context of the currently debugged function. Note that in most cases you will need to specify explicitly context of the function by indicating the name of the DLL where it is defined.
|
||||
|
||||
For example, assume that you are debugging a function, where local variable *TopoDS_Edge* *anEdge1* is of interest.
|
||||
The following set of commands in the Command window will save this edge to file *edge1.brep*, then put it to DRAW variable *e1* and show it maximized in the axonometric DRAW view:
|
||||
|
||||
~~~~~
|
||||
>? ({,,TKBRep.dll}BRepTools_Write)("d:/edge1.brep",(void*)&anEdge1)
|
||||
0x04a2f234 "d:/edge1.brep"
|
||||
>? ({,,TKDraw.dll}DBRep_Set)("e1",(void*)&anEdge1)
|
||||
0x0369eba8 "e1"
|
||||
>? ({,,TKDraw.dll}Draw_Eval)("donly e1; axo; fit")
|
||||
0x029a48f0 ""
|
||||
~~~~~
|
||||
|
||||
For convenience it is possible to define aliases to commands in this window, for instance (here ">" is prompt provided by the command window; in the Immediate window this symbol should be entered manually):
|
||||
|
||||
~~~~~
|
||||
>alias deval ? ({,,TKDraw}Draw_Eval)
|
||||
>alias dsetshape ? ({,,TKDraw}DBRep_Set)
|
||||
>alias dsetgeom ? ({,,TKDraw}DrawTrSurf_SetPnt)
|
||||
>alias dsetpnt2d ? ({,,TKDraw}DrawTrSurf_SetPnt2d)
|
||||
>alias saveshape ? ({,,TKBRep}BRepTools_Write)
|
||||
>alias dumpshape ? ({,,TKBRep}BRepTools_Dump)
|
||||
>alias dumploc ? ({,,TKBRep}BRepTools_DumpLoc)
|
||||
>alias dumpgeom ? ({,,TKGeomBase}GeomTools_Dump)
|
||||
~~~~~
|
||||
|
||||
Note that aliases are stored in the Visual Studio user's preferences and it is sufficient to define them once on a workstation. With these aliases, the above example can be reproduced easier (note the space symbol after alias name!):
|
||||
|
||||
~~~~~
|
||||
>saveshape ("d:/edge1.brep",(void*)&anEdge1)
|
||||
0x04a2f234 "d:/edge1.brep"
|
||||
>dsetshape ("e1",(void*)&anEdge1)
|
||||
0x0369eba8 "e1"
|
||||
>deval ("donly e1; axo; fit")
|
||||
0x029a48f0 ""
|
||||
~~~~~
|
||||
|
||||
Note that there is no guarantee that the call will succeed and will not affect the program execution, thus use this feature at your own risk. In particular, the commands interacting with window system (such as *axo*, *vinit*, etc.) are known to cause application crash when the program is built in 64-bit mode. To avoid this, it is recommended to prepare all necessary view windows in advance, and arrange these windows to avoid overlapping with the Visual Studio window, to ensure that they are visible during debug.
|
||||
|
||||
@subsection occt_debug_vstudio_watch Customized display of variables content
|
||||
|
||||
Visual Studio provides a way to customize display of variables of different types in debugger windows (Watch, Autos, Locals, etc.).
|
||||
|
||||
In Visual Studio 2005-2010 the rules for this display are defined in file *autoexp.dat* located in subfolder *Common7\\Packages\\Debugger* of the Visual Studio installation folder (hint: the path to that folder is given in the corresponding environment variable, e.g. *VS100COMNTOOLS* for vc10). This file contains two sections: *AutoExpand* and *Visualizer*. The following rules can be added to these sections to provide more convenient display of some OCCT data types.
|
||||
|
||||
### \[AutoExpand\] section
|
||||
|
||||
~~~~~
|
||||
; Open CASCADE classes
|
||||
Standard_Transient=<,t> count=<count,d>
|
||||
Handle_Standard_Transient=<entity,x> count=<entity->count,d> <,t>
|
||||
TCollection_AsciiString=<mylength,d> <mystring,s>
|
||||
TCollection_HAsciiString=<myString.mylength,d> <myString.mystring,s>
|
||||
TCollection_ExtendedString=<mylength,d> <mystring,su>
|
||||
TCollection_HExtendedString=<myString.mylength,d> <myString.mystring,su>
|
||||
TCollection_BaseSequence=size=<Size,d> curr=<CurrentIndex,d>
|
||||
TCollection_BasicMap=size=<mySize,d>
|
||||
NCollection_BaseSequence=size=<mySize,d> curr=<myCurrentIndex,d>
|
||||
NCollection_BaseList=length=<myLength,d>
|
||||
NCollection_BaseMap=size=<mySize,d> buckets=<myNbBuckets>
|
||||
NCollection_BaseVector=length=<myLength,d>
|
||||
TDF_Label=<myLabelNode,x> tag=<myLabelNode->myTag>
|
||||
TDF_LabelNode=tag=<myTag,d>
|
||||
TDocStd_Document=format=<myStorageFormat.mystring,su> count=<count,d> <,t>
|
||||
TopoDS_Shape=<myTShape.entity,x> <myOrient>
|
||||
gp_XYZ=<x,g>, <y,g>, <z,g>
|
||||
gp_Pnt=<coord.x,g>, <coord.y,g>, <coord.z,g>
|
||||
gp_Vec=<coord.x,g>, <coord.y,g>, <coord.z,g>
|
||||
gp_Dir=<coord.x,g>, <coord.y,g>, <coord.z,g>
|
||||
gp_XY=<x,g>, <y,g>
|
||||
gp_Pnt2d=<coord.x,g>, <coord.y,g>
|
||||
gp_Dir2d=<coord.x,g>, <coord.y,g>
|
||||
gp_Vec2d=<coord.x,g>, <coord.y,g>
|
||||
gp_Mat2d={<matrix[0][0],g>,<matrix[0][1],g>}, {<matrix[1][0],g>,<matrix[1][1],g>}
|
||||
gp_Ax1=loc={<loc.coord.x,g>, <loc.coord.y,g>, <loc.coord.z,g>} vdir={<vdir.coord.x,g>, <vdir.coord.y,g>, <vdir.coord.z,g>}
|
||||
~~~~~
|
||||
|
||||
### \[Visualizer\] section
|
||||
|
||||
~~~~~
|
||||
; Open CASCADE classes
|
||||
|
||||
NCollection_Handle<*> {
|
||||
preview ( *((($T0::Ptr*)$e.entity)->myPtr) )
|
||||
children ( (($T0::Ptr*)$e.entity)->myPtr )
|
||||
}
|
||||
|
||||
NCollection_List<*> {
|
||||
preview ( #( "NCollection_List [", $e.myLength, "]" ) )
|
||||
children ( #list( head: $c.myFirst, next: myNext ) : #(*($T1*)(&$e+1)) )
|
||||
}
|
||||
|
||||
NCollection_Array1<*> {
|
||||
preview ( #( "NCollection_Array1 [", $e.myLowerBound, "..", $e.myUpperBound, "]" ) )
|
||||
children ( #array( expr: $c.myData[$i], size: 1+$c.myUpperBound ) )
|
||||
}
|
||||
|
||||
math_Vector {
|
||||
preview ( #( "math_Vector [", $e.LowerIndex, "..", $e.UpperIndex, "]" ) )
|
||||
children ( #array ( expr: ((double*)($c.Array.Addr))[$i], size: 1+$c.UpperIndex ) )
|
||||
}
|
||||
|
||||
TColStd_Array1OfReal {
|
||||
preview ( #( "Array1OfReal [", $e.myLowerBound, "..", $e.myUpperBound, "]" ) )
|
||||
children ( #array ( expr: ((double*)($c.myStart))[$i], size: 1+$c.myUpperBound ) )
|
||||
}
|
||||
|
||||
Handle_TColStd_HArray1OfReal {
|
||||
preview ( #( "HArray1OfReal [",
|
||||
((TColStd_HArray1OfReal*)$e.entity)->myArray.myLowerBound, "..",
|
||||
((TColStd_HArray1OfReal*)$e.entity)->myArray.myUpperBound, "] ",
|
||||
[$e.entity,x], " count=", $e.entity->count ) )
|
||||
children ( #array ( expr: ((double*)(((TColStd_HArray1OfReal*)$e.entity)->myArray.myStart))[$i],
|
||||
size: 1+((TColStd_HArray1OfReal*)$e.entity)->myArray.myUpperBound ) )
|
||||
}
|
||||
|
||||
TColStd_Array1OfInteger {
|
||||
preview ( #( "Array1OfInteger [", $e.myLowerBound, "..", $e.myUpperBound, "]" ) )
|
||||
children ( #array ( expr: ((int*)($c.myStart))[$i], size: 1+$c.myUpperBound ) )
|
||||
}
|
||||
|
||||
Handle_TColStd_HArray1OfInteger {
|
||||
preview ( #( "HArray1OfInteger [",
|
||||
((TColStd_HArray1OfInteger*)$e.entity)->myArray.myLowerBound, "..",
|
||||
((TColStd_HArray1OfInteger*)$e.entity)->myArray.myUpperBound, "] ",
|
||||
[$e.entity,x], " count=", $e.entity->count ) )
|
||||
children ( #array ( expr: ((int*)(((TColStd_HArray1OfInteger*)$e.entity)->myArray.myStart))[$i],
|
||||
size: 1+((TColStd_HArray1OfInteger*)$e.entity)->myArray.myUpperBound ) )
|
||||
}
|
||||
|
||||
Handle_TCollection_HExtendedString {
|
||||
preview ( #( "HExtendedString ", [$e.entity,x], " count=", $e.entity->count,
|
||||
" ", ((TCollection_HExtendedString*)$e.entity)->myString ) )
|
||||
children ( #([actual members]: [$e,!] ) )
|
||||
}
|
||||
|
||||
Handle_TCollection_HAsciiString {
|
||||
preview ( #( "HAsciiString ", [$e.entity,x], " count=", $e.entity->count,
|
||||
" ", ((TCollection_HAsciiString*)$e.entity)->myString ) )
|
||||
children ( #([actual members]: [$e,!],
|
||||
#array( expr: ((TCollection_HAsciiString*)$e.entity)->myString.mystring[$i],
|
||||
size: ((TCollection_HAsciiString*)$e.entity)->myString.mylength) ) )
|
||||
}
|
||||
~~~~~
|
||||
|
||||
In Visual Studio 2012 and later, visualizers can be put in a separate file in subdirectory *Visualizers*. See file *occt.natvis* for example.
|
@@ -9,6 +9,7 @@ The following documents provide information on OCCT building, development and te
|
||||
* @subpage dev_guides__contribution_workflow "Contribution Workflow"
|
||||
* @subpage dev_guides__git_guide "Guide to installing and using Git for OCCT development"
|
||||
* @subpage dev_guides__tests "Automatic Testing system"
|
||||
* @subpage dev_guides__debug "Debugging tools and hints"
|
||||
|
||||
Two other documents provide details on obsolete technologies used by OCCT,
|
||||
to be removed in future releases:
|
||||
|
@@ -5,133 +5,123 @@
|
||||
|
||||
@section OCCT_DM_SECTION_1 Introduction
|
||||
|
||||
This document provides practical guidenes for generation and editing of OCCT user documentation.
|
||||
This document provides practical guidelines for generation and editing of OCCT user documentation.
|
||||
|
||||
@section OCCT_DM_SECTION_2 Prerequisites
|
||||
|
||||
<b>Tcl/Tk</b>
|
||||
You need to have the following software installed to generate the documentation.
|
||||
|
||||
**Tcl/Tk**
|
||||
Version 8.5 or 8.6: http://www.tcl.tk/software/tcltk/download.html
|
||||
|
||||
<b>Doxygen</b>
|
||||
**Doxygen**
|
||||
Version 1.8.4 or above: http://www.stack.nl/~dimitri/doxygen/download.html
|
||||
|
||||
<b>MathJax</b> (used for rendering math formulas in browser).
|
||||
See \ref OCCT_DM_SECTION_A_9 paragraph for more detailed description.
|
||||
The latest version: http://www.mathjax.org/download/
|
||||
**MiKTeX** or other package providing **pdflatex** command (only needed for generation of PDF documents): http://miktex.org/download
|
||||
|
||||
<b>MiKTeX</b> or equivalent tool (used for PDF document creation)
|
||||
**Inkscape** (only needed for generation of PDF documents containing SVG images): http://www.inkscape.org/download
|
||||
|
||||
Latest version: http://miktex.org/download
|
||||
When generating PDF documentation, **pdflatex** and **inkscape** executables should be accessible by PATH variable.
|
||||
You can use *custom.bat* file to add necessary paths to the *PATH* variable.
|
||||
|
||||
**Note**: to generate pdf documentation with MiKTeX you should execute gendoc.bat within MiKTeX environment
|
||||
(run gendoc.bat in MiKTeX command promt or update PATH for MiKTeX bin folder). Also in process of pdf generation
|
||||
MiKTeX can request you to download missing packages if MiKTeX was installed with option below:
|
||||
Note that in the process of PDF generation MiKTeX may need some packages not installed by default.
|
||||
We recommend setting option "Install missing packages on-the-fly" to "Ask me first" (default) during MiKTeX installation:
|
||||
|
||||
@image html /dev_guides/documentation/images/documentation_image002.png
|
||||
@image latex /dev_guides/documentation/images/documentation_image002.png
|
||||
@figure{/dev_guides/documentation/images/documentation_miktex.png}
|
||||
|
||||
If this option is set to "Yes", MiKTeX will download missing packages automatically.
|
||||
On the first run of **pdflatex** it will open a dialog window prompting for installation of missing packages.
|
||||
Follow the instructions to proceed (define proxy settings if needed, select a mirror site to download from, etc.).
|
||||
|
||||
**MathJax** is used for rendering math formulas in browser (HTML and CHM outputs): http://www.mathjax.org.
|
||||
|
||||
By default MathJAX scripts and fonts are taken from http://cdn.mathjax.org/mathjax/latest and no installation of MathJAX is necessary if Internet is accessible.
|
||||
If you need to use OCCT documentation while off-line, you can install a local copy of MatJAX, see http://www.mathjax.org/download/.
|
||||
See \ref OCCT_DM_SECTION_A_9 for more details on inserting mathematical expressions.
|
||||
|
||||
@section OCCT_DM_SECTION_2_1 Documentation Generation
|
||||
|
||||
Run gendoc.bat from OCCT directory to generate all articles are defined in FILES.txt:
|
||||
Run *gendoc.bat* from OCCT directory to generate all documents defined in *FILES.txt*:
|
||||
|
||||
gendoc.bat options:
|
||||
*gendoc.bat* can be started with the following 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).
|
||||
* <i>-html</i> : Generates HTML files (cannot be used with -pdf);
|
||||
* <i>-pdf</i> : Generates PDF files (cannot be used with -html);
|
||||
* <i>-m=\<modules_list\></i> : Specifies the list of documents to generate. If it is not specified, all files mentioned in *FILES.txt* are processed;
|
||||
* <i>-l=\<document_name\></i> : Specifies the output document title;
|
||||
* <i>-mathjax=\<path\></i> : Specifies the path to a non-default location of MathJAX;
|
||||
* <i>-h</i> : Prints a help message;
|
||||
* <i>-v</i> : Toggles 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.
|
||||
If you run the command without arguments (like in the example above) it will generate HTML documentation for all documents defined in *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.
|
||||
**Note**
|
||||
|
||||
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).
|
||||
* In case of a PDF output the utility generates a separate PDF file for each document;
|
||||
* In case of an HTML output the utility generates a common Table of contents containing references to all documents.
|
||||
|
||||
@verbatim
|
||||
devs_guid/documentation/documentation.md
|
||||
@endverbatim
|
||||
To generate the output for a specific document specify the path to the corresponding MarkDown file (paths relative to *dox* sub-folder can be given), for instance:
|
||||
|
||||
where documentation .md is name of article and devs_guid/documentation/ is relative path of it
|
||||
~~~~
|
||||
% gendoc.bat -html -m=dev_guides/documentation/documentation.md
|
||||
~~~~
|
||||
|
||||
* use this name with -m option in the generation process:
|
||||
Multiple files can be separated with commas:
|
||||
~~~~
|
||||
% gendoc.bat -html -m=MD_FILE_1,MD_FILE_2
|
||||
~~~~
|
||||
|
||||
@verbatim
|
||||
% gendoc.bat -html -m=devs_guid/documentation/documentation.md
|
||||
@endverbatim
|
||||
Use quotes to specify an article name with <i>-l</i> option, which helps to prevent incorrect interpretation of white spaces:
|
||||
|
||||
Multiple files are separated with comma:
|
||||
|
||||
@verbatim
|
||||
% gendoc.bat -html -m=MD_FILE_1,MD_FILE_2
|
||||
@endverbatim
|
||||
|
||||
To sepcify a article name with -l option, use quotes to prevent incorrect interpretation of whitespaces:
|
||||
|
||||
@verbatim
|
||||
% gendoc.bat -pdf -m=MD_FILE_1 -l="Label of MD_FILE_1 document"
|
||||
@endverbatim
|
||||
~~~~
|
||||
% gendoc.bat -pdf -m=MD_FILE_1 -l="Label of MD_FILE_1 document"
|
||||
~~~~
|
||||
|
||||
@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.
|
||||
This section contains information about file format conventions, directories structure, etc.
|
||||
|
||||
@subsection OCCT_DM_SECTION_3_1 File Format
|
||||
|
||||
The format used for documentation is MarkDown with Doxygen extensions.
|
||||
The MarkDown files have a "*.md" extension and are based on rules desribed in
|
||||
\ref OCCT_DM_SECTION_A section.
|
||||
The MarkDown files have a <i>*.md</i> extension and are based on rules described in \ref OCCT_DM_SECTION_A section.
|
||||
|
||||
@subsection OCCT_DM_SECTION_3_2 Directory Structure
|
||||
|
||||
@image html /dev_guides/documentation/images/documentation_image001.png
|
||||
@image latex /dev_guides/documentation/images/documentation_image001.png
|
||||
@figure{/dev_guides/documentation/images/documentation_folders.png}
|
||||
|
||||
Every separate article has own folder if images are used in it. These images
|
||||
are stored into "images" subfolder.
|
||||
Each document has its own folder if there are any images used in it. These images are stored in *images* subfolder.
|
||||
|
||||
If you want to use the same image for several documents, you can place it in *dox/resources* folder.
|
||||
|
||||
**Note**: To avoid incorrect image display, use a relative path to the image (starting from *dox* folder). For instance:
|
||||
|
||||
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
|
||||
@image html /dev_guides/snv/images/snv_image001.svg
|
||||
@figure{/dev_guides/documentation/images/documentation_test_image.svg}
|
||||
@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.
|
||||
The documentation is generated in subfolder *doc* :
|
||||
* *html* - a directory for generated HTML pages;
|
||||
* *pdf* - a directory for generated PDF files.
|
||||
|
||||
@section OCCT_DM_SECTION_4 Adding a New Article
|
||||
@section OCCT_DM_SECTION_4 Adding a New Document
|
||||
|
||||
- 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/dev_guides/ . If the article has images then you may create
|
||||
the own folder of the article and subfolder in it for images. For instance
|
||||
*/dox/dev_guides/svn/ - for svn.md file
|
||||
*/dox/dev_guides/svn/images/ - for images
|
||||
Place a new document in the folder taking into account its logical position in the documentation hierarchy. For instance, the document *svn.md* about the use of SVN to work with OCCT source code can be placed into <i>/dox/dev_guides/</i>.
|
||||
|
||||
If there are images in the document, it should be placed in its own folder containing a subfolder for images. For instance:
|
||||
* <i> /dox/dev_guides/svn/ </i> - for *svn.md* file;
|
||||
* <i> /dox/dev_guides/svn/images/ </i> - for images.
|
||||
|
||||
Add a relative path to *svn.md* in file <i>dox/FILES.txt</i>. For instance
|
||||
|
||||
- Update dox/FILES.txt to add relative path to svn.md. For instance
|
||||
@verbatim
|
||||
dev_guides/snv/svn.md
|
||||
dev_guides/svn/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 the order of paths to documents in *FILES.txt* is reproduced in the Table of Contents in the HTML output. Please, place them logically.
|
||||
|
||||
|
||||
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.
|
||||
**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
|
||||
|
||||
@@ -145,69 +135,60 @@ 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:
|
||||
A document file in *.md format must start with a proper header defining a caption and a unique tag.
|
||||
|
||||
@verbatim
|
||||
Header 1 {#header1}
|
||||
=======
|
||||
Documentation System {#dev_guides__documentation}
|
||||
=====================
|
||||
@endverbatim
|
||||
|
||||
to get
|
||||
The document structure is formed by sections that must be defined consistently.
|
||||
|
||||
Header 1
|
||||
=========
|
||||
The document can contain plain text, lists, tables, code snippets, images, math, etc.
|
||||
Any specific text elements can be introduced by Markdown language tags or by usual HTML tags.
|
||||
|
||||
and with the following code:
|
||||
The table of contents, page numbers (in PDF), and figure numbers (in PDF) are generated automatically.
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_1 Headers and hierarchic document structure
|
||||
|
||||
Headers of different levels can be specified with the following tags:
|
||||
* <i>\@section</i> - for the first-level headers;
|
||||
* <i>\@subsection</i> - for the second level headers;
|
||||
* <i>\@subsubsection</i> - for the third level headers.
|
||||
|
||||
For example:
|
||||
|
||||
@verbatim
|
||||
Header 2 {#header2}
|
||||
--------
|
||||
@section occt_ocaf_1 Basic Concepts
|
||||
@subsection occt_ocaf_1_1 Applications and Documents
|
||||
@subsubsection occt_ocaf_1_1_1 The document and the data framework
|
||||
@endverbatim
|
||||
|
||||
to get
|
||||
Please, note that section names can be used for references within the document and in other documents, so it is necessary to use the common prefix indicative of the document name for all section names in the given document.
|
||||
For example, *occt_ocaf* for sections in Open CASCADE Application Framework manual.
|
||||
|
||||
Header 2
|
||||
---------
|
||||
The remaining part of section names in most documents consists only of numbers, for example *1_1*. Actually, the hierarchical structure of the output table of contents is not based on these numbers and is generated automatically.
|
||||
|
||||
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:
|
||||
The numbers are only indicative of a section location in the body of the document. However, duplicate section names in a document inevitably cause errors during generation.
|
||||
|
||||
@verbatim
|
||||
@section Section_Name Section Header
|
||||
@subsection SubSection_Name SubSection Header
|
||||
@subsubsection SubSubSection_Name SubSubSection Header
|
||||
@endverbatim
|
||||
If you insert a section in the middle of a big document, do not renumber the document to the end (which is inefficient and error prone), but choose an arbitrary number or letter, not yet used in the document section naming, and base the naming in this section on it.
|
||||
|
||||
The section hierarchy is limited to three levels and further levels cannot be presented in the Table of Contents.
|
||||
|
||||
However, the fourth and fifth level headers can be tagged with <i>####</i> and <i>#####</i> correspondingly.
|
||||
|
||||
It is also possible to use tags <i>##</i> and <i>###</i> for second and third level headers if you do not wish to show them in the table of contents or make references to them.
|
||||
|
||||
@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**.
|
||||
A plain text is organized in paragraphs, separated by empty lines in MarkDown source.
|
||||
The length of lines is not restricted; it is recommended to put each sentence on a separate line -- this is optimal for easier comparison of different versions of the same document.
|
||||
|
||||
To insert special symbols, like \< , \> or \\, prepend them with \\ character: \\\<, \\\>, \\\\, etc.
|
||||
To emphasize a word or a group of words, wrap the text with one pair of asterisks (*) or underscores (_) to make it *italic* and two pairs of these symbols to make it **Bold**.
|
||||
|
||||
**Note** that if your emphasized text starts or ends with a special symbol, the asterisks may not work. Use explicit HTML tags \<i\>\</i\> and \<b\>\</b\> instead.
|
||||
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_3 Lists
|
||||
|
||||
@@ -238,7 +219,7 @@ then a space. Numbered lists can also be nested. Thus this code
|
||||
1. Sub-item 1
|
||||
2. Sub-item 2
|
||||
2. List item 2
|
||||
3. List item 3
|
||||
4. List item 3
|
||||
@endverbatim
|
||||
|
||||
produces this list:
|
||||
@@ -249,6 +230,11 @@ produces this list:
|
||||
2. List item 2
|
||||
3. List item 3
|
||||
|
||||
**Note** that numbers of list items in the output are generated so they do not necessarily follow the numbering of source items.
|
||||
|
||||
In some cases automatic generation adversely restarts the numbering, i.e. you get list items 1. 1. 1. instead of 1. 2. 3. in the output.
|
||||
The use of explicit HTML tags \<ol\>\</ol\> and \<li\>\</li\> can help in this case.
|
||||
|
||||
Each list item can contain several paragraphs of text; these paragraphs must
|
||||
have the same indentation as text after bullet or number in the numbered list
|
||||
item (otherwise numbering will be broken).
|
||||
@@ -258,29 +244,7 @@ Code blocks can be inserted as paragraphs with additional indentation
|
||||
and their use may cause numeration to be reset.
|
||||
|
||||
|
||||
Example of complex nested list:
|
||||
|
||||
@verbatim
|
||||
1. ListItem_1
|
||||
|
||||
Additional paragraph
|
||||
|
||||
code fragment
|
||||
|
||||
One more paragraph
|
||||
|
||||
1. Sub-item 1
|
||||
|
||||
code fragment for sub-item 1
|
||||
|
||||
2. Sub-item 2
|
||||
|
||||
Paragraph for sub-item 2
|
||||
|
||||
Yet one more paragraph for list item 1
|
||||
|
||||
2. ListItem_2
|
||||
@endverbatim
|
||||
Example of a complex nested list:
|
||||
|
||||
1. List item 1
|
||||
|
||||
@@ -302,8 +266,6 @@ Example of complex nested list:
|
||||
|
||||
2. List item 2
|
||||
|
||||
Note that numbers of paragraphs are regenerated so they do not necessarily
|
||||
follow numbering of source items.
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_4 Tables
|
||||
|
||||
@@ -340,19 +302,19 @@ which will looks as follows:
|
||||
| 10 | 10 | 10 |
|
||||
| 1000 | 1000 | 1000 |
|
||||
|
||||
Note that each table raw should be contained in one line of text; complex
|
||||
tables can be created using HTML tags.
|
||||
Note that each table row should be contained in one line of text; complex tables can be created using HTML tags.
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_5 Code Blocks
|
||||
|
||||
It is recommended to indent a code lines with 4 spaces.
|
||||
Paragraphs indented with 4 or more spaces are considered as code fragments and rendered using Courier font.
|
||||
Example:
|
||||
|
||||
This line is indented by 4 spaces and rendered as a code block.
|
||||
|
||||
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
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
The end of the block should have the same number of tildes.
|
||||
Thus it is strongly advised to use only three or four tildes.
|
||||
|
||||
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,
|
||||
@@ -360,99 +322,84 @@ 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}
|
||||
~~~{.cpp}
|
||||
int func(int a,int b) { return a*b; }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~
|
||||
@endverbatim
|
||||
|
||||
which will produce:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
|
||||
~~~{.cpp}
|
||||
int func(int a,int b) { return a*b; }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~
|
||||
|
||||
Verbatim content can be written by using framing \@verbatim \@endverbatim . For instance
|
||||
|
||||
verbatim text
|
||||
Smaller code blocks can be inserted by wrapping with tags <i>\@code</i> and <i>\@endcode</i>.
|
||||
|
||||
Verbatim content (same as code but without syntax highlighting) can be inserted by wrapping with tags <i>\@verbatim</i> and <i>\@endverbatim</i>.
|
||||
|
||||
@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:
|
||||
To insert a reference to a website, it is sufficient to write an URL.
|
||||
For example: http://en.wikipedia.org
|
||||
|
||||
@verbatim
|
||||
@htmlonly
|
||||
<a href="#OCCT_DOC_SECTION_5">Doxygen Configuration file</a>
|
||||
@endhtmlonly
|
||||
@endverbatim
|
||||
To insert a reference to a document or its subsection, use command <i>\@ref</i> followed by the document or section tag name.
|
||||
For instance, @code @ref OCCT_DM_SECTION_A @endcode will be rendered as @ref OCCT_DM_SECTION_A.
|
||||
|
||||
to get a link to paragraph : @htmlonly <a href="#OCCT_DOC_SECTION_5">Doxygen configuration</a> @endhtmlonly
|
||||
Note that links between documents will not work in PDF output if each document is generated independently.
|
||||
Hence it is recommended to add a name of the referenced section after the tag name in the <i>\@ref</i> command (in quotes): this will guarantee that the reference is recognizable for the reader even if the cross-link is not instantiated.
|
||||
For instance: @code @ref occt_modat_1 "Geometry Utilities" @endcode will be rendered as @ref occt_modat_1 "Geometry Utilities".
|
||||
|
||||
@subsection OCCT_DM_SECTION_A_7 Images
|
||||
|
||||
To insert image into document the developer can write the following code(in Doxygen-style):
|
||||
For inserting images into the document use the command <i>\@figure</i>, as follows:
|
||||
|
||||
For HTML document:
|
||||
@verbatim
|
||||
@image html /relative/path/to/image/image001.png "Image caption"
|
||||
@figure{/relative/path/to/image/image_file_name.png,"Image caption"}
|
||||
@endverbatim
|
||||
|
||||
For latex document:
|
||||
The first argument is a path to the image file, relative to the *dox* folder.
|
||||
The supported formats for images are PNG, JPG, and SVG.
|
||||
The file extension must be lowercase and correspond to the file format.
|
||||
The image file name should have no dots except for the one before extension (names with more than one dot confuse **pdflatex**).
|
||||
|
||||
The second argument is optional, it defines the caption for the image to be inserted.
|
||||
The caption argument, if given, should be quoted, even if it is a single word.
|
||||
Captions are included below the image; in PDF output the images with caption are numbered automatically.
|
||||
|
||||
Example:
|
||||
|
||||
@verbatim
|
||||
@image latex /relative/path/to/image/image001.png "Image caption"
|
||||
@figure{/dev_guides/documentation/images/documentation_test_image.svg,"Test SVG image"}
|
||||
@endverbatim
|
||||
|
||||
*Note*: When markdown document is used to generate html document the latex insertion is ignored (and vice versa)
|
||||
due to this fact you can use image insertions in the pair, like example below:
|
||||
is rendered as:
|
||||
|
||||
@figure{/dev_guides/documentation/images/documentation_test_image.svg,"Test SVG image"}
|
||||
|
||||
We recommend using **Inkscape** for creation and edition of vector graphics.
|
||||
The graphics created in MS Word Draw and some other vector editors can be copy-pasted to Inkscape and saved as SVG images.
|
||||
|
||||
Note that the image that will be included in documentation is the whole page of the Inkscape document; use option "Resize page to content" in menu **File -> Document properties** of Inkscape to fit page dimensions to the picture (adding margins as necessary).
|
||||
|
||||
Note that the *figure* command is an alias to the standard Doxygen command *image* repeated twice: once for HTML and then for Latex output (used for PDF generation). Thus if HTML and PDF outputs should include different images or captions, command "image" can be used:
|
||||
|
||||
@verbatim
|
||||
@image html /relative/path/to/image/image001.png "Image caption"
|
||||
@image latex /relative/path/to/image/image001.png "Image caption"
|
||||
@image html /relative/path/to/image/occ_logo.png
|
||||
@image latex /relative/path/to/image/occ_logo.png "OCC logo"
|
||||
@endverbatim
|
||||
|
||||
The code below tells Doxygen to insert a picture right in the place this code was written:
|
||||
@verbatim
|
||||
@image html /resources/occ_logo.png "OCCT logo"
|
||||
@image latex /resources/occ_logo.png "OCCT logo"
|
||||
@endverbatim
|
||||
|
||||
@image html /resources/occ_logo.png "OCCT logo"
|
||||
@image latex /resources/occ_logo.png "OCCT logo"
|
||||
@image html /resources/occ_logo.png
|
||||
@image latex /resources/occ_logo.png "OCC logo"
|
||||
|
||||
@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.
|
||||
Use \@tableofcontents tag to get the table of contents at the beginning of the document.
|
||||
|
||||
Actually, it is not strictly necessary 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.
|
||||
Formulas within MarkDown documents can be defined using LaTeX syntax.
|
||||
|
||||
Equations can be written by several ways:
|
||||
|
||||
@@ -485,8 +432,10 @@ gives the following result:
|
||||
\right|
|
||||
@f$
|
||||
|
||||
2.Formulas can also be put between @verbatim \begin{align} @endverbatim and @verbatim \end{align} @endverbatim tags. An example:
|
||||
2.Formulas can also be put between @verbatim \begin{align} @endverbatim and @verbatim \end{align} @endverbatim tags.
|
||||
|
||||
For example:
|
||||
|
||||
@verbatim
|
||||
\begin{align}
|
||||
\dot{x} & = \sigma(y-x) \\
|
||||
|
BIN
dox/dev_guides/documentation/images/documentation_folders.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 37 KiB |
BIN
dox/dev_guides/documentation/images/documentation_miktex.png
Normal file
After Width: | Height: | Size: 16 KiB |
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="443.5307"
|
||||
height="187.48862"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="test_image.svg">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.35"
|
||||
inkscape:cx="295.90235"
|
||||
inkscape:cy="-323.77532"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1366"
|
||||
inkscape:window-height="716"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:snap-page="false"
|
||||
borderlayer="false"
|
||||
fit-margin-top="5"
|
||||
fit-margin-left="5"
|
||||
fit-margin-right="5"
|
||||
fit-margin-bottom="5" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-79.097656,-21.098232)">
|
||||
<path
|
||||
sodipodi:type="spiral"
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
id="path2985"
|
||||
sodipodi:cx="142.85715"
|
||||
sodipodi:cy="126.6479"
|
||||
sodipodi:expansion="1"
|
||||
sodipodi:revolution="3"
|
||||
sodipodi:radius="73.178566"
|
||||
sodipodi:argument="-18.174814"
|
||||
sodipodi:t0="0"
|
||||
d="m 142.85715,126.6479 c 2.86505,2.29205 -1.67612,4.99285 -3.80953,4.76191 -5.78142,-0.62584 -7.49143,-7.75205 -5.71428,-12.38096 3.17892,-8.28004 13.59119,-10.36558 20.95239,-6.66665 10.80286,5.42832 13.31404,19.50561 7.61903,29.52381 -7.59056,13.35269 -25.44626,16.29352 -38.09525,8.5714 -15.91746,-9.71749 -19.28891,-31.39926 -9.52378,-46.66667 11.82689,-18.490884 37.35922,-22.29349 55.23811,-10.476151 21.06966,13.926321 25.30383,43.323481 11.42852,63.809531 -16.01959,23.65196 -49.29063,28.31803 -72.38096,12.3809 C 82.334702,151.39625 77.236493,114.2452 95.238126,88.552628 115.43324,59.729444 156.46861,54.198885 184.76195,74.26698 c 31.41097,22.27939 37.37404,67.20227 15.23802,98.09525" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
x="225.71429"
|
||||
y="55.219326"
|
||||
id="text2987"
|
||||
sodipodi:linespacing="125%"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan2989"
|
||||
x="225.71429"
|
||||
y="55.219326">Test SVG image</tspan></text>
|
||||
<path
|
||||
style="fill:#d40000"
|
||||
id="path2996"
|
||||
d="m 225.93253,80.077991 c 3.24312,6.556366 8.29882,11.800272 13.5792,16.763957 4.5107,4.980932 7.56994,10.929012 10.6621,16.828992 2.61039,5.79272 3.86714,11.94331 7.08009,17.44901 3.75425,6.35398 6.70021,13.19689 8.79217,20.27197 4.84784,15.88966 11.74851,2.45314 -37.25143,18.61001 -0.78487,0.2588 0.15562,-1.64589 0.20424,-2.47091 0.0536,-0.90872 0.0682,-1.81932 0.10224,-2.72899 0.17911,-6.50471 -0.15488,-13.01656 0.28271,-19.50992 0.46019,-6.30504 2.24023,-12.34988 4.0286,-18.37582 2.36519,-5.44796 6.30711,-10.00347 9.73908,-14.79837 3.98599,-5.97976 8.02146,-11.96839 13.10341,-17.072556 4.37574,-4.432922 8.35123,-9.243914 12.37764,-13.99199 4.43478,-4.829914 10.15101,-8.139537 15.06208,-12.425011 14.95925,-12.429871 35.2123,-18.385688 51.95332,-26.62658 11.5059,-5.663868 -23.27039,10.786567 -34.90558,16.179851 17.6228,-9.547136 35.52389,-19.290175 55.17352,-23.555822 4.29932,-0.713125 2.15416,-0.406331 6.43505,-0.923403 0,0 -35.68459,22.595324 -35.68459,22.595324 l 0,0 c -4.12774,0.727408 -2.06126,0.312559 -6.19873,1.248113 -3.11612,0.864072 -6.22731,1.766121 -9.25625,2.908329 -0.8427,0.317783 -3.30812,1.424428 -2.49421,1.03881 40.69568,-19.281166 46.47137,-22.237336 32.54467,-15.189227 -79.1837,37.555094 -31.13152,14.703661 -6.06008,3.03043 4.62777,-2.154687 -15.27783,7.276298 -11.28272,6.532336 -1.75524,1.522667 -3.27126,3.31763 -5.09432,4.758404 -3.18452,2.516733 -7.13492,4.190007 -9.93487,7.239896 -4.62518,4.303389 -8.28044,9.606276 -12.50569,14.296007 -0.80437,0.69437 -4.493,3.820284 -5.21444,4.670532 -2.98505,3.518007 -5.33483,7.691189 -8.08882,11.393589 -2.92337,4.905278 -6.62131,9.277358 -10.15131,13.755678 -2.01215,5.68475 -3.56944,11.57461 -4.40544,17.54154 -0.83081,6.35553 -0.13439,12.77693 -0.29528,19.17264 -0.0102,1.50844 -0.0276,5.46288 -0.0732,5.48876 -34.08891,19.36365 -36.17581,33.13461 -40.63381,14.4297 -1.84609,-6.79718 -4.68694,-13.28977 -8.31428,-19.32972 -3.24304,-5.58446 -4.82126,-11.64528 -7.31615,-17.57296 -2.8174,-5.54315 -5.55105,-11.15816 -9.9264,-15.68612 -5.41001,-5.49645 -10.6705,-11.1173 -14.41843,-17.919019 0,0 38.38591,-18.02746 38.38591,-18.02746 z"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="translate(84.097656,26.098232)" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.5 KiB |
168
dox/occdoc.tcl
@@ -20,7 +20,7 @@ proc OverviewDoc_DetectCasVersion {theCasRoot} {
|
||||
}
|
||||
|
||||
# Generates Doxygen configuration file for Overview documentation
|
||||
proc OverviewDoc_MakeDoxyfile {casDir outDir tagFileDir {doxyFileName} {generatorMode ""} DocFilesList verboseMode searchMode hhcPath} {
|
||||
proc OverviewDoc_MakeDoxyfile {casDir outDir tagFileDir {doxyFileName} {generatorMode ""} DocFilesList verboseMode searchMode hhcPath mathjaxLocation} {
|
||||
|
||||
set doxyFile [open $doxyFileName "w"]
|
||||
set casroot $casDir
|
||||
@@ -83,6 +83,10 @@ proc OverviewDoc_MakeDoxyfile {casDir outDir tagFileDir {doxyFileName} {generato
|
||||
# Keep doxygen comments within code blocks
|
||||
puts $doxyFile "STRIP_CODE_COMMENTS = NO"
|
||||
|
||||
# Define alias for inserting images to both HRML and PDF at once
|
||||
puts $doxyFile "ALIASES += figure\{1\}=\"\\image html \\1 \\n \\image latex \\1\""
|
||||
puts $doxyFile "ALIASES += figure\{2\}=\"\\image html \\1 \\2 \\n \\image latex \\1 \\2\""
|
||||
|
||||
set PARAM_INPUT "INPUT ="
|
||||
set PARAM_IMAGEPATH "IMAGE_PATH = $inputDir/resources/ "
|
||||
|
||||
@@ -150,7 +154,7 @@ proc OverviewDoc_MakeDoxyfile {casDir outDir tagFileDir {doxyFileName} {generato
|
||||
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"
|
||||
puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
|
||||
|
||||
} elseif { $generatorMode == "CHM_ONLY"} {
|
||||
puts $doxyFile "GENERATE_HTMLHELP = YES"
|
||||
@@ -162,7 +166,7 @@ proc OverviewDoc_MakeDoxyfile {casDir outDir tagFileDir {doxyFileName} {generato
|
||||
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"
|
||||
puts $doxyFile "MATHJAX_RELPATH = ${mathjaxLocation}"
|
||||
|
||||
} elseif { $generatorMode == "PDF_ONLY"} {
|
||||
puts $doxyFile "GENERATE_HTMLHELP = NO"
|
||||
@@ -215,25 +219,26 @@ proc OverviewDoc_PrintHelpMessage {} {
|
||||
puts "\nUsage : occdoc \[-h\] \[-html\] \[-pdf\] \[-m=<list of files>\] \[-l=<document name>\] \[-v\] \[-s\]"
|
||||
puts ""
|
||||
puts " Options are : "
|
||||
puts " -html : To generate HTML files"
|
||||
puts " (cannot be used with -pdf or -chm)"
|
||||
puts " -pdf : To generate PDF files"
|
||||
puts " (cannot be used with -html or chm)"
|
||||
puts " -chm : To generate CHM files"
|
||||
puts " (cannot be used with -html or pdf)"
|
||||
puts " -hhc : To define path to hhc - chm generator"
|
||||
puts " : is used with just -chm option"
|
||||
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)"
|
||||
puts " -s=<search_mode> : Specifies the Search mode of HTML documents."
|
||||
puts " Can be: none | local | server | external | "
|
||||
puts " : Can be used only with -html option"
|
||||
puts " -html : To generate HTML files"
|
||||
puts " (cannot be used with -pdf or -chm)"
|
||||
puts " -pdf : To generate PDF files"
|
||||
puts " (cannot be used with -html or chm)"
|
||||
puts " -chm : To generate CHM files"
|
||||
puts " (cannot be used with -html or pdf)"
|
||||
puts " -hhc : To define path to hhc - chm generator"
|
||||
puts " : is used with just -chm option"
|
||||
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)"
|
||||
puts " -s=<search_mode> : Specifies the Search mode of HTML documents."
|
||||
puts " Can be: none | local | server | external"
|
||||
puts " : Can be used only with -html option"
|
||||
puts " -mathjax=<path> : To use local or alternative copy of MathJax"
|
||||
}
|
||||
|
||||
# Parses command line arguments
|
||||
@@ -310,6 +315,9 @@ proc OverviewDoc_MakeRefmanTex {fileName latexDir docLabel verboseMode} {
|
||||
if {[file exists $DOCNAME] == 1} {
|
||||
file delete -force $DOCNAME
|
||||
}
|
||||
|
||||
set year [clock format [clock seconds] -format {%Y}]
|
||||
|
||||
set texfile [open $DOCNAME w]
|
||||
|
||||
puts $texfile "\\batchmode"
|
||||
@@ -384,8 +392,8 @@ proc OverviewDoc_MakeRefmanTex {fileName latexDir docLabel verboseMode} {
|
||||
puts $texfile "\\fancyhead\[RO\]{\\fancyplain{}{\\bfseries\\thepage}}"
|
||||
puts $texfile "\\fancyfoot\[LE\]{\\fancyplain{}{}}"
|
||||
puts $texfile "\\fancyfoot\[CE\]{\\fancyplain{}{}}"
|
||||
puts $texfile "\\fancyfoot\[RE\]{\\fancyplain{}{\\bfseries\\scriptsize (c) Open CASCADE 2001\-2013}}"
|
||||
puts $texfile "\\fancyfoot\[LO\]{\\fancyplain{}{\\bfseries\\scriptsize (c) Open CASCADE 2001\-2013}}"
|
||||
puts $texfile "\\fancyfoot\[RE\]{\\fancyplain{}{\\bfseries\\scriptsize Copyright (c) Open CASCADE $year}}"
|
||||
puts $texfile "\\fancyfoot\[LO\]{\\fancyplain{}{\\bfseries\\scriptsize Copyright (c) Open CASCADE $year}}"
|
||||
puts $texfile "\\fancyfoot\[CO\]{\\fancyplain{}{}}"
|
||||
puts $texfile "\\fancyfoot\[RO\]{\\fancyplain{}{}}"
|
||||
puts $texfile "\\renewcommand{\\footrulewidth}{0.4pt}"
|
||||
@@ -483,6 +491,8 @@ proc OverviewDoc_ProcessTex {{texFiles {}} {latexDir} verboseMode} {
|
||||
while {1} {
|
||||
set line [gets $IN_F]
|
||||
if { [string first "\\includegraphics" $line] != -1 } {
|
||||
# replace svg extension by pdf
|
||||
set line [regsub {[.]svg} $line ".pdf"]
|
||||
# Center images in TeX files
|
||||
set line "\\begin{center}\n $line\n\\end{center}"
|
||||
} elseif { [string first "\\subsection" $line] != -1 } {
|
||||
@@ -508,8 +518,27 @@ proc OverviewDoc_ProcessTex {{texFiles {}} {latexDir} verboseMode} {
|
||||
}
|
||||
}
|
||||
|
||||
# Convert SVG files to PDF format to allow including them to PDF
|
||||
# (requires InkScape to be in PATH)
|
||||
proc OverviewDoc_ProcessSvg {latexDir verboseMode} {
|
||||
|
||||
foreach file [glob -nocomplain $latexDir/*.svg] {
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "INFO: Converting file $file"
|
||||
}
|
||||
|
||||
set pdffile "[file rootname $file].pdf"
|
||||
if { [catch {exec inkscape -z -D --file=$file --export-pdf=$pdffile} res] } {
|
||||
puts "Error: $res"
|
||||
puts "Conversion failed; check that Inkscape is in PATH!"
|
||||
puts "SVG images will be lost in PDF documents"
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Main procedure for documents compilation
|
||||
proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchMode hhcPath} {
|
||||
proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchMode hhcPath mathjaxLocation} {
|
||||
|
||||
set INDIR [file normalize [file dirname [info script]]]
|
||||
set CASROOT [file normalize [file dirname "$INDIR/../../"]]
|
||||
@@ -536,23 +565,36 @@ proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchM
|
||||
file delete -force $LATEXDIR
|
||||
}
|
||||
file mkdir $LATEXDIR
|
||||
|
||||
# is MathJax HLink?
|
||||
set mathjax_relative_location $mathjaxLocation
|
||||
if { [file isdirectory "$mathjaxLocation"] == 1 } {
|
||||
if { $generatorMode == "HTML_ONLY"} {
|
||||
# related path
|
||||
set mathjax_relative_location [relativePath $HTMLDIR $mathjaxLocation]
|
||||
} elseif { $generatorMode == "CHM_ONLY"} {
|
||||
# absolute path
|
||||
set mathjax_relative_location [file normalize $mathjaxLocation]
|
||||
}
|
||||
}
|
||||
|
||||
# Run tools to compile documents
|
||||
puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating Doxyfile..."
|
||||
|
||||
OverviewDoc_MakeDoxyfile $CASROOT "$OUTDIR/overview" $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $verboseMode $searchMode $hhcPath
|
||||
OverviewDoc_MakeDoxyfile $CASROOT "$OUTDIR/overview" $TAGFILEDIR $DOXYFILE $generatorMode $docfiles $verboseMode $searchMode $hhcPath $mathjax_relative_location
|
||||
|
||||
# Run doxygen tool
|
||||
set starttimestamp [clock format [clock seconds] -format {%Y-%m-%d %H:%M}]
|
||||
if { $generatorMode == "HTML_ONLY"} {
|
||||
puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating HTML files..."
|
||||
puts "$starttimestamp Generating HTML files..."
|
||||
} elseif { $generatorMode == "CHM_ONLY" } {
|
||||
puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generating CHM file..."
|
||||
puts "$starttimestamp Generating CHM file..."
|
||||
}
|
||||
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 "See Doxygen log in $OUTDIR/doxygen_warnings_and_errors.log"
|
||||
puts "Error running Doxygen; see log in\n$OUTDIR/doxygen_warnings_and_errors.log"
|
||||
}
|
||||
set DOX_ERROR_FILE [open "$OUTDIR/doxygen_warnings_and_errors.log" "w"]
|
||||
puts $DOX_ERROR_FILE $DOX_ERROR
|
||||
@@ -594,6 +636,11 @@ proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchM
|
||||
}
|
||||
OverviewDoc_ProcessTex $TEXFILES $LATEXDIR $verboseMode
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Converting SVG images to PNG format..."
|
||||
}
|
||||
OverviewDoc_ProcessSvg $LATEXDIR $verboseMode
|
||||
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "Generating PDF files from TeX files..."
|
||||
}
|
||||
@@ -611,7 +658,7 @@ proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchM
|
||||
if {$RESULT != 0} {
|
||||
if {[llength [split $LaTeX_ERROR "\n"]] > 1} {
|
||||
if {$verboseMode == "YES"} {
|
||||
puts "See Latex log in $OUTDIR/pdflatex_warnings_and_errors.log"
|
||||
puts "Errors running Latex; see log in \n$OUTDIR/pdflatex_warnings_and_errors.log"
|
||||
}
|
||||
set LaTeX_ERROR_FILE [open "$OUTDIR/pdflatex_warnings_and_errors.log" "w"]
|
||||
puts $LaTeX_ERROR_FILE $LaTeX_ERROR
|
||||
@@ -627,7 +674,7 @@ proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchM
|
||||
}
|
||||
|
||||
if {![file exists "$LATEXDIR/refman.pdf"]} {
|
||||
puts "Error: file $LATEXDIR/refman.pdf does not exist"
|
||||
puts "Error: Latex failed to create $LATEXDIR/refman.pdf"
|
||||
return
|
||||
}
|
||||
|
||||
@@ -638,16 +685,47 @@ proc OverviewDoc_Main { {docfiles {}} generatorMode docLabel verboseMode searchM
|
||||
cd $INDIR
|
||||
puts "[clock format [clock seconds] -format {%Y-%m-%d %H:%M}] Generation completed"
|
||||
if { $generatorMode == "HTML_ONLY" } {
|
||||
puts "View generated HTML documentation by opening: "
|
||||
set RESFILE $OUTDIR/overview/html/index.html
|
||||
puts "$RESFILE"
|
||||
puts "View generated HTML documentation by opening:"
|
||||
puts "$OUTDIR/overview/html/index.html"
|
||||
}
|
||||
if { $generatorMode == "PDF_ONLY" } {
|
||||
puts "PDF files are generated in: "
|
||||
puts "$OUTDIR/overview/pdf folder"
|
||||
puts "PDF files are generated in folder:"
|
||||
puts "$OUTDIR/overview/pdf"
|
||||
}
|
||||
}
|
||||
|
||||
proc relativePath {thePathFrom thePathTo} {
|
||||
if { [file isdirectory "$thePathFrom"] == 0 } {
|
||||
return ""
|
||||
}
|
||||
|
||||
set aPathFrom [file normalize "$thePathFrom"]
|
||||
set aPathTo [file normalize "$thePathTo"]
|
||||
|
||||
set aCutedPathFrom "${aPathFrom}/dummy"
|
||||
set aRelatedDeepPath ""
|
||||
|
||||
while { "$aCutedPathFrom" != [file normalize "$aCutedPathFrom/.."] } {
|
||||
set aCutedPathFrom [file normalize "$aCutedPathFrom/.."]
|
||||
# does aPathTo contain aCutedPathFrom?
|
||||
regsub -all $aCutedPathFrom $aPathTo "" aPathFromAfterCut
|
||||
if { "$aPathFromAfterCut" != "$aPathTo" } { # if so
|
||||
if { "$aCutedPathFrom" == "$aPathFrom" } { # just go higher, for example, ./somefolder/someotherfolder
|
||||
set aPathTo ".${aPathTo}"
|
||||
} elseif { "$aCutedPathFrom" == "$aPathTo" } { # remove the last "/"
|
||||
set aRelatedDeepPath [string replace $aRelatedDeepPath end end ""]
|
||||
}
|
||||
regsub -all $aCutedPathFrom $aPathTo $aRelatedDeepPath aPathToAfterCut
|
||||
regsub -all "//" $aPathToAfterCut "/" aPathToAfterCut
|
||||
return $aPathToAfterCut
|
||||
}
|
||||
set aRelatedDeepPath "$aRelatedDeepPath../"
|
||||
|
||||
}
|
||||
|
||||
return $thePathTo
|
||||
}
|
||||
|
||||
# A command for User Documentation compilation
|
||||
proc occdoc {args} {
|
||||
# Programm options
|
||||
@@ -659,6 +737,9 @@ proc occdoc {args} {
|
||||
set SEARCH_MODE "none"
|
||||
set hhcPath ""
|
||||
|
||||
set mathjax_location "http://cdn.mathjax.org/mathjax/latest"
|
||||
set mathjax_js_name "MathJax.js"
|
||||
|
||||
global available_docfiles
|
||||
global tcl_platform
|
||||
global args_names
|
||||
@@ -758,6 +839,19 @@ proc occdoc {args} {
|
||||
puts "Error in argument s"
|
||||
return
|
||||
}
|
||||
} elseif {$arg_n == "mathjax"} {
|
||||
if {![info exists args_values(pdf)]} {
|
||||
set possible_mathjax_loc $args_values(mathjax)
|
||||
if {[file exist [file join $possible_mathjax_loc $mathjax_js_name]]} {
|
||||
set mathjax_location $args_values(mathjax)
|
||||
puts "$mathjax_location"
|
||||
} else {
|
||||
puts "Warning: $mathjax_js_name isn't found in $possible_mathjax_loc."
|
||||
puts " MathJax will be used from $mathjax_location"
|
||||
}
|
||||
} else {
|
||||
puts "Info: MathJax is not used with pdf and will be ignored"
|
||||
}
|
||||
} else {
|
||||
puts "\nWrong argument: $arg_n"
|
||||
OverviewDoc_PrintHelpMessage
|
||||
@@ -777,5 +871,5 @@ proc occdoc {args} {
|
||||
}
|
||||
|
||||
# Start main activities
|
||||
OverviewDoc_Main $DOCFILES $GEN_MODE $DOCLABEL $VERB_MODE $SEARCH_MODE $hhcPath
|
||||
OverviewDoc_Main $DOCFILES $GEN_MODE $DOCLABEL $VERB_MODE $SEARCH_MODE $hhcPath $mathjax_location
|
||||
}
|
||||
|
Before Width: | Height: | Size: 7.1 KiB |
512
dox/tutorial/images/tutorial_image003.svg
Normal file
@@ -0,0 +1,512 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="744.09448819"
|
||||
height="1052.3622047"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="ocaf.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<clipPath
|
||||
id="clipEmfPath1"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3001"
|
||||
height="22.583204"
|
||||
width="33.706238"
|
||||
y="12.49604"
|
||||
x="23.173038" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath2"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3004"
|
||||
height="22.583204"
|
||||
width="33.856712"
|
||||
y="193.16167"
|
||||
x="176.50632" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath3"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3007"
|
||||
height="22.583204"
|
||||
width="33.706238"
|
||||
y="12.49604"
|
||||
x="316.59788" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath4"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3010"
|
||||
height="22.583204"
|
||||
width="33.856712"
|
||||
y="193.16167"
|
||||
x="469.93116" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath5"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3013"
|
||||
height="22.583204"
|
||||
width="33.856712"
|
||||
y="97.258332"
|
||||
x="382.35513" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath1-1"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3132"
|
||||
height="44.154422"
|
||||
width="125.37695"
|
||||
y="131.71234"
|
||||
x="271.49972" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath2-7"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3135"
|
||||
height="44.154422"
|
||||
width="125.37695"
|
||||
y="212.8123"
|
||||
x="271.49972" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath3-4"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3138"
|
||||
height="44.154422"
|
||||
width="107.3371"
|
||||
y="212.8123"
|
||||
x="433.85835" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath4-0"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3141"
|
||||
height="17.121102"
|
||||
width="549.31338"
|
||||
y="293.91226"
|
||||
x="0.90199242" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath5-9"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3144"
|
||||
height="18.022213"
|
||||
width="333.7372"
|
||||
y="338.51723"
|
||||
x="72.61039" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath6"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3147"
|
||||
height="18.022213"
|
||||
width="342.75712"
|
||||
y="374.56166"
|
||||
x="72.61039" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath7"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3150"
|
||||
height="18.022213"
|
||||
width="243.53795"
|
||||
y="410.60608"
|
||||
x="135.74986" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath1-4"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3337"
|
||||
height="188.43307"
|
||||
width="602.36218"
|
||||
y="0"
|
||||
x="0" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath2-8"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3340"
|
||||
height="168.77963"
|
||||
width="461.37103"
|
||||
y="13.50237"
|
||||
x="1.4999058" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="375"
|
||||
inkscape:cy="845.71429"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1065"
|
||||
inkscape:window-height="932"
|
||||
inkscape:window-x="113"
|
||||
inkscape:window-y="14"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g2989" />
|
||||
<g
|
||||
id="g3120" />
|
||||
<g
|
||||
id="g3342"
|
||||
transform="translate(13.4445,5.5890899)">
|
||||
<text
|
||||
id="text3344"
|
||||
style="font-size:12.44921875px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
y="188.43307"
|
||||
x="464.07086"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3346"
|
||||
d="m 0.93744115,8.4389813 0,178.7188687 462.40221885,0 0,-178.7188687 -462.40221885,0 z"
|
||||
clip-path="url(#clipEmfPath1-4)"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3348"
|
||||
d="m 0.93744115,8.4389813 0,178.7188687 462.40221885,0 0,-178.7188687 z"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93744117px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<text
|
||||
id="text3350"
|
||||
style="font-size:7.49952936px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Wingdings 2"
|
||||
y="49.958771"
|
||||
x="10.499341"
|
||||
xml:space="preserve"></text>
|
||||
<text
|
||||
id="text3352"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="36.156345"
|
||||
x="17.248917"
|
||||
xml:space="preserve">(</text>
|
||||
<text
|
||||
id="text3354"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="36.156345"
|
||||
x="20.54871"
|
||||
xml:space="preserve">-</text>
|
||||
<text
|
||||
id="text3356"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="36.156345"
|
||||
x="23.848503"
|
||||
xml:space="preserve">myWidth / 2., 0 , 0)</text>
|
||||
<text
|
||||
id="text3358"
|
||||
style="font-size:14.99905872px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="39.907005"
|
||||
x="107.84323"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3360"
|
||||
style="font-size:14.99905872px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="39.907005"
|
||||
x="124.49218"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3362"
|
||||
style="font-size:14.99905872px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="39.907005"
|
||||
x="128.54193"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3364"
|
||||
style="font-size:14.99905872px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="39.907005"
|
||||
x="143.24101"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3366"
|
||||
style="font-size:14.99905872px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="39.907005"
|
||||
x="187.48824"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3368"
|
||||
style="font-size:14.99905872px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="39.907005"
|
||||
x="231.73544"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3370"
|
||||
style="font-size:7.49952936px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Wingdings 2"
|
||||
y="49.958771"
|
||||
x="275.98267"
|
||||
xml:space="preserve"></text>
|
||||
<text
|
||||
id="text3372"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="61.210743"
|
||||
x="282.73224"
|
||||
xml:space="preserve">(myWidth / </text>
|
||||
<text
|
||||
id="text3374"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="61.210743"
|
||||
x="333.42908"
|
||||
xml:space="preserve">2</text>
|
||||
<text
|
||||
id="text3376"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="61.210743"
|
||||
x="338.82874"
|
||||
xml:space="preserve">., </text>
|
||||
<text
|
||||
id="text3378"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="61.210743"
|
||||
x="347.22821"
|
||||
xml:space="preserve">0</text>
|
||||
<text
|
||||
id="text3380"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="61.210743"
|
||||
x="352.77786"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3382"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="61.210743"
|
||||
x="355.47769"
|
||||
xml:space="preserve">, </text>
|
||||
<text
|
||||
id="text3384"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="61.210743"
|
||||
x="361.17731"
|
||||
xml:space="preserve">0</text>
|
||||
<text
|
||||
id="text3386"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="61.210743"
|
||||
x="366.72699"
|
||||
xml:space="preserve">)</text>
|
||||
<text
|
||||
id="text3388"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="61.210743"
|
||||
x="369.87677"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3390"
|
||||
style="font-size:7.49952936px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Wingdings 2"
|
||||
y="103.6682"
|
||||
x="10.499341"
|
||||
xml:space="preserve"></text>
|
||||
<text
|
||||
id="text3392"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="89.865776"
|
||||
x="17.248917"
|
||||
xml:space="preserve">(</text>
|
||||
<text
|
||||
id="text3394"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="89.865776"
|
||||
x="20.54871"
|
||||
xml:space="preserve">-</text>
|
||||
<text
|
||||
id="text3396"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="89.865776"
|
||||
x="23.848503"
|
||||
xml:space="preserve">myWidth / 2., </text>
|
||||
<text
|
||||
id="text3398"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="89.865776"
|
||||
x="85.044662"
|
||||
xml:space="preserve">-</text>
|
||||
<text
|
||||
id="text3400"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="89.865776"
|
||||
x="88.344452"
|
||||
xml:space="preserve">myThickness / 4.</text>
|
||||
<text
|
||||
id="text3402"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="89.865776"
|
||||
x="163.33975"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3404"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="89.865776"
|
||||
x="166.18958"
|
||||
xml:space="preserve">, 0)</text>
|
||||
<text
|
||||
id="text3406"
|
||||
style="font-size:14.99905872px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="93.616432"
|
||||
x="180.58865"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3408"
|
||||
style="font-size:14.99905872px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="93.616432"
|
||||
x="187.48824"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3410"
|
||||
style="font-size:14.99905872px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="93.616432"
|
||||
x="231.73544"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3412"
|
||||
style="font-size:7.49952936px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Wingdings 2"
|
||||
y="103.6682"
|
||||
x="275.98267"
|
||||
xml:space="preserve"></text>
|
||||
<text
|
||||
id="text3414"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="114.92017"
|
||||
x="282.73224"
|
||||
xml:space="preserve">(myWidth / 2., </text>
|
||||
<text
|
||||
id="text3416"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="114.92017"
|
||||
x="347.22821"
|
||||
xml:space="preserve">myThickne</text>
|
||||
<text
|
||||
id="text3418"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="114.92017"
|
||||
x="395.52518"
|
||||
xml:space="preserve">ss / 4.</text>
|
||||
<text
|
||||
id="text3420"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="114.92017"
|
||||
x="422.22348"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3422"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="114.92017"
|
||||
x="424.92331"
|
||||
xml:space="preserve">, 0)</text>
|
||||
<text
|
||||
id="text3424"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="114.92017"
|
||||
x="439.32242"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3426"
|
||||
style="font-size:7.49952936px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Wingdings 2"
|
||||
y="137.27409"
|
||||
x="145.49088"
|
||||
xml:space="preserve"></text>
|
||||
<text
|
||||
id="text3428"
|
||||
style="font-size:7.49952936px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="137.27409"
|
||||
x="152.24043"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3430"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="148.52608"
|
||||
x="156.44019"
|
||||
xml:space="preserve">(0 , </text>
|
||||
<text
|
||||
id="text3432"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="148.52608"
|
||||
x="173.6891"
|
||||
xml:space="preserve">-</text>
|
||||
<text
|
||||
id="text3434"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="148.52608"
|
||||
x="176.98889"
|
||||
xml:space="preserve">myThickness / 2. , 0)</text>
|
||||
<text
|
||||
id="text3436"
|
||||
style="font-size:7.49952936px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="137.27409"
|
||||
x="269.0831"
|
||||
xml:space="preserve"> </text>
|
||||
<text
|
||||
id="text3438"
|
||||
style="font-size:10.04936886px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial Unicode MS"
|
||||
y="174.63065"
|
||||
x="100.49369"
|
||||
xml:space="preserve"> </text>
|
||||
</g>
|
||||
<g
|
||||
id="g3501"
|
||||
transform="translate(16.56497,18.45006)">
|
||||
<text
|
||||
id="text3503"
|
||||
style="font-size:13.83647633px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Calibri"
|
||||
y="11.821392"
|
||||
x="-0.15039648"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3505"
|
||||
d="m 144.22083,160.60232 0,-153.7065083 c 0,-0.3410016 0.28199,-0.6251697 0.62978,-0.6251697 0.34779,0 0.62039,0.2841681 0.62039,0.6251697 l 0,153.7065083 c 0,0.35047 -0.2726,0.63464 -0.62039,0.63464 -0.34779,0 -0.62978,-0.28417 -0.62978,-0.63464 z M 141.0907,8.1650958 l 3.75991,-7.57781513 3.75991,7.57781513 z"
|
||||
clip-path="url(#clipEmfPath0)"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15039648px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
id="path3507"
|
||||
d="m 0.52638768,36.581902 418.17741232,0 c 0.33839,0 0.62039,0.284168 0.62039,0.62517 0,0.359946 -0.282,0.644114 -0.62039,0.644114 l -418.17741232,0 c -0.33839208,0 -0.62038548,-0.284168 -0.62038548,-0.644114 0,-0.341002 0.2819934,-0.62517 0.62038548,-0.62517 z M 417.44423,33.418165 l 7.51983,3.788907 -7.51983,3.788908 z"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15039648px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 19 KiB |
@@ -52,8 +52,7 @@ This modeling requires four steps:
|
||||
|
||||
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.
|
||||
|
||||
@image html /tutorial/images/tutorial_image003.png
|
||||
@image latex /tutorial/images/tutorial_image003.png
|
||||
@figure{/tutorial/images/tutorial_image003.svg}
|
||||
|
||||
There are two classes to describe a 3D Cartesian point from its X, Y and Z coordinates in Open CASCADE Technology:
|
||||
|
||||
@@ -67,7 +66,7 @@ To choose the best class for this application, consider the following:
|
||||
* *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:
|
||||
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);
|
||||
|
@@ -1252,7 +1252,7 @@ clear
|
||||
foreach var [directory c_*] {erase $var}
|
||||
|
||||
# clear 2d views
|
||||
2d clear
|
||||
2dclear
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@subsubsection occt_draw_4_1_15 repaint, dflush
|
||||
@@ -2258,7 +2258,7 @@ Syntax:
|
||||
meshshadcolor meshname red green blue
|
||||
~~~~~
|
||||
|
||||
Changes the face interior color of object **meshname**. The *red*, *green** and *blue* are real values between *0* and *1*.
|
||||
Changes the face interior color of object **meshname**. The *red*, *green* and *blue* are real values between *0* and *1*.
|
||||
|
||||
**Example:**
|
||||
~~~~~
|
||||
@@ -3993,7 +3993,7 @@ parabola p2 0 0 0 1 50
|
||||
parabola p3 0 0 0 1 0 0 0 0 1 50
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_draw_6_2_7 beziercurve, dbeziercurve
|
||||
@subsubsection occt_draw_6_2_7 beziercurve, 2dbeziercurve
|
||||
|
||||
Syntax:
|
||||
~~~~~
|
||||
@@ -4012,13 +4012,15 @@ Creates a 3d rational or non-rational Bezier curve. Give the number of poles (co
|
||||
beziercurve cc 4 0 0 0 10 0 0 10 0 10 10 10 10
|
||||
~~~~~
|
||||
|
||||
@subsubsection occt_draw_6_2_8 bsplinecurve, dbsplinecurve, pbsplinecurve, dpbsplinecurve
|
||||
@subsubsection occt_draw_6_2_8 bsplinecurve, 2dbsplinecurve, pbsplinecurve, 2dpbsplinecurve
|
||||
|
||||
Syntax:
|
||||
~~~~~
|
||||
bsplinecurve name degree nbknots knot, umult pole, weight 2dbsplinecurve name degree nbknots knot, umult pole, weight pbsplinecurve name degree nbknots knot, umult pole, weight(periodic)
|
||||
bsplinecurve name degree nbknots knot, umult pole, weight
|
||||
2dbsplinecurve name degree nbknots knot, umult pole, weight
|
||||
|
||||
2dpbsplinecurve name degree nbknots knot, umult pole, weight (periodic)
|
||||
pbsplinecurve name degree nbknots knot, umult pole, weight (periodic)
|
||||
2dpbsplinecurve name degree nbknots knot, umult pole, weight (periodic)
|
||||
~~~~~
|
||||
|
||||
Creates 2d or 3d bspline curves; the **pbsplinecurve** and **2dpbsplinecurve** commands create periodic bspline curves.
|
||||
@@ -4076,7 +4078,7 @@ viso c2 c
|
||||
**Note** that this cannot be done from offset surfaces.
|
||||
|
||||
|
||||
@subsubsection occt_draw_6_2_10 tod, tod
|
||||
@subsubsection occt_draw_6_2_10 to3d, to2d
|
||||
|
||||
Syntax:
|
||||
~~~~~
|
||||
|
Before Width: | Height: | Size: 4.4 KiB |
504
dox/user_guides/ocaf/images/ocaf_image003.svg
Normal file
@@ -0,0 +1,504 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="549.58691"
|
||||
height="442.80087"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="ocaf3.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<clipPath
|
||||
id="clipEmfPath1"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3001"
|
||||
height="22.583204"
|
||||
width="33.706238"
|
||||
y="12.49604"
|
||||
x="23.173038" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath2"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3004"
|
||||
height="22.583204"
|
||||
width="33.856712"
|
||||
y="193.16167"
|
||||
x="176.50632" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath3"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3007"
|
||||
height="22.583204"
|
||||
width="33.706238"
|
||||
y="12.49604"
|
||||
x="316.59787" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath4"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3010"
|
||||
height="22.583204"
|
||||
width="33.856712"
|
||||
y="193.16167"
|
||||
x="469.93115" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath5"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3013"
|
||||
height="22.583204"
|
||||
width="33.856712"
|
||||
y="97.258331"
|
||||
x="382.35513" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath1-1"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3132"
|
||||
height="44.154423"
|
||||
width="125.37695"
|
||||
y="131.71234"
|
||||
x="271.49973" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath2-7"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3135"
|
||||
height="44.154423"
|
||||
width="125.37695"
|
||||
y="212.8123"
|
||||
x="271.49973" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath3-4"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3138"
|
||||
height="44.154423"
|
||||
width="107.3371"
|
||||
y="212.8123"
|
||||
x="433.85834" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath4-0"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3141"
|
||||
height="17.121101"
|
||||
width="549.31335"
|
||||
y="293.91226"
|
||||
x="0.90199244" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath5-9"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3144"
|
||||
height="18.022213"
|
||||
width="333.73721"
|
||||
y="338.51724"
|
||||
x="72.61039" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath6"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3147"
|
||||
height="18.022213"
|
||||
width="342.75711"
|
||||
y="374.56165"
|
||||
x="72.61039" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath7"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3150"
|
||||
height="18.022213"
|
||||
width="243.53795"
|
||||
y="410.60608"
|
||||
x="135.74986" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.70698094"
|
||||
inkscape:cx="287.00859"
|
||||
inkscape:cy="22.17673"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1065"
|
||||
inkscape:window-height="932"
|
||||
inkscape:window-x="22"
|
||||
inkscape:window-y="22"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:snap-page="false"
|
||||
inkscape:snap-bbox="true"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:snap-global="false"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-63.736307,-64.65625)">
|
||||
<g
|
||||
id="g2989" />
|
||||
<g
|
||||
id="g3120" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath1-1)"
|
||||
d="m 270.99235,207.81864 0,54.06664 126.27894,0 0,-54.06664 -126.27894,0 z"
|
||||
id="path3166"
|
||||
transform="matrix(1.0333295,0,0,1.0465218,64.357675,64.546499)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath2-7)"
|
||||
d="m 433.35098,207.81864 0,54.06664 108.23909,0 0,-54.06664 -108.23909,0 z"
|
||||
id="path3178"
|
||||
transform="matrix(1.0333295,0,0,1.0465218,64.357675,64.546499)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath3-4)"
|
||||
d="m 0.39462168,288.9186 0,27.03332 550.21537832,0 0,-27.03332 -550.21537832,0 z"
|
||||
id="path3188"
|
||||
transform="matrix(1.0333295,0,0,1.0465218,64.357675,64.546499)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15033206px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
clip-path="url(#clipEmfPath4-0)"
|
||||
d="m 325.73201,63.640939 0,56.826291 c 0,0.35669 -0.26308,0.61951 -0.62012,0.61951 -0.33824,0 -0.62012,-0.26282 -0.62012,-0.61951 l 0,-56.826291 c 0,-0.337916 0.28188,-0.619513 0.62012,-0.619513 0.35704,0 0.62012,0.281597 0.62012,0.619513 z m 3.13818,55.568491 -3.7583,7.50925 -3.7583,-7.50925 z"
|
||||
id="path3198"
|
||||
transform="matrix(1.0333295,0,0,1.0465218,64.357675,64.546499)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath5-9)"
|
||||
d="m 18.43447,370.01856 0,18.02221 45.099621,0 0,-18.02221 -45.099621,0 z"
|
||||
id="path3240"
|
||||
transform="matrix(1.0333295,0,0,1.0465218,64.357675,64.546499)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath6)"
|
||||
d="m 135.69348,406.06298 0,27.03332 243.53796,0 0,-27.03332 -243.53796,0 z"
|
||||
id="path3254"
|
||||
transform="matrix(1.0333295,0,0,1.0465218,64.357675,64.546499)" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="215.31396"
|
||||
y="504.24854"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3256"
|
||||
transform="scale(0.99367708,1.0063631)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.97706896px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 490.93507,282.03324 0,56.58191 113.26111,0 0,-56.58191 z"
|
||||
id="path3180" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.06878722px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 64.811308,366.95197 0,33.8571 548.659552,0 0,-33.8571 z"
|
||||
id="path3190" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="64.141869"
|
||||
y="77.413521"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Calibri"
|
||||
id="text3154"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 344.38206,197.16036 0,56.58192 130.48776,0 0,-56.58192 -130.48776,0 z"
|
||||
id="path3156" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.11373937px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 344.4504,197.2287 0,56.44524 169.95611,0 0,-56.44524 z"
|
||||
id="path3158" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="356.4809"
|
||||
y="214.69417"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Calibri"
|
||||
id="text3160"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="463.68921"
|
||||
y="186.10809"
|
||||
style="font-size:31.02789688px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Times New Roman"
|
||||
id="text3162"
|
||||
transform="scale(0.78359294,1.2761728)">Visualization</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="448.87256"
|
||||
y="246.24217"
|
||||
style="font-size:12.97547531px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Times New Roman"
|
||||
id="text3164"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.97706896px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 344.38206,282.03324 0,56.58191 130.48776,0 0,-56.58191 z"
|
||||
id="path3168" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="356.4809"
|
||||
y="299.0304"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000"
|
||||
id="text3170"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="459.00015"
|
||||
y="261.70831"
|
||||
style="font-size:34.08923721px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Times New Roman"
|
||||
id="text3172"
|
||||
transform="scale(0.82314176,1.2148576)">Shape</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="429.33118"
|
||||
y="330.5784"
|
||||
style="font-size:12.97547531px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Times New Roman"
|
||||
id="text3176"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="525.31842"
|
||||
y="299.0304"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Calibri"
|
||||
id="text3182"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="628.04413"
|
||||
y="255.03328"
|
||||
style="font-size:31.91677094px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Times New Roman"
|
||||
id="text3184"
|
||||
transform="scale(0.79737332,1.2541177)">Graphic</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="594.88574"
|
||||
y="330.5784"
|
||||
style="font-size:12.97547531px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Times New Roman"
|
||||
id="text3186"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="309.66422"
|
||||
y="358.04483"
|
||||
style="font-size:38.11062622px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Times New Roman"
|
||||
id="text3192"
|
||||
transform="scale(0.89965906,1.1115322)">Kernel</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="370.39435"
|
||||
y="381.80484"
|
||||
style="font-size:12.97547531px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Times New Roman"
|
||||
id="text3194"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="351.32196"
|
||||
y="398.35971"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Calibri"
|
||||
id="text3196"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15633102px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 270.30308,196.72815 70.26338,79.98089 c 0.23301,0.26523 0.21359,0.68762 -0.0583,0.92338 -0.26213,0.23576 -0.66991,0.21611 -0.91263,-0.0589 l -70.26338,-79.97107 c -0.23302,-0.27505 -0.2136,-0.68763 0.0583,-0.92339 0.26214,-0.24557 0.66992,-0.2161 0.91264,0.0491 z m 71.81681,76.82762 2.26217,8.47747 -8.0681,-3.26132 z"
|
||||
id="path3200" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15633102px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 409.43296,253.74228 0,21.74868 c 0,0.37328 -0.27185,0.64833 -0.64079,0.64833 -0.34951,0 -0.64079,-0.27505 -0.64079,-0.64833 l 0,-21.74868 c 0,-0.35363 0.29128,-0.64833 0.64079,-0.64833 0.36894,0 0.64079,0.2947 0.64079,0.64833 z m 3.24277,20.43236 -3.88356,7.8586 -3.88356,-7.8586 z"
|
||||
id="path3202" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.11878665px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 491.26208,253.69332 25.41321,24.57851 c 0.19618,0.18973 0.19618,0.49624 0,0.68598 -0.19618,0.18974 -0.51311,0.18974 -0.70929,0 l -25.4132,-24.5785 c -0.19618,-0.18974 -0.19618,-0.49624 0,-0.68599 0.19619,-0.18974 0.5131,-0.18974 0.70928,0 z m 26.48466,22.17028 2.12784,6.18842 -6.39858,-2.05795 z"
|
||||
id="path3204" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#1c1c1c;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 157.97099,65.135894 0,66.012236 335.53993,0 0,-66.012236 -335.53993,0 z"
|
||||
id="path3206" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.97706896px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 157.97099,65.135894 0,66.012236 335.53993,0 0,-66.012236 z"
|
||||
id="path3208" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#1c1c1c;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 157.97099,131.14813 0,132.02447 139.80831,0 0,-132.02447 -139.80831,0 z"
|
||||
id="path3210" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.97706896px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 157.97099,131.14813 0,132.02447 139.80831,0 0,-132.02447 z"
|
||||
id="path3212" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#1c1c1c;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 167.29154,263.1726 0,75.44255 130.48776,0 0,-75.44255 -130.48776,0 z"
|
||||
id="path3214" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.97706896px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 167.29154,263.1726 0,75.44255 130.48776,0 0,-75.44255 z"
|
||||
id="path3216" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#1c1c1c;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 64.765449,263.1726 0,75.44255 102.526091,0 0,-75.44255 -102.526091,0 z"
|
||||
id="path3218" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.97706896px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 64.765449,263.1726 0,75.44255 102.526091,0 0,-75.44255 z"
|
||||
id="path3220" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15633102px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 112.00901,338.61515 0,21.74868 c 0,0.36346 -0.28156,0.64833 -0.64079,0.64833 -0.35923,0 -0.6505,-0.28487 -0.6505,-0.64833 l 0,-21.74868 c 0,-0.35364 0.29127,-0.64833 0.6505,-0.64833 0.35923,0 0.64079,0.29469 0.64079,0.64833 z m 3.24277,20.43237 -3.88356,7.85859 -3.88357,-7.85859 z"
|
||||
id="path3222" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15633102px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 233.17621,338.61515 0,21.74868 c 0,0.36346 -0.28156,0.64833 -0.64079,0.64833 -0.35924,0 -0.6505,-0.28487 -0.6505,-0.64833 l 0,-21.74868 c 0,-0.35364 0.29126,-0.64833 0.6505,-0.64833 0.35923,0 0.64079,0.29469 0.64079,0.64833 z m 3.24277,20.43237 -3.88356,7.85859 -3.88356,-7.85859 z"
|
||||
id="path3224" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15633102px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 409.43296,338.61515 0,21.74868 c 0,0.37329 -0.27185,0.64833 -0.64079,0.64833 -0.34951,0 -0.64079,-0.27504 -0.64079,-0.64833 l 0,-21.74868 c 0,-0.35364 0.29128,-0.64833 0.64079,-0.64833 0.36894,0 0.64079,0.29469 0.64079,0.64833 z m 3.24277,20.43237 -3.88356,7.85859 -3.88356,-7.85859 z"
|
||||
id="path3226" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15633102px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 550.32809,340.02962 0,21.74868 c 0,0.37329 -0.27185,0.64833 -0.64079,0.64833 -0.34952,0 -0.64078,-0.27504 -0.64078,-0.64833 l 0,-21.74868 c 0,-0.35364 0.29126,-0.64833 0.64078,-0.64833 0.36894,0 0.64079,0.29469 0.64079,0.64833 z m 3.24278,20.43237 -3.88357,7.85859 -3.88356,-7.85859 z"
|
||||
id="path3228" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 83.406557,414.05771 0,18.86064 46.602773,0 0,-18.86064 -46.602773,0 z"
|
||||
id="path3230" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.97706896px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 83.406557,414.05771 0,18.86064 46.602773,0 0,-18.86064 z"
|
||||
id="path3232" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 139.32988,414.05771 0,28.29096 344.86049,0 0,-28.29096 -344.86049,0 z"
|
||||
id="path3234" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="149.65495"
|
||||
y="429.43918"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3236"
|
||||
transform="scale(0.99367712,1.0063631)">OCAF (Open CASCADE Application Framework)</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="461.06635"
|
||||
y="429.43918"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3238"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.97706896px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 83.406557,451.77899 0,18.86063 46.602773,0 0,-18.86063 z"
|
||||
id="path3242" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 139.32988,451.77899 0,28.29096 354.18104,0 0,-28.29096 -354.18104,0 z"
|
||||
id="path3244" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="149.65495"
|
||||
y="466.92197"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3246"
|
||||
transform="scale(0.99367712,1.0063631)">OCCT</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="190.30101"
|
||||
y="466.92197"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3248"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="194.20929"
|
||||
y="466.92197"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3250"
|
||||
transform="scale(0.99367712,1.0063631)">Object Libraries required by OCAF</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="414.01071"
|
||||
y="466.92197"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3252"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="425.57922"
|
||||
y="504.24854"
|
||||
style="font-size:14.38245487px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3258"
|
||||
transform="scale(0.99367712,1.0063631)"> </text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 22 KiB |
@@ -44,8 +44,7 @@ The table below contrasts the design of a modeling application using object libr
|
||||
|
||||
The relationship between OCAF and the Open CASCADE Technology (**OCCT**) Object Libraries can be seen in the image below.
|
||||
|
||||
@image html /user_guides/ocaf/images/ocaf_image003.png "OCAF Architecture"
|
||||
@image latex /user_guides/ocaf/images/ocaf_image003.png "OCAF Architecture"
|
||||
@figure{/user_guides/ocaf/images/ocaf_image003.svg, "OCAF Architecture"}
|
||||
|
||||
In the image, the OCAF (Open CASCADE Application Framework) is shown with black rectangles and OCCT Object Libraries required by OCAF are shown with white rectangles.
|
||||
|
||||
@@ -80,7 +79,7 @@ OCAF documents are in turn managed by an OCAF application, which is in charge of
|
||||
|
||||
Apart from their role as a container of application data, documents can refer to each other; Document A, for example, can refer to a specific label in Document B. This functionality is made possible by means of the reference key.
|
||||
|
||||
@subsection occt_ocaf_23 The document and the data framework
|
||||
@subsection occt_ocaf_2_3 The document and the data framework
|
||||
|
||||
Inside a document, there is a data framework, a model, for example. This is a set of labels organized in a tree structure characterized by the following features:
|
||||
* The first label in a framework is the root of the tree;
|
||||
|
Before Width: | Height: | Size: 4.4 KiB |
398
dox/user_guides/shape_healing/images/shape_healing_image009.svg
Normal file
@@ -0,0 +1,398 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="492.48849"
|
||||
height="306.85541"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="shape_heal.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<clipPath
|
||||
id="clipEmfPath1"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3045"
|
||||
height="188.43307"
|
||||
width="602.36218"
|
||||
y="0"
|
||||
x="0" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath2"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3048"
|
||||
height="168.77963"
|
||||
width="461.37103"
|
||||
y="13.50237"
|
||||
x="1.4999058" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath1-1"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3221"
|
||||
height="352.24017"
|
||||
width="546.80316"
|
||||
y="0"
|
||||
x="0" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath2-7"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3224"
|
||||
height="11.251283"
|
||||
width="140.71368"
|
||||
y="141.16611"
|
||||
x="0.60005832" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath3"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3227"
|
||||
height="11.251283"
|
||||
width="140.86369"
|
||||
y="141.16611"
|
||||
x="177.31725" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath4"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3230"
|
||||
height="11.251283"
|
||||
width="140.86369"
|
||||
y="140.86607"
|
||||
x="350.28406" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath5"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3233"
|
||||
height="11.251283"
|
||||
width="140.71368"
|
||||
y="276.48154"
|
||||
x="175.06702" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath6"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3236"
|
||||
height="11.251283"
|
||||
width="140.71368"
|
||||
y="214.07442"
|
||||
x="175.96712" />
|
||||
</clipPath>
|
||||
<clipPath
|
||||
id="clipEmfPath7"
|
||||
clipPathUnits="userSpaceOnUse">
|
||||
<rect
|
||||
id="rect3239"
|
||||
height="11.251283"
|
||||
width="140.86369"
|
||||
y="336.18835"
|
||||
x="174.01692" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="346.95854"
|
||||
inkscape:cy="41.972723"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="915"
|
||||
inkscape:window-height="838"
|
||||
inkscape:window-x="132"
|
||||
inkscape:window-y="132"
|
||||
inkscape:window-maximized="0"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-28.041461,-50.336628)">
|
||||
<g
|
||||
id="g2989" />
|
||||
<g
|
||||
id="g3000" />
|
||||
<g
|
||||
id="g3011" />
|
||||
<g
|
||||
id="g3022" />
|
||||
<g
|
||||
id="g3033" />
|
||||
<g
|
||||
id="g3209" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="77.124359"
|
||||
y="50.336628"
|
||||
style="font-size:19.95194054px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3245"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="384.65424"
|
||||
y="50.336628"
|
||||
style="font-size:19.95194054px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3249"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="384.35422"
|
||||
y="74.039337"
|
||||
style="font-size:12.45121098px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3253"> </text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="43.821121"
|
||||
y="95.941833"
|
||||
style="font-size:12.45121098px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3255"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath1-1)"
|
||||
d="m -0.00937591,136.00926 0,21.24618 141.76378591,0 0,-21.24618 -141.76378591,0 z"
|
||||
id="path3257"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 28.510257,137.89036 0,21.24618 141.763783,0 0,-21.24618 z"
|
||||
id="path3259" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="74.574112"
|
||||
y="153.24837"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3261">ShapeFix</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="124.52896"
|
||||
y="153.24837"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3263"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath2-7)"
|
||||
d="m 176.82969,136.00926 0,21.24618 141.76378,0 0,-21.24618 -141.76378,0 z"
|
||||
id="path3265"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 205.34932,137.89036 0,21.24618 141.76378,0 0,-21.24618 z"
|
||||
id="path3267" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="236.58987"
|
||||
y="153.24837"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3269">ShapeUpgrade</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="315.94757"
|
||||
y="153.24837"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3271"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath3)"
|
||||
d="m 349.77776,135.82174 0,21.24617 141.76378,0 0,-21.24617 -141.76378,0 z"
|
||||
id="path3273"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 378.29739,137.70284 0,21.24617 141.76378,0 0,-21.24617 z"
|
||||
id="path3275" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="411.35684"
|
||||
y="152.94833"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3277">ShapeCustom</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="486.9642"
|
||||
y="152.94833"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3279"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath4)"
|
||||
d="m 174.44821,271.3997 0,21.24618 141.76378,0 0,-21.24618 -141.76378,0 z"
|
||||
id="path3281"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 202.96784,273.2808 0,21.24618 141.76378,0 0,-21.24618 z"
|
||||
id="path3283" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="238.39005"
|
||||
y="288.56381"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3285">ShapeExtend</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="309.64694"
|
||||
y="288.56381"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3287"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
clip-path="url(#clipEmfPath5)"
|
||||
d="m 175.3858,208.95508 0,21.24617 141.76378,0 0,-21.24617 -141.76378,0 z"
|
||||
id="path3289"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 203.90543,210.83618 0,21.24617 141.76378,0 0,-21.24617 z"
|
||||
id="path3291" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="234.78969"
|
||||
y="226.15668"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3293">ShapeAnalysis</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="314.89746"
|
||||
y="226.15668"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3295"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-dasharray:none"
|
||||
clip-path="url(#clipEmfPath6)"
|
||||
d="m 74.257219,158.83061 0,182.75835"
|
||||
id="path3297"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 103.83926,342.96989 92.18396,0 c 0.35629,0 0.63756,0.28128 0.63756,0.63757 0,0.33754 -0.28127,0.61882 -0.63756,0.61882 l -92.18396,0 c -0.35628,0 -0.63756,-0.28128 -0.63756,-0.61882 0,-0.35629 0.28128,-0.63757 0.63756,-0.63757 z m 90.94634,-3.11286 7.50073,3.75043 -7.50073,3.75043 z"
|
||||
id="path3299" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 103.70507,285.15091 94.06852,0 c 0.3469,0 0.62818,0.28128 0.62818,0.62819 0,0.34692 -0.28128,0.6282 -0.62818,0.6282 l -94.06852,0 c -0.34691,0 -0.62819,-0.28128 -0.62819,-0.6282 0,-0.34691 0.28128,-0.62819 0.62819,-0.62819 z m 92.82152,-3.12223 7.50073,3.75042 -7.50073,3.75043 z"
|
||||
id="path3301" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 104.38951,221.9562 91.26512,0 c 0.34691,0 0.61881,0.28128 0.61881,0.6282 0,0.34691 -0.2719,0.62819 -0.61881,0.62819 l -91.26512,0 c -0.33753,0 -0.61881,-0.28128 -0.61881,-0.62819 0,-0.34692 0.28128,-0.6282 0.61881,-0.6282 z m 90.00875,-3.12223 7.50073,3.75043 -7.50073,3.75042 z"
|
||||
id="path3303" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 276.34372,233.58253 0,33.00376 c 0,0.34691 -0.2719,0.6282 -0.61881,0.6282 -0.3469,0 -0.62818,-0.28129 -0.62818,-0.6282 l 0,-33.00376 c 0,-0.33754 0.28128,-0.61882 0.62818,-0.61882 0.34691,0 0.61881,0.28128 0.61881,0.61882 z m 3.13156,31.75674 -3.75037,7.50086 -3.75036,-7.50086 z"
|
||||
id="path3305" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 453.74242,160.71171 0,59.06924"
|
||||
id="path3307" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 452.98619,220.39977 -100.62228,0 c -0.35629,0 -0.63757,-0.28128 -0.63757,-0.61882 0,-0.35629 0.28128,-0.63757 0.63757,-0.63757 l 100.62228,0 c 0.35628,0 0.63756,0.28128 0.63756,0.63757 0,0.33754 -0.28128,0.61882 -0.63756,0.61882 z m -99.38466,3.13161 -7.50073,-3.75043 7.50073,-3.75043 z"
|
||||
id="path3309" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 275.65928,158.82712 0,47.18976 c 0,0.34692 -0.28127,0.6282 -0.62818,0.6282 -0.33754,0 -0.61881,-0.28128 -0.61881,-0.6282 l 0,-47.18976 c 0,-0.34691 0.28127,-0.62819 0.61881,-0.62819 0.34691,0 0.62818,0.28128 0.62818,0.62819 z m 3.12218,45.94274 -3.75036,7.50086 -3.75037,-7.50086 z"
|
||||
id="path3311" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
|
||||
d="m 202.03025,332.9126 0,21.24618 141.76378,0 0,-21.24618 -141.76378,0 z"
|
||||
id="path3313" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.93759114px;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 202.03025,332.9126 0,21.24618 141.76378,0 0,-21.24618 z"
|
||||
id="path3315" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="249.19109"
|
||||
y="348.2706"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3317">Message</text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
x="296.7457"
|
||||
y="348.2706"
|
||||
style="font-size:11.25109386px;font-style:normal;font-weight:bold;text-align:start;text-anchor:start;fill:#000000;font-family:Arial"
|
||||
id="text3319"> </text>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
clip-path="url(#clipEmfPath7)"
|
||||
d="m 174.31695,148.19815 -25.62437,0 c -0.34691,0 -0.62818,-0.28128 -0.62818,-0.62819 0,-0.34692 0.28127,-0.6282 0.62818,-0.6282 l 25.62437,0 c 0.34691,0 0.62818,0.28128 0.62818,0.6282 0,0.34691 -0.28127,0.62819 -0.62818,0.62819 z m -24.37737,3.12223 -7.50073,-3.75042 7.50073,-3.75043 z"
|
||||
id="path3321"
|
||||
transform="translate(28.519633,1.8811043)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.15001458px;stroke-linecap:butt;stroke-linejoin:bevel;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 277.91888,297.09602 0,33.00376 c 0,0.35629 -0.28128,0.61882 -0.63756,0.61882 -0.33754,0 -0.61881,-0.26253 -0.61881,-0.61882 l 0,-33.00376 c 0,-0.33754 0.28127,-0.61882 0.61881,-0.61882 0.35628,0 0.63756,0.28128 0.63756,0.61882 z m 3.1128,31.74737 -3.75036,7.50086 -3.75037,-7.50086 z"
|
||||
id="path3323" />
|
||||
<g
|
||||
id="g3389"
|
||||
transform="translate(103.61121,159.85132)">
|
||||
<text
|
||||
id="text3391"
|
||||
style="font-size:21.59645653px;font-style:normal;font-weight:normal;text-align:start;text-anchor:start;fill:#000000;font-family:Calibri"
|
||||
y="197.34073"
|
||||
x="-0.70423234"
|
||||
xml:space="preserve"> </text>
|
||||
<path
|
||||
id="path3393"
|
||||
d="m 0.74824682,0.41458137 0,183.67838863"
|
||||
style="fill:none;stroke:#000000;stroke-width:1.46715069px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 17 KiB |
@@ -14,8 +14,8 @@ The **Shape Healing** toolkit provides a set of tools to work on the geometry an
|
||||
* upgrade shape characteristics for users needs, for example a C0 supporting surface can be upgraded so that it becomes C1 continuous.
|
||||
|
||||
The following diagram shows dependencies of API packages:
|
||||
@image html /user_guides/shape_healing/images/shape_healing_image009.png "Shape Healing packages"
|
||||
@image latex /user_guides/shape_healing/images/shape_healing_image009.png "Shape Healing packages"
|
||||
|
||||
@figure{/user_guides/shape_healing/images/shape_healing_image009.svg, "Shape Healing packages"}
|
||||
|
||||
Each sub-domain has its own scope of functionality:
|
||||
* analysis - exploring shape properties, computing shape features, detecting violation of OCCT requirements (shape itself is not modified);
|
||||
|
@@ -257,20 +257,20 @@ Handle_AIS_Shape OCCDemo_Presentation::drawShape
|
||||
return aGraphicShape;
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc)
|
||||
void OCCDemo_Presentation::GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
CViewer3dView *pView = (CViewer3dView *) pChild->GetActiveView();
|
||||
pView->GetViewCenter(Xc,Yc);
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
CViewer3dView *pView = (CViewer3dView *) pChild->GetActiveView();
|
||||
pView->GetViewAt (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::SetViewCenter(V3d_Coordinate Xc, V3d_Coordinate Yc)
|
||||
void OCCDemo_Presentation::SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
CViewer3dView *pView = (CViewer3dView *) pChild->GetActiveView();
|
||||
pView->SetViewCenter(Xc,Yc);
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
CViewer3dView *pView = (CViewer3dView *) pChild->GetActiveView();
|
||||
pView->SetViewAt (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z)
|
||||
|
@@ -50,10 +50,10 @@ public:
|
||||
void NextSample() {myIndex++;}
|
||||
void PrevSample() {myIndex--;}
|
||||
virtual void DoSample() = 0;
|
||||
static void GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc);
|
||||
static void SetViewCenter(const V3d_Coordinate Xc, const V3d_Coordinate Yc);
|
||||
static void GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
static void SetViewEye(V3d_Coordinate X, V3d_Coordinate Y, V3d_Coordinate Z);
|
||||
static void GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ);
|
||||
static void SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ);
|
||||
static void GetViewEye (V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
static void SetViewEye (V3d_Coordinate X, V3d_Coordinate Y, V3d_Coordinate Z);
|
||||
static Quantity_Factor GetViewScale();
|
||||
static void SetViewScale(Quantity_Factor Coef);
|
||||
static void ResetView();
|
||||
|
@@ -1183,14 +1183,14 @@ void CViewer3dView::Reset()
|
||||
}
|
||||
}
|
||||
|
||||
void CViewer3dView::GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc)
|
||||
void CViewer3dView::GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ) const
|
||||
{
|
||||
myView->Center(Xc,Yc);
|
||||
myView->At (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void CViewer3dView::SetViewCenter(V3d_Coordinate Xc, V3d_Coordinate Yc)
|
||||
void CViewer3dView::SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ)
|
||||
{
|
||||
myView->SetCenter(Xc,Yc);
|
||||
myView->SetAt (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void CViewer3dView::GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z)
|
||||
|
@@ -39,17 +39,17 @@ protected: // create from serialization only
|
||||
DECLARE_DYNCREATE(CViewer3dView)
|
||||
|
||||
public:
|
||||
CViewer3dDoc* GetDocument();
|
||||
void Redraw() { myView->Redraw(); };
|
||||
void InitButtons();
|
||||
void Reset();
|
||||
void GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc);
|
||||
void CViewer3dView::SetViewCenter(V3d_Coordinate Xc, V3d_Coordinate Yc);
|
||||
void GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
void SetViewEye(const V3d_Coordinate X,const V3d_Coordinate Y,const V3d_Coordinate Z);
|
||||
Quantity_Factor GetViewScale();
|
||||
void SetViewScale(const Quantity_Factor Coef);
|
||||
void FitAll() { myView->FitAll(); myView->ZFitAll(); };
|
||||
CViewer3dDoc* GetDocument();
|
||||
void Redraw() { myView->Redraw(); };
|
||||
void InitButtons();
|
||||
void Reset();
|
||||
void GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ) const;
|
||||
void SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ);
|
||||
void GetViewEye (V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
void SetViewEye (const V3d_Coordinate X,const V3d_Coordinate Y,const V3d_Coordinate Z);
|
||||
Quantity_Factor GetViewScale();
|
||||
void SetViewScale (const Quantity_Factor Coef);
|
||||
void FitAll() { myView->FitAll(); myView->ZFitAll(); };
|
||||
|
||||
|
||||
// Overrides
|
||||
|
@@ -90,6 +90,8 @@ BEGIN
|
||||
SEPARATOR
|
||||
BUTTON ID_FILE_EXPORT_IMAGE
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTON_STEREO
|
||||
SEPARATOR
|
||||
BUTTON ID_APP_ABOUT
|
||||
END
|
||||
|
||||
@@ -264,6 +266,11 @@ BEGIN
|
||||
ID_FILE_MRU_FILE1 "Open recent file\nRecent file"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_BUTTON_STEREO "Toggle stereographic mode on / off"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -135,6 +135,7 @@ void CAnimationView3D::OnInitialUpdate()
|
||||
|
||||
aViewer = GetDocument()->GetViewer();
|
||||
aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
|
||||
|
||||
myView = aViewer->CreateView();
|
||||
|
||||
// store for restore state after rotation (witch is in Degenerated mode)
|
||||
@@ -156,8 +157,6 @@ void CAnimationView3D::OnInitialUpdate()
|
||||
/* I suspect another problem elsewhere */
|
||||
::PostMessage ( GetSafeHwnd () , WM_SIZE , SIZE_RESTORED , w + h*65536 ) ;
|
||||
|
||||
myPView = Handle(V3d_PerspectiveView)::DownCast (myView);
|
||||
|
||||
m_Tune.Create ( IDD_TUNE , NULL ) ;
|
||||
|
||||
RECT dlgrect;
|
||||
@@ -892,37 +891,37 @@ void CAnimationView3D::Twist (int x , int /*y*/)
|
||||
myView->SetTwist (a) ;
|
||||
}
|
||||
|
||||
void CAnimationView3D::SetFocal(double dFocus,double dAngle)
|
||||
//=============================================================================
|
||||
// function: SetFocal
|
||||
// purpose:
|
||||
//=============================================================================
|
||||
void CAnimationView3D::SetFocal (double theFocus, double theAngle)
|
||||
{
|
||||
double v [3] ;
|
||||
double l ;
|
||||
int i ;
|
||||
|
||||
v [0] = m_Atx - m_Eyex ;
|
||||
v [1] = m_Aty - m_Eyey ;
|
||||
v [2] = m_Atz - m_Eyez ;
|
||||
Handle(Graphic3d_Camera) aCamera = myView->Camera();
|
||||
|
||||
l = sqrt ( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ) ;
|
||||
if ( l > 1.e-3 ) {
|
||||
for ( i=0 ; i<3 ; i++ )
|
||||
v [i] = v [i] / l * dFocus ;
|
||||
gp_Pnt anAt = aCamera->Center();
|
||||
gp_Pnt anEye = aCamera->Eye();
|
||||
|
||||
m_Focus = dFocus ;
|
||||
gp_Vec aLook (anAt, anEye);
|
||||
|
||||
m_Atx = v [0] + m_Eyex ;
|
||||
m_Aty = v [1] + m_Eyey ;
|
||||
m_Atz = v [2] + m_Eyez ;
|
||||
if (aCamera->Distance() > 1.e-3)
|
||||
{
|
||||
aLook = aLook / aCamera->Distance() * theFocus;
|
||||
|
||||
myView->SetImmediateUpdate ( Standard_False ) ;
|
||||
myView->SetAt ( m_Atx , m_Aty , m_Atz ) ;
|
||||
m_dAngle = dAngle ;
|
||||
dAngle = dAngle * M_PI / 180. ;
|
||||
myPView->SetAngle ( dAngle ) ;
|
||||
dAngle = myPView->Angle () ;
|
||||
m_Focus = theFocus;
|
||||
|
||||
myView->SetImmediateUpdate ( Standard_True ) ;
|
||||
myView->Update ();
|
||||
}
|
||||
anAt.SetX (aLook.X() + anEye.X());
|
||||
anAt.SetY (aLook.Y() + anEye.Y());
|
||||
anAt.SetZ (aLook.Z() + anEye.Z());
|
||||
|
||||
m_dAngle = theAngle;
|
||||
|
||||
aCamera->SetCenter (anAt);
|
||||
aCamera->SetFOVy (theAngle);
|
||||
|
||||
myView->Update();
|
||||
}
|
||||
}
|
||||
|
||||
void CAnimationView3D::ReloadData()
|
||||
@@ -958,9 +957,9 @@ void CAnimationView3D::ReloadData()
|
||||
dy = m_Aty - m_Eyey ;
|
||||
dz = m_Atz - m_Eyez ;
|
||||
|
||||
m_Focus = sqrt ( dx * dx + dy * dy + dz * dz ) ;
|
||||
m_dAngle = myPView->Angle () ;
|
||||
m_dAngle = m_dAngle * 180. / M_PI ;
|
||||
m_Focus = sqrt (dx * dx + dy * dy + dz * dz);
|
||||
|
||||
m_dAngle = myView->Camera()->FOVy();
|
||||
|
||||
m_Tune.m_dAngle = m_dAngle ;
|
||||
m_Tune.m_dFocus = m_Focus ;
|
||||
|
@@ -59,7 +59,7 @@ public:
|
||||
void SetDimensions ();
|
||||
void ReloadData();
|
||||
CTune m_Tune;
|
||||
void SetFocal ( double dFocus , double dAngle );
|
||||
void SetFocal (double theFocus, double theAngle);
|
||||
void Fly (int x , int y);
|
||||
void Turn (int x , int y);
|
||||
void Roll (int x , int y);
|
||||
@@ -138,8 +138,6 @@ private:
|
||||
Quantity_Factor myCurZoom;
|
||||
Standard_Boolean myHlrModeIsOn;
|
||||
|
||||
Handle_V3d_PerspectiveView myPView;
|
||||
|
||||
View3D_CurrentAction myCurrentMode;
|
||||
double m_Atx , m_Aty , m_Atz ;
|
||||
double m_Eyex , m_Eyey , m_Eyez ;
|
||||
|
@@ -210,7 +210,6 @@ enum CurrentAction3d {
|
||||
#include "HLRAlgo_Projector.hxx"
|
||||
#include "Aspect_MarkMap.hxx"
|
||||
|
||||
#include <V3d_PerspectiveView.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
|
@@ -69,6 +69,7 @@ Convert_Presentation::Convert_Presentation()
|
||||
myIndex = 0;
|
||||
myNbFuncs = sizeof(SampleFuncs)/sizeof(PSampleFuncType);
|
||||
myNbSamples = myNbFuncs;
|
||||
FitMode = true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -84,7 +85,6 @@ void Convert_Presentation::DoSample()
|
||||
(this->*SampleFuncs[myIndex])();
|
||||
}
|
||||
|
||||
|
||||
//================================================================
|
||||
// Function : Convert_Presentation::drawSurfaceAndItsBSpline
|
||||
// Purpose :
|
||||
@@ -332,7 +332,7 @@ void Convert_Presentation::sampleRevolSurface()
|
||||
{
|
||||
FitMode=false;
|
||||
ResetView();
|
||||
SetViewCenter(176.84682,102.12892);
|
||||
TranslateView(-176.84682, -102.12892);
|
||||
SetViewScale(0.69326);
|
||||
|
||||
getAISContext()->EraseAll();
|
||||
|
@@ -257,20 +257,20 @@ Handle_AIS_Shape OCCDemo_Presentation::drawShape
|
||||
return aGraphicShape;
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc)
|
||||
void OCCDemo_Presentation::GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->GetViewCenter(Xc,Yc);
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->GetViewAt (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::SetViewCenter(V3d_Coordinate Xc, V3d_Coordinate Yc)
|
||||
void OCCDemo_Presentation::SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->SetViewCenter(Xc,Yc);
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->SetViewAt (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z)
|
||||
@@ -311,4 +311,12 @@ void OCCDemo_Presentation::ResetView()
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void OCCDemo_Presentation::TranslateView (const V3d_Coordinate theX, const V3d_Coordinate theY)
|
||||
{
|
||||
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
||||
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
|
||||
COCCDemoView *pView = (COCCDemoView *) pChild->GetActiveView();
|
||||
pView->Translate (theX, theY);
|
||||
}
|
||||
|
@@ -50,14 +50,14 @@ public:
|
||||
void NextSample() {myIndex++;}
|
||||
void PrevSample() {myIndex--;}
|
||||
virtual void DoSample() = 0;
|
||||
static void GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc);
|
||||
static void SetViewCenter(const V3d_Coordinate Xc, const V3d_Coordinate Yc);
|
||||
static void GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
static void SetViewEye(V3d_Coordinate X, V3d_Coordinate Y, V3d_Coordinate Z);
|
||||
static void GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ);
|
||||
static void SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ);
|
||||
static void GetViewEye (V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
static void SetViewEye (V3d_Coordinate X, V3d_Coordinate Y, V3d_Coordinate Z);
|
||||
static Quantity_Factor GetViewScale();
|
||||
static void SetViewScale(Quantity_Factor Coef);
|
||||
static void ResetView();
|
||||
|
||||
static void TranslateView (const V3d_Coordinate theX, const V3d_Coordinate theY);
|
||||
|
||||
// place one-time initialization code in this function
|
||||
virtual void Init() {}
|
||||
|
@@ -97,6 +97,8 @@ void COCCDemoView::OnInitialUpdate()
|
||||
CView::OnInitialUpdate();
|
||||
|
||||
myView = GetDocument()->GetViewer()->CreateView();
|
||||
myView->SetViewMappingDefault();
|
||||
myView->SetViewOrientationDefault();
|
||||
|
||||
Handle(WNT_Window) aWNTWindow = new WNT_Window(GetSafeHwnd ());
|
||||
myView->SetWindow(aWNTWindow);
|
||||
@@ -543,14 +545,14 @@ void COCCDemoView::OnUpdateBUTTONHlrOn(CCmdUI* pCmdUI)
|
||||
pCmdUI->Enable (myVisMode != VIS_HLR);
|
||||
}
|
||||
|
||||
void COCCDemoView::GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc)
|
||||
void COCCDemoView::GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ) const
|
||||
{
|
||||
myView->Center(Xc,Yc);
|
||||
myView->At (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void COCCDemoView::SetViewCenter(V3d_Coordinate Xc, V3d_Coordinate Yc)
|
||||
void COCCDemoView::SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ)
|
||||
{
|
||||
myView->SetCenter(Xc,Yc);
|
||||
myView->SetAt (theX, theY, theZ);
|
||||
}
|
||||
|
||||
void COCCDemoView::GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z)
|
||||
@@ -572,3 +574,8 @@ void COCCDemoView::SetViewScale(Quantity_Factor Coef)
|
||||
{
|
||||
myView->SetScale(Coef);
|
||||
}
|
||||
|
||||
void COCCDemoView::Translate (const Standard_Real theX, const Standard_Real theY)
|
||||
{
|
||||
myView->Panning (theX, theY);
|
||||
}
|
||||
|
@@ -27,13 +27,18 @@ protected: // create from serialization only
|
||||
// Attributes
|
||||
public:
|
||||
COCCDemoDoc* GetDocument();
|
||||
void FitAll() { myView->FitAll(); myView->ZFitAll(); };
|
||||
void GetViewCenter(V3d_Coordinate& Xc, V3d_Coordinate& Yc);
|
||||
void SetViewCenter(const V3d_Coordinate Xc, const V3d_Coordinate Yc);
|
||||
void GetViewEye(V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
void SetViewEye(const V3d_Coordinate X,const V3d_Coordinate Y,const V3d_Coordinate Z);
|
||||
void FitAll()
|
||||
{
|
||||
myView->FitAll();
|
||||
myView->ZFitAll();
|
||||
};
|
||||
void GetViewAt (V3d_Coordinate& theX, V3d_Coordinate& theY, V3d_Coordinate& theZ) const;
|
||||
void SetViewAt (const V3d_Coordinate theX, const V3d_Coordinate theY, const V3d_Coordinate theZ);
|
||||
void GetViewEye (V3d_Coordinate& X, V3d_Coordinate& Y, V3d_Coordinate& Z);
|
||||
void SetViewEye (const V3d_Coordinate X,const V3d_Coordinate Y,const V3d_Coordinate Z);
|
||||
Quantity_Factor GetViewScale();
|
||||
void SetViewScale(const Quantity_Factor Coef);
|
||||
void Translate (const V3d_Coordinate theX, const V3d_Coordinate theY);
|
||||
|
||||
|
||||
// Operations
|
||||
|
@@ -9,7 +9,11 @@
|
||||
#include <res\OCC_Resource.h>
|
||||
|
||||
#include <Visual3d_View.hxx>
|
||||
|
||||
#include <Graphic3d_ExportFormat.hxx>
|
||||
#include <Graphic3d_Camera.hxx>
|
||||
|
||||
#include <OpenGl_GraphicDriver.hxx>
|
||||
|
||||
#define ValZWMin 1
|
||||
|
||||
@@ -31,6 +35,7 @@ BEGIN_MESSAGE_MAP(OCC_3dView, CView)
|
||||
ON_COMMAND(ID_BUTTONRot, OnBUTTONRot)
|
||||
ON_COMMAND(ID_BUTTONTop, OnBUTTONTop)
|
||||
ON_COMMAND(ID_BUTTONZoomAll, OnBUTTONZoomAll)
|
||||
ON_COMMAND(ID_BUTTON_STEREOCONFIG, OnStereoConfigButton)
|
||||
ON_WM_SIZE()
|
||||
ON_COMMAND(ID_FILE_EXPORT_IMAGE, OnFileExportImage)
|
||||
ON_COMMAND(ID_BUTTONZoomProg, OnBUTTONZoomProg)
|
||||
@@ -49,6 +54,7 @@ BEGIN_MESSAGE_MAP(OCC_3dView, CView)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONZoomProg, OnUpdateBUTTONZoomProg)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONZoomWin, OnUpdateBUTTONZoomWin)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTONRot, OnUpdateBUTTONRot)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTON_STEREOCONFIG, OnUpdateStereoConfigButton)
|
||||
ON_COMMAND(ID_Modify_ChangeBackground , OnModifyChangeBackground)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
@@ -73,9 +79,13 @@ OCC_3dView::OCC_3dView()
|
||||
|
||||
OCC_3dView::~OCC_3dView()
|
||||
{
|
||||
if ( myView )
|
||||
if (myView)
|
||||
{
|
||||
myView->Remove();
|
||||
if (m_Pen) delete m_Pen;
|
||||
}
|
||||
|
||||
delete m_pStereoDlg;
|
||||
delete m_Pen;
|
||||
}
|
||||
|
||||
BOOL OCC_3dView::PreCreateWindow(CREATESTRUCT& cs)
|
||||
@@ -97,15 +107,27 @@ void OCC_3dView::OnInitialUpdate()
|
||||
myHlrModeIsOn = Standard_False;
|
||||
myView->SetComputedMode (myHlrModeIsOn);
|
||||
|
||||
Handle(Graphic3d_GraphicDriver) aGraphicDriver =
|
||||
((OCC_App*)AfxGetApp())->GetGraphicDriver();
|
||||
Handle(OpenGl_GraphicDriver) aDriver =
|
||||
Handle(OpenGl_GraphicDriver)::DownCast (((OCC_App*)AfxGetApp())->GetGraphicDriver());
|
||||
|
||||
Handle(WNT_Window) aWNTWindow = new WNT_Window(GetSafeHwnd());
|
||||
|
||||
myView->SetWindow(aWNTWindow);
|
||||
if (!aWNTWindow->IsMapped()) aWNTWindow->Map();
|
||||
myView->Camera()->SetProjectionType (aDriver->Options().contextStereo
|
||||
? Graphic3d_Camera::Projection_Stereo
|
||||
: Graphic3d_Camera::Projection_Orthographic);
|
||||
|
||||
if (!aWNTWindow->IsMapped())
|
||||
{
|
||||
aWNTWindow->Map();
|
||||
}
|
||||
|
||||
// store the mode ( nothing , dynamic zooming, dynamic ... )
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
|
||||
m_pStereoDlg = new OCC_StereoConfigDlg (this);
|
||||
m_pStereoDlg->SetView (myView);
|
||||
m_pStereoDlg->Create (IDD_DIALOG_STEREO, this);
|
||||
}
|
||||
|
||||
void OCC_3dView::OnDraw(CDC* /*pDC*/)
|
||||
@@ -600,3 +622,33 @@ void OCC_3dView::OnModifyChangeBackground()
|
||||
}
|
||||
myView->Redraw();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// function: OnStereoConfigButton
|
||||
// purpose: Open stereographic configuration dialog
|
||||
//=============================================================================
|
||||
void OCC_3dView::OnStereoConfigButton()
|
||||
{
|
||||
m_pStereoDlg->ShowWindow (SW_SHOW);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// function: OnUpdateStereoConfigButton
|
||||
// purpose: Enable / disable state of stereo configuration button
|
||||
//=============================================================================
|
||||
void OCC_3dView::OnUpdateStereoConfigButton (CCmdUI* theCmdUI)
|
||||
{
|
||||
// get camera
|
||||
Handle(Graphic3d_Camera) aCamera = myView->Camera();
|
||||
|
||||
// check that button is enabled
|
||||
Standard_Boolean isEnabled = !aCamera.IsNull() && aCamera->IsStereo();
|
||||
|
||||
// update toggle state
|
||||
theCmdUI->Enable (isEnabled);
|
||||
|
||||
if (!isEnabled)
|
||||
{
|
||||
m_pStereoDlg->ShowWindow (SW_HIDE);
|
||||
}
|
||||
}
|
||||
|
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "OCC_BaseView.h"
|
||||
#include "OCC_3dDoc.h"
|
||||
#include "OCC_StereoConfigDlg.h"
|
||||
#include <Standard_Macro.hxx>
|
||||
|
||||
enum CurAction3d {
|
||||
@@ -81,6 +82,8 @@ protected:
|
||||
afx_msg void OnUpdateBUTTONZoomWin(CCmdUI* pCmdUI);
|
||||
afx_msg void OnUpdateBUTTONRot(CCmdUI* pCmdUI);
|
||||
afx_msg void OnModifyChangeBackground();
|
||||
afx_msg void OnStereoConfigButton();
|
||||
afx_msg void OnUpdateStereoConfigButton (CCmdUI* theCmdUI);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
@@ -111,6 +114,11 @@ protected:
|
||||
const Standard_Integer MaxY ,
|
||||
const Standard_Boolean Draw ,
|
||||
const LineStyle aLineStyle = Default );
|
||||
|
||||
private:
|
||||
|
||||
//! Persistent non blocking stereo configuration dialog
|
||||
OCC_StereoConfigDlg* m_pStereoDlg;
|
||||
};
|
||||
|
||||
#ifndef _DEBUG // debug version in OCC_3dView.cpp
|
||||
|
@@ -5,11 +5,13 @@
|
||||
#include <stdafx.h>
|
||||
|
||||
#include "OCC_App.h"
|
||||
|
||||
#include "OCC_BaseDoc.h"
|
||||
#include <res\OCC_Resource.h>
|
||||
|
||||
#include <Standard_Version.hxx>
|
||||
#include <OpenGl_GraphicDriver.hxx>
|
||||
#include <OSD.hxx>
|
||||
|
||||
#include "afxwin.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -24,6 +26,8 @@ BEGIN_MESSAGE_MAP(OCC_App, CWinApp)
|
||||
// Standard file based document commands
|
||||
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
|
||||
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
|
||||
ON_COMMAND(ID_BUTTON_STEREO, &OCC_App::OnStereo)
|
||||
ON_UPDATE_COMMAND_UI(ID_BUTTON_STEREO, &OCC_App::OnUpdateStereo)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -174,3 +178,57 @@ void OCC_App::SetSampleName(LPCTSTR Name)
|
||||
{
|
||||
SampleName = Name;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// function: OnStereo
|
||||
// purpose:
|
||||
//=============================================================================
|
||||
void OCC_App::OnStereo()
|
||||
{
|
||||
Handle(OpenGl_GraphicDriver) aDriver = Handle(OpenGl_GraphicDriver)::DownCast (myGraphicDriver);
|
||||
|
||||
int anAnswer = MessageBox(NULL,
|
||||
"It is required to switch OpenGl context to turn on / off hardware stereo support. "
|
||||
"The document views need to be re-created to change \"GL\" context pixel format. "
|
||||
"This will close all current views and open new one (the model will be kept).\n"
|
||||
"Do you want to continue?", "Enable/disable hardware stereo support", MB_OKCANCEL | MB_ICONQUESTION);
|
||||
if (anAnswer != IDOK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Standard_Boolean& aStereoMode = aDriver->ChangeOptions().contextStereo;
|
||||
|
||||
aStereoMode = !aStereoMode;
|
||||
|
||||
// reset document views
|
||||
POSITION aTemplateIt = GetFirstDocTemplatePosition();
|
||||
|
||||
while (aTemplateIt != NULL)
|
||||
{
|
||||
CDocTemplate* aTemplate = (CDocTemplate*)GetNextDocTemplate (aTemplateIt);
|
||||
|
||||
POSITION aDocumentIt = aTemplate->GetFirstDocPosition();
|
||||
|
||||
while (aDocumentIt != NULL)
|
||||
{
|
||||
OCC_BaseDoc* aDocument = dynamic_cast<OCC_BaseDoc*> (aTemplate->GetNextDoc (aDocumentIt));
|
||||
if (aDocument == NULL)
|
||||
continue;
|
||||
|
||||
aDocument->ResetDocumentViews (aTemplate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// function: OnUpdateStereo
|
||||
// purpose:
|
||||
//=============================================================================
|
||||
void OCC_App::OnUpdateStereo (CCmdUI* theCmdUI)
|
||||
{
|
||||
Handle(OpenGl_GraphicDriver) aDriver =
|
||||
Handle(OpenGl_GraphicDriver)::DownCast (myGraphicDriver);
|
||||
|
||||
theCmdUI->SetCheck (!aDriver.IsNull() && aDriver->Options().contextStereo);
|
||||
}
|
||||
|
@@ -27,11 +27,13 @@ public:
|
||||
}
|
||||
|
||||
// Implementation
|
||||
//{{AFX_MSG(OCC_BaseApp)
|
||||
afx_msg void OnAppAbout();
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
//{{AFX_MSG(OCC_BaseApp)
|
||||
afx_msg void OnAppAbout();
|
||||
afx_msg void OnStereo();
|
||||
afx_msg void OnUpdateStereo (CCmdUI* theCmdUI);
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
protected:
|
||||
Handle_Graphic3d_GraphicDriver myGraphicDriver;
|
||||
|
@@ -66,4 +66,40 @@ OCC_BaseDoc::OCC_BaseDoc()
|
||||
OCC_BaseDoc::~OCC_BaseDoc()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
// function: ResetDocumentViews
|
||||
// purpose:
|
||||
//=============================================================================
|
||||
void OCC_BaseDoc::ResetDocumentViews (CDocTemplate* theTemplate)
|
||||
{
|
||||
// do not delete document if no views
|
||||
BOOL isAutoDelete = m_bAutoDelete;
|
||||
m_bAutoDelete = FALSE;
|
||||
|
||||
// close all opened views
|
||||
POSITION aViewIt = GetFirstViewPosition();
|
||||
while (aViewIt)
|
||||
{
|
||||
CView* aView = GetNextView (aViewIt);
|
||||
if (aView == NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
RemoveView (aView);
|
||||
|
||||
aView->GetParentFrame()->SendMessage (WM_CLOSE);
|
||||
}
|
||||
|
||||
// create new view frame
|
||||
CFrameWnd* aNewFrame = theTemplate->CreateNewFrame (this, NULL);
|
||||
m_bAutoDelete = isAutoDelete;
|
||||
|
||||
// init frame
|
||||
theTemplate->InitialUpdateFrame(aNewFrame, this);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -68,6 +68,11 @@ public:
|
||||
virtual void Popup (const Standard_Integer /*theMouseX*/,
|
||||
const Standard_Integer /*theMouseY*/,
|
||||
const Handle(V3d_View)& /*theView*/) {}
|
||||
|
||||
public:
|
||||
|
||||
void ResetDocumentViews (CDocTemplate* theTemplate);
|
||||
|
||||
protected:
|
||||
|
||||
Handle(V3d_Viewer) myViewer;
|
||||
|
250
samples/mfc/standard/Common/OCC_StereoConfigDlg.cpp
Normal file
@@ -0,0 +1,250 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// OCC_StereoConfigDlg.cpp : source file
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "OCC_StereoConfigDlg.h"
|
||||
#include <Graphic3d_Camera.hxx>
|
||||
|
||||
BEGIN_MESSAGE_MAP (OCC_StereoConfigDlg, CDialog)
|
||||
|
||||
ON_WM_HSCROLL()
|
||||
ON_NOTIFY (UDN_DELTAPOS, IDC_SPIN_FOCUS, OnSpinFocus)
|
||||
ON_NOTIFY (UDN_DELTAPOS, IDC_SPIN_IOD, OnSpinIOD)
|
||||
ON_BN_CLICKED (IDC_CHECK_FOCUS_RELATIVE, OnCheckFocus)
|
||||
ON_BN_CLICKED (IDC_CHECK_IOD_RELATIVE, OnCheckIOD)
|
||||
ON_EN_CHANGE (IDC_EDIT_FOCUS, OnChangeFocus)
|
||||
ON_EN_CHANGE (IDC_EDIT_IOD, OnChangeIOD)
|
||||
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
// round up value macro
|
||||
#define ROUND_UP(X) X = (Round(X * 10000.0) / 10000.0)
|
||||
|
||||
// slider tick conversion
|
||||
#define TO_SLIDER(X) (Standard_Integer)Round(X * 10)
|
||||
|
||||
// back conversion from slider ticks
|
||||
#define FROM_SLIDER(X) X / 10.0
|
||||
|
||||
// ============================================================================
|
||||
// function: SetView
|
||||
// purpose:
|
||||
// ============================================================================
|
||||
void OCC_StereoConfigDlg::SetView (const Handle(V3d_View)& theView)
|
||||
{
|
||||
myView = theView;
|
||||
|
||||
// access initial values
|
||||
myIOD = myView->Camera()->IOD();
|
||||
myFocus = myView->Camera()->ZFocus();
|
||||
mySliderFocus = TO_SLIDER(myFocus);
|
||||
myIsRelativeIOD = (myView->Camera()->GetIODType() == Graphic3d_Camera::IODType_Relative);
|
||||
myIsRelativeFocus = (myView->Camera()->ZFocusType() == Graphic3d_Camera::FocusType_Relative);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// function: DoDataExchange
|
||||
// purpose:
|
||||
// ============================================================================
|
||||
void OCC_StereoConfigDlg::DoDataExchange(CDataExchange* theDX)
|
||||
{
|
||||
CDialog::DoDataExchange(theDX);
|
||||
|
||||
DDX_Text (theDX, IDC_EDIT_IOD, myIOD);
|
||||
DDV_MinMaxDouble (theDX, myIOD, -DBL_MAX, DBL_MAX);
|
||||
|
||||
if (myIsRelativeFocus)
|
||||
{
|
||||
// do slider data exchange
|
||||
DDX_Slider (theDX, IDC_SLIDER_FOCUS, (int&)mySliderFocus);
|
||||
DDV_MinMaxSlider (theDX, mySliderFocus, TO_SLIDER(0.1), TO_SLIDER(10));
|
||||
|
||||
// show up value in edit field
|
||||
Standard_Real aEditValue = FROM_SLIDER (mySliderFocus);
|
||||
DDX_Text (theDX, IDC_EDIT_FOCUS, aEditValue);
|
||||
|
||||
// update focus value correspondingly
|
||||
myFocus = FROM_SLIDER (mySliderFocus);
|
||||
}
|
||||
else
|
||||
{
|
||||
DDX_Text (theDX, IDC_EDIT_FOCUS, myFocus);
|
||||
DDV_MinMaxDouble (theDX, myFocus, 50, DBL_MAX);
|
||||
|
||||
mySliderFocus = TO_SLIDER(1.0);
|
||||
DDX_Slider (theDX, IDC_SLIDER_FOCUS, (int&)mySliderFocus);
|
||||
}
|
||||
|
||||
DDX_Check (theDX, IDC_CHECK_FOCUS_RELATIVE, (int&)myIsRelativeFocus);
|
||||
DDX_Check (theDX, IDC_CHECK_IOD_RELATIVE, (int&)myIsRelativeIOD);
|
||||
|
||||
CEdit* aFocusEdit = (CEdit*) GetDlgItem (IDC_EDIT_FOCUS);
|
||||
aFocusEdit->EnableWindow (myIsRelativeFocus != Standard_True);
|
||||
|
||||
CSliderCtrl* aSlider = (CSliderCtrl*) GetDlgItem (IDC_SLIDER_FOCUS);
|
||||
aSlider->EnableWindow (myIsRelativeFocus == Standard_True);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// function: OnHScroll
|
||||
// purpose:
|
||||
// ============================================================================
|
||||
void OCC_StereoConfigDlg::OnHScroll(UINT theSBCode, UINT thePos, CScrollBar* theScrollBar)
|
||||
{
|
||||
UpdateData (true);
|
||||
UpdateData (false);
|
||||
UpdateCamera();
|
||||
CWnd::OnHScroll(theSBCode, thePos, theScrollBar);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// function: UpdateCamera
|
||||
// purpose:
|
||||
// ============================================================================
|
||||
void OCC_StereoConfigDlg::UpdateCamera()
|
||||
{
|
||||
// update camera properties and redraw view
|
||||
const Handle(Graphic3d_Camera)& aCamera = myView->Camera();
|
||||
if (aCamera.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// change IOD
|
||||
Graphic3d_Camera::IODType aIODType =
|
||||
myIsRelativeIOD ? Graphic3d_Camera::IODType_Relative :
|
||||
Graphic3d_Camera::IODType_Absolute;
|
||||
|
||||
aCamera->SetIOD (aIODType, myIOD);
|
||||
|
||||
// change Focus
|
||||
Graphic3d_Camera::FocusType aFocusType =
|
||||
myIsRelativeFocus ? Graphic3d_Camera::FocusType_Relative :
|
||||
Graphic3d_Camera::FocusType_Absolute;
|
||||
|
||||
aCamera->SetZFocus (aFocusType, myFocus);
|
||||
|
||||
// redraw view
|
||||
myView->Redraw();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// function: OnCheckFocus
|
||||
// purpose:
|
||||
// ============================================================================
|
||||
void OCC_StereoConfigDlg::OnCheckFocus()
|
||||
{
|
||||
UpdateData (true);
|
||||
|
||||
// change focus to some predefined values
|
||||
if (myIsRelativeFocus)
|
||||
myFocus = 1.0;
|
||||
else
|
||||
myFocus = 100.0;
|
||||
|
||||
UpdateData (false);
|
||||
UpdateCamera();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// function: OnCheckIOD
|
||||
// purpose:
|
||||
// ============================================================================
|
||||
void OCC_StereoConfigDlg::OnCheckIOD()
|
||||
{
|
||||
UpdateData (true);
|
||||
UpdateCamera();
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// function: OnChangeFocus
|
||||
// purpose:
|
||||
// ============================================================================
|
||||
void OCC_StereoConfigDlg::OnChangeFocus()
|
||||
{
|
||||
// keep previous value
|
||||
Standard_Real aPrevFocus = myFocus;
|
||||
|
||||
// read data from ui controls
|
||||
if (UpdateData (true))
|
||||
{
|
||||
UpdateCamera();
|
||||
}
|
||||
else
|
||||
{
|
||||
// revert back
|
||||
myFocus = aPrevFocus;
|
||||
UpdateData (false);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// function: OnChangeIOD
|
||||
// purpose:
|
||||
// ============================================================================
|
||||
void OCC_StereoConfigDlg::OnChangeIOD()
|
||||
{
|
||||
// keep previous value
|
||||
Standard_Real aPrevIOD = myIOD;
|
||||
|
||||
// read data from ui controls
|
||||
if (UpdateData (true))
|
||||
{
|
||||
UpdateCamera();
|
||||
}
|
||||
else
|
||||
{
|
||||
// revert back
|
||||
myIOD = aPrevIOD;
|
||||
UpdateData (false);
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// function: OnSpinFocus
|
||||
// purpose:
|
||||
// ============================================================================
|
||||
void OCC_StereoConfigDlg::OnSpinFocus (NMHDR* theNMHDR, LRESULT* theResult)
|
||||
{
|
||||
NM_UPDOWN* aNMUpDown = (NM_UPDOWN*)theNMHDR;
|
||||
|
||||
const double aStep = 0.1; // use small incremental step
|
||||
const double aDelta = aNMUpDown->iDelta * aStep; // get delta
|
||||
|
||||
// changes value
|
||||
myFocus -= (Standard_Real)aDelta;
|
||||
|
||||
// round up value
|
||||
ROUND_UP (myFocus);
|
||||
|
||||
// actualize view & ui controls
|
||||
UpdateData (false);
|
||||
UpdateCamera();
|
||||
|
||||
*theResult = 0;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// function: OnSpinIOD
|
||||
// purpose:
|
||||
// ============================================================================
|
||||
void OCC_StereoConfigDlg::OnSpinIOD (NMHDR* theNMHDR, LRESULT* theResult)
|
||||
{
|
||||
NM_UPDOWN* aNMUpDown = (NM_UPDOWN*)theNMHDR;
|
||||
|
||||
const double aStep = 0.01; // use small incremental step
|
||||
const double aDelta = aNMUpDown->iDelta * aStep; // get delta
|
||||
|
||||
// changes value
|
||||
myIOD -= (Standard_Real)aDelta;
|
||||
|
||||
// round up value
|
||||
ROUND_UP (myIOD);
|
||||
|
||||
// actualize view & ui controls
|
||||
UpdateData (false);
|
||||
UpdateCamera();
|
||||
|
||||
*theResult = 0;
|
||||
}
|
55
samples/mfc/standard/Common/OCC_StereoConfigDlg.h
Normal file
@@ -0,0 +1,55 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// OCC_StereoConfigDlg.h : header file
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef OCC_StereoConfigDlg_Header
|
||||
#define OCC_StereoConfigDlg_Header
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
|
||||
#include "res\OCC_Resource.h"
|
||||
#include <V3d_View.hxx>
|
||||
|
||||
// Dialog to dynamically configure 3D Viewer stereo
|
||||
// projection properties.
|
||||
class AFX_EXT_CLASS OCC_StereoConfigDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
|
||||
OCC_StereoConfigDlg (CWnd* theParent = NULL)
|
||||
: CDialog (IDD_DIALOG_STEREO, theParent) {}
|
||||
|
||||
void SetView (const Handle(V3d_View)& theView);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void DoDataExchange (CDataExchange* theDX);
|
||||
|
||||
void UpdateCamera();
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
afx_msg void OnCheckFocus();
|
||||
afx_msg void OnCheckIOD();
|
||||
afx_msg void OnChangeFocus();
|
||||
afx_msg void OnChangeIOD();
|
||||
afx_msg void OnSpinFocus (NMHDR* theNMHDR, LRESULT* theResult);
|
||||
afx_msg void OnSpinIOD (NMHDR* theNMHDR, LRESULT* theResult);
|
||||
afx_msg void OnHScroll(UINT theSBCode, UINT thePos, CScrollBar* theScrollBar);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
|
||||
Standard_Real myIOD;
|
||||
Standard_Real myFocus;
|
||||
Standard_Integer mySliderFocus;
|
||||
Standard_Boolean myIsRelativeIOD;
|
||||
Standard_Boolean myIsRelativeFocus;
|
||||
Handle(V3d_View) myView;
|
||||
};
|
||||
|
||||
#endif
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
samples/mfc/standard/Common/res/OCC_Resource.aps
Executable file
@@ -5,6 +5,7 @@
|
||||
#define IDD_ParamsFacesPage 101
|
||||
#define IDR_POPUP 116
|
||||
#define IDD_Dimension 119
|
||||
#define IDD_DIALOG_STEREO 120
|
||||
#define IDD_LengthParamsEdgePage 122
|
||||
#define IDD_LengthParamsVerticesPage 123
|
||||
#define IDD_LengthParamsEdgesPage 125
|
||||
@@ -62,10 +63,17 @@
|
||||
#define IDC_TextDisplayMode 1047
|
||||
#define IDC_TextDisplayModeStatic 1048
|
||||
#define IDC_DimensionColor 1049
|
||||
#define IDC_FacesSt1 1052
|
||||
#define IDC_FacesSt2 1053
|
||||
#define IDC_FacesBtn1 1054
|
||||
#define IDC_FacesBtn2 1055
|
||||
#define IDC_EDIT_IOD 1050
|
||||
#define IDC_SPIN_IOD 1051
|
||||
#define IDC_CHECK_IOD_RELATIVE 1052
|
||||
#define IDC_CHECK_FOCUS_RELATIVE 1053
|
||||
#define IDC_SLIDER_FOCUS 1054
|
||||
#define IDC_EDIT_FOCUS 1055
|
||||
#define IDC_SPIN_FOCUS 1056
|
||||
#define IDC_FacesSt1 1057
|
||||
#define IDC_FacesSt2 1058
|
||||
#define IDC_FacesBtn1 1059
|
||||
#define IDC_FacesBtn2 1060
|
||||
#define ID_WINDOW_NEW3D 1151
|
||||
#define ID_OBJECT_DISPLAYALL 1201
|
||||
#define ID_OBJECT_MATERIAL 1205
|
||||
@@ -140,6 +148,9 @@
|
||||
#define ID_OBJECT_DIMENSIONS 40035
|
||||
#define ID_OBJECT_DIM 40036
|
||||
#define ID_LOCALCONTEXT_ADDDIMENSION 40037
|
||||
#define ID_BUTTON_STEREOSETTINGS 40038
|
||||
#define ID_BUTTON_STEREO 40039
|
||||
#define ID_BUTTON_STEREOCONFIG 40040
|
||||
#define ID_FILE_IMPORT_CSFDB 40100
|
||||
#define ID_FILE_IMPORT_BREP 40101
|
||||
#define ID_FILE_IMPORT_STEP 40102
|
||||
@@ -180,8 +191,8 @@
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 131
|
||||
#define _APS_NEXT_COMMAND_VALUE 40038
|
||||
#define _APS_NEXT_CONTROL_VALUE 1055
|
||||
#define _APS_NEXT_COMMAND_VALUE 40041
|
||||
#define _APS_NEXT_CONTROL_VALUE 1061
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -280,6 +280,25 @@ BEGIN
|
||||
PUSHBUTTON "Change dimension color",IDC_DimensionColor,105,156,63,24,BS_MULTILINE
|
||||
CONTROL "",IDC_Flyout,"msctls_trackbar32",TBS_TOP | TBS_TOOLTIPS | WS_TABSTOP,73,112,100,20
|
||||
END
|
||||
IDD_DIALOG_STEREO DIALOGEX 0, 0, 166, 177
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Configure stereo"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
EDITTEXT IDC_EDIT_IOD,88,42,41,12,ES_AUTOHSCROLL | WS_GROUP
|
||||
CONTROL "",IDC_SPIN_IOD,"msctls_updown32",UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_GROUP,130,42,11,12
|
||||
GROUPBOX "Stereo focus properties:",IDC_STATIC,7,72,149,96
|
||||
GROUPBOX "Eye separation properties:",IDC_STATIC,6,6,150,60
|
||||
LTEXT "Intraocular distance:",IDC_STATIC,18,43,68,8
|
||||
CONTROL "",IDC_CHECK_IOD_RELATIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,24,16,10
|
||||
LTEXT "Relative to focal length:",IDC_STATIC,18,24,78,8
|
||||
CONTROL "",IDC_CHECK_FOCUS_RELATIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,90,16,10
|
||||
LTEXT "Relative to focal length:",IDC_STATIC,18,90,78,8
|
||||
CONTROL "",IDC_SLIDER_FOCUS,"msctls_trackbar32",TBS_TOP | WS_TABSTOP,18,108,126,24
|
||||
LTEXT "Fixed value:",IDC_STATIC,18,146,40,8
|
||||
EDITTEXT IDC_EDIT_FOCUS,67,144,41,12,ES_AUTOHSCROLL | WS_GROUP
|
||||
CONTROL "",IDC_SPIN_FOCUS,"msctls_updown32",UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_GROUP,108,144,11,12
|
||||
END
|
||||
|
||||
IDD_ParamsFacesPage DIALOGEX 0, 0, 134, 73
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
|
||||
@@ -345,6 +364,8 @@ BEGIN
|
||||
BUTTON ID_BUTTONRot
|
||||
BUTTON ID_BUTTONReset
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTON_STEREOCONFIG
|
||||
SEPARATOR
|
||||
BUTTON ID_BUTTONHlrOff
|
||||
BUTTON ID_BUTTONHlrOn
|
||||
END
|
||||
@@ -486,6 +507,14 @@ BEGIN
|
||||
HORZGUIDE, 336
|
||||
END
|
||||
|
||||
IDD_DIALOG_STEREO, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 159
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 170
|
||||
END
|
||||
|
||||
IDD_ParamsFacesPage, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
@@ -657,6 +686,12 @@ BEGIN
|
||||
ID_LOCALCONTEXT_ADDDIMENSION "Add new dimension for selected objetcs"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
ID_BUTTON_STEREOSETTINGS "Configure stereo properties"
|
||||
ID_BUTTON_STEREO "Toggle stereographic mode on / off"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@@ -292,6 +292,22 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\Common\OCC_StereoConfigDlg.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\Common\LengthParamsEdgePage.cpp" />
|
||||
<ClCompile Include="..\..\..\..\Common\LengthParamsEdgesPage.cpp" />
|
||||
<ClCompile Include="..\..\..\..\Common\LengthParamsVerticesPage.cpp" />
|
||||
@@ -739,6 +755,7 @@
|
||||
<ClInclude Include="..\..\..\..\Common\OCC_BaseDoc.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\OCC_BaseView.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\OCC_MainFrame.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\OCC_StereoConfigDlg.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\RadiusParamsPage.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\ParamsFacesPage.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\res\OCC_Resource.h" />
|
||||
|
@@ -120,6 +120,9 @@
|
||||
<ClCompile Include="..\..\..\..\Common\ISession2D\ISession2D_Shape.cpp">
|
||||
<Filter>Source Files\ISession2D-src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\Common\OCC_StereoConfigDlg.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\Common\DimensionDlg.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -232,6 +235,9 @@
|
||||
<ClInclude Include="..\..\..\..\Common\ISession2D\ISession2D_Shape.h">
|
||||
<Filter>Header Files\ISession2D-headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\Common\OCC_StereoConfigDlg.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\Common\DimensionDlg.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
@@ -525,6 +525,22 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\Common\OCC_StereoConfigDlg.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EnableFastChecks</BasicRuntimeChecks>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\Common\ImportExport\SaveCSFDBDlg.cpp">
|
||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
@@ -747,6 +763,7 @@
|
||||
<ClInclude Include="..\..\..\..\Common\ParamsFacesPage.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\res\OCC_Resource.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\ResultDialog.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\OCC_StereoConfigDlg.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\ImportExport\SaveCSFDBDlg.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\ImportExport\SaveSTEPDlg.h" />
|
||||
<ClInclude Include="..\..\..\..\Common\StdAfx.h" />
|
||||
|
@@ -84,6 +84,9 @@
|
||||
<ClCompile Include="..\..\..\..\Common\ResultDialog.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\Common\OCC_StereoConfigDlg.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\Common\ImportExport\SaveCSFDBDlg.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -196,6 +199,9 @@
|
||||
<ClInclude Include="..\..\..\..\Common\ResultDialog.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\Common\OCC_StereoConfigDlg.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\Common\ImportExport\SaveCSFDBDlg.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
@@ -1168,6 +1168,10 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\Common\OCC_StereoConfigDlg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\Common\RadiusParamsPage.cpp"
|
||||
>
|
||||
@@ -1839,6 +1843,10 @@
|
||||
RelativePath="..\..\..\..\Common\res\OCC_Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\Common\OCC_StereoConfigDlg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\Common\RadiusParamsPage.h"
|
||||
>
|
||||
|
@@ -1169,6 +1169,10 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\Common\OCC_StereoConfigDlg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\Common\RadiusParamsPage.cpp"
|
||||
>
|
||||
@@ -1840,6 +1844,10 @@
|
||||
RelativePath="..\..\..\..\Common\res\OCC_Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\Common\OCC_StereoConfigDlg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\..\Common\RadiusParamsPage.h"
|
||||
>
|
||||
|
BIN
samples/qt/Common/res/raytracing.png
Normal file
After Width: | Height: | Size: 223 B |
@@ -7,7 +7,8 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QMenuBar>
|
||||
#include <QStatusBar>
|
||||
#include <QWorkspace>
|
||||
#include <QMdiArea>
|
||||
#include <QMdiSubWindow>
|
||||
#include <QMessageBox>
|
||||
#include <QApplication>
|
||||
#include <QSignalMapper>
|
||||
@@ -17,8 +18,8 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static ApplicationCommonWindow* stApp;
|
||||
static QWorkspace* stWs;
|
||||
static ApplicationCommonWindow* stApp = 0;
|
||||
static QMdiArea* stWs = 0;
|
||||
|
||||
ApplicationCommonWindow::ApplicationCommonWindow()
|
||||
: QMainWindow( 0 ),
|
||||
@@ -38,7 +39,7 @@ myStdToolBar( 0 )
|
||||
layout->setMargin( 0 );
|
||||
|
||||
vb->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
|
||||
stWs = new QWorkspace( vb );
|
||||
stWs = new QMdiArea( vb );
|
||||
layout->addWidget( stWs );
|
||||
setCentralWidget( vb );
|
||||
|
||||
@@ -122,7 +123,7 @@ void ApplicationCommonWindow::createStandardOperations()
|
||||
QMenu* aPrefMenu = new QMenu( QObject::tr("MNU_PREFERENCES") );
|
||||
aPrefMenu->addAction( filePrefUseVBOAction );
|
||||
|
||||
// popuplate a menu with all actions
|
||||
// populate a menu with all actions
|
||||
myFilePopup = new QMenu( this );
|
||||
myFilePopup = menuBar()->addMenu( QObject::tr("MNU_FILE") );
|
||||
myFilePopup->addAction( fileNewAction );
|
||||
@@ -198,43 +199,9 @@ void ApplicationCommonWindow::createCasCadeOperations()
|
||||
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_DEL") ), QObject::tr("MNU_TOOL_DEL"), this );
|
||||
a->setToolTip( QObject::tr("TBR_TOOL_DEL") );
|
||||
a->setStatusTip( QObject::tr("TBR_TOOL_DEL") );
|
||||
connect( a, SIGNAL( activated() ) , this, SLOT( onToolAction() ) );
|
||||
connect( a, SIGNAL( triggered() ) , this, SLOT( onToolAction() ) );
|
||||
myToolActions.insert( ToolDeleteId, a );
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
// populate a tool bar with some actions
|
||||
myRaytraceBar = addToolBar( tr( "Ray-trace options" ) );
|
||||
|
||||
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_SHADOWS") ), QObject::tr("MNU_TOOL_SHADOWS"), this );
|
||||
a->setToolTip( QObject::tr("TBR_TOOL_SHADOWS") );
|
||||
a->setStatusTip( QObject::tr("TBR_TOOL_SHADOWS") );
|
||||
a->setCheckable( true );
|
||||
a->setChecked( true );
|
||||
connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
|
||||
myRaytraceActions.insert( ToolShadowsId, a );
|
||||
myRaytraceBar->addAction( a );
|
||||
|
||||
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_REFLECTIONS") ), QObject::tr("MNU_TOOL_REFLECTIONS"), this );
|
||||
a->setToolTip( QObject::tr("TBR_TOOL_REFLECTIONS") );
|
||||
a->setStatusTip( QObject::tr("TBR_TOOL_REFLECTIONS") );
|
||||
a->setCheckable( true );
|
||||
a->setChecked( true );
|
||||
connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
|
||||
myRaytraceActions.insert( ToolReflectionsId, a );
|
||||
myRaytraceBar->addAction( a );
|
||||
|
||||
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_ANTIALIASING") ), QObject::tr("MNU_TOOL_ANTIALIASING"), this );
|
||||
a->setToolTip( QObject::tr("TBR_TOOL_ANTIALIASING") );
|
||||
a->setStatusTip( QObject::tr("TBR_TOOL_ANTIALIASING") );
|
||||
a->setCheckable( true );
|
||||
a->setChecked( false );
|
||||
connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
|
||||
myRaytraceActions.insert( ToolAntialiasingId, a );
|
||||
myRaytraceBar->addAction( a );
|
||||
|
||||
#endif
|
||||
|
||||
QSignalMapper* sm = new QSignalMapper( this );
|
||||
connect( sm, SIGNAL( mapped( int ) ), this, SLOT( onSetMaterial( int ) ) );
|
||||
|
||||
@@ -326,22 +293,12 @@ void ApplicationCommonWindow::windowsMenuAboutToShow()
|
||||
|
||||
QString dir = getResourceDir() + QString( "/" );
|
||||
|
||||
a = new QAction( QPixmap( dir + QObject::tr( "ICON_WINDOW_NEW3D" ) ), QObject::tr( "MNU_WINDOW_NEW3D_GL" ), this );
|
||||
a->setToolTip( QObject::tr( "TBR_WINDOW_NEW3D_GL" ) );
|
||||
a->setStatusTip( QObject::tr( "TBR_WINDOW_NEW3D_GL" ) );
|
||||
a = new QAction( QPixmap( dir + QObject::tr( "ICON_WINDOW_NEW3D" ) ), QObject::tr( "MNU_WINDOW_NEW3D" ), this );
|
||||
a->setToolTip( QObject::tr( "TBR_WINDOW_NEW3D" ) );
|
||||
a->setStatusTip( QObject::tr( "TBR_WINDOW_NEW3D" ) );
|
||||
connect( a, SIGNAL( triggered() ), this, SLOT( onCreateNewView() ) );
|
||||
myWindowPopup->addAction( a );
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
a = new QAction( QPixmap( dir + QObject::tr( "ICON_WINDOW_NEW3D" ) ), QObject::tr( "MNU_WINDOW_NEW3D_RT" ), this );
|
||||
a->setToolTip( QObject::tr( "TBR_WINDOW_NEW3D_RT" ) );
|
||||
a->setStatusTip( QObject::tr( "TBR_WINDOW_NEW3D_RT" ) );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( onCreateNewViewRT() ) );
|
||||
myWindowPopup->addAction( a );
|
||||
|
||||
#endif
|
||||
|
||||
a = new QAction( QPixmap( dir + QObject::tr( "ICON_WINDOW_CASCADE" ) ), QObject::tr( "MNU_WINDOW_CASCADE" ), this );
|
||||
a->setToolTip( QObject::tr( "TBR_WINDOW_CASCADE" ) );
|
||||
a->setStatusTip( QObject::tr( "TBR_WINDOW_CASCADE" ) );
|
||||
@@ -355,16 +312,15 @@ void ApplicationCommonWindow::windowsMenuAboutToShow()
|
||||
myWindowPopup->addAction( a );
|
||||
|
||||
myWindowPopup->addSeparator();
|
||||
QWidgetList windows = stWs->windowList();
|
||||
for ( uint i = 0; i < windows.count(); ++i )
|
||||
QList<QMdiSubWindow *> windows = stWs->subWindowList();
|
||||
for (int i = 0; i < windows.count(); ++i)
|
||||
{
|
||||
|
||||
QAction* aAction = new QAction( windows.at(i)->windowTitle(), this );
|
||||
QAction* aAction = new QAction( windows.at(i)->windowTitle(), this );
|
||||
aAction->setCheckable( true );
|
||||
aAction->setData( i );
|
||||
myWindowPopup->addAction( aAction );
|
||||
connect( aAction, SIGNAL( toggled( bool ) ), this, SLOT( windowsMenuActivated( bool ) ) );
|
||||
aAction->setChecked( stWs->activeWindow() == windows.at(i) );
|
||||
aAction->setChecked( stWs->activeSubWindow() == windows.at(i) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,12 +329,12 @@ void ApplicationCommonWindow::windowsMenuActivated( bool checked )
|
||||
QAction* aSender = qobject_cast<QAction*>( sender() );
|
||||
if ( !aSender )
|
||||
return;
|
||||
QWidget* w = stWs->windowList().at( aSender->data().toInt() );
|
||||
QWidget * w = stWs->subWindowList().at( aSender->data().toInt() );
|
||||
if ( w && checked )
|
||||
w->setFocus();
|
||||
}
|
||||
|
||||
QWorkspace * ApplicationCommonWindow::getWorkspace()
|
||||
QMdiArea * ApplicationCommonWindow::getWorkspace()
|
||||
{
|
||||
return stWs;
|
||||
}
|
||||
@@ -390,7 +346,7 @@ ApplicationCommonWindow* ApplicationCommonWindow::getApplication()
|
||||
|
||||
void ApplicationCommonWindow::updateFileActions()
|
||||
{
|
||||
if ( stWs->windowList().isEmpty() )
|
||||
if ( myDocuments.isEmpty() )
|
||||
{
|
||||
if ( !myIsDocuments )
|
||||
{
|
||||
@@ -447,67 +403,49 @@ int& ApplicationCommonWindow::getNbDocument()
|
||||
|
||||
DocumentCommon* ApplicationCommonWindow::onNewDoc()
|
||||
{
|
||||
updateFileActions();
|
||||
DocumentCommon* aDoc = createNewDocument();
|
||||
aDoc->onCreateNewView();
|
||||
onSelectionChanged();
|
||||
connect( aDoc, SIGNAL( sendCloseDocument( DocumentCommon* ) ),
|
||||
this, SLOT( onCloseDocument( DocumentCommon* ) ) );
|
||||
connect( stWs, SIGNAL( windowActivated( QWidget* ) ),
|
||||
this, SLOT( onWindowActivated( QWidget* ) ) );
|
||||
connect( aDoc, SIGNAL( selectionChanged() ),
|
||||
this, SLOT( onSelectionChanged() ) );
|
||||
myDocuments.append( aDoc );
|
||||
myStdActions.at( FileCloseId )->setEnabled( myDocuments.count() > 0 );
|
||||
return aDoc;
|
||||
}
|
||||
|
||||
DocumentCommon* ApplicationCommonWindow::onNewDocRT()
|
||||
{
|
||||
updateFileActions();
|
||||
DocumentCommon* aDoc = createNewDocument();
|
||||
aDoc->onCreateNewView(true);
|
||||
onSelectionChanged();
|
||||
connect( aDoc, SIGNAL( sendCloseDocument( DocumentCommon* ) ),
|
||||
this, SLOT( onCloseDocument( DocumentCommon* ) ) );
|
||||
connect( stWs, SIGNAL( windowActivated( QWidget* ) ),
|
||||
this, SLOT( onWindowActivated( QWidget* ) ) );
|
||||
connect( aDoc, SIGNAL( selectionChanged() ),
|
||||
this, SLOT( onSelectionChanged() ) );
|
||||
myDocuments.append( aDoc );
|
||||
myStdActions.at( FileCloseId )->setEnabled( myDocuments.count() > 0 );
|
||||
return aDoc;
|
||||
updateFileActions();
|
||||
|
||||
DocumentCommon* aDoc = createNewDocument();
|
||||
aDoc->onCreateNewView();
|
||||
onSelectionChanged();
|
||||
|
||||
connect (aDoc, SIGNAL (sendCloseDocument (DocumentCommon*) ),
|
||||
this, SLOT (onCloseDocument (DocumentCommon*)));
|
||||
connect (stWs, SIGNAL (windowActivated (QWidget*)),
|
||||
this, SLOT (onWindowActivated (QWidget*)));
|
||||
connect (aDoc, SIGNAL (selectionChanged()),
|
||||
this, SLOT (onSelectionChanged()));
|
||||
|
||||
myDocuments.append (aDoc);
|
||||
myStdActions.at (FileCloseId)->setEnabled (myDocuments.count() > 0);
|
||||
|
||||
return aDoc;
|
||||
}
|
||||
|
||||
void ApplicationCommonWindow::onCloseWindow()
|
||||
{
|
||||
MDIWindow* m = (MDIWindow*)stWs->activeWindow();
|
||||
if ( m )
|
||||
{
|
||||
DocumentCommon* doc = m->getDocument();
|
||||
onCloseDocument( doc );
|
||||
}
|
||||
stWs->activeSubWindow()->close();
|
||||
}
|
||||
|
||||
void ApplicationCommonWindow::onUseVBO()
|
||||
{
|
||||
MDIWindow* w = ( MDIWindow* ) stWs->activeWindow();
|
||||
MDIWindow* aWindow = qobject_cast<MDIWindow*> (stWs->activeSubWindow()->widget());
|
||||
|
||||
if ( NULL == w )
|
||||
return;
|
||||
if (NULL == aWindow)
|
||||
return;
|
||||
|
||||
Handle(AIS_InteractiveContext) aContextAIS = w->getDocument()->getContext();
|
||||
Handle(AIS_InteractiveContext) aContextAIS = aWindow->getDocument()->getContext();
|
||||
|
||||
if (aContextAIS.IsNull())
|
||||
return;
|
||||
if (aContextAIS.IsNull())
|
||||
return;
|
||||
|
||||
Handle(OpenGl_GraphicDriver) aDriver =
|
||||
Handle(OpenGl_GraphicDriver)::DownCast (aContextAIS->CurrentViewer()->Driver());
|
||||
Handle(OpenGl_GraphicDriver) aDriver =
|
||||
Handle(OpenGl_GraphicDriver)::DownCast (aContextAIS->CurrentViewer()->Driver());
|
||||
|
||||
if (!aDriver.IsNull())
|
||||
{
|
||||
aDriver->ChangeOptions().vboDisable = Standard_True;
|
||||
}
|
||||
if (!aDriver.IsNull())
|
||||
{
|
||||
aDriver->ChangeOptions().vboDisable = Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
void ApplicationCommonWindow::onCloseDocument(DocumentCommon* theDoc)
|
||||
@@ -549,20 +487,10 @@ void ApplicationCommonWindow::onAbout()
|
||||
|
||||
void ApplicationCommonWindow::onCreateNewView()
|
||||
{
|
||||
MDIWindow* window = qobject_cast< MDIWindow* >( stWs->activeWindow() );
|
||||
window->getDocument()->onCreateNewView( false );
|
||||
MDIWindow* window = qobject_cast< MDIWindow* >( stWs->activeSubWindow()->widget() );
|
||||
window->getDocument()->onCreateNewView();
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
void ApplicationCommonWindow::onCreateNewViewRT()
|
||||
{
|
||||
MDIWindow* window = qobject_cast< MDIWindow* >( stWs->activeWindow() );
|
||||
window->getDocument()->onCreateNewView( true );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void ApplicationCommonWindow::onWindowActivated ( QWidget * w )
|
||||
{
|
||||
if (w == NULL)
|
||||
@@ -573,21 +501,13 @@ void ApplicationCommonWindow::onWindowActivated ( QWidget * w )
|
||||
MDIWindow* window = qobject_cast< MDIWindow* >(w);
|
||||
|
||||
window->onWindowActivated();
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
myRaytraceActions.at( ToolShadowsId )->setChecked (window->ShadowsEnabled());
|
||||
myRaytraceActions.at( ToolReflectionsId )->setChecked (window->ReflectionsEnabled());
|
||||
myRaytraceActions.at( ToolAntialiasingId )->setChecked (window->AntialiasingEnabled());
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void ApplicationCommonWindow::onToolAction()
|
||||
{
|
||||
QAction* sentBy = (QAction*) sender();
|
||||
QWorkspace* ws = ApplicationCommonWindow::getWorkspace();
|
||||
DocumentCommon* doc = ((MDIWindow*)ws->activeWindow())->getDocument();
|
||||
QMdiArea* ws = ApplicationCommonWindow::getWorkspace();
|
||||
DocumentCommon* doc = qobject_cast<MDIWindow*>( ws->activeSubWindow()->widget() )->getDocument();
|
||||
|
||||
if( sentBy == myToolActions.at( ToolWireframeId ) )
|
||||
doc->onWireframe();
|
||||
@@ -608,87 +528,60 @@ void ApplicationCommonWindow::onToolAction()
|
||||
doc->onDelete();
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
void ApplicationCommonWindow::onRaytraceAction()
|
||||
{
|
||||
QAction* sentBy = (QAction*) sender();
|
||||
|
||||
DocumentCommon* doc = qobject_cast< MDIWindow* >(
|
||||
ApplicationCommonWindow::getWorkspace()->activeWindow())->getDocument();
|
||||
|
||||
if( sentBy == myRaytraceActions.at( ToolShadowsId ) )
|
||||
{
|
||||
bool flag = myRaytraceActions.at( ToolShadowsId )->isChecked();
|
||||
doc->onShadows( flag );
|
||||
}
|
||||
|
||||
if( sentBy == myRaytraceActions.at( ToolReflectionsId ) )
|
||||
{
|
||||
bool flag = myRaytraceActions.at( ToolReflectionsId )->isChecked();
|
||||
doc->onReflections( flag );
|
||||
}
|
||||
|
||||
if( sentBy == myRaytraceActions.at( ToolAntialiasingId ) )
|
||||
{
|
||||
bool flag = myRaytraceActions.at( ToolAntialiasingId )->isChecked();
|
||||
doc->onAntialiasing( flag );
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void ApplicationCommonWindow::onSelectionChanged()
|
||||
{
|
||||
QWorkspace* ws = ApplicationCommonWindow::getWorkspace();
|
||||
QMdiArea* ws = ApplicationCommonWindow::getWorkspace();
|
||||
DocumentCommon* doc;
|
||||
|
||||
if( !qobject_cast<MDIWindow*>( ws->activeWindow() ) )
|
||||
if( !qobject_cast<MDIWindow*>( ws->activeSubWindow()->widget() ) )
|
||||
return;
|
||||
doc = ((MDIWindow*)ws->activeWindow())->getDocument();
|
||||
Handle(AIS_InteractiveContext) context = doc->getContext();
|
||||
|
||||
doc = ( qobject_cast<MDIWindow*>( ws->activeSubWindow()->widget() ) )->getDocument();
|
||||
Handle(AIS_InteractiveContext) context = doc->getContext();
|
||||
|
||||
bool OneOrMoreInShading = false;
|
||||
bool OneOrMoreInWireframe = false;
|
||||
int numSel = context->NbSelected();
|
||||
if ( numSel )
|
||||
bool OneOrMoreInShading = false;
|
||||
bool OneOrMoreInWireframe = false;
|
||||
int numSel = context->NbSelected();
|
||||
if ( numSel )
|
||||
{
|
||||
for ( context->InitCurrent(); context->MoreCurrent(); context->NextCurrent() )
|
||||
{
|
||||
for ( context->InitCurrent(); context->MoreCurrent(); context->NextCurrent() )
|
||||
{
|
||||
if ( context->IsDisplayed( context->Current(), 1 ) )
|
||||
OneOrMoreInShading = true;
|
||||
if ( context->IsDisplayed( context->Current(), 0 ) )
|
||||
OneOrMoreInWireframe = true;
|
||||
}
|
||||
myToolActions.at( ToolWireframeId )->setEnabled( OneOrMoreInShading );
|
||||
myToolActions.at( ToolShadingId )->setEnabled( OneOrMoreInWireframe );
|
||||
myToolActions.at( ToolColorId )->setEnabled( true );
|
||||
myToolActions.at( ToolMaterialId )->setEnabled( true );
|
||||
myToolActions.at( ToolTransparencyId )->setEnabled( OneOrMoreInShading );
|
||||
myToolActions.at( ToolDeleteId )->setEnabled( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
myToolActions.at( ToolWireframeId )->setEnabled( false );
|
||||
myToolActions.at( ToolShadingId )->setEnabled( false );
|
||||
myToolActions.at( ToolColorId )->setEnabled( false );
|
||||
myToolActions.at( ToolMaterialId )->setEnabled( false );
|
||||
myToolActions.at( ToolTransparencyId )->setEnabled( false );
|
||||
myToolActions.at( ToolDeleteId )->setEnabled( false );
|
||||
if ( context->IsDisplayed( context->Current(), 1 ) )
|
||||
OneOrMoreInShading = true;
|
||||
if ( context->IsDisplayed( context->Current(), 0 ) )
|
||||
OneOrMoreInWireframe = true;
|
||||
}
|
||||
myToolActions.at( ToolWireframeId )->setEnabled( OneOrMoreInShading );
|
||||
myToolActions.at( ToolShadingId )->setEnabled( OneOrMoreInWireframe );
|
||||
myToolActions.at( ToolColorId )->setEnabled( true );
|
||||
myToolActions.at( ToolMaterialId )->setEnabled( true );
|
||||
myToolActions.at( ToolTransparencyId )->setEnabled( OneOrMoreInShading );
|
||||
myToolActions.at( ToolDeleteId )->setEnabled( true );
|
||||
}
|
||||
else
|
||||
{
|
||||
myToolActions.at( ToolWireframeId )->setEnabled( false );
|
||||
myToolActions.at( ToolShadingId )->setEnabled( false );
|
||||
myToolActions.at( ToolColorId )->setEnabled( false );
|
||||
myToolActions.at( ToolMaterialId )->setEnabled( false );
|
||||
myToolActions.at( ToolTransparencyId )->setEnabled( false );
|
||||
myToolActions.at( ToolDeleteId )->setEnabled( false );
|
||||
}
|
||||
}
|
||||
|
||||
void ApplicationCommonWindow::onSetMaterial( int theMaterial )
|
||||
{
|
||||
QWorkspace* ws = getWorkspace();
|
||||
DocumentCommon* doc = ((MDIWindow*)ws->activeWindow())->getDocument();
|
||||
QMdiArea* ws = getWorkspace();
|
||||
DocumentCommon* doc = qobject_cast<MDIWindow*>( ws->activeSubWindow()->widget() )->getDocument();
|
||||
doc->onMaterial( theMaterial );
|
||||
}
|
||||
|
||||
QString ApplicationCommonWindow::getResourceDir()
|
||||
{
|
||||
static QString resDir( ::getenv( "CSF_ResourcesDefaults" ) );
|
||||
return resDir;
|
||||
static QString aResourceDir =
|
||||
QString::fromUtf8 (qgetenv ("CSF_ResourcesDefaults").constData());
|
||||
|
||||
return aResourceDir;
|
||||
}
|
||||
|
||||
void ApplicationCommonWindow::resizeEvent( QResizeEvent* e )
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#include <QAction>
|
||||
#include <QToolBar>
|
||||
#include <QMenu>
|
||||
#include <QWorkspace>
|
||||
#include <QMdiArea>
|
||||
#include <QList>
|
||||
|
||||
|
||||
@@ -18,12 +18,11 @@ class COMMONSAMPLE_EXPORT ApplicationCommonWindow: public QMainWindow
|
||||
public:
|
||||
enum { FileNewId, FilePrefUseVBOId, FileCloseId, FilePreferencesId, FileQuitId, ViewToolId, ViewStatusId, HelpAboutId };
|
||||
enum { ToolWireframeId, ToolShadingId, ToolColorId, ToolMaterialId, ToolTransparencyId, ToolDeleteId };
|
||||
enum { ToolShadowsId, ToolReflectionsId, ToolAntialiasingId };
|
||||
|
||||
ApplicationCommonWindow();
|
||||
~ApplicationCommonWindow();
|
||||
|
||||
static QWorkspace* getWorkspace();
|
||||
static QMdiArea* getWorkspace();
|
||||
static ApplicationCommonWindow* getApplication();
|
||||
static QString getResourceDir();
|
||||
|
||||
@@ -38,7 +37,6 @@ protected:
|
||||
public slots:
|
||||
|
||||
DocumentCommon* onNewDoc();
|
||||
DocumentCommon* onNewDocRT();
|
||||
void onCloseWindow();
|
||||
void onUseVBO();
|
||||
virtual void onCloseDocument( DocumentCommon* theDoc );
|
||||
@@ -47,13 +45,7 @@ public slots:
|
||||
void onViewToolBar();
|
||||
void onViewStatusBar();
|
||||
void onToolAction();
|
||||
#ifdef HAVE_OPENCL
|
||||
void onRaytraceAction();
|
||||
#endif
|
||||
void onCreateNewView();
|
||||
#ifdef HAVE_OPENCL
|
||||
void onCreateNewViewRT();
|
||||
#endif
|
||||
void onWindowActivated ( QWidget * w );
|
||||
void windowsMenuAboutToShow();
|
||||
void windowsMenuActivated( bool checked/*int id*/ );
|
||||
@@ -77,16 +69,17 @@ private:
|
||||
|
||||
QList<QAction*> myStdActions;
|
||||
QList<QAction*> myToolActions;
|
||||
QList<QAction*> myRaytraceActions;
|
||||
QList<QAction*> myMaterialActions;
|
||||
QList<DocumentCommon*> myDocuments;
|
||||
//QList<DocumentCommon*> myDocuments;
|
||||
|
||||
QToolBar* myStdToolBar;
|
||||
QToolBar* myCasCadeBar;
|
||||
QToolBar* myRaytraceBar;
|
||||
QMenu* myFilePopup;
|
||||
QMenu* myWindowPopup;
|
||||
QAction* myFileSeparator;
|
||||
|
||||
protected:
|
||||
QList<DocumentCommon*> myDocuments;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -86,14 +86,6 @@
|
||||
<source>ICON_NEW</source>
|
||||
<translation>new.png</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>ICON_NEW_GL</source>
|
||||
<translation>newGL.png</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>ICON_NEW_RT</source>
|
||||
<translation>newRT.png</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>ICON_VIEW_RIGHT</source>
|
||||
<translation>view_right.png</translation>
|
||||
@@ -134,10 +126,18 @@
|
||||
<source>ICON_SAMPLE</source>
|
||||
<translation>lamp.png</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>ICON_TOOL_RAYTRACING</source>
|
||||
<translation>raytracing.png</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>ICON_TOOL_SHADOWS</source>
|
||||
<translation>shadows.png</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>ICON_TOOL_RAYTRACING</source>
|
||||
<translation>shadows.png</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>ICON_TOOL_REFLECTIONS</source>
|
||||
<translation>reflections.png</translation>
|
||||
|
@@ -142,13 +142,17 @@
|
||||
<source>MNU_TOOL_SHADOWS</source>
|
||||
<translation>&Shadows</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MNU_TOOL_RAYTRACING</source>
|
||||
<translation>&Ray-tracing</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MNU_TOOL_REFLECTIONS</source>
|
||||
<translation>&Reflections</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MNU_TOOL_ANTIALIASING</source>
|
||||
<translation>&Antialiasing</translation>
|
||||
<translation>&Anti-aliasing</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>BTN_BRASS</source>
|
||||
@@ -270,6 +274,22 @@
|
||||
<source>TBR_TOOL_MATER</source>
|
||||
<translation>Material</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TBR_TOOL_RAYTRACING</source>
|
||||
<translation>Enable Ray-tracing</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TBR_TOOL_SHADOWS</source>
|
||||
<translation>Enable Shadows</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TBR_TOOL_REFLECTIONS</source>
|
||||
<translation>Enable Reflections</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TBR_TOOL_ANTIALIASING</source>
|
||||
<translation>Enable Anti-aliasing</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TBR_TOOL_BAR</source>
|
||||
<translation>Toolbar</translation>
|
||||
@@ -343,20 +363,8 @@
|
||||
<translation>New 3D View</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TBR_WINDOW_NEW3D_GL</source>
|
||||
<translation>New GL 3D View</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MNU_WINDOW_NEW3D_GL</source>
|
||||
<translation>New GL 3D View</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TBR_WINDOW_NEW3D_RT</source>
|
||||
<translation>&New RT 3D View</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MNU_WINDOW_NEW3D_RT</source>
|
||||
<translation>&New RT 3D View</translation>
|
||||
<source>MNU_WINDOW_NEW3D</source>
|
||||
<translation>New 3D View</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MNU_STATUS_BAR</source>
|
||||
|
@@ -16,13 +16,16 @@
|
||||
#include <OpenGl_GraphicDriver.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Handle(V3d_Viewer) DocumentCommon::Viewer( const Standard_CString aDisplay,
|
||||
const Standard_ExtString aName,
|
||||
const Standard_CString aDomain,
|
||||
const Standard_Real ViewSize,
|
||||
const V3d_TypeOfOrientation ViewProj,
|
||||
const Standard_Boolean ComputedMode,
|
||||
const Standard_Boolean aDefaultComputedMode )
|
||||
// =======================================================================
|
||||
// function : Viewer
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
Handle(V3d_Viewer) DocumentCommon::Viewer (const Standard_ExtString theName,
|
||||
const Standard_CString theDomain,
|
||||
const Standard_Real theViewSize,
|
||||
const V3d_TypeOfOrientation theViewProj,
|
||||
const Standard_Boolean theComputedMode,
|
||||
const Standard_Boolean theDefaultComputedMode )
|
||||
{
|
||||
static Handle(OpenGl_GraphicDriver) aGraphicDriver;
|
||||
|
||||
@@ -30,14 +33,23 @@ Handle(V3d_Viewer) DocumentCommon::Viewer( const Standard_CString aDisplay,
|
||||
{
|
||||
Handle(Aspect_DisplayConnection) aDisplayConnection;
|
||||
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
aDisplayConnection = new Aspect_DisplayConnection (aDisplay);
|
||||
aDisplayConnection = new Aspect_DisplayConnection (qgetenv ("DISPLAY").constData());
|
||||
#endif
|
||||
aGraphicDriver = new OpenGl_GraphicDriver (aDisplayConnection);
|
||||
}
|
||||
|
||||
return new V3d_Viewer(aGraphicDriver,aName,aDomain,ViewSize,ViewProj,
|
||||
Quantity_NOC_GRAY30,V3d_ZBUFFER,V3d_GOURAUD,V3d_WAIT,
|
||||
ComputedMode,aDefaultComputedMode,V3d_TEX_NONE);
|
||||
return new V3d_Viewer (aGraphicDriver,
|
||||
theName,
|
||||
theDomain,
|
||||
theViewSize,
|
||||
theViewProj,
|
||||
Quantity_NOC_GRAY30,
|
||||
V3d_ZBUFFER,
|
||||
V3d_GOURAUD,
|
||||
V3d_WAIT,
|
||||
theComputedMode,
|
||||
theDefaultComputedMode,
|
||||
V3d_TEX_NONE);
|
||||
}
|
||||
|
||||
DocumentCommon::DocumentCommon( const int theIndex, ApplicationCommonWindow* app )
|
||||
@@ -46,14 +58,14 @@ myApp( app ),
|
||||
myIndex( theIndex ),
|
||||
myNbViews( 0 )
|
||||
{
|
||||
TCollection_ExtendedString a3DName("Visu3D");
|
||||
myViewer = Viewer( getenv("DISPLAY"), a3DName.ToExtString(), "", 1000.0,
|
||||
V3d_XposYnegZpos, Standard_True, Standard_True );
|
||||
TCollection_ExtendedString a3DName ("Visu3D");
|
||||
|
||||
myViewer->SetDefaultLights();
|
||||
myViewer->SetLightOn();
|
||||
myViewer = Viewer (a3DName.ToExtString(), "", 1000.0, V3d_XposYnegZpos, Standard_True, Standard_True);
|
||||
|
||||
myContext =new AIS_InteractiveContext(myViewer);
|
||||
myViewer->SetDefaultLights();
|
||||
myViewer->SetLightOn();
|
||||
|
||||
myContext = new AIS_InteractiveContext (myViewer);
|
||||
}
|
||||
|
||||
DocumentCommon::~DocumentCommon()
|
||||
@@ -65,22 +77,22 @@ ApplicationCommonWindow* DocumentCommon::getApplication()
|
||||
return myApp;
|
||||
}
|
||||
|
||||
MDIWindow* DocumentCommon::createNewMDIWindow( bool theRT )
|
||||
MDIWindow* DocumentCommon::createNewMDIWindow()
|
||||
{
|
||||
QWorkspace* ws = myApp->getWorkspace();
|
||||
return new MDIWindow( this, ws, 0, theRT );
|
||||
QMdiArea* ws = myApp->getWorkspace();
|
||||
return new MDIWindow (this, ws, 0);
|
||||
}
|
||||
|
||||
void DocumentCommon::onCreateNewView( bool theRT )
|
||||
void DocumentCommon::onCreateNewView()
|
||||
{
|
||||
QWorkspace* ws = myApp->getWorkspace();
|
||||
MDIWindow* w = createNewMDIWindow( theRT );
|
||||
QMdiArea* ws = myApp->getWorkspace();
|
||||
MDIWindow* w = createNewMDIWindow();
|
||||
|
||||
if( !w )
|
||||
if (!w)
|
||||
return;
|
||||
|
||||
ws->addWindow( w );
|
||||
myViews.append(w);
|
||||
ws->addSubWindow (w);
|
||||
myViews.append (w);
|
||||
|
||||
connect( w, SIGNAL( selectionChanged() ),
|
||||
this, SIGNAL( selectionChanged() ) );
|
||||
@@ -95,7 +107,7 @@ void DocumentCommon::onCreateNewView( bool theRT )
|
||||
|
||||
w->setWindowIcon( QPixmap( dir + QObject::tr("ICON_DOC") ) );
|
||||
|
||||
if ( ws->windowList().isEmpty() )
|
||||
if ( ws->subWindowList().isEmpty() )
|
||||
{
|
||||
// Due to strange Qt4.2.3 feature the child window icon is not drawn
|
||||
// in the main menu if showMaximized() is called for a non-visible child window
|
||||
@@ -129,7 +141,9 @@ void DocumentCommon::removeView(MDIWindow* theView)
|
||||
void DocumentCommon::removeViews()
|
||||
{
|
||||
while( myViews.count() )
|
||||
removeView( (MDIWindow*)myViews.first() );
|
||||
{
|
||||
removeView( myViews.first() );
|
||||
}
|
||||
}
|
||||
|
||||
int DocumentCommon::countOfWindow()
|
||||
@@ -226,49 +240,3 @@ void DocumentCommon::onDelete()
|
||||
myContext->ClearSelected();
|
||||
getApplication()->onSelectionChanged();
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
void DocumentCommon::onShadows( int state )
|
||||
{
|
||||
QWorkspace* ws = ApplicationCommonWindow::getWorkspace();
|
||||
|
||||
MDIWindow* window = qobject_cast< MDIWindow* >( ws->activeWindow() );
|
||||
|
||||
if( window == NULL )
|
||||
return;
|
||||
|
||||
window->setRaytracedShadows( state );
|
||||
|
||||
myContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
void DocumentCommon::onReflections( int state )
|
||||
{
|
||||
QWorkspace* ws = ApplicationCommonWindow::getWorkspace();
|
||||
|
||||
MDIWindow* window = qobject_cast< MDIWindow* >( ws->activeWindow() );
|
||||
|
||||
if( window == NULL )
|
||||
return;
|
||||
|
||||
window->setRaytracedReflections( state );
|
||||
|
||||
myContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
void DocumentCommon::onAntialiasing( int state )
|
||||
{
|
||||
QWorkspace* ws = ApplicationCommonWindow::getWorkspace();
|
||||
|
||||
MDIWindow* window = qobject_cast< MDIWindow* >( ws->activeWindow() );
|
||||
|
||||
if( window == NULL )
|
||||
return;
|
||||
|
||||
window->setRaytracedAntialiasing( state );
|
||||
|
||||
myContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -28,7 +28,7 @@ public:
|
||||
void fitAll();
|
||||
|
||||
protected:
|
||||
virtual MDIWindow* createNewMDIWindow( bool theRT = false );
|
||||
virtual MDIWindow* createNewMDIWindow();
|
||||
|
||||
signals:
|
||||
void selectionChanged();
|
||||
@@ -36,17 +36,11 @@ signals:
|
||||
|
||||
public slots:
|
||||
virtual void onCloseView( MDIWindow* );
|
||||
virtual void onCreateNewView( bool theRT = false );
|
||||
virtual void onCreateNewView();
|
||||
virtual void onMaterial();
|
||||
virtual void onMaterial( int );
|
||||
virtual void onDelete();
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
virtual void onShadows( int state );
|
||||
virtual void onReflections( int state );
|
||||
virtual void onAntialiasing( int state );
|
||||
#endif
|
||||
|
||||
void onWireframe();
|
||||
void onShading();
|
||||
void onColor();
|
||||
@@ -54,13 +48,12 @@ public slots:
|
||||
void onTransparency( int );
|
||||
|
||||
private:
|
||||
Handle(V3d_Viewer) Viewer( const Standard_CString aDisplay,
|
||||
const Standard_ExtString aName,
|
||||
const Standard_CString aDomain,
|
||||
const Standard_Real ViewSize,
|
||||
const V3d_TypeOfOrientation ViewProj,
|
||||
const Standard_Boolean ComputedMode,
|
||||
const Standard_Boolean aDefaultComputedMode );
|
||||
Handle(V3d_Viewer) Viewer (const Standard_ExtString theName,
|
||||
const Standard_CString theDomain,
|
||||
const Standard_Real theViewSize,
|
||||
const V3d_TypeOfOrientation theViewProj,
|
||||
const Standard_Boolean theComputedMode,
|
||||
const Standard_Boolean theDefaultComputedMode );
|
||||
|
||||
protected:
|
||||
ApplicationCommonWindow* myApp;
|
||||
|
@@ -21,20 +21,11 @@ MDIWindow::MDIWindow(View* aView,
|
||||
Qt::WindowFlags wflags )
|
||||
: QMainWindow( parent, wflags )
|
||||
{
|
||||
|
||||
myView = aView;
|
||||
myDocument = aDocument;
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
myShadowsEnabled = true;
|
||||
myReflectionsEnabled = true;
|
||||
myAntialiasingEnabled = false;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
MDIWindow::MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlags wflags, bool theRT )
|
||||
MDIWindow::MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlags wflags)
|
||||
: QMainWindow( parent, wflags )
|
||||
{
|
||||
QFrame *vb = new QFrame( this );
|
||||
@@ -47,24 +38,18 @@ MDIWindow::MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlag
|
||||
setCentralWidget( vb );
|
||||
|
||||
myDocument = aDocument;
|
||||
myView = new View( myDocument->getContext(), vb, theRT );
|
||||
layout->addWidget( myView );
|
||||
myView = new View (myDocument->getContext(), vb);
|
||||
layout->addWidget (myView);
|
||||
|
||||
connect( myView, SIGNAL( selectionChanged() ),
|
||||
this, SIGNAL( selectionChanged() ) );
|
||||
createViewActions();
|
||||
|
||||
createViewActions();
|
||||
createRaytraceActions();
|
||||
|
||||
resize( sizeHint() );
|
||||
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
myShadowsEnabled = true;
|
||||
myReflectionsEnabled = true;
|
||||
myAntialiasingEnabled = false;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
MDIWindow::~MDIWindow()
|
||||
@@ -98,21 +83,34 @@ void MDIWindow::createViewActions()
|
||||
aList->at(View::ViewHlrOffId)->setChecked( true );
|
||||
}
|
||||
|
||||
void MDIWindow::createRaytraceActions()
|
||||
{
|
||||
// populate a tool bar with some actions
|
||||
QToolBar* aToolBar = addToolBar( tr( "Ray-tracing Options" ) );
|
||||
|
||||
QList<QAction*>* aList = myView->getRaytraceActions();
|
||||
aToolBar->addActions( *aList );
|
||||
|
||||
aToolBar->toggleViewAction()->setVisible (true);
|
||||
aList->at (View::ToolRaytracingId)->setChecked (false);
|
||||
aList->at (View::ToolShadowsId)->setChecked (true);
|
||||
aList->at (View::ToolReflectionsId)->setChecked (true);
|
||||
aList->at (View::ToolAntialiasingId)->setChecked (false);
|
||||
}
|
||||
|
||||
void MDIWindow::onWindowActivated ()
|
||||
{
|
||||
getDocument()->getApplication()->onSelectionChanged();
|
||||
}
|
||||
|
||||
|
||||
void MDIWindow::dump()
|
||||
{
|
||||
|
||||
QString datadir = (QString(getenv("CASROOT")) + "/../data/images");
|
||||
QString datadir = (QString(qgetenv ("CASROOT").constData()) + "/../data/images");
|
||||
static QString filter;
|
||||
filter = "Images Files (*.bmp *.ppm *.png *.jpg *.tiff *.tga *.gif *.exr *.ps *.eps *.tex *.pdf *.svg *.pgf)";
|
||||
QFileDialog fd ( 0 );
|
||||
fd.setModal( true );
|
||||
fd.setFilter( filter );
|
||||
fd.setNameFilter ( filter );
|
||||
fd.setWindowTitle( QObject::tr("INF_APP_EXPORT") );
|
||||
fd.setFileMode( QFileDialog::AnyFile );
|
||||
int ret = fd.exec();
|
||||
@@ -129,6 +127,7 @@ void MDIWindow::dump()
|
||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||
if ( !QFileInfo( file ).completeSuffix().length() )
|
||||
file += QString( ".bmp" );
|
||||
|
||||
bool res = myView->dump( (Standard_CString)file.toLatin1().constData() );
|
||||
QApplication::restoreOverrideCursor();
|
||||
if ( !res )
|
||||
@@ -152,27 +151,3 @@ QSize MDIWindow::sizeHint() const
|
||||
{
|
||||
return QSize( 450, 300 );
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
void MDIWindow::setRaytracedShadows( int state )
|
||||
{
|
||||
myView->setRaytracedShadows( state );
|
||||
myShadowsEnabled = state;
|
||||
}
|
||||
|
||||
void MDIWindow::setRaytracedReflections( int state )
|
||||
{
|
||||
myView->setRaytracedReflections( state );
|
||||
myReflectionsEnabled = state;
|
||||
}
|
||||
|
||||
void MDIWindow::setRaytracedAntialiasing( int state )
|
||||
{
|
||||
myView->setRaytracedAntialiasing( state );
|
||||
myAntialiasingEnabled = state;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@@ -12,7 +12,7 @@ class COMMONSAMPLE_EXPORT MDIWindow: public QMainWindow
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlags wflags, bool theRT = false );
|
||||
MDIWindow( DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlags wflags );
|
||||
MDIWindow( View* aView, DocumentCommon* aDocument, QWidget* parent, Qt::WindowFlags wflags );
|
||||
~MDIWindow();
|
||||
|
||||
@@ -20,18 +20,6 @@ public:
|
||||
void fitAll();
|
||||
virtual QSize sizeHint() const;
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
void setRaytracedShadows( int state );
|
||||
void setRaytracedReflections( int state );
|
||||
void setRaytracedAntialiasing( int state );
|
||||
|
||||
bool ShadowsEnabled() { return myShadowsEnabled; }
|
||||
bool ReflectionsEnabled() { return myReflectionsEnabled; }
|
||||
bool AntialiasingEnabled() { return myAntialiasingEnabled; }
|
||||
|
||||
#endif
|
||||
|
||||
signals:
|
||||
void selectionChanged();
|
||||
void message(const QString&, int );
|
||||
@@ -44,19 +32,11 @@ public slots:
|
||||
|
||||
protected:
|
||||
void createViewActions();
|
||||
void createRaytraceActions();
|
||||
|
||||
protected:
|
||||
DocumentCommon* myDocument;
|
||||
View* myView;
|
||||
|
||||
#ifdef HAVE_OPENCL
|
||||
|
||||
bool myShadowsEnabled;
|
||||
bool myReflectionsEnabled;
|
||||
bool myAntialiasingEnabled;
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
@@ -14,12 +14,13 @@
|
||||
#include <QFileDialog>
|
||||
#include <QMouseEvent>
|
||||
#include <QRubberBand>
|
||||
#include <QMdiSubWindow>
|
||||
#include <QStyleFactory>
|
||||
|
||||
#include <Visual3d_View.hxx>
|
||||
#include <Graphic3d_ExportFormat.hxx>
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
#include <Graphic3d_TextureEnv.hxx>
|
||||
#include <QWindowsStyle>
|
||||
|
||||
#if defined(_WIN32) || defined(__WIN32__)
|
||||
#include <WNT_Window.hxx>
|
||||
@@ -54,10 +55,14 @@ static QCursor* globPanCursor = NULL;
|
||||
static QCursor* zoomCursor = NULL;
|
||||
static QCursor* rotCursor = NULL;
|
||||
|
||||
View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, bool theRT )
|
||||
View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent )
|
||||
: QWidget( parent ),
|
||||
myIsRT( theRT ),
|
||||
myIsRaytracing( false ),
|
||||
myIsShadowsEnabled (true),
|
||||
myIsReflectionsEnabled (true),
|
||||
myIsAntialiasingEnabled (false),
|
||||
myViewActions( 0 ),
|
||||
myRaytraceActions( 0 ),
|
||||
myBackMenu( NULL )
|
||||
{
|
||||
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
@@ -77,7 +82,7 @@ myBackMenu( NULL )
|
||||
myCurZoom = 0;
|
||||
myRectBand = 0;
|
||||
|
||||
setAttribute(Qt::WA_PaintOnScreen);
|
||||
setAttribute(Qt::WA_PaintOnScreen);
|
||||
setAttribute(Qt::WA_NoSystemBackground);
|
||||
|
||||
#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||
@@ -153,7 +158,12 @@ myBackMenu( NULL )
|
||||
myCurrentMode = CurAction3d_Nothing;
|
||||
myHlrModeIsOn = Standard_False;
|
||||
setMouseTracking( true );
|
||||
|
||||
|
||||
if( myFirst )
|
||||
{
|
||||
init();
|
||||
myFirst = false;
|
||||
}
|
||||
initViewActions();
|
||||
initCursors();
|
||||
|
||||
@@ -172,8 +182,9 @@ View::~View()
|
||||
|
||||
void View::init()
|
||||
{
|
||||
if (myView.IsNull())
|
||||
myView = myContext->CurrentViewer()->CreateView();
|
||||
if ( myView.IsNull() )
|
||||
myView = myContext->CurrentViewer()->CreateView();
|
||||
|
||||
#if defined(_WIN32) || defined(__WIN32__)
|
||||
Aspect_Handle aWindowHandle = (Aspect_Handle )winId();
|
||||
Handle(WNT_Window) hWnd = new WNT_Window (aWindowHandle);
|
||||
@@ -185,15 +196,16 @@ void View::init()
|
||||
Handle(Aspect_DisplayConnection) aDispConnection = myContext->CurrentViewer()->Driver()->GetDisplayConnection();
|
||||
Handle(Xw_Window) hWnd = new Xw_Window (aDispConnection, aWindowHandle);
|
||||
#endif // WNT
|
||||
|
||||
myView->SetWindow (hWnd);
|
||||
if (!hWnd->IsMapped())
|
||||
if ( !hWnd->IsMapped() )
|
||||
{
|
||||
hWnd->Map();
|
||||
}
|
||||
myView->SetBackgroundColor (Quantity_NOC_BLACK);
|
||||
myView->MustBeResized();
|
||||
|
||||
if (myIsRT)
|
||||
if (myIsRaytracing)
|
||||
myView->SetRaytracingMode();
|
||||
}
|
||||
|
||||
@@ -310,28 +322,95 @@ void View::hlrOn()
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void View::setRaytracedShadows( int state )
|
||||
void View::SetRaytracedShadows (bool theState)
|
||||
{
|
||||
if ( state )
|
||||
if (theState)
|
||||
myView->EnableRaytracedShadows();
|
||||
else
|
||||
myView->DisableRaytracedShadows();
|
||||
|
||||
myIsShadowsEnabled = theState;
|
||||
|
||||
myContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
void View::setRaytracedReflections( int state )
|
||||
void View::SetRaytracedReflections (bool theState)
|
||||
{
|
||||
if ( state )
|
||||
if (theState)
|
||||
myView->EnableRaytracedReflections();
|
||||
else
|
||||
myView->DisableRaytracedReflections();
|
||||
|
||||
myIsReflectionsEnabled = theState;
|
||||
|
||||
myContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
void View::setRaytracedAntialiasing( int state )
|
||||
void View::onRaytraceAction()
|
||||
{
|
||||
if ( state )
|
||||
QAction* aSentBy = (QAction*)sender();
|
||||
|
||||
if (aSentBy == myRaytraceActions->at (ToolRaytracingId))
|
||||
{
|
||||
bool aState = myRaytraceActions->at (ToolRaytracingId)->isChecked();
|
||||
|
||||
QApplication::setOverrideCursor (Qt::WaitCursor);
|
||||
if (aState)
|
||||
EnableRaytracing();
|
||||
else
|
||||
DisableRaytracing();
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
if (aSentBy == myRaytraceActions->at (ToolShadowsId))
|
||||
{
|
||||
bool aState = myRaytraceActions->at (ToolShadowsId)->isChecked();
|
||||
SetRaytracedShadows (aState);
|
||||
}
|
||||
|
||||
if (aSentBy == myRaytraceActions->at (ToolReflectionsId))
|
||||
{
|
||||
bool aState = myRaytraceActions->at (ToolReflectionsId)->isChecked();
|
||||
SetRaytracedReflections (aState);
|
||||
}
|
||||
|
||||
if (aSentBy == myRaytraceActions->at (ToolAntialiasingId))
|
||||
{
|
||||
bool aState = myRaytraceActions->at (ToolAntialiasingId)->isChecked();
|
||||
SetRaytracedAntialiasing (aState);
|
||||
}
|
||||
}
|
||||
|
||||
void View::SetRaytracedAntialiasing (bool theState)
|
||||
{
|
||||
if (theState)
|
||||
myView->EnableRaytracedAntialiasing();
|
||||
else
|
||||
myView->DisableRaytracedAntialiasing();
|
||||
|
||||
myIsAntialiasingEnabled = theState;
|
||||
|
||||
myContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
void View::EnableRaytracing()
|
||||
{
|
||||
if (!myIsRaytracing)
|
||||
myView->SetRaytracingMode();
|
||||
|
||||
myIsRaytracing = true;
|
||||
|
||||
myContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
void View::DisableRaytracing()
|
||||
{
|
||||
if (myIsRaytracing)
|
||||
myView->SetRasterizationMode();
|
||||
|
||||
myIsRaytracing = false;
|
||||
|
||||
myContext->UpdateCurrentViewer();
|
||||
}
|
||||
|
||||
void View::updateToggled( bool isOn )
|
||||
@@ -398,6 +477,12 @@ QList<QAction*>* View::getViewActions()
|
||||
return myViewActions;
|
||||
}
|
||||
|
||||
QList<QAction*>* View::getRaytraceActions()
|
||||
{
|
||||
initRaytraceActions();
|
||||
return myRaytraceActions;
|
||||
}
|
||||
|
||||
/*!
|
||||
Get paint engine for the OpenGL viewer. [ virtual public ]
|
||||
*/
|
||||
@@ -533,6 +618,48 @@ void View::initViewActions()
|
||||
myViewActions->insert( ViewHlrOnId, a );
|
||||
}
|
||||
|
||||
void View::initRaytraceActions()
|
||||
{
|
||||
if ( myRaytraceActions )
|
||||
return;
|
||||
|
||||
myRaytraceActions = new QList<QAction*>();
|
||||
QString dir = ApplicationCommonWindow::getResourceDir() + QString( "/" );
|
||||
QAction* a;
|
||||
|
||||
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_RAYTRACING") ), QObject::tr("MNU_TOOL_RAYTRACING"), this );
|
||||
a->setToolTip( QObject::tr("TBR_TOOL_RAYTRACING") );
|
||||
a->setStatusTip( QObject::tr("TBR_TOOL_RAYTRACING") );
|
||||
a->setCheckable( true );
|
||||
a->setChecked( false );
|
||||
connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
|
||||
myRaytraceActions->insert( ToolRaytracingId, a );
|
||||
|
||||
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_SHADOWS") ), QObject::tr("MNU_TOOL_SHADOWS"), this );
|
||||
a->setToolTip( QObject::tr("TBR_TOOL_SHADOWS") );
|
||||
a->setStatusTip( QObject::tr("TBR_TOOL_SHADOWS") );
|
||||
a->setCheckable( true );
|
||||
a->setChecked( true );
|
||||
connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
|
||||
myRaytraceActions->insert( ToolShadowsId, a );
|
||||
|
||||
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_REFLECTIONS") ), QObject::tr("MNU_TOOL_REFLECTIONS"), this );
|
||||
a->setToolTip( QObject::tr("TBR_TOOL_REFLECTIONS") );
|
||||
a->setStatusTip( QObject::tr("TBR_TOOL_REFLECTIONS") );
|
||||
a->setCheckable( true );
|
||||
a->setChecked( true );
|
||||
connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
|
||||
myRaytraceActions->insert( ToolReflectionsId, a );
|
||||
|
||||
a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_ANTIALIASING") ), QObject::tr("MNU_TOOL_ANTIALIASING"), this );
|
||||
a->setToolTip( QObject::tr("TBR_TOOL_ANTIALIASING") );
|
||||
a->setStatusTip( QObject::tr("TBR_TOOL_ANTIALIASING") );
|
||||
a->setCheckable( true );
|
||||
a->setChecked( false );
|
||||
connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
|
||||
myRaytraceActions->insert( ToolAntialiasingId, a );
|
||||
}
|
||||
|
||||
void View::mousePressEvent( QMouseEvent* e )
|
||||
{
|
||||
if ( e->button() == Qt::LeftButton )
|
||||
@@ -855,8 +982,8 @@ void View::MultiInputEvent( const int /*x*/, const int /*y*/ )
|
||||
void View::Popup( const int /*x*/, const int /*y*/ )
|
||||
{
|
||||
ApplicationCommonWindow* stApp = ApplicationCommonWindow::getApplication();
|
||||
QWorkspace* ws = ApplicationCommonWindow::getWorkspace();
|
||||
QWidget* w = ws->activeWindow();
|
||||
QMdiArea* ws = ApplicationCommonWindow::getWorkspace();
|
||||
QMdiSubWindow* w = ws->activeSubWindow();
|
||||
if ( myContext->NbSelected() )
|
||||
{
|
||||
QList<QAction*>* aList = stApp->getToolActions();
|
||||
@@ -928,7 +1055,7 @@ void View::DrawRectangle(const int MinX, const int MinY,
|
||||
if ( !myRectBand )
|
||||
{
|
||||
myRectBand = new QRubberBand( QRubberBand::Rectangle, this );
|
||||
myRectBand->setStyle(new QWindowsStyle);
|
||||
myRectBand->setStyle( QStyleFactory::create("windows") );
|
||||
myRectBand->setGeometry( aRect );
|
||||
myRectBand->show();
|
||||
|
||||
@@ -1000,7 +1127,7 @@ void View::onEnvironmentMap()
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "",
|
||||
tr("All Image Files (*.bmp *.gif *.jpg *.jpeg *.png *.tga)"));
|
||||
|
||||
Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv( fileName.toAscii().data() );
|
||||
Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv( fileName.toLatin1().data() );
|
||||
|
||||
myView->SetTextureEnv (aTexture);
|
||||
myView->SetSurfaceDetail (V3d_TEX_ENVIRONMENT);
|
||||
|
@@ -24,22 +24,30 @@ public:
|
||||
enum ViewAction { ViewFitAllId, ViewFitAreaId, ViewZoomId, ViewPanId, ViewGlobalPanId,
|
||||
ViewFrontId, ViewBackId, ViewTopId, ViewBottomId, ViewLeftId, ViewRightId,
|
||||
ViewAxoId, ViewRotationId, ViewResetId, ViewHlrOffId, ViewHlrOnId };
|
||||
enum RaytraceAction { ToolRaytracingId, ToolShadowsId, ToolReflectionsId, ToolAntialiasingId };
|
||||
|
||||
View( Handle(AIS_InteractiveContext) theContext,
|
||||
QWidget* parent,
|
||||
bool theRT = false );
|
||||
View( Handle(AIS_InteractiveContext) theContext, QWidget* parent );
|
||||
|
||||
~View();
|
||||
|
||||
virtual void init();
|
||||
bool dump( Standard_CString theFile );
|
||||
QList<QAction*>* getViewActions();
|
||||
QList<QAction*>* getRaytraceActions();
|
||||
void noActiveActions();
|
||||
bool isShadingMode();
|
||||
|
||||
void setRaytracedShadows( int state );
|
||||
void setRaytracedReflections( int state );
|
||||
void setRaytracedAntialiasing( int state );
|
||||
void EnableRaytracing();
|
||||
void DisableRaytracing();
|
||||
|
||||
void SetRaytracedShadows (bool theState);
|
||||
void SetRaytracedReflections (bool theState);
|
||||
void SetRaytracedAntialiasing (bool theState);
|
||||
|
||||
bool IsRaytracingMode() const { return myIsRaytracing; }
|
||||
bool IsShadowsEnabled() const { return myIsShadowsEnabled; }
|
||||
bool IsReflectionsEnabled() const { return myIsReflectionsEnabled; }
|
||||
bool IsAntialiasingEnabled() const { return myIsAntialiasingEnabled; }
|
||||
|
||||
static QString GetMessages( int type,TopAbs_ShapeEnum aSubShapeType,
|
||||
TopAbs_ShapeEnum aShapeType );
|
||||
@@ -77,6 +85,7 @@ public slots:
|
||||
void updateToggled( bool );
|
||||
void onBackground();
|
||||
void onEnvironmentMap();
|
||||
void onRaytraceAction();
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent* );
|
||||
@@ -104,6 +113,7 @@ protected:
|
||||
private:
|
||||
void initCursors();
|
||||
void initViewActions();
|
||||
void initRaytraceActions();
|
||||
void DragEvent( const int x, const int y, const int TheState );
|
||||
void InputEvent( const int x, const int y );
|
||||
void MoveEvent( const int x, const int y );
|
||||
@@ -114,7 +124,11 @@ private:
|
||||
const int MaxX, const int MaxY, const bool Draw );
|
||||
|
||||
private:
|
||||
bool myIsRT;
|
||||
bool myIsRaytracing;
|
||||
bool myIsShadowsEnabled;
|
||||
bool myIsReflectionsEnabled;
|
||||
bool myIsAntialiasingEnabled;
|
||||
|
||||
bool myFirst;
|
||||
bool myDrawRect; // set when a rect is used for selection or magnify
|
||||
Handle(V3d_View) myView;
|
||||
@@ -127,6 +141,7 @@ private:
|
||||
Quantity_Factor myCurZoom;
|
||||
Standard_Boolean myHlrModeIsOn;
|
||||
QList<QAction*>* myViewActions;
|
||||
QList<QAction*>* myRaytraceActions;
|
||||
QMenu* myBackMenu;
|
||||
QRubberBand* myRectBand; //!< selection rectangle rubber band
|
||||
};
|
||||
|
@@ -1,6 +1,6 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IESample", "IESample.vcxproj", "{7FD0453F-8AC0-3EE3-9C11-DD413EF20A44}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IESample", "IESample.vcxproj", "{7972FDD8-9612-3401-827F-C8DF8E2689B5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -8,12 +8,12 @@ Global
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7FD0453F-8AC0-3EE3-9C11-DD413EF20A44}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7FD0453F-8AC0-3EE3-9C11-DD413EF20A44}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7FD0453F-8AC0-3EE3-9C11-DD413EF20A44}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7FD0453F-8AC0-3EE3-9C11-DD413EF20A44}.Release|Win32.Build.0 = Release|Win32
|
||||
{7972FDD8-9612-3401-827F-C8DF8E2689B5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7972FDD8-9612-3401-827F-C8DF8E2689B5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7972FDD8-9612-3401-827F-C8DF8E2689B5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7972FDD8-9612-3401-827F-C8DF8E2689B5}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
EndGlobal
|
||||
|
@@ -1,6 +1,6 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IESample", "IESample.vcproj", "{7FD0453F-8AC0-3EE3-9C11-DD413EF20A44}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IESample", "IESample.vcproj", "{AD4DADCB-F15E-37FD-B3AA-88504FAAF4FD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -8,10 +8,10 @@ Global
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7FD0453F-8AC0-3EE3-9C11-DD413EF20A44}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7FD0453F-8AC0-3EE3-9C11-DD413EF20A44}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7FD0453F-8AC0-3EE3-9C11-DD413EF20A44}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7FD0453F-8AC0-3EE3-9C11-DD413EF20A44}.Release|Win32.Build.0 = Release|Win32
|
||||
{AD4DADCB-F15E-37FD-B3AA-88504FAAF4FD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AD4DADCB-F15E-37FD-B3AA-88504FAAF4FD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AD4DADCB-F15E-37FD-B3AA-88504FAAF4FD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AD4DADCB-F15E-37FD-B3AA-88504FAAF4FD}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@@ -3,10 +3,9 @@ CONFIG += debug_and_release qt
|
||||
|
||||
TARGET = IESample
|
||||
|
||||
SAMPLESROOT = $$(CASROOT)/samples/qt
|
||||
SAMPLESROOT = $$(SAMPLESROOT)
|
||||
|
||||
HEADERS = src/*.h \
|
||||
$${SAMPLESROOT}/Common/src/*.h \
|
||||
HEADERS = $${SAMPLESROOT}/Common/src/*.h \
|
||||
$${SAMPLESROOT}/Interface/src/*.h
|
||||
|
||||
SOURCES = src/*.cxx \
|
||||
@@ -24,7 +23,9 @@ RES_DIR = $$quote($$(RES_DIR))
|
||||
INCLUDEPATH += $$quote($${SAMPLESROOT}/Common/src)
|
||||
INCLUDEPATH += $$quote($${SAMPLESROOT}/Interface/src)
|
||||
|
||||
DEFINES = CSFDB
|
||||
OCCT_DEFINES = $$(CSF_DEFINES)
|
||||
|
||||
DEFINES = CSFDB $$split(OCCT_DEFINES, ;)
|
||||
|
||||
unix {
|
||||
UNAME = $$system(uname -s)
|
||||
@@ -38,11 +39,11 @@ unix {
|
||||
CONFIG(debug, debug|release) {
|
||||
DESTDIR = ./$$UNAME/bind
|
||||
OBJECTS_DIR = ./$$UNAME/objd
|
||||
MOC_DIR = ./$$UNAME/srcd
|
||||
MOC_DIR = ./$$UNAME/mocd
|
||||
} else {
|
||||
DESTDIR = ./$$UNAME/bin
|
||||
OBJECTS_DIR = ./$$UNAME/obj
|
||||
MOC_DIR = ./$$UNAME/src
|
||||
MOC_DIR = ./$$UNAME/moc
|
||||
}
|
||||
|
||||
MACOSX_USE_GLX = $$(MACOSX_USE_GLX)
|
||||
@@ -63,107 +64,23 @@ win32 {
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
DEFINES += _DEBUG
|
||||
DESTDIR = ./win$(ARCH)/$(VCVER)/bind
|
||||
OBJECTS_DIR = ./win$(ARCH)/$(VCVER)/objd
|
||||
MOC_DIR = ./win$(ARCH)/$(VCVER)/mocd
|
||||
!contains(QMAKE_HOST.arch, x86_64) {
|
||||
LIBS = -L$(CSF_OPT_LIB32D)
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1310) {
|
||||
DESTDIR = ./win32/vc7/bind
|
||||
OBJECTS_DIR = ./win32/vc7/objd
|
||||
MOC_DIR = ./win32/vc7/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
|
||||
DESTDIR = ./win32/vc8/bind
|
||||
OBJECTS_DIR = ./win32/vc8/objd
|
||||
MOC_DIR = ./win32/vc8/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
|
||||
DESTDIR = ./win32/vc9/bind
|
||||
OBJECTS_DIR = ./win32/vc9/objd
|
||||
MOC_DIR = ./win32/vc9/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
|
||||
DESTDIR = ./win32/vc10/bind
|
||||
OBJECTS_DIR = ./win32/vc10/objd
|
||||
MOC_DIR = ./win32/vc10/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
|
||||
DESTDIR = ./win32/vc11/bind
|
||||
OBJECTS_DIR = ./win32/vc11/objd
|
||||
MOC_DIR = ./win32/vc11/srcd
|
||||
}
|
||||
LIBS = -L$(CSF_OPT_LIB32D)
|
||||
} else {
|
||||
LIBS = -L$(CSF_OPT_LIB64D)
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
|
||||
DESTDIR = ./win64/vc8/bind
|
||||
OBJECTS_DIR = ./win64/vc8/objd
|
||||
MOC_DIR = ./win64/vc8/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
|
||||
DESTDIR = ./win64/vc9/bind
|
||||
OBJECTS_DIR = ./win64/vc9/objd
|
||||
MOC_DIR = ./win64/vc9/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
|
||||
DESTDIR = ./win64/vc10/bind
|
||||
OBJECTS_DIR = ./win64/vc10/objd
|
||||
MOC_DIR = ./win64/vc10/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
|
||||
DESTDIR = ./win64/vc11/bind
|
||||
OBJECTS_DIR = ./win64/vc11/objd
|
||||
MOC_DIR = ./win64/vc11/srcd
|
||||
}
|
||||
LIBS = -L$(CSF_OPT_LIB64D)
|
||||
}
|
||||
} else {
|
||||
DEFINES += NDEBUG
|
||||
DESTDIR = ./win$(ARCH)/$(VCVER)/bin
|
||||
OBJECTS_DIR = ./win$(ARCH)/$(VCVER)/obj
|
||||
MOC_DIR = ./win$(ARCH)/$(VCVER)/moc
|
||||
!contains(QMAKE_HOST.arch, x86_64) {
|
||||
LIBS = -L$(CSF_OPT_LIB32)
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1310) {
|
||||
DESTDIR = ./win32/vc7/bin
|
||||
OBJECTS_DIR = ./win32/vc7/obj
|
||||
MOC_DIR = ./win32/vc7/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
|
||||
DESTDIR = ./win32/vc8/bin
|
||||
OBJECTS_DIR = ./win32/vc8/obj
|
||||
MOC_DIR = ./win32/vc8/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
|
||||
DESTDIR = ./win32/vc9/bin
|
||||
OBJECTS_DIR = ./win32/vc9/obj
|
||||
MOC_DIR = ./win32/vc9/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
|
||||
DESTDIR = ./win32/vc10/bin
|
||||
OBJECTS_DIR = ./win32/vc10/obj
|
||||
MOC_DIR = ./win32/vc10/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
|
||||
DESTDIR = ./win32/vc11/bin
|
||||
OBJECTS_DIR = ./win32/vc11/obj
|
||||
MOC_DIR = ./win32/vc11/src
|
||||
}
|
||||
LIBS = -L$(CSF_OPT_LIB32)
|
||||
} else {
|
||||
LIBS = -L$(CSF_OPT_LIB64)
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
|
||||
DESTDIR = ./win64/vc8/bin
|
||||
OBJECTS_DIR = ./win64/vc8/obj
|
||||
MOC_DIR = ./win64/vc8/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
|
||||
DESTDIR = ./win64/vc9/bin
|
||||
OBJECTS_DIR = ./win64/vc9/obj
|
||||
MOC_DIR = ./win64/vc9/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
|
||||
DESTDIR = ./win64/vc10/bin
|
||||
OBJECTS_DIR = ./win64/vc10/obj
|
||||
MOC_DIR = ./win64/vc10/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
|
||||
DESTDIR = ./win64/vc11/bin
|
||||
OBJECTS_DIR = ./win64/vc11/obj
|
||||
MOC_DIR = ./win64/vc11/src
|
||||
}
|
||||
LIBS = -L$(CSF_OPT_LIB64)
|
||||
}
|
||||
}
|
||||
DEFINES +=WNT WIN32 NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS
|
||||
@@ -199,3 +116,8 @@ copy_res.CONFIG += no_link target_predeps
|
||||
win32: copy_res.commands = type ${QMAKE_FILE_IN} > $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
|
||||
unix: copy_res.commands = cp -f ${QMAKE_FILE_IN} $${RES_DIR}
|
||||
QMAKE_EXTRA_COMPILERS += copy_res
|
||||
#QMAKE_CXXFLAGS += /wd4996
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
QT += widgets
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
call "%~dp0..\..\..\env.bat" %1 %2 %3
|
||||
|
||||
SET "SAMPLESROOT=%~dp0.."
|
||||
SET "RES_DIR=%~dp0win%ARCH%\%VCVER%\res"
|
||||
SET "CSF_ResourcesDefaults=%RES_DIR%"
|
||||
SET "CSF_IEResourcesDefaults=%RES_DIR%"
|
||||
|
@@ -7,6 +7,8 @@ REM third argument specifies Debug or Release mode
|
||||
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
set EXT=vcproj
|
||||
|
||||
if not "%1" == "" (
|
||||
if /I "%1" == "vc8" (
|
||||
set VCVER=vc8
|
||||
@@ -16,9 +18,11 @@ if not "%1" == "" (
|
||||
set "VCVARS=%VS90COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
) else if /I "%1" == "vc10" (
|
||||
set VCVER=vc10
|
||||
set EXT=vcxproj
|
||||
set "VCVARS=%VS100COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
) else if /I "%1" == "vc11" (
|
||||
set VCVER=vc11
|
||||
set EXT=vcxproj
|
||||
set "VCVARS=%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
) else (
|
||||
echo Error: first argument ^(%1^) should specify supported version of Visual C++,
|
||||
@@ -32,4 +36,4 @@ if ["%ARCH%"] == ["64"] set VCARCH=amd64
|
||||
|
||||
call "%VCVARS%" %VCARCH%
|
||||
|
||||
qmake -tp vc -r IESample.pro
|
||||
qmake -tp vc -o IESample.%EXT% IESample.pro
|
||||
|
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <stdlib.h>
|
||||
#include <QMdiSubWindow>
|
||||
|
||||
ApplicationWindow::ApplicationWindow()
|
||||
: ApplicationCommonWindow( ),
|
||||
@@ -96,7 +97,7 @@ void ApplicationWindow::createTranslatePopups()
|
||||
|
||||
void ApplicationWindow::updateFileActions()
|
||||
{
|
||||
if ( getWorkspace()->windowList().isEmpty() )
|
||||
if ( myDocuments.isEmpty() )
|
||||
{
|
||||
if ( !isDocument() )
|
||||
{
|
||||
@@ -124,7 +125,7 @@ void ApplicationWindow::onImport()
|
||||
bool stat = translate( type, true );
|
||||
if ( stat )
|
||||
{
|
||||
DocumentCommon* doc = ((MDIWindow*) getWorkspace()->activeWindow())->getDocument();
|
||||
DocumentCommon* doc = qobject_cast<MDIWindow*>( getWorkspace()->activeSubWindow()->widget() )->getDocument();
|
||||
doc->fitAll();
|
||||
}
|
||||
}
|
||||
@@ -136,7 +137,7 @@ void ApplicationWindow::onExport()
|
||||
if ( type < 0 )
|
||||
return;
|
||||
|
||||
bool stat = translate( type, false );
|
||||
translate( type, false );
|
||||
}
|
||||
|
||||
int ApplicationWindow::translationFormat( const QAction* a )
|
||||
@@ -181,7 +182,7 @@ int ApplicationWindow::translationFormat( const QAction* a )
|
||||
bool ApplicationWindow::translate( const int format, const bool import )
|
||||
{
|
||||
static Translate* anTrans = createTranslator();
|
||||
DocumentCommon* doc = ((MDIWindow*) getWorkspace()->activeWindow())->getDocument();
|
||||
DocumentCommon* doc = qobject_cast<MDIWindow*>( getWorkspace()->activeSubWindow()->widget() )->getDocument();
|
||||
Handle(AIS_InteractiveContext) context = doc->getContext();
|
||||
bool status;
|
||||
if ( import )
|
||||
@@ -210,8 +211,8 @@ void ApplicationWindow::onSelectionChanged()
|
||||
{
|
||||
ApplicationCommonWindow::onSelectionChanged();
|
||||
|
||||
QWorkspace* ws = getWorkspace();
|
||||
DocumentCommon* doc = ((MDIWindow*)ws->activeWindow())->getDocument();
|
||||
QMdiArea* ws = getWorkspace();
|
||||
DocumentCommon* doc = qobject_cast<MDIWindow*>( ws->activeSubWindow()->widget() )->getDocument();
|
||||
Handle(AIS_InteractiveContext) context = doc->getContext();
|
||||
int numSel = context->NbSelected();
|
||||
|
||||
@@ -225,13 +226,15 @@ void ApplicationWindow::onSelectionChanged()
|
||||
|
||||
QString ApplicationWindow::getIEResourceDir()
|
||||
{
|
||||
static QString resDir( ::getenv( "CSF_IEResourcesDefaults" ) );
|
||||
return resDir;
|
||||
static QString aResourceDir =
|
||||
QString::fromUtf8 (qgetenv ("CSF_IEResourcesDefaults").constData());
|
||||
|
||||
return aResourceDir;
|
||||
}
|
||||
|
||||
void ApplicationWindow::onExportImage()
|
||||
{
|
||||
MDIWindow* w = (MDIWindow*)getWorkspace()->activeWindow();
|
||||
MDIWindow* w = qobject_cast<MDIWindow*>( getWorkspace()->activeSubWindow()->widget() );
|
||||
if ( w )
|
||||
w->dump();
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include <QFileDialog>
|
||||
#include <QApplication>
|
||||
#include <QWidget>
|
||||
#include <QStyleFactory>
|
||||
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
@@ -89,7 +90,9 @@ private:
|
||||
TranslateDlg::TranslateDlg( QWidget* parent, Qt::WindowFlags flags, bool modal )
|
||||
: QFileDialog( parent, flags )
|
||||
{
|
||||
setOption( QFileDialog::DontUseNativeDialog );
|
||||
setModal( modal );
|
||||
|
||||
QGridLayout* grid = ::qobject_cast<QGridLayout*>( layout() );
|
||||
|
||||
if( grid )
|
||||
@@ -331,7 +334,7 @@ QString Translate::selectFileName( const int format, const bool import )
|
||||
|
||||
if ( !QFileInfo( file ).completeSuffix().length() )
|
||||
{
|
||||
QString selFilter = theDlg->selectedFilter();
|
||||
QString selFilter = theDlg->selectedNameFilter();
|
||||
int idx = selFilter.indexOf( "(*." );
|
||||
if ( idx != -1 )
|
||||
{
|
||||
@@ -371,7 +374,7 @@ TranslateDlg* Translate::getDialog( const int format, const bool import )
|
||||
|
||||
cout << filter.toLatin1().constData() << endl;
|
||||
QStringList filters = filter.split( "\t" );
|
||||
myDlg->setFilters( filters );
|
||||
myDlg->setNameFilters ( filters );
|
||||
|
||||
if ( import )
|
||||
{
|
||||
@@ -384,7 +387,7 @@ TranslateDlg* Translate::getDialog( const int format, const bool import )
|
||||
((QFileDialog*)myDlg)->setFileMode( QFileDialog::AnyFile );
|
||||
}
|
||||
|
||||
QString datadir = (QString(getenv("CASROOT")) + QObject::tr( QString("INF_PATH_%1").arg( format ).toLatin1().constData() ) );
|
||||
QString datadir = (QString (qgetenv ("CASROOT").constData()) + QObject::tr( QString("INF_PATH_%1").arg( format ).toLatin1().constData() ) );
|
||||
|
||||
myDlg->clear();
|
||||
|
||||
@@ -459,7 +462,7 @@ Handle(TopTools_HSequenceOfShape) Translate::importSTEP( const QString& file )
|
||||
{
|
||||
bool ok = aReader.TransferRoot( n );
|
||||
int nbs = aReader.NbShapes();
|
||||
if ( nbs > 0 )
|
||||
if ( ok == true && nbs > 0 )
|
||||
{
|
||||
aSequence = new TopTools_HSequenceOfShape();
|
||||
for ( int i = 1; i <= nbs; i++ )
|
||||
|
@@ -1,6 +1,6 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tutorial", "Tutorial.vcxproj", "{59DEDC8A-A5ED-31E8-8F2B-8D996E3A41D6}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tutorial", "Tutorial.vcxproj", "{E417B143-8CB4-3EF0-8247-DA6F67FA3FCE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -8,10 +8,10 @@ Global
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{59DEDC8A-A5ED-31E8-8F2B-8D996E3A41D6}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{59DEDC8A-A5ED-31E8-8F2B-8D996E3A41D6}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{59DEDC8A-A5ED-31E8-8F2B-8D996E3A41D6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{59DEDC8A-A5ED-31E8-8F2B-8D996E3A41D6}.Release|Win32.Build.0 = Release|Win32
|
||||
{E417B143-8CB4-3EF0-8247-DA6F67FA3FCE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E417B143-8CB4-3EF0-8247-DA6F67FA3FCE}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E417B143-8CB4-3EF0-8247-DA6F67FA3FCE}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E417B143-8CB4-3EF0-8247-DA6F67FA3FCE}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@@ -3,7 +3,7 @@ CONFIG += debug_and_release qt
|
||||
|
||||
TARGET = Tutorial
|
||||
|
||||
SAMPLESROOT = $$(CASROOT)/samples/qt
|
||||
SAMPLESROOT = $$(SAMPLESROOT)
|
||||
|
||||
HEADERS = src/*.h \
|
||||
$${SAMPLESROOT}/Common/src/*.h \
|
||||
@@ -26,7 +26,9 @@ RES_DIR = $$quote($$(RES_DIR))
|
||||
INCLUDEPATH += $$quote($${SAMPLESROOT}/Common/src)
|
||||
INCLUDEPATH += $$quote($${SAMPLESROOT}/Interface/src)
|
||||
|
||||
DEFINES = CSFDB
|
||||
OCCT_DEFINES = $$(CSF_DEFINES)
|
||||
|
||||
DEFINES = CSFDB $$split(OCCT_DEFINES, ;)
|
||||
|
||||
unix {
|
||||
UNAME = $$system(uname -s)
|
||||
@@ -40,11 +42,11 @@ unix {
|
||||
CONFIG(debug, debug|release) {
|
||||
DESTDIR = ./$$UNAME/bind
|
||||
OBJECTS_DIR = ./$$UNAME/objd
|
||||
MOC_DIR = ./$$UNAME/srcd
|
||||
MOC_DIR = ./$$UNAME/mocd
|
||||
} else {
|
||||
DESTDIR = ./$$UNAME/bin
|
||||
OBJECTS_DIR = ./$$UNAME/obj
|
||||
MOC_DIR = ./$$UNAME/src
|
||||
MOC_DIR = ./$$UNAME/moc
|
||||
}
|
||||
|
||||
MACOSX_USE_GLX = $$(MACOSX_USE_GLX)
|
||||
@@ -65,107 +67,23 @@ win32 {
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
DEFINES += _DEBUG
|
||||
DESTDIR = ./win$(ARCH)/$(VCVER)/bind
|
||||
OBJECTS_DIR = ./win$(ARCH)/$(VCVER)/objd
|
||||
MOC_DIR = ./win$(ARCH)/$(VCVER)/mocd
|
||||
!contains(QMAKE_HOST.arch, x86_64) {
|
||||
LIBS = -L$(CSF_OPT_LIB32D)
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1310) {
|
||||
DESTDIR = ./win32/vc7/bind
|
||||
OBJECTS_DIR = ./win32/vc7/objd
|
||||
MOC_DIR = ./win32/vc7/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
|
||||
DESTDIR = ./win32/vc8/bind
|
||||
OBJECTS_DIR = ./win32/vc8/objd
|
||||
MOC_DIR = ./win32/vc8/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
|
||||
DESTDIR = ./win32/vc9/bind
|
||||
OBJECTS_DIR = ./win32/vc9/objd
|
||||
MOC_DIR = ./win32/vc9/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
|
||||
DESTDIR = ./win32/vc10/bind
|
||||
OBJECTS_DIR = ./win32/vc10/objd
|
||||
MOC_DIR = ./win32/vc10/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
|
||||
DESTDIR = ./win32/vc11/bind
|
||||
OBJECTS_DIR = ./win32/vc11/objd
|
||||
MOC_DIR = ./win32/vc11/srcd
|
||||
}
|
||||
LIBS = -L$(CSF_OPT_LIB32D)
|
||||
} else {
|
||||
LIBS = -L$(CSF_OPT_LIB64D)
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
|
||||
DESTDIR = ./win64/vc8/bind
|
||||
OBJECTS_DIR = ./win64/vc8/objd
|
||||
MOC_DIR = ./win64/vc8/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
|
||||
DESTDIR = ./win64/vc9/bind
|
||||
OBJECTS_DIR = ./win64/vc9/objd
|
||||
MOC_DIR = ./win64/vc9/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
|
||||
DESTDIR = ./win64/vc10/bind
|
||||
OBJECTS_DIR = ./win64/vc10/objd
|
||||
MOC_DIR = ./win64/vc10/srcd
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
|
||||
DESTDIR = ./win64/vc11/bind
|
||||
OBJECTS_DIR = ./win64/vc11/objd
|
||||
MOC_DIR = ./win64/vc11/srcd
|
||||
}
|
||||
LIBS = -L$(CSF_OPT_LIB64D)
|
||||
}
|
||||
} else {
|
||||
DEFINES += NDEBUG
|
||||
DESTDIR = ./win$(ARCH)/$(VCVER)/bin
|
||||
OBJECTS_DIR = ./win$(ARCH)/$(VCVER)/obj
|
||||
MOC_DIR = ./win$(ARCH)/$(VCVER)/moc
|
||||
!contains(QMAKE_HOST.arch, x86_64) {
|
||||
LIBS = -L$(CSF_OPT_LIB32)
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1310) {
|
||||
DESTDIR = ./win32/vc7/bin
|
||||
OBJECTS_DIR = ./win32/vc7/obj
|
||||
MOC_DIR = ./win32/vc7/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
|
||||
DESTDIR = ./win32/vc8/bin
|
||||
OBJECTS_DIR = ./win32/vc8/obj
|
||||
MOC_DIR = ./win32/vc8/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
|
||||
DESTDIR = ./win32/vc9/bin
|
||||
OBJECTS_DIR = ./win32/vc9/obj
|
||||
MOC_DIR = ./win32/vc9/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
|
||||
DESTDIR = ./win32/vc10/bin
|
||||
OBJECTS_DIR = ./win32/vc10/obj
|
||||
MOC_DIR = ./win32/vc10/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
|
||||
DESTDIR = ./win32/vc11/bin
|
||||
OBJECTS_DIR = ./win32/vc11/obj
|
||||
MOC_DIR = ./win32/vc11/src
|
||||
}
|
||||
LIBS = -L$(CSF_OPT_LIB32)
|
||||
} else {
|
||||
LIBS = -L$(CSF_OPT_LIB64)
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1400) {
|
||||
DESTDIR = ./win64/vc8/bin
|
||||
OBJECTS_DIR = ./win64/vc8/obj
|
||||
MOC_DIR = ./win64/vc8/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1500) {
|
||||
DESTDIR = ./win64/vc9/bin
|
||||
OBJECTS_DIR = ./win64/vc9/obj
|
||||
MOC_DIR = ./win64/vc9/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1600) {
|
||||
DESTDIR = ./win64/vc10/bin
|
||||
OBJECTS_DIR = ./win64/vc10/obj
|
||||
MOC_DIR = ./win64/vc10/src
|
||||
}
|
||||
contains(QMAKE_COMPILER_DEFINES, _MSC_VER=1700) {
|
||||
DESTDIR = ./win64/vc11/bin
|
||||
OBJECTS_DIR = ./win64/vc11/obj
|
||||
MOC_DIR = ./win64/vc11/src
|
||||
}
|
||||
LIBS = -L$(CSF_OPT_LIB64)
|
||||
}
|
||||
}
|
||||
DEFINES +=WNT WIN32 NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS
|
||||
@@ -201,4 +119,8 @@ copy_res.CONFIG += no_link target_predeps
|
||||
win32: copy_res.commands = type ${QMAKE_FILE_IN} > $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
|
||||
unix: copy_res.commands = cp -f ${QMAKE_FILE_IN} $${RES_DIR}
|
||||
QMAKE_EXTRA_COMPILERS += copy_res
|
||||
#QMAKE_CXXFLAGS += /wd4996
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
QT += widgets
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
call "%~dp0..\..\..\env.bat" %1 %2 %3
|
||||
|
||||
SET "SAMPLESROOT=%~dp0.."
|
||||
SET "RES_DIR=%~dp0win%ARCH%\%VCVER%\res"
|
||||
SET "CSF_ResourcesDefaults=%RES_DIR%"
|
||||
SET "CSF_TutorialResourcesDefaults=%RES_DIR%"
|
||||
|
||||
|
@@ -7,6 +7,8 @@ REM third argument specifies Debug or Release mode
|
||||
|
||||
call "%~dp0env.bat" %1 %2 %3
|
||||
|
||||
set EXT=vcproj
|
||||
|
||||
if not "%1" == "" (
|
||||
if /I "%1" == "vc8" (
|
||||
set VCVER=vc8
|
||||
@@ -16,9 +18,11 @@ if not "%1" == "" (
|
||||
set "VCVARS=%VS90COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
) else if /I "%1" == "vc10" (
|
||||
set VCVER=vc10
|
||||
set EXT=vcxproj
|
||||
set "VCVARS=%VS100COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
) else if /I "%1" == "vc11" (
|
||||
set VCVER=vc11
|
||||
set EXT=vcxproj
|
||||
set "VCVARS=%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
) else (
|
||||
echo Error: first argument ^(%1^) should specify supported version of Visual C++,
|
||||
@@ -32,4 +36,4 @@ if ["%ARCH%"] == ["64"] set VCARCH=amd64
|
||||
|
||||
call "%VCVARS%" %VCARCH%
|
||||
|
||||
qmake -tp vc -r Tutorial.pro
|
||||
qmake -tp vc -o Tutorial.%EXT% Tutorial.pro
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QStatusBar>
|
||||
#include <QMdiSubWindow>
|
||||
|
||||
ApplicationTut::ApplicationTut()
|
||||
: ApplicationCommonWindow( )
|
||||
@@ -33,7 +34,7 @@ void ApplicationTut::createMakeBottleOperation(){
|
||||
|
||||
void ApplicationTut::updateFileActions()
|
||||
{
|
||||
if ( getWorkspace()->windowList().isEmpty() )
|
||||
if ( getWorkspace()->subWindowList().isEmpty() )
|
||||
{
|
||||
if ( !isDocument() )
|
||||
{
|
||||
@@ -49,8 +50,8 @@ void ApplicationTut::updateFileActions()
|
||||
|
||||
void ApplicationTut::onMakeBottleAction()
|
||||
{
|
||||
QWorkspace* ws = ApplicationCommonWindow::getWorkspace();
|
||||
DocumentTut* doc = (DocumentTut*)((MDIWindow*)ws->activeWindow())->getDocument();
|
||||
QMdiArea* ws = ApplicationCommonWindow::getWorkspace();
|
||||
DocumentTut* doc = (DocumentTut*)( qobject_cast<MDIWindow*>( ws->activeSubWindow()->widget() )->getDocument() );
|
||||
statusBar()->showMessage( QObject::tr("INF_MAKE_BOTTLE"), 5000 );
|
||||
doc->onMakeBottle();
|
||||
statusBar()->showMessage(QObject::tr("INF_DONE"));
|
||||
@@ -58,7 +59,7 @@ void ApplicationTut::onMakeBottleAction()
|
||||
|
||||
QString ApplicationTut::getTutResourceDir()
|
||||
{
|
||||
static QString resDir( ::getenv( "CSF_TutorialResourcesDefaults" ) );
|
||||
return resDir;
|
||||
static QString resDir (qgetenv ("CSF_TutorialResourcesDefaults").constData());
|
||||
return resDir;
|
||||
}
|
||||
|
||||
|
@@ -112,12 +112,3 @@ puts "Showing result..."
|
||||
vdisplay bottle
|
||||
vfit
|
||||
vsetdispmode 1
|
||||
|
||||
# set ray tracing
|
||||
if { [regexp {HAVE_OPENCL} [dversion]] } {
|
||||
puts "Trying raytrace mode..."
|
||||
if { ! [catch {vraytrace 1}] } {
|
||||
vtextureenv on 1
|
||||
vfit
|
||||
}
|
||||
}
|
||||
|
39
samples/tcl/raytrace.tcl
Normal file
@@ -0,0 +1,39 @@
|
||||
# Script reproducing creation of bottle model as described in OCCT Tutorial
|
||||
|
||||
# make bottle by calling another script
|
||||
source [file join [file dirname [info script]] bottle.tcl]
|
||||
|
||||
# make table and a glass
|
||||
box table -50 -50 -10 100 100 10
|
||||
pcone glass_out 7 9 25
|
||||
pcone glass_in 7 9 25
|
||||
ttranslate glass_in 0 0 0.2
|
||||
bcut glass glass_out glass_in
|
||||
ttranslate glass -30 -30 0
|
||||
|
||||
# show table and glass
|
||||
vsetmaterial bottle aluminium
|
||||
vdisplay table
|
||||
vsetmaterial table bronze
|
||||
vsetmaterial table plastic
|
||||
vsetcolor table coral2
|
||||
vdisplay glass
|
||||
vsetmaterial glass plastic
|
||||
vsetcolor glass brown
|
||||
vsettransparency glass 0.6
|
||||
|
||||
# add light source for shadows
|
||||
vlight new spot pos -100 -100 300
|
||||
|
||||
# set white background and fit view
|
||||
vsetcolorbg 255 255 255
|
||||
vfit
|
||||
|
||||
# set ray tracing
|
||||
if { [regexp {HAVE_OPENCL} [dversion]] } {
|
||||
puts "Trying raytrace mode..."
|
||||
if { ! [catch {vraytrace 1}] } {
|
||||
vtextureenv on 1
|
||||
vsetraytracemode shad=1 refl=1 aa=1
|
||||
}
|
||||
}
|
@@ -5,8 +5,8 @@
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and / or modify it
|
||||
-- under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
@@ -146,7 +146,8 @@ uses
|
||||
StdSelect,
|
||||
DsgPrs,
|
||||
TopTools,
|
||||
Poly
|
||||
Poly,
|
||||
Image
|
||||
|
||||
is
|
||||
|
||||
@@ -241,19 +242,23 @@ is
|
||||
KOI_Datum,
|
||||
KOI_Shape,
|
||||
KOI_Object,
|
||||
KOI_Relation;
|
||||
--- Purpose: Declares the type of Interactive Object.
|
||||
-- This is one of the following:
|
||||
-- - the Datum
|
||||
-- - the Object
|
||||
-- - the Relation
|
||||
-- - the None type.
|
||||
-- The Datum is the construction element. These include
|
||||
-- points, lines, axes and planes. The object brings
|
||||
-- together topological shapes. The Relation includes
|
||||
-- dimensions and constraints. When the object is of an
|
||||
-- unknown type, the None type is declared.
|
||||
|
||||
KOI_Relation,
|
||||
KOI_Dimension;
|
||||
--- Purpose: Declares the type of Interactive Object.
|
||||
-- This is one of the following:
|
||||
-- - the Datum
|
||||
-- - the Object
|
||||
-- - the Relation
|
||||
-- - the Dimension
|
||||
-- - the None type.
|
||||
-- The Datum is the construction element. These include
|
||||
-- points, lines, axes and planes. The object brings
|
||||
-- together topological shapes. The Relation includes
|
||||
-- dimensions and constraints. The Dimension includes
|
||||
-- length, radius, diameter and angle dimensions.
|
||||
-- When the object is of an unknown type, the None
|
||||
-- type is declared.
|
||||
|
||||
enumeration ClearMode is
|
||||
CM_All,
|
||||
CM_Interactive,
|
||||
@@ -320,7 +325,7 @@ is
|
||||
|
||||
class Triangulation;
|
||||
|
||||
class TexturedShape;
|
||||
imported TexturedShape;
|
||||
|
||||
class Drawer;
|
||||
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <Select3D_SensitiveGroup.hxx>
|
||||
#include <Select3D_SensitiveSegment.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <Standard_ProgramError.hxx>
|
||||
#include <UnitsAPI.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_HANDLE (AIS_AngleDimension, AIS_Dimension)
|
||||
@@ -144,19 +145,17 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Edge& theFirstEdge,
|
||||
{
|
||||
gp_Pln aComputedPlane;
|
||||
|
||||
myFirstShape = theFirstEdge;
|
||||
mySecondShape = theSecondEdge;
|
||||
myThirdShape = TopoDS_Shape();
|
||||
myGeometryType = GeometryType_Edges;
|
||||
myIsValid = InitTwoEdgesAngle (aComputedPlane);
|
||||
myFirstShape = theFirstEdge;
|
||||
mySecondShape = theSecondEdge;
|
||||
myThirdShape = TopoDS_Shape();
|
||||
myGeometryType = GeometryType_Edges;
|
||||
myIsGeometryValid = InitTwoEdgesAngle (aComputedPlane);
|
||||
|
||||
if (myIsValid && !myIsPlaneCustom)
|
||||
if (myIsGeometryValid && !myIsPlaneCustom)
|
||||
{
|
||||
myPlane = aComputedPlane;
|
||||
ComputePlane();
|
||||
}
|
||||
|
||||
myIsValid &= CheckPlane (myPlane);
|
||||
|
||||
SetToUpdate();
|
||||
}
|
||||
|
||||
@@ -175,15 +174,13 @@ void AIS_AngleDimension::SetMeasuredGeometry (const gp_Pnt& theFirstPoint,
|
||||
mySecondShape = BRepLib_MakeVertex (myCenterPoint);
|
||||
myThirdShape = BRepLib_MakeVertex (mySecondPoint);
|
||||
myGeometryType = GeometryType_Points;
|
||||
myIsValid = IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
|
||||
myIsGeometryValid = IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
|
||||
|
||||
if (myIsValid && !myIsPlaneCustom)
|
||||
if (myIsGeometryValid && !myIsPlaneCustom)
|
||||
{
|
||||
ComputePlane();
|
||||
}
|
||||
|
||||
myIsValid &= CheckPlane (myPlane);
|
||||
|
||||
SetToUpdate();
|
||||
}
|
||||
|
||||
@@ -195,22 +192,20 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Vertex& theFirstVerte
|
||||
const TopoDS_Vertex& theSecondVertex,
|
||||
const TopoDS_Vertex& theThirdVertex)
|
||||
{
|
||||
myFirstShape = theFirstVertex;
|
||||
mySecondShape = theSecondVertex;
|
||||
myThirdShape = theThirdVertex;
|
||||
myFirstPoint = BRep_Tool::Pnt (theFirstVertex);
|
||||
myCenterPoint = BRep_Tool::Pnt (theSecondVertex);
|
||||
mySecondPoint = BRep_Tool::Pnt (theThirdVertex);
|
||||
myGeometryType = GeometryType_Points;
|
||||
myIsValid = IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
|
||||
myFirstShape = theFirstVertex;
|
||||
mySecondShape = theSecondVertex;
|
||||
myThirdShape = theThirdVertex;
|
||||
myFirstPoint = BRep_Tool::Pnt (theFirstVertex);
|
||||
myCenterPoint = BRep_Tool::Pnt (theSecondVertex);
|
||||
mySecondPoint = BRep_Tool::Pnt (theThirdVertex);
|
||||
myGeometryType = GeometryType_Points;
|
||||
myIsGeometryValid = IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
|
||||
|
||||
if (myIsValid && !myIsPlaneCustom)
|
||||
if (myIsGeometryValid && !myIsPlaneCustom)
|
||||
{
|
||||
ComputePlane();
|
||||
}
|
||||
|
||||
myIsValid &= CheckPlane (myPlane);
|
||||
|
||||
SetToUpdate();
|
||||
}
|
||||
|
||||
@@ -220,19 +215,17 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Vertex& theFirstVerte
|
||||
//=======================================================================
|
||||
void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theCone)
|
||||
{
|
||||
myFirstShape = theCone;
|
||||
mySecondShape = TopoDS_Shape();
|
||||
myThirdShape = TopoDS_Shape();
|
||||
myGeometryType = GeometryType_Face;
|
||||
myIsValid = InitConeAngle();
|
||||
myFirstShape = theCone;
|
||||
mySecondShape = TopoDS_Shape();
|
||||
myThirdShape = TopoDS_Shape();
|
||||
myGeometryType = GeometryType_Face;
|
||||
myIsGeometryValid = InitConeAngle();
|
||||
|
||||
if (myIsValid && !myIsPlaneCustom)
|
||||
if (myIsGeometryValid && !myIsPlaneCustom)
|
||||
{
|
||||
ComputePlane();
|
||||
}
|
||||
|
||||
myIsValid &= CheckPlane (myPlane);
|
||||
|
||||
SetToUpdate();
|
||||
}
|
||||
|
||||
@@ -243,19 +236,17 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theCone)
|
||||
void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace,
|
||||
const TopoDS_Face& theSecondFace)
|
||||
{
|
||||
myFirstShape = theFirstFace;
|
||||
mySecondShape = theSecondFace;
|
||||
myThirdShape = TopoDS_Shape();
|
||||
myGeometryType = GeometryType_Faces;
|
||||
myIsValid = InitTwoFacesAngle();
|
||||
myFirstShape = theFirstFace;
|
||||
mySecondShape = theSecondFace;
|
||||
myThirdShape = TopoDS_Shape();
|
||||
myGeometryType = GeometryType_Faces;
|
||||
myIsGeometryValid = InitTwoFacesAngle();
|
||||
|
||||
if (myIsValid && !myIsPlaneCustom)
|
||||
if (myIsGeometryValid && !myIsPlaneCustom)
|
||||
{
|
||||
ComputePlane();
|
||||
}
|
||||
|
||||
myIsValid &= CheckPlane (myPlane);
|
||||
|
||||
SetToUpdate();
|
||||
}
|
||||
|
||||
@@ -267,19 +258,17 @@ void AIS_AngleDimension::SetMeasuredGeometry (const TopoDS_Face& theFirstFace,
|
||||
const TopoDS_Face& theSecondFace,
|
||||
const gp_Pnt& thePoint)
|
||||
{
|
||||
myFirstShape = theFirstFace;
|
||||
mySecondShape = theSecondFace;
|
||||
myThirdShape = TopoDS_Shape();
|
||||
myGeometryType = GeometryType_Faces;
|
||||
myIsValid = InitTwoFacesAngle (thePoint);
|
||||
myFirstShape = theFirstFace;
|
||||
mySecondShape = theSecondFace;
|
||||
myThirdShape = TopoDS_Shape();
|
||||
myGeometryType = GeometryType_Faces;
|
||||
myIsGeometryValid = InitTwoFacesAngle (thePoint);
|
||||
|
||||
if (myIsValid && !myIsPlaneCustom)
|
||||
if (myIsGeometryValid && !myIsPlaneCustom)
|
||||
{
|
||||
ComputePlane();
|
||||
}
|
||||
|
||||
myIsValid &= CheckPlane (myPlane);
|
||||
|
||||
SetToUpdate();
|
||||
}
|
||||
|
||||
@@ -300,7 +289,7 @@ void AIS_AngleDimension::Init()
|
||||
//=======================================================================
|
||||
gp_Pnt AIS_AngleDimension::GetCenterOnArc (const gp_Pnt& theFirstAttach,
|
||||
const gp_Pnt& theSecondAttach,
|
||||
const gp_Pnt& theCenter)
|
||||
const gp_Pnt& theCenter) const
|
||||
{
|
||||
// construct plane where the circle and the arc are located
|
||||
gce_MakePln aConstructPlane (theFirstAttach, theSecondAttach, theCenter);
|
||||
@@ -517,7 +506,7 @@ Standard_Boolean AIS_AngleDimension::CheckPlane (const gp_Pln& thePlane)const
|
||||
//=======================================================================
|
||||
void AIS_AngleDimension::ComputePlane()
|
||||
{
|
||||
if (!IsValid())
|
||||
if (!myIsGeometryValid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -583,7 +572,7 @@ Standard_Real AIS_AngleDimension::ComputeValue() const
|
||||
|
||||
Standard_Real anAngle = aVec2.AngleWithRef (aVec1, GetPlane().Axis().Direction());
|
||||
|
||||
return anAngle > 0.0 ? anAngle : (2.0 * M_PI - anAngle);
|
||||
return anAngle > 0.0 ? anAngle : (2.0 * M_PI + anAngle);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -619,31 +608,23 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
||||
aLabelWidth += aDimensionAspect->TextAspect()->Height() * THE_3D_TEXT_MARGIN * 2.0;
|
||||
}
|
||||
|
||||
gp_Pnt aFirstAttach = myCenterPoint.Translated (gp_Vec(myCenterPoint, myFirstPoint).Normalized() * GetFlyout());
|
||||
gp_Pnt aSecondAttach = myCenterPoint.Translated (gp_Vec(myCenterPoint, mySecondPoint).Normalized() * GetFlyout());
|
||||
// Get parameters from aspect or adjust it according with custom text position
|
||||
Standard_Real anExtensionSize = aDimensionAspect->ExtensionSize();
|
||||
Prs3d_DimensionTextHorizontalPosition aHorisontalTextPos = aDimensionAspect->TextHorizontalPosition();
|
||||
|
||||
if (IsTextPositionCustom())
|
||||
{
|
||||
AdjustParameters (myFixedTextPosition,anExtensionSize, aHorisontalTextPos, myFlyout);
|
||||
}
|
||||
|
||||
// Handle user-defined and automatic arrow placement
|
||||
bool isArrowsExternal = false;
|
||||
switch (aDimensionAspect->ArrowOrientation())
|
||||
{
|
||||
case Prs3d_DAO_External: isArrowsExternal = true; break;
|
||||
case Prs3d_DAO_Internal: isArrowsExternal = false; break;
|
||||
case Prs3d_DAO_Fit:
|
||||
{
|
||||
gp_Vec anAttachVector (aFirstAttach, aSecondAttach);
|
||||
Standard_Real aDimensionWidth = anAttachVector.Magnitude();
|
||||
Standard_Boolean isArrowsExternal = Standard_False;
|
||||
Standard_Integer aLabelPosition = LabelPosition_None;
|
||||
|
||||
// add margin to ensure a small tail between text and arrow
|
||||
Standard_Real anArrowMargin = aDimensionAspect->IsText3d()
|
||||
? aDimensionAspect->TextAspect()->Height() * THE_3D_TEXT_MARGIN
|
||||
: 0.0;
|
||||
FitTextAlignment (aHorisontalTextPos, aLabelPosition, isArrowsExternal);
|
||||
|
||||
Standard_Real anArrowsWidth = (anArrowLength + anArrowMargin) * 2.0;
|
||||
|
||||
isArrowsExternal = aDimensionWidth < aLabelWidth + anArrowsWidth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
gp_Pnt aFirstAttach = myCenterPoint.Translated (gp_Vec(myCenterPoint, myFirstPoint).Normalized() * GetFlyout());
|
||||
gp_Pnt aSecondAttach = myCenterPoint.Translated (gp_Vec(myCenterPoint, mySecondPoint).Normalized() * GetFlyout());
|
||||
|
||||
//Arrows positions and directions
|
||||
gp_Vec aWPDir = gp_Vec (GetPlane().Axis().Direction());
|
||||
@@ -670,38 +651,9 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
||||
aFirstArrowEnd = aFirstAttach.Translated (-aFirstArrowVec);
|
||||
aSecondArrowEnd = aSecondAttach.Translated (-aSecondArrowVec);
|
||||
|
||||
Standard_Integer aLabelPosition = LabelPosition_None;
|
||||
|
||||
// Handle user-defined and automatic text placement
|
||||
switch (aDimensionAspect->TextHorizontalPosition())
|
||||
{
|
||||
case Prs3d_DTHP_Left : aLabelPosition |= LabelPosition_Left; break;
|
||||
case Prs3d_DTHP_Right : aLabelPosition |= LabelPosition_Right; break;
|
||||
case Prs3d_DTHP_Center: aLabelPosition |= LabelPosition_HCenter; break;
|
||||
case Prs3d_DTHP_Fit:
|
||||
{
|
||||
gp_Vec anAttachVector (aFirstAttach, aSecondAttach);
|
||||
Standard_Real aDimensionWidth = anAttachVector.Magnitude();
|
||||
Standard_Real anArrowsWidth = anArrowLength * 2.0;
|
||||
Standard_Real aContentWidth = isArrowsExternal ? aLabelWidth : aLabelWidth + anArrowsWidth;
|
||||
|
||||
aLabelPosition |= aDimensionWidth < aContentWidth ? LabelPosition_Left : LabelPosition_HCenter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (aDimensionAspect->TextVerticalPosition())
|
||||
{
|
||||
case Prs3d_DTVP_Above : aLabelPosition |= LabelPosition_Above; break;
|
||||
case Prs3d_DTVP_Below : aLabelPosition |= LabelPosition_Below; break;
|
||||
case Prs3d_DTVP_Center : aLabelPosition |= LabelPosition_VCenter; break;
|
||||
}
|
||||
|
||||
// Group1: stenciling text and the angle dimension arc
|
||||
Prs3d_Root::NewGroup (thePresentation);
|
||||
|
||||
Standard_Real anExtensionSize = aDimensionAspect->ExtensionSize();
|
||||
|
||||
Standard_Integer aHPosition = aLabelPosition & LabelPosition_HMask;
|
||||
|
||||
// draw text label
|
||||
@@ -729,7 +681,8 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
||||
if (theMode == ComputeMode_All || theMode == ComputeMode_Text)
|
||||
{
|
||||
gp_Vec aDimensionDir (aFirstAttach, aSecondAttach);
|
||||
gp_Pnt aTextPos = GetCenterOnArc (aFirstAttach, aSecondAttach, myCenterPoint);
|
||||
gp_Pnt aTextPos = IsTextPositionCustom() ? myFixedTextPosition
|
||||
: GetCenterOnArc (aFirstAttach, aSecondAttach, myCenterPoint);
|
||||
gp_Dir aTextDir = aDimensionDir;
|
||||
|
||||
DrawText (thePresentation,
|
||||
@@ -807,7 +760,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
||||
if (aHPosition != LabelPosition_Left)
|
||||
{
|
||||
DrawExtension (thePresentation,
|
||||
anExtensionSize,
|
||||
aDimensionAspect->ArrowTailSize(),
|
||||
aFirstArrowEnd,
|
||||
aFirstExtensionDir,
|
||||
THE_EMPTY_LABEL_STRING,
|
||||
@@ -819,7 +772,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
||||
if (aHPosition != LabelPosition_Right)
|
||||
{
|
||||
DrawExtension (thePresentation,
|
||||
anExtensionSize,
|
||||
aDimensionAspect->ArrowTailSize(),
|
||||
aSecondArrowEnd,
|
||||
aSecondExtensionDir,
|
||||
THE_EMPTY_LABEL_STRING,
|
||||
@@ -845,7 +798,7 @@ void AIS_AngleDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /*
|
||||
Prs3d_Root::CurrentGroup (thePresentation)->AddPrimitiveArray (aPrimSegments);
|
||||
}
|
||||
|
||||
myIsComputed = Standard_True;
|
||||
mySelectionGeom.IsComputed = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1184,3 +1137,269 @@ Standard_Boolean AIS_AngleDimension::IsValidPoints (const gp_Pnt& theFirstPoint,
|
||||
&& gp_Vec (theCenterPoint, theFirstPoint).Angle (
|
||||
gp_Vec (theCenterPoint, theSecondPoint)) > Precision::Angular();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetTextPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const gp_Pnt AIS_AngleDimension::GetTextPosition() const
|
||||
{
|
||||
if (!IsValid())
|
||||
{
|
||||
return gp::Origin();
|
||||
}
|
||||
|
||||
if (IsTextPositionCustom())
|
||||
{
|
||||
return myFixedTextPosition;
|
||||
}
|
||||
|
||||
// Counts text position according to the dimension parameters
|
||||
gp_Pnt aTextPosition (gp::Origin());
|
||||
|
||||
Handle(Prs3d_DimensionAspect) aDimensionAspect = myDrawer->DimensionAspect();
|
||||
|
||||
// Prepare label string and compute its geometrical width
|
||||
Standard_Real aLabelWidth;
|
||||
TCollection_ExtendedString aLabelString = GetValueString (aLabelWidth);
|
||||
|
||||
gp_Pnt aFirstAttach = myCenterPoint.Translated (gp_Vec(myCenterPoint, myFirstPoint).Normalized() * GetFlyout());
|
||||
gp_Pnt aSecondAttach = myCenterPoint.Translated (gp_Vec(myCenterPoint, mySecondPoint).Normalized() * GetFlyout());
|
||||
|
||||
// Handle user-defined and automatic arrow placement
|
||||
Standard_Boolean isArrowsExternal = Standard_False;
|
||||
Standard_Integer aLabelPosition = LabelPosition_None;
|
||||
FitTextAlignment (aDimensionAspect->TextHorizontalPosition(),
|
||||
aLabelPosition, isArrowsExternal);
|
||||
|
||||
// Get text position
|
||||
switch (aLabelPosition & LabelPosition_HMask)
|
||||
{
|
||||
case LabelPosition_HCenter:
|
||||
{
|
||||
aTextPosition = GetCenterOnArc (aFirstAttach, aSecondAttach, myCenterPoint);
|
||||
}
|
||||
break;
|
||||
case LabelPosition_Left:
|
||||
{
|
||||
gp_Dir aPlaneNormal = gp_Vec (aFirstAttach, aSecondAttach) ^ gp_Vec (myCenterPoint, aFirstAttach);
|
||||
gp_Dir anExtensionDir = aPlaneNormal ^ gp_Vec (myCenterPoint, aFirstAttach);
|
||||
Standard_Real anExtensionSize = aDimensionAspect->ExtensionSize();
|
||||
Standard_Real anOffset = isArrowsExternal
|
||||
? anExtensionSize + aDimensionAspect->ArrowAspect()->Length()
|
||||
: anExtensionSize;
|
||||
gp_Vec anExtensionVec = gp_Vec (anExtensionDir) * -anOffset;
|
||||
aTextPosition = aFirstAttach.Translated (anExtensionVec);
|
||||
}
|
||||
break;
|
||||
case LabelPosition_Right:
|
||||
{
|
||||
gp_Dir aPlaneNormal = gp_Vec (aFirstAttach, aSecondAttach) ^ gp_Vec (myCenterPoint, aFirstAttach);
|
||||
gp_Dir anExtensionDir = aPlaneNormal ^ gp_Vec (myCenterPoint, aSecondAttach);
|
||||
Standard_Real anExtensionSize = aDimensionAspect->ExtensionSize();
|
||||
Standard_Real anOffset = isArrowsExternal
|
||||
? anExtensionSize + aDimensionAspect->ArrowAspect()->Length()
|
||||
: anExtensionSize;
|
||||
gp_Vec anExtensionVec = gp_Vec (anExtensionDir) * anOffset;
|
||||
aTextPosition = aSecondAttach.Translated (anExtensionVec);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return aTextPosition;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTextPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_AngleDimension::SetTextPosition (const gp_Pnt& theTextPos)
|
||||
{
|
||||
if (!IsValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// The text position point for angle dimension should belong to the working plane.
|
||||
if (!GetPlane().Contains (theTextPos, Precision::Confusion()))
|
||||
{
|
||||
Standard_ProgramError::Raise ("The text position point for angle dimension doesn't belong to the working plane.");
|
||||
}
|
||||
|
||||
myIsTextPositionFixed = Standard_True;
|
||||
myFixedTextPosition = theTextPos;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AdjustParameters
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_AngleDimension::AdjustParameters (const gp_Pnt& theTextPos,
|
||||
Standard_Real& theExtensionSize,
|
||||
Prs3d_DimensionTextHorizontalPosition& theAlignment,
|
||||
Standard_Real& theFlyout) const
|
||||
{
|
||||
Handle(Prs3d_DimensionAspect) aDimensionAspect = myDrawer->DimensionAspect();
|
||||
Standard_Real anArrowLength = aDimensionAspect->ArrowAspect()->Length();
|
||||
|
||||
// Compute flyout direction vector.
|
||||
gp_Dir aPlaneNormal = GetPlane().Axis().Direction();
|
||||
gp_Dir aTargetPointsDir = gce_MakeDir (myFirstPoint, mySecondPoint);
|
||||
|
||||
// Build circle with radius that is equal to distance from text position to the center point.
|
||||
Standard_Real aRadius = gp_Vec (myCenterPoint, theTextPos).Magnitude();
|
||||
|
||||
// Set attach points in positive direction of the flyout.
|
||||
gp_Pnt aFirstAttach = myCenterPoint.Translated (gp_Vec (myCenterPoint, myFirstPoint).Normalized() * aRadius);
|
||||
gp_Pnt aSecondAttach = myCenterPoint.Translated (gp_Vec (myCenterPoint, mySecondPoint).Normalized() * aRadius);
|
||||
|
||||
gce_MakeCirc aConstructCircle (myCenterPoint, GetPlane(), aRadius);
|
||||
if (!aConstructCircle.IsDone())
|
||||
{
|
||||
return;
|
||||
}
|
||||
gp_Circ aCircle = aConstructCircle.Value();
|
||||
|
||||
// Default values
|
||||
theExtensionSize = aDimensionAspect->ArrowAspect()->Length();
|
||||
theAlignment = Prs3d_DTHP_Center;
|
||||
|
||||
Standard_Real aParamBeg = ElCLib::Parameter (aCircle, aFirstAttach);
|
||||
Standard_Real aParamEnd = ElCLib::Parameter (aCircle, aSecondAttach);
|
||||
if (aParamEnd < aParamBeg)
|
||||
{
|
||||
Standard_Real aParam = aParamEnd;
|
||||
aParamEnd = aParamBeg;
|
||||
aParamBeg = aParam;
|
||||
}
|
||||
|
||||
ElCLib::AdjustPeriodic (0.0, M_PI * 2, Precision::PConfusion(), aParamBeg, aParamEnd);
|
||||
Standard_Real aTextPar = ElCLib::Parameter (aCircle , theTextPos);
|
||||
|
||||
// Horizontal center
|
||||
if (aTextPar > aParamBeg && aTextPar < aParamEnd)
|
||||
{
|
||||
theFlyout = aRadius;
|
||||
return;
|
||||
}
|
||||
|
||||
aParamBeg += M_PI;
|
||||
aParamEnd += M_PI;
|
||||
ElCLib::AdjustPeriodic (0.0, M_PI * 2, Precision::PConfusion(), aParamBeg, aParamEnd);
|
||||
|
||||
if (aTextPar > aParamBeg && aTextPar < aParamEnd)
|
||||
{
|
||||
theFlyout = -aRadius;
|
||||
return;
|
||||
}
|
||||
|
||||
// Text on the extensions
|
||||
gp_Lin aFirstLine = gce_MakeLin (myCenterPoint, myFirstPoint);
|
||||
gp_Lin aSecondLine = gce_MakeLin (myCenterPoint, mySecondPoint);
|
||||
gp_Pnt aFirstTextProj = AIS::Nearest (aFirstLine, theTextPos);
|
||||
gp_Pnt aSecondTextProj = AIS::Nearest (aSecondLine, theTextPos);
|
||||
Standard_Real aFirstDist = aFirstTextProj.Distance (theTextPos);
|
||||
Standard_Real aSecondDist = aSecondTextProj.Distance (theTextPos);
|
||||
|
||||
if (aFirstDist <= aSecondDist)
|
||||
{
|
||||
aRadius = myCenterPoint.Distance (aFirstTextProj);
|
||||
Standard_Real aNewExtensionSize = aFirstDist - anArrowLength;
|
||||
theExtensionSize = aNewExtensionSize < 0.0 ? 0.0 : aNewExtensionSize;
|
||||
|
||||
theAlignment = Prs3d_DTHP_Left;
|
||||
|
||||
gp_Vec aPosFlyoutDir = gp_Vec (myCenterPoint, myFirstPoint).Normalized().Scaled (aRadius);
|
||||
|
||||
theFlyout = aFirstTextProj.Distance (myCenterPoint.Translated (aPosFlyoutDir)) > Precision::Confusion()
|
||||
? -aRadius : aRadius;
|
||||
}
|
||||
else
|
||||
{
|
||||
aRadius = myCenterPoint.Distance (aSecondTextProj);
|
||||
|
||||
Standard_Real aNewExtensionSize = aSecondDist - anArrowLength;
|
||||
|
||||
theExtensionSize = aNewExtensionSize < 0.0 ? 0.0 : aNewExtensionSize;
|
||||
|
||||
theAlignment = Prs3d_DTHP_Right;
|
||||
|
||||
gp_Vec aPosFlyoutDir = gp_Vec (myCenterPoint, mySecondPoint).Normalized().Scaled (aRadius);
|
||||
|
||||
theFlyout = aSecondTextProj.Distance (myCenterPoint.Translated (aPosFlyoutDir)) > Precision::Confusion()
|
||||
? -aRadius : aRadius;
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FitTextAlignment
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_AngleDimension::FitTextAlignment (const Prs3d_DimensionTextHorizontalPosition& theHorizontalTextPos,
|
||||
Standard_Integer& theLabelPosition,
|
||||
Standard_Boolean& theIsArrowsExternal) const
|
||||
{
|
||||
Handle(Prs3d_DimensionAspect) aDimensionAspect = myDrawer->DimensionAspect();
|
||||
|
||||
Quantity_Length anArrowLength = aDimensionAspect->ArrowAspect()->Length();
|
||||
|
||||
// Prepare label string and compute its geometrical width
|
||||
Standard_Real aLabelWidth;
|
||||
TCollection_ExtendedString aLabelString = GetValueString (aLabelWidth);
|
||||
|
||||
// add margins to label width
|
||||
if (aDimensionAspect->IsText3d())
|
||||
{
|
||||
aLabelWidth += aDimensionAspect->TextAspect()->Height() * THE_3D_TEXT_MARGIN * 2.0;
|
||||
}
|
||||
|
||||
gp_Pnt aFirstAttach = myCenterPoint.Translated (gp_Vec (myCenterPoint, myFirstPoint).Normalized() * GetFlyout());
|
||||
gp_Pnt aSecondAttach = myCenterPoint.Translated (gp_Vec (myCenterPoint, mySecondPoint).Normalized() * GetFlyout());
|
||||
|
||||
// Handle user-defined and automatic arrow placement
|
||||
switch (aDimensionAspect->ArrowOrientation())
|
||||
{
|
||||
case Prs3d_DAO_External: theIsArrowsExternal = true; break;
|
||||
case Prs3d_DAO_Internal: theIsArrowsExternal = false; break;
|
||||
case Prs3d_DAO_Fit:
|
||||
{
|
||||
gp_Vec anAttachVector (aFirstAttach, aSecondAttach);
|
||||
Standard_Real aDimensionWidth = anAttachVector.Magnitude();
|
||||
|
||||
// Add margin to ensure a small tail between text and arrow
|
||||
Standard_Real anArrowMargin = aDimensionAspect->IsText3d()
|
||||
? aDimensionAspect->TextAspect()->Height() * THE_3D_TEXT_MARGIN
|
||||
: 0.0;
|
||||
|
||||
Standard_Real anArrowsWidth = (anArrowLength + anArrowMargin) * 2.0;
|
||||
|
||||
theIsArrowsExternal = aDimensionWidth < aLabelWidth + anArrowsWidth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle user-defined and automatic text placement
|
||||
switch (theHorizontalTextPos)
|
||||
{
|
||||
case Prs3d_DTHP_Left : theLabelPosition |= LabelPosition_Left; break;
|
||||
case Prs3d_DTHP_Right : theLabelPosition |= LabelPosition_Right; break;
|
||||
case Prs3d_DTHP_Center: theLabelPosition |= LabelPosition_HCenter; break;
|
||||
case Prs3d_DTHP_Fit:
|
||||
{
|
||||
gp_Vec anAttachVector (aFirstAttach, aSecondAttach);
|
||||
Standard_Real aDimensionWidth = anAttachVector.Magnitude();
|
||||
Standard_Real anArrowsWidth = anArrowLength * 2.0;
|
||||
Standard_Real aContentWidth = theIsArrowsExternal ? aLabelWidth : aLabelWidth + anArrowsWidth;
|
||||
|
||||
theLabelPosition |= aDimensionWidth < aContentWidth ? LabelPosition_Left : LabelPosition_HCenter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (aDimensionAspect->TextVerticalPosition())
|
||||
{
|
||||
case Prs3d_DTVP_Above : theLabelPosition |= LabelPosition_Above; break;
|
||||
case Prs3d_DTVP_Below : theLabelPosition |= LabelPosition_Below; break;
|
||||
case Prs3d_DTVP_Center : theLabelPosition |= LabelPosition_VCenter; break;
|
||||
}
|
||||
}
|
||||
|
@@ -3,8 +3,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
@@ -47,8 +47,8 @@ DEFINE_STANDARD_HANDLE (AIS_AngleDimension, AIS_Dimension)
|
||||
//! as through three defined points can be built only one plane.
|
||||
//! Therefore, if user-defined plane differs from this one, the dimension can't be built.
|
||||
//!
|
||||
//! In cases of two planes automatical plane by default is built on point of the
|
||||
//! origin of parametrical space of the first face (the basis surface) so, that
|
||||
//! In cases of two planes automatic plane by default is built on point of the
|
||||
//! origin of parametric space of the first face (the basis surface) so, that
|
||||
//! the working plane and two faces intersection forms minimal angle between the faces.
|
||||
//! User can define the other point which the dimension plane should pass through
|
||||
//! using the appropriate constructor. This point can lay on the one of the faces or not.
|
||||
@@ -188,15 +188,25 @@ public:
|
||||
const gp_Pnt& thePoint);
|
||||
|
||||
//! @return the display units string.
|
||||
Standard_EXPORT virtual const TCollection_AsciiString& GetDisplayUnits () const;
|
||||
Standard_EXPORT virtual const TCollection_AsciiString& GetDisplayUnits() const;
|
||||
|
||||
//! @return the model units string.
|
||||
Standard_EXPORT virtual const TCollection_AsciiString& GetModelUnits () const;
|
||||
Standard_EXPORT virtual const TCollection_AsciiString& GetModelUnits() const;
|
||||
|
||||
Standard_EXPORT virtual void SetDisplayUnits (const TCollection_AsciiString& theUnits);
|
||||
|
||||
Standard_EXPORT virtual void SetModelUnits (const TCollection_AsciiString& theUnits);
|
||||
|
||||
//! Principle of horizontal text alignment settings:
|
||||
//! - divide circle into two halves according to attachment points
|
||||
//! - if aTextPos is between attach points -> Center + positive flyout
|
||||
//! - if aTextPos is not between attach points but in this half -> Left or Right + positive flyout
|
||||
//! - if aTextPos is between reflections of attach points -> Center + negative flyout
|
||||
//! - if aTextPos is not between reflections of attach points -> Left or Right + negative flyout
|
||||
Standard_EXPORT virtual void SetTextPosition (const gp_Pnt& theTextPos);
|
||||
|
||||
Standard_EXPORT virtual const gp_Pnt GetTextPosition () const;
|
||||
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_RTTI (AIS_AngleDimension)
|
||||
@@ -212,7 +222,7 @@ protected:
|
||||
//! @return the center of the dimension arc (the main dimension line in case of angle).
|
||||
Standard_EXPORT gp_Pnt GetCenterOnArc (const gp_Pnt& theFirstAttach,
|
||||
const gp_Pnt& theSecondAttach,
|
||||
const gp_Pnt& theCenter);
|
||||
const gp_Pnt& theCenter) const;
|
||||
|
||||
//! Draws main dimension line (arc).
|
||||
//! @param thePresentation [in] the dimension presentation.
|
||||
@@ -247,6 +257,30 @@ protected:
|
||||
const Standard_Integer theMode,
|
||||
const Standard_Integer theLabelPosition);
|
||||
|
||||
//! Fits text alignment relatively to the dimension line;
|
||||
//! it computes the value of label position and arrow orientation
|
||||
//! according set in the aspect and dimension properties.
|
||||
//! @param theHorizontalTextPos [in] the horizontal alignment for text position.
|
||||
//! @param theLabelPosition [out] the label position, contains bits that defines
|
||||
//! vertical and horizontal alignment. (for internal usage in count text position).
|
||||
//! @param theIsArrowExternal [out] is the arrows external,
|
||||
//! if arrow orientation in the dimension aspect is Prs3d_DAO_Fit, it fits arrow
|
||||
//! orientation automatically.
|
||||
Standard_EXPORT void FitTextAlignment (const Prs3d_DimensionTextHorizontalPosition& theHorizontalTextPos,
|
||||
Standard_Integer& theLabelPosition,
|
||||
Standard_Boolean& theIsArrowsExternal) const;
|
||||
|
||||
//! Adjusts aspect parameters according the text position:
|
||||
//! extension size, vertical text alignment and flyout.
|
||||
//! @param theTextPos [in] the user defined 3d point of text position.
|
||||
//! @param theExtensionSize [out] the adjusted extension size.
|
||||
//! @param theAlignment [out] the horizontal label alignment.
|
||||
//! @param theFlyout [out] the adjusted value of flyout.
|
||||
Standard_EXPORT void AdjustParameters (const gp_Pnt& theTextPos,
|
||||
Standard_Real& theExtensionSize,
|
||||
Prs3d_DimensionTextHorizontalPosition& theAlignment,
|
||||
Standard_Real& theFlyout) const;
|
||||
|
||||
protected:
|
||||
|
||||
Standard_EXPORT virtual void ComputePlane();
|
||||
|
@@ -5,8 +5,8 @@
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and / or modify it
|
||||
-- under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and / or modify it
|
||||
-- under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and / or modify it
|
||||
-- under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and / or modify it
|
||||
-- under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and / or modify it
|
||||
-- under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and / or modify it
|
||||
-- under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
|
@@ -5,8 +5,8 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
|